/* Business Rules Editor | CodeEffects.com | 5.1.18.4 */ window || (this.window = this); window.CodeEffects || (window.CodeEffects = { typeName: "CodeEffects", getName: function () { return "CodeEffects" }, __namespace: !0 }); CodeEffects.register || (CodeEffects.register = function (k) { var p = window; k = k.split("."); for (var d = 0; d < k.length; d++){ var n = k[d], m = p[n]; m || (m = p[n] = { typeName: k.slice(0, d + 1).join("."), __namespace: !0 }, m.getName = function () { return this.typeName }); p = m } }); CodeEffects.register("CodeEffects.Rule.Client"); CodeEffects.register("CodeEffects.Rule.Models"); CodeEffects.register("CodeEffects.Rule.Menu"); CodeEffects.register("CodeEffects.Rule.Calendar");CodeEffects.register("CodeEffects.Rule.Time");CodeEffects.register("CodeEffects.Rule.TextBox");CodeEffects.register("CodeEffects.Rule.Common");var $rule=CodeEffects.Rule;$rule.Models.RuleModel=function(){};$rule.Models.OperatorType={String:0,Numeric:1,Date:2,Time:3,Bool:4,Enum:6,Collection:8,None:16};$rule.Common.ValueInputType={Fields:0,User:2,All:4};$rule.Client.Element=function(){};$rule.Client.FunctionType={Name:0,Param:1,Comma:2,End:3,None:4}; $rule.Client.InputType={Field:0,Input:1,None:2};$rule.Client.CalculationType={Field:0,LeftParenthesis:1,RightParenthesis:2,Multiplication:3,Division:4,Addition:6,Subtraction:7,Number:8,None:9,Function:10};$rule.Client.CollectionType={Value:0,Reference:2,Generic:4,None:8};$rule.Client.SelectionType={Exists:0,DoesNotExist:1,None:2}; $rule.Client.ElementType={Flow:0,Field:1,Function:2,Operator:3,Value:4,Clause:6,Action:7,LeftParenthesis:8,RightParenthesis:9,LeftBracket:10,RightBracket:11,Calculation:12,Tab:13,NewLine:15,HtmlTag:16,Setter:17,LeftSource:18,RightSource:19,Where:20,Exists:22};$rule.Client.type={IE:0,Chrome:1,Firefox:2,Opera:3,Other:4};$rule.Client.browser=null;$rule.Client.version=Object.hasOwnProperty.call(window,"ActiveXObject")&&!window.ActiveXObject?11:0; 11==$rule.Client.version||navigator.appName&&-1$rule.Client.version)throw Error("Your browser is not supported by Code Effects rules engine (CE482)");$rule.defined=function(k){return null!=k&&"undefined"!=typeof k&&"NaN"!=String(k)}; $rule.isNumeric=function(k){return!isNaN(parseFloat(k))&&isFinite(k)};$rule.isInteger=function(k){return $rule.isNumeric(k)&&0===k%1};$rule.text=function(k,p){if(!k.tagName)return null;if($rule.defined(p))$rule.defined(document.getElementsByTagName("BODY")[0].innerText)?k.innerText=p.toString():k.textContent=p.toString();else return $rule.defined(document.getElementsByTagName("BODY")[0].innerText)?k.innerText:k.textContent}; $rule.trim=function(k){return $rule.defined(k)&&0!==k.length?k.replace(/^\s+|\s+$/g,""):k};$rule.encode=function(k){return!$rule.defined(k)||1>k.length?k:String(k).replace(/&/g,"&").replace(/ /g," ").replace(/"/g,""").replace(//g,">").replace(/\\/g,"\").replace(/'/g,"'")}; $rule.decode=function(k,p){if(!$rule.defined(k)||4>k.length)return k;var d=k;p||(d=String(d).replace(/\/g,"\\").replace(/"/g,'"'));return String(d).replace(/'/g,"'").replace(/>/g,">").replace(/</g,"<").replace(/ /g," ").replace(/&/g,"&")};$rule.highlight=function(k){k.style.backgroundColor="#ffff91"};$rule.dim=function(k){k.style.backgroundColor=""}; $rule.getElementWidth=function(k){return k.offsetWidth&&0d.y-v+d.height+n.height?d.y+d.height+"px":m.height-n.height+v-4+"px";p.style.left=m.width>d.x-u+d.width+n.width?d.x+d.width+6+"px":m.width-n.width+u-4+"px"}; $rule.leftAlign=function(k,p){var d=$rule.getBounds(k),n=$rule.getBounds(p),m=$rule.getWindowDimensions(),v=$rule.getScrollWidth();p.style.left=m.width>d.x-v+d.width+n.width?d.x+"px":m.width-n.width+v-4+"px"};$rule.getType=function(k){if(!$rule.defined(k.constructor))throw Error("CL1");k=String(k.constructor).match(/function\s+(\w+)/);return $rule.defined(k)?k[1]:"undefined"};$rule.getDocument=function(k){k=k.ownerDocument||k.document||k;return k.defaultView||k.parentWindow}; $rule.getStyle=function(k){if(3===k.nodeType)return null;var p=$rule.getDocument(k);k.documentElement&&(k=k.documentElement);var d=p&&k!==p&&p.getComputedStyle?p.getComputedStyle(k,null):k.currentStyle||k.style;if(!d&&$rule.Client.browser==$rule.Client.type.Chrome&&k.style){d=k.style.display;var n=k.style.position;k.style.position="absolute";k.style.display="block";p=p.getComputedStyle(k,null);k.style.display=d;k.style.position=n;d={};if(p)for(k=0;kp&&(p=n.style.zIndex+1),0q?"0"+q:q.toString()}function n(q,w){for(var c=0,F=!1,V=0,M=q.length;Vq?"00"+q:100>q?"0"+q:q.toString()}if(!p||0===p.length||"i"===p)return k.toString();p=function(q){$rule.defined(q)||(q="d");if(1==q.length)switch(q){case "F":return"dddd, MMMM dd, yyyy h:mm:ss tt";case "s":return"yyyy'-'MM'-'dd'T'HH':'mm':'ss"; case "Y":case "y":return"MMMM, yyyy";case "M":case "m":return"MMMM dd";case "d":return"M/d/yyyy";case "D":return"dddd, MMMM dd, yyyy";case "t":return"h:mm tt";case "T":return"h:mm:ss tt";default:throw Error("CL61");}return q}(p);for(var v=new $rule.StringBuilder,u,O=0,H=/dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z/g;;){var N=H.lastIndex;u=H.exec(p);N=p.slice(N,u?u.index:p.length);N=n(N,v);O+=N;if(!u)break;if(1===O%2)v.append(u[0]);else switch(u[0]){case "MMMM":v.append($rule.monthNames[k.getMonth()]); break;case "MMM":v.append($rule.abbrMonthNames[k.getMonth()]);break;case "MM":v.append(d(k.getMonth()+1));break;case "M":v.append(k.getMonth()+1);break;case "dddd":v.append($rule.dayNames[k.getDay()]);break;case "ddd":v.append($rule.abbrDayNames[k.getDay()]);break;case "dd":v.append(d(k.getDate()));break;case "d":v.append(k.getDate());break;case "yyyy":v.append(k.getFullYear());break;case "yy":v.append(d(k.getFullYear()%100));break;case "y":v.append(k.getFullYear()%100);break;case "hh":u=k.getHours()% 12;0===u&&(u=12);v.append(d(u));break;case "h":u=k.getHours()%12;0===u&&(u=12);v.append(u);break;case "HH":v.append(d(k.getHours()));break;case "H":v.append(k.getHours());break;case "mm":v.append(d(k.getMinutes()));break;case "m":v.append(k.getMinutes());break;case "ss":v.append(d(k.getSeconds()));break;case "s":v.append(k.getSeconds());break;case "tt":v.append(12>k.getHours()?"AM":"PM");break;case "t":v.append(12>k.getHours()?"A":"P");break;case "f":v.append(m(k.getMilliseconds()).charAt(0));break; case "ff":v.append(m(k.getMilliseconds()).substr(0,2));break;case "fff":v.append(m(k.getMilliseconds()));break;case "z":u=k.getTimezoneOffset()/60;v.append((0>=u?"+":"-")+Math.floor(Math.abs(u)));break;case "zz":u=k.getTimezoneOffset()/60;v.append((0>=u?"+":"-")+d(Math.floor(Math.abs(u))));break;case "zzz":u=k.getTimezoneOffset()/60,v.append((0>=u?"+":"-")+d(Math.floor(Math.abs(u)))+":"+d(Math.abs(k.getTimezoneOffset()%60)))}}return v.dump()}; Function.addDelegate=function(k,p){return function(){return p.apply(k,arguments)}}; $rule.Event=function(k){k=k||window.event;var p=this.type=k.type.toLowerCase();this.rawEvent=k;"keypress"==p&&(this.charCode=k.charCode||k.keyCode);k.keyCode?this.keyCode=46==k.keyCode&&"keypress"!=p?127:k.keyCode:k.charCode?this.keyCode=k.charCode:"undefined"!=typeof k.which&&(this.keyCode=k.which);this.offsetY=k.pageY?k.pageY:k.clientY+document.body.scrollTop-document.body.clientTop;this.target=k.target?k.target:k.srcElement;this.ctrlKey=k.ctrlKey;this.metaKey=k.metaKey||!1;this.altKey=k.altKey; this.shiftKey=k.shiftKey;this.changedTouches=k.changedTouches||null};$rule.Event.prototype={preventDefault:function(){this.rawEvent.preventDefault?this.rawEvent.preventDefault():window.event&&(this.rawEvent.returnValue=!1)},stopPropagation:function(){this.rawEvent.stopPropagation?this.rawEvent.stopPropagation():window.event&&(this.rawEvent.cancelBubble=!0)}}; $rule.addHandler=function(k,p,d){k.ceEvents||(k.ceEvents={});var n=k.ceEvents[p];n||(k.ceEvents[p]=n=[]);if(k.addEventListener){var m=function(v){return d.call(k,new $rule.Event(v))};k.addEventListener(p,m,!1)}else k.attachEvent&&(m=function(){var v={};try{v=$rule.getDocument(k).event}catch(u){}return d.call(k,new $rule.Event(v))},k.attachEvent("on"+p,m));n[n.length]={handler:d,browserHandler:m}}; $rule.addHandlers=function(k,p,d){for(var n in p){var m=p[n];d&&(m=Function.addDelegate(d,m));$rule.addHandler(k,n,m)}};$rule.removeHandlers=function(k){if(k.ceEvents){var p;for(p in k.ceEvents)if(k.ceEvents.hasOwnProperty(p)){var d=k.ceEvents[p];if(d.length&&0m&&(m=0);qa&&(n.scrollTop=w[m].offsetTop);ha(w)}break;case 40:qa=w[0].clientHeight,qa=n.scrollTop+11*qa-m*qaw.length-1&&(m=w.length-1),qa&&(n.scrollTop=w[m-12+1].offsetTop),ha(w)}Y||8!=P&&9!=P&&13!=P&&32!=P&&33!=P&&34!=P&&35!=P&&36!=P&&38!=P&&40!=P||(da.preventDefault&&da.preventDefault(),da.stopPropagation&& da.stopPropagation())},R=function(da){if(q&&M(n)&&0!=w.length){var P=da.keyCode;8!=P&&9!=P&&13!=P&&32!=P&&33!=P&&34!=P&&35!=P&&36!=P&&38!=P&&40!=P||da.preventDefault();return!1}return!0},ha=function(){Db();0!=w.length&&(c(w[m]),u&&u(w[m].getAttribute("ce101")))},ua=function(da){m=parseInt(da.getAttribute("ce103"),10);Db();c(da)},va=function(da){n=document.createElement("DIV");n.id="ce107"+da.id;n.style.backgroundColor="#fff";M(k)&&(n.className=k);n.style.position="absolute";n.style.padding="2px"; n.style.overflow="auto";n.style.display="inline-block";p&&(n.style.zIndex=$rule.topZindex(document.body));document.body.appendChild(n)},Db=function(){for(var da=0;dava?"0"+va:va,va)}}var H=$rule;p=H.defined(p)?p:"hh:mm tt";var N=new H.Time.Settings(p),q=function(){if(!N.h)return 0;if(N.us){var z=parseInt(m(F),10);return"AM"==m(Y)?12==z?0:z:12==z?z:z+12}return parseInt(m(F),10)},w=function(z){var R=document.createElement("SELECT");R.id=z;R.style.width= "44px";k.appendChild(R);O(R,0,59,!0);return R},c=function(){var z=document.createElement("SPAN");z.innerHTML=":";z.style.marginLeft="2px";z.style.marginRight="2px";k.appendChild(z)},F=null,V=null,M=null,Y=null;N.h&&(F=document.createElement("SELECT"),F.id="ce113"+k.id,F.style.width="44px",k.appendChild(F),N.us?(u(F,"12",12),O(F,1,11,!1)):O(F,0,23,!0));N.h&&N.m&&c();N.m&&(V=w("ce114"+k.id));N.s&&(c(),M=w("ce115"+k.id));N.h&&N.us&&(Y=document.createElement("SELECT"),Y.id="ce116"+k.id,Y.style.width= "44px",Y.style.marginLeft="4px",k.appendChild(Y),u(Y,"AM","AM"),u(Y,"PM","PM"));(function(){var z=document.createElement("INPUT");z.id="ce112"+k.id;z.type="button";z.style.marginLeft="4px";z.value="OK";k.appendChild(z);z.onclick=function(R){R=R||window.event;R.cancelBubble=!0;d()}})();this.defaultFormat=function(){return"hh:mm tt"};this.getRawValue=function(){return new Date("1/1/2000 "+q()+":"+(N.m?v(V):"00")+":"+(N.s?v(M):"00"))};this.getValue=function(){return H.formatDate(this.getRawValue(),"HH:mm:ss")}; this.getText=function(){var z=(N.h?v(F):"00")+":"+(N.m?v(V):"00")+":"+(N.s?v(M):"00")+(N.h&&N.us?" "+v(Y):"");return H.formatDate(new Date("1/1/2000 "+z),p)};this.setValue=function(z,R,ha){if(H.defined(z)&&H.defined(R)&&H.defined(ha)&&0!=z.length&&0!=R.length&&0!=ha.length){if(N.h)if(N.us){z=parseInt(z,10);var ua=z-12;13>z?(ua=0==z?12:z,n(Y,"AM",!0)):n(Y,"PM",!0);n(F,ua,!0)}else 2>z.length?n(F,z,!0):n(F,z,!1);N.m&&(2>R.length?n(V,R,!0):n(V,R,!1));N.s&&(2>ha.length?n(M,ha,!0):n(M,ha,!1))}else N.h&& (F.selectedIndex=0),N.m&&(V.selectedIndex=0),N.s&&(M.selectedIndex=0),N.h&&N.us&&(Y.selectedIndex=0)}};$rule.TextBox.Settings=function(k,p,d,n,m,v,u,O){this.parent=k;this.id=p;this.css=d;this.defCss=n;this.max=m;this.placeholder=v;this.errVal=u;this.errColor=O}; $rule.TextBox.Control=function(){var k,p;this.init=function(d){p=d;k=document.createElement("INPUT");k.type="text";k.id=p.id;k.className=p.defCss;k.maxLength=p.max;k.placeholder=p.placeholder;p.parent.appendChild(k);k.onfocus=function(n){k.className=$rule.trim(k.className.replace(p.errColor,""));k.className=p.css;k.value.toLowerCase()==p.errVal.toLowerCase()&&(k.value="")};k.onblur=function(n){n=$rule.trim(k.value);if(0==n.length||n.toLowerCase()==p.errVal.toLowerCase())k.className=$rule.trim(k.className.replace(p.errColor, "")),k.className=p.defCss}};this.getValue=function(){return k.value};this.setValue=function(d){k.value=d};this.setClass=function(d){k.className=d}};$rule.Calendar.Css=function(){this.container="ceCal";this.header="ceHeader";this.day="ceDay";this.today="ceToday";this.selected="ceSelected";this.dayRollover="ceRollover";this.weekDays="ceDays"}; $rule.Calendar.Control=function(k,p){var d=$rule,n,m,v,u,O=!1,H=d.defined(p)?p:new d.Calendar.Css,N,q,w,c,F=new Date;var V=F.getMonth();var M=F.getFullYear();var Y=F.getHours();var z=F.getMinutes();var R=F.getSeconds();var ha=F.getDate();var ua=N=0;this.show=function(K,J,L,S,X){n=K;v=J;u=d.defined(L)?L:"MMM dd, yyyy";O=S;d.defined(X)&&(ha=X.getDate(),N=M=X.getFullYear(),ua=V=X.getMonth(),Y=X.getHours(),z=X.getMinutes(),R=X.getSeconds());P();cb();va()};this.hide=function(){d.defined(c)&&d.defined(c.parentNode)&& c.parentNode.removeChild(c)};this.position=function(){cb()};this.defaultFormat=function(){return"MMM dd, yyyy"};this.getId=function(){return d.defined(c)?c.id:null};var va=function(){var K=d.getChildrenByTagName(q.rows[0].cells[1],"SPAN",!1);K[0].innerHTML=d.abbrMonthNames[V];K[1].innerHTML=M;Db()},Db=function(){var K=new Date,J=new Date(M,V,1),L=K.getFullYear(),S=K.getMonth();K=K.getDate();J=J.getDay();var X=1,Ra=!0;var ub=1==V&&(0==M%4&&0!=M%100||0==M%400)?29:d.days[V];for(var na=1;na=J||1S;S++){J=K.insertRow(-1);for(var X=0;7>X;X++)L=J.insertCell(-1),0==S&&d.defined(H.weekDays)&&(L.className=H.weekDays),L.innerHTML=" "}for(J=0;J=E&&h(l.ps[E].mds)?(g=yb(l.ps[E].mds,l.ps[E].ftr),h(g)&&0=E&&h(l.ps[E].mds)?(g=yb(l.ps[E].mds,l.ps[E].ftr),h(g)&&0=E&&t.ps[E].o==x?t.ps[E]:nd(t,x,0>E?0:E));x=y;if(g.InpType==v.Input){t=!1;if(h(x))switch(g.Oper){case m.String:g.Max=x.max;h(r.getAttribute("ce206"))&&(g.Value=$rule.decode(r.getAttribute("ce206"),!0));t=!0;break;case m.Numeric:g.Dec=x.dec;g.Min=x.min;g.Max=x.max;break;case m.Date:case m.Time:g.Format=x.f;break;case m.Enum:g.En= x.e}!t&&h(r.getAttribute("ce206"))&&(g.Value=r.getAttribute("ce206"))}else g.Value=r.getAttribute("ce208"),t=G(A.fds,g.Value),!h(x)||x.o!=m.Numeric&&x.o!=m.String||!h(x.mds)||h(t)||(g.InpType=v.Input)}else g.Value=r.getAttribute("ce208"),x==d.Function&&(g.IsFuncValue="true"==r.getAttribute("ce216"),G(A.fds,g.Value));break;case d.Exists:case d.Where:switch(r.getAttribute("ce208")){case "ce803":g.SelType=N.DoesNotExist;break;default:g.SelType=N.Exists}x=mb(r,d.Field);h(x)?(t=G(A.fds,x.getAttribute("ce208")), h(t)?g.CollType=t.ct:g.CollType=H.Generic):g.CollType=H.Generic;g.Value=r.getAttribute("ce208");break;default:g.Value=r.getAttribute("ce208")}e.Elements.push(g)}}}return e}},Sd=function(a){a.preventDefault();a.stopPropagation();return!1},Td=function(a){a.preventDefault();a.stopPropagation();return!1},Qd=function(a){if(9==w)return!1;va=a.target;qa=P=cb=0;Ka=(new Date).getTime();a.changedTouches&&(a=a.changedTouches[0],Db=a.pageX,da=a.pageY);K=setTimeout(function(){0===cb&&(h(va)&&h(va.getAttribute("ce202"))? od({keyCode:13}):Kc({keyCode:32}));K=null},600)},Rd=function(a){h(K)&&clearTimeout(K);K=null;a.changedTouches&&(a=a.changedTouches[0],P=a.pageX-Db,qa=a.pageY-da,250>=(new Date).getTime()-Ka&&(60<=Math.abs(P)&&30>=Math.abs(qa)?cb=0>P?4:2:60<=Math.abs(qa)&&30>=Math.abs(P)&&(cb=0>qa?1:3)));switch(cb){case 2:Lc({keyCode:127});break;case 3:Kc({keyCode:32});break;case 4:Lc({keyCode:8})}},be=function(a){function b(aa){Qa(aa)?kb(aa):c=I(aa)}function e(aa){aa=Mc(c,n.End);h(aa)&&(c=I(aa),pb())}function g(aa, Va){var ia=db(c),wa=null;if(ia&&(wa=za(aa.previousSibling),D(wa)==d.Function)){var ja=Tb(wa,n.Name);if(!h(ja))return;wa=za(ja.previousSibling)}ja=[];if(ra(c)==u.Function)for(ia=fc(Va),U("ce801",m.Numeric,qb(m.Numeric),ja),wa=0;wap.Client.version?p.getScrollHeight():0,fa=0;faa.offsetY+jc){b(E[fa]);Na=!0;break}}!Na&&0r.y-parseInt(l.height/2,10)))if(h(x)||(x=E),Oa>l.x+l.width||!h(E.previousSibling)||ib(E.previousSibling).yy){lc(l.y);c=I(E);break}}else t=g[e].id==c.id;Qa(c)&&kb(c);Z(c);xa();if(a.ctrlKey||a.metaKey)l=D(c),l==d.Flow&&bb(c)&&(c=I(Ya(c.nextSibling)),Z(c)),mc(!1),Sa("i137");na=!1;break;case 40:zb(e,g,ra(c),Ua(c))&&h(c.getAttribute("ce207"))&&(Pa(),c=I(c));e=!1;if(a.ctrlKey|| a.metaKey)l=D(c),l==d.Flow&&bb(c)&&(c=I(Ya(c.nextSibling)),Z(c),e=!0),l=za(c),!Wb(c)&&D(l)==d.Flow&&bb(l)&&(c=I(Ya(c.nextSibling)),Z(c),e=!0),ha=c.id;if(!e){e=ab();l=ib(c);0==Oa&&(Oa=l.x+l.width);x=!1;for(E=e.length-1;-1g.x+g.width||!h(t)||t.y=t){c=I(r);Rc(g.y,g.height);break}}Qa(c)&&kb(c);Z(c);xa()}if(a.ctrlKey|| a.metaKey)mc(!0),Sa("i137");na=!1;break;case 37:Oa=0;na=!1;6!=w&&8!=w||Ta();if("INPUT"==c.tagName)return!1;if(h(c.previousSibling)){g=!1;e=null;if(a.ctrlKey||a.metaKey)if(r=za(c.previousSibling),l=D(r),l==d.Flow&&bb(r)){if(g=!0,h(c.nextSibling)&&(l=D(c),l==d.Tab||l==d.NewLine||l==d.HtmlTag))c=I(Ya(c.nextSibling)),Z(c)}else ha=c.id;!g&&(h(c.previousSibling)&&(l=D(c.previousSibling),c=I(l==d.HtmlTag?c.previousSibling.previousSibling:c.previousSibling),Z(c)),Qa(c)&&(T(c)==n.End?kb(c):c=I(c.previousSibling)), g=za(c),l=D(g),(a.ctrlKey||a.metaKey)&&l==d.Flow&&bb(g)?h(c.nextSibling)&&(l=Ya(c.nextSibling),c=I(l),Z(c)):Z(c),xa(),a.ctrlKey||a.metaKey)&&(mc(!1),e="i137");Sa(e)}break;case 39:Oa=0;na=!1;6!=w&&8!=w||Ta();if(!a.ctrlKey&&!a.metaKey)if(e==d.Value&&(g==m.String||g==m.Numeric)){if(h(c.getAttribute("ce207")))return!1;c=I(c);xa()}else if(e==d.Calculation&&Ua(c)==v.Input&&ra(c)==u.Number){if(h(c.getAttribute("ce207")))return!1;c=I(c);xa()}else{if(!(e!=d.Function&&e!=d.Action||Ua(c)!=v.Input||g!=m.String&& g!=m.Numeric)){if(h(c.getAttribute("ce207")))return!1;c=I(c);xa()}}else if("INPUT"==c.tagName)return!1;if(h(c.nextSibling))if(a.ctrlKey||a.metaKey||!Qa(c.nextSibling)){e=!1;if(a.ctrlKey||a.metaKey)l=D(c),l==d.Flow&&bb(c)&&(c=I(Ya(c.nextSibling)),Z(c),e=!0),l=za(c),!Wb(c)&&D(l)==d.Flow&&bb(l)&&(c=I(Ya(c.nextSibling)),Z(c),e=!0),ha=c.id;e||(c=D(c.nextSibling)==d.HtmlTag?I(c.nextSibling.nextSibling):I(c.nextSibling),Z(c));if(a.ctrlKey||a.metaKey)mc(!0),Sa("i137");else{e=D(c);l=sa();if(h(c.nextSibling)|| e!=d.RightBracket)if(e!=d.Function&&e!=d.Action||!l)e==d.Flow&&l?"else"==c.getAttribute("ce208")?B(fb(),c,gb,null):B(Ja(),c,La,d.LeftParenthesis):e!=d.LeftParenthesis&&e!=d.LeftSource||!l?e!=d.RightParenthesis&&e!=d.RightSource&&e!=d.RightBracket&&e!=d.Value||!l?e==d.Field&&l?db(c)||(e=c.getAttribute("ce208"),G(A.fds,e).ct!=H.Reference&&B(sb(G(A.fds,e)),c,nb,null)):e==d.Exists&&l?B(Tc(mb(c,d.Field).getAttribute("ce208")),c,Uc,null):e==d.Setter&&l?"set"==c.getAttribute("ce208")?B(Nb(),c,Ob,null):(hb(za(c)), ud()&&B(ta(),c,pa,null)):e==d.Operator&&l?"isNull"==c.getAttribute("ce208")||"isNotNull"==c.getAttribute("ce208")?B(ta(),c,pa,d.RightParenthesis):(hb(c,!0),ud()&&B(ta(),c,pa,d.RightParenthesis)):e==d.Clause&&l?"then"==c.getAttribute("ce208")||db(c)?B(fb(),c,gb,null):B(Ja(),c,La,d.LeftParenthesis):e!=d.LeftBracket&&e!=d.Calculation||!l||B(Wa(),c,Ia,null):B(ta(),c,pa,d.RightParenthesis):(e==d.LeftSource&&Z(c),B(Ja(),c,La,d.LeftParenthesis));else switch(T(c)){case n.End:Ub(Ca(c));break;case n.Name:e= Ca(c),0=a.ps.length-1&&!W){var e=Mc(c,n.End);h(e)&&(c=I(e),Ub(a))}else switch(b+=1,W&&--b,e=a.ps[b],a=[],F=null, e.ai){case O.All:case O.Fields:if(e.o==m.Collection){for(var g=0;gl.max||r.dec&&!l.dec||r.mds!=l.mds)continue}else if(l.o==m.Enum){if(l.e!=r.e||l.l!=r.l)continue}else if(l.l!=r.l)continue;E=h(r.ftr)?r.ftr:null;null!=x&&"any"!=x&&x!=E&&"any"!=E||b.push(r)}}g=b}if(0b&&(b=0),b=r.ps[b].ftr),Xc(a.Name,b);else switch(parseInt(b,10)){case m.Numeric:ea=!1;pc(Pb(h(c.nextSibling)?c.nextSibling:c,m.Numeric))&& (b=jb(c),b++,g(r,m.Numeric),eb({t:r.t,v:"",st:m.Numeric,ct:u.None,ft:n.Param,pi:b,span:c}));break;case m.String:ea=!1;pc(Pb(h(c.nextSibling)?c.nextSibling:c,m.String))&&(b=jb(c),b++,g(r,m.String),eb({t:r.t,v:"",st:m.String,ct:u.None,ft:n.Param,pi:b,span:c}));break;case m.Date:la.close();w=3;Da.show(c,ce,Zc(r,Da.defaultFormat()),W,l(!0));Da.position();break;case m.Time:la.close();w=4;ka.show(c,de,Zc(r,ka.defaultFormat()),W,l(!1));ka.position();break;case m.Enum:e=jb(c)+(W?0:1);0>e&&(e=0);e<=r.ps.length- 1&&(F=Ib(r.ps[e].e),ea=W);B(F,c,ee,null);break;case m.Bool:ea=W;B(Ad(),c,fe,null);break;case m.Collection:break;default:throw Error("CL62");}else"ce804"==a||"ce805"==a?(Ha="ce805"==a?"ce805":e,W=!0,B(Ja(),c,ob,null)):(b=yb(b),h(b)?(e=jb(c)+(W?0:1),0>e&&(e=0),e=r.ps[e].o,g(r,e),ca({t:r.t,id:null,v:a,n:G(b,a).Name,st:e,ct:u.None,ft:n.Param,it:v.Field,h:!1,fv:!1})):(a=G(A.fds,a),g(r,a.o),ca({t:r.t,id:null,v:a.v,n:a.n,st:a.o,ct:u.None,ft:n.Param,it:v.Field,h:!1,fv:!1})),F=null,c=I(c),sa()&&lb(r))},fe= function(a){Bd(a,m.Bool,$b(a))},ee=function(a){Bd(a,m.Enum,G(F,a).Name)},Bd=function(a,b,e){var g=Pb(W?c:c.nextSibling,b),l=!1;h(g)&&(la.close(),Fa(g),l=!0,W=!1);g=Ca(c);l||Yc(g);ca({t:g.t,id:null,v:a,n:e,st:b,ct:u.None,ft:n.Param,it:v.Input,h:!1,fv:!1});c.setAttribute("ce206",a);c=I(c);sa()&&lb(g)},ce=function(a){var b=Ca(c);Cd(a,b,m.Date,p.formatDate(new Date(a),Zc(b,Da.defaultFormat())),Da)},de=function(a,b){Cd(a,Ca(c),m.Time,b,ka)},Cd=function(a,b,e,g,l){var r=Pb(W?c:c.nextSibling,e),x=!1;h(r)&& (Fa(r),x=!0,W=!1);ca({t:b.t,id:null,v:a,n:g,st:e,ct:u.None,ft:n.Param,it:v.Input,h:!1,fv:!1});c=I(c);l.hide();w=0;if(!x)switch(a=Ya(c.nextSibling),T(a)){case n.Param:a=c;ca({t:b.t,id:null,v:"",n:",",st:b.t==d.Action?null:b.rt.o,ct:u.None,ft:n.Comma,it:v.None,h:!1,fv:!1});c=I(a);break;case n.End:case n.Comma:a=c,e=za(c.previousSibling),T(e)==n.Param&&1x){if(g=new p.Menu.Item,g.Name=q.els.lbl.pe,g.Type=d.RightParenthesis,r.push(g),a[0].t==d.Clause){g=[];for(t=0;tg?"1":"0")):(e.maxLength=h(l)?l:256,e.setAttribute("ce212",e.maxLength.toString()))}else e.maxLength=256,e.setAttribute("ce212",e.maxLength.toString());h(a.span)?D(a.span)==d.Value||D(a.span)==d.Calculation&&ra(a.span)==u.Number|| (D(a.span)==d.Function||D(a.span)==d.Action)&&Ua(a.span)==v.Input?(ub=a.span.id,a.span.style.display="none",C.container.insertBefore(e,a.span)):(ub=null,h(a.span.nextSibling)?C.container.insertBefore(e,a.span.nextSibling):C.container.appendChild(e)):h(c)&&h(c.nextSibling)?C.container.insertBefore(e,c.nextSibling):(ub=null,C.container.appendChild(e));e.setAttribute("ce202",a.t);e.setAttribute("ce209",h(a.st)?a.st:m.None);e.setAttribute("ce206",a.v);e.setAttribute("ce203",h(a.ct)?a.ct:u.None);e.setAttribute("ce204", h(a.ft)?a.ft:n.None);e.setAttribute("ce205",v.Input);e.setAttribute("ce208",a.v);Jd(e);w=0;e.value=h(a.v)?p.decode(a.v):"";0this.value.indexOf("-")&&(this.value="-"+this.value,Cb(this,109)),x.preventDefault(),!1;default:if(Q=x.rawEvent.key||x.rawEvent["char"])switch(t){case 48:"0"!=Q&&(y=Q);break;case 49:"1"!=Q&&(y=Q);break;case 50:"2"!= Q&&(y=Q);break;case 51:"3"!=Q&&(y=Q);break;case 52:"4"!=Q&&(y=Q);break;case 53:"5"!=Q&&(y=Q);break;case 54:"6"!=Q&&(y=Q);break;case 55:"7"!=Q&&(y=Q);break;case 56:"8"!=Q&&(y=Q);break;case 57:"9"!=Q&&(y=Q)}1>y.length&&(96<=t&&105>=t&&(t-=48),y=this.value.replace(",",".")+String.fromCharCode(t),1=a.maxLength)){var e=document.createElement("SPAN");e.id="ceTxt"+C.container.id;e.className= "ceValue";e.style.whiteSpace="nowrap";C.container.appendChild(e);e.innerHTML=$rule.encode(a.value+(h(b)?String.fromCharCode(b):""));var g=ib(e).width;C.container.removeChild(e);a.style.width=g+2+"px"}},me=function(a){function b(g){g=G(A.fds,g);h(g)&&h(g.d)&&(c.title=Zb(g.d))}switch(a.t){case d.Function:case d.Action:switch(a.FuncType){case n.Name:a=G(a.t==d.Function?A.fds:A.acs,a.v);h(a)&&h(a.d)&&(c.title=Zb(a.d));break;case n.Param:if(a=Ca(c),h(a)&&0g&&(a=q.els.er.e108,c.value=g.toString(),c.setAttribute("ce206",c.value))}g=c.getAttribute("ce206");l=parseInt(c.getAttribute("ce211"),10);try{if(h(g)){var x=parseFloat(g.replace(",","."));e=h(x)&&"-0."!=g&&"0."!=g?x.toString():l.toString()}else e=l.toString()}catch(t){e=l.toString()}}else e=$rule.encode(c.value);x=c;h(ub)?(b=document.getElementById(ub),h(b)&&(c=I(b),c.innerHTML=0==e.length?q.els.lbl.em: e,c.setAttribute("ce206",e),c.setAttribute("ce205",v.Input),c.style.display="",h(a)?(c.className="ceValidationWarning",c.title=a):(c.className="ceValue ceCurrent",c.title=""))):(ca({t:D(x),id:null,v:e,n:0==e.length?q.els.lbl.em:e,st:b,ct:ra(x),ft:T(x),it:v.Input,h:!1,fv:!1}),h(a)&&(c.className="ceValidationWarning",c.title=a));ub=null;C.container.removeChild(x)}}},gc=function(){var a=[];a.push(G(q.els.cls,"and"));for(var b=ab(),e=!1,g=!1,l=0;lx&&U(u.RightParenthesis,null,q.els.lbl.pe,l);U(u.Addition,null,"+",l);U(u.Subtraction,null,"–",l);U(u.Multiplication,null,"×",l);U(u.Division,null,"÷",l)}var b=[];switch(D(za(c))){case d.LeftBracket:U(u.LeftParenthesis,null,q.els.lbl.pb,b);U(u.Number,null,qb(m.Numeric),b);for(var e=fc(),g=0;ge&&(e=0);e=b.length&&g.substr(0,b.length).toLowerCase()==b&&e.push(a[l]);return e},oe=function(){if(!h(c))return"i101";if(8==w)return"i126";var a=za(c);switch(D(a)){case d.Flow:return"else"==a.getAttribute("ce208")?"i110":"i103";case d.LeftSource:case d.LeftParenthesis:return"i103";case d.RightSource:case d.RightParenthesis:return"i111";case d.Field:if(Ea)return"i127";a=G(A.fds,a.getAttribute("ce208"));return h(a)?a.o==m.Collection&& a.ct==H.Reference?"i124":"i104":"i124";case d.Exists:return Ea?"i136":"i135";case d.Where:return"i124";case d.LeftBracket:return"i106";case d.RightBracket:return"i121";case d.Calculation:return"i108";case d.Action:switch(T(a)){case n.End:return Qa(a)&&Ea?"i128":"else"==Sc(a,d.Flow).getAttribute("ce208")?"i124":"i125";case n.Name:return Ea?"i128":"i123";default:return"i123"}case d.Function:switch(T(a)){case n.End:return Qa(a)&&Ea?"i127":"i104";case n.Name:return Ea?"i127":"i123";default:return"i123"}case d.Operator:if(Ea)return"i129"; var b=ya(a);return b==m.Numeric?(a=Xa(a),a=h(a)?G(A.fds,a.getAttribute("ce208")):null,h(a)&&a.cal?"i122":"i113"):b==m.String?"i113":b==m.Date?"i114":b==m.Time?"i117":"i119";case d.Value:return b=ya(a),b==m.String||b==m.Numeric?h(a.getAttribute("ce207"))?"i105":"i107":b==m.Date?3==w?"i109":Ea?"i132":"i115":b==m.Time?4==w?"i116":Ea?"i133":"i118":Ea?"i134":"i120";case d.Clause:return"then"==a.getAttribute("ce208")?"i110":Ea?"i129":"i103";default:return"i122"}},qb=function(a,b){switch(a){case m.String:return q.els.lbl.s; case m.Date:return q.els.lbl.v;case m.Time:return q.els.lbl.j;case m.Numeric:return b?q.els.lbl.e:q.els.lbl.m;case m.Bool:return q.els.lbl.b;case m.Enum:return q.els.lbl.e;default:throw Error("CL45");}},db=function(a){var b=h(a.getAttribute("ce202"))?D(a):null;return b==d.Setter||b==d.Action?!0:b==d.Flow?!1:h(a.previousSibling)?db(a.previousSibling):!1},nd=function(a,b,e){if(!h(a)||!h(a.ps))return null;for(var g=e;g<=a.ps.length;g++)if(a.ps[g].o==b)return a.ps[g];return 0a.className.indexOf("ceCurrent")&&(a.className+=" ceCurrent");return a}},Qa=function(a){var b=D(a),e=T(a);return b==d.Function||b==d.Action||b==d.Calculation&&(e==n.Name||e==n.End)?(a=Ca(a),h(a)&&h(a.ps)?0==a.ps.length:!0):!1},Wb=function(a){return a.getAttribute&&h(a.getAttribute("ce202"))?(a=D(a),a!=d.Tab&&a!=d.NewLine&&a!=d.HtmlTag):!1},zb=function(a,b,e,g){return a==d.Value&&(b==m.String||b==m.Numeric)||a==d.Calculation&&e==u.Number||(a==d.Function|| a==d.Action)&&g==v.Input&&(b==m.String||b==m.Numeric)},Ma=function(a){return 31a||41a||61==a||63a||96a||222uc?uc++:(Oa=0,1!=w&&2!=w&&xa())},ge=function(){if(na){6!=w&&8!=w||Ta();var a=D(c);a!=d.NewLine&&a!=d.Tab?xb(!1):xa()}},Ta=function(){tc=0;z="";M=[];la.close();w=0},ec=function(a){a=$rule.getChildrenByAttribute(document.body,"class", a);if(h(a)&&0 a)try{window.scroll(p.getScrollWidth(),a)}catch(b){}},Rc=function(a,b){var e=p.getWindowDimensions().height,g=p.getScrollHeight();if(e+g