(function(n){ /*! * jQuery JavaScript Library v1.8.3 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright 2012 jQuery Foundation and other contributors * Released under the MIT license * http://jquery.org/license * * Date: Tue Nov 13 2012 08:20:33 GMT-0500 (Eastern Standard Time) */ (function(n,t){function yu(n){var t=wt[n]={};return i.each(n.split(h),function(n,i){t[i]=!0}),t}function ui(n,r,u){if(u===t&&n.nodeType===1){var f="data-"+r.replace(sr,"-$1").toLowerCase();if(u=n.getAttribute(f),typeof u=="string"){try{u=u==="true"?!0:u==="false"?!1:u==="null"?null:+u+""===u?+u:or.test(u)?i.parseJSON(u):u}catch(e){}i.data(n,r,u)}else u=t}return u}function at(n){for(var t in n)if((t!=="data"||!i.isEmptyObject(n[t]))&&t!=="toJSON")return!1;return!0}function v(){return!1}function g(){return!0}function k(n){return!n||!n.parentNode||n.parentNode.nodeType===11}function fi(n,t){do n=n[t];while(n&&n.nodeType!==1);return n}function ei(n,t,r){if(t=t||0,i.isFunction(t))return i.grep(n,function(n,i){var u=!!t.call(n,i,n);return u===r});if(t.nodeType)return i.grep(n,function(n){return n===t===r});if(typeof t=="string"){var u=i.grep(n,function(n){return n.nodeType===1});if(fe.test(t))return i.filter(t,u,!r);t=i.filter(t,u)}return i.grep(n,function(n){return i.inArray(n,t)>=0===r})}function oi(n){var i=dr.split("|"),t=n.createDocumentFragment();if(t.createElement)while(i.length)t.createElement(i.pop());return t}function pu(n,t){return n.getElementsByTagName(t)[0]||n.appendChild(n.ownerDocument.createElement(t))}function si(n,t){if(t.nodeType===1&&i.hasData(n)){var u,f,o,s=i._data(n),r=i._data(t,s),e=s.events;if(e){delete r.handle;r.events={};for(u in e)for(f=0,o=e[u].length;f").appendTo(r.body),t=f.css("display");return f.remove(),(t==="none"||t==="")&&(p=r.body.appendChild(p||i.extend(r.createElement("iframe"),{frameBorder:0,width:0,height:0})),w&&p.createElement||(w=(p.contentWindow||p.contentDocument).document,w.write(""),w.close()),f=w.body.appendChild(w.createElement(n)),t=u(f,"display"),r.body.removeChild(p)),ii[n]=t,t}function vt(n,t,r,u){var f;if(i.isArray(t))i.each(t,function(t,i){r||to.test(n)?u(n,i):vt(n+"["+(typeof i=="object"?t:"")+"]",i,r,u)});else if(r||i.type(t)!=="object")u(n,t);else for(f in t)vt(n+"["+f+"]",t[f],r,u)}function bi(n){return function(t,r){typeof t!="string"&&(r=t,t="*");var u,o,f,s=t.toLowerCase().split(h),e=0,c=s.length;if(i.isFunction(r))for(;e)[^>]*$|#([\w\-]*)$)/,fr=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,cf=/^[\],:{}\s]*$/,lf=/(?:^|:|,)(?:\s*\[)+/g,af=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,vf=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,yf=/^-ms-/,pf=/-([\da-z])/gi,wf=function(n,t){return(t+"").toUpperCase()},et=function(){r.addEventListener?(r.removeEventListener("DOMContentLoaded",et,!1),i.ready()):r.readyState==="complete"&&(r.detachEvent("onreadystatechange",et),i.ready())},er={},wt,or,sr,y,ot,hr,bt;i.fn=i.prototype={constructor:i,init:function(n,u,f){var e,o,s;if(!n)return this;if(n.nodeType)return this.context=this[0]=n,this.length=1,this;if(typeof n=="string"){if(e=n.charAt(0)==="<"&&n.charAt(n.length-1)===">"&&n.length>=3?[null,n,null]:hf.exec(n),e&&(e[1]||!u)){if(e[1])return u=u instanceof i?u[0]:u,s=u&&u.nodeType?u.ownerDocument||u:r,n=i.parseHTML(e[1],s,!0),fr.test(e[1])&&i.isPlainObject(u)&&this.attr.call(n,u,!0),i.merge(this,n);if(o=r.getElementById(e[2]),o&&o.parentNode){if(o.id!==e[2])return f.find(n);this.length=1;this[0]=o}return this.context=r,this.selector=n,this}return!u||u.jquery?(u||f).find(n):this.constructor(u).find(n)}return i.isFunction(n)?f.ready(n):(n.selector!==t&&(this.selector=n.selector,this.context=n.context),i.makeArray(n,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return o.call(this)},get:function(n){return n==null?this.toArray():n<0?this[this.length+n]:this[n]},pushStack:function(n,t,r){var u=i.merge(this.constructor(),n);return u.prevObject=this,u.context=this.context,t==="find"?u.selector=this.selector+(this.selector?" ":"")+r:t&&(u.selector=this.selector+"."+t+"("+r+")"),u},each:function(n,t){return i.each(this,n,t)},ready:function(n){return i.ready.promise().done(n),this},eq:function(n){return n=+n,n===-1?this.slice(n):this.slice(n,n+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(o.apply(this,arguments),"slice",o.call(arguments).join(","))},map:function(n){return this.pushStack(i.map(this,function(t,i){return n.call(t,i,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:rr,sort:[].sort,splice:[].splice};i.fn.init.prototype=i.fn;i.extend=i.fn.extend=function(){var o,e,u,r,s,h,n=arguments[0]||{},f=1,l=arguments.length,c=!1;for(typeof n=="boolean"&&(c=n,n=arguments[1]||{},f=2),typeof n=="object"||i.isFunction(n)||(n={}),l===f&&(n=this,--f);f0)||(ut.resolveWith(r,[i]),i.fn.trigger&&i(r).trigger("ready").off("ready"))}},isFunction:function(n){return i.type(n)==="function"},isArray:Array.isArray||function(n){return i.type(n)==="array"},isWindow:function(n){return n!=null&&n==n.window},isNumeric:function(n){return!isNaN(parseFloat(n))&&isFinite(n)},type:function(n){return n==null?String(n):er[ef.call(n)]||"object"},isPlainObject:function(n){if(!n||i.type(n)!=="object"||n.nodeType||i.isWindow(n))return!1;try{if(n.constructor&&!yt.call(n,"constructor")&&!yt.call(n.constructor.prototype,"isPrototypeOf"))return!1}catch(u){return!1}for(var r in n);return r===t||yt.call(n,r)},isEmptyObject:function(n){for(var t in n)return!1;return!0},error:function(n){throw new Error(n);},parseHTML:function(n,t,u){var f;return!n||typeof n!="string"?null:(typeof t=="boolean"&&(u=t,t=0),t=t||r,f=fr.exec(n))?[t.createElement(f[1])]:(f=i.buildFragment([n],t,u?null:[]),i.merge([],(f.cacheable?i.clone(f.fragment):f.fragment).childNodes))},parseJSON:function(t){if(!t||typeof t!="string")return null;if(t=i.trim(t),n.JSON&&n.JSON.parse)return n.JSON.parse(t);if(cf.test(t.replace(af,"@").replace(vf,"]").replace(lf,"")))return new Function("return "+t)();i.error("Invalid JSON: "+t)},parseXML:function(r){var u,f;if(!r||typeof r!="string")return null;try{n.DOMParser?(f=new DOMParser,u=f.parseFromString(r,"text/xml")):(u=new ActiveXObject("Microsoft.XMLDOM"),u.async="false",u.loadXML(r))}catch(e){u=t}return u&&u.documentElement&&!u.getElementsByTagName("parsererror").length||i.error("Invalid XML: "+r),u},noop:function(){},globalEval:function(t){t&&of.test(t)&&(n.execScript||function(t){n.eval.call(n,t)})(t)},camelCase:function(n){return n.replace(yf,"ms-").replace(pf,wf)},nodeName:function(n,t){return n.nodeName&&n.nodeName.toLowerCase()===t.toLowerCase()},each:function(n,r,u){var f,e=0,o=n.length,s=o===t||i.isFunction(n);if(u){if(s){for(f in n)if(r.apply(n[f],u)===!1)break}else for(;e0&&n[0]&&n[o-1]||o===0||i.isArray(n));if(c)for(;s-1;)r.splice(u,1),o&&(u<=s&&s--,u<=e&&e--)}),this},has:function(n){return i.inArray(n,r)>-1},empty:function(){return r=[],this},disable:function(){return r=u=f=t,this},disabled:function(){return!r},lock:function(){return u=t,f||h.disable(),this},locked:function(){return!u},fireWith:function(n,t){return t=t||[],t=[n,t.slice?t.slice():t],r&&(!c||u)&&(o?u.push(t):a(t)),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!c}};return h};i.extend({Deferred:function(n){var u=[["resolve","done",i.Callbacks("once memory"),"resolved"],["reject","fail",i.Callbacks("once memory"),"rejected"],["notify","progress",i.Callbacks("memory")]],f="pending",r={state:function(){return f},always:function(){return t.done(arguments).fail(arguments),this},then:function(){var n=arguments;return i.Deferred(function(r){i.each(u,function(u,f){var e=f[0],o=n[u];t[f[1]](i.isFunction(o)?function(){var n=o.apply(this,arguments);n&&i.isFunction(n.promise)?n.promise().done(r.resolve).fail(r.reject).progress(r.notify):r[e+"With"](this===t?r:this,[n])}:r[e])});n=null}).promise()},promise:function(n){return n!=null?i.extend(n,r):r}},t={};return r.pipe=r.then,i.each(u,function(n,i){var e=i[2],o=i[3];r[i[1]]=e.add;o&&e.add(function(){f=o},u[n^1][2].disable,u[2][2].lock);t[i[0]]=e.fire;t[i[0]+"With"]=e.fireWith}),r.promise(t),n&&n.call(t,t),t},when:function(n){var t=0,u=o.call(arguments),r=u.length,e=r!==1||n&&i.isFunction(n.promise)?r:0,f=e===1?n:i.Deferred(),c=function(n,t,i){return function(r){t[n]=this;i[n]=arguments.length>1?o.call(arguments):r;i===s?f.notifyWith(t,i):--e||f.resolveWith(t,i)}},s,l,h;if(r>1)for(s=new Array(r),l=new Array(r),h=new Array(r);t<\/table>a<\/a>",h=t.getElementsByTagName("*"),e=t.getElementsByTagName("a")[0],!h||!e||!h.length)return{};c=r.createElement("select");l=c.appendChild(r.createElement("option"));f=t.getElementsByTagName("input")[0];e.style.cssText="top:1px;float:left;opacity:.5";u={leadingWhitespace:t.firstChild.nodeType===3,tbody:!t.getElementsByTagName("tbody").length,htmlSerialize:!!t.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.5/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:f.value==="on",optSelected:l.selected,getSetAttribute:t.className!=="t",enctype:!!r.createElement("form").enctype,html5Clone:r.createElement("nav").cloneNode(!0).outerHTML!=="<:nav><\/:nav>",boxModel:r.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1};f.checked=!0;u.noCloneChecked=f.cloneNode(!0).checked;c.disabled=!0;u.optDisabled=!l.disabled;try{delete t.test}catch(p){u.deleteExpando=!1}if(!t.addEventListener&&t.attachEvent&&t.fireEvent&&(t.attachEvent("onclick",y=function(){u.noCloneEvent=!1}),t.cloneNode(!0).fireEvent("onclick"),t.detachEvent("onclick",y)),f=r.createElement("input"),f.value="t",f.setAttribute("type","radio"),u.radioValue=f.value==="t",f.setAttribute("checked","checked"),f.setAttribute("name","t"),t.appendChild(f),o=r.createDocumentFragment(),o.appendChild(t.lastChild),u.checkClone=o.cloneNode(!0).cloneNode(!0).lastChild.checked,u.appendChecked=f.checked,o.removeChild(f),o.appendChild(t),t.attachEvent)for(v in{submit:!0,change:!0,focusin:!0})a="on"+v,s=a in t,s||(t.setAttribute(a,"return;"),s=typeof t[a]=="function"),u[v+"Bubbles"]=s;return i(function(){var i,t,f,e,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",o=r.getElementsByTagName("body")[0];o&&(i=r.createElement("div"),i.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",o.insertBefore(i,o.firstChild),t=r.createElement("div"),i.appendChild(t),t.innerHTML="
]","i"),tu=/^(?:checkbox|radio)$/,iu=/checked\s*(?:[^=]|=\s*.checked.)/i,ae=/\/(java|ecma)script/i,ve=/^\s*\s*$/g,e={option:[1,"
<\/td>t<\/td><\/tr><\/table>",f=t.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",s=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",u.reliableHiddenOffsets=s&&f[0].offsetHeight===0,t.innerHTML="",t.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",u.boxSizing=t.offsetWidth===4,u.doesNotIncludeMarginInBodyOffset=o.offsetTop!==1,n.getComputedStyle&&(u.pixelPosition=(n.getComputedStyle(t,null)||{}).top!=="1%",u.boxSizingReliable=(n.getComputedStyle(t,null)||{width:"4px"}).width==="4px",e=r.createElement("div"),e.style.cssText=t.style.cssText=h,e.style.marginRight=e.style.width="0",t.style.width="1px",t.appendChild(e),u.reliableMarginRight=!parseFloat((n.getComputedStyle(e,null)||{}).marginRight)),typeof t.style.zoom!="undefined"&&(t.innerHTML="",t.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",u.inlineBlockNeedsLayout=t.offsetWidth===3,t.style.display="block",t.style.overflow="visible",t.innerHTML="
<\/div>",t.firstChild.style.width="5px",u.shrinkWrapBlocks=t.offsetWidth!==3,i.style.zoom=1),o.removeChild(i),i=t=f=e=null)}),o.removeChild(t),h=e=c=l=f=o=t=null,u}();or=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/;sr=/([A-Z])/g;i.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(i.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(n){return n=n.nodeType?i.cache[n[i.expando]]:n[i.expando],!!n&&!at(n)},data:function(n,r,u,f){if(i.acceptData(n)){var s,h,c=i.expando,a=typeof r=="string",l=n.nodeType,o=l?i.cache:n,e=l?n[c]:n[c]&&c;if(e&&o[e]&&(f||o[e].data)||!a||u!==t)return e||(l?n[c]=e=i.deletedIds.pop()||i.guid++:e=c),o[e]||(o[e]={},l||(o[e].toJSON=i.noop)),(typeof r=="object"||typeof r=="function")&&(f?o[e]=i.extend(o[e],r):o[e].data=i.extend(o[e].data,r)),s=o[e],f||(s.data||(s.data={}),s=s.data),u!==t&&(s[i.camelCase(r)]=u),a?(h=s[r],h==null&&(h=s[i.camelCase(r)])):h=s,h}},removeData:function(n,t,r){if(i.acceptData(n)){var e,o,h,s=n.nodeType,u=s?i.cache:n,f=s?n[i.expando]:i.expando;if(u[f]){if(t&&(e=r?u[f]:u[f].data,e)){for(i.isArray(t)||((t in e)?t=[t]:(t=i.camelCase(t),t=(t in e)?[t]:t.split(" "))),o=0,h=t.length;o1,null,!1))},removeData:function(n){return this.each(function(){i.removeData(this,n)})}});i.extend({queue:function(n,t,r){var u;if(n)return t=(t||"fx")+"queue",u=i._data(n,t),r&&(!u||i.isArray(r)?u=i._data(n,t,i.makeArray(r)):u.push(r)),u||[]},dequeue:function(n,t){t=t||"fx";var r=i.queue(n,t),e=r.length,u=r.shift(),f=i._queueHooks(n,t),o=function(){i.dequeue(n,t)};u==="inprogress"&&(u=r.shift(),e--);u&&(t==="fx"&&r.unshift("inprogress"),delete f.stop,u.call(n,o,f));!e&&f&&f.empty.fire()},_queueHooks:function(n,t){var r=t+"queueHooks";return i._data(n,r)||i._data(n,r,{empty:i.Callbacks("once memory").add(function(){i.removeData(n,t+"queue",!0);i.removeData(n,r,!0)})})}});i.fn.extend({queue:function(n,r){var u=2;return(typeof n!="string"&&(r=n,n="fx",u--),arguments.length1)},removeAttr:function(n){return this.each(function(){i.removeAttr(this,n)})},prop:function(n,t){return i.access(this,i.prop,n,t,arguments.length>1)},removeProp:function(n){return n=i.propFix[n]||n,this.each(function(){try{this[n]=t;delete this[n]}catch(i){}})},addClass:function(n){var r,f,o,t,e,u,s;if(i.isFunction(n))return this.each(function(t){i(this).addClass(n.call(this,t,this.className))});if(n&&typeof n=="string")for(r=n.split(h),f=0,o=this.length;f=0)r=r.replace(" "+e[f]+" "," ");u.className=n?i.trim(r):""}return this},toggleClass:function(n,t){var r=typeof n,u=typeof t=="boolean";return i.isFunction(n)?this.each(function(r){i(this).toggleClass(n.call(this,r,this.className,t),t)}):this.each(function(){if(r==="string")for(var f,s=0,o=i(this),e=t,c=n.split(h);f=c[s++];)e=u?e:!o.hasClass(f),o[e?"addClass":"removeClass"](f);else(r==="undefined"||r==="boolean")&&(this.className&&i._data(this,"__className__",this.className),this.className=this.className||n===!1?"":i._data(this,"__className__")||"")})},hasClass:function(n){for(var i=" "+n+" ",t=0,r=this.length;t=0)return!0;return!1},val:function(n){var r,u,e,f=this[0];return arguments.length?(e=i.isFunction(n),this.each(function(u){var f,o=i(this);this.nodeType===1&&(f=e?n.call(this,u,o.val()):n,f==null?f="":typeof f=="number"?f+="":i.isArray(f)&&(f=i.map(f,function(n){return n==null?"":n+""})),r=i.valHooks[this.type]||i.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,f,"value")!==t||(this.value=f))})):f?(r=i.valHooks[f.type]||i.valHooks[f.nodeName.toLowerCase()],r&&"get"in r&&(u=r.get(f,"value"))!==t)?u:(u=f.value,typeof u=="string"?u.replace(bf,""):u==null?"":u):void 0}});i.extend({valHooks:{option:{get:function(n){var t=n.attributes.value;return!t||t.specified?n.value:n.text}},select:{get:function(n){for(var e,t,o=n.options,r=n.selectedIndex,u=n.type==="select-one"||r<0,s=u?null:[],h=u?r+1:o.length,f=r<0?h:u?r:0;f=0}),r.length||(n.selectedIndex=-1),r}}},attrFn:{},attr:function(n,r,u,f){var e,o,h,c=n.nodeType;if(n&&c!==3&&c!==8&&c!==2){if(f&&i.isFunction(i.fn[r]))return i(n)[r](u);if(typeof n.getAttribute=="undefined")return i.prop(n,r,u);if(h=c!==1||!i.isXMLDoc(n),h&&(r=r.toLowerCase(),o=i.attrHooks[r]||(vr.test(r)?cr:s)),u!==t){if(u===null){i.removeAttr(n,r);return}return o&&"set"in o&&h&&(e=o.set(n,u,r))!==t?e:(n.setAttribute(r,u+""),u)}return o&&"get"in o&&h&&(e=o.get(n,r))!==null?e:(e=n.getAttribute(r),e===null?t:e)}},removeAttr:function(n,t){var u,f,r,e,o=0;if(t&&n.nodeType===1)for(f=t.split(h);o=0}})});var kt=/^(?:textarea|input|select)$/i,pr=/^([^\.]*|)(?:\.(.+)|)$/,ne=/(?:^|\s)hover(\.\S+|)\b/,te=/^key/,ie=/^(?:mouse|contextmenu)|click/,wr=/^(?:focusinfocus|focusoutblur)$/,br=function(n){return i.event.special.hover?n:n.replace(ne,"mouseenter$1 mouseleave$1")};i.event={add:function(n,r,u,f,e){var a,s,v,y,p,o,b,l,w,c,h;if(n.nodeType!==3&&n.nodeType!==8&&r&&u&&(a=i._data(n))){for(u.handler&&(w=u,u=w.handler,e=w.selector),u.guid||(u.guid=i.guid++),v=a.events,v||(a.events=v={}),s=a.handle,s||(a.handle=s=function(n){return typeof i!="undefined"&&(!n||i.event.triggered!==n.type)?i.event.dispatch.apply(s.elem,arguments):t},s.elem=n),r=i.trim(br(r)).split(" "),y=0;y=0&&(s=s.slice(0,-1),d=!0),s.indexOf(".")>=0&&(b=s.split("."),s=b.shift(),b.sort()),e&&!i.event.customEvent[s]||i.event.global[s])){if(u=typeof u=="object"?u[i.expando]?u:new i.Event(s,u):new i.Event(s),u.type=s,u.isTrigger=!0,u.exclusive=d,u.namespace=b.join("."),u.namespace_re=u.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,v=s.indexOf(":")<0?"on"+s:"",!e){w=i.cache;for(c in w)w[c].events&&w[c].events[s]&&i.event.trigger(u,f,w[c].handle.elem,!0);return}if(u.result=t,u.target||(u.target=e),f=f!=null?i.makeArray(f):[],f.unshift(u),a=i.event.special[s]||{},!a.trigger||a.trigger.apply(e,f)!==!1){if(p=[[e,a.bindType||s]],!o&&!a.noBubble&&!i.isWindow(e)){for(k=a.delegateType||s,h=wr.test(k+s)?e:e.parentNode,l=e;h;h=h.parentNode)p.push([h,k]),l=h;l===(e.ownerDocument||r)&&p.push([l.defaultView||l.parentWindow||n,k])}for(c=0;c=0:i.find(s,this,null,[e]).length),a[s]&&v.push(u);v.length&&b.push({elem:e,matches:v})}for(y.length>p&&b.push({elem:this,matches:y.slice(p)}),f=0;f0?this.on(t,null,n,i):this.trigger(t)};te.test(t)&&(i.event.fixHooks[t]=i.event.keyHooks);ie.test(t)&&(i.event.fixHooks[t]=i.event.mouseHooks)}); /*! * Sizzle CSS Selector Engine * Copyright 2012 jQuery Foundation and other contributors * Released under the MIT license * http://sizzlejs.com/ */ (function(n,t){function r(n,t,i,r){i=i||[];t=t||h;var e,u,o,f,s=t.nodeType;if(!n||typeof n!="string")return i;if(s!==1&&s!==9)return[];if(o=it(t),!o&&!r&&(e=ki.exec(n)))if(f=e[1]){if(s===9)if(u=t.getElementById(f),u&&u.parentNode){if(u.id===f)return i.push(u),i}else return i;else if(t.ownerDocument&&(u=t.ownerDocument.getElementById(f))&&ti(t,u)&&u.id===f)return i.push(u),i}else{if(e[2])return p.apply(i,w.call(t.getElementsByTagName(n),0)),i;if((f=e[3])&&hi&&t.getElementsByClassName)return p.apply(i,w.call(t.getElementsByClassName(f),0)),i}return lt(n.replace(ft,"$1"),t,i,r,o)}function b(n){return function(t){var i=t.nodeName.toLowerCase();return i==="input"&&t.type===n}}function gt(n){return function(t){var i=t.nodeName.toLowerCase();return(i==="input"||i==="button")&&t.type===n}}function a(n){return s(function(t){return t=+t,s(function(i,r){for(var u,f=n([],i.length,t),e=f.length;e--;)i[u=f[e]]&&(i[u]=!(r[u]=i[u]))})})}function d(n,t,i){if(n===t)return i;for(var r=n.nextSibling;r;){if(r===t)return-1;r=r.nextSibling}return 1}function g(n,t){var o,f,h,s,i,c,l,a=fi[e][n+" "];if(a)return t?0:a.slice(0);for(i=n,c=[],l=u.preFilter;i;){(!o||(f=pi.exec(i)))&&(f&&(i=i.slice(f[0].length)||i),c.push(h=[]));o=!1;(f=wi.exec(i))&&(h.push(o=new ri(f.shift())),i=i.slice(o.length),o.type=f[0].replace(ft," "));for(s in u.filter)(f=et[s].exec(i))&&(!l[s]||(f=l[s](f)))&&(h.push(o=new ri(f.shift())),i=i.slice(o.length),o.type=s,o.matches=f);if(!o)break}return t?i.length:i?r.error(n):fi(n,c).slice(0)}function ot(n,t,i){var r=t.dir,u=i&&t.dir==="parentNode",f=ai++;return t.first?function(t,i,f){while(t=t[r])if(u||t.nodeType===1)return n(t,i,f)}:function(t,i,o){if(o){while(t=t[r])if((u||t.nodeType===1)&&n(t,i,o))return t}else for(var s,h=ut+" "+f+" ",c=h+at;t=t[r];)if(u||t.nodeType===1){if((s=t[e])===c)return t.sizset;if(typeof s=="string"&&s.indexOf(h)===0){if(t.sizset)return t}else{if(t[e]=c,n(t,i,o))return t.sizset=!0,t;t.sizset=!1}}}}function st(n){return n.length>1?function(t,i,r){for(var u=n.length;u--;)if(!n[u](t,i,r))return!1;return!0}:n[0]}function nt(n,t,i,r,u){for(var e,o=[],f=0,s=n.length,h=t!=null;f-1&&(f[l]=!(e[l]=a))}}else h=nt(h===e?h.splice(b,h.length):h),u?u(null,e,h,s):p.apply(e,h)})}function ct(n){for(var s,r,i,o=n.length,h=u.relative[n[0].type],c=h||u.relative[" "],t=h?1:0,l=ot(function(n){return n===s},c,!0),a=ot(function(n){return wt.call(s,n)>-1},c,!0),f=[function(n,t,i){return!h&&(i||t!==rt)||((s=t).nodeType?l(n,t,i):a(n,t,i))}];t1&&st(f),t>1&&n.slice(0,t-1).join("").replace(ft,"$1"),r,t0,e=n.length>0,i=function(o,s,c,l,a){var y,b,k,w=[],d=0,v="0",g=o&&[],tt=a!=null,it=rt,et=o||e&&u.find.TAG("*",a&&s.parentNode||s),ft=ut+=it==null?1:Math.E;for(tt&&(rt=s!==h&&s,at=i.el);(y=et[v])!=null;v++){if(e&&y){for(b=0;k=n[b];b++)if(k(y,s,c)){l.push(y);break}tt&&(ut=ft,at=++i.el)}f&&((y=!k&&y)&&d--,o&&g.push(y))}if(d+=v,f&&v!==d){for(b=0;k=t[b];b++)k(g,w,s,c);if(o){if(d>0)while(v--)g[v]||w[v]||(w[v]=vi.call(l));w=nt(w)}p.apply(l,w);tt&&!o&&w.length>0&&d+t.length>1&&r.uniqueSort(l)}return tt&&(ut=ft,rt=it),g};return i.el=0,f?s(i):i}function li(n,t,i){for(var u=0,f=t.length;u2&&(s=e[0]).type==="ID"&&t.nodeType===9&&!f&&u.relative[e[1].type]){if(t=u.find.ID(s.matches[0].replace(y,""),t,f)[0],!t)return i;n=n.slice(e.shift().length)}for(o=et.POS.test(n)?-1:e.length-1;o>=0;o--){if(s=e[o],u.relative[c=s.type])break;if((l=u.find[c])&&(r=l(s.matches[0].replace(y,""),dt.test(e[0].type)&&t.parentNode||t,f))){if(e.splice(o,1),n=r.length&&e.join(""),!n)return p.apply(i,w.call(r,0)),i;break}}}return yt(n,h)(r,t,f,i,dt.test(n)),i}function ni(){}var at,vt,u,tt,it,ti,yt,pt,k,rt,ii=!0,c="undefined",e=("sizcache"+Math.random()).replace(".",""),ri=String,h=n.document,o=h.documentElement,ut=0,ai=0,vi=[].pop,p=[].push,w=[].slice,wt=[].indexOf||function(n){for(var t=0,i=this.length;tu.cacheLength&&delete n[t.shift()],n[i+" "]=r},n)},ui=bt(),fi=bt(),ei=bt(),f="[\\x20\\t\\r\\n\\f]",v="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",yi=v.replace("w","w#"),oi="\\["+f+"*("+v+")"+f+"*(?:([*^$|!~]?=)"+f+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+yi+")|)|)"+f+"*\\]",kt=":("+v+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+oi+")|[^:]|\\\\.)*|.*))\\)|)",si=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+f+"*((?:-\\d)?\\d*)"+f+"*\\)|)(?=[^-]|$)",ft=new RegExp("^"+f+"+|((?:^|[^\\\\])(?:\\\\.)*)"+f+"+$","g"),pi=new RegExp("^"+f+"*,"+f+"*"),wi=new RegExp("^"+f+"*([\\x20\\t\\r\\n\\f>+~])"+f+"*"),bi=new RegExp(kt),ki=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,dt=/[\x20\t\r\n\f]*[+~]/,di=/h\d/i,gi=/input|select|textarea|button/i,y=/\\(?!\\)/g,et={ID:new RegExp("^#("+v+")"),CLASS:new RegExp("^\\.("+v+")"),NAME:new RegExp("^\\[name=['\"]?("+v+")['\"]?\\]"),TAG:new RegExp("^("+v.replace("w","w*")+")"),ATTR:new RegExp("^"+oi),PSEUDO:new RegExp("^"+kt),POS:new RegExp(si,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+f+"*(even|odd|(([+-]|)(\\d*)n|)"+f+"*(?:([+-]|)"+f+"*(\\d+)|))"+f+"*\\)|)","i"),needsContext:new RegExp("^"+f+"*[>+~]|"+si,"i")},l=function(n){var t=h.createElement("div");try{return n(t)}catch(i){return!1}finally{t=null}},nr=l(function(n){return n.appendChild(h.createComment("")),!n.getElementsByTagName("*").length}),tr=l(function(n){return n.innerHTML="<\/a>",n.firstChild&&typeof n.firstChild.getAttribute!==c&&n.firstChild.getAttribute("href")==="#"}),ir=l(function(n){n.innerHTML="";t.querySelectorAll(":enabled").length||n.push(":enabled",":disabled")});n=new RegExp(n.join("|"));lt=function(t,i,r,u,f){if(!u&&!f&&!n.test(t)){var o,l,a=!0,c=e,y=i,v=i.nodeType===9&&t;if(i.nodeType===1&&i.nodeName.toLowerCase()!=="object"){for(o=g(t),(a=i.getAttribute("id"))?c=a.replace(h,"\\$&"):i.setAttribute("id",c),c="[id='"+c+"'] ",l=o.length;l--;)o[l]=c+o[l].join("");y=dt.test(t)&&i.parentNode||i;v=o.join(",")}if(v)try{return p.apply(r,w.call(y.querySelectorAll(v),0)),r}catch(b){}finally{a||i.removeAttribute("id")}}return s(t,i,r,u,f)};i&&(l(function(n){u=i.call(n,"div");try{i.call(n,"[test!='']:sizzle");t.push("!=",kt)}catch(r){}}),t=new RegExp(t.join("|")),r.matchesSelector=function(f,e){if(e=e.replace(c,"='$1']"),!it(f)&&!t.test(e)&&!n.test(e))try{var o=i.call(f,e);if(o||u||f.document&&f.document.nodeType!==11)return o}catch(s){}return r(e,null,null,[f]).length>0})}();u.pseudos.nth=u.pseudos.eq;u.filters=ni.prototype=u.pseudos;u.setFilters=new ni;r.attr=i.attr;i.find=r;i.expr=r.selectors;i.expr[":"]=i.expr.pseudos;i.unique=r.uniqueSort;i.text=r.getText;i.isXMLDoc=r.isXML;i.contains=r.contains})(n);var re=/Until$/,ue=/^(?:parents|prev(?:Until|All))/,fe=/^.[^:#\[\.,]*$/,kr=i.expr.match.needsContext,ee={children:!0,contents:!0,next:!0,prev:!0};i.fn.extend({find:function(n){var t,f,o,u,e,r,s=this;if(typeof n!="string")return i(n).filter(function(){for(t=0,f=s.length;t0)for(u=o;u=0:i.filter(n,this).length>0:this.filter(n).length>0)},closest:function(n,t){for(var r,f=0,o=this.length,u=[],e=kr.test(n)||typeof n!="string"?i(n,t||this.context):0;f-1:i.find.matchesSelector(r,n)){u.push(r);break}r=r.parentNode}return u=u.length>1?i.unique(u):u,this.pushStack(u,"closest",n)},index:function(n){return n?typeof n=="string"?i.inArray(this[0],i(n)):i.inArray(n.jquery?n[0]:n,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(n,t){var u=typeof n=="string"?i(n,t):i.makeArray(n&&n.nodeType?[n]:n),r=i.merge(this.get(),u);return this.pushStack(k(u[0])||k(r[0])?r:i.unique(r))},addBack:function(n){return this.add(n==null?this.prevObject:this.prevObject.filter(n))}});i.fn.andSelf=i.fn.addBack;i.each({parent:function(n){var t=n.parentNode;return t&&t.nodeType!==11?t:null},parents:function(n){return i.dir(n,"parentNode")},parentsUntil:function(n,t,r){return i.dir(n,"parentNode",r)},next:function(n){return fi(n,"nextSibling")},prev:function(n){return fi(n,"previousSibling")},nextAll:function(n){return i.dir(n,"nextSibling")},prevAll:function(n){return i.dir(n,"previousSibling")},nextUntil:function(n,t,r){return i.dir(n,"nextSibling",r)},prevUntil:function(n,t,r){return i.dir(n,"previousSibling",r)},siblings:function(n){return i.sibling((n.parentNode||{}).firstChild,n)},children:function(n){return i.sibling(n.firstChild)},contents:function(n){return i.nodeName(n,"iframe")?n.contentDocument||n.contentWindow.document:i.merge([],n.childNodes)}},function(n,t){i.fn[n]=function(r,u){var f=i.map(this,t,r);return re.test(n)||(u=r),u&&typeof u=="string"&&(f=i.filter(u,f)),f=this.length>1&&!ee[n]?i.unique(f):f,this.length>1&&ue.test(n)&&(f=f.reverse()),this.pushStack(f,n,o.call(arguments).join(","))}});i.extend({filter:function(n,t,r){return r&&(n=":not("+n+")"),t.length===1?i.find.matchesSelector(t[0],n)?[t[0]]:[]:i.find.matches(n,t)},dir:function(n,r,u){for(var e=[],f=n[r];f&&f.nodeType!==9&&(u===t||f.nodeType!==1||!i(f).is(u));)f.nodeType===1&&e.push(f),f=f[r];return e},sibling:function(n,t){for(var i=[];n;n=n.nextSibling)n.nodeType===1&&n!==t&&i.push(n);return i}});var dr="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",oe=/ jQuery\d+="(?:null|\d+)"/g,dt=/^\s+/,gr=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,nu=/<([\w:]+)/,se=/
","<\/table>"],tr:[2,"
","<\/tbody><\/table>"],td:[3,"
","<\/tr><\/tbody><\/table>"],col:[2,"
<\/tbody>","<\/colgroup><\/table>"],area:[1,"","<\/map>"],_default:[0,"",""]},ru=oi(r),ni=ru.appendChild(r.createElement("div"));e.optgroup=e.option;e.tbody=e.tfoot=e.colgroup=e.caption=e.thead;e.th=e.td;i.support.htmlSerialize||(e._default=[1,"X
","<\/div>"]);i.fn.extend({text:function(n){return i.access(this,function(n){return n===t?i.text(this):this.empty().append((this[0]&&this[0].ownerDocument||r).createTextNode(n))},null,n,arguments.length)},wrapAll:function(n){if(i.isFunction(n))return this.each(function(t){i(this).wrapAll(n.call(this,t))});if(this[0]){var t=i(n,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]);t.map(function(){for(var n=this;n.firstChild&&n.firstChild.nodeType===1;)n=n.firstChild;return n}).append(this)}return this},wrapInner:function(n){return i.isFunction(n)?this.each(function(t){i(this).wrapInner(n.call(this,t))}):this.each(function(){var t=i(this),r=t.contents();r.length?r.wrapAll(n):t.append(n)})},wrap:function(n){var t=i.isFunction(n);return this.each(function(r){i(this).wrapAll(t?n.call(this,r):n)})},unwrap:function(){return this.parent().each(function(){i.nodeName(this,"body")||i(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(n){(this.nodeType===1||this.nodeType===11)&&this.appendChild(n)})},prepend:function(){return this.domManip(arguments,!0,function(n){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(n,this.firstChild)})},before:function(){if(!k(this[0]))return this.domManip(arguments,!1,function(n){this.parentNode.insertBefore(n,this)});if(arguments.length){var n=i.clean(arguments);return this.pushStack(i.merge(n,this),"before",this.selector)}},after:function(){if(!k(this[0]))return this.domManip(arguments,!1,function(n){this.parentNode.insertBefore(n,this.nextSibling)});if(arguments.length){var n=i.clean(arguments);return this.pushStack(i.merge(this,n),"after",this.selector)}},remove:function(n,t){for(var r,u=0;(r=this[u])!=null;u++)(!n||i.filter(n,[r]).length)&&(t||r.nodeType!==1||(i.cleanData(r.getElementsByTagName("*")),i.cleanData([r])),r.parentNode&&r.parentNode.removeChild(r));return this},empty:function(){for(var n,t=0;(n=this[t])!=null;t++)for(n.nodeType===1&&i.cleanData(n.getElementsByTagName("*"));n.firstChild;)n.removeChild(n.firstChild);return this},clone:function(n,t){return n=n==null?!1:n,t=t==null?n:t,this.map(function(){return i.clone(this,n,t)})},html:function(n){return i.access(this,function(n){var r=this[0]||{},u=0,f=this.length;if(n===t)return r.nodeType===1?r.innerHTML.replace(oe,""):t;if(typeof n=="string"&&!ce.test(n)&&(i.support.htmlSerialize||!gt.test(n))&&(i.support.leadingWhitespace||!dt.test(n))&&!e[(nu.exec(n)||["",""])[1].toLowerCase()]){n=n.replace(gr,"<$1><\/$2>");try{for(;u1&&typeof s=="string"&&iu.test(s))return this.each(function(){i(this).domManip(n,r,u)});if(i.isFunction(s))return this.each(function(f){var e=i(this);n[0]=s.call(this,f,r?e.html():t);e.domManip(n,r,u)});if(this[0]){if(h=i.buildFragment(n,this,c),f=h.fragment,o=f.firstChild,f.childNodes.length===1&&(f=o),o)for(r=r&&i.nodeName(o,"tr"),a=h.cacheable||l-1;e0?this.clone(!0):this).get(),i(f[u])[t](o),s=s.concat(o);return this.pushStack(s,n,f.selector)}});i.extend({clone:function(n,t,r){var f,o,u,e;if(i.support.html5Clone||i.isXMLDoc(n)||!gt.test("<"+n.nodeName+">")?e=n.cloneNode(!0):(ni.innerHTML=n.outerHTML,ni.removeChild(e=ni.firstChild)),(!i.support.noCloneEvent||!i.support.noCloneChecked)&&(n.nodeType===1||n.nodeType===11)&&!i.isXMLDoc(n))for(hi(n,e),f=nt(n),o=nt(e),u=0;f[u];++u)o[u]&&hi(f[u],o[u]);if(t&&(si(n,e),r))for(f=nt(n),o=nt(e),u=0;f[u];++u)si(f[u],o[u]);return f=o=null,e},clean:function(n,t,u,f){var h,c,o,p,v,d,s,w,a,b,k,y=t===r&&ru,l=[];for(t&&typeof t.createDocumentFragment!="undefined"||(t=r),h=0;(o=n[h])!=null;h++)if(typeof o=="number"&&(o+=""),o){if(typeof o=="string")if(he.test(o)){for(y=y||oi(t),s=t.createElement("div"),y.appendChild(s),o=o.replace(gr,"<$1><\/$2>"),p=(nu.exec(o)||["",""])[1].toLowerCase(),v=e[p]||e._default,d=v[0],s.innerHTML=v[1]+o+v[2];d--;)s=s.lastChild;if(!i.support.tbody)for(w=se.test(o),a=p==="table"&&!w?s.firstChild&&s.firstChild.childNodes:v[1]==="
"&&!w?s.childNodes:[],c=a.length-1;c>=0;--c)i.nodeName(a[c],"tbody")&&!a[c].childNodes.length&&a[c].parentNode.removeChild(a[c]);!i.support.leadingWhitespace&&dt.test(o)&&s.insertBefore(t.createTextNode(dt.exec(o)[0]),s.firstChild);o=s.childNodes;s.parentNode.removeChild(s)}else o=t.createTextNode(o);o.nodeType?l.push(o):i.merge(l,o)}if(s&&(o=s=y=null),!i.support.appendChecked)for(h=0;(o=l[h])!=null;h++)i.nodeName(o,"input")?ci(o):typeof o.getElementsByTagName!="undefined"&&i.grep(o.getElementsByTagName("input"),ci);if(u)for(b=function(n){if(!n.type||ae.test(n.type))return f?f.push(n.parentNode?n.parentNode.removeChild(n):n):u.appendChild(n)},h=0;(o=l[h])!=null;h++)i.nodeName(o,"script")&&b(o)||(u.appendChild(o),typeof o.getElementsByTagName!="undefined"&&(k=i.grep(i.merge([],o.getElementsByTagName("script")),b),l.splice.apply(l,[h+1,0].concat(k)),h+=k.length));return l},cleanData:function(n,t){for(var f,u,r,e,h=0,o=i.expando,s=i.cache,c=i.support.deleteExpando,l=i.event.special;(r=n[h])!=null;h++)if((t||i.acceptData(r))&&(u=r[o],f=u&&s[u],f)){if(f.events)for(e in f.events)l[e]?i.event.remove(r,e):i.removeEvent(r,e,f.handle);s[u]&&(delete s[u],c?delete r[o]:r.removeAttribute?r.removeAttribute(o):r[o]=null,i.deletedIds.push(u))}}}),function(){var t,n;i.uaMatch=function(n){n=n.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(n)||/(webkit)[ \/]([\w.]+)/.exec(n)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(n)||/(msie) ([\w.]+)/.exec(n)||n.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(n)||[];return{browser:t[1]||"",version:t[2]||"0"}};t=i.uaMatch(rf.userAgent);n={};t.browser&&(n[t.browser]=!0,n.version=t.version);n.chrome?n.webkit=!0:n.webkit&&(n.safari=!0);i.browser=n;i.sub=function(){function n(t,i){return new n.fn.init(t,i)}i.extend(!0,n,this);n.superclass=this;n.fn=n.prototype=this();n.fn.constructor=n;n.sub=this.sub;n.fn.init=function(r,u){return u&&u instanceof i&&!(u instanceof n)&&(u=n(u)),i.fn.init.call(this,r,u,t)};n.fn.init.prototype=n.fn;var t=n(r);return n}}();var u,p,w,ti=/alpha\([^)]*\)/i,ye=/opacity=([^)]*)/,pe=/^(top|right|bottom|left)$/,we=/^(none|table(?!-c[ea]).+)/,uu=/^margin/,be=new RegExp("^("+ft+")(.*)$","i"),st=new RegExp("^("+ft+")(?!px)[a-z%]+$","i"),ke=new RegExp("^([-+])=("+ft+")","i"),ii={BODY:"block"},de={position:"absolute",visibility:"hidden",display:"block"},fu={letterSpacing:0,fontWeight:400},c=["Top","Right","Bottom","Left"],eu=["Webkit","O","Moz","ms"],ge=i.fn.toggle;i.fn.extend({css:function(n,r){return i.access(this,function(n,r,u){return u!==t?i.style(n,r,u):i.css(n,r)},n,r,arguments.length>1)},show:function(){return ai(this,!0)},hide:function(){return ai(this)},toggle:function(n,t){var r=typeof n=="boolean";return i.isFunction(n)&&i.isFunction(t)?ge.apply(this,arguments):this.each(function(){(r?n:tt(this))?i(this).show():i(this).hide()})}});i.extend({cssHooks:{opacity:{get:function(n,t){if(t){var i=u(n,"opacity");return i===""?"1":i}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:i.support.cssFloat?"cssFloat":"styleFloat"},style:function(n,r,u,f){if(n&&n.nodeType!==3&&n.nodeType!==8&&n.style){var o,s,e,h=i.camelCase(r),c=n.style;if(r=i.cssProps[h]||(i.cssProps[h]=li(c,h)),e=i.cssHooks[r]||i.cssHooks[h],u!==t){if(s=typeof u,s==="string"&&(o=ke.exec(u))&&(u=(o[1]+1)*o[2]+parseFloat(i.css(n,r)),s="number"),u==null||s==="number"&&isNaN(u))return;if(s!=="number"||i.cssNumber[h]||(u+="px"),!e||!("set"in e)||(u=e.set(n,u,f))!==t)try{c[r]=u}catch(l){}}else return e&&"get"in e&&(o=e.get(n,!1,f))!==t?o:c[r]}},css:function(n,r,f,e){var o,c,s,h=i.camelCase(r);return(r=i.cssProps[h]||(i.cssProps[h]=li(n.style,h)),s=i.cssHooks[r]||i.cssHooks[h],s&&"get"in s&&(o=s.get(n,!0,e)),o===t&&(o=u(n,r)),o==="normal"&&r in fu&&(o=fu[r]),f||e!==t)?(c=parseFloat(o),f||i.isNumeric(c)?c||0:o):o},swap:function(n,t,i){var u,r,f={};for(r in t)f[r]=n.style[r],n.style[r]=t[r];u=i.call(n);for(r in t)n.style[r]=f[r];return u}});n.getComputedStyle?u=function(t,r){var f,o,s,h,e=n.getComputedStyle(t,null),u=t.style;return e&&(f=e.getPropertyValue(r)||e[r],f!==""||i.contains(t.ownerDocument,t)||(f=i.style(t,r)),st.test(f)&&uu.test(r)&&(o=u.width,s=u.minWidth,h=u.maxWidth,u.minWidth=u.maxWidth=u.width=f,f=e.width,u.width=o,u.minWidth=s,u.maxWidth=h)),f}:r.documentElement.currentStyle&&(u=function(n,t){var f,u,i=n.currentStyle&&n.currentStyle[t],r=n.style;return i==null&&r&&r[t]&&(i=r[t]),st.test(i)&&!pe.test(t)&&(f=r.left,u=n.runtimeStyle&&n.runtimeStyle.left,u&&(n.runtimeStyle.left=n.currentStyle.left),r.left=t==="fontSize"?"1em":i,i=r.pixelLeft+"px",r.left=f,u&&(n.runtimeStyle.left=u)),i===""?"auto":i});i.each(["height","width"],function(n,t){i.cssHooks[t]={get:function(n,r,f){if(r)return n.offsetWidth===0&&we.test(u(n,"display"))?i.swap(n,de,function(){return pi(n,t,f)}):pi(n,t,f)},set:function(n,r,u){return vi(n,r,u?yi(n,t,u,i.support.boxSizing&&i.css(n,"boxSizing")==="border-box"):0)}}});i.support.opacity||(i.cssHooks.opacity={get:function(n,t){return ye.test((t&&n.currentStyle?n.currentStyle.filter:n.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(n,t){var r=n.style,u=n.currentStyle,e=i.isNumeric(t)?"alpha(opacity="+t*100+")":"",f=u&&u.filter||r.filter||"";(r.zoom=1,t>=1&&i.trim(f.replace(ti,""))===""&&r.removeAttribute&&(r.removeAttribute("filter"),u&&!u.filter))||(r.filter=ti.test(f)?f.replace(ti,e):f+" "+e)}});i(function(){i.support.reliableMarginRight||(i.cssHooks.marginRight={get:function(n,t){return i.swap(n,{display:"inline-block"},function(){if(t)return u(n,"marginRight")})}});!i.support.pixelPosition&&i.fn.position&&i.each(["top","left"],function(n,t){i.cssHooks[t]={get:function(n,r){if(r){var f=u(n,t);return st.test(f)?i(n).position()[t]+"px":f}}}})});i.expr&&i.expr.filters&&(i.expr.filters.hidden=function(n){return n.offsetWidth===0&&n.offsetHeight===0||!i.support.reliableHiddenOffsets&&(n.style&&n.style.display||u(n,"display"))==="none"},i.expr.filters.visible=function(n){return!i.expr.filters.hidden(n)});i.each({margin:"",padding:"",border:"Width"},function(n,t){i.cssHooks[n+t]={expand:function(i){for(var u=typeof i=="string"?i.split(" "):[i],f={},r=0;r<4;r++)f[n+c[r]+t]=u[r]||u[r-2]||u[0];return f}};uu.test(n)||(i.cssHooks[n+t].set=vi)});var no=/%20/g,to=/\[\]$/,ou=/\r?\n/g,io=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ro=/^(?:select|textarea)/i;i.fn.extend({serialize:function(){return i.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?i.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ro.test(this.nodeName)||io.test(this.type))}).map(function(n,t){var r=i(this).val();return r==null?null:i.isArray(r)?i.map(r,function(n){return{name:t.name,value:n.replace(ou,"\r\n")}}):{name:t.name,value:r.replace(ou,"\r\n")}}).get()}});i.param=function(n,r){var u,f=[],e=function(n,t){t=i.isFunction(t)?t():t==null?"":t;f[f.length]=encodeURIComponent(n)+"="+encodeURIComponent(t)};if(r===t&&(r=i.ajaxSettings&&i.ajaxSettings.traditional),i.isArray(n)||n.jquery&&!i.isPlainObject(n))i.each(n,function(){e(this.name,this.value)});else for(u in n)vt(u,n[u],r,e);return f.join("&").replace(no,"+")};var l,a,uo=/#.*$/,fo=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,eo=/^(?:GET|HEAD)$/,oo=/^\/\//,su=/\?/,so=/)<[^<]*)*<\/script>/gi,ho=/([?&])_=[^&]*/,hu=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,cu=i.fn.load,ri={},lu={},au=["*/"]+["*"];try{a=tf.href}catch(po){a=r.createElement("a");a.href="";a=a.href}l=hu.exec(a.toLowerCase())||[];i.fn.load=function(n,r,u){if(typeof n!="string"&&cu)return cu.apply(this,arguments);if(!this.length)return this;var f,o,s,h=this,e=n.indexOf(" ");return e>=0&&(f=n.slice(e,n.length),n=n.slice(0,e)),i.isFunction(r)?(u=r,r=t):r&&typeof r=="object"&&(o="POST"),i.ajax({url:n,type:o,dataType:"html",data:r,complete:function(n,t){u&&h.each(u,s||[n.responseText,t,n])}}).done(function(n){s=arguments;h.html(f?i("
").append(n.replace(so,"")).find(f):n)}),this};i.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(n,t){i.fn[t]=function(n){return this.on(t,n)}});i.each(["get","post"],function(n,r){i[r]=function(n,u,f,e){return i.isFunction(u)&&(e=e||f,f=u,u=t),i.ajax({type:r,url:n,data:u,success:f,dataType:e})}});i.extend({getScript:function(n,r){return i.get(n,t,r,"script")},getJSON:function(n,t,r){return i.get(n,t,r,"json")},ajaxSetup:function(n,t){return t?ki(n,i.ajaxSettings):(t=n,n=i.ajaxSettings),ki(n,t),n},ajaxSettings:{url:a,isLocal:/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/.test(l[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":au},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":n.String,"text html":!0,"text json":i.parseJSON,"text xml":i.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bi(ri),ajaxTransport:bi(lu),ajax:function(n,r){function p(n,r,h,l){var a,k,w,d,p,v=r;e!==2&&(e=2,nt&&clearTimeout(nt),c=t,g=l||"",f.readyState=n>0?4:0,h&&(d=wu(u,f,h)),n>=200&&n<300||n===304?(u.ifModified&&(p=f.getResponseHeader("Last-Modified"),p&&(i.lastModified[o]=p),p=f.getResponseHeader("Etag"),p&&(i.etag[o]=p)),n===304?(v="notmodified",a=!0):(a=bu(u,d),v=a.state,k=a.data,w=a.error,a=!w)):(w=v,(!v||n)&&(v="error",n<0&&(n=0))),f.status=n,f.statusText=(r||v)+"",a?rt.resolveWith(s,[k,v,f]):rt.rejectWith(s,[f,v,w]),f.statusCode(b),b=t,y&&tt.trigger("ajax"+(a?"Success":"Error"),[f,u,a?k:w]),ut.fireWith(s,[f,v]),y&&(tt.trigger("ajaxComplete",[f,u]),--i.active||i.event.trigger("ajaxStop")))}var k,d;typeof n=="object"&&(r=n,n=t);r=r||{};var o,g,w,c,nt,a,y,v,u=i.ajaxSetup({},r),s=u.context||u,tt=s!==u&&(s.nodeType||s instanceof i)?i(s):i.event,rt=i.Deferred(),ut=i.Callbacks("once memory"),b=u.statusCode||{},ft={},et={},e=0,ot="canceled",f={readyState:0,setRequestHeader:function(n,t){if(!e){var i=n.toLowerCase();n=et[i]=et[i]||n;ft[n]=t}return this},getAllResponseHeaders:function(){return e===2?g:null},getResponseHeader:function(n){var i;if(e===2){if(!w)for(w={};i=fo.exec(g);)w[i[1].toLowerCase()]=i[2];i=w[n.toLowerCase()]}return i===t?null:i},overrideMimeType:function(n){return e||(u.mimeType=n),this},abort:function(n){return n=n||ot,c&&c.abort(n),p(0,n),this}};if(rt.promise(f),f.success=f.done,f.error=f.fail,f.complete=ut.add,f.statusCode=function(n){if(n){var t;if(e<2)for(t in n)b[t]=[b[t],n[t]];else t=n[f.status],f.always(t)}return this},u.url=((n||u.url)+"").replace(uo,"").replace(oo,l[1]+"//"),u.dataTypes=i.trim(u.dataType||"*").toLowerCase().split(h),u.crossDomain==null&&(a=hu.exec(u.url.toLowerCase()),u.crossDomain=!!(a&&(a[1]!==l[1]||a[2]!==l[2]||(a[3]||(a[1]==="http:"?80:443))!=(l[3]||(l[1]==="http:"?80:443))))),u.data&&u.processData&&typeof u.data!="string"&&(u.data=i.param(u.data,u.traditional)),it(ri,u,r,f),e===2)return f;y=u.global;u.type=u.type.toUpperCase();u.hasContent=!eo.test(u.type);y&&i.active++==0&&i.event.trigger("ajaxStart");u.hasContent||(u.data&&(u.url+=(su.test(u.url)?"&":"?")+u.data,delete u.data),o=u.url,u.cache===!1&&(k=i.now(),d=u.url.replace(ho,"$1_="+k),u.url=d+(d===u.url?(su.test(u.url)?"&":"?")+"_="+k:"")));(u.data&&u.hasContent&&u.contentType!==!1||r.contentType)&&f.setRequestHeader("Content-Type",u.contentType);u.ifModified&&(o=o||u.url,i.lastModified[o]&&f.setRequestHeader("If-Modified-Since",i.lastModified[o]),i.etag[o]&&f.setRequestHeader("If-None-Match",i.etag[o]));f.setRequestHeader("Accept",u.dataTypes[0]&&u.accepts[u.dataTypes[0]]?u.accepts[u.dataTypes[0]]+(u.dataTypes[0]!=="*"?", "+au+"; q=0.01":""):u.accepts["*"]);for(v in u.headers)f.setRequestHeader(v,u.headers[v]);if(u.beforeSend&&(u.beforeSend.call(s,f,u)===!1||e===2))return f.abort();ot="abort";for(v in{success:1,error:1,complete:1})f[v](u[v]);if(c=it(lu,u,r,f),c){f.readyState=1;y&&tt.trigger("ajaxSend",[f,u]);u.async&&u.timeout>0&&(nt=setTimeout(function(){f.abort("timeout")},u.timeout));try{e=1;c.send(ft,p)}catch(st){if(e<2)p(-1,st);else throw st;}}else p(-1,"No Transport");return f},active:0,lastModified:{},etag:{}});var vu=[],co=/\?/,ht=/(=)\?(?=&|$)|\?\?/,lo=i.now();i.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var n=vu.pop()||i.expando+"_"+lo++;return this[n]=!0,n}});i.ajaxPrefilter("json jsonp",function(r,u,f){var e,s,o,h=r.data,c=r.url,l=r.jsonp!==!1,a=l&&ht.test(c),v=l&&!a&&typeof h=="string"&&!(r.contentType||"").indexOf("application/x-www-form-urlencoded")&&ht.test(h);if(r.dataTypes[0]==="jsonp"||a||v)return e=r.jsonpCallback=i.isFunction(r.jsonpCallback)?r.jsonpCallback():r.jsonpCallback,s=n[e],a?r.url=c.replace(ht,"$1"+e):v?r.data=h.replace(ht,"$1"+e):l&&(r.url+=(co.test(c)?"&":"?")+r.jsonp+"="+e),r.converters["script json"]=function(){return o||i.error(e+" was not called"),o[0]},r.dataTypes[0]="json",n[e]=function(){o=arguments},f.always(function(){n[e]=s;r[e]&&(r.jsonpCallback=u.jsonpCallback,vu.push(e));o&&i.isFunction(s)&&s(o[0]);o=s=t}),"script"});i.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(n){return i.globalEval(n),n}}});i.ajaxPrefilter("script",function(n){n.cache===t&&(n.cache=!1);n.crossDomain&&(n.type="GET",n.global=!1)});i.ajaxTransport("script",function(n){if(n.crossDomain){var i,u=r.head||r.getElementsByTagName("head")[0]||r.documentElement;return{send:function(f,e){i=r.createElement("script");i.async="async";n.scriptCharset&&(i.charset=n.scriptCharset);i.src=n.url;i.onload=i.onreadystatechange=function(n,r){(r||!i.readyState||/loaded|complete/.test(i.readyState))&&(i.onload=i.onreadystatechange=null,u&&i.parentNode&&u.removeChild(i),i=t,r||e(200,"success"))};u.insertBefore(i,u.firstChild)},abort:function(){if(i)i.onload(0,1)}}}});ot=n.ActiveXObject?function(){for(var n in y)y[n](0,1)}:!1;hr=0;i.ajaxSettings.xhr=n.ActiveXObject?function(){return!this.isLocal&&di()||ku()}:di,function(n){i.extend(i.support,{ajax:!!n,cors:!!n&&"withCredentials"in n})}(i.ajaxSettings.xhr());i.support.ajax&&i.ajaxTransport(function(r){if(!r.crossDomain||i.support.cors){var u;return{send:function(f,e){var h,s,o=r.xhr();if(r.username?o.open(r.type,r.url,r.async,r.username,r.password):o.open(r.type,r.url,r.async),r.xhrFields)for(s in r.xhrFields)o[s]=r.xhrFields[s];r.mimeType&&o.overrideMimeType&&o.overrideMimeType(r.mimeType);r.crossDomain||f["X-Requested-With"]||(f["X-Requested-With"]="XMLHttpRequest");try{for(s in f)o.setRequestHeader(s,f[s])}catch(c){}o.send(r.hasContent&&r.data||null);u=function(n,f){var s,a,v,c,l;try{if(u&&(f||o.readyState===4))if(u=t,h&&(o.onreadystatechange=i.noop,ot&&delete y[h]),f)o.readyState!==4&&o.abort();else{s=o.status;v=o.getAllResponseHeaders();c={};l=o.responseXML;l&&l.documentElement&&(c.xml=l);try{c.text=o.responseText}catch(w){}try{a=o.statusText}catch(w){a=""}s||!r.isLocal||r.crossDomain?s===1223&&(s=204):s=c.text?200:404}}catch(p){f||e(-1,p)}c&&e(s,a,c,v)};r.async?o.readyState===4?setTimeout(u,0):(h=++hr,ot&&(y||(y={},i(n).unload(ot)),y[h]=u),o.onreadystatechange=u):u()},abort:function(){u&&u(0,1)}}}});var b,ct,ao=/^(?:toggle|show|hide)$/,vo=new RegExp("^(?:([-+])=|)("+ft+")([a-z%]*)$","i"),yo=/queueHooks$/,lt=[nf],d={"*":[function(n,t){var o,s,r=this.createTween(n,t),e=vo.exec(t),h=r.cur(),u=+h||0,f=1,c=20;if(e){if(o=+e[2],s=e[3]||(i.cssNumber[n]?"":"px"),s!=="px"&&u){u=i.css(r.elem,n,!0)||o||1;do f=f||".5",u=u/f,i.style(r.elem,n,u+s);while(f!==(f=r.cur()/h)&&f!==1&&--c)}r.unit=s;r.start=u;r.end=e[1]?u+(e[1]+1)*o:o}return r}]};i.Animation=i.extend(nr,{tweener:function(n,t){i.isFunction(n)?(t=n,n=["*"]):n=n.split(" ");for(var r,u=0,f=n.length;u-1,u={},s={},h,c;v?(s=e.position(),h=s.top,c=s.left):(h=parseFloat(l)||0,c=parseFloat(a)||0);i.isFunction(t)&&(t=t.call(n,r,o));t.top!=null&&(u.top=t.top-o.top+h);t.left!=null&&(u.left=t.left-o.left+c);"using"in t?t.using.call(n,u):e.css(u)}};i.fn.extend({position:function(){if(this[0]){var u=this[0],n=this.offsetParent(),t=this.offset(),r=bt.test(n[0].nodeName)?{top:0,left:0}:n.offset();return t.top-=parseFloat(i.css(u,"marginTop"))||0,t.left-=parseFloat(i.css(u,"marginLeft"))||0,r.top+=parseFloat(i.css(n[0],"borderTopWidth"))||0,r.left+=parseFloat(i.css(n[0],"borderLeftWidth"))||0,{top:t.top-r.top,left:t.left-r.left}}},offsetParent:function(){return this.map(function(){for(var n=this.offsetParent||r.body;n&&!bt.test(n.nodeName)&&i.css(n,"position")==="static";)n=n.offsetParent;return n||r.body})}});i.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(n,r){var u=/Y/.test(r);i.fn[n]=function(f){return i.access(this,function(n,f,e){var o=tr(n);if(e===t)return o?r in o?o[r]:o.document.documentElement[f]:n[f];o?o.scrollTo(u?i(o).scrollLeft():e,u?e:i(o).scrollTop()):n[f]=e},n,f,arguments.length,null)}});i.each({Height:"height",Width:"width"},function(n,r){i.each({padding:"inner"+n,content:r,"":"outer"+n},function(u,f){i.fn[f]=function(f,e){var o=arguments.length&&(u||typeof f!="boolean"),s=u||(f===!0||e===!0?"margin":"border");return i.access(this,function(r,u,f){var e;return i.isWindow(r)?r.document.documentElement["client"+n]:r.nodeType===9?(e=r.documentElement,Math.max(r.body["scroll"+n],e["scroll"+n],r.body["offset"+n],e["offset"+n],e["client"+n])):f===t?i.css(r,u,f,s):i.style(r,u,f,s)},r,o?f:t,o,null)}})});n.jQuery=n.$=i;typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return i})})(n);n.XDomainRequest&&jQuery.ajaxTransport(function(t){if(t.crossDomain){t.timeout&&(t.xdrTimeout=t.timeout,delete t.timeout);var i;return{send:function(r,u){function f(n,t,r,f){if(i.onload=i.onerror=i.ontimeout=i.onprogress=function(){},i=undefined,r.text.slice(0,9)==="ie9error:"){var e=JSON.parse(r.text.substring(9));n=e.status;t=e.description;r.text=""}u(n,t,r,f)}i=new XDomainRequest;t.url.slice(0,5)==="https"&&n.location.protocol==="http:"&&(t.url=t.url.replace("https","http"));i.open(t.type,t.url);i.onload=function(){f(200,"OK",{text:i.responseText},"Content-Type: "+i.contentType)};i.onerror=function(){f(500,"General error.")};i.onprogress=function(){};t.xdrTimeout&&(i.ontimeout=function(){f(0,"timeout")},i.timeout=t.xdrTimeout);i.send(t.hasContent&&t.data||null)},abort:function(){i&&(i.onerror=function(){},i.abort())}}}}),function(n,i){function d(){function ft(){throw Error.notImplemented();}function et(n){return this._parts.push(n),this}function ot(n){return this._parts.push(typeof n=="undefined"||n===null||n===""?"\r\n":n+"\r\n"),this}function st(){if(arguments.length!==0)throw Error.parameterCount();this._parts=[];this._value={};this._len=0}function ht(){if(arguments.length!==0)throw Error.parameterCount();return this._parts.length===0?!0:this.toString()===""}function ct(n){var t,r,i;if(n=n||"",t=this._parts,this._len!==t.length&&(this._value={},this._len=t.length),r=this._value,typeof r[n]=="undefined"){if(n!=="")for(i=0;i=0;f--){if(l=s[f].trim(),u=r[l],typeof u!="number")throw Error.argument("value",String.format(i.Res.enumInvalidValue,n.split(",")[f].trim(),this.__typeName));h|=u}return h}if(c=t?n.toLowerCase():n,u=r[c.trim()],typeof u!="number")throw Error.argument("value",String.format(i.Res.enumInvalidValue,n,this.__typeName));return u}function ti(n){var u,t,r,f,o,s,e;if(typeof n=="undefined"||n===null)return this.__string;if(typeof n!="number"||n%1!=0)throw Error.argumentType("value",Object.getType(n),this);if(u=this.prototype,this.__flags&&n!==0){if(r=this.__sortedValues,!r){r=[];for(t in u)r[r.length]={key:t,value:u[t]};r.sort(function(n,t){return n.value-t.value});this.__sortedValues=r}for(f=[],o=n,t=r.length-1;t>=0;t--)if((s=r[t],e=s.value,e!==0)&&(e&n)===e&&(f[f.length]=s.key,o-=e,o===0))break;if(f.length&&o===0)return f.reverse().join(", ")}else for(t in u)if(u[t]===n)return t;throw Error.argumentOutOfRange("value",n,String.format(i.Res.enumInvalidValue,n,this.__typeName));}function ii(){if(arguments.length!==0)throw Error.parameterCount();return this._changes||[]}function d(n){return n.split(" ").join(" ").toUpperCase()}function g(n){var t=[];return o(n,function(n,i){t[i]=d(n)}),t}function tt(n){var t={};return c(n,function(n,i){t[i]=n instanceof Array?n.length===1?[n]:Array.apply(null,n):typeof n=="object"?tt(n):n}),t}function ri(){var t=this._dateTimeFormats,n;return t||(n=this.dateTimeFormat,this._dateTimeFormats=t=[n.MonthDayPattern,n.YearMonthPattern,n.ShortDatePattern,n.ShortTimePattern,n.LongDatePattern,n.LongTimePattern,n.FullDateTimePattern,n.RFC1123Pattern,n.SortableDateTimePattern,n.UniversalSortableDateTimePattern]),t}function ui(n,t){var i=t?"_upperAbbrMonths":"_upperMonths",f=i+"Genitive",e=this[i],u,r;return e||(u=t?"Abbreviated":"",this[i]=g(this.dateTimeFormat[u+"MonthNames"]),this[f]=g(this.dateTimeFormat[u+"MonthGenitiveNames"])),n=d(n),r=p(this[i],n),r<0&&(r=p(this[f],n)),r}function fi(n,t){var i=t?"_upperAbbrDays":"_upperDays",r=this[i];return r||(this[i]=g(this.dateTimeFormat[(t?"Abbreviated":"")+"DayNames"])),p(this[i],d(n))}function ei(n,t){Array.add(this._getEvent(n,!0),t)}function oi(n,t){this._addHandler(n,t)}function si(n,t){var i=this._getEvent(n);i&&Array.remove(i,t)}function hi(n){if(n){var t=this._getEvent(n);if(!t)return;t.length=0}else this._list={}}function ci(n,t){this._removeHandler(n,t)}function li(n){var t=this._getEvent(n);return!t||t.length===0?null:(t=Array.clone(t),function(n,i){for(var r=0,u=t.length;r=0;r--)u=h[r],e=u.dispose,e&&typeof e=="function"?(u.dispose(),u.dispose=null,u.__msajaxdispose=null):(f=u.control,f&&typeof f.dispose=="function"&&f.dispose()),i=u._behaviors,i&&this._disposeComponents(i),i=u._components,i&&(this._disposeComponents(i),u._components=null);t||(e=n.dispose,e&&typeof e=="function"?(n.dispose(),n.dispose=null,n.__msajaxdispose=null):(f=n.control,f&&typeof f.dispose=="function"&&f.dispose()),i=n._behaviors,i&&this._disposeComponents(i),i=n._components,i&&(this._disposeComponents(i),n._components=null))}}function gu(){var t,n,f,r,u;if(arguments.length!==0)throw Error.parameterCount();for(t=this._secondPassComponents,n=0,f=t.length;n1e3))){for(i=[],r=0,f=t.length;r=0;t--)i=n[t],typeof i.dispose=="function"&&i.dispose()}function af(){this.beginCreateComponents();i.Observer.raiseEvent(this,"init");this.endCreateComponents()}function v(n){if(n&&n.prototype){for(key in n.prototype)n.prototype.hasOwnProperty(key)&&(n.prototype[key]=null);n.prototype.constructor&&(n.prototype.constructor=null)}}function vf(){if(i.Browser.agent===i.Browser.InternetExplorer&&!(i.Browser.version>9))try{this.dispose();n.$find=null;n.Type=null;n._events=null;v(Function);v(Object);v(String);v(Array);v(RegExp);v(Number);v(Boolean);v(Date);v(Error);for(var t in i.__upperCaseTypes)v(i.__upperCaseTypes[t]);n.Sys=null;n.onload=null;n.onunload=null;n.__msajaxdispose=null;n.dispose=null}catch(r){}}function yf(){if(arguments.length!==0)throw Error.parameterCount();return this._element}function pf(){if(arguments.length!==0)throw Error.parameterCount();var n=i.UI.Behavior.callBaseMethod(this,"get_id");return n?n:!this._element||!this._element.id?"":this._element.id+"$"+this.get_name()}function wf(){if(arguments.length!==0)throw Error.parameterCount();if(this._name)return this._name;var n=Object.getTypeName(this),t=n.lastIndexOf(".");return t!==-1&&(n=n.substr(t+1)),this._initialized||(this._name=n),n}function bf(n){if(n===""||n.charAt(0)===" "||n.charAt(n.length-1)===" ")throw Error.argument("value",i.Res.invalidId);if(typeof this._element[n]!="undefined")throw Error.invalidOperation(String.format(i.Res.behaviorDuplicateName,n));if(this.get_isInitialized())throw Error.invalidOperation(i.Res.cantSetNameAfterInit);this._name=n}function kf(){i.UI.Behavior.callBaseMethod(this,"initialize");var n=this.get_name();n&&(this._element[n]=this)}function df(){var n,t,r;i.UI.Behavior.callBaseMethod(this,"dispose");n=this._element;n&&(t=this.get_name(),t&&(n[t]=null),r=n._behaviors,Array.remove(r,this),r.length||(n._behaviors=null),delete this._element)}function gf(){if(arguments.length!==0)throw Error.parameterCount();return this._element}function ne(){if(arguments.length!==0)throw Error.parameterCount();return this._id||(this._element?this._element.id:"")}function te(){if(arguments.length!==0)throw Error.parameterCount();if(this._parent)return this._parent;if(!this._element)return null;for(var n=this._element.parentNode;n;){if(n.control)return n.control;n=n.parentNode}return null}function ie(n){if(!this._element)throw Error.invalidOperation(i.Res.cantBeCalledAfterDispose);for(var r=[this],t=n;t;){if(Array.contains(r,t))throw Error.invalidOperation(i.Res.circularParentChain);r[r.length]=t;t=t.get_parent()}this._parent=n}function re(){if(arguments.length!==0)throw Error.parameterCount();return null}function ue(){if(arguments.length!==0)throw Error.parameterCount();if(!this._element)throw Error.invalidOperation(i.Res.cantBeCalledAfterDispose);return i.UI.DomElement.getVisibilityMode(this._element)}function fe(n){if(!this._element)throw Error.invalidOperation(i.Res.cantBeCalledAfterDispose);i.UI.DomElement.setVisibilityMode(this._element,n)}function ee(){if(arguments.length!==0)throw Error.parameterCount();if(!this._element)throw Error.invalidOperation(i.Res.cantBeCalledAfterDispose);return i.UI.DomElement.getVisible(this._element)}function oe(n){if(!this._element)throw Error.invalidOperation(i.Res.cantBeCalledAfterDispose);i.UI.DomElement.setVisible(this._element,n)}function se(n){if(!this._element)throw Error.invalidOperation(i.Res.cantBeCalledAfterDispose);i.UI.DomElement.addCssClass(this._element,n)}function he(){i.UI.Control.callBaseMethod(this,"dispose");this._element&&(this._element.control=null,delete this._element);this._parent&&delete this._parent}function ce(){return!1}function le(n,t){this._raiseBubbleEvent(n,t)}function ae(n,t){for(var i=this.get_parent();i;){if(i.onBubbleEvent(n,t))return;i=i.get_parent()}}function ve(n){if(!this._element)throw Error.invalidOperation(i.Res.cantBeCalledAfterDispose);i.UI.DomElement.removeCssClass(this._element,n)}function ye(n){if(!this._element)throw Error.invalidOperation(i.Res.cantBeCalledAfterDispose);i.UI.DomElement.toggleCssClass(this._element,n)}function pe(){if(arguments.length!==0)throw Error.parameterCount();return this._state}function we(){if(arguments.length!==0)throw Error.parameterCount();return this._webRequest}function be(n){if(this.get_started())throw Error.invalidOperation(String.format(i.Res.cannotCallOnceStarted,"set_webRequest"));this._webRequest=n}function ke(){if(arguments.length!==0)throw Error.parameterCount();throw Error.notImplemented();}function de(){if(arguments.length!==0)throw Error.parameterCount();throw Error.notImplemented();}function ge(){if(arguments.length!==0)throw Error.parameterCount();throw Error.notImplemented();}function no(){if(arguments.length!==0)throw Error.parameterCount();throw Error.notImplemented();}function to(){if(arguments.length!==0)throw Error.parameterCount();throw Error.notImplemented();}function io(){if(arguments.length!==0)throw Error.parameterCount();throw Error.notImplemented();}function ro(){if(arguments.length!==0)throw Error.parameterCount();throw Error.notImplemented();}function uo(){if(arguments.length!==0)throw Error.parameterCount();throw Error.notImplemented();}function fo(){if(arguments.length!==0)throw Error.parameterCount();return this._resultObject||(this._resultObject=i.Serialization.JavaScriptSerializer.deserialize(this.get_responseData())),this._resultObject}function eo(){if(arguments.length!==0)throw Error.parameterCount();throw Error.notImplemented();}function oo(){if(arguments.length!==0)throw Error.parameterCount();throw Error.notImplemented();}function so(){throw Error.notImplemented();}function ho(){if(arguments.length!==0)throw Error.parameterCount();throw Error.notImplemented();}function co(){if(arguments.length!==0)throw Error.parameterCount();return this._timedOut}function lo(){if(arguments.length!==0)throw Error.parameterCount();return this._started}function ao(){if(arguments.length!==0)throw Error.parameterCount();return this._responseAvailable}function vo(){if(arguments.length!==0)throw Error.parameterCount();return this._aborted}function yo(){var r,t,u,f,e,o;if(arguments.length!==0)throw Error.parameterCount();if(this._webRequest=this.get_webRequest(),this._started)throw Error.invalidOperation(String.format(i.Res.cannotCallOnceStarted,"executeRequest"));if(this._webRequest===null)throw Error.invalidOperation(i.Res.nullWebRequest);if(r=this._webRequest.get_body(),t=this._webRequest.get_headers(),this._xmlHttpRequest=new XMLHttpRequest,this._xmlHttpRequest.onreadystatechange=this._onReadyStateChange,u=this._webRequest.get_httpVerb(),this._xmlHttpRequest.open(u,this._webRequest.getResolvedUrl(),!0),this._xmlHttpRequest.setRequestHeader("X-Requested-With","XMLHttpRequest"),t)for(f in t)e=t[f],typeof e!="function"&&this._xmlHttpRequest.setRequestHeader(f,e);u.toLowerCase()==="post"&&(t!==null&&t["Content-Type"]||this._xmlHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8"),r||(r=""));o=this._webRequest.get_timeout();o>0&&(this._timer=n.setTimeout(Function.createDelegate(this,this._onTimeout),o));this._xmlHttpRequest.send(r);this._started=!0}function po(n){if(!this._responseAvailable)throw Error.invalidOperation(String.format(i.Res.cannotCallBeforeResponse,"getResponseHeader"));if(!this._xmlHttpRequest)throw Error.invalidOperation(String.format(i.Res.cannotCallOutsideHandler,"getResponseHeader"));var t;try{t=this._xmlHttpRequest.getResponseHeader(n)}catch(r){}return t||(t=""),t}function wo(){if(arguments.length!==0)throw Error.parameterCount();if(!this._responseAvailable)throw Error.invalidOperation(String.format(i.Res.cannotCallBeforeResponse,"getAllResponseHeaders"));if(!this._xmlHttpRequest)throw Error.invalidOperation(String.format(i.Res.cannotCallOutsideHandler,"getAllResponseHeaders"));return this._xmlHttpRequest.getAllResponseHeaders()}function bo(){if(arguments.length!==0)throw Error.parameterCount();if(!this._responseAvailable)throw Error.invalidOperation(String.format(i.Res.cannotCallBeforeResponse,"get_responseData"));if(!this._xmlHttpRequest)throw Error.invalidOperation(String.format(i.Res.cannotCallOutsideHandler,"get_responseData"));return this._xmlHttpRequest.responseText}function ko(){if(arguments.length!==0)throw Error.parameterCount();if(!this._responseAvailable)throw Error.invalidOperation(String.format(i.Res.cannotCallBeforeResponse,"get_statusCode"));if(!this._xmlHttpRequest)throw Error.invalidOperation(String.format(i.Res.cannotCallOutsideHandler,"get_statusCode"));var n=0;try{n=this._xmlHttpRequest.status}catch(t){}return n}function go(){if(arguments.length!==0)throw Error.parameterCount();if(!this._responseAvailable)throw Error.invalidOperation(String.format(i.Res.cannotCallBeforeResponse,"get_statusText"));if(!this._xmlHttpRequest)throw Error.invalidOperation(String.format(i.Res.cannotCallOutsideHandler,"get_statusText"));return this._xmlHttpRequest.statusText}function ns(){if(arguments.length!==0)throw Error.parameterCount();if(!this._responseAvailable)throw Error.invalidOperation(String.format(i.Res.cannotCallBeforeResponse,"get_xml"));if(!this._xmlHttpRequest)throw Error.invalidOperation(String.format(i.Res.cannotCallOutsideHandler,"get_xml"));var n=this._xmlHttpRequest.responseXML;if(n&&n.documentElement)navigator.userAgent.indexOf("MSIE")!==-1&&n.setProperty("SelectionLanguage","XPath");else if(n=i.Net.XMLDOM(this._xmlHttpRequest.responseText),!n||!n.documentElement)return null;return n.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml"&&n.documentElement.tagName==="parsererror"?null:n.documentElement.firstChild&&n.documentElement.firstChild.tagName==="parsererror"?null:n}function ts(){if(arguments.length!==0)throw Error.parameterCount();if(!this._started)throw Error.invalidOperation(i.Res.cannotAbortBeforeStart);this._aborted||this._responseAvailable||this._timedOut||(this._aborted=!0,this._clearTimer(),this._xmlHttpRequest&&!this._responseAvailable&&(this._xmlHttpRequest.onreadystatechange=Function.emptyMethod,this._xmlHttpRequest.abort(),this._xmlHttpRequest=null,this._webRequest.completed(i.EventArgs.Empty)))}function is(n){i.Observer.addEventHandler(this,"invokingRequest",n)}function rs(n){i.Observer.removeEventHandler(this,"invokingRequest",n)}function us(n){i.Observer.addEventHandler(this,"completedRequest",n)}function fs(n){i.Observer.removeEventHandler(this,"completedRequest",n)}function es(){if(arguments.length!==0)throw Error.parameterCount();return this._defaultTimeout}function os(n){if(n<0)throw Error.argumentOutOfRange("value",n,i.Res.invalidTimeout);this._defaultTimeout=n}function ss(){if(arguments.length!==0)throw Error.parameterCount();return this._defaultExecutorType}function hs(n){this._defaultExecutorType=n}function cs(t){var r=t.get_executor(),u,e,f;if(!r){u=!1;try{e=n.eval(this._defaultExecutorType);r=new e}catch(o){u=!0}if(u||!i.Net.WebRequestExecutor.isInstanceOfType(r)||!r)throw Error.argument("defaultExecutorType",String.format(i.Res.invalidExecutorType,this._defaultExecutorType));t.set_executor(r)}r.get_aborted()||(f=new i.Net.NetworkRequestEventArgs(t),i.Observer.raiseEvent(this,"invokingRequest",f),f.get_cancel()||r.executeRequest())}function ls(){if(arguments.length!==0)throw Error.parameterCount();return this._webRequest}function as(n){i.Observer.addEventHandler(this,"completed",n)}function vs(n){i.Observer.removeEventHandler(this,"completed",n)}function ys(n){function t(t,r,u){var f=i.Observer._getContext(t,!0).events.getHandler(u);f&&f(r,n)}t(i.Net.WebRequestManager,this._executor,"completedRequest");t(this,this._executor,"completed");i.Observer.clearEventHandlers(this,"completed")}function ps(){if(arguments.length!==0)throw Error.parameterCount();return this._url}function ws(n){this._url=n}function bs(){if(arguments.length!==0)throw Error.parameterCount();return this._headers}function ks(){if(arguments.length!==0)throw Error.parameterCount();return this._httpVerb===null?this._body===null?"GET":"POST":this._httpVerb}function ds(n){if(n.length===0)throw Error.argument("value",i.Res.invalidHttpVerb);this._httpVerb=n}function gs(){if(arguments.length!==0)throw Error.parameterCount();return this._body}function nh(n){this._body=n}function th(){if(arguments.length!==0)throw Error.parameterCount();return this._userContext}function ih(n){this._userContext=n}function rh(){if(arguments.length!==0)throw Error.parameterCount();return this._executor}function uh(n){if(this._executor!==null&&this._executor.get_started())throw Error.invalidOperation(i.Res.setExecutorAfterActive);this._executor=n;this._executor._set_webRequest(this)}function fh(){if(arguments.length!==0)throw Error.parameterCount();return this._timeout===0?i.Net.WebRequestManager.get_defaultTimeout():this._timeout}function eh(n){if(n<0)throw Error.argumentOutOfRange("value",n,i.Res.invalidTimeout);this._timeout=n}function oh(){if(arguments.length!==0)throw Error.parameterCount();return i.Net.WebRequest._resolveUrl(this._url)}function sh(){if(arguments.length!==0)throw Error.parameterCount();if(this._invokeCalled)throw Error.invalidOperation(i.Res.invokeCalledTwice);i.Net.WebRequestManager.executeRequest(this);this._invokeCalled=!0}function hh(){if(arguments.length!==0)throw Error.parameterCount();return this._timeout||0}function ch(n){if(n<0)throw Error.argumentOutOfRange("value",n,i.Res.invalidTimeout);this._timeout=n}function lh(){if(arguments.length!==0)throw Error.parameterCount();return typeof this._userContext=="undefined"?null:this._userContext}function ah(n){this._userContext=n}function vh(){if(arguments.length!==0)throw Error.parameterCount();return this._succeeded||null}function yh(n){this._succeeded=n}function ph(){if(arguments.length!==0)throw Error.parameterCount();return this._failed||null}function wh(n){this._failed=n}function bh(){if(arguments.length!==0)throw Error.parameterCount();return!!this._jsonp}function kh(n){this._jsonp=n}function dh(){if(arguments.length!==0)throw Error.parameterCount();return this._path||null}function gh(n){this._path=n}function nc(){if(arguments.length!==0)throw Error.parameterCount();return this._callbackParameter||"callback"}function tc(n){this._callbackParameter=n}function ic(n,t,r,u,f,e,o){return f=f||this.get_defaultSucceededCallback(),e=e||this.get_defaultFailedCallback(),(o===null||typeof o=="undefined")&&(o=this.get_defaultUserContext()),i.Net.WebServiceProxy.invoke(n,t,r,u,f,e,o,this.get_timeout(),this.get_enableJsonp(),this.get_jsonpCallbackParameter())}function rc(){if(arguments.length!==0)throw Error.parameterCount();return this._timedOut}function uc(){if(arguments.length!==0)throw Error.parameterCount();return this._statusCode}function fc(){if(arguments.length!==0)throw Error.parameterCount();return this._message}function ec(){if(arguments.length!==0)throw Error.parameterCount();return this._stackTrace||""}function oc(){if(arguments.length!==0)throw Error.parameterCount();return this._exceptionType||""}function sc(){if(arguments.length!==0)throw Error.parameterCount();return this._errorObject||null}function nt(n){this._path=n}var y,p,a,l,k;i._foreach=o;i._forIn=c;i._merge=h;i._callIf=s;Function.__typeName="Function";Function.__class=!0;Function.createCallback=function(n,t){return function(){var u=arguments.length,r,i;if(u>0){for(r=[],i=0;i=e)break;if(r=Function._validateParameter(n[u],f,o),r)return r.popStackFrame(),r}return null};Function._validateParameterCount=function(n,t,i){var r,f,u=t.length,e=n.length,o,s,h;if(eu)for(f=!0,r=0;r0&&(f1&&typeof r=="undefined")throw Error.argumentUndefined("baseType");if(this.prototype.constructor=this,this.__typeName=t,this.__class=!0,r&&(this.__baseType=r,this.__basePrototypePending=!0),i.__upperCaseTypes[t.toUpperCase()]=this,u)for(this.__interfaces=[],this.resolveInheritance(),f=2,h=arguments.length;f=0&&(u=u.substr(c+1),u&&u.charAt(0)==="_"))return;u=u.substr(0,1).toLowerCase()+u.substr(1)}r||(r={});r.name=u;r.type=t;r.typeName=l;r._isBehavior=e;i.components[u]=h(i.components[u],r);f=i.create[u];o=f&&f.defaults;i.create[u]=f=i._getCreate(t,e,r);f.defaults=o||null;f._component=r;n.jQuery&&(s=e?jQuery.fn:jQuery,s.hasOwnProperty(u)||(f=s[u],o=f&&f.defaults,s[u]=f=i._getCreate(t,e,r,!0),f.defaults=o||null,f._component=r))};i._getCreate=function(n,t,i,r){var e=n.getName(),u=[],f=[],s=i&&i.description||"Creates an instance of the type '"+e+"' and sets the given properties.";return u.push("/// ",s,"<\/summary>\n"),t&&!r&&(f.push("target"),u.push('/// The DOM element to attach to, as a DOM element or selector.<\/param>\n')),o(i&&i.parameters,function(n){var t=n,i="",r="";typeof n!="string"&&(t=n.name,i=n.type||"",r=n.description||"");f.push(t);u.push('/// ',r,"<\/param>\n")}),f.push("properties"),u.push('/// Additional properties to set on the component.<\/param>\n'),r?u.push("var callee = arguments.callee, component = callee._component, defaults = callee.defaults, args = Array.prototype.slice.call(arguments, 0);\nargs.splice(0, 0, null);\nreturn this.each(function() {\n"," args[0] = this;\n Sys._createComp(component, defaults, args)\n","});"):u.push('/// <\/returns>\n',"return Sys._createComp(arguments.callee._component, arguments.callee.defaults, arguments);"),f.push(u.join("")),Function.apply(null,f)};i.registerPlugin=function(t){var r=t.name;i.plugins[r]=h(i.plugins[r],t);i[r]=t.plugin;n.jQuery&&(jQuery[r]=i[r])};i._createComp=function(n,t,r){var e=n.parameters||[],f=n._isBehavior,c=f?r[0]:null,s=f?1:0,u=r[e.length+s]||{};return u=h({},t,u),o(e,function(n,t){var i=typeof n=="string"?n:n.name,f=r[t+s];typeof f!="undefined"&&typeof u[i]=="undefined"&&(u[i]=f)}),f?i._create(n.type,u,c):i._create(n.type,u)};i._create=function(n,t,r){var f=typeof r,u;return f==="string"&&(r=i.get(r)),i._2Pass(function(){u=f==="undefined"?new n:new n(r);s(u,"beginUpdate");i._setProps(u,t);var e=i.Component;e&&e._register(u)||s(u,"endUpdate")||s(u,"initialize")}),u};i._setProps=function(n,t){c(t,function(t,i){s(n,"add_"+i,t)||s(n,"set_"+i,t)||(n[i]=t)})};Type.prototype.registerInterface=function(t){if(!Type.__fullyQualifiedIdentifierRegExp.test(t))throw Error.argument("typeName",i.Res.notATypeName);var r;try{r=n.eval(t)}catch(u){throw Error.argument("typeName",i.Res.argumentTypeName);}if(r!==this)throw Error.argument("typeName",i.Res.badTypeName);if(i.__registeredTypes[t])throw Error.invalidOperation(String.format(i.Res.typeRegisteredTwice,t));return i.__upperCaseTypes[t.toUpperCase()]=this,this.prototype.constructor=this,this.__typeName=t,this.__interface=!0,i.__registeredTypes[t]=!0,this};Type.prototype.resolveInheritance=function(){var n,t,i;if(arguments.length!==0)throw Error.parameterCount();if(this.__basePrototypePending){n=this.__baseType;n.resolveInheritance();for(t in n.prototype)i=n.prototype[t],this.prototype[t]||(this.prototype[t]=i);delete this.__basePrototypePending}};Type.getRootNamespaces=function(){if(arguments.length!==0)throw Error.parameterCount();return Array.clone(i.__rootNamespaces)};Type.isClass=function(n){return typeof n=="undefined"||n===null?!1:!!n.__class};Type.isInterface=function(n){return typeof n=="undefined"||n===null?!1:!!n.__interface};Type.isNamespace=function(n){return typeof n=="undefined"||n===null?!1:!!n.__namespace};Type.parse=function(t,r){var u;if(r)return u=i.__upperCaseTypes[r.getName().toUpperCase()+"."+t.toUpperCase()],u||null;if(!t)return null;if(Type.__htClasses||(Type.__htClasses={}),u=Type.__htClasses[t],!u){if(u=n.eval(t),typeof u!="function")throw Error.argument("typeName",i.Res.notATypeName);Type.__htClasses[t]=u}return u};Type.registerNamespace=function(n){Type._registerNamespace(n)};Type._registerNamespace=function(t){var e,f,u,h,s;if(!Type.__fullyQualifiedIdentifierRegExp.test(t))throw Error.argument("namespacePath",i.Res.invalidNameSpace);for(e=n,f=t.split("."),u=0,h=f.length;u=0};Array.dequeue=function(n){return n.shift()};Array.forEach=function(n,t,i){for(var u,r=0,f=n.length;r=0&&n.splice(i,1),i>=0};Array.removeAt=function(n,t){n.splice(t,1)};p=i._indexOf=function(n,t,i){var u,r;if(typeof t=="undefined")return-1;if(u=n.length,u!==0)for(i=+i,isNaN(i)?i=0:(isFinite(i)&&(i=i-i%1),i<0&&(i=Math.max(0,u+i))),r=i;r-1?(l.agent=l.InternetExplorer,l.version=parseFloat(a.match(/MSIE (\d+\.\d+)/)[1]),l.version>7&&document.documentMode>6&&(l.documentMode=document.documentMode),l.hasDebuggerStatement=!0,l.name="InternetExplorer"):a.indexOf(" Edge/")>-1?(l.agent=l.InternetExplorer,l.version=parseFloat(a.match(/ Edge\/(\d+\.\d+)/)[1]),l.hasDebuggerStatement=!0):a.indexOf(" Firefox/")>-1?(l.agent=l.Firefox,l.version=parseFloat(a.match(/ Firefox\/(\d+\.\d+)/)[1]),l.name="Firefox",l.hasDebuggerStatement=!0):a.indexOf(" AppleWebKit/")>-1?(l.agent=l.Safari,l.version=parseFloat(a.match(/ AppleWebKit\/(\d+(\.\d+)?)/)[1]),l.name="Safari"):a.indexOf("Opera/")>-1?l.agent=l.Opera:a.indexOf("Trident")>-1&&(l.agent=l.InternetExplorer,l.version=parseFloat(a.match(/rv\:(\d+\.\d+)/)[1]),l.documentMode=document.documentMode,l.hasDebuggerStatement=!0,l.name="InternetExplorer");i.EventArgs=function(){if(arguments.length!==0)throw Error.parameterCount();};i.EventArgs.registerClass("Sys.EventArgs");i.EventArgs.Empty=new i.EventArgs;i.CancelEventArgs=function(){if(arguments.length!==0)throw Error.parameterCount();i.CancelEventArgs.initializeBase(this);this._cancel=!1};i.CancelEventArgs.prototype={get_cancel:lt,set_cancel:at};i.CancelEventArgs.registerClass("Sys.CancelEventArgs",i.EventArgs);Type.registerNamespace("Sys.UI");i._Debug=function(){if(arguments.length!==0)throw Error.parameterCount();};i._Debug.prototype={_appendConsole:vt,_appendTrace:yt,assert:pt,clearTrace:wt,fail:bt,trace:kt,traceDump:dt,_traceDump:gt};i._Debug.registerClass("Sys._Debug");i.Debug=new i._Debug;i.Debug.isDebug=!0;Type.prototype.registerEnum=function(t,r){var o,u,f,e;if(!Type.__fullyQualifiedIdentifierRegExp.test(t))throw Error.argument("name",i.Res.notATypeName);try{o=n.eval(t)}catch(s){throw Error.argument("name",i.Res.argumentTypeName);}if(o!==this)throw Error.argument("name",i.Res.badTypeName);if(i.__registeredTypes[t])throw Error.invalidOperation(String.format(i.Res.typeRegisteredTwice,t));for(u in this.prototype){if(f=this.prototype[u],!Type.__identifierRegExp.test(u))throw Error.invalidOperation(String.format(i.Res.enumInvalidValueName,u));if(typeof f!="number"||f%1!=0)throw new Error(u);if(typeof this[u]!="undefined")throw Error.invalidOperation(String.format(i.Res.enumReservedName,u));}i.__upperCaseTypes[t.toUpperCase()]=this;for(e in this.prototype)this[e]=this.prototype[e];this.__typeName=t;this.parse=ni;this.__string=this.toString();this.toString=ti;this.__flags=r;this.__enum=!0;i.__registeredTypes[t]=!0};Type.isEnum=function(n){return typeof n=="undefined"||n===null?!1:!!n.__enum};Type.isFlags=function(n){return typeof n=="undefined"||n===null?!1:!!n.__flags};i.CollectionChange=function(n,t,i,r,u){this.action=n;t&&(t instanceof Array||(t=[t]));this.newItems=t||null;typeof i!="number"&&(i=-1);this.newStartingIndex=i;r&&(r instanceof Array||(r=[r]));this.oldItems=r||null;typeof u!="number"&&(u=-1);this.oldStartingIndex=u};i.CollectionChange.registerClass("Sys.CollectionChange");i.NotifyCollectionChangedAction=function(){if(arguments.length!==0)throw Error.parameterCount();throw Error.notImplemented();};i.NotifyCollectionChangedAction.prototype={add:0,remove:1,reset:2};i.NotifyCollectionChangedAction.registerEnum("Sys.NotifyCollectionChangedAction");i.NotifyCollectionChangedEventArgs=function(n){this._changes=n;i.NotifyCollectionChangedEventArgs.initializeBase(this)};i.NotifyCollectionChangedEventArgs.prototype={get_changes:ii};i.NotifyCollectionChangedEventArgs.registerClass("Sys.NotifyCollectionChangedEventArgs",i.EventArgs);i.Observer=function(){throw Error.invalidOperation();};i.Observer.registerClass("Sys.Observer");i.Observer.makeObservable=function(n){var r=n instanceof Array,t=i.Observer;return(i.Observer._ensureObservable(n),n.setValue===t._observeMethods.setValue)?n:(t._addMethods(n,t._observeMethods),r&&t._addMethods(n,t._arrayMethods),n)};i.Observer.disposeObservable=function(n){var r=n instanceof Array,t=i.Observer;n.setValue===t._observeMethods.setValue&&(t._removeMethods(n,t._observeMethods),r&&t._removeMethods(n,t._arrayMethods))};i.Observer._ensureObservable=function(n){var t=typeof n;if(t==="string"||t==="number"||t==="boolean"||t==="date")throw Error.invalidOperation(String.format(i.Res.notObservable,t));};i.Observer._addMethods=function(n,t){for(var i in t)n[i]=t[i]};i.Observer._removeMethods=function(n,t){for(var i in t)n[i]=null};i.Observer._addEventHandler=function(n,t,r){i.Observer._getContext(n,!0).events._addHandler(t,r)};i.Observer.addEventHandler=function(n,t,r){i.Observer._ensureObservable(n);i.Observer._addEventHandler(n,t,r)};i.Observer._removeEventHandler=function(n,t,r){i.Observer._getContext(n,!0).events._removeHandler(t,r)};i.Observer.removeEventHandler=function(n,t,r){i.Observer._ensureObservable(n);i.Observer._removeEventHandler(n,t,r)};i.Observer.clearEventHandlers=function(n,t){i.Observer._ensureObservable(n);i.Observer._getContext(n,!0).events._removeHandlers(t)};i.Observer.raiseEvent=function(n,t,r){var u,f;(i.Observer._ensureObservable(n),u=i.Observer._getContext(n),u)&&(f=u.events.getHandler(t),f&&f(n,r||i.EventArgs.Empty))};i.Observer.addPropertyChanged=function(n,t){i.Observer._ensureObservable(n);i.Observer._addEventHandler(n,"propertyChanged",t)};i.Observer.removePropertyChanged=function(n,t){i.Observer._ensureObservable(n);i.Observer._removeEventHandler(n,"propertyChanged",t)};i.Observer.beginUpdate=function(n){i.Observer._ensureObservable(n);i.Observer._getContext(n,!0).updating=!0};i.Observer.endUpdate=function(n){var t,r,u;(i.Observer._ensureObservable(n),t=i.Observer._getContext(n),t&&t.updating)&&(t.updating=!1,r=t.dirty,t.dirty=!1,r&&(n instanceof Array&&(u=t.changes,t.changes=null,i.Observer.raiseCollectionChanged(n,u)),i.Observer.raisePropertyChanged(n,"")))};i.Observer.isUpdating=function(n){i.Observer._ensureObservable(n);var t=i.Observer._getContext(n);return t?t.updating:!1};i.Observer._setValue=function(n,t,r){for(var c,y,l,p,f,s,u,e,a=n,o=t.split("."),h=0,v=o.length-1;h-1&&tn.Calendar.TwoDigitYearMax&&(t-=100)),t};Date._getEra=function(n,t){var r,u,i,f;if(!t)return 0;for(u=n.getTime(),i=0,f=t.length;i=r)return i;return 0};Date._getEraYear=function(n,t,i,r){var u=n.getFullYear();return!r&&t.eras&&(u-=t.eras[i+3]),u};Date._getParseRegExp=function(n,t){var u,l,a,o;if(n._parseRegExp){if(n._parseRegExp[t])return n._parseRegExp[t]}else n._parseRegExp={};u=Date._expandFormat(n,t);u=u.replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g,"\\\\$1");for(var r=new i.StringBuilder("^"),s=[],e=0,h=0,c=Date._getTokenRegExp(),f;(f=c.exec(u))!==null;){if(l=u.slice(e,f.index),e=c.lastIndex,h+=Date._appendPreOrPostMatch(l,r),h%2==1){r.append(f[0]);continue}switch(f[0]){case"dddd":case"ddd":case"MMMM":case"MMM":case"gg":case"g":r.append("(\\D+)");break;case"tt":case"t":r.append("(\\D*)");break;case"yyyy":r.append("(\\d{4})");break;case"fff":r.append("(\\d{3})");break;case"ff":r.append("(\\d{2})");break;case"f":r.append("(\\d)");break;case"dd":case"d":case"MM":case"M":case"yy":case"y":case"HH":case"H":case"hh":case"h":case"mm":case"m":case"ss":case"s":r.append("(\\d\\d?)");break;case"zzz":r.append("([+-]?\\d\\d?:\\d{2})");break;case"zz":case"z":r.append("([+-]?\\d\\d?)");break;case"/":r.append("(\\"+n.DateSeparator+")")}Array.add(s,f[0])}return Date._appendPreOrPostMatch(u.slice(e),r),r.append("$"),a=r.toString().replace(/\s+/g,"\\s+"),o={regExp:a,groups:s},n._parseRegExp[t]=o,o};Date._getTokenRegExp=function(){return/\/|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|gg|g/g};Date.parseLocale=function(n){return Date._parse(n,i.CultureInfo.CurrentCulture,arguments)};Date.parseInvariant=function(n){return Date._parse(n,i.CultureInfo.InvariantCulture,arguments)};Date._parse=function(n,t,i){for(var u,e,o,s=!1,r=1,f=i.length;r31)return null;break;case"MMMM":if(u=i._getMonthIndex(r),u<0||u>11)return null;break;case"MMM":if(u=i._getMonthIndex(r,!0),u<0||u>11)return null;break;case"M":case"MM":if(u=parseInt(r,10)-1,u<0||u>11)return null;break;case"y":case"yy":if(e=Date._expandYear(s,parseInt(r,10)),e<0||e>9999)return null;break;case"yyyy":if(e=parseInt(r,10),e<0||e>9999)return null;break;case"h":case"hh":if(o=parseInt(r,10),o===12&&(o=0),o<0||o>11)return null;break;case"H":case"HH":if(o=parseInt(r,10),o<0||o>23)return null;break;case"m":case"mm":if(k=parseInt(r,10),k<0||k>59)return null;break;case"s":case"ss":if(d=parseInt(r,10),d<0||d>59)return null;break;case"tt":case"t":if(rt=r.toUpperCase(),it=rt===s.PMDesignator.toUpperCase(),!it&&rt!==s.AMDesignator.toUpperCase())return null;break;case"f":if(c=parseInt(r,10)*100,c<0||c>999)return null;break;case"ff":if(c=parseInt(r,10)*10,c<0||c>999)return null;break;case"fff":if(c=parseInt(r,10),c<0||c>999)return null;break;case"dddd":if(l=i._getDayIndex(r),l<0||l>6)return null;break;case"ddd":if(l=i._getDayIndex(r,!0),l<0||l>6)return null;break;case"zzz":if((nt=r.split(/:/),nt.length!==2)||(a=parseInt(nt[0],10),a<-12||a>13)||(y=parseInt(nt[1],10),y<0||y>59))return null;g=a*60+(r.startsWith("-")?-y:y);break;case"z":case"zz":if(a=parseInt(r,10),a<-12||a>13)return null;g=a*60;break;case"g":case"gg":if(p=r,!p||!s.eras)return null;for(p=p.toLowerCase().trim(),w=0,ht=s.eras.length;w1?parseInt(c[1]):0,c=e.split("."),e=c[0],f=c.length>1?c[1]:"",o>0?(f=h(f,o,!1),e+=f.slice(0,o),f=f.substr(o)):o<0&&(o=-o,e=h(e,o+1,!0),f=e.slice(-o,e.length)+f,e=e.slice(0,-o)),t>0?(f=f.length>t?f.slice(0,t):h(f,t,!1),f=u+f):f="",s=e.length-1,l="";s>=0;){if(a===0||a>s)return l.length>0?e.slice(0,s+1)+r+l+f:e.slice(0,s+1)+f;l=l.length>0?e.slice(s-a+1,s+1)+r+l:e.slice(s-a+1,s+1);s-=a;v0?this.toLocaleString():this.toString();r=t.numberFormat;f=Math.abs(this);n||(n="D");u=-1;n.length>1&&(u=parseInt(n.slice(1),10));switch(n.charAt(0)){case"d":case"D":e="n";u!==-1&&(f=h(""+f,u,!0));this<0&&(f=-f);break;case"c":case"C":e=this<0?["($n)","-$n","$-n","$n-","(n$)","-n$","n-$","n$-","-n $","-$ n","n $-","$ n-","$ -n","n- $","($ n)","(n $)"][r.CurrencyNegativePattern]:["$n","n$","$ n","n $"][r.CurrencyPositivePattern];u===-1&&(u=r.CurrencyDecimalDigits);f=c(Math.abs(this),u,r.CurrencyGroupSizes,r.CurrencyGroupSeparator,r.CurrencyDecimalSeparator);break;case"n":case"N":e=this<0?["(n)","-n","- n","n-","n -"][r.NumberNegativePattern]:"n";u===-1&&(u=r.NumberDecimalDigits);f=c(Math.abs(this),u,r.NumberGroupSizes,r.NumberGroupSeparator,r.NumberDecimalSeparator);break;case"p":case"P":e=this<0?["-n %","-n%","-%n"][r.PercentNegativePattern]:["n %","n%","%n"][r.PercentPositivePattern];u===-1&&(u=r.PercentDecimalDigits);f=c(Math.abs(this)*100,u,r.PercentGroupSizes,r.PercentGroupSeparator,r.PercentDecimalSeparator);break;default:throw Error.format(i.Res.formatBadFormatSpecifier);}for(l=/n|\$|-|%/g,o="";;){if(a=l.lastIndex,s=l.exec(e),o+=e.slice(a,s?s.index:e.length),!s)break;switch(s[0]){case"n":o+=f;break;case"$":o+=r.CurrencySymbol;break;case"-":/[1-9]/.test(f)&&(o+=r.NegativeSign);break;case"%":o+=r.PercentSymbol}}return o};i.CultureInfo=function(n,t,i){this.name=n;this.numberFormat=t;this.dateTimeFormat=i};i.CultureInfo.prototype={_getDateTimeFormats:ri,_getMonthIndex:ui,_getDayIndex:fi};i.CultureInfo.registerClass("Sys.CultureInfo");h(i.CultureInfo,{_parse:function(n){var t=n.dateTimeFormat;return t&&!t.eras&&(t.eras=n.eras),new i.CultureInfo(n.name,n.numberFormat,t)},_setup:function(){var t=n.__cultureInfo,r=["January","February","March","April","May","June","July","August","September","October","November","December",""],u=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],f={name:"",numberFormat:{CurrencyDecimalDigits:2,CurrencyDecimalSeparator:".",CurrencyGroupSizes:[3],NumberGroupSizes:[3],PercentGroupSizes:[3],CurrencyGroupSeparator:",",CurrencySymbol:"¤",NaNSymbol:"NaN",CurrencyNegativePattern:0,NumberNegativePattern:1,PercentPositivePattern:0,PercentNegativePattern:0,NegativeInfinitySymbol:"-Infinity",NegativeSign:"-",NumberDecimalDigits:2,NumberDecimalSeparator:".",NumberGroupSeparator:",",CurrencyPositivePattern:0,PositiveInfinitySymbol:"Infinity",PositiveSign:"+",PercentDecimalDigits:2,PercentDecimalSeparator:".",PercentGroupSeparator:",",PercentSymbol:"%",PerMilleSymbol:"‰",NativeDigits:["0","1","2","3","4","5","6","7","8","9"],DigitSubstitution:1},dateTimeFormat:{AMDesignator:"AM",Calendar:{MinSupportedDateTime:"@-62135568000000@",MaxSupportedDateTime:"@253402300799999@",AlgorithmType:1,CalendarType:1,Eras:[1],TwoDigitYearMax:2029},DateSeparator:"/",FirstDayOfWeek:0,CalendarWeekRule:0,FullDateTimePattern:"dddd, dd MMMM yyyy HH:mm:ss",LongDatePattern:"dddd, dd MMMM yyyy",LongTimePattern:"HH:mm:ss",MonthDayPattern:"MMMM dd",PMDesignator:"PM",RFC1123Pattern:"ddd, dd MMM yyyy HH':'mm':'ss 'GMT'",ShortDatePattern:"MM/dd/yyyy",ShortTimePattern:"h:mm tt",SortableDateTimePattern:"yyyy'-'MM'-'dd'T'HH':'mm':'ss",TimeSeparator:":",UniversalSortableDateTimePattern:"yyyy'-'MM'-'dd HH':'mm':'ss'Z'",YearMonthPattern:"yyyy MMMM",AbbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ShortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],DayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],AbbreviatedMonthNames:u,MonthNames:r,NativeCalendarName:"Gregorian Calendar",AbbreviatedMonthGenitiveNames:Array.clone(u),MonthGenitiveNames:Array.clone(r)},eras:[1,"A.D.",null,0]},i;this.InvariantCulture=this._parse(f);switch(typeof t){case"string":t=n.eval("("+t+")");case"object":this.CurrentCulture=this._parse(t);try{delete __cultureInfo}catch(e){__cultureInfo=null}break;default:t=tt(f);t.name="en-US";t.numberFormat.CurrencySymbol="$";i=t.dateTimeFormat;i.FullDatePattern="dddd, MMMM dd, yyyy h:mm:ss tt";i.LongDatePattern="dddd, MMMM dd, yyyy";i.LongTimePattern="h:mm:ss tt";i.ShortDatePattern="M/d/yyyy";i.ShortTimePattern="h:mm tt";i.YearMonthPattern="MMMM, yyyy";this.CurrentCulture=this._parse(t)}}});i.CultureInfo._setup();Type.registerNamespace("Sys.Serialization");i.Serialization.JavaScriptSerializer=function(){if(arguments.length!==0)throw Error.parameterCount();};i.Serialization.JavaScriptSerializer.registerClass("Sys.Serialization.JavaScriptSerializer");h(i.Serialization.JavaScriptSerializer,{_esc:{charsRegExs:{'"':/\"/g,"\\":/\\/g},chars:["\\",'"'],dateRegEx:/(^|[^\\])\"\\\/Date\((-?[0-9]+)(?:[a-zA-Z]|(?:\+|-)[0-9]{4})?\)\\\/\"/g,escapeChars:{"\\":"\\\\",'"':'\\"',"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r"},escapeRegExG:/[\"\\\x00-\x1F]/g,escapeRegEx:/[\"\\\x00-\x1F]/i,jsonRegEx:/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/g,jsonStringRegEx:/\"(\\.|[^\"\\])*\"/g},_init:function(){for(var n,i=this._esc,u=i.chars,f=i.charsRegExs,r=i.escapeChars,t=0;t<32;t++)n=String.fromCharCode(t),u[t+2]=n,f[n]=new RegExp(n,"g"),r[n]=r[n]||"\\u"+("000"+t.toString(16)).slice(-4);this._load=!0},_serializeNumberWithBuilder:function(n,t){if(!isFinite(n))throw Error.invalidOperation(i.Res.cannotSerializeNonFiniteNumbers);t.append(String(n))},_serializeStringWithBuilder:function(n,t){var i,u,r,f;if(t.append('"'),i=this._esc,i.escapeRegEx.test(n))if(this._load||this._init(),n.length<128)n=n.replace(i.escapeRegExG,function(n){return i.escapeChars[n]});else for(u=0;u<34;u++)r=i.chars[u],n.indexOf(r)!==-1&&(f=i.escapeChars[r],n=y("Opera")||y("Firefox")?n.split(r).join(f):n.replace(i.charsRegExs[r],f));t.append(n).append('"')},_serializeWithBuilder:function(n,t,r,u){var f,e,o,s,h;switch(typeof n){case"object":if(n){if(u){if(i._indexOf(u,n)!==-1)throw Error.invalidOperation(i.Res.cannotSerializeObjectWithCycle);}else u=[];try{if(u.push(n),Number.isInstanceOfType(n))this._serializeNumberWithBuilder(n,t);else if(Boolean.isInstanceOfType(n))t.append(n);else if(String.isInstanceOfType(n))this._serializeStringWithBuilder(n,t);else if(n instanceof Array){for(t.append("["),f=0;f=0;i--)e=f[i],(!t||e.autoRemove)&&$removeHandler(n,u,e.handler)}})};i.UI.DomEvent._disposeHandlers=function(){i.UI.DomEvent._clearHandlers(this,!0)};$removeHandler=i.UI.DomEvent.removeHandler=function(n,t,r){i.UI.DomEvent._removeHandler(n,t,r)};i.UI.DomEvent._removeHandler=function(n,t,r){i._queryAll(n,function(n){var e=null,u,f,o,s;if(typeof n._events!="object"||!n._events){typeof console!="undefined"&&console.error&&(console.error("element events does not exist"),console.error("handler: "+r.toString()),console.error(i.Res.eventHandlerInvalid));return}if(u=n._events[t],!(u instanceof Array)){typeof console!="undefined"&&console.error&&(console.error("cache is not an array: "+u),console.error("handler: "+r.toString()),console.error(i.Res.eventHandlerInvalid));return}for(f=0,o=u.length;f=3&&(f+=parseInt(r.borderLeftWidth),e+=parseInt(r.borderTopWidth));if(r=i.UI.DomElement._getCurrentStyle(n),s=r?r.position:null,!s||s!=="absolute")for(t=n.parentNode;t;t=t.parentNode)if(u=t.tagName?t.tagName.toUpperCase():null,u!=="BODY"&&u!=="HTML"&&(t.scrollLeft||t.scrollTop)&&(f-=t.scrollLeft||0,e-=t.scrollTop||0),r=i.UI.DomElement._getCurrentStyle(t),h=r?r.position:null,h&&h==="absolute")break;return new i.UI.Point(f,e)}:function(n){var u,s;if(n.window&&n.window===n||n.nodeType===9)return new i.UI.Point(0,0);for(var f=0,e=0,h=null,o=null,r=null,t=n;t;h=t,o=r,t=t.offsetParent)u=t.tagName?t.tagName.toUpperCase():null,r=i.UI.DomElement._getCurrentStyle(t),!(t.offsetLeft||t.offsetTop)||u==="BODY"&&(!o||o.position!=="absolute")||(f+=t.offsetLeft,e+=t.offsetTop),h!==null&&r&&(u!=="TABLE"&&u!=="TD"&&u!=="HTML"&&(f+=parseInt(r.borderLeftWidth)||0,e+=parseInt(r.borderTopWidth)||0),u==="TABLE"&&(r.position==="relative"||r.position==="absolute")&&(f+=parseInt(r.marginLeft)||0,e+=parseInt(r.marginTop)||0));if(r=i.UI.DomElement._getCurrentStyle(n),s=r?r.position:null,!s||s!=="absolute")for(t=n.parentNode;t;t=t.parentNode)u=t.tagName?t.tagName.toUpperCase():null,u!=="BODY"&&u!=="HTML"&&(t.scrollLeft||t.scrollTop)&&(f-=t.scrollLeft||0,e-=t.scrollTop||0,r=i.UI.DomElement._getCurrentStyle(t),r&&(f+=parseInt(r.borderLeftWidth)||0,e+=parseInt(r.borderTopWidth)||0));return new i.UI.Point(f,e)};i.UI.DomElement.isDomElement=function(n){return i._isDomElement(n)};i.UI.DomElement.removeCssClass=function(n,t){var i=" "+n.className+" ",r=i.indexOf(" "+t+" ");r>=0&&(n.className=(i.substr(0,r)+" "+i.substring(r+t.length+1,i.length)).trim())};i.UI.DomElement.resolveElement=function(n,t){var r=n;if(!r)return null;if(typeof r=="string"){if(r=i.get("#"+r,t),!r)throw Error.argument("elementOrElementId",String.format(i.Res.elementNotFound,n));}else if(!i.UI.DomElement.isDomElement(r))throw Error.argument("elementOrElementId",i.Res.expectedElementOrId);return r};i.UI.DomElement.raiseBubbleEvent=function(n,t){for(var r=n,i;r;){if(i=r.control,i&&i.onBubbleEvent&&i.raiseBubbleEvent){i.onBubbleEvent(n,t)||i._raiseBubbleEvent(n,t);return}r=r.parentNode}};i.UI.DomElement._ensureGet=function(n,t,r){var u=i.get(n,t);if(u||typeof n!="string"){if(u&&!this.isDomElement(u))throw Error.invalidOperation(String.format(i.Res.expectedDomElementOrSelector,r));}else throw Error.invalidOperation(String.format(i.Res.selectorNotFound,n));return u};i.UI.DomElement.setLocation=function(n,t,i){var r=n.style;r.position="absolute";r.left=t+"px";r.top=i+"px"};i.UI.DomElement.toggleCssClass=function(n,t){i.UI.DomElement.containsCssClass(n,t)?i.UI.DomElement.removeCssClass(n,t):i.UI.DomElement.addCssClass(n,t)};i.UI.DomElement.getVisibilityMode=function(n){return n._visibilityMode===i.UI.VisibilityMode.hide?i.UI.VisibilityMode.hide:i.UI.VisibilityMode.collapse};i.UI.DomElement.setVisibilityMode=function(n,t){i.UI.DomElement._ensureOldDisplayMode(n);n._visibilityMode!==t&&(n._visibilityMode=t,i.UI.DomElement.getVisible(n)===!1&&(n.style.display=n._visibilityMode===i.UI.VisibilityMode.hide?n._oldDisplayMode:"none"),n._visibilityMode=t)};i.UI.DomElement.getVisible=function(n){var t=n.currentStyle||i.UI.DomElement._getCurrentStyle(n);return t?t.visibility!=="hidden"&&t.display!=="none":!0};i.UI.DomElement.setVisible=function(n,t){t!==i.UI.DomElement.getVisible(n)&&(i.UI.DomElement._ensureOldDisplayMode(n),n.style.visibility=t?"visible":"hidden",n.style.display=t||n._visibilityMode===i.UI.VisibilityMode.hide?n._oldDisplayMode:"none")};i.UI.DomElement.setCommand=function(n,t,r,u){i.UI.DomEvent.addHandler(n,"click",function(){var n=u||this;i.UI.DomElement.raiseBubbleEvent(n,new i.CommandEventArgs(t,r,this))},!0)};i.registerPlugin({name:"setCommand",plugin:i.UI.DomElement.setCommand});i.UI.DomElement._ensureOldDisplayMode=function(n){if(!n._oldDisplayMode){var t=n.currentStyle||i.UI.DomElement._getCurrentStyle(n);if(n._oldDisplayMode=t?t.display:null,!n._oldDisplayMode||n._oldDisplayMode==="none")switch(n.tagName.toUpperCase()){case"DIV":case"P":case"ADDRESS":case"BLOCKQUOTE":case"BODY":case"COL":case"COLGROUP":case"DD":case"DL":case"DT":case"FIELDSET":case"FORM":case"H1":case"H2":case"H3":case"H4":case"H5":case"H6":case"HR":case"IFRAME":case"LEGEND":case"OL":case"PRE":case"TABLE":case"TD":case"TH":case"TR":case"UL":n._oldDisplayMode="block";break;case"LI":n._oldDisplayMode="list-item";break;default:n._oldDisplayMode="inline"}}};i.UI.DomElement._getWindow=function(n){var t=n.ownerDocument||n.document||n;return t.defaultView||t.parentWindow};i.UI.DomElement._getCurrentStyle=function(n){var t,r,e,o,u,f;if(n.nodeType===3)return null;if(t=i.UI.DomElement._getWindow(n),n.documentElement&&(n=n.documentElement),r=t&&n!==t&&t.getComputedStyle?t.getComputedStyle(n,null):n.currentStyle||n.style,!r&&y("Safari")&&n.style){e=n.style.display;o=n.style.position;n.style.position="absolute";n.style.display="block";u=t.getComputedStyle(n,null);n.style.display=e;n.style.position=o;r={};for(f in u)r[f]=u[f];r.display="none"}return r};i.UI.DomElement._onDispose=function(n,t){var r,u=n.dispose;u!==i.UI.DomElement._dispose?(n.dispose=i.UI.DomElement._dispose,n.__msajaxdispose=r=[],typeof u=="function"&&r.push(u)):r=n.__msajaxdispose;r.push(t)};i.UI.DomElement._dispose=function(){var t=this.__msajaxdispose,n,i;if(t)for(n=0,i=t.length;n0&&t.charAt(0)==="#"&&(t=t.substring(1)),t)};i._Application.prototype.get_enableHistory=function(){if(arguments.length!==0)throw Error.parameterCount();return this._enableHistory};i._Application.prototype.set_enableHistory=function(n){if(this._initialized&&!this._initializing)throw Error.invalidOperation(i.Res.historyCannotEnableHistory);else if(this._historyEnabledInScriptManager&&!n)throw Error.invalidOperation(i.Res.invalidHistorySettingCombination);this._enableHistory=n};i._Application.prototype.add_navigate=function(n){this._addHandler("navigate",n)};i._Application.prototype.remove_navigate=function(n){this._removeHandler("navigate",n)};i._Application.prototype.addHistoryPoint=function(n,t){var s,e,f,r,u,o,h;if(!this._enableHistory)throw Error.invalidOperation(i.Res.historyCannotAddHistoryPointWithHistoryDisabled);for(s in n)if(e=n[s],f=typeof e,e!==null&&(f==="object"||f==="function"||f==="undefined"))throw Error.argument("state",i.Res.stateMustBeStringDictionary);this._ensureHistory();r=this._state;for(u in n)o=n[u],o===null?typeof r[u]!="undefined"&&delete r[u]:r[u]=o;h=this._serializeState(r);this._historyPointIsNew=!0;this._setState(h,t);this._raiseNavigate()};i._Application.prototype.setServerId=function(n,t){this._clientId=n;this._uniqueId=t};i._Application.prototype.setServerState=function(n){this._ensureHistory();this._state.__s=n;this._updateHiddenField(n)};i._Application.prototype._deserializeState=function(n){var f={},t,e,u,o,i,r,s,h;for(n=n||"",t=n.indexOf("&&"),t!==-1&&t+27?(o=document.title,document.title=e,this._setState(r),document.title=o):this._setState(r),this._raiseNavigate()):(this._setState(r),this._raiseNavigate()))};i._Application.prototype._raiseNavigate=function(){var f=this._historyPointIsNew,r={},t,u;for(t in this._state)t!=="__s"&&(r[t]=this._state[t]);if(u=new i.HistoryEventArgs(r),i.Observer.raiseEvent(this,"navigate",u),!f)try{y("Firefox")&&n.location.hash&&(!n.frameElement||n.top.location.hash)&&(i.Browser.version<3.5?n.history.go(0):location.hash=this.get_stateString())}catch(e){}};i._Application.prototype._serializeState=function(n){var r=[],t,u,f;for(t in n)if(u=n[t],t==="__s")f=u;else{if(t.indexOf("=")!==-1)throw Error.argument("state",i.Res.stateFieldNameInvalid);r[r.length]=t+"="+encodeURIComponent(u)}return r.join("&")+(f?"&&"+f:"")};i._Application.prototype._setState=function(t,r){var u,e,f,s,o;if(this._enableHistory&&(t=t||"",t!==this._currentEntry)){if(n.theForm&&(u=n.theForm.action,e=u.indexOf("#"),n.theForm.action=(e!==-1?u.substring(0,e):u)+"#"+t),this._historyFrame&&this._historyPointIsNew&&(this._ignoreIFrame=!0,f=this._historyFrame.contentWindow.document,f.open("javascript:'<\/html>'"),f.write(""+(r||document.title)+'<\/title><script type="text/javascript">parent.Sys.Application._onIFrameLoad('+i.Serialization.JavaScriptSerializer.serialize(t)+");<\/script><\/head><body><\/body><\/html>"),f.close()),this._ignoreTimer=!1,this._currentEntry=t,(this._historyFrame||this._historyPointIsNew)&&(s=this.get_stateString(),t!==s)){if(o=document.location,o.href.length-o.hash.length+t.length>2048)throw Error.invalidOperation(String.format(i.Res.urlTooLong,2048));n.location.hash=t;this._currentEntry=this.get_stateString();typeof r!="undefined"&&r!==null&&(document.title=r)}this._historyPointIsNew=!1}};i._Application.prototype._updateHiddenField=function(n){if(this._clientId){var t=document.getElementById(this._clientId);t&&(t.value=n)}};n.XMLHttpRequest||(n.XMLHttpRequest=function(){for(var t=["Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP"],n=0,i=t.length;n<i;n++)try{return new ActiveXObject(t[n])}catch(r){}return null});Type.registerNamespace("Sys.Net");i.Net.WebRequestExecutor=function(){if(arguments.length!==0)throw Error.parameterCount();this._webRequest=null;this._resultObject=null};i.Net.WebRequestExecutor.prototype={get_webRequest:we,_set_webRequest:be,get_started:ke,get_responseAvailable:de,get_timedOut:ge,get_aborted:no,get_responseData:to,get_statusCode:io,get_statusText:ro,get_xml:uo,get_object:fo,executeRequest:eo,abort:oo,getResponseHeader:so,getAllResponseHeaders:ho};i.Net.WebRequestExecutor.registerClass("Sys.Net.WebRequestExecutor");i.Net.XMLDOM=function(t){var u,r,f,i,e;if(n.DOMParser)try{return e=new n.DOMParser,e.parseFromString(t,"text/xml")}catch(o){}else for(u=["Msxml2.DOMDocument.3.0","Msxml2.DOMDocument"],r=0,f=u.length;r<f;r++)try{return i=new ActiveXObject(u[r]),i.async=!1,i.loadXML(t),i.setProperty("SelectionLanguage","XPath"),i}catch(o){}return null};i.Net.XMLHttpExecutor=function(){if(arguments.length!==0)throw Error.parameterCount();i.Net.XMLHttpExecutor.initializeBase(this);var t=this;this._xmlHttpRequest=null;this._webRequest=null;this._responseAvailable=!1;this._timedOut=!1;this._timer=null;this._aborted=!1;this._started=!1;this._onReadyStateChange=function(){if(t._xmlHttpRequest.readyState===4){try{if(typeof t._xmlHttpRequest.status=="undefined")return}catch(n){return}t._clearTimer();t._responseAvailable=!0;t._webRequest.completed(i.EventArgs.Empty);t._xmlHttpRequest!=null&&(t._xmlHttpRequest.onreadystatechange=Function.emptyMethod,t._xmlHttpRequest=null)}};this._clearTimer=function(){t._timer!=null&&(n.clearTimeout(t._timer),t._timer=null)};this._onTimeout=function(){t._responseAvailable||(t._clearTimer(),t._timedOut=!0,t._xmlHttpRequest.onreadystatechange=Function.emptyMethod,t._xmlHttpRequest.abort(),t._webRequest.completed(i.EventArgs.Empty),t._xmlHttpRequest=null)}};i.Net.XMLHttpExecutor.prototype={get_timedOut:co,get_started:lo,get_responseAvailable:ao,get_aborted:vo,executeRequest:yo,getResponseHeader:po,getAllResponseHeaders:wo,get_responseData:bo,get_statusCode:ko,get_statusText:go,get_xml:ns,abort:ts};i.Net.XMLHttpExecutor.registerClass("Sys.Net.XMLHttpExecutor",i.Net.WebRequestExecutor);i.Net._WebRequestManager=function(){if(arguments.length!==0)throw Error.parameterCount();this._defaultTimeout=0;this._defaultExecutorType="Sys.Net.XMLHttpExecutor"};i.Net._WebRequestManager.prototype={add_invokingRequest:is,remove_invokingRequest:rs,add_completedRequest:us,remove_completedRequest:fs,get_defaultTimeout:es,set_defaultTimeout:os,get_defaultExecutorType:ss,set_defaultExecutorType:hs,executeRequest:cs};i.Net._WebRequestManager.registerClass("Sys.Net._WebRequestManager");i.Net.WebRequestManager=new i.Net._WebRequestManager;i.Net.NetworkRequestEventArgs=function(n){i.Net.NetworkRequestEventArgs.initializeBase(this);this._webRequest=n};i.Net.NetworkRequestEventArgs.prototype={get_webRequest:ls};i.Net.NetworkRequestEventArgs.registerClass("Sys.Net.NetworkRequestEventArgs",i.CancelEventArgs);i.Net.WebRequest=function(){if(arguments.length!==0)throw Error.parameterCount();this._url="";this._headers={};this._body=null;this._userContext=null;this._httpVerb=null;this._executor=null;this._invokeCalled=!1;this._timeout=0};i.Net.WebRequest.prototype={add_completed:as,remove_completed:vs,completed:ys,get_url:ps,set_url:ws,get_headers:bs,get_httpVerb:ks,set_httpVerb:ds,get_body:gs,set_body:nh,get_userContext:th,set_userContext:ih,get_executor:rh,set_executor:uh,get_timeout:fh,set_timeout:eh,getResolvedUrl:oh,invoke:sh};i.Net.WebRequest._resolveUrl=function(n,t){var u,r,f,e,o;if(n&&n.indexOf("://")!==-1)return n;if(t&&t.length!==0||(u=document.getElementsByTagName("base")[0],t=u&&u.href&&u.href.length>0?u.href:document.URL),r=t.indexOf("?"),r!==-1&&(t=t.substr(0,r)),r=t.indexOf("#"),r!==-1&&(t=t.substr(0,r)),t=t.substr(0,t.lastIndexOf("/")+1),!n||n.length===0)return t;if(n.charAt(0)==="/"){if(f=t.indexOf("://"),f===-1)throw Error.argument("baseUrl",i.Res.badBaseUrl1);if(e=t.indexOf("/",f+3),e===-1)throw Error.argument("baseUrl",i.Res.badBaseUrl2);return t.substr(0,e)+n}if(o=t.lastIndexOf("/"),o===-1)throw Error.argument("baseUrl",i.Res.badBaseUrl3);return t.substr(0,o+1)+n};i.Net.WebRequest._createQueryString=function(n,t,r){t=t||encodeURIComponent;var o=0,f,s,e,u=new i.StringBuilder;if(n)for(e in n)(f=n[e],typeof f!="function")&&(s=i.Serialization.JavaScriptSerializer.serialize(f),o++&&u.append("&"),u.append(e),u.append("="),u.append(t(s)));return r&&(o&&u.append("&"),u.append(r)),u.toString()};i.Net.WebRequest._createUrl=function(n,t,r){if(!t&&!r)return n;var u=i.Net.WebRequest._createQueryString(t,null,r);return u.length?n+(n&&n.indexOf("?")>=0?"&":"?")+u:n};i.Net.WebRequest.registerClass("Sys.Net.WebRequest");Type.registerNamespace("Sys.Net");i.Net.WebServiceProxy=function(){};i.Net.WebServiceProxy.prototype={get_timeout:hh,set_timeout:ch,get_defaultUserContext:lh,set_defaultUserContext:ah,get_defaultSucceededCallback:vh,set_defaultSucceededCallback:yh,get_defaultFailedCallback:ph,set_defaultFailedCallback:wh,get_enableJsonp:bh,set_enableJsonp:kh,get_path:dh,set_path:gh,get_jsonpCallbackParameter:nc,set_jsonpCallbackParameter:tc,_invoke:ic};i.Net.WebServiceProxy.registerClass("Sys.Net.WebServiceProxy");i.Net.WebServiceProxy.invoke=function(t,r,u,f,e,o,s,h,c,l){function tt(n){var f,t,h,c,u,l,a;if(n.get_responseAvailable()){f=n.get_statusCode();t=null;try{h=n.getResponseHeader("Content-Type");t=h.startsWith("application/json")?n.get_object():h.startsWith("text/xml")?n.get_xml():n.get_responseData()}catch(v){}if(c=n.getResponseHeader("jsonerror"),u=c==="true",u?t&&(t=new i.Net.WebServiceError(!1,t.Message,t.StackTrace,t.ExceptionType,t)):h.startsWith("application/json")&&(t=!t||typeof t.d=="undefined"?t:t.d),f<200||f>=300||u)if(o)t&&u||(t=new i.Net.WebServiceError(!1,String.format(i.Res.webServiceFailedNoMsg,r))),t._statusCode=f,o(t,s,r);else{c=t&&u?t.get_exceptionType()+"-- "+t.get_message():n.get_responseData();throw i.Net.WebServiceProxy._createFailedError(r,String.format(i.Res.webServiceFailed,r,c));}else e&&e(t,s,r)}else if(l=n.get_timedOut(),a=String.format(l?i.Res.webServiceTimedOut:i.Res.webServiceFailedNoMsg,r),o)o(new i.Net.WebServiceError(l,a,"",""),s,r);else throw i.Net.WebServiceProxy._createFailedError(r,a);}var p=c!==!1?i.Net.WebServiceProxy._xdomain.exec(t):null,y,w=p&&p.length===3&&(p[1]!==location.protocol||p[2]!==location.host),b,v;u=w||u;w&&(l=l||"callback",y="_jsonp"+i._jsonp++);f||(f={});b=f;u&&b||(b={});var a,d=null,k=null,g=i.Net.WebRequest._createUrl(r?t+"/"+encodeURIComponent(r):t,b,w?l+"=Sys."+y:null);if(w){function nt(t,u){if(d!==null&&(n.clearTimeout(d),d=null),delete i[y],y=null,typeof u!="undefined"&&u!==200)if(o)a=new i.Net.WebServiceError(!1,t.Message||String.format(i.Res.webServiceFailedNoMsg,r),t.StackTrace||null,t.ExceptionType||null,t),a._statusCode=u,o(a,s,r);else{a=t.StackTrace&&t.Message?t.StackTrace+"-- "+t.Message:t.StackTrace||t.Message;a=String.format(a?i.Res.webServiceFailed:i.Res.webServiceFailedNoMsg,r,a);throw i.Net.WebServiceProxy._createFailedError(r,String.format(i.Res.webServiceFailed,r,a));}else e&&e(t,s,r)}return i[y]=nt,i._loadJsonp(g,function(){y&&nt({Message:String.format(i.Res.webServiceFailedNoMsg,r)},-1)}),null}return v=new i.Net.WebRequest,v.set_url(g),v.get_headers()["Content-Type"]="application/json; charset=utf-8",u||(k=i.Serialization.JavaScriptSerializer.serialize(f),k==="{}"&&(k="")),v.set_body(k),v.add_completed(tt),h&&h>0&&v.set_timeout(h),v.invoke(),v};i.Net.WebServiceProxy._createFailedError=function(n,t){var r="Sys.Net.WebServiceFailedException: "+t,i=Error.create(r,{name:"Sys.Net.WebServiceFailedException",methodName:n});return i.popStackFrame(),i};i.Net.WebServiceProxy._defaultFailedCallback=function(n,t){var r=n.get_exceptionType()+"-- "+n.get_message();throw i.Net.WebServiceProxy._createFailedError(t,String.format(i.Res.webServiceFailed,t,r));};i.Net.WebServiceProxy._generateTypedConstructor=function(n){return function(t){if(t)for(var i in t)this[i]=t[i];this.__type=n}};i._jsonp=0;i.Net.WebServiceProxy._xdomain=/^\s*([a-zA-Z0-9\+\-\.]+\:)\/\/([^?#\/]+)/;i._loadJsonp=function(n,t){function r(){(!u||/loaded|complete/.test(i.readyState))&&(u?i.detachEvent("onreadystatechange",r):(i.removeEventListener("load",r,!1),i.removeEventListener("error",r,!1)),t.apply(i),i=null)}var i=createElement("script"),u;i.type="text/javascript";i.src=n;u=i.attachEvent;u?i.attachEvent("onreadystatechange",r):(i.addEventListener("load",r,!1),i.addEventListener("error",r,!1));document.getElementsByTagName("head")[0].appendChild(i)};i.Net.WebServiceError=function(n,t,i,r,u){this._timedOut=n;this._message=t;this._stackTrace=i;this._exceptionType=r;this._errorObject=u;this._statusCode=-1};i.Net.WebServiceError.prototype={get_timedOut:rc,get_statusCode:uc,get_message:fc,get_stackTrace:ec,get_exceptionType:oc,get_errorObject:sc};i.Net.WebServiceError.registerClass("Sys.Net.WebServiceError");Type.registerNamespace("Sys.Services");var w=i.Services,b="Service",it="Role",rt="Authentication",ut="Profile";w[rt+b]={set_path:nt,_setAuthenticated:function(n){this._auth=n}};w["_"+rt+b]={};w[ut+b]={set_path:nt};w["_"+ut+b]={};w.ProfileGroup=function(n){this._propertygroup=n};w[it+b]={set_path:nt};w["_"+it+b]={}}var h=function(n){return n=n||{},o(arguments,function(t){t&&c(t,function(t,i){n[i]=t})},1),n},c=function(n,t){for(var i in n)t(n[i],i)},o=function(t,i,r){var f,u,e;if(t)for(t=t!==n&&typeof t.nodeType=="undefined"&&(t instanceof Array||typeof t.length=="number"&&(typeof t.callee=="function"||t.item&&typeof t.nodeType=="undefined"&&!t.addEventListener&&!t.attachEvent))?t:[t],u=r||0,e=t.length;u<e;u++)if(i(t[u],u)){f=!0;break}return!f},s=function(n,t,i){var r=n[t],u=typeof r=="function";return u&&r.call(n,i),u};if(!i||!i.loader){function g(n){return n=n||{},o(arguments,function(t){t&&c(t,function(t,i){typeof n[i]=="undefined"&&(n[i]=t)})},1),n}var l=!!document.attachEvent;function v(n,t){var i=n[t];return delete n[t],i}function ut(n,t,i){o(v(n,t),function(n){n.apply(null,i||[])})}function p(n,t,i){return n?n[t]=n[t]||i:i}function w(n,t,i){p(n,t,[]).push(i)}function ft(n,t,i,r){p(n,t,{})[i]=r}function a(n,t){return(t||document).getElementsByTagName(n)}function createElement(n){return document.createElement(n)}function y(n,t,i,r,u,f){function e(){l&&u&&!/loaded|complete/.test(n.readyState)||(l?n.detachEvent(i||"on"+t,e):(n.removeEventListener(t,e,!1),f&&n.removeEventListener("error",e,!1)),r.apply(n),n=null)}l?n.attachEvent(i||"on"+t,e):(n.addEventListener(t,e,!1),f&&n.addEventListener("error",e,!1))}function b(){i._domReady&&i._2Pass(v(i,"_domReadyQueue"))}function k(){var n=i._ready;n||!i._domReady||i.loader&&i.loader._loading||(i._ready=n=!0);n&&i._2Pass(v(i,"_readyQueue"))}n.Sys=i=g(i,{version:[3,0,31106,1],__class:!0,debug:!0,scripts:{},activateDom:!0,composites:{},components:{},plugins:{},create:{},converters:{},_domLoaded:function(){function t(){i._domReady||(i._domReady=!0,b(),k())}var r,f,u;y(n,"load",null,t);l?n==n.top&&document.documentElement.doScroll?(u=createElement("div"),r=function(){try{u.doScroll("left")}catch(i){f=n.setTimeout(r,0);return}u=null;t()},r()):y(document,null,"onreadystatechange",t,!0):document.addEventListener&&y(document,"DOMContentLoaded",null,t)},_getById:function(n,t,i,r,u){if(u)r&&u.id===t?n[0]=u:o(a("*",u),function(i){if(i.id===t)return n[0]=i,!0});else{var f=document.getElementById(t);f&&(n[0]=f)}return n.length},_getByClass:function(n,t,i,r,u){function h(i){var u,r=i.className;return r&&(r===t||r.indexOf(" "+t)>=0||r.indexOf(t+" ")>=0)&&(n.push(i),u=!0),u}var f,o,e,s;if(r&&h(u)&&i)return!0;if(u=u||document,s=u.querySelectorAll||u.getElementsByClassName,s){for(u.querySelectorAll&&(t="."+t),e=s.call(u,t),f=0,o=e.length;f<o;f++)if(n.push(e[f]),i)return!0}else for(e=a("*",u),f=0,o=e.length;f<o;f++)if(h(e[f])&&i)return!0},query:function(n,t){return t&&typeof t.query=="function"?t.query(n):this._find(n,t)},get:function(n,t){return t&&typeof t.get=="function"?t.get(n):this._find(n,t,!0)},_find:function(t,r,u){var f=[],s,e,h,c,l;if(typeof t!="string")f.push(t);else if(s=r instanceof Array,e=/^([\$#\.])((\w|[$:\.\-])+)$/.exec(t),e&&e.length===4)t=e[2],h=e[1],h==="$"?i._getComponent(f,t,r):(c=h==="#"?i._getById:i._getByClass,r?o(r,function(n){if(n.nodeType===1)return c(f,t,u,s,n)}):c(f,t,u));else if(/^\w+$/.test(t))if(s)o(r,function(n){if(n.nodeType===1&&(n.tagName.toLowerCase()===t&&(f.push(n),u)||!o(a(t,n),function(n){return f.push(n),u?!0:void 0})))return!0});else{if(l=a(t,r),u)return l[0]||null;o(l,function(n){f.push(n)})}else n.jQuery&&(f=jQuery(t).get());return f.length?u?f[0]:f:null},onDomReady:function(n){w(this,"_domReadyQueue",n);b()},onReady:function(n){w(this,"_readyQueue",n);k()}});i._getComponent=i._getComponent||function(){};i._2Pass=i._2Pass||function(n){o(n,function(n){n()})};i._domLoaded()}i.loader?i.loader.registerScript("MicrosoftAjax",null,d):d()}(n,n.Sys);var u,t,r,f,e;Type.registerNamespace("Sys");Sys.Res={invokeCalledTwice:"Cannot call invoke more than once.",argumentTypeName:"Value is not the name of an existing type.",cantBeCalledAfterDispose:"Can't be called after dispose.",webServiceFailed:"The server method '{0}' failed with the following error: {1}",componentCantSetIdAfterAddedToApp:"The id property of a component can't be set after it's been added to the Application object.",behaviorDuplicateName:"A behavior with name '{0}' already exists or it is the name of an existing property on the target element.",notATypeName:"Value is not a valid type name.",elementNotFound:"An element with id '{0}' could not be found.",stateMustBeStringDictionary:"The state object can only have null and string fields.",invalidExecutorType:"Could not create a valid Sys.Net.WebRequestExecutor from: {0}.",boolTrueOrFalse:"Value must be 'true' or 'false'.",cannotCallBeforeResponse:"Cannot call {0} when responseAvailable is false.",scriptLoadFailedNoHead:"ScriptLoader requires pages to contain a <head> element.",stringFormatInvalid:"The format string is invalid.",referenceNotFound:"Component '{0}' was not found.",enumReservedName:"'{0}' is a reserved name that can't be used as an enum value name.",circularParentChain:"The chain of control parents can't have circular references.",namespaceContainsNonObject:"Object {0} already exists and is not an object.",undefinedEvent:"'{0}' is not an event.",invalidTimeout:"Value must be greater than or equal to zero.",cannotAbortBeforeStart:"Cannot abort when executor has not started.",observableConflict:"Object already contains a member with the name '{0}'.",invalidHttpVerb:"httpVerb cannot be set to an empty or null string.",nullWebRequest:"Cannot call executeRequest with a null webRequest.",historyCannotEnableHistory:"Cannot set enableHistory after initialization.",eventHandlerInvalid:"Handler was not added through the Sys.UI.DomEvent.addHandler method.",scriptLoadFailedDebug:"The script '{0}' failed to load. Check for:\r\n Inaccessible path.\r\n Script errors. (IE) Enable 'Display a notification about every script error' under advanced settings.",propertyNotWritable:"'{0}' is not a writable property.",enumInvalidValueName:"'{0}' is not a valid name for an enum value.",cannotCallOnceStarted:"Cannot call {0} once started.",controlAlreadyDefined:"A control is already associated with the element.",addHandlerCantBeUsedForError:"Can't add a handler for the error event using this method. Please set the window.onerror property instead.",badBaseUrl1:"Base URL does not contain ://.",badBaseUrl2:"Base URL does not contain another /.",badBaseUrl3:"Cannot find last / in base URL.",setExecutorAfterActive:"Cannot set executor after it has become active.",cantAddNonFunctionhandler:"Can't add a handler that is not a function.",invalidNameSpace:"Value is not a valid namespace identifier.",notAnInterface:"Value is not a valid interface.",eventHandlerNotFunction:"Handler must be a function.",propertyNotAnArray:"'{0}' is not an Array property.",namespaceContainsClass:"Object {0} already exists as a class, enum, or interface.",typeRegisteredTwice:"Type {0} has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update.",cantSetNameAfterInit:"The name property can't be set on this object after initialization.",historyMissingFrame:"For the history feature to work in IE, the page must have an iFrame element with id '__historyFrame' pointed to a page that gets its title from the 'title' query string parameter and calls Sys.Application._onIFrameLoad() on the parent window. This can be done by setting EnableHistory to true on ScriptManager.",appDuplicateComponent:"Two components with the same id '{0}' can't be added to the application.",historyCannotAddHistoryPointWithHistoryDisabled:"A history point can only be added if enableHistory is set to true.",expectedElementOrId:"Value must be a DOM element or DOM element id.",selectorNotFound:"An element with selector '{0}' could not be found.",cannotCallOutsideHandler:"Cannot call {0} outside of a completed event handler.",methodNotFound:"No method found with name '{0}'.",arrayParseBadFormat:"Value must be a valid string representation for an array. It must start with a '[' and end with a ']'.",cannotSerializeObjectWithCycle:"Cannot serialize object with cyclic reference within child properties.",stateFieldNameInvalid:"State field names must not contain any '=' characters.",stringFormatBraceMismatch:"The format string contains an unmatched opening or closing brace.",enumValueNotInteger:"An enumeration definition can only contain integer values.",propertyNullOrUndefined:"Cannot set the properties of '{0}' because it returned a null value.",expectedDomElementOrSelector:"'{0}' must be a DOM element or DOM element selector.",argumentDomNode:"Value must be a DOM element or a text node.",componentCantSetIdTwice:"The id property of a component can't be set more than once.",createComponentOnDom:"Value must be null for Components that are not Controls or Behaviors.",createNoDom:"Value must not be null for Controls and Behaviors.",cantAddWithoutId:"Can't add a component that doesn't have an id.",urlTooLong:"The history state must be small enough to not make the url larger than {0} characters.",notObservable:"Instances of type '{0}' cannot be observed.",badTypeName:"Value is not the name of the type being registered or the name is a reserved word.",argumentInteger:"Value must be an integer.",argumentType:"Object cannot be converted to the required type.",argumentNull:"Value cannot be null.",scriptAlreadyLoaded:"The script '{0}' has been referenced multiple times. If referencing Microsoft AJAX scripts explicitly, set the MicrosoftAjaxMode property of the ScriptManager to Explicit.",scriptDependencyNotFound:"The script '{0}' failed to load because it is dependent on script '{1}'.",formatBadFormatSpecifier:"Format specifier was invalid.",requiredScriptReferenceNotIncluded:"'{0}' requires that you have included a script reference to '{1}'.",webServiceFailedNoMsg:"The server method '{0}' failed.",argumentDomElement:"Value must be a DOM element.",actualValue:"Actual value was {0}.",enumInvalidValue:"'{0}' is not a valid value for enum {1}.",scriptLoadFailed:"The script '{0}' could not be loaded.",parameterCount:"Parameter count mismatch.",cannotDeserializeEmptyString:"Cannot deserialize empty string.",formatInvalidString:"Input string was not in a correct format.",argument:"Value does not fall within the expected range.",cannotDeserializeInvalidJson:"Cannot deserialize. The data does not correspond to valid JSON.",cannotSerializeNonFiniteNumbers:"Cannot serialize non finite numbers.",argumentUndefined:"Value cannot be undefined.",webServiceInvalidReturnType:"The server method '{0}' returned an invalid type. Expected type: {1}",servicePathNotSet:"The path to the web service has not been set.",argumentTypeWithTypes:"Object of type '{0}' cannot be converted to type '{1}'.",paramName:"Parameter name: {0}",nullReferenceInPath:"Null reference while evaluating data path: '{0}'.",format:"One of the identified items was in an invalid format.",assertFailedCaller:"Assertion Failed: {0}\r\nat {1}",argumentOutOfRange:"Specified argument was out of the range of valid values.",webServiceTimedOut:"The server method '{0}' timed out.",notImplemented:"The method or operation is not implemented.",assertFailed:"Assertion Failed: {0}",invalidOperation:"Operation is not valid due to the current state of the object.",breakIntoDebugger:"{0}\r\n\r\nBreak into debugger?"},function(){function t(){function n(n){return Sys.Serialization.JavaScriptSerializer.serialize(n)}function c(){return this._error||null}function l(){return this._executor}function a(){return this._result}function v(){var n=this._data;return typeof n=="undefined"?null:n}function y(n){this._data=n}function p(){return this._placeholder||null}function w(n){this._placeholder=n}function b(){return this._itemTemplate||null}function k(n){this._itemTemplate=n}function g(){return this._element}function nt(){this._element=null;this._instantiateIn=null}function tt(t,i,r){t.push(i,"document.createTextNode(",n(r),"));\n")}function it(t,i,r,u,f,e){var c=r.ns,o=r.name,a=!c&&Sys.UI.Template._isRestricted(o),h,s,l;a&&(u="Sys.UI.Template._checkAttribute('"+o+"', "+u+")");switch(r.type){case 1:if(t.push(" $component = $element;\n "),f?r.textNode?t.push("container.appendChild(document.createTextNode(",u,"));\n"):t.push("$element.",o," = ",u,";\n"):t.push(u,";\n"),r.textNode||o==="innerHTML")return!0;break;case 2:f?(o=n(o),t.push(" $component = $element;\n (",u,") ? Sys.UI.DomElement.addCssClass($element, ",o,") : Sys.UI.DomElement.removeCssClass($element, ",o,");\n")):t.push(" $component = $element;\n ",u,";\n");break;case 3:if(h=i[c],h.isClass)t.push(" $component = __componentIndex['",c,"'];\n"),f?(s=r.map,s.type===1?t.push(" $component.",s.setterName,"(",u,");\n"):s.type===2?t.push(" __f = ",u,";\n"," $component.",s.setterName,'(typeof(__f) === "function" ? __f : new Function("sender", "args", __f));\n'):t.push(" $component.",s.name," = ",u,";\n")):t.push(" ",u,";\n");else{if(!f)throw Error.invalidOperation();l=n(r.name)+": "+u;h.props?h.props+=", "+l:h.props=l}break;case 4:this["_"+o]=u;break;default:f?/^on/i.test(o)?t.push(" $component = $element;\n $element."+o+" = new Function("+(document.attachEvent?"":"'event', ")+u+");\n"):e?t.push(" $component = $element;\n if ("+u+") {\n __e = document.createAttribute('"+o+"');\n __e.nodeValue = \""+e+'";\n $element.setAttributeNode(__e);\n }\n'):t.push(" $component = $element;\n __e = document.createAttribute('"+o+"');\n __e.nodeValue = "+u+";\n $element.setAttributeNode(__e);\n"):t.push(" $component = $element;\n "+u+";\n")}return!1}function rt(n,t,i,r,u){return(r=this._getAttributeExpression(i,r),r)?this._appendAttributeSetter(n,t,i,r.code,r.isExpression,u):!1}function ut(t,i,r){var h=typeof i,o,f,s;if(h==="undefined")return null;if(i===null)return{isExpression:!0,code:"null"};if(!t.isNative&&h==="string"){if(i.startsWith("{{")&&i.endsWith("}}"))return{isExpression:!0,code:i.slice(2,-2).trim()};if(i.startsWith("{")&&i.endsWith("}")){var e=Sys.Application._getExtensionCode(i.slice(1,-1)),c=e.properties,u="";for(o in c)f=this._getAttributeExpression(t,c[o]),f&&f.isExpression&&(s=n(o)+":"+f.code,u?u+=","+s:u=s);return{isExpression:e.instance.expression,code:"Sys.Application._getMarkupExtension("+n(e.name)+").extension($component, "+n((t.type===2?"class:":"")+t.name)+", $context, {"+u+"})"}}}return t.isId&&(r=!0,i="$id("+n(i)+")"),{isExpression:!0,code:r?i:n(i)}}function ft(n,t,i,r){var u,e,f=n.getAttributeNode("sys:"+r);if(f){if(u=f.nodeValue,u==="true")u=!0;else if(u==="false")return}else if(e=!0,f=n.getAttributeNode(r),f&&(f.specified||f.nodeValue===!0))u=!0;else if(n.getAttribute(r)===r)u=!0;else return;this._processAttribute(t,i,{name:r,isNative:e},u,r)}function et(n,t,i,r){for(var u=0,f=r.length;u<f;u++)this._processBooleanAttribute(n,t,i,r[u])}function ot(n,t,i){var r=this._getExplicitAttribute(null,null,t,n);return r&&(r=this._getAttributeExpression({name:n},r,!0).code,i.push(n==="sys:if"?" if ("+r+") {\n":" "+r+"\n")),!!r}function st(n,i,r,u,f,e,o){var h,s;if(u==="style"&&r.style)s=r.style.cssText;else try{if(u.toLowerCase()==="class"&&Sys.Browser.agent===Sys.Browser.InternetExplorer&&Sys.Browser.version>=9)if(r.className)r.getAttributeNode("sys:class");else return;h=r.getAttributeNode(u);h&&h.specified&&(s=h.nodeValue)}catch(c){}return s&&f&&this._processAttribute(n,i,t({name:f,type:1,isNative:e},o),s),s}function ht(t,r,u,f){var ot,s,gt,y,h,tt,yt,ni=Sys.UI.Template._expressionRegExp,p=" "+(f?"__p[__d-1].appendChild(":"__topElements.push("),li=i("InternetExplorer")&&Sys.Browser.version<9,e,l,w,ti,ai,st,a,it,pt,ri,k,d,c,ht,ui,fi,ei,ct,wt,bt,vt,ci;for(u.push(" __d++;\n"),ot=0,gt=r.childNodes.length;ot<gt;ot++)if(e=r.childNodes[ot],l=e.nodeValue,e.nodeType===8)u.push(p+"document.createComment("+n(l)+"));\n");else if(e.nodeType===3)if(w=l.trim(),w.startsWith("{")&&w.endsWith("}")&&(!w.startsWith("{{")||!w.endsWith("}}")))ai="$component=$element;\n",ti=r.tagName.toLowerCase()==="textarea"?"value":"innerText",st=this._getAttributeExpression({name:ti},w),st.isExpression?u.push(p,"document.createTextNode(",st.code,"));\n"):u.push("$component=$element;\n"," ",st.code,";\n");else{for(a=ni.exec(l),it=0;a;)pt=l.substring(it,a.index),pt&&this._appendTextNode(u,p,pt),u.push(p,"document.createTextNode(",a[1],"));\n"),it=a.index+a[0].length,a=ni.exec(l);it<l.length&&this._appendTextNode(u,p,l.substr(it))}else{var ii=e.attributes,b=null,o={},rt=e.tagName.toLowerCase(),ut,vi=f+1,ft;if(rt==="script")continue;if(ri=this._processCodeBlock("sys:if",e,u),this._processCodeBlock("sys:codebefore",e,u),ft=this._getExplicitAttribute(null,null,e,"sys:content-template"),ft){if(ft.constructor!==String)throw new Error("The sys:content-template attribute value must be a string.");u.push(" __contentTemplates.push('"+ft+"');\n")}if(yt=rt==="button",tt=yt||rt==="input",tt){if(k=e.getAttribute("sys:type"),k=k?this._getAttributeExpression({name:"type"},k):this._getAttributeExpression({name:"type",isNative:!0},e.getAttribute("type")),d=e.getAttribute("sys:name"),d=d?this._getAttributeExpression({name:"name"},d):this._getAttributeExpression({name:"name",isNative:!0},e.getAttribute("name")),!k.isExpression||!d.isExpression)throw Error.invalidOperation(Sys.UI.TemplatesRes.mustSetInputElementsExplicitly);u.push(" $element=container=__p[__d]=Sys.UI.Template._createInput("+k.code+", "+d.code+", "+yt+");\n");ut=Sys.UI.Template._inputBooleanAttributes;this._processBooleanAttributes(e,u,o,ut[" list"])}else u.push(" $element=container=__p[__d]=document.createElement('"+e.nodeName+"');\n");if(f||u.push(" $element.__mstcindex = $context._tcindex;\n"),this._getExplicitAttribute(u,o,e,"sys:id","id",!1,{isId:!0})||this._getExplicitAttribute(u,o,e,"id","id",!0,{isId:!0}),b=this._getExplicitAttribute(u,o,e,"sys:attach"),b)for(b=b.split(","),u.push(" __componentIndex = {}\n"),s=0,y=b.length;s<y;s++)if(h=b[s].trim(),!o[h]){if(c=Sys.Application._findType(e,h,li),!c)throw Error.invalidOperation(String.format(Sys.UI.TemplatesRes.invalidAttach,"sys:attach",h));ct=typeof c!="string";ct&&(ht=c.inheritsFrom(Sys.Component),ui=ht&&(c.inheritsFrom(Sys.UI.Behavior)||c.inheritsFrom(Sys.UI.Control)),fi=c.implementsInterface(Sys.UI.ITemplateContextConsumer),ei=c.implementsInterface(Sys.UI.IContentTemplateConsumer));o[h]={type:c,isClass:ct,isComponent:ht};ct&&(u.push(" __componentIndex['"+h+"'] = $component = new "+c.getName()),ui?u.push("($element);\n"):u.push("();\n Sys.Application._registerComponent($element, $component);\n"),ht&&u.push(" $component.beginUpdate();\n"),fi&&u.push(" $component.set_templateContext($context);\n"),ei&&(u.push(" if (__parentContentTemplate && __parentContentTemplate.length > 0) $component.addContentTemplate(__parentContentTemplate);\n"),u.push(" if (__contentTemplates.length > 0) $component.addContentTemplate(__contentTemplates.join(' '));\n")),wt=h+":id",bt=Sys.Application._splitAttribute(wt,!1,o),bt.isId=!0,this._getExplicitAttribute(u,o,e,wt,"id",!1,bt))}this._getExplicitAttribute(u,o,e,"style","style.cssText",!0);this._getExplicitAttribute(u,o,e,"class","className",!0);tt||(ut=Sys.UI.Template._booleanAttributes[rt]||Sys.UI.Template._commonBooleanAttributes,this._processBooleanAttributes(e,u,o,ut[" list"]));var oi=rt==="select",g=null,yi=Sys.Application._splitAttribute,si=!1,kt={id:1,"class":1,style:1,"sys:attach":1,"sys:id":1,"sys:disabled":1,"sys:checked":1,"sys:readonly":1,"sys:ismap":1,"sys:multiple":1,"sys:selected":1,"sys:if":1,"sys:codebefore":1,"sys:codeafter":1,"sys:content-template":1};for(s=0,y=ii.length;s<y;s++){var nt=ii[s],v=nt.nodeName,lt=v.toLowerCase();if(v.indexOf("jQuery")!==0&&(nt.specified||tt&<==="value")&&!kt[lt]&&!ut[lt]&&(!tt||!Sys.UI.Template._inputRequiredAttributes[lt])){var et=yi(v,oi,o),at=et.ns,hi=nt.nodeValue,dt=et.type;if(v=et.name,dt===1){if(oi&&(!at||at==="sys")){g=g||[];g.push([et,hi]);continue}kt[v.toLowerCase()]=!0}else if(dt===0)kt[v.toLowerCase()]=!0;else if(dt===3&&v==="id"&&o[at]&&o[at].isClass)continue;this._processAttribute(u,o,et,hi)&&(si=!0)}}this._command&&(u.push(" Sys.UI.DomElement.setCommand($element, "+this._command+", "+(this._commandargument||"null")+", Sys.UI.DomElement._ensureGet("+(this._commandtarget||"null")+", $context, 'sys:commandtarget'));\n"),this._command=null);this._commandargument=null;this._commandtarget=null;u.push(p+"$element);\n");for(h in o)vt=o[h],vt.isClass?u.push(" $context._registerComponent(__componentIndex['"+h+"']);\n"):(u.push(" $context._registerIf("),u.push(vt.type),u.push("($element, "),u.push("{"+(vt.props||"")+"}, $context));\n"));if(Sys.UI.Template._isTemplate(e)?(ci=new Sys.UI.Template(e),ci.recompile(),t.push(e._msajaxtemplate),u.push(" $element._msajaxtemplate = this.get_element()._msajaxtemplate[2]["+(t.length-1)+"];\n")):si||(this._buildTemplateCode(t,e,u,vi),u.push(" $element=container=__p[__d];\n")),g)for(s=0,y=g.length;s<y;s++)nt=g[s],this._processAttribute(u,o,nt[0],nt[1]);ft&&u.push(" __contentTemplates.pop();\n");this._processCodeBlock("sys:codeafter",e,u);ri&&u.push(" }\n")}u.push(" --__d;\n")}function ct(){if(!this._instantiateIn){var n=this.get_element();n._msajaxtemplate?this._instantiateIn=n._msajaxtemplate[0]:this.recompile()}}function lt(){var t=this.get_element(),n=[" $index = (typeof($index) === 'number' ? $index : __instanceId);\n var fragment=document.createDocumentFragment(), $component, __componentIndex, __e, __f, __topElements = [], __d = 0, __p = [fragment], $element = __containerElement, container = fragment, $context = new Sys.UI.TemplateContext(), __contentTemplates = [], $id = function(prefix) { return $context.getInstanceId(prefix); };\n $context.data = (typeof(__data) === 'undefined' ? null : __data);\n $context.components = [];\n $context.nodes = __topElements;\n $context.dataItem = $dataItem;\n $context.index = $index;\n $context.parentContext = __parentContext;\n $context.containerElement = __containerElement;\n $context.insertBeforeNode = __referenceNode;\n $context.template = this;\n with($dataItem || {}) {\n"],i=[];this._buildTemplateCode(i,t,n,0);n.push("}\n __containerElement.appendChild(fragment);\n $context._onInstantiated(__referenceNode);\n return $context;");n=n.join("");t._msajaxtemplate=[this._instantiateIn=new Function("__containerElement","__data","$dataItem","$index","__referenceNode","__parentContext","__parentContentTemplate","__instanceId",n),t,i]}function at(n,t,i,r,u,f,e){return n=Sys.UI.DomElement._ensureGet(n,null,"containerElement"),u=Sys.UI.DomElement._ensureGet(u,null,"nodeToInsertTemplateBefore"),this._ensureCompiled(),this._instantiateIn(n,t,i,r,u,f,e,this._instanceId++)}function vt(){var t,u,r,n,i;if(!this._global){if(t=this.nodes,t)for(n=0,i=t.length;n<i;n++)u=t[n],u.nodeType===1&&Sys.Application.disposeElement(u,!1);if(r=this.components,r)for(n=0,i=r.length;n<i;n++)delete r[n].__tc}delete Sys.UI.TemplateContext._contexts[this._tcindex];this.nodes=this.dataItem=this.components=this.getInstanceId=this.containerElement=this.insertBeforeNode=this.parentContext=this.data=null;this.isDisposed=!0}function yt(n){return this._find(n)}function pt(n){return this._find(n,!0)}function wt(n,t){return/^[#\$](\w|[$:\.\-])+$/.test(n)?this._findById(n.substr(0,1),n.substr(1),t):Sys._find(n,this.nodes,t)}function bt(n,t,i){for(var e,f,r=null,u=this;!r&&u;u=u.parentContext)e=u.nodes,f=n+u.getInstanceId(t),r=u._global?Sys.get(f)||Sys.get(f,e):Sys.get(f,e);return r=r||Sys.get(n+t),i?r:r?[r]:[]}function kt(n){return n+(this._global?"":this._tcindex)}function dt(){var i=this.components,t,r,n;if(i)for(t=i.length-1,r=this._lastIndex,this._lastIndex=t;t>r;t--)n=i[t],n&&Sys.Component.isInstanceOfType(n)&&(n.get_isUpdating()?n.endUpdate():n.get_isInitialized()||n.initialize())}function gt(n){Sys.Observer.addEventHandler(this,"instantiated",n)}function ni(n){Sys.Observer.removeEventHandler(this,"instantiated",n)}function ti(n,t){if(r(this._completed,function(n){n()}),this._completed=[],!t){var i=this.containerElement;r(this.nodes,function(t){i.insertBefore(t,n||null)})}Sys.Observer.raiseEvent(this,"instantiated")}function ii(n){var t=this.components;n.__tc=[this._tcindex,t.length];t.push(n);Sys.Component._register(n,null,!0)}function ri(n){if(n instanceof Array)for(var t=0,i=n.length;t<i;t++)this._registerComponent(n[t]);else n&&typeof n=="object"&&this._registerComponent(n)}function ui(){throw Error.notImplemented();}function fi(){throw Error.notImplemented();}function ei(n){if(n.constructor!==String)throw new Error('Method "addContentTemplate" requires an argument of type String.');n.length>0&&(this._contentTemplate?(this._contentTemplate+=" ",this._contentTemplate+=n):this._contentTemplate=n)}function u(n){if(!n.tagName)return"unknown element";var t=n.tagName.toLowerCase();return t==="input"&&(t+="["+n.type+"]"),n.id&&(t+="#"+n.id),n.className&&n.className.split(/\s+/g).forEach(function(n){t+="."+n}),t}function oi(){return this._convert||null}function si(n){this._convert=n;this._convertFn=this._resolveFunction(n)}function hi(){return this._convertBack||null}function ci(n){this._convertBack=n;this._convertBackFn=this._resolveFunction(n)}function li(){return!!this._ignoreErrors}function ai(n){this._ignoreErrors=n}function vi(){return this._mode||Sys.BindingMode.auto}function yi(n){if(this._initialized)throw Error.invalidOperation(String.format(Sys.UI.TemplatesRes.commonNotAfterInit,"Binding","mode"));this._mode=n}function pi(){return this._defaultValue}function wi(n){this._defaultValue=n}function bi(){return this._source||null}function ki(n){if(this._initialized)throw Error.invalidOperation(String.format(Sys.UI.TemplatesRes.commonNotAfterInit,"Binding","source"));this._source=n}function di(){return this._templateContext||null}function gi(n){this._templateContext=n}function nr(){return this._path||""}function tr(n){if(this._initialized)throw Error.invalidOperation(String.format(Sys.UI.TemplatesRes.commonNotAfterInit,"Binding","path"));this._path=n;this._pathArray=n?n.split("."):null}function ir(){return this._target||null}function rr(n){if(this._initialized)throw Error.invalidOperation(String.format(Sys.UI.TemplatesRes.commonNotAfterInit,"Binding","target"));this._target=n}function ur(){return this._targetProperty||""}function fr(n){if(this._initialized)throw Error.invalidOperation(String.format(Sys.UI.TemplatesRes.commonNotAfterInit,"Binding","targetProperty"));this._targetProperty=n;this._targetPropertyArray=n?n.split("."):null}function er(n){if(n.nodeType!==3||(n=n.parentNode,n)){var t=n.__msajaxbindings=n.__msajaxbindings||[];t.push(this);Sys.UI.DomElement._onDispose(n,Sys.Binding._disposeBindings)}}function or(){if(!this._disposed){this._disposed=!0;this._watchObject(null);this._watchObject(null,!0);this._targetHandlers=null;this._sourceHandlers=null;var n=this._source,t=this._target;n&&(this._sourceOption&&Sys.Observer.removeEventHandler(n,"optionsChanged",this._onOptionsUpdated),Sys.INotifyDisposing.isImplementedBy(n)&&n.remove_disposing(this._onDispose));t&&(this._targetOption&&Sys.Observer.removeEventHandler(t,"optionsChanged",this._onOptionsUpdated),Sys.INotifyDisposing.isImplementedBy(t)&&t.remove_disposing(this._onDispose));this._convert=this._convertBack=this._convertFn=this._convertBackFn=this._lastSource=this._lastTarget=this._source=this._target=this._path=this._pathArray=this._defaultValue=this._targetProperty=this._targetPropertyArray=this._templateContext=this._updateSource=this._sourceOption=this._updateTarget=this._targetOption=this._mode=this._onOptionsUpdated=this._onTargetChanged=this._onSourceChanged=this._onDispose=null}Sys.Binding.callBaseMethod(this,"dispose")}function sr(n,t,i,r){for(var u=i;u<=r;u++){if(n===null||typeof n=="undefined")return null;n=this._getPropertyData(n,t[u])}return n}function hr(n,t){return typeof n["get_"+t]=="function"?n["get_"+t]():n[t]}function cr(n,t){var u=t?this._pathArray:this._targetPropertyArray,f=t?this._sourceHandlers:this._targetHandlers,e=!!n,i,s,o,r;if(u)for(i=0,s=u.length;i<s;i++)o=u[i],r=f[i],r&&r.object===n||(r&&(this._forget(r),f[i]=null),e&&(f[i]=this._listen(n,o,t))),e?(n=this._getPropertyData(n,o),e=n&&(typeof n=="object"||n instanceof Array||Sys._isDomElement(n))):n=null}function lr(n,t){var r,i=Sys.UI.DomElement.isDomElement(n)&&n.nodeType===1&&n.tagName?n.tagName.toLowerCase():"";return(i==="select"||i==="input"||i==="textarea")&&(t=(t||"").toLowerCase(),(t==="value"||t==="selectedindex"||t==="checked")&&(i==="input"&&(i!=="input"||/button|image|hidden|submit|reset/i.test(n.type))||(r=i))),r}function ar(n,t,i){var o=this,r=i?this._onSourceChanged:this._onTargetChanged,u={listener:r,object:n,pc:function(n,i){var u=i.get_propertyName();u&&u!==t||r()},dom:[]},f,e;return Sys.Observer._addEventHandler(n,"propertyChanged",u.pc),f=this._isInput(n,t),e=Sys.UI.DomEvent.addHandler,f&&(u.dom.push("change"),e(n,"change",r),f!=="textarea"&&(u.dom.push("click"),e(n,"click",r),f==="select"&&(u.dom.push("keyup"),e(n,"keyup",r)))),n=null,u}function vr(n){var i=n.object,r=n.dom,t,u;for(Sys.Observer._removeEventHandler(i,"propertyChanged",n.pc),t=0,u=r.length;t<u;t++)Sys.UI.DomEvent.removeHandler(i,r[t],n.listener)}function yr(n){var t;if(typeof n=="function")t=n;else{if(typeof n!="string")throw Error.invalidOperation(String.format(Sys.UI.TemplatesRes.invalidFunctionName,n));if(t=Sys.converters[n],!t)try{t=Type.parse(n)}catch(i){throw Error.invalidOperation(String.format(Sys.UI.TemplatesRes.functionNotFound,n));}}return t}function pr(){this.get_mode()===Sys.BindingMode.oneWayToSource?this._targetChanged(!1):this._sourceChanged(!1);Sys.Binding.callBaseMethod(this,"link")}function wr(n){if(!this._initialized)throw Error.invalidOperation(Sys.UI.TemplatesRes.updateBeforeInit);n=n||this.get_mode();n===Sys.BindingMode.oneWayToSource?this._targetChanged(!0):this._sourceChanged(!0)}function br(n){throw Error.invalidOperation(String.format(Sys.UI.TemplatesRes.bindingPropertyNotSet,n));}function kr(){if(!this.get_isInitialized()){this.get_targetProperty()||this._notSet("targetProperty");var n=this.get_templateContext();n?n._completed.push(Function.createDelegate(this,this._doInitialize)):this._doInitialize()}}function dr(){function r(n,t){return Sys.UI.DomElement.isDomElement(n)&&/^select$/i.test(n.tagName)&&/^(selectedIndex|value)$/i.test(t)?(Sys.Observer.addEventHandler(n,"optionsChanged",this._onOptionsUpdated),!0):!1}var i=this.get_source(),n=this.get_target(),t;typeof i=="string"&&this.set_source(i=this._resolveReference(i)||null);typeof n=="string"&&this.set_target(n=this._resolveReference(n)||null);t=this.get_mode();n&&t===Sys.BindingMode.auto&&(t="oneWay",(this._isInput(n,this._targetPropertyArray?this._targetPropertyArray[0]:"")||Sys.INotifyPropertyChange.isImplementedBy(n))&&(t="twoWay"),t=Sys.BindingMode[t],this.set_mode(t));Sys.Binding.callBaseMethod(this,"initialize");this.get_isLinkPending()?this.link():this.update(t);t!==Sys.BindingMode.oneTime&&(i&&(t!==Sys.BindingMode.oneWayToSource&&(this._watchObject(i,!0),Sys.INotifyDisposing.isImplementedBy(i)&&i.add_disposing(this._onDispose)),Sys.UI.DomElement.isDomElement(i)&&this._addBinding(i)),n&&(t!==Sys.BindingMode.oneWay&&(this._watchObject(n),Sys.INotifyDisposing.isImplementedBy(n)&&n.add_disposing(this._onDispose)),Sys.UI.DomElement.isDomElement(n)&&this._addBinding(n)));i&&t>=3&&(this._sourceOption=r.call(this,i,this.get_path()));n&&t<=3&&(this._targetOption=r.call(this,n,this.get_targetProperty()))}function gr(n,t){return t==="checked"&&n.tagName.toLowerCase()==="input"}function nu(n){this._disposed||this.update(n===this.get_source()?4:2)}function tu(n){var e,o,r,u,s;if(!this._disposed){var f=n===!1,i=this.get_target(),t=this.get_source();if(n=n===!0,i){if(t=t&&this._pathArray?this._getPropertyFromIndex(t,this._pathArray,0,this._pathArray.length-1):t,!this._updateSource&&(n||f||t!==this._lastSource))try{if(this._updateTarget=!0,this._lastSource=this._lastTarget=t,!f){if(this._convertFn)if(this._ignoreErrors)try{t=this._convertFn(t,this)}catch(h){}else t=this._convertFn(t,this);(t===null||typeof t=="undefined")&&(t=this.get_defaultValue());this._targetProperty&&this._targetProperty.startsWith("class:")?(e=this._targetProperty.substr(6).trim(),t?Sys.UI.DomElement.addCssClass(i,e):Sys.UI.DomElement.removeCssClass(i,e)):(o=this._targetPropertyArray.length,i=this._getPropertyFromIndex(i,this._targetPropertyArray,0,o-2),i!==null&&typeof i!="undefined"&&(r=this._targetPropertyArray[o-1],u=Sys.UI.DomElement.isDomElement(i),u&&(t=Sys.UI.Template._checkAttribute(r,t),(t===null||t===undefined)&&(t="")),u&&(r==="innerHTML"||r==="innerText")?(Sys.Application._clearContent(i),r==="innerHTML"?i.innerHTML=t:i.appendChild(document.createTextNode(t)),Sys.Observer.raisePropertyChanged(i,r)):u&&(r==="tabIndex"||r==="tabindex")?Sys.Observer._setValue(i,"tabIndex",t):Sys.Observer._setValue(i,r,t),t&&u&&this._isChecked(i,r)&&(s=document.createAttribute(r),s.nodeValue=r,i.setAttributeNode(s))))}}finally{this._updateTarget=!1}n||f||this._watchObject(this.get_source(),!0)}}}function iu(n){var f,r,e,o;if(!this._disposed){var u=n===!1,t=this.get_target(),i=this.get_source();if(n=n===!0,i){if(t=t?this._getPropertyFromIndex(t,this._targetPropertyArray,0,this._targetPropertyArray.length-1):null,!this._updateTarget&&(n||u||t!==this._lastTarget))try{if(this._updateSource=!0,this._lastTarget=this._lastSource=t,!u){if(this._convertBackFn)if(this._ignoreErrors)try{t=this._convertBackFn(t,this)}catch(s){}else t=this._convertBackFn(t,this);this._pathArray&&(f=this._pathArray.length,i=this._getPropertyFromIndex(i,this._pathArray,0,f-2),i!==null&&typeof i!="undefined"&&(r=this._pathArray[f-1],e=Sys.UI.DomElement.isDomElement(i),e&&(t=Sys.UI.Template._checkAttribute(r,t),r==="innerHTML"&&Sys.Application._clearContent(i)),Sys.Observer._setValue(i,r,t),t&&e&&this._isChecked(i,r)&&(o=document.createAttribute(r),o.nodeValue=r,i.setAttributeNode(o))))}}finally{this._updateSource=!1}n||u||this._watchObject(this.get_target())}}}function ru(n){var t=Sys.get(n,this.get_templateContext());if(t===null||typeof t=="undefined")throw Error.invalidOperation(String.format(Sys.UI.TemplatesRes.unresolvedReference,n));return t||null}function uu(n){this._addHandler("command",n)}function fu(n){this._removeHandler("command",n)}function eu(n){this._addHandler("rendering",n)}function ou(n){this._removeHandler("rendering",n)}function su(n){this._addHandler("rendered",n)}function hu(n){this._removeHandler("rendered",n)}function cu(n){this._addHandler("itemRendered",n)}function lu(n){this._removeHandler("itemRendered",n)}function au(n){this._addHandler("itemRendering",n)}function vu(n){this._removeHandler("itemRendering",n)}function yu(n){this._addHandler("fetchFailed",n)}function pu(n){this._removeHandler("fetchFailed",n)}function wu(n){this._addHandler("fetchSucceeded",n)}function bu(n){this._removeHandler("fetchSucceeded",n)}function ku(){return this._viewData||null}function du(){return this._data}function gu(n){this._setData&&this._data===n||this._loadData(n)}function nf(){return this._provider||null}function tf(n){if(this._dataProvider=this._wsp=this._wspClass=null,Sys.Data.IDataProvider.isImplementedBy(n))this._dataProvider=n;else if(Sys.Net.WebServiceProxy.isInstanceOfType(n))this._wsp=n;else if(Type.isClass(n)&&n.inheritsFrom(Sys.Net.WebServiceProxy)&&typeof n.get_path=="function")this._wspClass=n;else if(n!==null&&typeof n!="string")throw Error.argument("dataProvider",Sys.UI.TemplatesRes.invalidDataProviderType);this._provider=n;this.get_autoFetch()&&this._isActive()?n&&this._doAutoFetch():this._stale=!0}function rf(){return this._autoFetch}function uf(n){var t=this._autoFetch;if(typeof n=="string")n=Boolean.parse(n);else if(typeof n!="boolean")throw Error.invalidOperation(Sys.UI.TemplatesRes.stringOrBoolean);this._autoFetch=n;this._isActive()&&this._stale&&!t&&n&&this._doAutoFetch()}function ff(){return this._fetching}function ef(){return this._httpVerb||"POST"}function of(n){this._httpVerb=n}function sf(){return this._contexts}function hf(){return this._fetchParameters}function cf(n){this._fetchParameters!==n&&(this._fetchParameters=n,this.get_autoFetch()&&this._isActive()?this._doAutoFetch():this._stale=!0)}function lf(){var t=this.get_selectedIndex(),n;return t>-1&&(n=this.get_viewData(),n instanceof Array&&t<n.length)?n[t]:null}function af(){return this._selectedIndex}function vf(n){if(n=this._validateIndexInput(n),n<-1)throw Error.argumentOutOfRange("value",n);this.get_isInitialized()&&this._setData?this._applySelectedIndex(n):this._selectedIndex=n}function yf(){return this._initialSelectedIndex}function pf(n){if(n=this._validateIndexInput(n),n<-1)throw Error.argumentOutOfRange("value",n);n!==this.get_initialSelectedIndex()&&(this._initialSelectedIndex=n,this._raiseChanged("initialSelectedIndex"))}function wf(){return this._selectedItemClass||""}function bf(n){var i=this.get_selectedItemClass(),t;n!==i&&(t=this.get_selectedIndex(),this._addRemoveCssClass(t,i,Sys.UI.DomElement.removeCssClass),this._addRemoveCssClass(t,n,Sys.UI.DomElement.addCssClass),this._selectedItemClass=n)}function kf(){return this._timeout}function df(n){this._timeout=n}function gf(){return this._query||""}function ne(n){this._query!==n&&(this._query=n,this.get_autoFetch()&&this._isActive()?n&&this._doAutoFetch():this._stale=!0)}function te(){return this._placeholder||null}function ie(n){this._placeholder!==n&&(this._placeholder=n,this._dirty=!0,this._raiseChanged("itemPlaceholder"))}function re(){return this._parentContext||Sys.UI.Template.findContext(this.get_element())}function ue(n){this._parentContext!==n&&(this._parentContext=n,this._dirty=!0,this._raiseChanged("templateContext"))}function fe(){return this._template||null}function ee(n){this._template!==n&&(this._template=n,this._dirty=!0,this._dvTemplate&&(this._dvTemplate.dispose(),this._dvTemplate=null),this._isActive()?(this.raisePropertyChanged("itemTemplate"),this.refresh()):this._changed=!0)}function oe(n,t){var r=this.get_selectedIndex(),i,u,f;if(t||n!==r){if(i=this.get_viewData(),i instanceof Array||(i=[i]),u=n<-1||n>=i.length,u)throw Error.argumentOutOfRange("value",n);this._selectedIndex=n;this._currentData=n===-1||u?null:i[n];f=this.get_selectedItemClass();this._addRemoveCssClass(r,f,Sys.UI.DomElement.removeCssClass);this._addRemoveCssClass(n,f,Sys.UI.DomElement.addCssClass);this.get_isUpdating()?this._changed=!0:n!==r&&this.raisePropertyChanged("selectedIndex")}this.get_isUpdating()?this._changed=!0:this._raiseSelectedData()}function se(n,t,i){var r,e,u,f,s,o;if(t&&n>-1&&(r=this.get_contexts(),e=r?r.length:-1,e&&n<e&&(u=r[n].nodes,u)))for(f=0,s=u.length;f<s;f++)o=u[f],o.nodeType===1&&i(o,t)}function he(){return this._useOptimalUpdates}function ce(n){this._useOptimalUpdates=n}function le(n,t){var w=this._currentData,e=t.get_changes(),i=this.get_selectedIndex(),b=i,c,s,l,a,u,h,o,v,f;if(this._isActive())this._changing=!0,c=e.some(function(n,t){return n.action===Sys.NotifyCollectionChangedAction.add&&e.some(function(i,r){return r>t&&i.action===Sys.NotifyCollectionChangedAction.remove&&i.oldStartingIndex<=n.newStartingIndex})}),c?this.refresh():(s=this._ensureTemplate(this._getTemplate()),s._ensureCompiled(),l=/with\s*\(.*\$index/.test(s._instantiateIn.toString().replace(/(\r\n|\n|\r)/gm,"")),a=this.get_useOptimalUpdates()!=null?this.get_useOptimalUpdates():Sys.UI.DataView.config.useOptimalUpdates,a!==!0||l?this.refresh():(u=this,r(e,function(n){var r,f,t,i;if(n.oldItems&&n.oldItems.length>0)f=n.oldItems,t=n.oldStartingIndex,i=f.length,u._clearContainers(u._placeholders,t,i),u._contexts.splice(t,i);else if(n.newItems&&n.newItems.length>0){for(f=n.newItems,t=n.newStartingIndex,i=f.length,r=0;r<i;r++)u._contexts.splice(t+r,0,null);u.refresh(t,i)}})));else{this._dirty=!0;return}if(h=this.get_viewData(),i===-1||!(i<h.length)||h[i]!==w){for(o=0,v=e.length;o<v;o++)if(f=e[o],f.action===Sys.NotifyCollectionChangedAction.add)i>=f.newStartingIndex&&(i+=f.newItems.length);else{var y=f.oldStartingIndex,p=f.oldItems.length,k=y+p-1;if(i>k)i-=p;else if(i>=y){i=-1;break}}i!==b&&this.set_selectedIndex(i)}}function ae(n,t,i){if(n===t)return!i;do if(t=t.parentNode,t===n)return!0;while(t);return!1}function ve(n){this._isActive()?this.raisePropertyChanged(n):this._changed=!0}function ye(n,t){var i=new Sys.Net.WebRequestEventArgs(n?n.get_executor():null,t);this.onFetchFailed(i);Sys.Observer.raiseEvent(this,"fetchFailed",i)}function pe(){this._lastData!==this._currentData&&(this._lastData=this._currentData,this.raisePropertyChanged("selectedData"))}function we(n,t){var i=new Sys.Net.WebRequestEventArgs(n?n.get_executor():null,null,t);this.onFetchSucceeded(i);Sys.Observer.raiseEvent(this,"fetchSucceeded",i)}function be(n){return Sys.UI.Template.isInstanceOfType(n)||(n=Sys.UI.DomElement._ensureGet(n,this.get_templateContext(),"itemTemplate"),n&&(n=new Sys.UI.Template(n))),n}function ke(n){if(this._dvTemplate)throw Error.invalidOperation(Sys.UI.TemplatesRes.templateAlreadyDefined);this._dvTemplate=n}function de(){var n,t,i;if(this._dvTemplate)return this._dvTemplate;if(n=this.get_itemTemplate(),n)if(Sys.UI.Template.isInstanceOfType(n)){if(this._elementContains(this.get_element(),n.get_element(),!0))throw Error.invalidOperation(Sys.UI.TemplatesRes.misplacedTemplate);}else{if(n=Sys.UI.DomElement._ensureGet(n,this.get_templateContext(),"itemTemplate"),i=this.get_element(),i!==n&&this._elementContains(i,n,!0))throw Error.invalidOperation(Sys.UI.TemplatesRes.misplacedTemplate);this._dvTemplate=n=new Sys.UI.Template(n)}else t=this.get_element(),Sys.UI.Template._isTemplate(t)&&(this._dvTemplate=n=new Sys.UI.Template(t));return n}function ge(n){this._swapData(this._data,n);this._data=n;this._setData=!0;this._stale=!1;this._dirty=!0;this._isActive()?(this.get_isLinkPending()?this.link():this.refresh(),this.raisePropertyChanged("data")):this._changed=!0}function no(){var t=this.get_viewData(),n=this.get_initialSelectedIndex(),i=this.get_selectedIndex();if(!(t instanceof Array)||n>=t.length){if(i!==-1){this.set_selectedIndex(-1);return}}else if(i!==n){this.set_selectedIndex(n);return}this._currentData=this.get_selectedData();this._raiseSelectedData()}function to(n,t){for(var r,i=n||0,u=t?n+t:this._contexts.length;i<u;i++)r=this._contexts[i],r&&r.initializeComponents()}function io(){return this.get_isInitialized()&&!this.get_isUpdating()}function ro(n){this.onCommand(n);Sys.Observer.raiseEvent(this,"command",n)}function uo(n,t){this["onItem"+n](t);Sys.Observer.raiseEvent(this,"item"+n,t)}function fo(){this._request&&(this._request.get_executor().abort(),this._request=null);this._fetching&&(this._fetching=!1,this._raiseChanged("isFetching"))}function eo(n,t){var i,r;if(Sys.CommandEventArgs.isInstanceOfType(t)){if(this._raiseCommand(t),t.get_cancel())return!0;if(i=t.get_commandName(),i&&i.toLowerCase()==="select"&&(r=this._findContextIndex(n),r!==-1))return this.set_selectedIndex(r),!0}return!1}function oo(){}function so(){}function ho(){}function co(){try{(this._dataProvider||this._provider)&&(this.fetchData(),this._stale=!1)}catch(n){this._raiseFailed(null,null)}}function lo(n){var f=this._containers,u,i,s,r,h,o;if(n&&f&&(u=this.get_contexts(),u&&(i=Sys.UI.DomElement._ensureGet(n,this.get_templateContext(),"source"),i))){for(var t=i.parentNode,c=this.get_element(),e=-1;t&&(e=Sys._indexOf(f,t))<0&&t!==c;)i=t,t=t.parentNode;if(e>-1)for(s=f[e],r=0,h=u.length;r<h;r++)if(o=u[r],o.containerElement===s&&Sys._indexOf(o.nodes,i)>-1)return r}return-1}function ao(n){var t=this._findContextIndex(n);return t!==-1?this.get_contexts()[t]:null}function vo(n,t,i,r){var e=t?t.__msajaxphcount:-1,s,f,c,u,l,a,o,h;if(e>-1&&t&&(t.__msajaxphcount=0),e<0){if(t&&n.removeChild(t),i||Sys.Application.disposeElement(n,!0),s=!1,!i)try{n.innerHTML="";s=!0}catch(v){}if(!s)for(f=i||n.firstChild;f;)c=f===r?null:f.nextSibling,Sys.Application.disposeElement(f,!1),n.removeChild(f),f=c;t&&n.appendChild(t)}else if(e>0){for(o=n.childNodes,u=0,l=o.length;u<l;u++)if(o[u]===t)break;for(a=u-e,u=0;u<e;u++)h=o[a],Sys.Application.disposeElement(h,!1),n.removeChild(h)}}function yo(n,t,i){for(var f,o,e,r=0,u=n.length;r<u;r++)f=n[r],o=f?f.parentNode:this.get_element(),this._clearContainer(o,f);for(r=t||0,u=i?t+i:this._contexts.length;r<u;r++)e=this._contexts[r],e.nodes=null,e.dispose()}function po(n,t){var f=n.childNodes,i,u,r;if(f.length===1)return!0;for(i=n.firstChild,u=/\S/;i;){if(i!==t)if(r=i.nodeType,r===3){if(u.test(i.nodeValue))return!1}else if(r!==8)return!1;i=i.nextSibling}return!0}function wo(){return!0}function bo(n,i){function ut(){if(!this._cleared){if(Sys.UI.Template._isTemplate(s)){var n=new Sys.UI.Template(s);n._ensureCompiled();n.dispose();Sys.UI.DomElement.removeCssClass(s,"sys-template")}this._clearContainer(s,null);s.__msajaxphcount=-1;this._cleared=!0}}var rt,p,nt,c,u,r,ft,b,e,k,l,et,d,g,y,ot,i,tt,it;if(this._setData){rt=this._changing;this._changing=!1;var f=this.get_data(),a=this.get_templateContext(),o=new Sys.Data.DataEventArgs(f);o._itemTemplate=this._getTemplate();o._placeholder=Sys.UI.DomElement._ensureGet(this.get_itemPlaceholder(),a,"itemPlaceholder");this.onRendering(o);if(Sys.Observer.raiseEvent(this,"rendering",o),!o.get_cancel()){f=o.get_data();this._viewData=f;p=this._ensureTemplate(o._itemTemplate);this._dirty=!1;var st=Sys.UI.DomElement._ensureGet(o._placeholder,a,"itemPlaceholder"),s=this.get_element(),v,w,h,ht=this._contentTemplate;for(this._placeholders&&arguments.length===0&&this._clearContainers(this._placeholders),nt=f,f===null||typeof f=="undefined"?(u=0,c=0):f instanceof Array?(u=n||0,c=i?n+i:f.length):(nt=[f],u=0,c=1),!c&&p&&p.get_element()===s&&ut.call(this),arguments.length===0?(this._placeholders=b=[],this._containers=k=[],this._contexts=new Array(c)):(b=this._placeholders,k=this._containers,d=this._contexts[n+i],d&&d.nodes&&(et=d.nodes[0]));u<c;u++)g=nt[u],h=new Sys.UI.DataViewItemEventArgs(g),h._itemTemplate=p,h._placeholder=st,this._raiseItem("Rendering",h),w=this._ensureTemplate(h._itemTemplate),r=Sys.UI.DomElement._ensureGet(h._placeholder,a,"itemPlaceholder"),r=r?r.__msajaxphoption||r:null,r!==ft&&(e=r?r.parentNode:s,Sys._indexOf(b,r)<0&&(r?(/^option$/i.test(r.tagName)&&/select/i.test(e.tagName)&&(y=document.createElement("_hiddenPlaceholder"),e.replaceChild(y,r),r.__msajaxphoption=y,y.appendChild(r),r=y),r.style.display="none",ot=r.__msajaxphcount,typeof ot=="undefined"&&this._isAlone(e,r)&&(r.__msajaxphcount=-1,this._clearContainer(e,r))):ut.call(this),b.push(r),Sys._indexOf(k,e)<0&&(k.push(e),/^select$/i.test(e.tagName)&&(l=l||[],l.push(e))))),ft=r,v=w?w.instantiateIn(e,f,g,u,r||et,a,ht):t(new Sys.UI.TemplateContext,{nodes:[],dataItem:g,data:f,index:u,parentContext:a}),h._ctx=v,this._contexts[u]=v,this._raiseItem("Rendered",v),w&&r&&(i=r.__msajaxphcount||0,i>-1&&(r.__msajaxphcount=i+v.nodes.length));if(l)for(u=0;u<l.length;u++)Sys.Observer.raiseEvent(l[u],"optionsChanged",Sys.EventArgs.Empty);rt||(!this._rendered&&this.get_selectedIndex()>-1?this._applySelectedIndex(this.get_selectedIndex(),!0):this._resetSelectedIndex());this._rendered=!0;tt=this.get_selectedItemClass();tt&&(it=this.get_selectedIndex(),it!==-1&&this._addRemoveCssClass(it,tt,Sys.UI.DomElement.addCssClass));this.raisePropertyChanged("viewData");Sys.Observer.raiseEvent(this,"rendered",o);this._initializeResults(n,i)}}}function ko(n,t){if(n)switch(this._eventType){case 1:n.remove_collectionChanged(this._changedHandler);break;case 2:Sys.Observer.removeCollectionChanged(n,this._changedHandler)}this._eventType=0;t&&(this._changedHandler||(this._changedHandler=Function.createDelegate(this,this._collectionChanged)),typeof t.add_collectionChanged=="function"?(t.add_collectionChanged(this._changedHandler),this._eventType=1):t instanceof Array&&(Sys.Observer.addCollectionChanged(t,this._changedHandler),this._eventType=2))}function go(n){var t=typeof n;if(t==="string"){if(n=parseInt(n),isNaN(n))throw Error.argument(Sys.UI.TemplatesRes.invalidSelectedIndexValue);}else if(t!=="number")throw Error.argument(Sys.UI.TemplatesRes.invalidSelectedIndexValue);return n}function ns(){this._placeholders&&!Sys.Application.get_isDisposing()&&this._clearContainers(this._placeholders);this._dvTemplate&&this._dvTemplate.dispose();this.get_isFetching()&&(this.abortFetch(),this._fetching=!1);this._swapData(this._data,null);this._currentData=this._lastData=this._placeholders=this._containers=this._placeholder=this._contexts=this._autoFetch=this._parentContext=this._dvTemplate=this._request=this._dataProvider=this._wsp=this._wspClass=this._fetching=this._initialSelectedIndex=this._selectedIndex=this._provider=this._data=this._fetchParameters=this._query=this._contentTemplate=this._changed=this._dirty=this._eventType=this._stale=this._timeout=this._visibilityMode=this._changing=this._changedHandler=this._viewData=this._cleared=this._rendered=this._setData=null;Sys.UI.DataView.callBaseMethod(this,"dispose")}function ts(){Sys.UI.DataView.callBaseMethod(this,"initialize");this.get_isLinkPending()?this.hasOwnProperty("_data")&&this.link():(this.refresh(),this.updated())}function is(n,t,i,r){function e(t){u._loadData(t);u._fetching=!1;u._request=null;u._raiseChanged("isFetching");u._raiseSucceeded(f,t);n&&n(t,r,"fetchData")}function o(n){u._fetching=!1;u._request=null;u._raiseChanged("isFetching");u._raiseFailed(f,n);t&&t(n,r,"fetchData")}var f,u,v,y;this._stale=!1;u=this;this._fetching&&this.abortFetch();var w=this._dataProvider,s=this._wsp,p=this._wspClass,h=this.get_fetchOperation(),c=this.get_fetchParameters()||null,l=this.get_httpVerb()||"POST",a=this.get_timeout()||0;return typeof i=="undefined"&&(i=null),w?f=w.fetchData(h,c,i,l,e,o,a,r):s?(v=s.get_path(),v||(y=Object.getType(s),y&&typeof y.get_path=="function"&&(v=y.get_path())),Type._checkDependency("MicrosoftAjaxWebServices.js","Sys.UI.DataView.fetchData"),f=Sys.UI.DataView._fetchWSP(null,v,h,c,l,e,o,a||s.get_timeout())):(Type._checkDependency("MicrosoftAjaxWebServices.js","Sys.UI.DataView.fetchData"),f=p?Sys.UI.DataView._fetchWSP(null,p.get_path(),h,c,l,e,o,a||p.get_timeout()):Sys.UI.DataView._fetchWSP(null,this._provider,h,c,l,e,o,a)),this._request=f,this._fetching=!0,this._raiseChanged("isFetching"),f}function rs(){}function us(){}function fs(){}function es(){this._stale&&this.get_autoFetch()&&this._doAutoFetch();this._dirty&&this.refresh();this._changed&&(this.raisePropertyChanged(""),this._changed=!1)}function os(){this._changed=!1;this._dirty=!1;this._contexts=[];this._placeholders=[null];this._containers=[this.get_element()];Sys.Application._linkContexts(this.get_templateContext(),this,this.get_data(),this.get_element(),null,this._contentTemplate);this._initializeResults();Sys.UI.DataView.callBaseMethod(this,"link")}function ss(){return this._data}function hs(){return this._ctx||null}function cs(){return this._placeholder||null}function ls(n){this._placeholder=n}function as(){return this._itemTemplate||null}function vs(n){this._itemTemplate=n}var s;Type._registerScript("MicrosoftAjaxTemplates.js",["MicrosoftAjaxComponentModel.js","MicrosoftAjaxSerialization.js"]);var t=Sys._merge,r=Sys._foreach,h=Sys._forIn,ys=Sys._indexOf,i=Sys._isBrowser;if(Type.registerNamespace("Sys.Net"),Sys.Net.WebRequestEventArgs=function(n,t,i){this._executor=n;this._error=t||null;this._result=typeof i=="undefined"?null:i;Sys.Net.WebRequestEventArgs.initializeBase(this)},Sys.Net.WebRequestEventArgs.prototype={get_error:c,get_executor:l,get_result:a},Sys.Net.WebRequestEventArgs.registerClass("Sys.Net.WebRequestEventArgs",Sys.EventArgs),Type.registerNamespace("Sys.Data"),Sys.Data.DataEventArgs=function(n){this._data=n;Sys.Data.DataEventArgs.initializeBase(this)},Sys.Data.DataEventArgs.prototype={get_data:v,set_data:y,get_itemPlaceholder:p,set_itemPlaceholder:w,get_itemTemplate:b,set_itemTemplate:k},Sys.Data.DataEventArgs.registerClass("Sys.Data.DataEventArgs",Sys.CancelEventArgs),!Sys.Data.IDataProvider){Sys.Data.IDataProvider=function(){};function d(){throw Error.notImplemented();}Sys.Data.IDataProvider.prototype={fetchData:d};Sys.Data.IDataProvider.registerInterface("Sys.Data.IDataProvider")}Sys.Data.MergeOption||(Sys.Data.MergeOption=function(){throw Error.notImplemented();},Sys.Data.MergeOption.prototype={appendOnly:0,overwriteChanges:1},Sys.Data.MergeOption.registerEnum("Sys.Data.MergeOption"));Type.registerNamespace("Sys.UI");Sys.Application.registerMarkupExtension=function(n,t,i){this._extensions||(this._extensions={});i=typeof i=="undefined"||i===!0;this._extensions[n]={expression:i,extension:t}};Sys.Application._getMarkupExtension=function(n){var t=this._extensions?this._extensions[n]:null;if(!t)throw Error.invalidOperation(String.format(Sys.UI.TemplatesRes.cannotFindMarkupExtension,n));return t};Sys.UI.Template=function(n){this._element=n;this._instantiateIn=null;this._instanceId=0};Sys.UI.Template.prototype={get_element:g,dispose:nt,_appendTextNode:tt,_appendAttributeSetter:it,_processAttribute:rt,_getAttributeExpression:ut,_processBooleanAttribute:ft,_processBooleanAttributes:et,_processCodeBlock:ot,_getExplicitAttribute:st,_buildTemplateCode:ht,_ensureCompiled:ct,recompile:lt,instantiateIn:at};Sys.UI.Template._isRestricted=function(n){var t=Sys.UI.Template._getRestrictedIndex();return t.attributes[n.toLowerCase()]};Sys.UI.Template._checkAttribute=function(n,t){var i,r,u;return t===null||t===undefined?t:(i=t,r=Sys.UI.Template._getRestrictedIndex(),r.attributes[n.toLowerCase()]&&(typeof t!="string"&&(t=t.toString()),u=Sys.UI.Template._protocolRegExp.exec(t.toLowerCase()),u&&(r.protocols[u[1]]||(i=""))),i)};Sys.UI.Template._getIdFunction=function(n){return function(t){return t+n}};Sys.UI.Template._createInput=function(n,t,i){var r,e=arguments.callee,u=e._dynamic,f;if(u===!0)r=document.createElement(i?"button":"input"),n&&r.setAttribute("type",n),t&&r.setAttribute("name",t);else{f=i?"<button ":"<input ";n&&(f+="type='"+n+"' ");t&&(f+="name='"+t+"' ");f+=i?"><\/button>":"/>";try{r=document.createElement(f)}catch(o){u=!0}typeof u=="undefined"&&(dynamc=r.tagName.toLowerCase()!==(i?"button":"input"));e._dynamic=u;u&&(r=e(n,t,i))}return r};Sys.UI.Template._isTemplate=function(n){var t=n.className;return t&&(t==="sys-template"||/(^| )sys\-template($| )/.test(t))};Sys.UI.Template._inputRequiredAttributes={type:1,name:1,"sys:type":1,"sys:name":1};Sys.UI.Template._commonBooleanAttributes={disabled:!0," list":["disabled"]};Sys.UI.Template._inputBooleanAttributes={disabled:!0,checked:!0,readonly:!0," list":["disabled","checked","readonly"]};Sys.UI.Template._booleanAttributes={input:Sys.UI.Template._inputBooleanAttributes,select:{disabled:!0,multiple:!0," list":["disabled","multiple"]},option:{disabled:!0,selected:!0," list":["disabled","selected"]},img:{disabled:!0,ismap:!0," list":["disabled","ismap"]},textarea:{disabled:!0,readonly:!0," list":["disabled","readonly"]}};Sys.UI.Template._expressionRegExp=/\{\{\s*([\w\W]*?)\s*\}\}/g;Sys.UI.Template.allowedProtocols=["http","https","data"];Sys.UI.Template.restrictedAttributes=["src","href","codebase","cite","background","action","longdesc","profile","usemap","classid","data"];Sys.UI.Template._getRestrictedIndex=function(){var n,i,f,e,r=Sys.UI.Template.allowedProtocols||[],u=Sys.UI.Template.restrictedAttributes||[],t=Sys.UI.Template._restrictedIndex;if(!t||t.allowedProtocols!==r||t.restrictedAttributes!==u){for(t={allowedProtocols:r,restrictedAttributes:u},t.protocols=f={},n=0,i=r.length;n<i;n++)f[r[n]]=!0;for(t.attributes=e={},n=0,i=u.length;n<i;n++)e[u[n]]=!0;Sys.UI.Template._restrictedIndex=t}return t};Sys.UI.Template.registerClass("Sys.UI.Template",null,Sys.IDisposable);Sys.UI.Template._protocolRegExp=/^\s*([a-zA-Z0-9\+\-\.]+)\:/;Sys.UI.Template.findContext=function(n){var t;do t=Sys.UI.TemplateContext._contexts[n.__mstcindex],n=n.parentNode;while(!t&&n);return t||Sys.Application.get_templateContext()};Sys._Application.prototype.get_templateContext=function(){return this._context||null};Sys._Application.prototype._baseDispose=Sys._Application.prototype.dispose;Sys._Application.prototype.dispose=function(){var n=this._context;n&&n.dispose();this._context=null;this._baseDispose()};Sys._Application.prototype.removeComponent=function(n){var r=n.get_id(),t,i;r&&delete this._components[r];t=this._context;t&&(i=n.__tc,i&&i[0]===t._tcindex&&delete t.components[i[1]])};Sys.UI.TemplateContext=function(n){var t=this._tcindex=n||Sys.UI.TemplateContext._tcindex++;Sys.UI.TemplateContext._contexts[t]=this;this._completed=[];Sys.UI.TemplateContext.initializeBase(this)};Sys.UI.TemplateContext.prototype={data:null,dataItem:null,index:0,parentContext:null,containerElement:null,insertBeforeNode:null,components:null,nodes:null,isDisposed:!1,_lastIndex:-1,dispose:vt,query:yt,get:pt,_find:wt,_findById:bt,getInstanceId:kt,initializeComponents:dt,add_instantiated:gt,remove_instantiated:ni,_onInstantiated:ti,_registerComponent:ii,_registerIf:ri};Sys.UI.TemplateContext.registerClass("Sys.UI.TemplateContext",null,Sys.IDisposable);Sys.UI.TemplateContext._tcindex=0;Sys.UI.TemplateContext._contexts=[];Sys.UI.ITemplateContextConsumer=function(){throw Error.notImplemented();};Sys.UI.ITemplateContextConsumer.prototype={get_templateContext:ui,set_templateContext:fi};Sys.UI.ITemplateContextConsumer.registerInterface("Sys.UI.ITemplateContextConsumer");Sys.UI.IContentTemplateConsumer=function(){throw Error.notImplemented();};Sys.UI.IContentTemplateConsumer.prototype={addContentTemplate:ei};Sys.UI.IContentTemplateConsumer.registerInterface("Sys.UI.IContentTemplateConsumer");Sys.Application._caseIndex={};Sys.Application._prototypeIndex={};Sys.Application._context=new Sys.UI.TemplateContext;Sys.Application._context._global=!0;Sys.Application.activateElement=function(n,t,i){return Sys.Application.activateElements(n,t||null,i!==!1)};Sys.Application.activateElements=function(n,t,r){var f=Sys.Application,u=f._context,e=i("InternetExplorer")&&Sys.Browser.version<9;return u.dataItem=typeof t=="undefined"?null:t,u.components=u.components||[],u.nodes=n,r=r!==!1,Sys._queryAll(n,function(n){f._activateElement(n,u,e,null,r)}),u.initializeComponents(),u._onInstantiated(null,!0),u};Sys.registerPlugin({name:"activateElements",plugin:Sys.Application.activateElements,returnType:"Sys.UI.TemplateContext",parameters:[{name:"elements",description:"The element or array of elements to activate. You may also pass DOM selectors or array of DOM selectors."},{name:"bindingContext",description:"The binding context."},{name:"recursive",type:"Boolean",description:"Specifies whether processing should occur recursively."}]});Sys.Application._findType=function(n,t,i){function e(){var t;try{t=i?n[f]:n.getAttribute(f)}catch(e){}if(t&&t.substr(0,11)==="javascript:"){t=t.substr(11);r=null;try{r=Type.parse(t)}catch(e){u=String.format(Sys.UI.TemplatesRes.invalidTypeNamespace,t);return}if(r&&r.__class)return;r=t}}for(var u,r,f="xmlns:"+t;n;n=n.parentNode){if(e(),u)throw Error.invalidOperation(u);if(r)return r}if(n=document.body,e(),u)throw Error.invalidOperation(u);return r};Sys.Application._activateElement=function(n,t,i,r,u){var v,e,rt,pt,b,c,tt,ct,k,h;u&&(u=!Sys.UI.Template._isTemplate(n));var ut=-1,lt=u?i?n.all:n.getElementsByTagName("*"):[],at=i&&Sys.Browser.version<=7,f=n;do if(f.nodeType===1){var l,vt,nt=null,s=null,p=null,w=null,d=null,yt=!1,it=null,ft=f.attributes,et=ft.length-1,g=null;if(et>=0&&(!at||ft[et].expando)&&!f.__msajaxactivated){for(l=et;l>=0;l--){if(v=ft[l],at&&!v.expando)break;if(v.specified&&!(v.nodeName.indexOf(":")<0)){yt=!0;it=v.nodeName;e=v.nodeValue;switch(it){case"sys:attach":nt=e.split(",");break;case"sys:command":var ii=Sys.Application._getPropertyValue(null,null,null,e,t,f,null,!0),ri=Sys.Application._getCommandAttr(f,t,"sys:commandargument",i),ui=Sys.Application._getCommandAttr(f,t,"sys:commandtarget",i);Sys.UI.DomElement.setCommand(f,ii||"",ri||null,Sys.UI.DomElement._ensureGet(ui,t,"sys:commandtarget"));break;case"sys:content-template":d=Sys.Application._getPropertyValue(null,null,null,e,t,f,null,!0);break;default:g=g||[];g.push(v)}}}if(d!==null&&nt===null)throw Error.invalidOperation("invalidSysContentTemplate");if(yt){if(f.__msajaxactivated=!0,nt)for(p={},rt=0,pt=nt.length;rt<pt;rt++)if(b=nt[rt].trim(),!p[b]){if(c=Sys.Application._findType(f,b,i),!c)throw Error.invalidOperation(String.format(Sys.UI.TemplatesRes.invalidAttach,"sys:attach",b));var wt=null,ot=0,st=0,bt=0,kt=0,fi=typeof c!="string",y=null;if(fi){if(ot=c.inheritsFrom(Sys.Component),st=ot&&(c.inheritsFrom(Sys.UI.Behavior)||c.inheritsFrom(Sys.UI.Control)),bt=c.implementsInterface(Sys.UI.ITemplateContextConsumer),kt=c.implementsInterface(Sys.UI.IContentTemplateConsumer),y=st?new c(f):new c,ot&&y.beginUpdate(),st||Sys.Application._registerComponent(f,y),bt&&y.set_templateContext(t),kt)d!==null&&y.addContentTemplate(d),r&&y.addContentTemplate(r);else if(d!==null)throw Error.invalidOperation("invalidSysContentTemplate");s={instance:y,isClass:!0,typeName:b,type:c}}else if(d!==null)throw Error.invalidOperation("invalidSysContentTemplate");else wt={},y=Type.parse(c),s={instance:y,props:wt,typeName:b,type:c},w?w[w.length]=s:w=[s];p[b]=s}if(g)for(l=g.length-1;l>=0;l--){v=g[l];it=v.nodeName;e=v.nodeValue;var dt=/^select$/i.test(f.tagName),a=Sys.Application._splitAttribute(it,dt,p),ht=a.type,ei=a.ns,o=a.name;if(!(ht<0))if(ht===3){if(s=a.index,tt=s.instance,e=Sys.Application._getPropertyValue(a,tt,o,e,t,f),typeof e=="undefined")continue;if(s.isClass)switch(a.map.type){case 1:a.map.setter.call(tt,e);break;case 2:a.map.setter.call(tt,typeof e=="function"?e:new Function("sender","args",e));break;default:tt[o]=e}else s.props[o]=e}else if(ht<=2){if((a.textNode||o==="innerHTML")&&Sys.Application._clearContent(f),e=Sys.Application._getPropertyValue(a,f,o,e,t,f),typeof e=="undefined")continue;switch(a.type){case 0:if(/^on/i.test(o)){f[o]=document.attachEvent?new Function(e):new Function("event",e);break}if(dt&&o==="value"){f.value=e;break}var gt=Sys.UI.Template._booleanAttributes,ni=f.tagName.toLowerCase(),ti=o==="disabled"||gt[ni]&>[ni][o];if(ti)if(o==="selected"&&(f.selected=e),e){if(o==="checked"){f.setAttribute(o,o);break}}else{f.removeAttribute(o);break}ct=document.createAttribute(o);ct.nodeValue=ti?o:e;f.setAttributeNode(ct);break;case 1:a.textNode?(Sys.Application._clearContent(f),f.appendChild(document.createTextNode(e))):Sys.Observer.setValue(f,o,e);break;case 2:e?Sys.UI.DomElement.addCssClass(f,o):Sys.UI.DomElement.removeCssClass(f,o)}}}if(w)for(l=0,vt=w.length;l<vt;l++)s=w[l],t._registerIf(s.instance(f,s.props,t));if(p)for(s in p)p.hasOwnProperty(s)&&(s=p[s],s&&s.isClass&&t._registerComponent(s.instance))}}if(u&&(k=f.className,k&&k.length>=10&&(k==="sys-template"||k==="sys-ignore"||/(^| )sys\-template($| )/.test(k)||/(^| )sys\-ignore($| )/.test(k)))){for(h=f.nextSibling;h&&h.nodeType!==1;)h=h.nextSibling;while(!h){if(f=f.parentNode,f===n)break;for(h=f.nextSibling;h&&h.nodeType!==1;)h=h.nextSibling}if(!h||h.nodeType!==1)break;do{if(f=lt[ut+1],f===h)break;ut++}while(f)}}while(!!(f=lt[++ut]))};var f=/^data\-sys\-([a-z_]*)$/,e=/^data\-([a-z_]*)\-([a-z_]*)$/,o=/^sys\:([a-z_]*)$/;Sys.Application._linkAttributes=function(n,t,i){var c,s,r,a,k,d,p,u,w,v,h,l,b,g,y;for(n.control&&i&&(b={},y=n.control.constructor,b[i]={type:y,isClass:!0,isComponent:y.inheritsFrom&&y.inheritsFrom(Sys.Component)}),c=0;c<n.attributes.length;c++)s=n.attributes[c],u=s.name,f.test(u)?(r={raw:u,prefix:"sys"},r.name=f.exec(s.name)[1],l=!0):e.test(u)?(r={raw:u},p=e.exec(u),r.control=r.prefix=p[1],r.name=p[2],l=!0):o.test(u)&&(r={raw:u,prefix:"sys"},r.name=o.exec(s.name)[1],l=!1),r&&(v=r.control?n.control:n,v&&(k=n.tagName==="SELECT",d=n.tagName==="TEXTAREA",a=Sys.Application._splitAttribute(r.prefix+":"+r.name,k,b),h=a.name,(h==="innerHTML"||h==="innerText"||d&&h==="value")&&(g=!0),w=Sys.Application._getPropertyValue(a,v,h,s.nodeValue,t,n,null,!1,{isLinkPending:!n.control&&l}),w!==undefined&&Sys.Observer.setValue(v,a.name||h,w),r=null,l||(n.removeAttribute(s.name),c-=1)));return g};s=/^(\/|)item(\:([\$_A-Za-z0-9]+)|)$/;Sys.Application._linkContexts=function(n,t,r,f,e,o,h,c){var ct,v,g,p,nt,pt,d,l,y,w,lt,at,vt,a,tt,wt,et,bt,ot,it,rt,b,st,kt,ht,ni,k,ut,dt,gt,ft,yt;for(p=-1,bt=!h&&e,wt=r&&r instanceof Array,pt=f.tagName==="SELECT",kt=Sys.UI.Template._expressionRegExp,d=-1,ct=[];l=f.childNodes[++d];)ct[d]=l;for(d=0;d<ct.length;d++){if(l=ct[d],w=lt=at=y=a=null,vt=tt=!1,et=c,ft=l.nodeType===1,gt=l.nodeType===3,yt=l.nodeType===8,gt){if(b=l.nodeValue,st=b.trim(),st.startsWith("{")&&st.endsWith("}")&&(!st.startsWith("{{")||!st.endsWith("}}")))tt=!0,it=f.tagName.toLowerCase()==="textarea"?"value":"innerText",rt=Sys.Application._splitAttribute(it,pt),a=Sys.Application._getPropertyValue(rt,f,it,b,e,f,null,!1);else{for(ot=0,y=kt.exec(b);y;)tt||(a="",tt=!0,it=f.tagName.toLowerCase()==="textarea"?"value":"innerText",rt=Sys.Application._splitAttribute(it,pt)),a+=b.substring(ot,y.index)||"",a+=Sys.Application._getPropertyValue(rt,f,it,y[0],e,f,null,!1)||"",ot=y.index+y[0].length,y=kt.exec(b);tt&&ot<b.length&&(a+=b.substr(ot))}tt&&(l.nodeValue=a||"");continue}if(!h)if(yt&&(y=s.exec(l.nodeValue))?y[1]===""?(nt=y[3],w={begin:!0,end:!1}):y[1]==="/"&&(w={begin:!1,end:!0}):ft&&l.hasAttribute("data-sys-ctx")&&(dt=l.getAttribute("data-sys-ctx"),dt.indexOf("/")===0?w={begin:!1,end:!0}:(nt=dt,w={begin:!0,end:!1})),w){if(bt)if(ft)throw new Error("Unexpected context marker in DOM for element '"+u(l)+"': context was provided by caller.");else if(yt)throw new Error("Unexpected context marker in DOM for comment '"+l.nodeValue+"': context was provided by caller.");else throw new Error("Unexpected context marker in DOM: context was provided by caller");if(w.begin){if(e)throw new Error("There is already a context in use. This may be caused by invalid markup.");if(!nt)throw new Error("Could not find context id for newly created context.");if(v=new Sys.UI.TemplateContext(nt),v.data=r,v.components=[],v.nodes=g?g.slice():[],v.index=++p,wt){if(p>=r.length)throw new Error("Unexpected number of contexts: expected "+r.length+" but found at least "+(p+1));v.dataItem=r[p]}else if(p>0)throw new Error("Found multiple contexts in DOM, but data is not an array.");else v.dataItem=r;v.parentContext=n;v.containerElement=f;t._getTemplate&&(v.template=t._getTemplate());v.template._ensureCompiled();g=null;t._contexts.push(v);e=v}else w.end&&(e._onInstantiated(null,!0),e=null);ft&&f.removeChild(l);continue}else if(gt&&!e)g?g.push(l):g=[l];else{if(!e)if(ft)throw new Error("Found element '"+u(l)+"' outside of an active context.");else if(yt)throw new Error("Found comment '"+l.nodeValue+"' outside of an active context.");else throw new Error("Found unknown node '"+l.nodeValue+"' outside of an active context.");e.nodes.push(l)}if(ft){if(l.hasAttribute("data-sys-tmplidx")&&(lt=parseInt(l.getAttribute("data-sys-tmplidx"),10)),l.__mstcindex=e._tcindex,l.hasAttribute("data-continue")||et||(l.hasAttribute("sys:attach")||l.hasAttribute("sys:if")||l.hasAttribute("sys:content-template"))&&(et=!0),l.hasAttribute("sys:if"))if(a=l.getAttribute("sys:if"),Sys.Application._getPropertyValue(null,null,null,a,e,l,null,!0))l.removeAttribute("sys:if");else{f.removeChild(l);continue}if(l.hasAttribute("sys:id")){if(l.id)throw new Error("Found a sys:id binding in pre-rendered markup, but the element already has an id.");a=l.getAttribute("sys:id");a.startsWith("{")&&a.endsWith("}")?(rt=Sys.Application._splitAttribute("id",!1),a=Sys.Application._getPropertyValue(rt,f,"id",a,e,f,null,!0)):a=e.getInstanceId(a);l.id=a;l.removeAttribute("sys:id")}else et&&l.hasAttribute("id")&&(a=l.id,l.id=e.getInstanceId(a));if(k=l.hasAttribute("data-sys-content-template")?l.getAttribute("data-sys-content-template"):null,nt=l.getAttribute("data-sys-tcindex"),l.hasAttribute("data-sys-attach")){if(ht=l.getAttribute("data-sys-attach"),Sys.Application._linkControlElement(l,e),ni=l.control.constructor.implementsInterface(Sys.UI.IContentTemplateConsumer),ni)k&&l.control.addContentTemplate(k),o&&l.control.addContentTemplate(o);else if(k!==null)throw Error.invalidOperation("invalidSysContentTemplate");if(l.control._setTemplateCtxId&&l.control._setTemplateCtxId(nt),Sys.Application._linkAttributes(l,e,ht),l.control._generatesContext&&(vt=l.control._generatesContext()),vt&&l.control._setTemplate){if(typeof lt!="number")throw new Error("A templated control is attached to the node, but no template index was specified.");at=new Sys.UI.Template(e.template.get_element()._msajaxtemplate[2][lt][1]);at._ensureCompiled();l.control._setTemplate(at)}e._registerComponent(l.control)}o?(ut=o,k&&(ut+=" "+k)):ut=k?k:null;vt||(Sys.UI.Template._isTemplate(l)?(ht=l.getAttribute("sys:attach"),Sys.Application._activateElement(l,e,i("InternetExplorer")&&Sys.Browser.version<9,ut,!0),Sys.Application._linkAttributes(l,e,ht)):(Array.prototype.some.call(l.attributes,function(n){return n.name.indexOf(":")>=0})&&Sys.Application._activateElement(l,e,i("InternetExplorer")&&Sys.Browser.version<9,ut,!1),Sys.Application._linkAttributes(l,e,ht)||Sys.Application._linkContexts(n,t,r,l,e,ut,!0,et)))}}if(!h&&wt&&!bt&&p!=r.length-1)throw new Error("Unexpected number of contexts: expected "+r.length+" but found "+(p+1));};Sys.Application._linkControlElement=function(n,t){if(!n.hasAttribute("data-sys-attach"))throw new Error("Element '"+u(n)+"' is not a control.");var f=n.getAttribute("data-sys-attach"),e=Sys.Application._findType(n,f,i("InternetExplorer")&&Sys.Browser.version<9),o=e.implementsInterface(Sys.UI.ITemplateContextConsumer),r=new e(n);return r.beginUpdate(),r.set_isLinkPending(!0),o&&r.set_templateContext(t),f};Sys.Application.linkElement=function(n,t){var i,r,e,u,f,o;if(i=Sys.Application._context,i.dataItem=null,i.components=i.components||[],i.nodes=[n],e=Sys.Application._linkControlElement(n,i),r=n.control,n.hasAttribute("data-sys-content-template")){if(o=r.constructor.implementsInterface(Sys.UI.IContentTemplateConsumer),!o)throw Error.invalidOperation("invalidSysContentTemplate");f=n.getAttribute("data-sys-content-template");f&&r.addContentTemplate(f)}r._setTemplate&&(u=new Sys.UI.Template(t),u._ensureCompiled(),r._setTemplate(u));Sys.Application._linkAttributes(n,i,e);i._registerComponent(r);i.initializeComponents();i._onInstantiated(null,!0)};Sys.Application._clearContent=function(n){Sys.Application.disposeElement(n,!0);try{n.innerHTML=""}catch(t){while(n.firstChild)n.removeChild(n.firstChild)}};Sys.Application._getCommandAttr=function(n,t,i,r){var u=null;try{u=r?n[i]:n.getAttribute(i);u=u?Sys.Application._getPropertyValue(null,null,null,u,t,n,null,!0):null}catch(f){}return u};Sys.Application._directAttributes={style:"style.cssText","class":"className",cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",rowspan:"rowSpan",contenteditable:"contentEditable",valign:"vAlign",innertext:"innerText",innerhtml:"innerHTML"};Sys.Application._splitAttribute=function(n,t,i){var o=n.split(":"),u=o.length>1?o[0]:null,r=o[u?1:0],f=-1,l,s,e,h=u==="sys",a=r.toLowerCase(),v=!u,c;return!u||h?(c=Sys.Application._directAttributes[a],c?(f=1,r==="innertext"&&(l=!0),r=c):t?a==="selectedindex"?(r="selectedIndex",f=1):r==="value"?f=1:h&&(f=0,u=null):h&&(r==="command"||r==="commandargument"||r==="commandtarget"?f=4:r.indexOf("style-")===0?(r="style."+Sys.Application._translateStyleName(r.substr(6)),f=1):r.indexOf("class-")===0?(r=r.substr(6),f=2):(u=null,f=0))):i?(e=i[u],e?(f=3,e.isClass&&(s=Sys.Application._translateName(r,e.type),r=s.name)):(r=u+":"+r,u=null,f=-1)):(r=u+":"+r,u=null,f=-1),{ns:u,name:r,type:f,map:s,index:e,textNode:l,isNative:v}};Sys.Application._translateStyleName=function(n){var t,r,i,f,u;if(n.indexOf("-")===-1)return n;for(t=n.toLowerCase().split("-"),r=t[0],i=1,f=t.length;i<f;i++)u=t[i],r+=u.substr(0,1).toUpperCase()+u.substr(1);return r};Sys.Application._getExtensionCode=function(n,t,i,r){var o,u,l,s,h,v,f,c,e,a;if(n=n.trim(),l={},s=n.indexOf(" "),s!==-1){if(o=n.substr(0,s),u=n.substr(s+1),u)for(u=u.replace(/\\,/g,"\x00").split(","),h=0,v=u.length;h<v;h++)f=u[h].replace(/\u0000/g,","),c=f.indexOf("="),c!==-1?(a=f.substr(0,c).trim(),e=f.substr(c+1).trim(),t&&(e=this._getPropertyValue(null,null,null,e,i,r,!0))):(a="$default",e=f.trim()),l[a]=e}else o=n;return{instance:Sys.Application._getMarkupExtension(o),name:o,properties:l}};Sys.Application._getPropertyValue=function(n,i,r,u,f,e,o,s,h){var c=u.replace(/</,"<").replace(/>/,">"),l;return c.startsWith("{{")&&c.endsWith("}}")?c=this._evaluateExpression(c.slice(2,-2),f,e):!s&&!o&&c.startsWith("{")&&c.endsWith("}")&&(l=this._getExtensionCode(c.slice(1,-1),!0,f,e),c=l.instance.extension(i,(n.type===2?"class:":"")+r,f,t(h||{},l.properties))),c};Sys.Application._tryName=function(n,t){var r=t.prototype,i="set_"+n,f=r[i],u;return f?{name:n,setterName:i,setter:f,type:1}:n.startsWith("on")&&(i="add_"+n.substr(2),u=r[i],u)?{name:n,setterName:i,setter:u,type:2}:typeof r[n]!="undefined"?{name:n}:null};Sys.Application._translateName=function(n,t){var i,r,u;if(n&&n!==n.toLowerCase())throw Error.invalidOperation(String.format(Sys.UI.TemplatesRes.invalidAttributeName,n));if(r=Sys.Application._prototypeIndex[t.__typeName],r){if(i=r[n],i)return i}else r={};return t.resolveInheritance(),i=Sys.Application._tryName(n,t),i||(u=Sys.Application._mapToPrototype(n,t),u&&u!==n&&(i=Sys.Application._tryName(u,t)),i||(i={name:n})),r[n]=i,i};Sys.Application._mapToPrototype=function(n,t){var u,r,i;if(!t)throw new Error('type is undefined (name="'+n+'").');if(!t.__typeName)throw new Error('"'+t+'" is not a valid type (name="'+n+'").');if(r=Sys.Application._caseIndex[t.__typeName],!r){r={};t.resolveInheritance();for(i in t.prototype)i.startsWith("get_")||i.startsWith("set_")||i.startsWith("add_")?i=i.substr(4):i.startsWith("remove_")&&(i=i.substr(7)),r[i.toLowerCase()]=i;Sys.Application._caseIndex[t.__typeName]=r}return n=n.toLowerCase(),n.startsWith("on")?(u=r[n.substr(2)],u=u?"on"+u:r[n]):u=r[n],u};Sys.Application._doEval=function(__expression,n){with(n.dataItem||{})return eval("("+__expression+")")};Sys.Application._evaluateExpression=function(n,t,i){var r=new Function("$context","$element","$dataItem","$index","$id","return "+n+";");return r(t,i,t.dataItem,t.index,function(n){return t.getInstanceId(n)})};Sys.Application._registerComponent=function(n,t){var i=n._components;i||(n._components=i=[]);i[i.length]=t};Sys.Application._activateOnPartial=function(n,t){this._doUpdatePanel(n,t);Sys.activateDom&&Sys.Application.activateElement(n)};Sys.Application._raiseInit=function(){if(this.beginCreateComponents(),Sys.Observer.raiseEvent(this,"init"),Sys.activateDom&&Sys.Application.activateElement(document.documentElement),Sys.WebForms&&Sys.WebForms.PageRequestManager){var n=Sys.WebForms.PageRequestManager.getInstance();n._doUpdatePanel=n._updatePanel;n._updatePanel=Sys.Application._activateOnPartial}this.endCreateComponents()};Sys.BindingMode=function(){};Sys.BindingMode.prototype={auto:0,oneTime:1,oneWay:2,twoWay:3,oneWayToSource:4};Sys.BindingMode.registerEnum("Sys.BindingMode");Sys.Binding=function(){Sys.Binding.initializeBase(this);this._sourceHandlers=[];this._targetHandlers=[];this._onSourceChanged=Function.createDelegate(this,this._sourceChanged);this._onTargetChanged=Function.createDelegate(this,this._targetChanged);this._onOptionsUpdated=Function.createDelegate(this,this._optionsUpdated);this._onDispose=Function.createDelegate(this,this.dispose)};Sys.Binding.prototype={_defaultValue:null,get_convert:oi,set_convert:si,get_convertBack:hi,set_convertBack:ci,get_ignoreErrors:li,set_ignoreErrors:ai,get_mode:vi,set_mode:yi,get_defaultValue:pi,set_defaultValue:wi,get_source:bi,set_source:ki,get_templateContext:di,set_templateContext:gi,get_path:nr,set_path:tr,get_target:ir,set_target:rr,get_targetProperty:ur,set_targetProperty:fr,_addBinding:er,dispose:or,_getPropertyFromIndex:sr,_getPropertyData:hr,_watchObject:cr,_isInput:lr,_listen:ar,_forget:vr,_resolveFunction:yr,update:wr,link:pr,_notSet:br,initialize:kr,_doInitialize:dr,_isChecked:gr,_optionsUpdated:nu,_sourceChanged:tu,_targetChanged:iu,_resolveReference:ru};Sys.Binding._disposeBindings=function(){var t=this.__msajaxbindings,n,i;if(t)for(n=0,i=t.length;n<i;n++)t[n].dispose();this.__msajaxbindings=null};Sys.Binding.registerClass("Sys.Binding",Sys.Component,Sys.UI.ITemplateContextConsumer);Sys.converters=Sys.converters||{};Sys.Binding.bind=function(n,i,r,u,f){var e,o;return f=arguments.length>1?t({target:n,targetProperty:i,source:r,path:u,templateContext:Sys._isInstanceOfType(Sys.UI.TemplateContext,this)?this:null},f):n,e=f.mode,typeof e=="string"&&(f.mode=Sys.BindingMode.parse(e)),e=f.ignoreErrors,typeof e=="string"&&(f.ignoreErrors=Boolean.parse(e)),o=new Sys.Binding,h(f,function(n,t){typeof n!="undefined"&&Sys.Observer.setValue(o,t,n)}),o.initialize(),o};Sys.registerPlugin({name:"bind",plugin:Sys.Binding.bind});Sys.Application.registerMarkupExtension("binding",function(n,i,r,u){var f=t({source:r.dataItem,templateContext:r,target:n,targetProperty:i},u),e;f.path=f.path||f.$default;delete f.$default;e=Sys.Binding.bind(f);r.components.push(e)},!1);Sys.UI.DataView=function(n){Sys.UI.DataView.initializeBase(this,[n])};Sys.UI.DataView.config={useOptimalUpdates:!1};Sys.UI.DataView.prototype={_autoFetch:!1,_fetching:!1,_changed:!1,_data:null,_dataProvider:null,_wsp:null,_wspClass:null,_dirty:!1,_stale:!0,_dvTemplate:null,_eventType:0,_httpVerb:null,_initialSelectedIndex:-1,_fetchParameters:null,_parentContext:null,_placeholder:null,_query:null,_contexts:null,_selectedIndex:-1,_selectedItemClass:null,_template:null,_timeout:0,_request:null,add_command:uu,remove_command:fu,add_rendering:eu,remove_rendering:ou,add_rendered:su,remove_rendered:hu,add_itemRendered:cu,remove_itemRendered:lu,add_itemRendering:au,remove_itemRendering:vu,add_fetchFailed:yu,remove_fetchFailed:pu,add_fetchSucceeded:wu,remove_fetchSucceeded:bu,get_viewData:ku,get_data:du,set_data:gu,get_dataProvider:nf,set_dataProvider:tf,get_autoFetch:rf,set_autoFetch:uf,get_isFetching:ff,get_httpVerb:ef,set_httpVerb:of,get_contexts:sf,get_fetchParameters:hf,set_fetchParameters:cf,get_selectedData:lf,get_selectedIndex:af,set_selectedIndex:vf,get_initialSelectedIndex:yf,set_initialSelectedIndex:pf,get_selectedItemClass:wf,set_selectedItemClass:bf,get_timeout:kf,set_timeout:df,get_fetchOperation:gf,set_fetchOperation:ne,get_itemPlaceholder:te,set_itemPlaceholder:ie,get_templateContext:re,set_templateContext:ue,get_itemTemplate:fe,set_itemTemplate:ee,get_useOptimalUpdates:he,set_useOptimalUpdates:ce,_applySelectedIndex:oe,_addRemoveCssClass:se,_collectionChanged:le,_elementContains:ae,_raiseChanged:ve,_raiseFailed:ye,_raiseSelectedData:pe,_raiseSucceeded:we,_ensureTemplate:be,_setTemplate:ke,_getTemplate:de,_loadData:ge,_resetSelectedIndex:no,_initializeResults:to,_isActive:io,_raiseCommand:ro,_raiseItem:uo,abortFetch:fo,onBubbleEvent:eo,onRendering:oo,onFetchFailed:so,onFetchSucceeded:ho,_doAutoFetch:co,_findContextIndex:lo,findContext:ao,_clearContainer:vo,_clearContainers:yo,_isAlone:po,_generatesContext:wo,refresh:bo,_swapData:ko,_validateIndexInput:go,dispose:ns,initialize:ts,fetchData:is,onCommand:rs,onItemRendering:us,onItemRendered:fs,updated:es,link:os};Sys.UI.DataView.registerClass("Sys.UI.DataView",Sys.UI.Control,Sys.UI.ITemplateContextConsumer,Sys.UI.IContentTemplateConsumer);Sys.registerComponent(Sys.UI.DataView);Sys.UI.DataView._fetchWSP=function(n,t,i,r,u,f,e,o,s){if(!t)throw Error.invalidOperation(Sys.UI.TemplatesRes.requiredUri);return Sys.Net.WebServiceProxy.invoke(t,i,u==="GET",r,f,e,s,o)};Sys.UI.DataViewItemEventArgs=function(n,t){Sys.UI.DataViewItemEventArgs.initializeBase(this);this._ctx=t;this._data=n||null};Sys.UI.DataViewItemEventArgs.prototype={get_dataItem:ss,get_itemContext:hs,get_itemPlaceholder:cs,set_itemPlaceholder:ls,get_itemTemplate:as,set_itemTemplate:vs};Sys.UI.DataViewItemEventArgs.registerClass("Sys.UI.DataViewItemEventArgs",Sys.EventArgs)}n.Sys&&Sys.loader?Sys.loader.registerScript("Templates",null,t):t()}();Type.registerNamespace("Sys.UI");Sys.UI.TemplatesRes={commonNotAfterInit:"{0} '{1}' cannot be set after initialize.",unresolvedReference:'Sys.Binding could not find an element or component with the selector "{0}".',stringOrBoolean:'Value must be the string "true", "false", or a Boolean.',elementNotFound:"An element with id '{0}' could not be found.",updateBeforeInit:"Update cannot be called before initialize.",invalidAttributeName:"Invalid attribute name '{0}'. Declared attribute names must be in lowercase.",invalidFunctionName:"'{0}' must be of type Function or the name of a function as a String.",invalidDataProviderType:"Value must be a service URI, an instance of Sys.Net.WebServiceProxy, or class that implements Sys.Data.IDataProvider.",requiredUri:"A serviceUri must be set prior to calling fetchData.",invalidAttach:"Invalid attribute '{0}', the type '{1}' is not a registered namespace.",cannotActivate:"Could not activate element with id '{0}', the element could not be found.",misplacedTemplate:"DataView item template must not be a child element of the DataView.",templateAlreadyDefined:"DataView template is already defined.",functionNotFound:"A function with the name '{0}' could not be found.",bindingPropertyNotSet:"Binding '{0}' must be set prior to initialize.",invalidSelectedIndexValue:"Value must be a Number or a String that can be converted to a Number.",mustSetInputElementsExplicitly:"Input elements 'type' and 'name' attributes must be explicitly set.",invalidTypeNamespace:"Invalid type namespace declaration, '{0}' is not a valid type.",cannotFindMarkupExtension:"A markup extension with the name '{0}' could not be found.",invalidSysContentTemplate:"The sys:content-template attribute must be used on or within an control that implements Sys.UI.IContentTemplateConsumer."};n.Cognito=n.Cognito||{},function(n,t){t||console.error("jQuery not loaded. Cognito depends on jQuery 1.7+");n.ExoJQuery=t.noConflict(!0)}(n,jQuery);n.ExoWeb={};n.ExoWeb.Model={};n.ExoWeb.Mapper={};n.ExoWeb.UI={};n.ExoWeb.View={};n.ExoWeb.DotNet={},function(r){function h(n,t,i){if(arguments.length!==3)throw new vt(3,arguments.length);if(n==null)throw new l("argumentName");if(typeof n!="string")throw new h("argumentName","string",n);if(t==null)throw new l("expectedType");if(typeof t!="string")throw new h("expectedType","string",t);this.name="ArgumentTypeError";this.argumentName=n;this.expectedType=t;this.actualValue=i;this.message="Argument '"+n+"' must be of type "+t+": "+i+"."}function vt(n,t){if(arguments.length!==2)throw new vt(2,arguments.length);if(n==null)throw new l("expected");if(t==null)throw new l("actual");if(typeof n!="number")throw new h("expected","number",n);if(typeof t!="number")throw new h("actual","number",t);this.name="ArgumentsLengthError";this.expected=n;this.actual=t;this.message="The number of arguments is not correct, expected "+n+", actual "+t+"."}function l(n,t){if(arguments.length<1&&arguments.length>2)throw new vt(2,arguments.length);if(n==null)throw new l("argumentName");if(typeof n!="string")throw new h("argumentName","string",n);if(t!=null&&typeof t!="string")throw new h("reason","string",t);this.name="ArgumentNullError";this.argumentName=n;this.reason=t;this.message="Argument '"+n+"' cannot be null or undefined"+(t?": "+t+".":".")}function tr(n,t){if(arguments.length!==2)throw new vt(2,arguments.length);if(n==null)throw new l("argumentName");if(typeof n!="string")throw new h("argumentName","string",n);if(t==null)throw new l("reason");if(typeof t!="string")throw new h("reason","string",t);this.name="ArgumentError";this.argumentName=n;this.reason=t;this.message="Argument '"+n+"' has an invalid value"+(t?": "+t+".":".")}function fv(n){if(arguments.length!==1)throw new vt(1,arguments.length);if(n==null)throw new l("fn");if(typeof n!="function")throw new h("fn","function",n);kf=n}function ev(n){if(n==null)throw new l("fn");if(typeof n!="function")throw new h("fn","function",n);pu.push(n)}function ov(n){if(n==null)throw new l("fn");if(typeof n!="function")throw new h("fn","function",n);var t=pu.indexOf(n);if(t<0)throw new tr("fn","The given function was not found in the list of error handlers.");pu.splice(t,1)}function df(t,i,u,f,e,o,s,h,c){var l=!1,a=r.extend({message:t,type:"Error",url:n.location.href,refererUrl:document.referrer,stackTrace:e?e.stack:"",additionalInfo:{url:i,lineNumber:u,columnNumber:f}},o);s&&pu.forEach(function(n){if(!l){var r=n(t,i,u,f,e,a);r===!0&&(l=!0)}});!l&&kf&&kf(a,h,c)}function sv(n,t,i,r,u){if(n==null)throw new l("message");if(arguments.length>9)throw new vt(9,arguments.length);var f=Array.prototype.slice.call(arguments),e=null,s=null,o=null,c=!1,a=null;if(po(f[f.length-1])&&(e=f.pop(),po(f[f.length-1])&&(s=e,e=f.pop())),dh(f[f.length-1])&&(c=f.pop()),f.length>1&&f[f.length-1]instanceof Object&&!(f[f.length-1]instanceof Error)&&(a=f.pop()),f.length===1)n instanceof Error?(o=n,df(o.message,o.fileName,o.lineNumber,o.columnNumber,n,a,c,e,s)):df(n.toString(),"?","-1","-1",null,a,c,e,s);else if(f.length>=3){if(!(n.constructor===String))throw new h("message","string",n);if(t.constructor!==String)throw new h("url","string",t);if(i!=null&&typeof i!="number")throw new h("lineNumber","number",i);df(n,t,i,typeof r=="number"?r:-1,u instanceof Error?u:null,a,c,e,s)}else throw new vt(3,arguments.length);}function hv(n){if(arguments.length!==1)throw new vt(1,arguments.length);if(n==null)throw new l("fn");if(typeof n!="function")throw new h("fn","function",n);gf=n}function c(n){gf&&gf(n)}function oi(n){return n===undefined?"undefined":n===null?"null":Object.prototype.toString.call(n).match(ph)[1].toLowerCase()}function wu(n){return n===null||n===undefined}function yo(n){return oi(n)==="array"}function ir(n){return oi(n)==="string"}function ne(n){return oi(n)==="number"}function rr(n){return ne(n)&&!isNaN(n)&&wh.test(n.toString())&&n>=-2147483648&&n<=2147483647}function bh(n){return rr(n)&&n>0}function cv(n){return rr(n)&&n>=0}function lv(n){return ne(n)&&!isNaN(n)&&kh.test(n.toString())}function po(n){return oi(n)==="function"}function dh(n){return oi(n)==="boolean"}function av(n){return oi(n)==="date"}function gh(n){return oi(n)==="object"||n&&n instanceof Object}function nc(n,t){var i;if(arguments.length===0)n=0,t=9;else if(arguments.length===1){if(!rr(n))throw new Error("Minimum argument must be an integer.");n<0?t=0:(t=n,n=0)}else if(rr(n))if(rr(t)){if(n>=t)throw new Error("Minimum argument must be less than maximum argument.");}else throw new Error("Maximum argument must be an integer.");else throw new Error("Minimum argument must be an integer.");return i=Math.random(),i===1?t:Math.floor(i*(t-n+1))+n}function wo(n,t){var i,r;if(arguments.length===0)throw new Error("Length argument is required.");else if(!bh(n))throw new Error("Length argument must be a natural number.");for(i="",r=0;r<n;r++){var e=t?35:25,u=nc(0,e),f;f=u<=25?u+97:u- -22;i+=String.fromCharCode(f)}return i}function ic(n,t,i){i instanceof Function?n[t]=i:i instanceof Object?Object.defineProperty(n,t,i):n[t]=i}function vv(n){var i=[].slice,f=i.call(arguments,1),r=this,t=function(){},u=function(){return r.apply(this instanceof t?this:n||{},f.concat(i.call(arguments)))};return t.prototype=r.prototype,u.prototype=new t,u}function rc(n,t,i){if(n||t)return t?n?i&&i.async===!0?function(){var f=i.callbackIndex||0,r=arguments[f],u,e,o;if(r==null)throw new l("callback","'mergeFunctions' was called in async mode");if(typeof r!="function")throw new h("callback","function",r);u=new et("mergeFunctions");e=Array.prototype.slice.call(arguments);e.splice(f,1,u.pending());n.apply(this,e);o=Array.prototype.slice.call(arguments);o.splice(f,1,u.pending());t.apply(this,o);u.waitForAll(r,i.thisPtrIndex&&arguments[i.thisPtrIndex]||this)}:i&&i.andResults===!0?function(){return n.apply(this,arguments)&&t.apply(this,arguments)}:i&&i.orResults===!0?function(){return n.apply(this,arguments)||t.apply(this,arguments)}:function(){n.apply(this,arguments);t.apply(this,arguments)}:t:n}function vi(n){return function(t){return n===t}}function yv(n){return function(){return!n.apply(this,arguments)}}function pv(n){n.call()}function ii(n){var t=uc.exec(n);return t?t[1]||"{anonymous}":"{anonymous}"}function fc(n,t){Array.prototype.push.apply(n,t)}function wv(n,t,i){return n.indexOf(t,i)>=0}function bo(n){return Array.prototype.slice.call(n)}function ec(n){for(var i=[],t=0,r=n.length;t<r;t++)i.indexOf(n[t])<0&&i.push(n[t]);return i}function bv(n,t,i){for(var r=0,u=n.length;r<u;r++)if(r in n&&!t.call(i||this,n[r],r,n))return!1;return!0}function kv(n,t,i){for(var r=0;r<i;r++)n.push(t);return n}function ur(n,t,i){for(var u,f=[],r=0,e=n.length;r<e;r++)r in n&&(u=n[r],t.call(i||this,u,r,n)&&f.push(u));return f}function oc(n,t,i){for(var u,r=0,f=n.length;r<f;r++)if(r in n&&(u=n[r],!t||t.call(i||this,u,r,n)===!0))return u;return null}function kr(n,t,i){for(var r=0,u=n.length;r<u;r++)r in n&&t.call(i||this,n[r],r,n)}function dv(n,t,i){var r=n.length;for(i=Number(i)||0,i=i<0?Math.ceil(i):Math.floor(i),i<0&&(i+=r);i<r;i++)if(i in n&&n[i]===t)return i;return-1}function gv(n,t,i){var r=i.slice();r.splice(0,0,t,0);Array.prototype.splice.apply(n,r)}function sc(n,t){return ec(ur(n,function(n){return t.indexOf(n)>=0}))}function ny(n,t,i){for(var u,f=null,r=0,e=n.length;r<e;r++)r in n&&(u=n[r],t&&t.call(i||this,u,r,n)!==!0||(f=u));return f}function ty(n,t,i){var f=n.length,r,u;if(f===0)return-1;for(r=f,i&&(r=Number(i),r!==r?r=0:r!==0&&r!==1/0&&r!==-(1/0)&&(r=(r>0||-1)*Math.floor(Math.abs(r)))),u=r>=0?Math.min(r,f-1):f-Math.abs(r);u>=0;)if(u in n&&n[u]===t)return u;return-1}function hc(n,t,i){for(var u=[],r=0,f=n.length;r<f;r++)r in n&&(u[r]=t.call(i||this,n[r],r,n));return u}function iy(n,t,i){var r=[];return kr(n,function(n,u,f){fc(r,t.call(i||this,n,u,f))}),r}function cc(n,t,i,r,u){var f;r&&(f=r>1&&n.removeRange?n.removeRange(i,r):r===1&&n.removeAt?[n.removeAt(i)]:n.splice(i,r),t&&t.push({action:Sys.NotifyCollectionChangedAction.remove,oldStartingIndex:i,oldItems:f,newStartingIndex:null,newItems:null}));u.length>0&&(u.length>1&&n.insertRange?n.insertRange(i,u):u.length===1&&n.insert?n.insert(i,u[0]):gv(n,i,u),t&&t.push({action:Sys.NotifyCollectionChangedAction.add,oldStartingIndex:null,oldItems:null,newStartingIndex:i,newItems:u}))}function ry(n){var t=n.pop();return n.push(t),t}function dr(n,t,i){for(var u=null,r=0;r<n.length;r++)t.call(i||this,n[r],r,n)===!0&&(n.removeAt?n.removeAt(r):n.splice(r,1),u===null&&(u=[]),u.push(r+u.length),r--);return u}function uy(n,t){var i=0,u=n.length,r;if(typeof t!="function")throw new TypeError("First argument is not a function.");if(!u&&arguments.length<=2)throw new TypeError("Array length is 0 and no intial value was given.");if(arguments.length<=2){if(u===0)throw new TypeError("Empty array and no second argument");r=n[i++]}else r=arguments[2];for(;i<u;i++)i in n&&(r=t.call(undefined,r,n[i],i,n));return r}function fy(n,t){var i=n.indexOf(t);return i<0?!1:(n.splice(i,1),!0)}function ey(n,t,i){var r;if(r=t!==undefined?ur(n,t,i):n,r.length>1)throw new Error("Expected a single item, but found "+r.length+".");if(r.length===0)throw new Error("Expected a single item, but did not find a match.");return r[0]}function oy(n,t,i){for(var r=0,u=n.length;r<u;r++)if(r in n&&t.call(i||this,n[r],r,n))return!0;return!1}function fr(n,t){for(var f=n,o=arguments[2],e=o?[]:null,i=0,u=0,r=0,s=arguments[3];u<f.length;)f[u]===t[r]?i===u&&i===r?i=u=r=i+1:(cc(f,e,i,u-i,t.slice(i,r)),i=u=r=r+1):r>=t.length?(r=i,u+=1):r+=1;return cc(f,e,i,u-i,t.slice(i,Math.max(r,t.length))),e}function sy(n){return n===null||n===undefined||n===""}function er(n,t,i){if(n==null)throw new l("label");if(typeof n!="string")throw new h("label","string",n);if(t==null)throw new l("callback");if(typeof t!="function")throw new h("callback","function",t);var r={label:n,callback:t};i&&(t.thisPtr=i);re.push(r)}function cy(){var n=!1,t=arguments[0];return yc(function(i){return n=!0,t?(console.log('Item "'+i.label+'" is busy.'),!1):!0}),n}function yc(n){for(var t,i=[],r=0,u=re.length;r<u;r++)if(t=re[r],t.callback.call(t.thisPtr||this)===!0&&(i.push(t),n&&n(t)===!0))return i;return i}function s(n){this._index=ly++;this._labels=[n];this._rootLabel=n;this._subscribers=[];pc.push(this)}function et(n){this._waitForAll=[];this._pending=0;this._debugLabel=n}function ay(n,t,i,r,u){if(u===!1||bf.signalTimeout===!0&&u!==!0){var e=s.suspendCurrent("_doCallback"),f=!1;yi===null&&(yi=[],f=!0);yi.push(function(){s.resume(e);i.apply(t,r||[])});f&&go()}else i.apply(t,r||[])}function nt(){var t=[],n=function(){for(var n,i=0;i<t.length;++i)(n=t[i],n.applied!==!0)&&(n.filter&&n.filter.apply(this,arguments)!==!0||(n.once===!0&&(n.applied=!0),n.fn.apply(this,arguments)))};return n._funcs=t,n.add=vy,n.remove=yy,n.isEmpty=wy,n.clear=py,n}function vy(n,t,i){var r={fn:n};return t!==undefined&&(r.filter=t),i!==undefined&&(r.once=i),this._funcs.push(r),n}function yy(n){for(var t=this._funcs.length-1;t>=0;--t)if(this._funcs[t].fn===n)return this._funcs.splice(t,1),!0;return!1}function py(){this._funcs.length=0}function wy(n){return!this._funcs.some(function(t){return t.applied!==!0&&(!n||!t.filter||t.filter.apply(this,n))},this)}function gr(n,t){if(!(n instanceof Array))throw new h("steps","array",n);this._steps=n;this._thisPtr=t}function wc(n,t,i){var r=t,u=i,f=n+1<this._steps.length?wc.prependArguments(n+1,r,u).bind(this):function(){r&&r instanceof Function&&r.apply(u||this,arguments)};this._steps[n].call(this._thisPtr||this,f)}function fe(){var n=b;Object.defineProperty(this,"parent",{value:n});this.isActive=!0;b=this}function nu(n,t){if(b===null)t?n.call(t):n();else if(b.isActive)b._addEvent("exit",n.bind(t));else throw new Error("The current event scope cannot be inactive.");}function ns(n,t){if(b!==null){if(!b.isActive)throw new Error("The current event scope cannot be inactive.");b._addEvent("abort",n.bind(t))}}function ee(n,t){var i=new fe;try{t?n.call(t):n()}finally{i.exit()}}function ts(n){this.value=n}function or(n,t){if(n==null)throw new l("array","transform input is required");if(!(n instanceof Array))throw new h("array","array",n);this._array=n;this.rootInput=n;t===!0&&(this._livePending=!0,this._liveComplete=!1)}function is(n,t){this.group=n;this.items=t}function dy(n,t,i){var r=$transform(t,i);return n.forEach(function(n){r=r[n._transform.method].call(r,n._transform.arg,n._transform.thisPtr)}),r}function ku(n,t,i,r,u){if(t._liveComplete===!0)throw new Error("Cannot call live on the same transform multiple times.");var f;return t._livePending===!0?f=new or(n,!0):(Function.mixin(or.prototype,n),f=n),f._prior=t,f.rootInput=t.rootInput,f._transform={method:i,arg:r,thisPtr:u},f}function us(){this._forwardDictionary={};this._reverseDictionary={}}function gc(){Object.defineProperty=function(n,t,i){if("get"in i){if(!i.init)throw new Error("Getters are not supported by the current browser. Use definePropertySupported to check for full support.");if(n.prototype)n[t]=i.get.call(n,n);else if(n.constructor){var r=n.constructor.__initProperties;r||(n.constructor.__initProperties=r={});r[t]=i.get}}else n[t]=i.value;if("set"in i)throw new Error("Setters are not supported by the current browser. Use definePropertySupported to check for full support.");}}function gy(n){var t,i;if(!oe&&(t=n.constructor.__initProperties,t))for(i in t)n[i]=t[i].call(n,n)}function sr(n,t,i,r){var f,e,o=t.split("."),s,u=n;if(u===null)return arguments.length>=3?i:null;if(u===undefined)return arguments.length>=4?r:undefined;for(f=0;f<o.length;++f){if(e=o[f],s=u,u=ri(s,e),u===null)return arguments.length>=3?i:null;if(u===undefined)return arguments.length>=4?r:undefined}return u}function nl(n,t){var i,r,u=n;if(t==null)throw new l("propertyPath");if(t.constructor==String)r=t.split(".");else{if(!(t instanceof Array))throw h("propertyPath","string|array",t);r=t}for(i=0;i<r.length-1;i++)u&&(u=ri(u,r[i]));return u}function ri(n,t){var i,r=n["get_"+t];return r?(i=r.call(n),i===undefined&&(i=null)):gh(n)&&t in n||Object.prototype.hasOwnProperty.call(n,t)||n.constructor===String&&/^[0-9]+$/.test(t)&&parseInt(t,10)<n.length?(i=n[t],i===undefined&&(i=null)):/\./.test(t)&&c('Possible incorrect usage of "getValue()", the path "'+t+'" does not exist on the target and appears to represent a multi-hop path.'),i}function tl(t){if(t!==undefined&&t!==null){if(lt(t,Function))return t;var i;if(lt(t,String)&&(t=t.replace(/(window\.)?(.*)/,"$2"),i=sr(n,t)),i===undefined||i===null||lt(i,Function))return i;c('The given type "'+t+'" is not a function.')}}function lt(n,t){if(n!==undefined&&n!==null&&n===Function&&t!==undefined&&t!==null&&t===Function)return!0;var i=tl(t);return n!==undefined&&n!==null&&i!==undefined&&i!==null&&(n instanceof i||n.constructor===i)}function hr(n,t,i){for(var r in n)if(n.hasOwnProperty(r)&&t.apply(i||this,[r,n[r]])===!1)break}function np(n){var t=[];return hr(n,function(n,i){t.push(i)}),t}function f(n,t){var i;return arguments.length<2?n:(i=arguments.length>2?Array.prototype.slice.call(arguments,1):(t instanceof Array)?t:[t],n.replace(/\{([0-9]+)\}/ig,function(n,t){var u=parseInt(t,10),r=i[u];return r!==null&&r!==undefined&&r.constructor!==String&&(r=r.toString()),r}))}function il(n){return n.replace(/([^A-Z]+)([A-Z])/g,"$1 $2")}function ui(n){this.totalMilliseconds=n;gy(this)}function ul(n){return n!==undefined&&n!==null&&n.constructor===String?n=he.indexOf(n.toLowerCase()):n!==undefined&&n!==null&&n.constructor!==Number&&(n=null),n>=0&&n<he.length?n:null}function tp(n){var t,i;for(t in fl){if(i=n[t],!(i instanceof Function))throw new Error("Observable provider does not implement '"+t+"'.");e[t]=i}}function ce(n){this._source=null;this._prop=n;this._handler=null}function fi(n){if(!n.hasOwnProperty("specifier")||!ir(n.specifier))throw new Error("Format specifier string must be provided.");this._specifier=n.specifier;this._paths=n.paths;this._convert=n.convert;this._convertBack=n.convertBack;this._compile=n.compile;this._description=n.description;this._nullString=n.nullString||"";this._undefinedString=n.undefinedString||"";this._formatEval=n.formatEval}function a(){this._types={};this._ruleQueue=[]}function le(n,t,i){return!n||u.isLoaded(n)?i():(t?u.load(n,null,!1,i):$extend(n._fullName,i),null)}function v(){}function ol(n,t,i){for(var r in n)t.call(i||this,r,n[r])}function sl(){if(arguments.length===2){var n={};return n[arguments[0]]=arguments[1],n}return arguments[0]}function bt(t,i,r,u){var e,l;this._fullName=i;this._origin=u||"client";this._originForNewProperties=this._origin;this._pool={};this._legacyPool={};this._counter=0;this._properties={};this._instanceProperties={};this._staticProperties={};this._pendingInit=[];this._pendingInvocation=[];Object.defineProperty(this,"model",{value:t});Object.defineProperty(this,"rules",{value:[]});for(var f=a.getJsType(i,!0),c=i.split("."),h=c.dequeue(),o=a.types,s=n;c.length>0;)o=t._ensureNamespace(h,o),s=t._ensureNamespace(h,s),h=c.dequeue();e=h;f=ip(this);this._jstype=f;o[e]?o["$"+e]=f:o[e]=f;s[e]?s["$"+e]=f:s[e]=f;this.derivedTypes=[];r?(l=r._jstype,this.baseType=r,r.derivedTypes.push(this),hl(f,r)):(l=v,this.baseType=null);ae=!0;this._jstype.prototype=new l;ae=!1;this._jstype.prototype.constructor=this._jstype;f.meta=this;this.type=this}function hl(n,t){for(var i in t._properties)n["$"+i]=t._properties[i];t.baseType&&hl(n,t.baseType)}function ip(n){function t(t,i,r){var e,f,u,o;if(!ae)if(t&&t.constructor===String){if(e=t,f=n.get(e,!0,!0),f)return i&&f.init(i),f;n.register(this,e,r);i&&this.init(i)}else for(n.register(this,null,r),t&&this.set(t),u=n;u;u=u.baseType)o=u._getEventHandler("initNew"),o&&o(this,{})}return t}function k(n,t,i,r,u,e,o,s,h,l,a,v){this._containingType=n;this._name=t;this._fieldName="_"+t;this._jstype=i;this._label=r||il(t);this._helptext=u;this._format=e;this._isList=o===!0;this._isStatic=s===!0;this._isPersisted=h===!0;this._isCalculated=l===!0;this._index=a;this._defaultValue=v!==undefined?v:o?[]:i===Boolean?!1:i===Number?0:null;this._rules=[];n.get_originForNewProperties()&&(this._origin=n.get_originForNewProperties());this._origin==="client"&&this._isPersisted&&c(f("Client-origin properties should not be marked as persisted: Type = {0}, Name = {1}",n.get_fullName(),t))}function gt(n,t,i){return t.property=n,i&&i.constructor===String?t.message=i:i instanceof p&&(t.conditionType=i),t}function rp(n,t){var i=n._getEventHandler("changed");return i&&!i.isEmpty([t])}function cl(n,t){n._rules.push(t);var i=n._getEventHandler("ruleRegistered");i&&!i.isEmpty()&&i(t,{property:n})}function bi(n,t,i){var r=this._isStatic?this._containingType.get_jstype():n,f=r[this._fieldName],u;if(f===undefined||i===undefined||i)return r[this._fieldName]=t,r.meta.pendingInit(this,!1),t instanceof Array&&(u=this,e.makeObservable(t),e.addCollectionChanged(t,function(n,i){var f=i.get_changes();f&&f.some(function(n){return n.newItems&&n.newItems.length>0||n.oldItems&&n.oldItems.length>0})&&(u._containingType.model.notifyListChanged(r,u,f),u._raiseEvent("changed",[r,{property:u,newValue:t,oldValue:undefined,changes:f,collectionChanged:!0}]),e.raisePropertyChanged(r,u._name))}),t.toString=up.bind(t)),e.raisePropertyChanged(r,this._name),this}function up(){return this.join(", ")}function gu(n){n.hasOwnProperty(this._fieldName)||(this.get_isCalculated()||bi.call(this,n,this.get_defaultValue()),n.meta.pendingInit(this,!0))}function fs(n){if(!u.isRegistered(n)){gu.call(this,n);var t=this._getEventHandler("get");return t&&!t.isEmpty()&&t(n,{property:this,value:n[this._fieldName]}),n[this._fieldName]}}function es(n,t,i,r){var f,e,o;if(u.isRegistered(n))throw new Error("Cannot set "+this.get_name()+"="+(t===undefined?"<undefined>":t)+" for instance "+n.meta.type.get_fullName()+"|"+n.meta.id+": object is ghosted.");if(gu.call(this,n),!this.canSetValue(n,t))throw new Error("Cannot set "+this.get_name()+"="+(t===undefined?"<undefined>":t)+" for instance "+n.meta.type.get_fullName()+"|"+n.meta.id+": a value of type "+(this._jstype&&this._jstype.meta?this._jstype.meta.get_fullName():ii(this._jstype))+" was expected.");f=n[this._fieldName];this.get_isList()?(f.beginUpdate(),fr(f,t),f.endUpdate()):(e=f===undefined||f===null?f:f.valueOf(),o=t===undefined||t===null?t:t.valueOf(),e===o||this._jstype===Number&&isNaN(e)&&isNaN(o)||(n[this._fieldName]=t,n.meta.pendingInit(this,!1),f!==undefined&&this.raiseChanged(n,t,f,r)))}function ot(n){n.substr(0,5)==="this."&&(n=n.substr(5));this.expression=n;n=n.replace(/<[^>]*>/ig,function(n){return n.replace(/\./ig,function(){return"$_$"})});this.steps=n.length>0?n.split(".").map(function(n){var t=n.match(/^([_0-9a-zA-Z\u00aa\u00b5\u00ba\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u02bb-\u02c1\u02d0-\u02d1\u02e0-\u02e4\u02ee\u0370-\u0373\u0376-\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0523\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0621-\u064a\u0660-\u0669\u066e-\u066f\u0671-\u06d3\u06d5\u06e5-\u06e6\u06ee-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07c0-\u07ea\u07f4-\u07f5\u07fa\u0904-\u0939\u093d\u0950\u0958-\u0961\u0966-\u096f\u0971-\u0972\u097b-\u097f\u0985-\u098c\u098f-\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc-\u09dd\u09df-\u09e1\u09e6-\u09f1\u0a05-\u0a0a\u0a0f-\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32-\u0a33\u0a35-\u0a36\u0a38-\u0a39\u0a59-\u0a5c\u0a5e\u0a66-\u0a6f\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2-\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0-\u0ae1\u0ae6-\u0aef\u0b05-\u0b0c\u0b0f-\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32-\u0b33\u0b35-\u0b39\u0b3d\u0b5c-\u0b5d\u0b5f-\u0b61\u0b66-\u0b6f\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99-\u0b9a\u0b9c\u0b9e-\u0b9f\u0ba3-\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0be6-\u0bef\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58-\u0c59\u0c60-\u0c61\u0c66-\u0c6f\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0-\u0ce1\u0ce6-\u0cef\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d28\u0d2a-\u0d39\u0d3d\u0d60-\u0d61\u0d66-\u0d6f\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32-\u0e33\u0e40-\u0e46\u0e50-\u0e59\u0e81-\u0e82\u0e84\u0e87-\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa-\u0eab\u0ead-\u0eb0\u0eb2-\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0ed0-\u0ed9\u0edc-\u0edd\u0f00\u0f20-\u0f29\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8b\u1000-\u102a\u103f-\u1049\u1050-\u1055\u105a-\u105d\u1061\u1065-\u1066\u106e-\u1070\u1075-\u1081\u108e\u1090-\u1099\u10a0-\u10c5\u10d0-\u10fa\u10fc\u1100-\u1159\u115f-\u11a2\u11a8-\u11f9\u1200-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u1676\u1681-\u169a\u16a0-\u16ea\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u17e0-\u17e9\u1810-\u1819\u1820-\u1877\u1880-\u18a8\u18aa\u1900-\u191c\u1946-\u196d\u1970-\u1974\u1980-\u19a9\u19c1-\u19c7\u19d0-\u19d9\u1a00-\u1a16\u1b05-\u1b33\u1b45-\u1b4b\u1b50-\u1b59\u1b83-\u1ba0\u1bae-\u1bb9\u1c00-\u1c23\u1c40-\u1c49\u1c4d-\u1c7d\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u2094\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2183-\u2184\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2c6f\u2c71-\u2c7d\u2c80-\u2ce4\u2d00-\u2d25\u2d30-\u2d65\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3006\u3031-\u3035\u303b-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31b7\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fc3\ua000-\ua48c\ua500-\ua60c\ua610-\ua62b\ua640-\ua65f\ua662-\ua66e\ua680-\ua697\ua722-\ua788\ua78b-\ua78c\ua7fb-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8d0-\ua8d9\ua900-\ua925\ua930-\ua946\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa50-\uaa59\uac00-\ud7a3\uf900-\ufa2d\ufa30-\ufa6a\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff10-\uff19\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]+)(<([_$0-9a-zA-Z\u00aa\u00b5\u00ba\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u02bb-\u02c1\u02d0-\u02d1\u02e0-\u02e4\u02ee\u0370-\u0373\u0376-\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0523\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0621-\u064a\u0660-\u0669\u066e-\u066f\u0671-\u06d3\u06d5\u06e5-\u06e6\u06ee-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07c0-\u07ea\u07f4-\u07f5\u07fa\u0904-\u0939\u093d\u0950\u0958-\u0961\u0966-\u096f\u0971-\u0972\u097b-\u097f\u0985-\u098c\u098f-\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc-\u09dd\u09df-\u09e1\u09e6-\u09f1\u0a05-\u0a0a\u0a0f-\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32-\u0a33\u0a35-\u0a36\u0a38-\u0a39\u0a59-\u0a5c\u0a5e\u0a66-\u0a6f\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2-\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0-\u0ae1\u0ae6-\u0aef\u0b05-\u0b0c\u0b0f-\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32-\u0b33\u0b35-\u0b39\u0b3d\u0b5c-\u0b5d\u0b5f-\u0b61\u0b66-\u0b6f\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99-\u0b9a\u0b9c\u0b9e-\u0b9f\u0ba3-\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0be6-\u0bef\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58-\u0c59\u0c60-\u0c61\u0c66-\u0c6f\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0-\u0ce1\u0ce6-\u0cef\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d28\u0d2a-\u0d39\u0d3d\u0d60-\u0d61\u0d66-\u0d6f\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32-\u0e33\u0e40-\u0e46\u0e50-\u0e59\u0e81-\u0e82\u0e84\u0e87-\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa-\u0eab\u0ead-\u0eb0\u0eb2-\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0ed0-\u0ed9\u0edc-\u0edd\u0f00\u0f20-\u0f29\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8b\u1000-\u102a\u103f-\u1049\u1050-\u1055\u105a-\u105d\u1061\u1065-\u1066\u106e-\u1070\u1075-\u1081\u108e\u1090-\u1099\u10a0-\u10c5\u10d0-\u10fa\u10fc\u1100-\u1159\u115f-\u11a2\u11a8-\u11f9\u1200-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u1676\u1681-\u169a\u16a0-\u16ea\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u17e0-\u17e9\u1810-\u1819\u1820-\u1877\u1880-\u18a8\u18aa\u1900-\u191c\u1946-\u196d\u1970-\u1974\u1980-\u19a9\u19c1-\u19c7\u19d0-\u19d9\u1a00-\u1a16\u1b05-\u1b33\u1b45-\u1b4b\u1b50-\u1b59\u1b83-\u1ba0\u1bae-\u1bb9\u1c00-\u1c23\u1c40-\u1c49\u1c4d-\u1c7d\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u2094\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2183-\u2184\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2c6f\u2c71-\u2c7d\u2c80-\u2ce4\u2d00-\u2d25\u2d30-\u2d65\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3006\u3031-\u3035\u303b-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31b7\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fc3\ua000-\ua48c\ua500-\ua60c\ua610-\ua62b\ua640-\ua65f\ua662-\ua66e\ua680-\ua697\ua722-\ua788\ua78b-\ua78c\ua7fb-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8d0-\ua8d9\ua900-\ua925\ua930-\ua946\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa50-\uaa59\uac00-\ud7a3\uf900-\ufa2d\ufa30-\ufa6a\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff10-\uff19\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc$]+)>)?$/i),i;return t?(i={property:t[1]},t[3]&&(i.cast=t[3].replace(/\$_\$/ig,function(){return"."})),i):null}):[]}function it(n,t,i){function u(n,t,i){this._rootType.known().forEach(function(r){if(this.connects(r,t,n)){var u=Object.copy(i);u.originalSender=t;u.triggeredBy=u.property;u.property=this;this._raiseEvent("changed",[r,u])}},this)}var r=null;this._updatePropertyChangeSubscriptions=function(){var n=this._getEventHandler("changed"),t=n&&!n.isEmpty(),i=r!==null;!t&&i?(this._properties.forEach(function(n,t){var i=r[t];n.removeChanged(i)},this),r=null):t&&!i&&(r=[],this._properties.forEach(function(n,t){var f=t===0?undefined:this._properties[t-1],i=u.bind(this).prependArguments(f);r.push(i);n.addChanged(i)},this))};this._rootType=n;this._properties=t;this._filters=i}function ye(n,t){this._obj=t;this.type=n;this._conditions={};this._pendingInit={};this._pendingInvocation=[]}function y(n,t){if(arguments.length!==0){if(!(n instanceof ExoWeb.Model.Type))if(n&&n.meta)n=n.meta;else throw new Error("A value root model type must be specified when constructing rules.");t?t instanceof Function?this._options={name:n.get_fullName()+".Custom."+ ++pe,execute:function(n){return t.apply(n,arguments)}}:(this._options=t,this._options.name||(this._options.name=n.get_fullName()+".Custom."+ ++pe)):this._options={name:n.get_fullName()+".Custom."+ ++pe};this._options.execute instanceof Function&&(this.execute=this._options.execute);Object.defineProperty(this,"rootType",{value:n});Object.defineProperty(this,"name",{value:this._options.name});Object.defineProperty(this,"invocationTypes",{value:0,writable:!0});Object.defineProperty(this,"predicates",{value:[],writable:!0});Object.defineProperty(this,"returnValues",{value:[],writable:!0});n.model.registerRule(this)}}function ll(n){this.property=n}function si(n,t){var r,i;arguments.length!==0&&(r=t.assert||t.fn,r&&(this.assert=r),t.hasOwnProperty("onInitNew")||(t.onInitNew=!0),i=t.conditionType,ir(i)&&(i=p.get(i)),Object.defineProperty(this,"conditionType",{value:i||y.ensureConditionType(t.name,n,t.category||p.Error,t.sets)}),t.hasOwnProperty("onInitExisting")||this.conditionType.origin==="server"||(t.onInitExisting=!0),t.message&&Object.defineProperty(this,"message",{value:t.message,writable:!0}),t.properties&&Object.defineProperty(this,"properties",{value:t.properties,writable:!0}),y.apply(this,[n,t]))}function w(n,t){if(arguments.length!=0){t.name=t.name||"ValidatedProperty";var i=t.property instanceof k?t.property:n.property(t.property);Object.defineProperty(this,"property",{value:i});t.isValid instanceof Function&&(this.isValid=t.isValid);t.properties?t.properties.indexOf(i.get_name())<0&&t.properties.indexOf(i)<0&&t.properties.push(i.get_name()):t.properties=[i.get_name()];t.onChangeOf?t.onChangeOf.indexOf(i.get_name())<0&&t.onChangeOf.indexOf(i)<0&&t.onChangeOf.push(i):t.onChangeOf=[i];t.conditionType=t.conditionType||y.ensureConditionType(t.name,this.property,t.category||p.Error);t.message&&typeof t.message!="function"&&(t.message=t.message.replace("{property}",i.get_label()));si.apply(this,[n,t])}}function cr(n,t){var i=t.property instanceof k?t.property:n.property(t.property);Object.defineProperty(this,"property",{value:i});t.name=t.name||n.get_fullName()+"."+i.get_name()+".Calculated";Object.defineProperty(this,"calculate",{value:t.calculate||t.fn,writable:!0});Object.defineProperty(this,"defaultIfError",{value:t.hasOwnProperty("defaultIfError")?t.defaultIfError:ExoWeb.config.calculationErrorDefault});t.returns=[i];y.apply(this,[n,t])}function ni(n,t){t.name=t.name||"Required";t.message=t.message||o.get("required");t.requiredValue&&Object.defineProperty(this,"requiredValue",{value:t.requiredValue});w.apply(this,[n,t])}function tu(n,t){t.name=t.name||"Validation";t.message=o.get(t.message)?'"'+o.get(t.message)+'"':t.message||o.get("validation");var i=t.property instanceof k?t.property:n.property(t.property);t.message=t.message.replace("{property}",i.get_label().replace(/\"/g,'\\"'));(t.isError||t.fn)&&Object.defineProperty(this,"isError",{value:t.isError||t.fn,writable:!0});w.apply(this,[n,t])}function ki(n,t){if(arguments.length!=0){t.name=t.name||"Range";var i=t.property instanceof k?t.property:n.property(t.property);t.min&&i.get_jstype()===Date&&(t.min=new Date(t.min));t.max&&i.get_jstype()===Date&&(t.max=new Date(t.max));t.min===null&&(t.min=undefined);t.max===null&&(t.max=undefined);t.minFn||(t.minFn=function(){return t.min});t.maxFn||(t.maxFn=function(){return t.max});Object.defineProperty(this,"min",{value:t.minFn,writable:!0});Object.defineProperty(this,"max",{value:t.maxFn,writable:!0});w.apply(this,[n,t])}}function iu(n,t){t.name=t.name||"AllowedValues";t.message=t.message||o.get("allowed-values");t.source instanceof k||t.source instanceof it?(Object.defineProperty(this,"sourcePath",{value:t.source.get_path()}),Object.defineProperty(this,"source",{value:t.source}),t.onChangeOf=[t.source]):t.source instanceof Function||t.fn?(Object.defineProperty(this,"sourceFn",{value:t.source||t.fn,writable:!0}),t.fn=null):(Object.defineProperty(this,"sourcePath",{value:t.source}),t.onChangeOf=[t.source]);t.ignoreValidation&&Object.defineProperty(this,"ignoreValidation",{value:t.ignoreValidation});t.conditionType=t.conditionType||y.ensureConditionType(t.name,this.property,t.category||p.Error);t.hasOwnProperty("onInitExisting")||t.conditionType.origin!=="server"||(t.onInitExisting=!1);w.apply(this,[n,t])}function hi(n,t){arguments.length!=0&&(t.name=t.name||"Compare",t.compareSource&&(t.onChangeOf=[t.compareSource]),Object.defineProperty(this,"compareOperator",{value:t.compareOperator}),t.source instanceof k||t.compareSource instanceof it?(Object.defineProperty(this,"comparePath",{value:t.compareSource.get_path()}),Object.defineProperty(this,"compareSource",{value:t.compareSource})):Object.defineProperty(this,"comparePath",{value:t.compareSource}),w.apply(this,[n,t]))}function ru(n,t){t.name=t.name||"RequiredIf";!t.onChangeOf&&t.compareSource&&(t.onChangeOf=[t.compareSource]);t.isRequired||t.fn?(Object.defineProperty(this,"isRequired",{value:t.isRequired||t.fn,writable:!0}),t.fn=null,t.message=t.message||o.get("required")):(Object.defineProperty(this,"comparePath",{value:t.compareSource}),Object.defineProperty(this,"compareOperator",{value:t.compareOperator||(t.compareValue!==undefined&&t.compareValue!==null?"Equal":"NotEqual"),writable:!0}),Object.defineProperty(this,"compareValue",{value:t.compareValue,writable:!0}));t.requiredValue&&Object.defineProperty(this,"requiredValue",{value:t.requiredValue});w.apply(this,[n,t])}function uu(n,t){t.name=t.name||"StringLength";Object.defineProperty(this,"min",{value:t.min});Object.defineProperty(this,"max",{value:t.max});t.message=t.message||(t.min&&t.max?o.get("string-length-between").replace("{min}",this.min).replace("{max}",this.max):t.min?o.get("string-length-at-least").replace("{min}",this.min):o.get("string-length-at-most").replace("{max}",this.max));w.apply(this,[n,t])}function fu(n,t){arguments.length!=0&&(t.name=t.name||"StringFormat",t.message=o.get(t.message)?o.get(t.message):t.message||o.get("string-format").replace("{formatDescription}",t.description),Object.defineProperty(this,"description",{value:t.description}),Object.defineProperty(this,"expression",{value:t.expression instanceof RegExp?t.expression:RegExp(t.expression)}),Object.defineProperty(this,"reformat",{value:t.reformat}),w.apply(this,[n,t]))}function eu(n,t){t.name=t.name||"ListLength";ki.apply(this,[n,t])}function nf(n){if(ou[n])throw new Error('A set with the name "'+n+'" has already been created.');Object.defineProperty(this,"name",{value:n});Object.defineProperty(this,"types",{value:[]});Object.defineProperty(this,"active",{value:!1,writable:!0});Object.defineProperty(this,"conditions",{value:[]});ou[n]=this}function p(n,t,i,r,u){if(arguments.length!==0){if(su[n])throw new Error('A condition type with the code "'+n+'" has already been created.');Object.defineProperty(this,"code",{value:n});Object.defineProperty(this,"category",{value:t});Object.defineProperty(this,"message",{value:i});Object.defineProperty(this,"sets",{value:r||[]});Object.defineProperty(this,"rules",{value:[]});Object.defineProperty(this,"conditions",{value:[]});Object.defineProperty(this,"origin",{value:u});r&&r.length>0&&Array.forEach(r,function(n){n.types.push(this)},this);su[n]=this}}function os(n,t,i){Object.defineProperty(this,"target",{value:t});Object.defineProperty(this,"condition",{value:n});Object.defineProperty(this,"properties",{value:i});t.meta.setCondition(this)}function hu(n,t,i,r,u){var e,y,d,l,p,a,c,h,s,f,n,o,w;if(Object.defineProperty(this,"type",{value:n}),Object.defineProperty(this,"message",{value:t||(n?n.message:undefined)}),Object.defineProperty(this,"origin",{value:u}),e=[],i)if(r=ot.normalizePaths(r||[]),r.every(function(n){return n.length===1}))e.push(new os(this,i,r));else for(y=r.length-1;y>=0;y--){var b=r[y].steps,k=[i],g=b.length-1;for(o=0;o<b.length;o++){for(d=b[o].property,l=[],p=k.length-1;p>=0;p--)if(a=k[p],c=a.meta.type.property(d),c){if(o===g){for(f=null,s=e.length-1;s>=0;s--)if(e[s].target===a){f=e[s];break}f?f.properties.indexOf(c)<0&&f.properties.push(c):(f=new os(this,a,[c]),e.push(f))}h=c.value(a);h instanceof v?l.push(h):h instanceof Array&&h.length>0&&h[0]instanceof v&&(l=l.concat(h))}k=l}}if(Object.defineProperty(this,"targets",{value:e}),this.type!=we){for(s=e.length-1;s>=0;s--)for(f=e[s],f.target.meta._raiseEvent("conditionsChanged",[f.target.meta,{conditionTarget:f,add:!0,remove:!1}]),n=f.target.meta.type;n;n=n.baseType)n._raiseEvent("conditionsChanged",[f.target.meta,{conditionTarget:f,add:!0,remove:!1}]);if(this.type.conditions.push(this),this.type._raiseEvent("conditionsChanged",[this.type,{condition:this,add:!0,remove:!1}]),this.type.sets)for(o=this.type.sets.length-1;o>=0;o--)w=this.type.sets[o],w.conditions.push(this),w._raiseEvent("conditionsChanged",[w,{condition:this,add:!0,remove:!1}])}}function tf(n,t){Object.defineProperty(this,"message",{value:n});Object.defineProperty(this,"invalidValue",{value:t})}function ti(n,t){if(!t||t==="")return null;n._formats||(n._formats={});var i=n._formats[t];return i?i:(n._formats[t]=n.meta&&n.meta instanceof bt?i=fi.fromTemplate(n,t):i=ss(n,t),i)}function fp(n){ss=n}function u(){}function be(n,t,i,r,u,f,e,o){var h,c;f===undefined||f===null||f instanceof Function?h=context.server._scopeQueries:(h=f,f=e,e=o,o=arguments.length>8?arguments[8]:null);e===undefined||e===null||e instanceof Function||(o=e,e=null);c=s.suspendCurrent("objectProvider");hs(n,t,i,r,u,h,function(){s.resume(c);f&&f.apply(o||null,arguments)},function(){s.resume(c);e&&e.apply(o||null,arguments)})}function ep(n,t,i,r,u){var f,e;i===undefined||i===null||i instanceof Function?f=context.server._scopeQueries:(f=i,i=r,r=u,u=arguments.length>5?arguments[5]:null);r===undefined||r===null||r instanceof Function||(u=r,r=null);e=s.suspendCurrent("queryProvider");cs(n,t,f,function(){s.resume(e);i&&i.apply(u||this,arguments)},function(){s.resume(e);r&&r.apply(u||this,arguments)})}function op(t,i,r){var f=s.suspendCurrent("typeProvider"),e=bo(t),o=[],u={};dr(e,function(t){var i=n.ExoWeb.cache(t);if(i){if(n.ExoWeb.cacheHash&&i.cacheHash!==n.ExoWeb.cacheHash)return n.ExoWeb.cache(t,null),!1}else return!1;return o.push(t),!0});o.length>0&&o.forEach(function(t){u[t]=n.ExoWeb.cache(t).types[t]});e.length>0?ls(e,function(t){s.resume(f);var e=t.types;hr(e,function(t){var i={cacheHash:n.ExoWeb.cacheHash,types:{}};i.types[t]=u[t]=e[t];n.ExoWeb.cache(t,i)});i.call(r||null,!0,u)},function(){s.resume(f);var n=bo(arguments);n.splice(0,0,!1);i.apply(r||null,n)}):(s.resume(f),i.call(r||null,!0,u))}function sp(n,t,i){i[0]&&i.splice(1,1,{},i[1])}function hp(n,t,i,r,u,f,e,o){var h,c,l,a,v;f===undefined||f===null||f instanceof Function?h=context.server._scopeQueries:(h=f,f=e,e=o,o=arguments.length>7?arguments[7]:null);e===undefined||e===null||e instanceof Function||(o=e,e=null);c=s.suspendCurrent("listProvider");v=t==="static"?null:t;l=t==="static"?n+"."+i:i;a=[l];r&&r.length>0&&Array.forEach(r,function(n){a.push(l+"."+n)});vs(n,v,a,u,h,function(){s.resume(c);f&&f.apply(o||null,arguments)},function(){s.resume(c);e&&e.apply(o||null,arguments)})}function cp(n,t,i,r,u,f){var e,o;r===undefined||r===null||r instanceof Function?e=context.server._scopeQueries:(e=r,r=u,u=f,f=arguments.length>4?arguments[4]:null);u===undefined||u===null||u instanceof Function||(f=u,u=null);o=s.suspendCurrent("roundtripProvider");ys(n,t,i,e,function(){s.resume(o);r&&r.apply(f||this,arguments)},function(){s.resume(o);u&&u.apply(f||this,arguments)})}function lp(n,t,i,r,u){var f,e;i===undefined||i===null||i instanceof Function?f=context.server._scopeQueries:(f=i,i=r,r=u,u=arguments.length>5?arguments[5]:null);r===undefined||r===null||r instanceof Function||(u=r,r=null);e=s.suspendCurrent("saveProvider");ps(n,t,f,function(){s.resume(e);i&&i.apply(u||this,arguments)},function(){s.resume(e);r&&r.apply(u||this,arguments)})}function ap(n,t,i,r,u,f,e,o){var h,c;f===undefined||f===null||f instanceof Function?h=context.server._scopeQueries:(h=f,f=e,e=o,o=arguments.length>8?arguments[8]:null);e===undefined||e===null||e instanceof Function||(o=e,e=null);c=s.suspendCurrent("eventProvider");ws(n,t,i,r,u,h,function(){s.resume(c);f&&f.apply(o||null,arguments)},function(){s.resume(c);e&&e.apply(o||null,arguments)})}function cu(n,t,i){if(i===undefined||i===null)throw new Error("Options cannot be null or undefined.");this._model=n;this._serverSync=t;this._options=i}function at(n,t){if(n!==undefined&&n!==null){if(n instanceof ExoWeb.Model.Entity){var i={id:n.meta.id,type:n.meta.type.get_fullName()};return n.meta.isNew&&(i.isNew=!0),i.id=t.forward(i.type,i.id)||i.id,i}return n}}function lu(n,t,i){var r=n.forward(t,i)||i;return n.reverse(t,r)||r}function st(n,t,i,r){var u,e,f,o;if(n!==undefined&&n!==null&&n.type&&n.id){if(u=ExoWeb.Model.Model.getJsType(n.type),u.meta&&u.meta instanceof ExoWeb.Model.Type&&t){if(e=lu(t,n.type,n.id),f=u.meta.get(e,!0),!f&&r&&r.length>0){if(o=r.filter(function(n){return n instanceof u&&n.meta.id===e}),o.length>1)throw new Error("Expected a single item, but found "+o.length+".");f=o[0]}return!f&&i&&(f=new u(e),u.meta.get_origin()==="server"&&ut.register(f)),f}return n}return n}function ke(n,t,i){this._model=n;this._translator=t;this._filters=i;n.addListChanged(this.onListChanged.bind(this));n.addAfterPropertySet(this.onPropertyChanged.bind(this));n.addObjectRegistered(this.onObjectRegistered.bind(this));n.addObjectUnregistered(this.onObjectUnregistered.bind(this))}function de(n,t,i,r,u){if(n===null||n===undefined)throw new l("source");if(n.constructor!==String)throw new h("source","string",n);if(n!=="init"&&n!=="server"&&n!=="client")throw new tr("source",n+" must be in the set ['init', 'server', 'client']");if(i!==null&&i!==undefined&&i.constructor!==String)throw new h("user","string",i);this.code=u||wo(8);this.source=n;this.title=t||null;this.user=i||null;this.changes=r&&r instanceof Array?[].concat(r):[];this.onChangeAdded=new nt;this.onChangeUndone=new nt;this.onTruncated=new nt}function vl(n){this._defaultUser=n;this.activeSet=null;this.sets=[];this.onChangeAdded=new nt;this.onChangeSetStarted=new nt;this.onChangeUndone=new nt;this.onTruncated=new nt}function bs(n){if(n===null||n===undefined)throw new l("model");if(typeof n!="object"||!(n instanceof a))throw new h("model","model",n);var u=new vl,s=new us,o=[],v=function(n,t,i){return Array.contains(n,t)?(i&&c(f("Object {0}|{1} was changed but has been deleted.",t.meta.type.get_fullName(),t.meta.id)),!0):!1},y=function(n){return!v(o,n,!1)},p=function(n){return!v(o,n,!0)},w=new ke(n,s,{listChanged:p,propertyChanged:p,objectRegistered:y,objectUnregistered:y}),t=0,i=!1,r=this;w.addChangeDetected(function(n){var e,f;if(t<=0&&i===!0){if(n.property)if(e=st(n.instance,s),f=e.meta.property(n.property),f.get_jstype()===Date&&n.newValue&&f.get_format()&&!no.test(f.get_format().toString())){var o=r.get_ServerTimezoneOffset(),h=-((new Date).getTimezoneOffset()/60),c=h-o;n.newValue=n.newValue.addHours(c)}else n.newValue&&n.newValue instanceof ui&&(n.newValue=n.newValue.toObject());u.add(n);r._raiseEvent("changesDetected",[r,{reason:"listener.addChangeDetected",changes:[n]}]);r._saveInterval&&r.canSave(n)&&yl(n)&&r._queueAutoSave()}});this.isApplyingChanges=function(){return t>0};this.beginApplyingChanges=function(){t+=1};this.endApplyingChanges=function(){if(t-=1,t<0)throw new Error("Error in transaction log processing: unmatched begin and end applying changes.");};this.isCapturingChanges=function(){return i===!0};this.beginCapturingChanges=function(){i||(i=!0,u.start({user:this._localUser}))};this.stopCapturingChanges=function(){i&&(i=!1,u.stop())};this.ignoreChanges=function(n,i,r,u){return arguments.length===1&&(i=arguments[0],n=null),function(){var f=!1;try{t+=1;n&&n instanceof Function&&n();f=!0;i.apply(u||this,arguments)}finally{t-=1;f===!0&&r&&r instanceof Function&&r()}}};this.isObjectDeleted=function(n,t){return v(o,n,t)};n.addObjectRegistered(function(n){n.meta.isNew||n.meta.type.get_origin()!=="server"||i!==!0||t||ut.register(n)});Object.defineProperty(this,"model",{value:n});Object.defineProperty(n,"server",{value:this});this._changeLog=u;this._scopeQueries=[];this._objectsExcludedFromSave=[];this._objectsDeleted=o;this._translator=s;this._serverInfo=null;this._localUser=null;e.makeObservable(this)}function yl(n){var t,i;return n.property&&(t=a.getJsType(n.instance.type,!0),t&&(i=t.meta.property(n.property),!i.get_isPersisted()))?!1:!0}function lr(n,t){var r=this._changeLog.serialize(n?this.canSend:this.canSave,this),u,i;if(t&&t.meta.isNew){function f(n){return n.type==="InitNew"&&n.instance.type===t.meta.type.get_fullName()&&(n.instance.id===t.meta.id||this._translator.reverse(n.instance.type,n.instance.id)===t.meta.id)}u=!1;i=r.filter(function(n){return n.source==="init"})[0];i&&i.changes.some(f,this)||r.forEach(function(n){u!==!0&&n.changes.forEach(function(t,e){u!==!0&&f.call(this,t)&&(n.changes.splice(e,1),i?i.changes.push(t):(i={changes:[t],source:"init"},r.splice(0,0,i)),u=!0)},this)},this)}return r}function vp(n){this._scopeQueries.push(n)}function yp(n){var t=this._changeLog.activeSet;this._changeLog.addSet("init",null,null,n);t&&this._changeLog.start({title:t.title,user:t.user})}function ar(n,t){n.id===t.meta.legacyId&&(n.id=t.meta.id,n.isNew=!1)}function pl(n,t,i,r){var f=n.type(t);f?u.isRegistered(f)?u.load(f,null,!1,function(n){i.apply(r||this,[n])}):i.apply(r||this,[f.get_jstype()]):li(n,[t],function(n){i.call(r||this,n)})}function rf(n,t,i,r,u){for(var f in t)pp(n,i,f,t[f]);r&&r instanceof Function&&r.call(u||this)}function pp(n,t,i,r){var f=ExoWeb.Model.ConditionType.get(i),u;if(!f){c('A condition type with code "'+i+'" could not be found.');return}u=n.server;t?r.forEach(function(i){var r=i.targets[0];r&&rt(u.model,r.instance.type,null,!1,function(e){pt(u.model,u._translator,e,r.instance.id,null,tt.None,function(r){t.indexOf(r)>=0&&wl(n,f,i.message,i.targets)})})}):r.forEach(function(t){wl(n,f,t.message,t.targets)})}function wl(n,t,i,r){var f=new hu(t,i,null,null,"server"),u=n.server;r.forEach(function(n){rt(u.model,n.instance.type,null,!1,function(t){pt(u.model,u._translator,t,n.instance.id,null,tt.None,function(i){f.targets.push(new os(f,i,n.properties.map(function(n){return t.meta.property(n)})))})})})}function au(n,t,i,r){var o=new ExoWeb.Signal("objectsFromJson"),s=[],u,f,e;for(u in t){f=t[u];for(e in f)ks(n,u,e,f[e],o.pending(function(n){n&&s.push(n)}),r)}o.waitForAll(function(){i.call(r||this,s)})}function ks(n,t,i,r,e,o){var l,g=n.type(t),rt,y,ft,p,et,w,s,h,k,a,nt,tt,b,it,d,ot,st;if(!g){li(n,[t],function(){ks(n,t,i,r,e)});return}if(u.isRegistered(g)){u.load(g,null,!1,function(){ks(n,t,i,r,e,o)});return}if(l=i===di?null:to(n,t,i,null,!0),y=!1,i===di?y=!0:l&&(u.isRegistered(l)&&(y=!0,rt=l,ut.unregister(l)),l.wasGhosted&&(y=!0,rt=l,delete l.wasGhosted)),y||!l||!l.meta.isNew)for(ft=[],p=g;p!==null;p=l?p.baseType:null){et=l?p.get_instanceProperties():p.get_staticProperties();for(w in et)if(!(ft.indexOf(w)>=0)){if(ft.push(w),s=et[w],!s)throw new Error(f("Cannot load object {0}|{2} because it has an unexpected property '{1}'",t,w,i));if(s.get_origin()==="server"&&(y||s.get_isList())){if(l)h=r[s.get_index()];else if(h=r[w],h===undefined)continue;if(h!==null)if(k=s.get_jstype(),s.get_isList()){if(a=s.get_isStatic()?s.value():l[s._fieldName],h=="?")a||(a=ht.register(l,s),bi.call(s,l,a,!1));else if(!a||u.isRegistered(a)){for(nt=undefined,a?(ht.unregister(a),nt=!1):(a=[],nt=!0),tt=0;tt<h.length;tt++)b=h[tt],it=to(n,k,b&&b.id||b,b&&b.type||k),a.contains(it)&&c(f("Initializing list {0}|{1}.{2} already contains object {3}.",t,i,s._name,v.toIdString(it))),a.push(it);nt?bi.call(s,l,a):s._raiseEvent("changed",[l,{property:s,newValue:a,oldValue:undefined,collectionChanged:!0}])}}else y&&(d=s.get_jstype(!0),!d||d.meta?bi.call(s,l,to(n,k,h&&h.id||h,h&&h.type||k)):(d==Date&&h&&h.constructor==String&&h.length>0?(ci.lastIndex=0,h=new Date(h.replace(ci,ge)),s.get_format()&&!no.test(s.get_format().toString())&&(ot=n.server.get_ServerTimezoneOffset(),st=-((new Date).getTimezoneOffset()/60),h=h.addHours(ot-st))):d===ui&&(h=new ui(h.TotalMilliseconds)),bi.call(s,l,h)));else y&&bi.call(s,l,null)}}}e&&e instanceof Function&&e.call(o||this,rt)}function bl(n,t,i,r){var u,f;for(u in t)f=t[u],f===null?r&&r(u,null):(wp(n,u,f),i&&i(u,f))}function wp(n,t,i){var u=nh(n,t,i.baseType),c,r,e,v,s,o,f,l,a,h;if(i.format&&u.set_format(ti(u.get_jstype(),i.format)),u.get_originForNewProperties()==="client")throw new Error('Type "'+u._fullName+'" has already been loaded');i.exports&&u.set_exports(i.exports);for(c in i.properties)if(r=i.properties[c],e=r.type,r.type.endsWith("[]")&&(e=e.toString().substring(0,e.length-2),r.isList=!0),e=kp(n,e),v=ti(e,r.format),s=u.addProperty({name:c,type:e,label:r.label,helptext:r.helptext,format:v,isList:r.isList===!0,isStatic:r.isStatic===!0,isPersisted:r.isPersisted!==!1,isCalculated:r.isCalculated===!0,index:r.index,defaultValue:r.defaultValue?u.compileExpression(r.defaultValue):undefined}),r.isStatic&&r.isList&&bi.call(s,null,ht.register(null,s)),r.rules)for(o in r.rules)f=r.rules[o],f.type?f.name||(f.name=o):(f.type=o,f.name||(f.name=u.get_fullName()+"."+s.get_name()+"."+o.substr(0,1).toUpperCase()+o.substr(1))),f.property=s,gs(u,f);u.set_originForNewProperties("client");for(l in i.methods)a=i.methods[l],u.addMethod({name:l,parameters:a.parameters,isStatic:a.isStatic});if(i.conditionTypes&&bp(n,u,i.conditionTypes),i.rules)for(h=0;h<i.rules.length;++h)gs(u,i.rules[h])}function bp(n,t,i){i.forEach(function(n){ds(t,n)})}function ds(n,t){var i,r;return t.code=t.code||t.name,i=ExoWeb.Model.ConditionType.get(t.code),i||(r=t.sets?t.sets.map(function(n){var t=ExoWeb.Model.ConditionTypeSet.get(n);return t||(t=new ExoWeb.Model.ConditionTypeSet(n)),t}):[],i=t.category&&t.category!="Error"?t.category=="Warning"?new ExoWeb.Model.ConditionType.Warning(t.code,t.message,r,"server"):t.category=="Permission"?new ExoWeb.Model.ConditionType.Permission(t.code,t.message,r,t.permissionType,t.isAllowed,"server"):new ExoWeb.Model.ConditionType(t.code,t.category,t.message,r,"server"):new ExoWeb.Model.ConditionType.Error(t.code,t.message,r,"server"),i.extend(t)),t.rule&&t.rule.hasOwnProperty("type")&&i.rules.push(gs(n,t.rule,i)),i}function gs(n,t){var i=ExoWeb.Model.Rule[t.type];return t.conditionType?t.conditionType=ds(n,t.conditionType):i.prototype instanceof si&&(t.conditionType=ds(n,t)),new i(n,t)}function kp(n,t){var r=t.split(">"),i=ExoWeb.Model.Model.getJsType(r[0],!0);return i===undefined&&(i=nh(n,null,r).get_jstype()),i}function kl(n,t){function i(n){t.indexOf(n)<0&&t.push(n)}n instanceof Array?Array.forEach(n,i):typeof n=="string"?Array.forEach(n.split(">"),i):n&&i(n)}function nh(n,t,i){var f=[],r,e,u;for(kl(t,f),kl(i,f);f.length>0;)e=r,u=f.pop(),u instanceof ExoWeb.Model.Type?r=u:u.meta?r=u.meta:(r=n.type(u),r||(r=n.addType(u,e,"server"),vr.register(r)));return r}function to(n,t,i,r,u){if(i===di)throw new Error("Function 'getObject' can only be called for instances (id='"+i+"')");var e=nh(n,r,t),f=e.get(i,!0);return f||(f=new(e.get_jstype())(i),f.wasGhosted=!0,u||ut.register(f)),f}function dp(n,t){var i=n.type(t);return i.eachBaseType(function(n){if(!u.isLoaded(n))throw new Error("Base type "+n._fullName+" is not loaded.");}),vr.unregister(i),ra(i),i}function gp(n,t,i,r){function h(i,r,c){var v=[],b=[],l={},y=[],a,w,p;if(i){for(bl(n,r,null,function(n){e.remove(n)}),hr(r,function(n){o.push(n)}),c&&hr(c,function(n){o.push(n)}),dr(e,function(t){var i,r=!1;if(o.contains(t)&&(i=n.type(t),i))if(u.isLoaded(i))b.push(i._fullName);else if(i.eachBaseType(function(n){u.isLoaded(n)||(o.contains(n._fullName)?l.hasOwnProperty(t)?l[t].splice(0,0,n._fullName):l[t]=[n._fullName]:(r=!0,v.contains(n._fullName)||e.contains(n._fullName)||v.push(n._fullName)))}),!r)return y.push(t),!0}),b.forEach(function(n){e.remove(n)});y.length>0;)a=y.dequeue(),l.hasOwnProperty(a)?(w=l[a],delete l[a],w.forEach(function(n){y.remove(n);delete l[n]}),p=w,p.push(a),p.splice(0,0,0,0),Array.prototype.splice.apply(y,p)):(e.remove(a),dp(n,a));v.length>0?(e.addRange(v),as(v,h)):e.length===0&&s.isActive()&&s.oneDone()}else throw new Error(f("Failed to load {0} (HTTP: {1}, Timeout: {2})",t.join(","),r._statusCode,r._timedOut));}var s=new ExoWeb.Signal("fetchTypes("+t.join(",")+")"),e,o;s.pending();e=t.copy();o=[];as(t,h);s.waitForAll(function(){if(i&&i instanceof Function){var u=t.map(function(t){var i=n.type(t);return i?i.get_jstype():null});i.apply(r||this,u)}})}function nw(n,t,i){var r=[0,i.length];Array.prototype.push.apply(r,t[1].map(function(n){var i=t[0].type(n);return i?i.get_jstype():null}));Array.prototype.splice.apply(i,r)}function io(n,t,i,r,f){for(var e=i.steps.dequeue(),s=[e],h,c,o;e;){if(h=t.meta.property(e.property),!h){c=[0,0];Array.prototype.push.apply(c,s);Array.prototype.splice.apply(i.steps,c);f('Could not find property "'+e.property+'" on type "'+t.meta.get_fullName()+'".');return}if(h.get_isValueType())break;if(e.cast){if(o=n.type(e.cast),!o){Array.insert(i.steps,0,e);li(n,[e.cast],function(){io(n,t,i,r,function(){var n=[0,0];Array.prototype.push.apply(n,s);Array.prototype.splice.apply(i.steps,n);f.apply(this,arguments)})});return}}else o=h.get_jstype().meta;if(!u.isLoaded(o)){li(n,[o.get_fullName()],function(t){io(n,t,i,r,function(){var n=[0,0];Array.prototype.push.apply(n,s);Array.prototype.splice.apply(i.steps,n);f.apply(this,arguments)})});return}t=o.get_jstype();e=i.steps.dequeue();s.push(e)}r()}function tw(n,t,i,r){function o(t){i&&Array.forEach(i,function(i){io(n,t,i,f.pending(),function(t){for(var s=null,r="",e,o;i.steps.length>1;)s=i.steps.dequeue(),r+=(r.length>0?".":"")+s.property;e=n.type(r);o=function(){io(n,(e||n.type(r)).get_jstype(),i,f.pending(),function(){throw new Error('Invalid query path "'+i+'" - '+t);})};e?u.isRegistered(e)?u.load(e,null,!1,f.pending(o)):o():li(n,[r],f.pending(function(n){if(!n)throw new Error(t);o(n)}))})})}var f=new ExoWeb.Signal("fetchTypes"),e=n.type(t);e?u.isRegistered(e)?u.load(e,null,!1,f.pending(o)):o(e.get_jstype()):li(n,[t],f.pending(function(n){o(n)}));f.waitForAll(r)}function iw(n){function r(n,t){var i=n[t];i&&i.constructor===String&&ci.test(i)&&(ci.lastIndex=0,n[t]=new Date(i.replace(ci,ge)))}var t,i;if(n instanceof Array)for(t=0;t<n.length;t++)r(n,t);else if(n instanceof Object)for(i in n)n.hasOwnProperty(i)&&r(n,i)}function rt(n,t,i,r,f,e){var o=ExoWeb.Model.Model.getJsType(t,!0);o&&u.isLoaded(o.meta)?f.call(e||this,o):o&&r?u.load(o.meta,i,!1,f,e):!o&&r?pl(n,t,f,e):$extend(t,function(){f.apply(this,arguments)},e)}function rw(n,t,i,r){var u=ro[n];u||(ro[n]=u={});u[t]||(u[t]={callback:i,thisPtr:r})}function pt(n,t,i,r,f,e,o,s){var h=i.meta.get(lu(t,i.meta.get_fullName(),r),!0,e!==tt.Force&&e!==tt.ForceAndWait&&e!==tt.Lazy),c;if(h&&h.meta.isLoaded(f))o.call(s||this,h);else if(e==tt.Lazy)h||(h=st({type:i.meta.get_fullName(),id:r},t,!0)),o.call(s||this,h);else if(e==tt.Force)h||(h=st({type:i.meta.get_fullName(),id:r},t,!0)),o.call(s||this,h),u.load(h,f,!1);else if(e==tt.ForceAndWait)h||(h=st({type:i.meta.get_fullName(),id:r},t,!0)),u.load(h,f,!1,s?o.bind(s):o);else{function y(){ur(h)===!0&&(propertyFilter=function(){return!1},o.call(s||this,h))}c=new et("wait for object to exist");function l(){if(f){var n=i.meta.property(f);n.get_isEntityListType()&&(h.meta.isLoaded(f)||n.addChanged(c.pending(null,null,!0),h,!0))}}function a(){h.meta.type.addInitExisting(c.pending(function(){l()},null,!0),h,!0)}function v(){n.addObjectRegistered(c.pending(null,null,!0),function(n){if(n.meta.type===i.meta&&n.meta.id===lu(t,i.meta.get_fullName(),r))return h=n,h.meta.isLoaded()||a(),!0},!0)}h?h.meta.isLoaded()?l():a():v();c.waitForAll(function(){o.call(s||this,h)},null,!0)}}function vr(){}function uw(n,t,i,r,u){if(!ExoWeb.config.allowTypeLazyLoading)throw new Error("Type lazy loading has been disabled: "+n.get_fullName());li(n.model,[n.get_fullName()],function(n){r&&r instanceof Function&&r(n)},u)}function ut(){this._requests={};this._typePaths={}}function fw(n,t,i,r,e){if(!ExoWeb.config.allowObjectLazyLoading)throw new Error(f("Object lazy loading has been disabled: {0}|{1}",n.meta.type.get_fullName(),n.meta.id));uf++;var l=new ExoWeb.Signal("object lazy loader"),s=n.meta.id||di,o=n.meta.type||n.meta,h=ut.getRelativePaths(n);t&&h.indexOf(t)<0&&h.push(t);c(f("Lazy load object: {0}|{1}",o.get_fullName(),s));be(o.get_fullName(),[s],h,i,lr.call(context.server,!0),function(t){o.model.server._handleResult(t,f("Lazy load: {0}|{1}",o.get_fullName(),s),null,function(){var t,i;for(u.unregister(n,this),uf--,t=o;t;t=t.baseType)i=t._getEventHandler("initExisting"),i&&i(n,{});r.call(e||this,n)})},function(n){uf--;var t=f("Failed to load {0}|{1}: ",[o.get_fullName(),s])+(n!==undefined&&n!==null&&n.get_message!==undefined&&n.get_message!==null&&n.get_message instanceof Function?n.get_message():"unknown error");throw new Error(t);});u.isRegistered(o)&&u.load(o,null,!1,l.pending())}function ht(){}function ew(n,t,i,r,e){var a=new ExoWeb.Signal("list lazy loader"),p=n._ownerProperty.get_containingType().model,o=n._ownerId,k=n._ownerProperty.get_containingType(),y=o===di?k.get_jstype():k.get(o,!1),s=o===di?y.meta.get_fullName():y.meta.type.get_fullName(),w=n._ownerProperty,d=n._ownerProperty.get_index(),t=n._ownerProperty.get_name(),l=n._ownerProperty.get_jstype().meta,h,b;if(!ExoWeb.config.allowListLazyLoading)throw new Error(f("List lazy loading has been disabled: {0}|{1}.{2}",s,o,t));c(f("Lazy load list: {0}|{1}.{2}",s,o,t));hp(s,o,t,o===di?[]:ut.getRelativePathsForType(l),lr.call(context.server,!0),a.pending(function(n){h=n.instances;b=n.conditions}),a.orPending(function(n){var i=n!==undefined&&n!==null&&n.get_message!==undefined&&n.get_message!==null&&n.get_message instanceof Function?n.get_message():n.message?n.message:"unknown error";throw new Error(f("Failed to load {0}|{1}.{2}: {3}",s,o,t,i));}));u.isRegistered(l)&&u.load(l,null,!1,a.pending());a.waitForAll(function(){function ut(n,t){var u,r;if(h[n.get_fullName()]){if(h[n.get_fullName()][t])return i=n.get_fullName(),k=t,!0;for(u in h[n.get_fullName()])if(u.toLowerCase()==t.toLowerCase())return i=n.get_fullName(),k=u,!0}for(r=0;r<n.derivedTypes.length;r++)if(ut(n.derivedTypes[r],t))return!0}var k,i,g,it,tt,a,nt,ft,rt;if(h){if(k=o,i=s,!ut(ExoWeb.Model.Model.getJsType(s).meta,o))throw new Error(f("Data could not be found for {0}:{1}.",s,o));if(g=w.get_isStatic()?h[i][k][t]:h[i][k][d],!(g instanceof Array))throw new Error(f("Attempting to load list {0} of instance {1}:{2}, but the response JSON is not an array: {3}.",t,s,o,g));for(it=!1,u.isRegistered(n)&&(it=!0,ht.unregister(n,this)),tt=0;tt<g.length;tt++)a=g[tt],nt=to(p,l,a&&a.id||a,a&&a.type||l),it&&(n.contains(nt)&&c(f("Lazy loading list {0}|{1}.{2} already contains object {3}.",s,o,t,v.toIdString(nt))),n.push(nt)),u.isLoaded(nt)&&delete h[i][a.id];u.isLoaded(y)&&delete h[i][k];ht.unregister(n,this);ft=ExoWeb.Batch.start(f("{0}|{1}.{2}",[s,o,t]));rt=function(){w._raiseEvent("changed",[y,{property:w,newValue:n,oldValue:undefined,collectionChanged:!0}]);ExoWeb.Batch.end(ft);r.call(e||this,n)};au(p,h,function(){b?rf(p,b,n.slice(0),rt):rt()})}})}function ei(){n.context=this;this.model={meta:new ExoWeb.Model.Model};this.server=new bs(this.model.meta)}function ow(){if(n.context||(n.context=new ei),!(n.context instanceof ei))throw new Error("The window object has a context property that is not a valid context.");}function gl(n,t){this.context=n;this.options=t;this.batch=null;this.state={}}function ia(){ff&&(ff(n.context,ta.pending()),ff=null);ta.waitForAll(function(){rh.isEmpty()||(n.context.beginContextReady(),rh(n.context),n.context.endContextReady());r(function(){if(!na&&ExoWeb.config.autoActivation&&(na=!0,Sys.Application.activateElement(document.documentElement)),!fo.isEmpty())if(ExoWeb.config.debug)fo(n.context);else try{fo(n.context)}catch(t){ExoWeb.logError(t,!0)}})})}function sw(t){t instanceof Function&&(t={init:t});t.init&&(ih.add(t.init,null,!0),delete t.init);t.extendContext&&(ff=rc(ff,t.extendContext,{async:!0,callbackIndex:1}),delete t.extendContext);t.contextReady&&(rh.add(t.contextReady,null,!0),delete t.contextReady);t.domReady&&(fo.add(t.domReady,null,!0),delete t.domReady);t.serverInfo&&(uo=r.extend(uo,t.serverInfo),delete t.serverInfo);t.types&&t.types instanceof Array&&(gi=gi.concat(t.types),delete t.types);var u=!1,i={};if(t.model&&(u=!0,i.model=t.model,delete t.model),t.types&&(u=!0,i.types=t.types,delete t.types),t.instances&&(u=!0,i.instances=t.instances,delete t.instances),t.conditions&&(u=!0,i.conditions=t.conditions,delete t.conditions),t.changes&&(u=!0,i.changes=t.changes,delete t.changes),u)ow(),ih(n.context),uo&&(i.serverInfo=uo),gi.length>0&&!i.types&&(i.types=gi,gi=[]),ei.query(n.context,i),gi.length>0&&(ei.query(n.context,{types:gi}),gi=[]),n.context.addReady(ia);else if(n.context){if(!(n.context instanceof ei))throw new Error("The window object has a context property that is not a valid context.");ih(n.context);n.context.isPending()||d.waitForAll(ia)}}function ra(n){var t=ef[n.get_fullName()];t&&(delete ef[n.get_fullName()],t(n.get_jstype()));n.eachBaseType(function(t){var i=eo[t.get_fullName()];i&&i(n.get_jstype())})}function uh(n,t,i){var f=ExoWeb.Model.Model.getJsType(n,!0),r;f&&u.isLoaded(f.meta)?t.call(i||this,f):(r=ef[n],r||(r=ef[n]=ExoWeb.Functor()),r.add(i?t.bind(i):t))}function g(n){this._action="show";g.initializeBase(this,[n])}function pr(){this._signal=new ExoWeb.Signal;pr.initializeBase(this)}function of(n){of.initializeBase(this,[n])}function wr(n){wr.initializeBase(this,[n])}function hw(n,t,i){var f,r,e,u,o;if((t===undefined||t===null)&&c("Attempting to find template for "+(t===undefined?"undefined":"null")+" data."),f=oo[n])for(r=f.length-1;r>=0;r--)if(e=f[r],u=e.control,u instanceof wr&&(o=u.isCorrectKind(t),(o===undefined||o===!0)&&u.matches(t,i)))return e;return null}function sf(n){sf.initializeBase(this,[n])}function cf(n){cf.initializeBase(this,[n])}function lf(n){lf.initializeBase(this,[n])}function oa(n){function i(n){return n.control&&n.control instanceof Sys.UI.DataView||n.control&&n.control instanceof ExoWeb.UI.Content}for(var t=n;t.parentNode&&!i(t.parentNode);)t=t.parentNode;if(t.parentNode&&i(t.parentNode))return t}function cw(n,t,i){var e=null,r,u,s,c,o,l,f,a,h;if(n&&(n.control instanceof Sys.UI.DataView||n.control instanceof ExoWeb.UI.Content)&&(r=n.control.get_contexts(),u=n.control.get_data(),u instanceof Array||(u=[u]),r))if(r.length==1&&(i=0),i!==undefined&&i!==null&&i.constructor===Number)i<r.length&&(s=r[i],c=u[i],e=s?s.dataItem:c);else for(o=0,l=r.length;o<l;o++)if(f=r[o],f){if(f.containerElement===n&&Sys._indexOf(f.nodes,t)>-1){e=f.dataItem;break}}else if(a=hc(n.children,function(n){return Sys.UI.Template.findContext(n.firstChild)}).distinct(),h=a.single(function(n){return Sys._indexOf(n.nodes,t)>=0}),h){e=h.dataItem;break}return e}function eh(n){var t=n.target,h=n.level||1,i,r=n.subcontainer,o=0,s=!0,e,u,f;for(t.control&&(t.control instanceof Sys.UI.DataView||t.control instanceof ExoWeb.UI.Content)?t=t.control:t instanceof Sys.UI.Template?t=t.get_element():t instanceof Sys.UI.TemplateContext&&(t=t.containerElement);s===!0;){if(!i&&(t instanceof Sys.UI.DataView||t instanceof ExoWeb.UI.Content)){if(e=t.get_templateContext(),e._global===!0)return{data:null,global:!0,container:document.documentElement,subcontainer:t.get_element()};i=e.containerElement;i.control instanceof g&&(i=Sys.UI.Template.findContext(i).containerElement);n.target&&n.target.tagName&&(r=oa(n.target))}else{if(f=i||t,r=oa(f),!r){if(f.control&&(f.control instanceof Sys.UI.DataView||i.control instanceof ExoWeb.UI.Content)){i=null;t=f.control;continue}throw Error.invalidOperation("Not within a container template.");}i=r.parentNode}o++;u=cw(i,r,n.index);s=n.dataType?!u||!(u instanceof n.dataType||u.constructor===n.dataType):n.ifFn?!n.ifFn.call(this,u,i):o<h}return{data:u,container:i,subcontainer:r}}function lw(n,t){var i=n.get_element().control.get_contexts().length;return t==i-1}function vu(n,t,i,r,f,e,o){vu.initializeBase(this);this._templateContext=n;this._source=t;this._sourcePath=i;this._target=r;var s=f?f.toLowerCase():f;this._targetPath=s==="innertext"?"innerText":s==="innerhtml"?"innerHTML":f;this._options=e||{};this._isTargetElement=Sys.UI.DomElement.isDomElement(r);this._updateImmediately=!0;this._sourcePath?(this._evalSuccessHandler=this._evalSuccess.bind(this),this._evalFailureHandler=this._evalFailure.bind(this),u.eval(this._source,this._sourcePath,this._evalSuccessHandler,this._evalFailureHandler,o)):this._evalSuccess(this._source);this._updateImmediately=!1}function af(n){return yo(n)?n:wu(n)?[]:[n]}function kt(n,t,i,r){if(kt.initializeBase(this),this._target=n instanceof vf?n.get_rawValue():n,this._propertyPath=t,this._settingRawValue=!1,this._readySignal=new ExoWeb.Signal("Adapter Ready"),r.allowedValuesTransform&&(this._allowedValuesTransform=r.allowedValuesTransform),r.optionsTransform)throw new Error(f('Option "optionsTransform" is obsolete, use "allowedValuesTransform" instead. Path = "{0}".',t));r.allowedValuesMayBeNull&&(this._allowedValuesMayBeNull=r.allowedValuesMayBeNull);this._initPropertyChain();this._format=i?ti(this._propertyChain.get_jstype(),i):this._propertyChain.get_format();u.eval(this._target,this._propertyChain.get_path(),this._readySignal.pending(null,null,!0),this._readySignal.orPending(function(n){throw new Error(f("Couldn't evaluate path '{0}', {1}",t,n));},null,!0));this._extendProperties(r)}function aw(n,t,i){i.add?n.add(i.conditionTarget.condition):i.remove&&n.remove(i.conditionTarget.condition)}function ho(n,t){for(var i,r=null,u=0;u<n.length;u++)i=n[u],(i.type instanceof p.Error||t===!0&&i.type instanceof p.Warning)&&(r===null||/FormatError/i.test(i.type.code)?r=i:!/FormatError/i.test(r.type.code)&&/Required/i.test(i.type.code)&&(r=i));return r}function ha(){var t=this._propertyChain.lastProperty(),n=t.rule(ExoWeb.Model.Rule.allowedValues);this._allowedValuesChangedHandler&&(n.removeChanged(this._allowedValuesChangedHandler),this._allowedValuesChangedHandler=null);this._allowedValuesRuleExistsHandler&&(this._propertyChain.lastProperty().removeRuleRegistered(this._allowedValuesRuleExistsHandler),this._allowedValuesRuleExistsHandler=null);this._allowedValuesExistHandler&&(n.removeChanged(this._allowedValuesExistHandler),this._allowedValuesExistHandler=null);this._options=null}function sh(n){return n instanceof is?new lo(this,n.group,n.items):new vf(this,n)}function yu(){this._disposed||(delete this._options,ExoWeb.Observer.raisePropertyChanged(this,"options"))}function vw(n){n instanceof y.allowedValues&&(this._propertyChain.lastProperty().removeRuleRegistered(this._allowedValuesRuleExistsHandler),yu.call(this))}function yw(){var t=this._propertyChain.lastProperty(),n=t.rule(ExoWeb.Model.Rule.allowedValues),i=this._propertyChain.lastTarget(this._target),r=n.values(i,!!this._allowedValuesMayBeNull);r instanceof Array&&(n.removeChanged(this._allowedValuesExistHandler),delete this._allowedValuesExistHandler,yu.call(this))}function co(n){var i=this._propertyChain.lastProperty(),r=i.rule(ExoWeb.Model.Rule.allowedValues),u=this._propertyChain.lastTarget(this._target),t=r.values(u,!!this._allowedValuesMayBeNull);t?(n.beginUpdate(),fr(n,t),n.endUpdate()):yu.call(this)}function ca(n,t,i){s.whenDone(function(){var r=new et("ensureAllowedValuesLoaded");n.forEach(function(n){u.isRegistered(n)&&u.load(n,null,!0,r.pending())});r.waitForAll(t,i)})}function hh(n){var t=this.get_rawValue();n?t instanceof Array?dr(t,function(t){return n.indexOf(t)<0},this):n.indexOf(t)<0&&this._propertyChain.value(this._target)!==null&&this._propertyChain.value(this._target,null):t instanceof Array?t.clear():this._propertyChain.value(this._target)!==null&&this._propertyChain.value(this._target,null)}function pw(n,t,i){var e=this._propertyChain.lastProperty(),u=e.rule(ExoWeb.Model.Rule.allowedValues),f=u.values(this._propertyChain.lastTarget(this._target),!!this._allowedValuesMayBeNull),r;u.ignoreValidation||hh.call(this,f);i.changes?(r=[],i.changes.forEach(function(n){n.newItems&&r.addRange(n.newItems)}),r.length>0?ca(r,co.prependArguments(n),this):co.call(this,n)):!i.oldValue&&i.newValue?ca(f,co.prependArguments(n),this):co.call(this,n)}function vf(n,t){this._parent=n;this._obj=t;this._ensureObservable()}function ch(n,t){this._parent=n;this._index=t;this._ensureObservable()}function lo(n,t,i){this._parent=n;this._obj=t;this._options=$transform(i).select(n._createOption.bind(n)).live();this._ensureObservable()}function la(n){for(var t=n.get_source(),i=0;i<n._pathArray.length-1;++i)t=t[n._pathArray[i]]||t["get_"+n._pathArray[i]]();return t}function aa(n){return n._pathArray[n._pathArray.length-1]}function ww(n){var t=la(n),i,r,u,f;return t instanceof ExoWeb.View.OptionAdapter&&(t=t.get_parent()),t instanceof ExoWeb.View.Adapter?(u=t.get_propertyChain(),r=u.lastProperty(),i=u.lastTarget(t.get_target())):t instanceof ExoWeb.Model.Entity&&(f=aa(n),r=t.meta.property(f),i=t),{target:i,property:r}}function gw(){var t,i,r,u,f,e;if(!wa&&n.Sys&&Sys.Binding&&Sys.UI&&Sys.UI.TemplateContext){if(t=Sys.Binding.prototype._addBinding,!t)throw new Error("Could not find Binding._addBinding method to override.");if(Sys.Binding.prototype._addBinding=function(n){t.apply(this,arguments);var i=this._templateContext;i._completed&&i._completed.length>0?i.add_instantiated(function(){wt(n,n,"bound")}):wt(n,n,"bound")},i=Sys.Binding._disposeBindings,!i)throw new Error("Could not find Binding._disposeBindings method to override.");Sys.Binding._disposeBindings=function(){i.apply(this,arguments);wt(this,this,"unbound")};wa=!0}if(!ba&&n.Sys&&Sys.UI&&Sys.UI.Template){if(r=Sys.UI.Template.prototype.instantiateIn,!r)throw new Error("Could not find Template.instantiateIn method to override.");Sys.UI.Template.prototype.instantiateIn=function(){var n=r.apply(this,arguments);return n.nodes.length>0&&wt(n.containerElement,n.nodes,"added","template"),n};Sys.UI.DataView.prototype._clearContainers=function(n,t,i){for(var u,e,s,h,o,l,c,r=t||0,f=i?t+i:this._contexts.length;r<f;r++)h=this._contexts[r],u=h.nodes,u.length>0&&wt(h.containerElement,u,"deleted","template"),i&&(e||(e=u[0]),u.length>0&&(s=u[u.length-1]));for(r=0,f=n.length;r<f;r++)o=n[r],l=o?o.parentNode:this.get_element(),(!i||e&&s)&&this._clearContainer(l,o,e,s,!0);for(r=t||0,f=i?t+i:this._contexts.length;r<f;r++)c=this._contexts[r],c.nodes=null,c.dispose()};Sys.UI.DataView.prototype._clearContainer=function(n,t,i,r,u){var o=t?t.__msajaxphcount:-1,c,e,l,f,a,v,h,s;if(o>-1&&t&&(t.__msajaxphcount=0),o<0){if(t&&n.removeChild(t),u||n.childNodes.length>0&&wt(n,n.childNodes,"deleted","template"),i||Sys.Application.disposeElement(n,!0),c=!1,!i)try{n.innerHTML="";c=!0}catch(y){}if(!c)for(e=i||n.firstChild;e;)l=e===r?null:e.nextSibling,Sys.Application.disposeElement(e,!1),n.removeChild(e),e=l;t&&n.appendChild(t)}else if(o>0){for(h=n.childNodes,f=0,a=h.length;f<a;f++)if(h[f]===t)break;for(v=f-o,f=0;f<o;f++)s=h[v],wt(s,s,"deleted","template"),Sys.Application.disposeElement(s,!1),n.removeChild(s)}};ba=!0}if(!ka&&n.Sys&&Sys.WebForms&&Sys.WebForms.PageRequestManager&&(Sys.WebForms.PageRequestManager.getInstance().add_pageLoading(function(n,t){nv=!0;var i=t.get_panelsUpdating();i.length>0&&wt(null,i,"deleted","updatePanel")}),Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(function(n,t){var i,r;nv&&(i=t.get_panelsCreated(),i.length>0&&wt(null,i,"added","updatePanel"));r=t.get_panelsUpdated();r.length>0&&wt(null,r,"added","updatePanel")}),ka=!0),!da&&n.ExoWeb&&ExoWeb.UI&&ExoWeb.UI.Toggle){if(u=ExoWeb.UI.Toggle.prototype.undo_render,!u)throw new Error("Could not find Toggle.undo_render method to override.");if(ExoWeb.UI.Toggle.prototype.undo_render=function(){var n=this._element.children;n.length>0&&wt(this._element,n,"deleted","template");u.apply(this,arguments)},f=ExoWeb.UI.Toggle.prototype.do_dispose,!f)throw new Error("Could not find Toggle.do_dispose method to override.");ExoWeb.UI.Toggle.prototype.do_dispose=function(){var n=this._element.children;n.length>0&&wt(this._element,n,"deleted","template");f.apply(this,arguments)};da=!0}if(!ga&&n.ExoWeb&&ExoWeb.UI&&ExoWeb.UI.Content){if(e=ExoWeb.UI.Content.prototype._render,!e)throw new Error("Could not find Content._render method to override.");ExoWeb.UI.Content.prototype._render=function(){if(this._element){var n=this._element.children;n.length>0&&wt(this._element,n,"deleted","template")}e.apply(this,arguments)};ga=!0}}function yh(){return rv+(dt.appRoot||nr)+"ExoWeb.axd"}function br(n){n.data.config=dt;r.ajax({url:yh()+"/"+n.path,type:n.type,data:JSON.stringify(n.data),processData:!1,dataType:"text",contentType:"application/json",success:function(t){n.onSuccess(JSON.parse(t))},error:function(t){var i={message:t.statusText};try{i=JSON.parse(t.responseText)}catch(r){}n.onFailure(i)}})}function uv(n,t){var i=n.__propertyChangeHandlers[t.get_propertyName()];i&&i instanceof Function&&i.apply(this,arguments)}var bf={debug:!1,signalTimeout:!1,signalMaxBatchSize:null,individualQueryLoading:!1,appInstanceId:"?",autoActivation:!0,allowTypeLazyLoading:!0,allowObjectLazyLoading:!0,allowListLazyLoading:!0,expressionScope:null,calculationErrorDefault:undefined,autoReformat:!0,enableBatchChanges:!0,detectRunawayRules:!1,nonExitingScopeNestingCount:100},kf,pu,vo,gf,ph,wh,kh,te,tc,uc,ko,ie,re,yi,go,ue,b,bc,oe,se,he,rl,e,fl,o,wi,el,ae,du,ve,yt,pe,ou,su,we,ss,al,hs,cs,ls,as,vs,ys,ps,ws,ct,li,ro,tt,dl,uf,d,yr,th,ef,eo,fh,oo,ua,so,fa,ai,hf,ea,oh,sa,yf,lh,ah,vh,tv,pf,dt,nr,wf,iv,rv,ao;ExoWeb.config=bf;ExoWeb.windowIsUnloading=!1;n.addEventListener?n.addEventListener("unload",function(){ExoWeb.windowIsUnloading=!0},!1):n.attachEvent&&n.attachEvent("onunload",function(){ExoWeb.windowIsUnloading=!0});h.prototype=new Error;h.prototype.constructor=h;ExoWeb.ArgumentTypeError=h;n.ArgumentTypeError=h;vt.prototype=new Error;vt.prototype.constructor=vt;ExoWeb.ArgumentsLengthError=vt;n.ArgumentsLengthError=vt;l.prototype=new Error;l.prototype.constructor=l;ExoWeb.ArgumentNullError=l;n.ArgumentNullError=l;tr.prototype=new Error;tr.prototype.constructor=tr;ExoWeb.ArgumentError=tr;n.ArgumentError=tr;kf=null;ExoWeb.setLogErrorProvider=fv;pu=[];ExoWeb.addError=ev;ExoWeb.removeError=ov;ExoWeb.logError=sv;vo=n.onerror;n.onerror=function(t,i,r,u,f){return!n.ExoWeb||ExoWeb.windowIsUnloading?!1:vo&&vo.apply(this,arguments)===!0?!0:(df(t,i,r,u,f,null,!0),!1)};gf=function(n){typeof console!="undefined"&&console.warn&&console.warn(n)};ExoWeb.setLogWarningProvider=hv;ExoWeb.logWarning=c;ph=/\s([a-z|A-Z]+)/;ExoWeb.type=oi;ExoWeb.isNullOrUndefined=wu;ExoWeb.isArray=yo;ExoWeb.isString=ir;ExoWeb.isNumber=ne;wh=/^-?[0-9]{1,10}$/;ExoWeb.isInteger=rr;ExoWeb.isNatural=bh;ExoWeb.isWhole=cv;kh=/^-?[0-9]+\.[0-9]+$/;ExoWeb.isDecimal=lv;ExoWeb.isFunction=po;ExoWeb.isBoolean=dh;ExoWeb.isDate=av;ExoWeb.isObject=gh;ExoWeb.randomInteger=nc;ExoWeb.randomText=wo;for(tc in{})if(tc=="toString"){te=[];break}te||(te=["toString","toLocaleString","valueOf"]);Function.prototype.mixin=function(n,t){var i,r;t||(t=this.prototype);for(i in n)r=n[i],n.hasOwnProperty(i)&&ic(t,i,r);te.forEach(function(i){var r=n[i];n.hasOwnProperty(i)&&ic(t,i,r)})};Function.prototype.dontDoubleUp=function(n){var i=this,t=[];return function(){var u,c,e,y,s,l,r,h,o,a,f,v,p,w,b,k;if(k=Array.prototype.slice.call(arguments),n.callbackArg<arguments.length&&(s=arguments[n.callbackArg]),n.thisPtrArg<arguments.length&&(l=arguments[n.thisPtrArg]),n.partitionedArg!==null&&n.partitionedArg!==undefined){if(r=arguments[n.partitionedArg],!(r instanceof Array))throw new Error("The partitioned argument must be an array.");r=r.copy();h=-1}if(o=[],n.groupBy&&n.groupBy instanceof Array)for(u=0,c=n.groupBy.length;u<c;u++)r!==undefined&&n.groupBy[u]===n.partitionedArg&&(h=o.length),o.push(arguments[n.groupBy[u]]);else if(n.groupBy!==null&&n.groupBy!==undefined)o.push(arguments[n.groupBy]),n.groupBy===n.partitionedArg&&(h=0);else for(u=0,c=arguments.length;u<c;++u)u!==n.callbackArg&&u!==n.thisPtrArg&&(r!==undefined&&u===n.partitionedArg&&(h=o.length),o.push(arguments[u]));if(h===-1)throw new Error("Invalid partitionedArg option.");for(a=[],u=0,c=t.length;(r===undefined||r.length>0)&&u<c;u++)if(f=t[u],o.length==f.groupBy.length){for(v=this===f.context,e=0,y=o.length;v&&e<y;e++)e===h?v=f.groupBy[e].some(function(n){return r.indexOf(n)>=0}):o[e]!==f.groupBy[e]&&(v=!1);if(v){if(w=[],r!==undefined)for(p=f.groupBy[h],e=0,y=p.length;e<y;e++)b=r.indexOf(p[e]),b>=0&&(w.push(p[e]),r.splice(b,1));a.push({call:f,partitioned:w})}}(a.length===0||r!==undefined&&r.length>0)&&(f={callback:nt(),groupBy:o,context:this},t.push(f),f.callback.add(function(){if(t.indexOf(f)<0)throw new Error("Call not found.");s&&s.apply(l||this,arguments);n.memoize===!0?(f.complete=!0,f.response={thisPtr:this,args:Array.prototype.slice.call(arguments)}):t.remove(f)}),newArgs=k.slice(),r!==undefined&&r.length>0&&(newArgs[n.partitionedArg]=r),newArgs[n.callbackArg]=f.callback,f.args=newArgs,i.apply(this,newArgs));a.length>0&&s&&kr(a,function(t){var r,i;n.partitionedFilter&&(r=k.slice(),r[n.partitionedArg]=t.partitioned,r[n.callbackArg]=s);t.call.complete===!0?(n.partitionedFilter?(i=Array.prototype.slice.call(t.call.response.args),n.partitionedFilter.call(l||this,t.call.args,r,i)):i=t.call.response.args,s.apply(l||t.call.response.thisPtr,i)):t.call.callback.add(function(){n.partitionedFilter?(i=Array.prototype.slice.call(arguments),n.partitionedFilter.call(l||this,t.call.args,r,i)):i=arguments;s.apply(l||this,i)})})}};Function.prototype.cached=function(n){var i=this,t={},r=n&&n.key||function(n){return n};return function(){var n=r.apply(this,arguments);return t.hasOwnProperty(n)?t[n]:t[n]=i.apply(this,arguments)}};Function.prototype.bind||(Function.prototype.bind=vv);Function.prototype.prepare=function(n,t){var i=this;return function(){return i.apply(n||this,t||[])}};Function.prototype.prependArguments=function(){var n=this,t=Array.prototype.slice.call(arguments);return function(){var i=[];return Array.prototype.push.apply(i,t),Array.prototype.push.apply(i,Array.prototype.slice.call(arguments)),n.apply(this,i)}};Function.prototype.appendArguments=function(){var n=this,t=Array.prototype.slice.call(arguments);return function(){var i=Array.prototype.slice.call(arguments);return Array.prototype.push.apply(i,t),n.apply(this,i)}};Function.prototype.spliceArguments=function(){var n=this,t=arguments;return function(){var i=Array.prototype.slice.call(arguments);return i.splice.apply(i,t),n.apply(this,i)}};Function.prototype.sliceArguments=function(){var n=this,t=arguments;return function(){var i=Array.prototype.slice.call(arguments);return i=i.slice.apply(i,t),n.apply(this,i)}};uc=/function\s*([\w_\$]*)/i;Array.prototype.addRange||(Array.prototype.addRange=function(n){fc(this,n)});Array.prototype.copy||(Array.prototype.copy=function(){return bo(this)});Array.prototype.clear||(Array.prototype.clear=function(){this.length=0});Array.prototype.contains||(Array.prototype.contains=function(n){return wv(this,n,arguments[1])});Array.prototype.dequeue||(Array.prototype.dequeue=function(){return this.shift()});Array.prototype.distinct||(Array.prototype.distinct=function(){return ec(this)});Array.prototype.every||(Array.prototype.every=function(n){return bv(this,n,arguments[1])});Array.prototype.fill||(Array.prototype.fill=function(n,t){return kv(this,n,t)});Array.prototype.filter||(Array.prototype.filter=function(n){return ur(this,n,arguments[1])});Array.prototype.first||(Array.prototype.first=function(n){return oc(this,n,arguments[1])});Array.prototype.forEach||(Array.prototype.forEach=function(n){kr(this,n,arguments[1])});Array.prototype.indexOf||(Array.prototype.indexOf=function(n){return dv(this,n,arguments[1])});Array.prototype.intersect||(Array.prototype.intersect=function(n){return sc(this,n)});Array.prototype.last||(Array.prototype.last=function(n){return ny(this,n,arguments[1])});Array.prototype.lastIndexOf||(Array.prototype.lastIndexOf=function(n){return ty(this,n,arguments[1])});Array.prototype.map||(Array.prototype.map=function(n){return hc(this,n,arguments[1])});Array.prototype.mapToArray||(Array.prototype.mapToArray=function(n){return iy(this,n,arguments[1])});Array.prototype.peek||(Array.prototype.peek=function(){return ry(this)});Array.prototype.purge||(Array.prototype.purge=function(n){return dr(this,n,arguments[1])});Array.prototype.reduce||(Array.prototype.reduce=function(n,t){return uy(this,n,t)});Array.prototype.remove||(Array.prototype.remove=function(n){return fy(this,n)});Array.prototype.single||(Array.prototype.single=function(n){return ey(this,n,arguments[1])});Array.prototype.some||(Array.prototype.some=function(n){return oy(this,n,arguments[1])});typeof String.prototype.trim!="function"&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")});var lc=!1,ac=document.getElementsByTagName("script"),hy=ac[ac.length-1].src,bu,vc=/[?&]cachehash=([^&]*)/i.exec(hy);vc&&(bu=vc[1]);ExoWeb.cacheHash=bu;ko=!1;try{ie="c-localStorage";n.localStorage.setItem(ie,ie);n.localStorage.removeItem(ie);ko=!0}catch(vb){}ko?(ExoWeb.cache=function(t,i){var r=t,u;if(lc||(lc=!0,n.localStorage.getItem("cacheHash")&&n.localStorage.clear(),bu&&ExoWeb.cache("cacheHash")!=bu&&(ExoWeb.clearCache(),ExoWeb.cache("cacheHash",bu))),r="ExoWeb:cache:"+ExoWeb.config.appInstanceId+":"+r,arguments.length==1)return i=n.localStorage.getItem(r),i?JSON.parse(i):null;if(arguments.length==2){u=JSON.stringify(i);try{n.localStorage.setItem(r,u)}catch(f){c(f.message)}return i}},ExoWeb.clearCache=function(){n.localStorage.clear()}):(ExoWeb.cache=function(){return null},ExoWeb.clearCache=function(){});re=[];ExoWeb.registerActivity=er;ExoWeb.isBusy=cy;ExoWeb.getBusyItems=yc;var ly=0,pc=[],ft=null;er("Batch",function(){return s.all().length>0});s.all=function(n){return pc.filter(function(t){return n||!t.isEnded()})};s.current=function(){return ft};s.suspendCurrent=function(){if(ft!==null){var n=ft;return ft=null,n}};s.start=function(n){return ft?ft._begin(n):ft=new s(n),ft};s.resume=function(n){n&&(n._transferredTo||n)._resume()};s.end=function(n){(n._transferredTo||n)._end()};s.whenDone=function(n,t){ft?ft.whenDone(n,t):n.call(t||this)};s.current=function(){return ft};s.mixin({_begin:function(n){return this._labels.push(n),this},_end:function(){var t,n;if(this.isEnded())return this;if(t=this._labels.pop(),this.isEnded())for(ft===this&&(ft=null),n=this._subscribers.dequeue();n;)n.fn.apply(n.thisPtr||this,arguments),n=this._subscribers.dequeue();return this},_transferTo:function(n){n._labels.addRange(this._labels);this._labels.clear();n._subscribers.addRange(this._subscribers);this._subscribers.clear();this._transferredTo=n},_resume:function(){if(!this.isEnded())return ft!==null?(this._transferTo(ft),ft):(ft=this,this)},isEnded:function(){return this._labels.length===0},whenDone:function(n,t){return this._subscribers.push({fn:n,thisPtr:t}),this}});ExoWeb.Batch=s;yi=null;go=function go(){n.setTimeout(function(){var n,t=ne(bf.signalMaxBatchSize)?bf.signalMaxBatchSize:null;t&&yi.length>t?(n=yi.splice(0,t),go()):(n=yi,yi=null);n.forEach(pv)},1)};et.mixin({pending:function(n,t,i){return this._pending===0&&et.allPending.push(this),this._pending++,this._genCallback(n,t,i)},orPending:function(n,t,i){return this._genCallback(n,t,i)},_doCallback:function(){ay.apply(this,arguments)},_genCallback:function(n,t,i){var r=this,u=!1;return function(){r._doCallback("pending",t||this,function(){if(u)throw new Error("("+r._debugLabel+") signal callback was called more than once.");u=!0;n&&n.apply(this,arguments);r.oneDone()},arguments,i)}},waitForAll:function(n,t,i){n&&(this._pending===0?this._doCallback("waitForAll",t,n,[],i):this._waitForAll.push({callback:n,thisPtr:t,executeImmediately:i}))},oneDone:function(){for(--this._pending,this._pending===0&&et.allPending.remove(this);this._pending===0&&this._waitForAll.length>0;){var n=this._waitForAll.dequeue();this._doCallback("waitForAll",n.thisPtr,n.callback,[],n.executeImmediately)}},isActive:function(){return this._pending>0}});et.allPending=[];et.begin=function(n){return new et(n)};ExoWeb.Signal=et;ue=0;er("Functor",function(){return ue>0});nt.eventing={_addEvent:function(n,t,i,r){return this["_"+n]||(this["_"+n]=new nt),this["_"+n].add(t,i,r),t},_removeEvent:function(n,t){var i=this["_"+n];return i?(i.remove(t),!0):!1},_raiseEvent:function(n,t){var i=this["_"+n];if(i)try{ue++;i.apply(this,t||[])}finally{ue--}},_clearEvent:function(n){var t="_"+n;this.hasOwnProperty(t)&&(this[t]=null)},_getEventHandler:function(n){return this["_"+n]}};ExoWeb.Functor=nt;gr.prepare=function(){var n,t=null;return arguments.length===0?n=[]:arguments.length===1&&arguments[0]instanceof Array?n=arguments[0]:arguments.length===2&&arguments[0]instanceof Array?(n=arguments[0],t=arguments[1]):n=Array.prototype.slice.call(arguments),function(i,r){var u=new gr(n,t||this);u.invoke(i,r)}};gr.forEachAsync=function(n,t,i){if(n.length===0){i&&i();return}var r=new gr(n.map(function(n){return function(i,r){t.call(r||this,n,i,r||this)}}));r.invoke(i)};gr.mixin({invoke:function(n,t){wc.call(this,0,n,t)}});ExoWeb.FunctionChain=gr;b=null;fe.mixin(nt.eventing);fe.mixin({abort:function(){if(!this.isActive)throw new Error("The event scope cannot be aborted because it is not active.");try{var n=this._getEventHandler("abort");n&&!n.isEmpty()&&n();this._clearEvent("abort");this._clearEvent("exit")}finally{if(this.isActive=!1,b&&b===this)while(b&&!b.isActive)b=b.parent}},exit:function(){var t,i;if(!this.isActive)throw new Error("The event scope cannot be exited because it is not active.");try{if(t=this._getEventHandler("exit"),t&&!t.isEmpty()){if(this.parent!==null&&this.parent.isActive){if(typeof n.ExoWeb.config.nonExitingScopeNestingCount=="number"&&(i=n.ExoWeb.config.nonExitingScopeNestingCount-1,this.parent.hasOwnProperty("_exitEventVersion")&&this.parent._exitEventVersion>=i)){this.abort();c("Event scope 'exit' subscribers were discarded due to non-exiting.");return}this.parent._addEvent("exit",t);this.parent.hasOwnProperty("_exitEventVersion")&&this.parent._exitEventVersion++}else this._exitEventVersion=0,this._exitEventHandlerCount=t._funcs.length,t(),delete this._exitEventHandlerCount,delete this._exitEventVersion;this._clearEvent("exit");this._clearEvent("abort")}}finally{if(this.isActive=!1,b&&b===this)while(b&&!b.isActive)b=b.parent}}});bc={onExit:nu,onAbort:ns,perform:ee};ExoWeb.EventScope=bc;ts.mixin({get:function(t){var i=ri(this.value,t);if(i===undefined&&(i=n[t]),i===undefined)throw new TypeError(t+" is undefined");return new ts(i)}});ExoWeb.EvalWrapper=ts;var by=function(n){var t=["true","false","$index","null"];return n=n.replace(/(([a-z_$][0-9a-z_$]*)([.]?))|(('([^']|\')*')|("([^"]|\")*"))/gi,function(n,i,r,u,f){return f!==undefined&&f!==null&&f.length>0||t.indexOf(r)>=0?n:r==="$item"?u?"":r:u.length>0?"get('"+r+"')"+u:"get('"+r+"').value"}),new Function("$item","$index","with(new ExoWeb.EvalWrapper($item)){ return ("+n+");}")}.cached(),rs=function(n){return new Function("$item","$index","return ExoWeb.evalPath($item, '"+n+"');")}.cached(),kc=function(n){return new Function("$item","$index","return ExoWeb.evalPath($item, '"+n+"');")}.cached(),dc=function(n){return new Function("$item","$index","return ExoWeb.evalPath($item, '"+n+"');")}.cached(),ky=function(n){function i(n,t){return n!==null&&n!==undefined&&n.constructor===String&&t!==null&&t!==undefined&&t.constructor===String&&(n=n.toLowerCase(),t=t.toLowerCase()),n<t}var t=[];return n.replace(/\s*([a-z0-9_.]+)(\s+null)?(\s+(asc|desc))?(\s+null)? *(,|$)/gi,function(n,i,r,u,f,e){var o=r!==undefined&&r!==null&&r.length>0,s=e!==undefined&&e!==null&&e.length>0;t.push({path:i,ab:f==="desc"?1:-1,nulls:s||!u&&o?1:-1})}),function(n,r){for(var f=0;f<t.length;++f){var u=t[f],e=sr(n,u.path,null,null),o=sr(r,u.path,null,null);if(e===null&&o!==null)return u.nulls;if(e!==null&&o===null)return-u.nulls;if(i(e,o))return u.ab;if(i(o,e))return-u.ab}return 0}}.cached(),pi={where:function(n,t,i){var r=t instanceof Function?t:by(t);return n.filter(r,i)},select:function(n,t,i){var r=t instanceof Function?t:rs(t);return n.map(r,i)},selectMany:function(n,t,i){var r=t instanceof Function?t:rs(t);return n.mapToArray(r,i)},groupBy:function(n,t,i){for(var u,h=t instanceof Function?t:dc(t),r=[],c=n.length,f=0;f<c;f++){var e=n[f],s=h.apply(i||e,[e,f]),o=null;for(u=0;u<r.length;++u)if(r[u].group==s){o=r[u];o.items.push(e);break}o||r.push(new is(s,[e]))}return r},orderBy:function(n,t,i){var r=t instanceof Function?t:ky(t);return n.copy().sort(i?r.bind(i):r)}};or.mixin({input:function(){return this._array||this},where:function(n,t){var i=pi.where(this.input(),n,t);return ku(i,this,"where",n,t)},select:function(n,t){var i=pi.select(this.input(),n,t);return ku(i,this,"select",n,t)},selectMany:function(n,t){var i=pi.selectMany(this.input(),n,t);return ku(i,this,"selectMany",n,t)},groupBy:function(n,t){var i=pi.groupBy(this.input(),n,t);return this._livePending&&i.forEach(function(n){ExoWeb.Observer.makeObservable(n.items)}),ku(i,this,"groupBy",n,t)},orderBy:function(n,t){var i=pi.orderBy(this.input(),n,t);return ku(i,this,"orderBy",n,t)},live:function(){for(var n,u=[],r,t=this;t;t=t._prior)t._prior?u.splice(0,0,t):r=t;return this._livePending!==!0?dy(u,r.input(),!0).live():(n=this.input().copy(),ExoWeb.Observer.makeObservable(n),n.rootInput=this.rootInput,ExoWeb.Observer.addCollectionChanged(r.input(),function(t,f){var s,o,e,h=[];s=f.get_changes().map(function(n){return{action:n.action,oldItems:n.oldItems?n.oldItems.copy():null,oldStartingIndex:n.oldStartingIndex,newItems:n.newItems?n.newItems.copy():null,newStartingIndex:n.newStartingIndex}});o=r.input().copy();u.forEach(function(n){var r,t,u;e=n.input();n._transform.method==="where"?s.purge(function(t){var f,s,r,i,u;if(t.oldItems){if(f=t.oldItems,t.oldItems=pi[n._transform.method](t.oldItems,n._transform.arg,n._transform.thisPtr),t.oldItems.length===0)return t.oldItems=null,t.oldStartingIndex=null,!0;t.oldStartingIndex=e.indexOf(t.oldItems[0]);e.splice(t.oldStartingIndex,t.oldItems.length)}else if(t.newItems){if(s=t.newItems,t.newItems=pi[n._transform.method](t.newItems,n._transform.arg,n._transform.thisPtr),t.newItems.length===0)return t.newItems=null,t.newStartingIndex=null,!0;if(t.newStartingIndex!==0&&t.newStartingIndex+t.newItems.length!==o.length){for(r=!1,i=t.newStartingIndex-1;!r&&i>=0;i--)e.indexOf(o[i])>=0&&(r=!0);t.newStartingIndex=i+1}u=t.newItems.copy();u.splice(0,0,t.newStartingIndex,0);Array.prototype.splice.apply(e,u)}else return!0}):n._transform.method==="select"?s.forEach(function(t){var r,i;t.oldItems?t.oldItems=e.splice(t.oldStartingIndex,t.oldItems.length):t.newItems&&(r=n._transform.arg instanceof Function?n._transform.arg:rs(n._transform.arg),t.newItems=t.newItems.map(function(t){return r.call(n._transform.thisPtr||t,t)}),i=t.newItems.copy(),i.splice(0,0,t.newStartingIndex,0),Array.prototype.splice.apply(e,i))}):n._transform.method==="selectMany"?s.forEach(function(t){var i,r;if(t.oldItems){var i=n._transform.arg instanceof Function?n._transform.arg:kc(n._transform.arg),f=t.oldItems.mapToArray(function(t){return i.call(n._transform.thisPtr||t,t)}),s=o.slice(0,t.oldStartingIndex),u=s.mapToArray(function(t){return i.call(n._transform.thisPtr||t,t)});t.oldItems=e.splice(u.length,f.length);t.oldStartingIndex=u.length}else t.newItems&&(i=n._transform.arg instanceof Function?n._transform.arg:kc(n._transform.arg),t.newItems=t.newItems.mapToArray(function(t){return i.call(n._transform.thisPtr||t,t)}),r=t.newItems.copy(),r.splice(0,0,t.newStartingIndex,0),Array.prototype.splice.apply(e,r))}):n._transform.method==="groupBy"?(r=n._transform.arg instanceof Function?n._transform.arg:dc(n._transform.arg),t=e.copy(),s.forEach(function(u){u.oldItems?u.oldItems.forEach(function(u){var c=r.call(n._transform.thisPtr||u,u),f=t.filter(function(n){return n.group===c})[0],s;if(h.indexOf(f.items)<0&&(f.items.beginUpdate(),h.push(f.items)),s=f.items.indexOf(u),f.items.remove(u),s===0){var l=t.indexOf(f),a=o.indexOf(f.items[0]),e=null;for(i=0;i<t.length;i++)if(a>o.indexOf(t[i].items[0])){e=i+1;break}e!==null&&(t.splice(l,1),t.splice(e,0,f))}f.items.length===0&&t.splice(t.indexOf(f),1)}):u.newItems&&u.newItems.forEach(function(i){var a=r.call(n._transform.thisPtr||i,i),u=t.filter(function(n){return n.group===a})[0],s,e,c=!1,l,f;if(u){for(h.indexOf(u.items)<0&&(u.items.beginUpdate(),h.push(u.items)),s=o.indexOf(i),e=null,f=0;f<u.items.length;f++)if(s<o.indexOf(u.items[f])){e=f;break}e!==null?(u.items.insert(e,i),e===0&&(c=!0)):u.items.add(i)}else u=new is(a,[i]),ExoWeb.Observer.makeObservable(u.items),t.push(u),c=!0;if(c===!0){for(l=t.indexOf(u),s=o.indexOf(u.items[0]),e=null,f=0;f<l;f++)if(s<o.indexOf(t[f].items[0])){e=f;break}e!==null&&(t.splice(l,1),t.splice(e,0,u))}})}),s=fr(e,t,!0)):n._transform.method==="orderBy"&&(u=pi[n._transform.method](o,n._transform.arg,n._transform.thisPtr),s=fr(e,u,!0));o=e});n.beginUpdate();s.forEach(function(t){t.oldItems?n.removeRange(t.oldStartingIndex,t.oldItems.length):t.newItems&&n.insertRange(t.newStartingIndex,t.newItems)});n.endUpdate();h.forEach(function(n){n.endUpdate()})}),r._liveComplete=!0,u.forEach(function(n){n._liveComplete=!0}),n)}});ExoWeb.Transform=or;n.$transform=function(n,t){return new or(n,t)};us.prototype={lookup:function(n,t,i){if(n[t])return n[t][i]||null},forward:function(n,t){return this.lookup(this._forwardDictionary,n,t)},reverse:function(n,t){return this.lookup(this._reverseDictionary,n,t)},add:function(n,t,i){var r=arguments.length==4&&arguments[3].constructor===Boolean?arguments[3]:!1;this._forwardDictionary[n]||(this._forwardDictionary[n]={});this._forwardDictionary[n][t]=i;r||(this._reverseDictionary[n]||(this._reverseDictionary[n]={}),this._reverseDictionary[n][i]=t)}};ExoWeb.Translator=us;oe=!1;try{Object.prototype.__defineGetter__&&!Object.defineProperty?(Object.defineProperty=function(n,t,i){var r;"get"in i&&n.__defineGetter__(t,i.get);"set"in i&&n.__defineSetter__(t,i.set);"get"in i||"set"in i||(i.writable?(r=i.value,n.__defineGetter__(t,function(){return r}),n.__defineSetter__(t,function(n){r=n})):(r=i.value,n.__defineGetter__(t,function(){return r})))},oe=!0):Object.defineProperty&&Object.defineProperty({},"x",{get:function(){return!0}}).x?oe=!0:gc()}catch(vb){gc()}ExoWeb.evalPath=sr;ExoWeb.getLastTarget=nl;n.$lastTarget=nl;ExoWeb.getValue=ri;ExoWeb.getCtor=tl;ExoWeb.isType=lt;ExoWeb.eachProp=hr;ExoWeb.objectToArray=np;n.$format=f;ExoWeb.makeHumanReadable=il;ui.mixin({totalSeconds:{get:function(){return this.totalMilliseconds/1e3},init:!0},totalMinutes:{get:function(){return this.totalSeconds/60},init:!0},totalHours:{get:function(){return this.totalMinutes/60},init:!0},totalDays:{get:function(){return this.totalHours/24},init:!0},milliseconds:{get:function(){return Math.floor(this.totalMilliseconds%1e3)},init:!0},seconds:{get:function(){return Math.floor(this.totalSeconds%60)},init:!0},minutes:{get:function(){return Math.floor(this.totalMinutes%60)},init:!0},hours:{get:function(){return Math.floor(this.totalHours%24)},init:!0},days:{get:function(){return Math.floor(this.totalDays)},init:!0},toObject:function(){return{Hours:this.hours,Minutes:this.minutes,Seconds:this.seconds,Milliseconds:this.milliseconds,Ticks:this.totalMilliseconds*1e4,Days:this.days,TotalDays:this.totalDays,TotalHours:this.totalHours,TotalMilliseconds:this.totalMilliseconds,TotalMinutes:this.totalMinutes,TotalSeconds:this.totalSeconds}},valueOf:function(){return this.totalMilliseconds},toString:function(){var n,t;return this.totalHours<1?(n=Math.round(this.totalMinutes),t="minute"):this.totalDays<1?(n=Math.round(this.totalHours*100)/100,t="hour"):(n=Math.round(this.totalDays*100)/100,t="day"),n==1?n+" "+t:n+" "+t+"s"}});n.TimeSpan=ui;Date.mixin({subtract:function(n){return new ui(this-n)},add:function(n){return new Date(this.getTime()+n.totalMilliseconds)}});se={};he=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];he.forEach(function(n,t){se[n]=t});Date.prototype.toDate=function(){return new Date(this.getFullYear(),this.getMonth(),this.getDate())};Date.prototype.addYears=function(n){return new Date(this.getFullYear()+n,this.getMonth(),this.getDate(),this.getHours(),this.getMinutes(),this.getSeconds(),this.getMilliseconds())};Date.prototype.addDays=function(n,t){var i=new Date(this.getFullYear(),this.getMonth(),this.getDate()+n,this.getHours(),this.getMinutes(),this.getSeconds(),this.getMilliseconds());return t===!0&&(i.getDay()===0?i.setDate(i.getDate()+(n>=0?1:-2)):i.getDay()===6&&i.setDate(i.getDate()+(n>=0?2:-1))),i};rl=36e5;Date.prototype.addHours=function(n){return new Date(+this+rl*n)};Date.prototype.startOfWeek=function(n){var t=ul(n)||se.monday;return this.addDays(t-this.getDay())};Date.prototype.weekOfYear=function(n){var f=ul(n)||se.monday,r,t,u,e,i;if(this.startOfWeek(f).getYear()<this.getYear())return 0;for(r=new Date(this.getFullYear(),0,1),t=r.startOfWeek(f),t.getFullYear()<r.getFullYear()&&(t=t.addDays(7)),u=0,e=this.toDate(),i=t;i<=e;i=i.addDays(7))u++;return u};Date.prototype.weekDifference=function(n,t){var o=n<=this,u=this,f=n,e,i,r;for(o&&(u=n,f=this),e=u.weekOfYear(t),i=f.weekOfYear(t),r=u.getFullYear();r<f.getFullYear();r++)i+=new Date(r,11,31).weekOfYear(t);return o?e-i:i-e};Object.copy=function(n,t){var u,f,i,e,o,r;if(t||(t={}),t.maxLevel||(t.maxLevel=25),u=arguments.length>2?arguments[2]:0,u>=t.maxLevel||typeof n!="object"||n===null||n===undefined)return n;if(n instanceof Array){for(f=[],i=0;i<n.length;i++)f.push(Object.copy(n[i]));return f}if(e=n.valueOf(),n!=e)return new n.constructor(e);if(typeof v!="undefined"&&n instanceof v)return n;o={};for(r in n)o[r]=t.copyChildren?Object.copy(n[r],t,u+1):n[r];return o};e={};e.addPathChanged=function(n,t,i,r){function s(t,r,o){function l(n){var t=new ce(r);c.push(t);o===0&&f.push(t);t.start(n,i);o+1<u.length&&s(t,u[o+1],o+1)}function a(n){for(var i,t=0;t<c.length;t++)i=c[t],i._source===n&&(Array.removeAt(c,t--),o===0&&Array.remove(f,i),i.stop())}var c=[],h;t&&(t._addEvent("valueCaptured",l),t._addEvent("valueReleased",a));h=o===0?n:t.value();h!==undefined&&h!==null&&(h instanceof Array?(Array.forEach(h,l),o===0&&e.addCollectionChanged(h,function(n,t){var r=t.get_changes();Array.forEach(r.removed||[],a);Array.forEach(r.added||[],l);i()})):l(h))}var u,f,o;if(n==null){if(r===!0)return;throw new l("target","'allowNoTarget' is false - path = \""+(t instanceof Array?t.join("."):t)+'"');}n.__pathChangeHandlers||(n.__pathChangeHandlers={});u=t;t instanceof Array?t=t.join("."):u=t.split(".");f=[];s(null,u[0],0);o=n.__pathChangeHandlers[t];o||(n.__pathChangeHandlers[t]=o=[]);o.push({roots:f,handler:i})};e.removePathChanged=function(n,t,i){var r,u,f;if(t=t instanceof Array?t.join("."):t,r=n.__pathChangeHandlers?n.__pathChangeHandlers[t]:null,r&&(r.purge(function(n){if(n.handler===i)return Array.forEach(n.roots,function(n){n.stop()}),!0}),r.length===0)){delete n.__pathChangeHandlers[t];u=!1;for(f in n.__pathChangeHandlers)n.__pathChangeHandlers.hasOwnProperty(f)&&(u=!0);u||(n.__pathChangeHandlers=null)}};fl={makeObservable:function(){throw new Error("Observable provider has not been implemented. Call ExoWeb.Model.setObservableProvider().");},disposeObservable:function(){throw new Error("Observable provider has not been implemented. Call ExoWeb.Model.setObservableProvider().");},addCollectionChanged:function(){throw new Error("Observable provider has not been implemented. Call ExoWeb.Model.setObservableProvider().");},removeCollectionChanged:function(){throw new Error("Observable provider has not been implemented. Call ExoWeb.Model.setObservableProvider().");},addPropertyChanged:function(){throw new Error("Observable provider has not been implemented. Call ExoWeb.Model.setObservableProvider().");},removePropertyChanged:function(){throw new Error("Observable provider has not been implemented. Call ExoWeb.Model.setObservableProvider().");},raisePropertyChanged:function(){throw new Error("Observable provider has not been implemented. Call ExoWeb.Model.setObservableProvider().");},setValue:function(){throw new Error("Observable provider has not been implemented. Call ExoWeb.Model.setObservableProvider().");}};ExoWeb.Observer=e;ce.mixin(nt.eventing);ce.mixin({value:function(){return ExoWeb.getValue(this._source,this._prop)},release:function(n){n instanceof Array?Array.forEach(n,function(n){this._raiseEvent("valueReleased",[n])},this):this._raiseEvent("valueReleased",[n])},capture:function(n){if(n instanceof Array){Array.forEach(n,function(n){this._raiseEvent("valueCaptured",[n])},this);var t=this;this._collectionTarget!==undefined&&this._collectionTarget!==null&&e.removeCollectionChanged(this._collectionTarget,this._collectionHandler);this._collectionTarget=n;this._collectionHandler=function(n,i){var r=i.get_changes();t._handler.apply(this,arguments);Array.forEach(r.removed||[],function(n){t._raiseEvent("valueReleased",[n])});Array.forEach(r.added||[],function(n){t._raiseEvent("valueCaptured",[n])})};e.addCollectionChanged(this._collectionTarget,this._collectionHandler)}else this._raiseEvent("valueCaptured",[n])},start:function(n,t){var r,i;if(this._source)throw new Error("Cannot start an observer that is already started.");r=this;this._source=n;this._handler=t;i=this.value();this._propHandler=function(){r._handler.apply(this,arguments);i!==undefined&&i!==null&&r.release(i);i=r.value();i!==undefined&&i!==null&&r.capture(i)};e.addPropertyChanged(this._source,this._prop,this._propHandler);i!==undefined&&i!==null&&this.capture(i)},stop:function(){if(this._source){if(e.removePropertyChanged(this._source,this._prop,this._propHandler),this._collectionTarget!==undefined&&this._collectionTarget!==null)e.removeCollectionChanged(this._collectionTarget,this._collectionHandler),this.release(this._collectionTarget);else{var n=this.value();n!==undefined&&n!==null&&this.release(n)}this._source=null}}});ExoWeb.PropertyObserver=ce;o={"allowed-values":"{property} is not in the list of allowed values.","compare-after":"{property} must be after {compareSource}.","compare-before":"{property} must be before {compareSource}.","compare-equal":"{property} must be the same as {compareSource}.","compare-greater-than":"{property} must be greater than {compareSource}.","compare-greater-than-or-equal":"{property} must be greater than or equal to {compareSource}.","compare-less-than":"{property} must be less than {compareSource}.","compare-less-than-or-equal":"{property} must be less than or equal to {compareSource}.","compare-not-equal":"{property} must be different from {compareSource}.","compare-on-or-after":"{property} must be on or after {compareSource}.","compare-on-or-before":"{property} must be on or before {compareSource}.","listlength-at-least":"Please specify at least {min} {property}.","listlength-at-most":"Please specify no more than {max} {property}.","listlength-between":"Please specify between {min} and {max} {property}.","range-at-least":"{property} must be at least {min}.","range-at-most":"{property} must be at most {max}.","range-between":"{property} must be between {min} and {max}.","range-on-or-after":"{property} must be on or after {min}.","range-on-or-before":"{property} must be on or before {max}.",required:"{property} is required.","required-if-after":"{property} is required when {compareSource} is after {compareValue}.","required-if-before":"{property} is required when {compareSource} is before {compareValue}.","required-if-equal":"{property} is required when {compareSource} is {compareValue}.","required-if-exists":"{property} is required when {compareSource} is specified.","required-if-greater-than":"{property} is required when {compareSource} is greater than {compareValue}.","required-if-greater-than-or-equal":"{property} is required when {compareSource} is greater than or equal to {compareValue}.","required-if-less-than":"{property} is required when {compareSource} is less than {compareValue}.","required-if-less-than-or-equal":"{property} is required when {compareSource} is less than or equal to {compareValue}.","required-if-not-equal":"{property} is required when {compareSource} is not {compareValue}.","required-if-not-exists":"{property} is required when {compareSource} is not specified.","required-if-on-or-after":"{property} is required when {compareSource} is on or after {compareValue}.","required-if-on-or-before":"{property} is required when {compareSource} is on or before {compareValue}.","string-format":"{property} must be formatted as {formatDescription}.","string-length-at-least":"{property} must be at least {min} characters.","string-length-at-most":"{property} must be at most {max} characters.","string-length-between":"{property} must be between {min} and {max} characters.","format-with-description":"{property} must be formatted as {description}.","format-without-description":"{property} is not properly formatted.","format-currency":"$#,###.##","format-percentage":"#.##%","format-integer":"#,###","format-decimal":"#,###.##",get:function(n){return this[n]}};ExoWeb.Model.Resource=o;wi=/\[([_a-zA-Z\u00aa\u00b5\u00ba\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u02bb-\u02c1\u02d0-\u02d1\u02e0-\u02e4\u02ee\u0370-\u0373\u0376-\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0523\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0621-\u064a\u0660-\u0669\u066e-\u066f\u0671-\u06d3\u06d5\u06e5-\u06e6\u06ee-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07c0-\u07ea\u07f4-\u07f5\u07fa\u0904-\u0939\u093d\u0950\u0958-\u0961\u0966-\u096f\u0971-\u0972\u097b-\u097f\u0985-\u098c\u098f-\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc-\u09dd\u09df-\u09e1\u09e6-\u09f1\u0a05-\u0a0a\u0a0f-\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32-\u0a33\u0a35-\u0a36\u0a38-\u0a39\u0a59-\u0a5c\u0a5e\u0a66-\u0a6f\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2-\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0-\u0ae1\u0ae6-\u0aef\u0b05-\u0b0c\u0b0f-\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32-\u0b33\u0b35-\u0b39\u0b3d\u0b5c-\u0b5d\u0b5f-\u0b61\u0b66-\u0b6f\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99-\u0b9a\u0b9c\u0b9e-\u0b9f\u0ba3-\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0be6-\u0bef\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58-\u0c59\u0c60-\u0c61\u0c66-\u0c6f\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0-\u0ce1\u0ce6-\u0cef\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d28\u0d2a-\u0d39\u0d3d\u0d60-\u0d61\u0d66-\u0d6f\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32-\u0e33\u0e40-\u0e46\u0e50-\u0e59\u0e81-\u0e82\u0e84\u0e87-\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa-\u0eab\u0ead-\u0eb0\u0eb2-\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0ed0-\u0ed9\u0edc-\u0edd\u0f00\u0f20-\u0f29\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8b\u1000-\u102a\u103f-\u1049\u1050-\u1055\u105a-\u105d\u1061\u1065-\u1066\u106e-\u1070\u1075-\u1081\u108e\u1090-\u1099\u10a0-\u10c5\u10d0-\u10fa\u10fc\u1100-\u1159\u115f-\u11a2\u11a8-\u11f9\u1200-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u1676\u1681-\u169a\u16a0-\u16ea\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u17e0-\u17e9\u1810-\u1819\u1820-\u1877\u1880-\u18a8\u18aa\u1900-\u191c\u1946-\u196d\u1970-\u1974\u1980-\u19a9\u19c1-\u19c7\u19d0-\u19d9\u1a00-\u1a16\u1b05-\u1b33\u1b45-\u1b4b\u1b50-\u1b59\u1b83-\u1ba0\u1bae-\u1bb9\u1c00-\u1c23\u1c40-\u1c49\u1c4d-\u1c7d\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u2094\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2183-\u2184\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2c6f\u2c71-\u2c7d\u2c80-\u2ce4\u2d00-\u2d25\u2d30-\u2d65\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3006\u3031-\u3035\u303b-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31b7\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fc3\ua000-\ua48c\ua500-\ua60c\ua610-\ua62b\ua640-\ua65f\ua662-\ua66e\ua680-\ua697\ua722-\ua788\ua78b-\ua78c\ua7fb-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8d0-\ua8d9\ua900-\ua925\ua930-\ua946\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa50-\uaa59\uac00-\ud7a3\uf900-\ufa2d\ufa30-\ufa6a\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff10-\uff19\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc][_.0-9a-zA-Z\u00aa\u00b5\u00ba\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u02bb-\u02c1\u02d0-\u02d1\u02e0-\u02e4\u02ee\u0370-\u0373\u0376-\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0523\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0621-\u064a\u0660-\u0669\u066e-\u066f\u0671-\u06d3\u06d5\u06e5-\u06e6\u06ee-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07c0-\u07ea\u07f4-\u07f5\u07fa\u0904-\u0939\u093d\u0950\u0958-\u0961\u0966-\u096f\u0971-\u0972\u097b-\u097f\u0985-\u098c\u098f-\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc-\u09dd\u09df-\u09e1\u09e6-\u09f1\u0a05-\u0a0a\u0a0f-\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32-\u0a33\u0a35-\u0a36\u0a38-\u0a39\u0a59-\u0a5c\u0a5e\u0a66-\u0a6f\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2-\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0-\u0ae1\u0ae6-\u0aef\u0b05-\u0b0c\u0b0f-\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32-\u0b33\u0b35-\u0b39\u0b3d\u0b5c-\u0b5d\u0b5f-\u0b61\u0b66-\u0b6f\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99-\u0b9a\u0b9c\u0b9e-\u0b9f\u0ba3-\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0be6-\u0bef\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58-\u0c59\u0c60-\u0c61\u0c66-\u0c6f\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0-\u0ce1\u0ce6-\u0cef\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d28\u0d2a-\u0d39\u0d3d\u0d60-\u0d61\u0d66-\u0d6f\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32-\u0e33\u0e40-\u0e46\u0e50-\u0e59\u0e81-\u0e82\u0e84\u0e87-\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa-\u0eab\u0ead-\u0eb0\u0eb2-\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0ed0-\u0ed9\u0edc-\u0edd\u0f00\u0f20-\u0f29\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8b\u1000-\u102a\u103f-\u1049\u1050-\u1055\u105a-\u105d\u1061\u1065-\u1066\u106e-\u1070\u1075-\u1081\u108e\u1090-\u1099\u10a0-\u10c5\u10d0-\u10fa\u10fc\u1100-\u1159\u115f-\u11a2\u11a8-\u11f9\u1200-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u1676\u1681-\u169a\u16a0-\u16ea\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u17e0-\u17e9\u1810-\u1819\u1820-\u1877\u1880-\u18a8\u18aa\u1900-\u191c\u1946-\u196d\u1970-\u1974\u1980-\u19a9\u19c1-\u19c7\u19d0-\u19d9\u1a00-\u1a16\u1b05-\u1b33\u1b45-\u1b4b\u1b50-\u1b59\u1b83-\u1ba0\u1bae-\u1bb9\u1c00-\u1c23\u1c40-\u1c49\u1c4d-\u1c7d\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u2094\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2183-\u2184\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2c6f\u2c71-\u2c7d\u2c80-\u2ce4\u2d00-\u2d25\u2d30-\u2d65\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3006\u3031-\u3035\u303b-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31b7\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fc3\ua000-\ua48c\ua500-\ua60c\ua610-\ua62b\ua640-\ua65f\ua662-\ua66e\ua680-\ua697\ua722-\ua788\ua78b-\ua78c\ua7fb-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8d0-\ua8d9\ua900-\ua925\ua930-\ua946\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa50-\uaa59\uac00-\ud7a3\uf900-\ufa2d\ufa30-\ufa6a\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff10-\uff19\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]*)(\:(.+?))?\]/ig;el=/^(.*\.|)meta(\..*|)$/;fi.fromTemplate=function(n,t,i){return new fi({specifier:t,compile:function(){var f,r,o,h,s,c;if(!this._tokens){for(this._paths=[],this._tokens=[],t=t.replace(/\\\\/g,"\x00").replace(/\\\[/g,"\x01").replace(/\\\]/g,"\x02"),f=0,wi.lastIndex=0,r=wi.exec(t);r;){var e=r[1],i=e,u=null;try{i=i.replace(el,"$1");o=i.length>0&&i.length<e.length;h=!o;o&&(i=i.substring(0,i.length-1));i&&(s=a.property(i,n),s&&(h?(u=s.get_format(),c=wi.lastIndex,u&&u.constructor===fi&&u!==this&&u.getPaths().length>0?this._paths.addRange(u.getPaths().map(function(n){return i+"."+n})):this._paths.push(i),wi.lastIndex=c):this._paths.push(i)))}catch(l){}this._tokens.push({prefix:t.substring(f,wi.lastIndex-r[0].length).replace(/\u0000/g,"\\").replace(/\u0001/g,"[").replace(/\u0002/g,"]"),path:e,format:r[3]?r[3].replace(/\u0000/g,"\\").replace(/\u0001/g,"[").replace(/\u0002/g,"]"):u});f=wi.lastIndex;r=wi.exec(t)}f<t.length&&this._tokens.push({prefix:t.substring(f).replace(/\u0000/g,"\\").replace(/\u0001/g,"[").replace(/\u0002/g,"]")})}},convert:function(n){var r,u,i,t;if(n===null||n===undefined)return"";for(this._compile(),r="",u=0;u<this._tokens.length;u++)i=this._tokens[u],i.prefix&&(r=r+i.prefix),i.path&&(t=sr(n,i.path),t===undefined||t===null?t="":i.format&&(i.format.constructor===String&&(i.format=ti(t.constructor,i.format)),t=t instanceof Array?t.map(function(n){return i.format.convert(n)}).join(", "):i.format.convert(t),this._formatEval&&(t=this._formatEval(t))),r=r+t);return r},formatEval:i})};fi.mixin({getPaths:function(){return this._compile&&this._compile(),this._paths||[]},convert:function(n){return n===undefined?this._undefinedString:n===null?this._nullString:n instanceof tf?n.get_invalidValue():this._convert?this._convert(n):n},convertBack:function(n){if(n===null||n==this._nullString)return null;if(n!==undefined&&n!=this._undefinedString){if(n.constructor==String&&(n=n.trim(),n.length===0))return null;if(!this._convertBack)return n;try{return this._convertBack(n)}catch(t){return t instanceof tf?t:new tf(this._description?o.get("format-with-description").replace("{description}",this._description):o.get("format-without-description"),n)}}},toString:function(){return this._specifier}});ExoWeb.Model.Format=fi;a.mixin(nt.eventing);a.mixin({dispose:function(){for(var t in this._types)delete n[t]},addType:function(n,t,i,r){var u=new bt(this,n,t,i,r);return this._types[n]=u,u},type:function(n){return this._types[n]},types:function(n){var i=[],r,t;for(r in this._types)t=this._types[r],(!n||n(t))&&i.push(t);return i},addBeforeContextReady:function(n){this._contextReady?n():this._addEvent("beforeContextReady",n,null,!0)},registerRule:function(n){this._contextReady?n.register():this._ruleQueue.push(n)},registerRules:function(){var n,t=this._ruleQueue;for(this._ruleQueue=[],n=0;n<t.length;n+=1)t[n].register()},notifyBeforeContextReady:function(){this._contextReady=!0;this.registerRules();this._raiseEvent("beforeContextReady",[])},addAfterPropertySet:function(n){this._addEvent("afterPropertySet",n)},notifyAfterPropertySet:function(n,t,i,r){this._raiseEvent("afterPropertySet",[n,t,i,r])},addObjectRegistered:function(n,t,i){this._addEvent("objectRegistered",n,t?t instanceof Function?t:vi(t):null,i)},removeObjectRegistered:function(n){this._removeEvent("objectRegistered",n)},notifyObjectRegistered:function(n){this._raiseEvent("objectRegistered",[n])},addObjectUnregistered:function(n){this._addEvent("objectUnregistered",n)},notifyObjectUnregistered:function(n){this._raiseEvent("objectUnregistered",[n])},addListChanged:function(n){this._addEvent("listChanged",n)},notifyListChanged:function(n,t,i){this._raiseEvent("listChanged",[n,t,i])},_ensureNamespace:function(t,i){var u,r=i;return r.constructor===String?(u=r.split("."),r=n,Array.forEach(u,function(n){if(r=r[n],r===undefined)throw new Error('Parent namespace "'+i+'" could not be found.');})):(r===undefined||r===null)&&(r=n),t in r?r[t]:r[t]={}}});a.property=function(n,t){var r,e,o,i=null,s=arguments.length>=3&&arguments[2]&&arguments[2].constructor===Boolean?arguments[2]:!1,u=arguments[3],f=arguments[4];if(n.constructor===ot&&(i=n,n=i.expression),t&&t._chains&&t._chains[n])return u?(u.call(f||this,t._chains[n]),null):t._chains[n];if(i||(i=new ot(n)),r=t instanceof Function?t.meta:t,i.steps[0].property==="this"&&i.steps[0].cast&&(r=a.getJsType(i.steps[0].cast,!1).meta,i.steps.dequeue()),e=function(n,t,i){le(n,s,function(){i.call(f||this,n.property(t))})},i.steps.length===1)if(o=i.steps[0].property,u)e(r,o,u);else return r.property(o);else{var h=i.steps.slice(0,i.steps.length-1).map(function(n){return n.property}).join("."),c=i.steps[i.steps.length-1].property,v=Array.prototype.slice.call(arguments),l=function(n){if(r=a.getJsType(h,!0),!r){if(u)return $extend(h,a.property.prepare(a,v)),null;throw new Error(n?n:'Error getting type "'+h+'".');}if(r=r.meta,u)e(r,c,u);else return r.property(c)};if(u)it.create(r,i,s,f?u.bind(f):u,l);else return it.create(r,i,s)||l(null)}};a.intrinsicJsTypes=["Object","String","Number","Boolean","Date","TimeSpan","Array"];a.types={};a.getJsType=function(t,i){var r=a.types,e=t.split("."),u,o;if(e.length===1&&a.intrinsicJsTypes.indexOf(t)>-1)return n[t];for(u=0;u<e.length;u++)if(o=e[u],r=r[o],r===undefined){if(i)return;throw new Error(f('The type "{0}" could not be found. Failed on step "{1}".',[t,o]));}return r};ExoWeb.Model.Model=a;v.mixin({init:function(){ol(sl.apply(this,arguments),function(n,t){var i=this.meta.type.property(n);if(!i)throw new Error('Could not find property "'+n+'" on type "'+this.meta.type.get_fullName()+'".');bi.call(i,this,t)},this)},set:function(){ol(sl.apply(this,arguments),function(n,t){var i=this.meta.type.property(n);if(!i)throw new Error('Could not find property "'+n+'" on type "'+this.meta.type.get_fullName()+'".');es.call(i,this,t,!1)},this)},get:function(n){return this.meta.type.property(n).value(this)},toString:function(n){return n=n?ti(this.constructor,n):this.meta.type.get_format(),n?n.convert(this):v.toIdString(this)}});v.toIdString=function(n){return f("{0}|{1}",[n.meta.type.get_fullName(),n.meta.id])};v.fromIdString=function(n){var t=n.substring(0,n.indexOf("|")),i=n.substring(t.length+1),r=ExoWeb.Model.Model.getJsType(t);return r.meta.get(i,!1)};ExoWeb.Model.Entity=v;ae=!1;du=function(n,t){if(t===null||t===undefined)throw new Error(f("Id cannot be {0} (entity = {1}).",t===null?"null":"undefined",n.get_fullName()));else if(ExoWeb.isString(t)){if(t==="")throw new Error(f("Id cannot be a blank string (entity = {0}).",n.get_fullName()));}else throw new Error(f('Id must be a string: encountered id {0} of type "{1}" (entity = {2}).',t.toString(),ii(t.constructor),n.get_fullName()));};ve="+c";bt.getNewIdPrefix=function(){if(arguments.length>0)throw new Error("The method getNewIdPrefix does not accept arguments");return ve.substring(1)};bt.setNewIdPrefix=function(n){if(n===null||n===undefined)throw new Error("The new id prefix argument is required");if(typeof n!="string")throw new TypeError("The new id prefix must be a string, found "+n.toString());if(n.length===0)throw new Error("The new id prefix cannot be empty string");ve="+"+n};bt.prototype={pendingInvocation:function(n,t){var i=this._pendingInvocation.indexOf(n);return arguments.length>1&&(t&&i<0?this._pendingInvocation.push(n):!t&&i>=0&&this._pendingInvocation.splice(i,1)),i>=0},addInitNew:function(n,t,i){return this._addEvent("initNew",n,t?vi(t):null,i),this},pendingInit:function(n,t){var i=this[n._fieldName]===undefined||this._pendingInit[n.get_name()]===!0;return arguments.length>1&&(t?this._pendingInit[n.get_name()]=!0:delete this._pendingInit[n.get_name()]),i},addInitExisting:function(n,t,i){return this._addEvent("initExisting",n,t?vi(t):null,i),this},newId:function(){for(var t,n=this;n;n=n.baseType)t=Math.max(t||0,n._counter);for(n=this;n;n=n.baseType)n._counter=t+1;return ve+t},register:function(n,t,i){var u,r;for(arguments.length===2&&du(this,t),n.meta=new ye(this,n),t||(t=this.newId(),n.meta.isNew=!0),u=t.toLowerCase(),n.meta.id=t,e.makeObservable(n),r=this;r;r=r.baseType){if(r._pool.hasOwnProperty(u))throw new Error(f('Object "{0}|{1}" has already been registered.',this.get_fullName(),t));r._pool[u]=n;r._known&&r._known.add(n)}i||this.model.notifyObjectRegistered(n)},changeObjectId:function(n,t){var i;du(this,n);du(this,t);var u=n.toLowerCase(),e=t.toLowerCase(),r=this._pool[u];if(r){for(r.meta.legacyId=n,i=this;i;i=i.baseType)i._pool[e]=r,delete i._pool[u],i._legacyPool[u]=r;return r.meta.id=t,r}c(f('Attempting to change id: Instance of type "{0}" with id = "{1}" could not be found.',this.get_fullName(),n))},unregister:function(n){for(var t=this;t;t=t.baseType)delete t._pool[n.meta.id.toLowerCase()],n.meta.legacyId&&delete t._legacyPool[n.meta.legacyId.toLowerCase()],t._known&&t._known.remove(n);this.model.notifyObjectUnregistered(n)},get:function(n,t){du(this,n);var r=n.toLowerCase(),i=this._pool[r]||this._legacyPool[r];if(i&&t===!0&&i.meta.type!==this)throw new Error(f("The entity with id='{0}' is expected to be of type '{1}' but found type '{2}'.",n,this._fullName,i.meta.type._fullName));return i},known:function(){var n=this._known,t;if(!n){n=this._known=[];for(t in this._pool)n.push(this._pool[t]);e.makeObservable(n)}return n},addPropertyAdded:function(n){this._addEvent("propertyAdded",n)},addRule:function(n){return new y(this,n)},addProperty:function(n){function r(i,u){var f="$"+n.name;f in i._jstype&&!u||(i._jstype[f]=t);i.derivedTypes.forEach(function(n){r(n,!1)})}var i=n.format,t;return i&&i.constructor===String&&(i=ti(n.type,i)),t=new k(this,n.name,n.type,n.label,n.helptext,i,n.isList,n.isStatic,n.isPersisted,n.isCalculated,n.index,n.defaultValue),this._properties[n.name]=t,(n.isStatic?this._staticProperties:this._instanceProperties)[n.name]=t,r(this,!0),t.get_isStatic()?this._jstype["get_"+n.name]=this._makeGetter(t,fs.bind(t),!0):this._jstype.prototype["get_"+n.name]=this._makeGetter(t,fs.bind(t),!0),t.get_isStatic()?this._jstype["set_"+n.name]=this._makeSetter(t):this._jstype.prototype["set_"+n.name]=this._makeSetter(t),this._raiseEvent("propertyAdded",[this,{property:t}]),t},addMethod:function(n){var t=this.get_fullName()+"."+n.name,i=function(){var r,u,o=null,s,e;arguments.length>1?(r=arguments[arguments.length-2],r instanceof Function?u=arguments[arguments.length-1]:r=arguments[arguments.length-1]):arguments.length>0&&(r=arguments[arguments.length-1]);r instanceof Function||(r=undefined);var h=function(n){r!==undefined&&r(n.event)},i=arguments.length-(r===undefined?0:1)-(u===undefined?0:1),c=i>0&&arguments[0]instanceof Object&&!(n.parameters.length===0||arguments[0][n.parameters[0]]===undefined),l=this instanceof v?this:null;if(i>=1&&i<=2&&arguments[0]instanceof Object&&(i==1&&(n.parameters.length!=1||c)||i==2&&(n.parameters.length!=2||c&&arguments[1]instanceof Array)))context.server.raiseServerEvent(t,l,arguments[0],!1,h,u,i==2?arguments[1]:null);else{if(n.parameters.length==i-1&&arguments[i-1]instanceof Array)o=arguments[i-1];else if(n.parameters.length!=i)throw new Error(f('Invalid number of arguments passed to "{0}.{1}" method.',this._fullName,n.name));if(n.isStatic&&o)throw new Error(f('Cannot include paths when invoking a static method - "{0}.{1}".',this.meta._fullName,n.name));s={};for(e in n.parameters)n.parameters.hasOwnProperty(e)&&(s[n.parameters[e]]=arguments[e]);context.server.raiseServerEvent(t,l,s,!1,h,u,o)}};n.isStatic?this._jstype[n.name]=i:this._jstype.prototype[n.name]=i},_makeGetter:function(n,t,i){return function(){var r=t.call(n,this,i);if(r===undefined||n.get_isList()&&u.isRegistered(r))throw new Error(f("Property {0}.{1} is not initialized. Make sure instances are loaded before accessing property values. {2}|{3}",n._containingType.get_fullName(),n.get_name(),this.meta.type.get_fullName(),this.meta.id));return r}},_makeSetter:function(n){var t=function(t){es.call(n,this,t,!0)};return t.__notifies=!0,t},get_format:function(){return this._format?this._format:this.baseType?this.baseType.get_format():undefined},set_format:function(n){n&&n.constructor==String&&(n=ti(this.get_jstype(),n));this._format=n},get_fullName:function(){return this._fullName},get_jstype:function(){return this._jstype},get_properties:function(){return ExoWeb.objectToArray(this._properties)},get_allproperties:function(){for(var t=ExoWeb.objectToArray(this._properties),n=this;n.baseType;)n=n.baseType,t=n.get_properties().concat(t);return t},get_baseproperties:function(){for(var t=[],n=this,i=!0;n.baseType;)n=n.baseType,t=n.get_properties().concat(t),i=!1;return i&&(t=n.get_properties()),t},get_staticProperties:function(){return this._staticProperties},get_instanceProperties:function(){return this._instanceProperties},property:function(n){for(var t,i=this;i&&!t;i=i.baseType)if(t=i._properties[n],t)return t;return null},conditionIf:function(n){return new ExoWeb.Model.Rule.condition(this,n),this},set_originForNewProperties:function(n){this._originForNewProperties=n},get_originForNewProperties:function(){return this._originForNewProperties},set_origin:function(n){this._origin=n},get_origin:function(){return this._origin},compileExpression:function(n){var t,i,r,u,f,e;if(this._exports||ExoWeb.config.expressionScope){if(n="return function() { return "+n+"; }",this._exports&&(t=this._exports.names,i=this._exports.implementations),ExoWeb.config.expressionScope){if(!ExoWeb.config.expressionScope._names){r=[];u=[];for(f in ExoWeb.config.expressionScope)r.push(f),u.push(ExoWeb.config.expressionScope[f]);ExoWeb.config.expressionScope._names=r;ExoWeb.config.expressionScope._values=u}t=t?t.concat(ExoWeb.config.expressionScope._names):ExoWeb.config.expressionScope._names;i=i?i.concat(ExoWeb.config.expressionScope._values):ExoWeb.config.expressionScope._values}return e=Function.apply(null,t.concat([n])),e.apply(null,i)}return new Function("return "+n+";")},set_exports:function(n){var i=[],t="return [";for(var r in n)i.push(r),t+=n[r]+",";t.length>8&&(t=t.slice(0,-1)+"];",this._exports={names:i,implementations:new Function(t)()})},addExport:function(n,t){this._exports?this._exports.names.indexOf(n)===-1&&(this._exports.names.push(n),this._exports.implementations.push(new Function("return "+t)())):this._exports={names:[n],implementations:new Function("return ["+t+"];")()}},eachBaseType:function(n,t){for(var i=this.baseType;!!i;i=i.baseType)if(n.call(t||this,i)===!1)return},isSubclassOf:function(n){var t=!1;return this.eachBaseType(function(i){if(i===n)return t=!0,!1}),t},isLoaded:function(n){if(u.isRegistered(this,null,n))return!1;if(n){ir(n)&&(n=this.property(n));var t=n.value(this._jstype);if(t!==null&&t!==undefined&&u.isRegistered(t))return!1}return!0},toString:function(){return this.get_fullName()},addConditionsChanged:function(n,t){var i;return t instanceof p?i=function(n,i){return i.conditionTarget.condition.type===t}:(t instanceof k||t instanceof it)&&(t=t.lastProperty(),i=function(n,i){return i.conditionTarget.properties.indexOf(t)>=0}),this._addEvent("conditionsChanged",n,i),this},removeConditionsChanged:function(n){this._removeEvent("conditionsChanged",n)}};bt.mixin(nt.eventing);ExoWeb.Model.Type=bt;k.mixin({defaultValue:function(n){return this._defaultValue=n,this},equals:function(n){if(n!==undefined&&n!==null){if(n instanceof k)return this===n;if(n instanceof it){var t=n.all();return t.length===1&&this.equals(t[0])}}},raiseChanged:function(n,t,i,r){var u,o,f;if(this._containingType.model.notifyAfterPropertySet(n,this,t,i),u=this._getEventHandler("changed"),u&&!u.isEmpty()){if(o={property:this,newValue:t,oldValue:i},r)for(f in r)r.hasOwnProperty(f)&&(o[f]=r[f]);u(n,o)}e.raisePropertyChanged(n,this._name)},rule:function(n){if(n==null)throw new l("type");if(typeof n!="function")throw new h("type","function",n);return oc(this._rules,function(t){if(t instanceof n)return!0})},rules:function(n){return n&&n instanceof Function?this._rules.filter(n):this._rules.slice()},addRuleRegistered:function(n,t,i){return this._addEvent("ruleRegistered",n,t?vi(t):null,i),this},removeRuleRegistered:function(n){return this._removeEvent("ruleRegistered",n),this},toString:function(){return this._isStatic?this.get_path():f("this<{0}>.{1}",[this.get_containingType(),this.get_name()])},get_containingType:function(){return this._containingType},isDefinedBy:function(n){return this._containingType===n||n.isSubclassOf(this._containingType)},get_jstype:function(){return this._jstype},get_index:function(){return this._index},get_format:function(){return this._format||(this._format=this._jstype.meta instanceof ExoWeb.Model.Type?this._jstype.meta.get_format():ti(this._jstype,"G")),this._format},set_format:function(n){this._format=ti(this._jstype,n)},format:function(n){return this.get_format()?this.get_format().convert(n):n},get_defaultValue:function(){return this._defaultValue instanceof Array?this._defaultValue.slice():this._defaultValue instanceof Date?new Date(+this._defaultValue):this._defaultValue instanceof ui?new ui(this._defaultValue.totalMilliseconds):this._defaultValue instanceof Function?this._defaultValue():this._defaultValue},get_origin:function(){return this._origin?this._origin:this._containingType.get_origin()},get_isEntityType:function(){return this.get_jstype().meta?!this._isList:!1},get_isEntityListType:function(){return this.get_jstype().meta?this._isList:!1},get_isValueType:function(){return!this.get_jstype().meta},get_isList:function(){return this._isList},get_isStatic:function(){return this._isStatic},get_isPersisted:function(){return this._isPersisted},get_isCalculated:function(){return this._isCalculated},get_label:function(){return this._label},get_helptext:function(){return this._helptext},get_name:function(){return this._name},get_fieldName:function(){return this._fieldName},get_path:function(){return this._isStatic?this._containingType.get_fullName()+"."+this._name:this._name},canSetValue:function(n,t){var r,i;if(t===undefined)return c("You should not set property values to undefined, use null instead: property = ."+this._name+"."),!0;if(t===null)return!0;if(t.constructor&&t.constructor.meta){for(r=t.constructor.meta;r;r=r.baseType)if(r._jstype===this._jstype)return!0;return!1}i=t.constructor;switch(oi(t)){case"string":i=String;break;case"number":i=Number;break;case"boolean":i=Boolean;break;case"date":i=Date;break;case"array":i=Array}return i===this._jstype||i===Array&&this.get_isList()&&t.every(function(n){if(n.constructor&&n.constructor.meta)for(var t=n.constructor.meta;t;t=t.baseType)if(t._jstype===this._jstype)return!0;return n.constructor===this._jstype},this)},value:function(n,t,i){var r=this._isStatic?this._containingType.get_jstype():n;if(r===undefined||r===null)throw new Error(f('Cannot {0} value for {1}static property "{2}" on type "{3}": target is null or undefined.',arguments.length>1?"set":"get",this._isStatic?"":"non-",this.get_path(),this._containingType.get_fullName()));if(arguments.length>1)es.call(this,r,t,!1,i);else return fs.call(this,r)},isInited:function(n){var i=this._isStatic?this._containingType.get_jstype():n,t;return i.hasOwnProperty(this._fieldName)?this._isList&&(t=i[this._fieldName],t===undefined||!u.isLoaded(t))?!1:!0:!1},addGet:function(n,t,i){return this._addEvent("get",n,t?vi(t):null,i),this},removeGet:function(n){this._removeEvent("get",n)},addChanged:function(n,t,i){return this._addEvent("changed",n,t?vi(t):null,i),this},removeChanged:function(n){this._removeEvent("changed",n)},firstProperty:function(){return this},lastProperty:function(){return this},properties:function(){return[this]},lastTarget:function(n){return n},ifExists:function(n){return a.property(n,this._containingType,!0,function(t){this.calculated({basedOn:[n],fn:function(){return!wu(t.value(this))}})},this),this},alias:function(n,t){return a.property(n,this._containingType,!0,function(i){this.calculated({basedOn:[(t?t+" of ":"")+n],fn:function(){return i.value(this)}})},this),this},rootedPath:function(n){if(this.isDefinedBy(n))return this._isStatic?this._containingType.get_fullName()+"."+this._name:this._name},label:function(n){return this._label=n,this},helptext:function(n){return this._helptext=n,this},calculated:function(n){n.property=this;var t=n.rootType?n.rootType.meta:this._containingType;return delete n.rootType,new cr(t,n),this},required:function(n){var t=gt(this,{},n);return new ExoWeb.Model.Rule.required(this._containingType,t),this},allowedValues:function(n,t){var i=gt(this,{source:n},t);return new ExoWeb.Model.Rule.allowedValues(this._containingType,i),this},optionValues:function(n,t){var i=gt(this,{source:n,onInit:!1,onInitNew:!1,onInitExisting:!1},t);return i.ignoreValidation=!0,new ExoWeb.Model.Rule.allowedValues(this._containingType,i),this},compare:function(n,t,i){var r=gt(this,{compareOperator:n,compareSource:t},i);return new ExoWeb.Model.Rule.compare(this._containingType,r),this},range:function(n,t,i){var r=gt(this,{min:n,max:t},i);return new ExoWeb.Model.Rule.range(this._containingType,r),this},conditionIf:function(n,t){var i=n.rootType?n.rootType.meta:this._containingType;return delete n.rootType,n=gt(this,n,t),new ExoWeb.Model.Rule.validated(i,n),this},errorIf:function(n,t){return this.conditionIf(n,t)},warningIf:function(n,t){return this.conditionIf(r.extend(n,{category:p.Warning}),t)},requiredIf:function(n,t,i,r){var u,f;return n.constructor===String?(u=gt(this,{compareSource:n,compareOperator:t,compareValue:i},r),new ExoWeb.Model.Rule.requiredIf(this._containingType,u)):(f=n.rootType?n.rootType.meta:this._containingType,delete n.rootType,n=gt(this,n),new ExoWeb.Model.Rule.requiredIf(f,n)),this},stringLength:function(n,t,i){var r=gt(this,{min:n,max:t},i);return new ExoWeb.Model.Rule.stringLength(this._containingType,r),this},stringFormat:function(n,t,i,r){var u=gt(this,{description:n,expression:t,reformat:i},r);return new ExoWeb.Model.Rule.stringFormat(this._containingType,u),this},listLength:function(n,t){var n=gt(this,{staticLength:n.staticLength,compareSource:n.compareSource,compareOperator:n.compareOperator},t);return new ExoWeb.Model.Rule.listLength(this._containingType,n),this}});k.mixin(nt.eventing);ExoWeb.Model.Property=k;ot.normalizePaths=function(n){var t=[];return n&&n.forEach(function(n){var r,u,f;n=n instanceof k?n.get_name():n instanceof it?n.get_path():n;var e=[],i,o=0,s=n.length;for(r=0;r<s;++r)u=n.charAt(r),(u==="{"||u===","||u==="}")&&(f=n.substring(o,r).trim(),o=r+1,u==="{"?i?(e.push(i),i+="."+f):i=f:(f.length>0&&t.push(new ot(i?i+"."+f:f)),u==="}"&&(i=e.length===0?undefined:e.pop())));if(e.length>0)throw new Error("Unclosed '{' in path: "+n);o===0&&t.push(new ot(n.trim()))}),t};ot.mixin({buildExpression:function(){var n="";return this.steps.forEach(function(t){n+=(n?".":"")+t.property+(t.cast?"<"+t.cast+">":"")}),n},toString:function(){return this.expression}});ExoWeb.Model.PathTokens=ot;it.create=function(n,t){var i=n,r=[],s=[],h=[],e=arguments.length>=3&&arguments[2]&&arguments[2].constructor===Boolean?arguments[2]:!1,o=arguments.length>=4&&arguments[3]&&arguments[3]instanceof Function?arguments[3]:null,u=arguments.length>=5&&arguments[4]&&arguments[4]instanceof Function?arguments[4]:function(n){if(o)throw new Error(n);},c=function(){var l=t.steps.dequeue(),v,y,p,w,b;if(!l)return u(f("Syntax error in property path: {0}",[t.expression])),null;if(v=i.property(l.property),!v)return u(f("Path '{0}' references an unknown property: {1}.{2}.",[t.expression,i.get_fullName(),l.property])),null;if(v.get_isStatic())return u(f("Path '{0}' references a static property: {1}.{2}.",[t.expression,i.get_fullName(),l.property])),null;if(r.push(v),l.cast){if(i=a.getJsType(l.cast,!0).meta,!i)return u(f("Path '{0}' references an invalid type: {1}",[t.expression,l.cast])),null;y=i.get_jstype();h[r.length]=y;s[r.length]=function(n){return n instanceof y}}else i=v.get_jstype().meta;return t.steps.length>0?le(i,e,c):r.length===0?(u(f("PropertyChain cannot be zero-length.")),null):(p=new et("filterType"),w=h[r.length-1],w&&le(w.meta,e,p.pending(null,null,!0)),p.waitForAll(function(){var i=new it(n,r,s);n._chains||(n._chains={});n._chains[t.expression]=i;o&&o(i);b=i},null,!0),b)};return le(i,e,c)};it.mixin(nt.eventing);it.mixin({equals:function(n){if(n!==undefined&&n!==null){if(n instanceof k)return n.equals(this);if(n instanceof it){if(n._properties.length!==this._properties.length)return!1;for(var t=0;t<this._properties.length;t++)if(!this._properties[t].equals(n._properties[t]))return!1;return!0}}},all:function(){return this._properties},append:function(n){Array.addRange(this._properties,n.all())},each:function(n,t,i,r){var f,e,c;if(n==null)throw new l("obj");if(t==null)throw new l("callback");if(typeof t!="function")throw new h("callback","function",t);var u=arguments[4]||n,s=arguments[6]||null,a=this._properties.slice(arguments[5]||0);for(f=arguments[5]||0;f<this._properties.length;f++){var o=this._properties[f],p=f===this._properties.length-1,v=p||r&&s===r,y=!r||s===r;if(u instanceof Array){for(e=0;e<u.length;++e)if((!this._filters[f]||this._filters[f](u[e]))&&(y&&t.call(i||this,u[e],e,u,o,f,a)===!1||!v&&(c=o.value(u[e]),!c||this.each(n,t,i,r,c,f+1,o)===!1)))return!1;return!0}if(this._filters[f]&&this._filters[f](u)===!1)break;if(y&&t.call(i||this,u,-1,null,o,f,a)===!1)return!1;if(v)break;if(u=u[o._fieldName],u===undefined||u===null)break;s=o}return!0},get_path:function(){return this._path||(this._path=this._getPathFromIndex(0)),this._path},_getPathFromIndex:function(n){var t=[],i;return this._properties[n].get_isStatic()&&t.push(this._properties[n].get_containingType().get_fullName()),this._properties.slice(n).forEach(function(n,r){r!==0&&n.get_containingType()!==i&&n.get_containingType().isSubclassOf(i)&&(t[t.length-1]=t[t.length-1]+"<"+n.get_containingType().get_fullName()+">");t.push(n.get_name());i=n.get_jstype().meta}),t.join(".")},firstProperty:function(){return this._properties[0]},lastProperty:function(){return this._properties[this._properties.length-1]},properties:function(){return this._properties.slice()},lastTarget:function(n){for(var i,t=0;t<this._properties.length-1;t++){if(i=this._properties[t],n===undefined||n===null)return n;n=i.value(n)}return n},prepend:function(n){var t=n instanceof it?n.all():[n];this._rootType=n.get_containingType();Array.prototype.splice.apply(this._properties,[0,0].concat(t))},canSetValue:function(n,t){return this.lastProperty().canSetValue(this.lastTarget(n),t)},connects:function(n,t,i){var r=!1;return i?(this.each(n,function(n){if(n===t)return r=!0,!1},this,i),r):n===t},rootedPath:function(n){for(var i,t=0;t<this._properties.length;t++)if(this._properties[t].isDefinedBy(n))return i=this._getPathFromIndex(t),this._properties[t]._isStatic?this._properties[t].get_containingType().get_fullName()+"."+i:i},addGet:function(n,t){var i=this;return this.lastProperty().addGet(function(t,r,u,f){n(t,i,u,f)},t),this},removeChanged:function(n){this._removeEvent("changed",n);this._updatePropertyChangeSubscriptions()},addChanged:function(n,t,i,r){var f=rc(t?vi(t):null,r?function(n){var t=!0;return this.each(n,function(n,i,r,f){var e,o;if(!f.isInited(n)&&(e=!1,u.isRegistered(n)?e=!0:f.get_isList()&&(o=n[f._fieldName],o&&u.isRegistered(o)&&(e=!0)),e))return t=!1,!1}),t}.bind(this):this.isInited.bind(this).spliceArguments(1,1,!0),{andResults:!0});return this._addEvent("changed",n,f,i),this._updatePropertyChangeSubscriptions(),this},get_containingType:function(){return this._rootType},get_jstype:function(){return this.lastProperty().get_jstype()},get_format:function(){return this.lastProperty().get_format()},format:function(n){return this.lastProperty().format(n)},get_isList:function(){return this.lastProperty().get_isList()},get_isStatic:function(){return this.lastProperty().get_isStatic()},get_label:function(){return this.lastProperty().get_label()},get_helptext:function(){return this.lastProperty().get_helptext()},get_name:function(){return this.lastProperty().get_name()},get_isValueType:function(){return this.lastProperty().get_isValueType()},get_isEntityType:function(){return this.lastProperty().get_isEntityType()},get_isEntityListType:function(){return this.lastProperty().get_isEntityListType()},rules:function(n){return this.lastProperty().rules(n)},value:function(n,t,i){var r=this.lastTarget(n,!0),u=this.lastProperty();if(arguments.length>1)u.value(r,t,i);else return r?u.value(r):r},isInited:function(n,t){var r=!0,i=[],u=arguments[2]||0,f=arguments[3]||null,e=this._properties.length-u;return this.each(n,function(n,u,f,e,o,s){return f&&t?(f.every(function(n){return this.isInited(n,!0,o,s[o-1])},this)?Array.prototype.push.apply(i,s.slice(o)):r=!1,!1):(f&&u!==0||i.push(e),!e.isInited(n))?(i.remove(e),r=!1,!1):void 0},this,null,n,u,f),r&&(!t||i.length===e)},toString:function(){if(this._isStatic)return this.get_path();var n=this._properties.map(function(n){return n.get_name()}).join(".");return f("this<{0}>.{1}",[this.get_containingType(),n])}});ExoWeb.Model.PropertyChain=it;ye.mixin({get_entity:function(){return this._obj},property:function(n,t){return this.type.property(n,t)},pendingInvocation:function(n,t){var i=this._pendingInvocation.indexOf(n);return arguments.length>1&&(t&&i<0?this._pendingInvocation.push(n):!t&&i>=0&&this._pendingInvocation.splice(i,1)),i>=0},pendingInit:function(n,t){var i=this._obj[n._fieldName]===undefined||this._pendingInit[n.get_name()]===!0;return arguments.length>1&&(t?this._pendingInit[n.get_name()]=!0:delete this._pendingInit[n.get_name()]),i},getCondition:function(n){return this._conditions[n.code]},setCondition:function(n){n.condition.type!=we&&(this._conditions[n.condition.type.code]=n)},clearCondition:function(n){delete this._conditions[n.code]},isAllowed:function(){var t,i,n;if(arguments.length===0)return undefined;for(t=arguments.length-1;t>=0;t--){if(i=arguments[t],n=p.get(i),n===undefined)return undefined;if(!(n instanceof p.Permission))throw new Error('Condition type "'+i+'" should be a Permission.');if(this._conditions[n.code]?!n.isAllowed:n.isAllowed)return!1}return!0},isLoaded:function(n){var i,t;if(u.isRegistered(this._obj,null,n))return!1;if(n){if(ir(n)&&(i=n,n=this.property(n,!0),!n))throw new Error('Could not find property "'+i+'" on type "'+this.type.get_fullName()+'".');if(t=n.value(this._obj),t!==null&&t!==undefined&&u.isRegistered(t))return!1}return!0},conditions:function(n){var t,i,r;if(n instanceof p)return t=this._conditions[n.code],t?[t.condition]:[];if(n instanceof k||n instanceof it){n=n.lastProperty();i=[];for(r in this._conditions)t=this._conditions[r],t.properties.some(function(t){return t.equals(n)})&&i.push(t.condition);return i}i=[];for(r in this._conditions)i.push(this._conditions[r].condition);return i},destroy:function(){this.type.unregister(this._obj)},addConditionsChanged:function(n,t){var i;return t instanceof p?i=function(n,i){return i.conditionTarget.condition.type===t}:(t instanceof k||t instanceof it)&&(t=t.lastProperty(),i=function(n,i){return i.conditionTarget.properties.indexOf(t)>=0}),this._addEvent("conditionsChanged",n,i),this},removeConditionsChanged:function(n){this._removeEvent("conditionsChanged",n)}});ye.mixin(nt.eventing);ExoWeb.Model.ObjectMeta=ye;yt={InitExisting:2,InitNew:4,PropertyGet:8,PropertyChanged:16};pe=0;y.mixin({onInitNew:function(){return this._options?(this.invocationTypes|=yt.InitNew,this):this},onInitExisting:function(){return this._options?(this.invocationTypes|=yt.InitExisting,this):this},onInit:function(){return this._options?(this.invocationTypes|=yt.InitNew|yt.InitExisting,this):this},onChangeOf:function(n){return this._options?(n&&n.constructor===String&&(n=Array.prototype.slice.call(arguments)),this.predicates=this.predicates.length>0?this.predicates.concat(n):n,(this.invocationTypes&yt.PropertyGet)==0&&(this.invocationTypes|=yt.PropertyChanged),this):this},returns:function(n){if(!this._options)return this;if(n&&n.constructor===String&&(n=Array.prototype.slice.call(arguments)),!n)throw new Error("Rule must specify at least 1 property for returns.");return this.returnValues=this.returnValues.length>0?this.returnValues.concat(n):n,this.invocationTypes|=yt.PropertyGet,this.invocationTypes&=~yt.PropertyChanged,this},register:function(){var i,r;if(this.rootType.rules.push(this),this._options){if(this._options.onInit&&this.onInit(),this._options.onInitNew&&this.onInitNew(),this._options.onInitExisting&&this.onInitExisting(),this._options.onChangeOf)this.onChangeOf(this._options.onChangeOf);this._options.returns&&this.returns(this._options.returns);this._options.basedOn&&this._options.basedOn.forEach(function(n){var t=n.split(" of ");if(t.length>=2){if(t[0].split(",").indexOf("change")>=0)this.onChangeOf([t[1]])}else this.onChangeOf(n)},this)}delete this._options;var u=function(n,t){return t instanceof n.rootType.get_jstype()},t=function(t,i,r){u(t,i,r)&&ee(function(){if(n.ExoWeb.config.detectRunawayRules&&b.parent&&b.parent._exitEventVersion){var u;if(u=typeof n.ExoWeb.config.nonExitingScopeNestingCount=="number"?n.ExoWeb.config.nonExitingScopeNestingCount-1:99,b.parent._exitEventVersion>u){c("Aborting rule '"+t.name+"'.");return}}t.execute.call(t,i,r)})},f=function(){var n=this;this.invocationTypes&yt.InitNew&&this.rootType.addInitNew(function(i,r){t(n,i,r)});this.invocationTypes&yt.InitExisting&&this.rootType.addInitExisting(function(i,r){t(n,i,r)});this.invocationTypes&yt.PropertyChanged&&this.predicates.forEach(function(i){i.addChanged(function(i,r){u(n,i,r)&&!i.meta.pendingInvocation(n)&&(i.meta.pendingInvocation(n,!0),nu(function(){i.meta.pendingInvocation(n,!1);t(n,i,r)}),ns(function(){i.meta.pendingInvocation(n,!1)}))},null,!1,!0)});this.invocationTypes&yt.PropertyGet&&this.returnValues&&(this.returnValues.forEach(function(i){i.addGet(function(r,f){u(n,r,f)&&r.meta.pendingInit(i)&&(r.meta.pendingInit(i,!1),t(n,r,f))})}),this.predicates.forEach(function(i){i.addChanged(function(i,r){n.returnValues.some(function(n){return rp(n,i)})?u(n,i,r)&&!i.meta.pendingInvocation(n)&&(i.meta.pendingInvocation(n,!0),nu(function(){i.meta.pendingInvocation(n,!1);t(n,i,r)}),ns(function(){i.meta.pendingInvocation(n,!1)})):(n.returnValues.forEach(function(n){i.meta.pendingInit(n,!0)}),nu(function(){n.returnValues.forEach(function(n){e.raisePropertyChanged(i,n.get_name())})},this))},null,!1,!0)}));this.onRegister instanceof Function&&this.onRegister()};this.returnValues&&this.returnValues.forEach(function(n,t){n instanceof k||(this.returnValues[t]=this.rootType.property(n))},this);this.predicates&&(r=[],this.predicates.forEach(function(n){n instanceof k||n instanceof it?r.push(n):n.constructor===String&&(i||(i=new et("prepare rule predicates")),ot.normalizePaths([n]).forEach(function(n){a.property(n,this.rootType,!1,i.pending(function(n){r.push(n)},this,!0),this)},this))},this),i?i.waitForAll(function(){this.predicates=r;f.call(this)},this,!0):(this.predicates=r,f.call(this)))}});y.ensureConditionType=function(n,t,i){for(var u=t instanceof k?f("{0}.{1}.{2}",[t.get_containingType().get_fullName(),t.get_name(),n]):t instanceof bt?f("{0}.{1}",[t.get_fullName(),n]):n,r="";p.get(u+r);)r++;return new i(u+r,f("Generated condition type for {0} rule.",[n]),null,"client")};y.ensureError=function(n,t,i){return y.ensureConditionType(n,t,p.Error,i)};y.ensureWarning=function(n,t,i){return y.ensureConditionType(n,t,p.Warning,i)};ExoWeb.Model.Rule=y;ll.prototype={set_dependsOnInit:function(n){this._init=n},get_dependsOnInit:function(){return this._init===undefined?!1:this._init},set_dependsOnChange:function(n){this._change=n},get_dependsOnChange:function(){return this._change===undefined?!0:this._change},set_dependsOnGet:function(n){this._get=n},get_dependsOnGet:function(){return this._get===undefined?!1:this._get},get_isTarget:function(){return this._isTarget===undefined?!1:this._isTarget},set_isTarget:function(n){this._isTarget=n}};ExoWeb.Model.RuleInput=ll;si.prototype=new y;si.prototype.constructor=si;si.mixin({properties:function(){return this.hasOwnProperty("properties")?this.properties:[]},message:function(){return this.conditionType.message},assert:function(){throw new Error("ConditionRule.assert() must be passed into the constructor or overriden by subclasses.");},execute:function(n,t){var r,i;this.hasOwnProperty("assert")?(this.assert.constructor===String&&(this.assert=this.rootType.compileExpression(this.assert)),r=this.assert.call(n,n,t)):r=this.assert(n);i=this.message;i instanceof Function&&(i=this.hasOwnProperty("message")?i.bind(n):i.bind(this));r!==undefined&&this.conditionType.when(r,n,this.properties instanceof Function?this.properties(n):this.properties,i)},toString:function(){return this.message||this.conditionType.message}});y.condition=si;ExoWeb.Model.ConditionRule=si;w.prototype=new si;w.prototype.constructor=w;w.mixin({assert:function(n){var t=this.isValid(n,this.property,this.property.value(n));return t===undefined?t:!t},onRegister:function(){cl(this.property,this)}});y.validated=w;ExoWeb.Model.ValidatedPropertyRule=w;cr.prototype=new y;cr.prototype.constructor=cr;cr.mixin({execute:function(n){var f=this.property,t,r,i,e,u;if(this.calculate.constructor===String&&(this.calculate=this.rootType.compileExpression(this.calculate)),this.defaultIfError===undefined)t=this.calculate.apply(n,[n]);else try{t=this.calculate.apply(n,[n])}catch(o){t=this.defaultIfError}if(t!==undefined)if(f.get_isList()){if(r=t,i=f.value(n),r.length===i.length){for(e=!0,u=0;u<r.length;++u)if(r[u]!==i[u]){e=!1;break}if(e)return}i.beginUpdate();fr(i,r);i.endUpdate()}else f.value(n,t,{calculated:!0})},toString:function(){return"calculation of "+this.property._name},onRegister:function(){cl(this.property,this)}});y.calculated=cr;ExoWeb.Model.CalculatedPropertyRule=cr;ni.prototype=new w;ni.prototype.constructor=ni;ni.hasValue=function(n){return n!==undefined&&n!==null&&(n.constructor!==String||n.trim()!=="")&&(!(n instanceof Array)||n.length>0)};ni.mixin({isValid:function(n,t,i){return this.requiredValue?i===this.requiredValue:ni.hasValue(i)},toString:function(){return f("{0}.{1} is required",[this.property.get_containingType().get_fullName(),this.property.get_name()])}});y.required=ni;ExoWeb.Model.RequiredRule=ni;tu.prototype=new w;tu.prototype.constructor=tu;tu.mixin({isValid:function(n){if(this.isError.constructor===String&&(this.isError=this.rootType.compileExpression(this.isError)),this.message.constructor===String){var t=this.rootType.compileExpression(this.message);this.message=function(n){try{return t.apply(n,[n])}catch(i){return""}}}try{return!this.isError.apply(n,[n])||!this.message.apply(n,[n])}catch(i){return!0}},toString:function(){return f("{0}.{1} is invalid",[this.property.get_containingType().get_fullName(),this.property.get_name()])}});y.validation=tu;ExoWeb.Model.ValidationRule=tu;ki.prototype=new w;ki.prototype.constructor=ki;ki.mixin({range:function(n){this.min&&this.min.constructor===String&&(this.min=this.rootType.compileExpression(this.min));this.max&&this.max.constructor===String&&(this.max=this.rootType.compileExpression(this.max));var t={};try{t.min=this.min.call(n)}catch(i){}try{t.max=this.max.call(n)}catch(i){}return t.min=t.min==null?undefined:t.min,t.max=t.max==null?undefined:t.max,t},isValid:function(n,t,i){var r=this.range(n);return i===null||i===undefined||(r.min===undefined||i>=r.min)&&(r.max===undefined||i<=r.max)},message:function(n){var t=this.range(n),i=t.min!==undefined&&t.max!==undefined?o.get("range-between").replace("{min}",this.property.format(t.min)).replace("{max}",this.property.format(t.max)):this.property.get_jstype()===Date?t.min!==undefined?o.get("range-on-or-after").replace("{min}",this.property.format(t.min)):o.get("range-on-or-before").replace("{max}",this.property.format(t.max)):t.min!==undefined?o.get("range-at-least").replace("{min}",this.property.format(t.min)):o.get("range-at-most").replace("{max}",this.property.format(t.max));return i.replace("{property}",this.property.get_label())},toString:function(){return f("{0}.{1} in range, min: {2}, max: {3}",[this.get_property().get_containingType().get_fullName(),this.get_property().get_name(),this.min?"":this.min,this.max?"":this.max])}});y.range=ki;ExoWeb.Model.RangeRule=ki;iu.prototype=new w;iu.prototype.constructor=iu;iu.mixin({onRegister:function(){this.source||this.sourceFn||Object.defineProperty(this,"source",{value:a.property(this.sourcePath,this.rootType)});w.prototype.onRegister.call(this)},isValid:function(n,t,i){if(this.ignoreValidation||!i)return!0;var r=this.values(n);if(u.isLoaded(r))return i instanceof Array?i.every(function(n){return Array.contains(r,n)}):Array.contains(r,i)},addChanged:function(n,t,i){for(var u,r=0;r<this.predicates.length;r++)u=this.predicates[r],u!==this.property&&u.addChanged(n,t,i)},removeChanged:function(n,t,i){for(var u,r=0;r<this.predicates.length;r++)u=this.predicates[r],u!==this.property&&u.removeChanged(n,t,i)},values:function(n,t){if(!this.source&&!this.sourceFn){c('AllowedValues rule on type "'+this.prop.get_containingType().get_fullName()+'" has not been initialized.');return}if(this.sourceFn)return this.sourceFn.constructor===String&&(this.sourceFn=this.rootType.compileExpression(this.sourceFn)),this.sourceFn.call(n,n);if(!this.source.get_isStatic()){var i=this.source.lastTarget(n,t);if(i===undefined)return undefined;if(i===null)return null}return this.source.value(n)},toString:function(){return f("{0}.{1} allowed values = {2}",[this.property.get_containingType().get_fullName(),this.property.get_name(),this._sourcePath])}});y.allowedValues=iu;ExoWeb.Model.AllowedValuesRule=iu;hi.compare=function(n,t,i,r){if(i===undefined||i===null)switch(t){case"Equal":return!ni.hasValue(n);case"NotEqual":return ni.hasValue(n)}if(n!==undefined&&n!==null&&i!==undefined&&i!==null){switch(t){case"Equal":return n==i;case"NotEqual":return n!=i;case"GreaterThan":return n>i;case"GreaterThanEqual":return n>=i;case"LessThan":return n<i;case"LessThanEqual":return n<=i}return n==i}return r};hi.prototype=new w;hi.prototype.constructor=hi;hi.mixin({isValid:function(n,t,i){var r=this.compareSource.value(n);return hi.compare(i,this.compareOperator,r,!0)},message:function(){var n,t=this.compareSource.get_jstype()===Date;if(this.compareOperator==="Equal")n=o.get("compare-equal");else if(this.compareOperator==="NotEqual")n=o.get("compare-not-equal");else if(this.compareOperator==="GreaterThan")n=o.get(t?"compare-after":"compare-greater-than");else if(this.compareOperator==="GreaterThanEqual")n=o.get(t?"compare-on-or-after":"compare-greater-than-or-equal");else if(this.compareOperator==="LessThan")n=o.get(t?"compare-before":"compare-less-than");else if(this.compareOperator==="LessThanEqual")n=o.get(t?"compare-on-or-before":"compare-less-than-or-equal");else throw new Error("Invalid comparison operator for compare rule.");return n.replace("{property}",this.property.get_label()).replace("{compareSource}",this.compareSource.get_label())},onRegister:function(){!this.compareSource&&this.comparePath&&Object.defineProperty(this,"compareSource",{value:a.property(this.comparePath,this.rootType)});w.prototype.onRegister.call(this)}});y.compare=hi;ExoWeb.Model.CompareRule=hi;ru.prototype=new w;ru.prototype.constructor=ru;ru.mixin({isRequired:function(n){var t=this.compareSource.value(n);return hi.compare(t,this.compareOperator,this.compareValue,!1)},message:function(){var n,t=this.compareSource.get_jstype()===Date;if(this.compareValue===undefined||this.compareValue===null)n=o.get(this.compareOperator==="Equal"?"required-if-not-exists":"required-if-exists");else if(this.compareOperator==="Equal")n=o.get("required-if-equal");else if(this.compareOperator==="NotEqual")n=o.get("required-if-not-equal");else if(this.compareOperator==="GreaterThan")n=o.get(t?"required-if-after":"required-if-greater-than");else if(this.compareOperator==="GreaterThanEqual")n=o.get(t?"required-if-on-or-after":"required-if-greater-than-or-equal");else if(this.compareOperator==="LessThan")n=o.get(t?"required-if-before":"required-if-less-than");else if(this.compareOperator==="LessThanEqual")n=o.get(t?"required-if-on-or-before":"required-if-less-than-or-equal");else throw new Error("Invalid comparison operator for compare rule.");return n.replace("{property}",this.property.get_label()).replace("{compareSource}",this.compareSource.get_label()).replace("{compareValue}",this.compareSource.format(this.compareValue))},assert:function(n){var t;if(this.isRequired.constructor===String&&(this.isRequired=this.rootType.compileExpression(this.isRequired)),this.hasOwnProperty("isRequired"))try{t=this.isRequired.call(n)}catch(i){t=!1}else t=this.isRequired(n);return this.requiredValue?t&&this.property.value(n)!==this.requiredValue:t&&!ni.hasValue(this.property.value(n))},onRegister:function(){w.prototype.onRegister.call(this);this.comparePath&&(Object.defineProperty(this,"compareSource",{value:a.property(this.comparePath,this.rootType)}),this.compareSource.get_jstype()===Boolean&&this.compareOperator=="NotEqual"&&(this.compareValue===undefined||this.compareValue===null)&&(this.compareOperator="Equal",this.compareValue=!0))}});y.requiredIf=ru;ExoWeb.Model.RequiredIfRule=ru;uu.prototype=new w;uu.prototype.constructor=uu;uu.mixin({isValid:function(n,t,i){return!i||i===""||(!this.min||i.length>=this.min)&&(!this.max||i.length<=this.max)},toString:function(){return f("{0}.{1} in range, min: {2}, max: {3}",[this.get_property().get_containingType().get_fullName(),this.get_property().get_name(),this.min?"":this.min,this.max?"":this.max])}});y.stringLength=uu;ExoWeb.Model.StringLengthRule=uu;fu.prototype=new w;fu.prototype.constructor=fu;fu.mixin({isValid:function(n,t,i){var r=!0;return i&&i!=""&&(this.expression.lastIndex=0,r=this.expression.test(i),r&&this.reformat&&(this.reformat instanceof Function?i=this.reformat(i):(this.expression.lastIndex=0,i=i.replace(this.expression,this.reformat)),t.value(n,i))),r},toString:function(){return f("{0}.{1} formatted as {2}",[this.get_property.get_containingType().get_fullName(),this.get_property().get_name(),this.description])}});y.stringFormat=fu;ExoWeb.Model.StringFormatRule=fu;eu.prototype=new ki;eu.prototype.constructor=eu;eu.mixin({isValid:function(n,t,i){var r=this.range(n);return i===null||i===undefined||(!r.min||i.length>=r.min)&&(!r.max||i.length<=r.max)},message:function(n){var t=this.range(n),i=t.min&&t.max?o.get("listlength-between").replace("{min}",this.property.format(t.min)).replace("{max}",this.property.format(t.max)):t.min?o.get("listlength-at-least").replace("{min}",this.property.format(t.min)):o.get("listlength-at-most").replace("{max}",this.property.format(t.max));return i.replace("{property}",this.property.get_label())}});y.listLength=eu;ExoWeb.Model.ListLengthRule=eu;ou={};nf.all=function(){var n=[];for(var t in ou)n.push(ou[t]);return n};nf.get=function(n){return ou[n]};nf.prototype={activate:function(){this.active||(this.active=!0,this._raiseEvent("activated"))},deactivate:function(){this.active&&(this.active=!1,this._raiseEvent("deactivated"))},addActivated:function(n){this._addEvent("activated",n)},removeActivated:function(n){this._removeEvent("activated",n)},addDeactivated:function(n){this._addEvent("deactivated",n)},removeDeactivated:function(n){this._removeEvent("deactivated",n)},addConditionsChanged:function(n){return this._addEvent("conditionsChanged",n),this},removeConditionsChanged:function(n){this._removeEvent("conditionsChanged",n)}};nf.mixin(ExoWeb.Functor.eventing);ExoWeb.Model.ConditionTypeSet=nf;su={};p.all=function(){var n=[];for(var t in su)n.push(su[t]);return n};p.get=function(n){return su[n]};p.prototype={when:function(n,t,i,r){var u=t.meta.getCondition(this);return n?(r=r instanceof Function?r(t):r,u?r&&r!=u.condition.message?(u.condition.destroy(),new hu(this,r,t,i,"client")):u.condition:new hu(this,r,t,i,"client")):(u!=null&&u.condition.destroy(),null)},extend:function(n){var t,i;for(t in n)t==="type"||t==="rule"||this["get_"+t]||(i="_"+t,this[i]=n[t],this["get"+i]=function(){return this[i]})},addConditionsChanged:function(n){return this._addEvent("conditionsChanged",n),this},removeConditionsChanged:function(n){this._removeEvent("conditionsChanged",n)}};p.mixin(nt.eventing);ExoWeb.Model.ConditionType=p,function(){function n(n,t,i,r){p.call(this,n,"Error",t,i,r)}function t(n,t,i,r){p.call(this,n,"Warning",t,i,r)}function i(n,t,i,r,u,f){p.call(this,n,"Permission",t,i,f);Object.defineProperty(this,"permissionType",{value:r});Object.defineProperty(this,"isAllowed",{value:u})}n.prototype=new p;ExoWeb.Model.ConditionType.Error=n;t.prototype=new p;ExoWeb.Model.ConditionType.Warning=t;i.prototype=new p;ExoWeb.Model.ConditionType.Permission=i}();hu.mixin({destroy:function(){var i,r,u,n,t;if(this.type.sets)for(i=this.type.sets.length-1;i>=0;i--)r=this.type.sets[i],r.conditions.remove(this),r._raiseEvent("conditionsChanged",[r,{condition:this,add:!1,remove:!0}]);for(this.type.conditions.remove(this),this.type._raiseEvent("conditionsChanged",[this.type,{condition:this,add:!1,remove:!0}]),u=this.targets.length-1;u>=0;u--)for(n=this.targets[u],n.target.meta.clearCondition(n.condition.type),n.target.meta._raiseEvent("conditionsChanged",[n.target.meta,{conditionTarget:n,add:!1,remove:!0}]),t=n.target.meta.type;t;t=t.baseType)t._raiseEvent("conditionsChanged",[n.target.meta,{conditionTarget:n,add:!1,remove:!0}]);this.targets.slice(0,0)},toString:function(){return this.message}});ExoWeb.Model.Condition=hu;we=new p.Error("FormatError","The value is not properly formatted.",[]);tf.mixin({createCondition:function(n,t){return new hu(we,this.message.replace("{property}",t.get_label()),n,[t.get_name()],"client")},toString:function(){return this._invalidValue}});ExoWeb.Model.FormatError=tf;ss=function(){throw new Error("Format provider has not been implemented. Call ExoWeb.Model.setFormatProvider(fn);");};ExoWeb.Model.getFormat=ti;u.eval=function(t,i,r,f,e,o){var a,h,l,v,s,p,y,w;if((i===undefined||i===null)&&(i=""),lt(i,String))i=new ot(i);else if(lt(i,Array))c("Calling LazyLoader.eval with a path Array is deprecated, please use a string path instead."),i=new ot(i.join("."));else if(!lt(i,ot))throw new Error('Unknown path "'+i+'" of type '+ii(i.constructor)+".");for(e=e||[n],arguments.length===11?(v=arguments[6]instanceof Function?arguments[6]:v,l=arguments[7]instanceof Boolean?arguments[7]:!1,h=arguments[8],a=arguments[9],w=arguments[10]):(v=u.eval,l=!1,h=t,a=[],w=null),(t===undefined||t===null)&&(t=h=e.dequeue());i.steps.length>0;){if(t===undefined||t===null)if(f)f.apply(o||this,["Target is null or undefined"]);else throw new Error("Cannot complete property evaluation because the target is null or undefined");if(v!==u.eval&&t instanceof Array){v(t,i,r,f,e,o,v,l,h,a,w);return}if(s=i.steps.dequeue(),u.isRegistered(t,null,s.property)){l=!0;Array.insert(i.steps,0,s);u.load(t,s.property,!1,function(){v(t,i,r,f,e,o,v,l,h,a,w)});return}if(y=ri(t,s.property),y===undefined)if(e.length>0){for(t=h=e.dequeue(),Array.insert(i.steps,0,s),p=a.length-1;p>=0;p-=1)Array.insert(i.steps,0,a[p]);a.length=0}else{if(f)f.apply(o||this,["Property is undefined: "+s.property]);else throw new Error("Cannot complete property evaluation because a property is undefined: "+s.property);return}else{if(y===null||s.cast&&!lt(y,s.cast)){r&&r.apply(o||this,[null,l,h]);return}a.push(s);t=y}}t!==undefined&&t!==null&&u.isRegistered(t)?(l=!0,u.load(t,null,!1,r?r.prepare(o||this,[t,l,h]):undefined)):r&&r.apply(o||this,[t,l,h])};u.evalAll=function(n,t,i,r,f,e){var o,s,l,h,v,y,a,p,w,b;if(arguments.length===11?(s=arguments[7]instanceof Boolean?arguments[7]:!1,o=arguments[8],l=arguments[9],h=arguments[10]):(s=!1,o=n,l=[],h=null),n instanceof Array){if(u.isRegistered(n)){u.load(n,null,!1,function(){u.evalAll(n,t,i,r,f,e,u.evalAll,s,o,l,h)});return}}else{u.eval(n,t,i,r,f,e,u.evalAll,s,o,l,h);return}v=new et("evalAll - "+t);y=[];a=[];p=[];w=[];b=!0;n.forEach(function(n,t){y.push(null);a.push(null);p.push(v.pending(function(n,i,r){s=s||i;y[t]=n;o!==r&&c("Found different roots when evaluating all paths.");o=r},null,h));w.push(v.orPending(function(n){b=!1;a[t]=n},null,h))});n.forEach(function(n,i){t instanceof ot&&(t=t.buildExpression());u.eval(n,t,p[i],w[i],f,e,u.evalAll,s,o,l.slice(0),h)});v.waitForAll(function(){b?i&&i.apply(e||this,[y,s,o]):r?r.apply(e||this,[a]):a.forEach(function(n){throw new Error("Error encountered while attempting to eval paths for all items in the target array: "+n);})},null,h)};u.isRegistered=function(n,t,i){var r,u,e,f;if(n===null||n===undefined||(r=n._lazyLoader,!r))return!1;if(i){if(ir(i))f=i;else if(i instanceof k)f=i.get_name();else throw new Error('Unexpected targetProperty argument value "'+i+'" in LazyLoader.isRegistered().');if(r.byProp&&r.byProp.hasOwnProperty(f)&&(e=r.byProp[f],e!==null&&e!==undefined))return!0}return(u=r.allProps,u!==null&&u!==undefined)?t?u===t:!0:!1};u.isLoaded=function(n){var r,f,t,c,e,o,s,h,i;if(n===undefined)r=undefined;else if(n===null)r=null;else if(f=arguments.length===1?null:arguments.length===2?lt(arguments[1],Array)?arguments[1]:[arguments[1]]:Array.prototype.slice.call(arguments,1),f&&f.length!==0)if(f.length===1){if(t=f[0],lt(t,String)&&t.startsWith("this.")&&(t=t.substring(5)),lt(t,String)&&t.indexOf(".")<0){if(t.length===0)throw new Error("Unexpected empty string passed to LazyLoader.isLoaded().");o=t}else if(lt(t,ot))if(t.steps.length===0)throw new Error("Unexpected empty path tokens passed to LazyLoader.isLoaded().");else t.steps.length===1&&(c=t.steps.dequeue(),o=c.property);if(o)if(u.isRegistered(n,null,o))r=!1;else return n.meta?(h=n.meta.property(o,!0),i=h.value(n)):i=ri(n,o),i?!u.isRegistered(i):!0;else{if(lt(t,String)){if(t.length===0)throw new Error("Unexpected empty string passed to LazyLoader.isLoaded().");t=new ot(t)}else if(!lt(t,ot))throw new Error('Unknown path "'+t+'" of type '+ii(t.constructor)+".");if(e=t.steps.dequeue(),n.meta?(h=n.meta.property(e.property,!0),i=h.value(n)):i=ri(n,e.property),i){if(u.isRegistered(i))return!1;e.cast&&(s=a.getJsType(e.cast,!0));e.cast&&!s?r=!0:yo(i)?(t instanceof ot&&(t=t.buildExpression()),r=!i.some(function(n){return(!s||n instanceof s)&&!u.isLoaded(n,t)})):r=!s||i instanceof s?u.isLoaded(i,t):!0}else return!0}}else r=!f.some(function(t){return!u.isLoaded(n,t)});else r=!u.isRegistered(n);return r};u.load=function(n,t,i,r,u){var o=n._lazyLoader,e;if(o){if(t&&o.byProp&&(e=o.byProp[t]),e||(e=o.allProps),!e)throw new Error(f("Attempting to load object but no appropriate loader is registered. object: {0}, property: {1}",n,t));e.load(n,t,i,r,u)}else r&&r instanceof Function&&r.call(u||this)};u.register=function(n,t,i){var r=n._lazyLoader;r||(r=n._lazyLoader={});i?(r.byProp||(r.byProp={}),r.byProp[i]=t):n._lazyLoader.allProps=t};u.unregister=function(n,t,i){var r=n._lazyLoader,u,f;if(r){if(i)delete r.byProp[i];else if(r.byProp){u=!0;for(f in r.byProp)r.byProp[f]===t?delete r.byProp[f]:u=!1;u&&delete r.byProp}r.allProps===t&&delete r.allProps;r.byProp||r.allProps||delete n._lazyLoader}};al=ri;ri=function(n,t){var r,i;return(n instanceof ExoWeb.Model.Entity||n.meta&&n.meta instanceof ExoWeb.Model.Type)&&(r=n.meta.type.property(t),r)?(i=r.value(n),i===undefined&&(i=null),i):al(n,t)};ExoWeb.getValue=ri;hs=function(){throw new Error("Object provider has not been implemented. Call ExoWeb.Mapper.setObjectProvider(fn);");};ExoWeb.Mapper.setObjectProvider=function(n){hs=n};cs=function(){throw new Error("Query provider has not been implemented. Call ExoWeb.Mapper.setQueryProvider(fn);");};ExoWeb.Mapper.setQueryProvider=function(n){cs=n};ls=function(){throw new Error("Type provider has not been implemented. Call ExoWeb.Mapper.setTypeProvider(fn);");};as=op.dontDoubleUp({callbackArg:1,partitionedArg:0,partitionedFilter:sp,memoize:!0});ExoWeb.Mapper.setTypeProvider=function(n){ls=n};vs=function(){throw new Error("List provider has not been implemented. Call ExoWeb.Mapper.setListProvider(fn);");};ExoWeb.Mapper.setListProvider=function(n){vs=n};ys=function(){throw new Error("Roundtrip provider has not been implemented. Call ExoWeb.Mapper.setRoundtripProvider(fn);");};ExoWeb.Mapper.setRoundtripProvider=function(n){ys=n};ps=function(){throw new Error("Save provider has not been implemented. Call ExoWeb.Mapper.setSaveProvider(fn);");};ExoWeb.Mapper.setSaveProvider=function(n){ps=n};ws=function(){throw new Error("Event provider has not been implemented. Call ExoWeb.Mapper.setEventProvider(fn);");};ExoWeb.Mapper.setEventProvider=function(n){ws=n};cu.mixin({execute:ExoWeb.FunctionChain.prepare(function(n,t){this._batch=s.start("ResponseHandler");n.call(t||this)},function(n,t){this._options.serverInfo&&this._serverSync.set_ServerInfo(this._options.serverInfo);n.call(t||this)},function(n,t){var r,i,f;if(this._options.types)for(r in this._options.types)i=this._model.type(r),(!i||u.isRegistered(i))&&(f={},f[r]=this._options.types[r],bl(this._model,f),i=this._model.type(r),vr.unregister(i),ra(i));n.call(t||this)},function(n,t){this._eventScope=new fe;n.call(t||this)},function(n,t){this._options.changes?this._options.changes?this._serverSync.applyChanges(this._options.checkpoint,this._options.changes,this._options.source,null,this._options.checkpoint,this._options.description?this._options.description+":response":null,null,this._options.beforeApply,this._options.afterApply,n,t):(this._options.source&&(this._serverSync._changeLog.addSet(this._options.source,this._options.description+":response"),this._serverSync._changeLog.start({user:this._serverSync.get_localUser()})),n.call(t||this)):n.call(t||this)},function(n,t){this._options.instances?au(this._model,this._options.instances,function(i){this.instancesPendingInit=i;n.apply(t||this,arguments)},this):n.call(t||this)},function(n,t){this._model.registerRules();n.call(t||this)},function(n,t){this._serverSync.batchChanges(this._options.description+":result",function(){this._eventScope.exit()},this);n.call(t||this)},function(n,t){if(this.instancesPendingInit){var i=this.instancesPendingInit;context.server._changeLog.batchChanges(this._options.description?this._options.description+":initExisting":"responseHandlerInitExisting",context.server._localUser,function(){i.forEach(function(n){for(var i,t=n.meta.type;t;t=t.baseType)i=t._getEventHandler("initExisting"),i&&i(n,{})})},!0)}n.call(t||this)},function(n,t){this._options.conditions?rf(this._model,this._options.conditions,this.instancesPendingInit,n,t):n.call(t||this)},function(n,t){s.end(this._batch);n.call(t||this)})});cu.execute=function(n,t,i,r,u){new cu(n,t,i).execute(r,u)};ExoWeb.Mapper.ResponseHandler=cu;v.fromIdString=function(n){var r=n.substring(0,n.indexOf("|")),u=n.substring(r.length+1),i=ExoWeb.Model.Model.getJsType(r),t=i.meta.get(u,!1);return t||(t=new i(u),i.meta.get_origin()==="server"&&ut.register(t)),t};ke.mixin(ExoWeb.Functor.eventing);ke.mixin({addChangeDetected:function(n){this._addEvent("changeDetected",n)},onListChanged:function(n,t,i){var u;if((!this._filters||!this._filters.listChanged||this._filters.listChanged(n,t,i)===!0)&&!t.get_isStatic())for(u=0;u<i.length;++u){var r=i[u],f={type:"ListChange",instance:at(n,this._translator),property:t.get_name(),added:[],removed:[]},e=this;(r.newStartingIndex>=0||r.newItems)&&Array.forEach(r.newItems,function(n){f.added.push(at(n,e._translator))});(r.oldStartingIndex>=0||r.oldItems)&&Array.forEach(r.oldItems,function(n){f.removed.push(at(n,e._translator))});this._raiseEvent("changeDetected",[f])}},onObjectRegistered:function(n){if((!this._filters||!this._filters.objectRegistered||this._filters.objectRegistered(n)===!0)&&n.meta.isNew){var t={type:"InitNew",instance:at(n,this._translator)};this._raiseEvent("changeDetected",[t])}},onObjectUnregistered:function(n){this._filters&&this._filters.objectUnregistered&&this._filters.objectUnregistered(n)!==!0},onPropertyChanged:function(n,t,i,r){var u,f;this._filters&&this._filters.propertyChanged&&this._filters.propertyChanged(n,t,i,r)!==!0||t.get_isStatic()||(t.get_isValueType()?(u={type:"ValueChange",instance:at(n,this._translator),property:t.get_name(),oldValue:r,newValue:i},this._raiseEvent("changeDetected",[u])):(f={type:"ReferenceChange",instance:at(n,this._translator),property:t.get_name(),oldValue:at(r,this._translator),newValue:at(i,this._translator)},this._raiseEvent("changeDetected",[f])))}});ExoWeb.Mapper.ExoModelEventListener=ke;de.mixin({add:function(n){var t=this.changes.push(n)-1;this.onChangeAdded(n,t,this);return t},checkpoint:function(n,t){return t||(t=wo(10)),this.add({type:"Checkpoint",title:n||"untitled",code:t}),t},count:function(n,t){return n?this.changes.filter(n,t).length:this.changes.length},lastChange:function(){return this.changes.length>0?this.changes[this.changes.length-1]:null},serialize:function(n,t,i){arguments.length===0?n=!0:n instanceof Function&&(i=t,t=n,n=!0);var r={source:this.source,changes:t?this.changes.filter(t,i):Array.prototype.slice.call(this.changes)};return n||(r.title=this.title,r.code=this.code,this.user&&(r.user=this.user)),r},truncate:function(n,t,i){var u,f,r,e;n&&Object.prototype.toString.call(n)==="[object Function]"&&(i=t,t=n,n=null);n&&(u=!1,f=t,t=function(t){return(t.type==="Checkpoint"&&t.code===n&&(u=!0),u===!0)?!1:f?f.apply(this,arguments):!0});t?(e=this.changes.purge(t,i),r=e?e.length:0):(r=this.changes.length,this.changes.clear());this.onTruncated(r,this);return r},undo:function(){if(this.changes.length>0){var n=this.changes.length-1,t=this.changes[n];this.changes.splice(n,1);this.onChangeUndone(t,n,this);return t}return null}});vl.mixin({add:function(n){if(this.activeSet===null)throw new Error("The change log is not currently active.");var t=this.activeSet.add(n);this.onChangeAdded(n,t,this.activeSet,this);return t},addSet:function(n,t,i,r,u){var f=new de(n,t,i,r,u);return this.sets.push(f),f},batchChanges:function(n,t,i,r){var l,v;if(!n||n.constructor!==String||n.length===0)throw new Error("The first argument to batchChanges must be a non-empty string which specifies a title for the changes.");if(t!==null&&t!==undefined&&(t.constructor!==String||t.length===0))throw new Error("The second argument to batchChanges must be a non-empty string which specifies the user who is initiating the changes.");if(!i||!(i instanceof Function))throw new Error("The third argument to batchChanges must be a function which performs the changes.");var o,f,s,u=this.activeSet,h=u?this.sets.indexOf(u):-1,c=u,a=!0,e=null;(!u||u.changes.length>0||u.source!=="client"||u.title!==n||u.user!==t)&&(f=new de("client",n,t||this._defaultUser),this.sets.push(f),this.activeSet=f);f&&u&&(u.title||u.user||u.changes.length!==0||(e=u,this.sets.splice(h,1),c=this.sets[h-1],a=!1));s=function(){throw new Error("Nested change batches are not currently supported. Batch already in progress: "+n);};this.onChangeSetStarted.add(s);try{i()}finally{if(!this.onChangeSetStarted.remove(s))throw new Error("Could not unsubscribe from change set started event.");if(f){if(o=this.sets.indexOf(f),r&&f===this.activeSet&&f.changes.length===0)return this.sets.splice(o,1),u&&c!==u&&this.sets.splice(h,0,u),this.activeSet=u,null;this.onChangeSetStarted(f,a?c:null,o,this)}if(e){l=this.sets.push(e)-1;v=this.sets[l-1];this.activeSet=e;this.onChangeSetStarted(e,v,l,this)}else u?this.start({title:u.title,user:u.user}):this.activeSet.changes.length>0&&this.start("unknown")}return f},checkpoint:function(n,t){return this.activeSet?this.activeSet.checkpoint(n,t):null},compress:function(n,t){for(var i,e,u,f=[],r=this.sets.length-1;r>=0;r--)if(i=this.sets[r],i.changes.length!==0||t&&(i.title||i.user)||(i===this.activeSet&&(this.activeSet=null),e=this.sets.splice(r,1),u=[0,0],Array.prototype.push.apply(u,e),Array.prototype.splice.apply(f,u)),n)break;return f},count:function(n,t){var i=0;return kr(this.sets,function(r){i+=r.count(n,t)},this),i},lastChange:function(){for(var i,t,n=this.sets.length-1;n>=0;n--)if(i=this.sets[n],t=i.lastChange(),t!==null&&t!==undefined)return t;return null},serialize:function(n,t,i){return arguments.length===0?n=!0:n instanceof Function&&(i=t,t=n,n=!0),this.sets.map(function(r){return r.serialize(n,t,i)})},start:function(n,t){var f,e,o,r,i,u,s;if(n==null)throw new l("titleOrOptions");if(n.constructor!==String&&!(n instanceof Object))throw new h("titleOrOptions","string|object",n);if(t!=null&&t.constructor!==Boolean)throw new h("continueLast","boolean",t);if(n.constructor===String?(f=n,e=null,o=null):(f=n.title||null,e=n.user||null,o=n.code||null),r=this.activeSet,t&&(i=r,!i&&this.sets.length>0&&(i=this.sets[this.sets.length-1]),i&&i.source==="client"&&i.user===e&&i.title===f)){if(r)return null;this.activeSet=i;this.onChangeSetStarted(i,r,this.sets.length-1,this);return i}u=new de("client",f,e||this._defaultUser,null,o);s=this.sets.push(u)-1;this.activeSet=u;this.onChangeSetStarted(u,r,s,this);return u},stop:function(){if(!this.activeSet)throw new Error("The change log is not currently active.");this.activeSet=null},truncate:function(n,t,i){var u,f,r,e;for(n&&Object.prototype.toString.call(n)==="[object Function]"&&(i=t,t=n,n=null),u=0,f=!1,r=0;r<this.sets.length;r++)if(n&&(f=this.sets[r].changes.some(function(t){return t.type==="Checkpoint"&&t.code===n})),u+=this.sets[r].truncate(n,t,i),this.sets[r].changes.length===0&&(e=this.sets[r],this.sets.splice(r--,1),e===this.activeSet&&(this.activeSet=null)),f)break;this.onTruncated(u,this);return u},undo:function(){var n,t,r,i;if(!this.activeSet)throw new Error("The change log is not currently active.");for(n=this.activeSet,t=this.sets.indexOf(n);n.changes.length===0;){if(this.sets.splice(t,1),--t<0)return null;n=this.sets[t];this.activeSet=n}r=n.changes.length-1;i=n.undo();this.onChangeUndone(i,r,n,this);return i}});bs.mixin(nt.eventing);ct=0;er("ServerSync: request",function(){return ct>0});bs.mixin({enableSave:function(n){if(!(n instanceof v))throw new Error("Can only enableSave on entity objects.");if(Array.contains(this._objectsExcludedFromSave,n)){var t;return this._saveRoot&&(t=this.changes(!1,this._saveRoot,!0)),Array.remove(this._objectsExcludedFromSave,n),this._raiseEvent("changesDetected",[this,{reason:"enableSave"}]),t&&t.length===0&&this._saveInterval&&!this._saveTimeout&&this.changes(!1,this._saveRoot,!0).length>0&&this._queueAutoSave(),!0}},disableSave:function(t){if(!(t instanceof v))throw new Error("Can only disableSave on entity objects.");if(!Array.contains(this._objectsExcludedFromSave,t)){var i;return this._saveRoot&&(i=this.changes(!1,this._saveRoot,!0)),this._objectsExcludedFromSave.push(t),this._raiseEvent("changesDetected",[this,{reason:"disableSave"}]),i&&i.length>0&&this._saveInterval&&this._saveTimeout&&this.changes(!1,this._saveRoot,!0).length===0&&(n.clearTimeout(this._saveTimeout),this._saveTimeout=null),!0}},notifyDeleted:function(n){if(!(n instanceof v))throw new Error("Notified of deleted object that is not an entity.");return Array.contains(this._objectsDeleted,n)?!1:(this._objectsDeleted.push(n),!0)},canSend:function(n){var t,i,r;return n.type==="Checkpoint"?!1:n.instance&&(t=a.getJsType(n.instance.type,!0),t&&u.isLoaded(t.meta)&&(t.meta.get_origin()!=="server"||n.property&&(i=t.meta.property(n.property),i.get_origin()!=="server"||i.get_isStatic())||(r=st(n.instance,this._translator,!1,this._objectsDeleted),r&&this.isObjectDeleted(r,!1))))?!1:!0},canSaveObject:function(n){var t;if(n==null)throw new l("objOrMeta");else if(n instanceof ExoWeb.Model.ObjectMeta)t=n._obj;else if(n instanceof v)t=n;else throw new h("objOrMeta","ObjectMeta|Entity",n);return!Array.contains(this._objectsExcludedFromSave,t)&&!Array.contains(this._objectsDeleted,t)},canSave:function(n){var t,f,i,e,r,o,u;if(!this.canSend(n))return!1;if(n.type==="ListChange"){if((n.added.length>0||n.removed.length>0)&&(t=!0,Array.forEach(n.added,function(n){if(n.type&&ExoWeb.Model.Model.getJsType(n.type,!0)){var i=st(n,this._translator,!1,this._objectsDeleted);(!i||this.canSaveObject(i))&&(t=!1)}else t=!1},this),Array.forEach(n.removed,function(n){if(n.type&&ExoWeb.Model.Model.getJsType(n.type,!0)){var i=st(n,this._translator,!1,this._objectsDeleted);(!i||this.canSaveObject(i))&&(t=!1)}else t=!1},this),t))return!1}else if(n.type==="ReferenceChange"&&((f=n.oldValue&&ExoWeb.Model.Model.getJsType(n.oldValue.type,!0),f&&(i=st(n.oldValue,this._translator,!1,this._objectsDeleted),i&&!this.canSaveObject(i)))||(e=n.newValue&&ExoWeb.Model.Model.getJsType(n.newValue.type,!0),e&&(r=st(n.newValue,this._translator,!1,this._objectsDeleted),r&&!this.canSaveObject(r)))))return!1;return(o=ExoWeb.Model.Model.getJsType(n.instance.type,!0),!o)?!0:(u=st(n.instance,this._translator,!1,this._objectsDeleted),!u||this.canSaveObject(u))},_handleResult:function(n,t,i,r){var u,f=null,e=null;r instanceof Function?u=r:(u=r.callback,f=r.beforeApply,e=r.afterApply);cu.execute(this.model,this,{instances:n.instances,conditions:n.conditions,types:n.types&&n.types instanceof Array?null:n.types,changes:n.changes,source:"server",description:t,checkpoint:i,serverInfo:n.serverInfo,beforeApply:f,afterApply:e},u,this)},addRequestBegin:function(n){this._addEvent("requestBegin",n)},removeRequestBegin:function(n){this._removeEvent("requestBegin",n)},addRequestEnd:function(n){this._addEvent("requestEnd",n)},removeRequestEnd:function(n){this._removeEvent("requestEnd",n)},addRequestSuccess:function(n){this._addEvent("requestSuccess",n)},removeRequestSuccess:function(n){this._removeEvent("requestSuccess",n)},addRequestFailed:function(n){this._addEvent("requestFailed",n)},removeRequestFailed:function(n){this._removeEvent("requestFailed",n)},raiseServerEvent:function(n,t,i,r,u,f,e){var o,c,s,l,a,h;if(ct++,c=this._changeLog.checkpoint("raiseServerEvent("+n+")-"+ +new Date),o={type:"raiseServerEvent",target:t,checkpoint:c,includeAllChanges:r},o.eventName=n,o.eventObject=i,this._raiseEvent("raiseServerEventBegin",[this,o]),s={},i!==undefined&&i!==null)for(a in i)h=i[a],s[a]=h instanceof Array?h.map(function(n){return at(n,this._translator)},this):at(h,this._translator);l=at(t,this._translator);o.root=l;o.eventData=s;this._raiseEvent("requestBegin",[this,o]);ap(n,l,s,e,lr.call(this,r,t),this._onRaiseServerEventSuccess.bind(this).appendArguments(o,c,u),this._onRaiseServerEventFailed.bind(this).appendArguments(o,f||u))},_onRaiseServerEventSuccess:function(n,t,i,r){t.responseObject=n;t.requestSucceeded=!0;this._raiseEvent("requestEnd",[this,t]);this._handleResult(n,"raiseServerEvent("+t.eventName+")",i,function(){var i,u;if(this._raiseEvent("requestSuccess",[this,t]),i=n.events[0],i instanceof Array)for(u=0;u<i.length;++u)i[u]=st(i[u],this._translator,!0);else i=st(i,this._translator,!0);iw(i);n.event=i;t.eventResult=i;this._raiseEvent("raiseServerEventEnd",[this,t]);this._raiseEvent("raiseServerEventSuccess",[this,t]);r&&r instanceof Function&&r(n);ct--})},_onRaiseServerEventFailed:function(n,t,i){t.responseObject=n;t.requestSucceeded=!1;this._raiseEvent("requestEnd",[this,t]);this._raiseEvent("requestFailed",[this,t]);this._raiseEvent("raiseServerEventEnd",[this,t]);this._raiseEvent("raiseServerEventFailed",[this,t]);i&&i instanceof Function&&i(n);ct--},addRaiseServerEventBegin:function(n){this._addEvent("raiseServerEventBegin",n)},removeRaiseServerEventBegin:function(n){this._removeEvent("raiseServerEventBegin",n)},addRaiseServerEventEnd:function(n){this._addEvent("raiseServerEventEnd",n)},removeRaiseServerEventEnd:function(n){this._removeEvent("raiseServerEventEnd",n)},addRaiseServerEventSuccess:function(n){this._addEvent("raiseServerEventSuccess",n)},removeRaiseServerEventSuccess:function(n){this._removeEvent("raiseServerEventSuccess",n)},addRaiseServerEventFailed:function(n){this._addEvent("raiseServerEventFailed",n)},removeRaiseServerEventFailed:function(n){this._removeEvent("raiseServerEventFailed",n)},roundtrip:function(n,t,i,r){var u,f,e,o;ct++;n&&n instanceof Function&&(i=n,r=t,n=null,t=null);f=this._changeLog.checkpoint("roundtrip-"+ +new Date);o=n?!0:!1;u={type:"roundtrip",target:n||null,checkpoint:f,includeAllChanges:o};this._raiseEvent("roundtripBegin",[this,u]);e=n?at(n,this._translator):null;u.root=e;this._raiseEvent("requestBegin",[this,u]);cp(e,t,lr.call(this,o,n),this._onRoundtripSuccess.bind(this).appendArguments(u,f,i),this._onRoundtripFailed.bind(this).appendArguments(u,r||i))},_onRoundtripSuccess:function(n,t,i,r){t.responseObject=n;t.requestSucceeded=!0;this._raiseEvent("requestEnd",[this,t]);this._handleResult(n,"roundtrip",i,function(){this._raiseEvent("requestSuccess",[this,t]);this._raiseEvent("roundtripEnd",[this,t]);this._raiseEvent("roundtripSuccess",[this,t]);r&&r instanceof Function&&r(n);ct--})},_onRoundtripFailed:function(n,t,i){t.responseObject=n;t.requestSucceeded=!1;this._raiseEvent("requestEnd",[this,t]);this._raiseEvent("requestFailed",[this,t]);this._raiseEvent("roundtripEnd",[this,t]);this._raiseEvent("roundtripFailed",[this,t]);i&&i instanceof Function&&i(n);ct--},startAutoRoundtrip:function(t){function i(){this.roundtrip(function(){this._roundtripTimeout=n.setTimeout(i.bind(this),t)})}if(!t||typeof t!="number"||t<=0)throw new Error("An interval must be specified for auto-save.");this.stopAutoRoundtrip();this._roundtripTimeout=n.setTimeout(i.bind(this),t)},stopAutoRoundtrip:function(){this._roundtripTimeout&&n.clearTimeout(this._roundtripTimeout)},addRoundtripBegin:function(n){this._addEvent("roundtripBegin",n)},removeRoundtripBegin:function(n){this._removeEvent("roundtripBegin",n)},addRoundtripEnd:function(n){this._addEvent("roundtripEnd",n)},removeRoundtripEnd:function(n){this._removeEvent("roundtripEnd",n)},addRoundtripSuccess:function(n){this._addEvent("roundtripSuccess",n)},removeRoundtripSuccess:function(n){this._removeEvent("roundtripSuccess",n)},addRoundtripFailed:function(n){this._addEvent("roundtripFailed",n)},removeRoundtripFailed:function(n){this._removeEvent("roundtripFailed",n)},save:function(n,t,i){var r,u,f;ct++;u=this._changeLog.checkpoint("save-"+ +new Date);r={type:"save",target:n,checkpoint:u,includeAllChanges:!1};this._raiseEvent("saveBegin",[this,r]);f=at(n,this._translator);r.root=f;this._raiseEvent("requestBegin",[this,r]);lp(f,lr.call(this,!1,n),this._onSaveSuccess.bind(this).appendArguments(r,u,t),this._onSaveFailed.bind(this).appendArguments(r,i||t))},_onSaveSuccess:function(n,t,i,r){t.responseObject=n;t.requestSucceeded=!0;this._raiseEvent("requestEnd",[this,t]);this._handleResult(n,"save",i,function(){this._raiseEvent("requestSuccess",[this,t]);this._raiseEvent("saveEnd",[this,t]);this._raiseEvent("saveSuccess",[this,t]);r&&r instanceof Function&&r(n);ct--})},_onSaveFailed:function(n,t,i){t.responseObject=n;t.requestSucceeded=!1;this._raiseEvent("requestEnd",[this,t]);this._raiseEvent("requestFailed",[this,t]);this._raiseEvent("saveEnd",[this,t]);this._raiseEvent("saveFailed",[this,t]);i&&i instanceof Function&&i(n);ct--},startAutoSave:function(n,t,i){if(!n||!(n instanceof v))throw new Error("A root object must be specified for auto-save.");if(!t||typeof t!="number"||t<=0)throw new Error("An interval must be specified for auto-save.");if(i&&(typeof i!="number"||i<=0))throw new Error("Max number of auto-save attempts must be a positive number.");this.stopAutoSave();this._saveInterval=t;this._saveRoot=n;this._maxAutoSaveAttempts=i||3},stopAutoSave:function(){this._saveTimeout&&(n.clearTimeout(this._saveTimeout),this._saveTimeout=null);this._saveInterval=null;this._saveRoot=null;this._maxAutoSaveAttempts=null},_autoSaveSuccess:function(){this._failedAutoSaveAttempts=0;this._saveTimeout=null;this.changes(!1,this._saveRoot,!0).length>0&&this._queueAutoSave()},_autoSaveFailure:function(){++this._failedAutoSaveAttempts<this._maxAutoSaveAttempts?this._queueAutoSave():c(f("Auto-save failed {0} consecutive times and will not re-try again until additional changes are detected.",this._failedAutoSaveAttempts))},_doAutoSave:function(){this.save(this._saveRoot,this._autoSaveSuccess.bind(this),this._autoSaveFailure.bind(this))},_queueAutoSave:function(){this._saveTimeout||this._saveInterval&&this._saveRoot&&this._maxAutoSaveAttempts&&(this._saveTimeout=n.setTimeout(this._doAutoSave.bind(this),this._saveInterval))},addSaveBegin:function(n){this._addEvent("saveBegin",n)},removeSaveBegin:function(n){this._removeEvent("saveBegin",n)},addSaveEnd:function(n){this._addEvent("saveEnd",n)},removeSaveEnd:function(n){this._removeEvent("saveEnd",n)},addSaveSuccess:function(n){this._addEvent("saveSuccess",n)},removeSaveSuccess:function(n){this._removeEvent("saveSuccess",n)},addSaveFailed:function(n){this._addEvent("saveFailed",n)},removeSaveFailed:function(n){this._removeEvent("saveFailed",n)},ensureLoaded:function(t,i,r,e,o){var s,a,p,y,c,h,w,l;if(ct++,t===null||t===undefined)throw new Error("Method ensureLoaded requires a target argument.");if(t instanceof v)r?(y=ut.getRelativePaths(t),c=i?i.concat(y):y):c=i||[];else{if(c=[],t instanceof Function&&t.meta&&t.meta&&t.meta instanceof bt&&(t=t.meta),!(t instanceof bt))throw new Error(f('Method ensureLoaded expects target of type Entity or Type, but found type "{0}".',ii(t.constructor)));if(i===null||i===undefined)throw new Error("Method ensureLoaded requires a paths argument for static property loading.");if(Object.prototype.toString.call(i)==="[object String]")h=i;else if(Object.prototype.toString.call(i)==="[object Array]")if(i.length===1)h=i[0];else throw new Error(f('Multiple paths cannot be specified when ensuring that static property information is loaded: "{0}.[{1}]".',t.get_fullName(),i.join(",")));else throw new Error(f('Argument "paths" was expected to be a string or array of strings, but found type "{0}" instead.',ii(t.constructor)));if(h.indexOf(".")>=0)throw new Error(f('Multiple path steps cannot be specified when ensuring that static property information is loaded: "{0}.{1}".',t.get_fullName(),h));if(w=t.property(h),h=t.get_fullName()+"."+h,t=w.value(t),t===null||t===undefined)throw new Error(f('Unable to ensure that static path "{0}" is loaded because it evaluates to a null or undefined value.',h));}a=this._changeLog.checkpoint("ensureLoaded"+ +new Date);s={type:"ensureLoaded",target:t instanceof v?t:null,checkpoint:a,includeAllChanges:!0};this._raiseEvent("ensureLoadedBegin",[this,s]);u.isLoaded.apply(null,[t].concat(c))?(l=this,n.setTimeout(function(){s.requiredLoading=!1;l._raiseEvent("ensureLoadedEnd",[l,s]);l._raiseEvent("ensureLoadedSuccess",[l,s]);e&&e instanceof Function&&e();ct--},1)):(p=t instanceof v?at(t,this._translator):null,s.root=p,this._raiseEvent("requestBegin",[this,s]),be(t instanceof v?t.meta.type.get_fullName():t.get_fullName(),t instanceof v?[t.meta.id]:[],c,!1,lr.call(this,!0),this._onEnsureLoadedSuccess.bind(this).appendArguments(s,a,e),this._onEnsureLoadedFailed.bind(this).appendArguments(s,o||e)))},_onEnsureLoadedSuccess:function(n,t,i,r){t.responseObject=n;t.requestSucceeded=!0;this._raiseEvent("requestEnd",[this,t]);this._handleResult(n,"ensureLoaded",i,function(){this._raiseEvent("requestSuccess",[this,t]);t.requiredLoading=!0;this._raiseEvent("ensureLoadedEnd",[this,t]);this._raiseEvent("ensureLoadedSuccess",[this,t]);r&&r instanceof Function&&r(n);ct--})},_onEnsureLoadedFailed:function(n,t,i){t.responseObject=n;t.requestSucceeded=!1;this._raiseEvent("requestEnd",[this,t]);this._raiseEvent("requestFailed",[this,t]);t.requiredLoading=!0;this._raiseEvent("ensureLoadedEnd",[this,t]);this._raiseEvent("ensureLoadedFailed",[this,t]);i&&i instanceof Function&&i(n);ct--},addEnsureLoadedBegin:function(n){this._addEvent("ensureLoadedBegin",n)},removeEnsureLoadedBegin:function(n){this._removeEvent("ensureLoadedBegin",n)},addEnsureLoadedEnd:function(n){this._addEvent("ensureLoadedEnd",n)},removeEnsureLoadedEnd:function(n){this._removeEvent("ensureLoadedEnd",n)},addEnsureLoadedSuccess:function(n){this._addEvent("ensureLoadedSuccess",n)},removeEnsureLoadedSuccess:function(n){this._removeEvent("ensureLoadedSuccess",n)},addEnsureLoadedFailed:function(n){this._addEvent("ensureLoadedFailed",n)},removeEnsureLoadedFailed:function(n){this._removeEvent("ensureLoadedFailed",n)},applyChanges:function(n,t,i,r,f,e,o,s,h,c,a){var w,v,b,g,ht,nt;if(!t||!(t instanceof Array)){c&&c.call(a||this);return}if(i==null)throw new l("source");var p=[],y=new et("applyChanges"),tt=!1,it=!1,rt=!1,ut=!1,ft=!1;try{w=ExoWeb.Batch.start("apply changes");it=!0;this.beginApplyingChanges();rt=!0;v=null;this._changeLog.activeSet&&(v=this._changeLog.activeSet,this._changeLog.stop(),this._changeLog.compress(!0,!0).indexOf(v)>0&&(v=null));b=this._changeLog.addSet(i,e,r,null,f);this._changeLog.onChangeSetStarted(b,v,v?this._changeLog.sets.indexOf(v):-1,this._changeLog);var ct=function(n){if(ExoWeb.Model.Model.getJsType(n.instance.type,!0)){var t=st(n.instance,this._translator);return t&&t.meta.isNew}return!1},k,ot=t.filter(function(n){return n.type==="Save"}),d=ot.length;d>0&&(g=ot.mapToArray(function(n){return n.added||[]}),ht=g.map(function(n){return n.type+"|"+n.oldId}),k=function(n){var t,i;return t=this.canSave(n),i=n.instance&&(n.instance.isNew||ct.call(this,n))&&!ht.contains(n.instance.type+"|"+n.instance.id),t&&!i},this._changeLog.truncate(n,k.bind(this)),this._changeLog.start({user:this._localUser}),g.forEach(function(n){var t=ExoWeb.Model.Model.getJsType(n.type,!0),i,r;t&&u.isLoaded(t.meta)&&(i=n.oldId,r=(n.oldId in t.meta._pool)?n.oldId:this._translator.reverse(n.type,i),this._scopeQueries.forEach(function(t){t.ids=t.ids.map(function(t){return t===r?n.newId:t},this)},this))},this));nt=d;t.forEach(function(n){if(n.type==="InitNew"?this.applyInitChange(n,s,h,y.pending()):n.type==="ReferenceChange"?this.applyRefChange(n,s,h,y.pending()):n.type==="ValueChange"?this.applyValChange(n,s,h,y.pending()):n.type==="ListChange"?this.applyListChange(n,s,h,y.pending()):n.type==="Save"&&(this.applySaveChange(n,s,h,y.pending()),nt--),n.type!=="Save"){var t=d===0,i=nt>0;!t&&i&&k.call(this,n)||o&&o(n)!==!0||(p.push(n),b.add(n))}},this);this.isCapturingChanges()&&this._changeLog.start({user:this._localUser});tt=!0;y.waitForAll(function(){ft||this.endApplyingChanges();ExoWeb.Batch.end(w);c&&c.call(a||this);ut=!0},this,!0)}finally{rt&&!ut&&this.endApplyingChanges();it&&!tt&&ExoWeb.Batch.end(w)}p.length>0&&this._raiseEvent("changesDetected",[this,{reason:"applyChanges",changes:p}]);ft=!0},applySaveChange:function(n,t,i,r,u){if(!(n.added||n.deleted)){r&&r.call(u||this);return}n.deleted.forEach(function(n){rt(this.model,n.type,null,!1,function(r){pt(this.model,this._translator,r,n.id,null,tt.None,this.ignoreChanges(t,function(n){this.notifyDeleted(n);n.meta.isDeleted=!0;r.meta.unregister(n);this._scopeQueries.purge(function(t){return t.ids.purge(function(t){return t===n.meta.id},this),t.ids.length===0},this)},i),this)},this)},this);n.added.forEach(function(n){pl(this.model,n.type,this.ignoreChanges(t,function(t){var s=n.oldId,r=(n.oldId in t.meta._pool)?n.oldId:this._translator.reverse(n.type,s),o,u;if(r){if(o=this.model.type(n.type),u=o.get(r,!0),!u)throw new Error(f('Unable to change id for object of type "{0}" from "{1}" to "{2}" since the object could not be found.',t.meta.get_fullName(),n.oldId,n.newId));o.changeObjectId(r,n.newId);e.setValue(u.meta,"isNew",!1);this._scopeQueries.forEach(function(t){t.ids=t.ids.map(function(t){return t===r?n.newId:t},this)},this);function i(t){if(t){var i=a.getJsType(t.type,!0);i&&u===st(t,this._translator)&&(t.id=n.newId,t.isNew=!1)}}this._changeLog.sets.forEach(function(n){n.changes.forEach(function(n){if(n.instance)if(i.call(this,n.instance),n.type==="ListChange"){var t=a.getJsType(n.instance.type,!0);t&&t.meta.property(n.property).get_isEntityListType()&&(n.added.length>0&&n.added.forEach(i,this),n.removed.length>0&&n.removed.forEach(i,this))}else n.type==="ReferenceChange"&&(i.call(this,n.oldValue),i.call(this,n.newValue))},this)},this)}else c(f('Cannot apply id change on type "{0}" since old id "{1}" was not found.',n.type,n.oldId))},i),this)},this);r&&r.call(u||this)},applyInitChange:function(n,t,i,r,u){rt(this.model,n.instance.type,null,!1,this.ignoreChanges(t,function(r){var u=r.meta.get(n.instance.id,!0),f;u||(f=this._translator.forward(n.instance.type,n.instance.id)||n.instance.id,rw(n.instance.type,f,this.ignoreChanges(t,function(){return u=new r(null,null,!0),this._translator.add(n.instance.type,u.meta.id,f),this.model.notifyObjectRegistered(u),u},i),this))},i),this);r&&r.call(u||this)},applyRefChange:function(n,t,i,r,u){var o=!1,f=!0;rt(this.model,n.instance.type,n.property,!1,function(s){pt(this.model,this._translator,s,n.instance.id,null,tt.None,this.ignoreChanges(t,function(h){ar(n.instance,h);var c=h.meta.property(n.property);if(!c)throw new Error('Property "'+n.property+'" could not be found on type "'+s.meta.get_fullName()+'".');n.newValue?(o||(f=!1),rt(this.model,n.newValue.type,null,!0,this.ignoreChanges(t,function(o){pt(this.model,this._translator,o,n.newValue.id,null,tt.Lazy,this.ignoreChanges(t,function(t){ar(n.newValue,t);n.newValue.id===t.meta.legacyId&&(n.newValue.id=t.meta.id);gu.call(c,h);h.meta.pendingInit(c,!1);e.setValue(h,n.property,t);!f&&r&&r.call(u||this)},i),this)},i),this)):(gu.call(c,h),h.meta.pendingInit(c,!1),e.setValue(h,n.property,null));n.oldValue&&rt(this.model,n.oldValue.type,null,!0,this.ignoreChanges(t,function(){var t=st(n.oldValue,this._translator,!0);ar(n.oldValue,t)},i),this)},i),this)},this);f&&r&&r.call(u||this);o=!0},applyValChange:function(n,t,i,r,u){rt(this.model,n.instance.type,n.property,!1,function(r){pt(this.model,this._translator,r,n.instance.id,null,tt.None,this.ignoreChanges(t,function(t){var i,u,f,o;if(ar(n.instance,t),i=n.newValue,u=t.meta.property(n.property),!u)throw new Error('Property "'+n.property+'" could not be found on type "'+r.meta.get_fullName()+'".');u.get_jstype()===Date&&i&&i.constructor==String&&i.length>0?(ci.lastIndex=0,i=new Date(i.replace(ci,ge)),u.get_format()&&!no.test(u.get_format().toString())&&(f=this.get_ServerTimezoneOffset(),o=-((new Date).getTimezoneOffset()/60),i=i.addHours(f-o))):i&&i instanceof ui&&(i=i.toObject());gu.call(u,t);t.meta.pendingInit(u,!1);e.setValue(t,n.property,i)},i),this)},this);r&&r.call(u||this)},applyListChange:function(n,t,i,r,u){var f=!1,e=!0;rt(this.model,n.instance.type,n.property,!1,function(o){pt(this.model,this._translator,o,n.instance.id,n.property,tt.None,this.ignoreChanges(t,function(s){var c,l,h,a;if(ar(n.instance,s),c=s.meta.property(n.property),!c)throw new Error('Property "'+n.property+'" could not be found on type "'+o.meta.get_fullName()+'".');l=c.get_isEntityListType();h=c.value(s);h.beginUpdate();a=new ExoWeb.Signal("applyListChange-items");n.added.length>0&&(f||(e=!1),n.added.forEach(function(n){l?rt(this.model,n.type,null,!0,a.pending(this.ignoreChanges(t,function(r){pt(this.model,this._translator,r,n.id,null,tt.Lazy,this.ignoreChanges(t,function(t){ar(n,t);h.contains(t)||ht.allowModification(h,function(){h.add(t)})},i),this)},i)),this,!0):ht.allowModification(h,function(){h.add(n)})},this));n.removed.forEach(function(n){l?rt(this.model,n.type,null,!1,this.ignoreChanges(t,function(r){pt(this.model,this._translator,r,n.id,null,tt.Lazy,this.ignoreChanges(t,function(t){ar(n,t);ht.allowModification(h,function(){h.remove(t)})},i),this)},i),this,!0):ht.allowModification(h,function(){h.remove(n)})},this);a.waitForAll(this.ignoreChanges(t,function(){try{var n=!1;f&&this.beginApplyingChanges();try{ht.allowModification(h,function(){n=!0;h.endUpdate()})}finally{n||h.endUpdate()}}finally{f&&this.endApplyingChanges()}!e&&r&&r.call(u||this)},i),this,!0)},i),this)},this);e&&r&&r.call(u||this);f=!0},checkpoint:function(){return this._changeLog.checkpoint()},rollback:function(n,t,i){var u=new et("rollback"),e=!1,f,r;try{for(f=ExoWeb.Batch.start("rollback changes"),this.beginApplyingChanges(),r=this._changeLog.undo();r&&!(r.type==="Checkpoint"&&r.code===n);)r.type=="InitNew"?this.rollbackInitChange(r,u.pending()):r.type=="ReferenceChange"?this.rollbackRefChange(r,u.pending()):r.type=="ValueChange"?this.rollbackValChange(r,u.pending()):r.type=="ListChange"&&this.rollbackListChange(r,u.pending()),r=this._changeLog.undo();e=!0;u.waitForAll(function(){this.endApplyingChanges();ExoWeb.Batch.end(f);t&&t.call(i||this);this._raiseEvent("changesDetected",[this,{reason:"rollback"}])},this,!0)}finally{e||(this.endApplyingChanges(),ExoWeb.Batch.end(f))}},rollbackValChange:function(n,t,i){rt(this.model,n.instance.type,n.property,!1,function(t){pt(this.model,this._translator,t,n.instance.id,null,tt.None,function(i){var r=n.oldValue,u=i.meta.property(n.property),f,o;if(!u)throw new Error('Property "'+n.property+'" could not be found on type "'+t.meta.get_fullName()+'".');u.get_jstype()===Date&&r&&r.constructor==String&&r.length>0?(ci.lastIndex=0,r=new Date(r.replace(ci,ge)),u.get_format()&&!no.test(u.get_format().toString())&&(f=this.get_ServerTimezoneOffset(),o=-((new Date).getTimezoneOffset()/60),r=r.addHours(f-o))):r&&r instanceof ui&&(r=r.toObject());e.setValue(i,n.property,r)},this)},this);t&&t.call(i||this)},rollbackRefChange:function(n,t,i){var u=!1,r=!0;rt(this.model,n.instance.type,n.property,!1,function(f){pt(this.model,this._translator,f,n.instance.id,null,tt.None,function(f){n.oldValue?(u||(r=!1),rt(this.model,n.oldValue.type,null,!0,function(u){pt(this.model,this._translator,u,n.oldValue.id,null,tt.None,function(u){e.setValue(f,n.property,u);!r&&t&&t.call(i||this)},this)},this)):e.setValue(f,n.property,null)},this)},this);r&&t&&t.call(i||this);u=!0},rollbackInitChange:function(n,t,i){t&&t.call(i||this)},rollbackListChange:function(n,t,i){var r=!1,u=!0;rt(this.model,n.instance.type,n.property,!1,function(f){pt(this.model,this._translator,f,n.instance.id,n.property,tt.None,function(e){var s=e.meta.property(n.property),h;if(!s)throw new Error('Property "'+n.property+'" could not be found on type "'+f.meta.get_fullName()+'".');var c=s.get_isEntityListType(),o=s.value(e),l=this._translator;o.beginUpdate();h=new ExoWeb.Signal("rollbackListChange-items");n.added.forEach(function(n){c?rt(this.model,n.type,null,!1,function(){var t=st(n,l);t&&o.remove(t)},this):o.remove(n)},this);n.removed.length>0&&(r||(u=!1),n.removed.forEach(function(n){c?rt(this.model,n.type,null,!0,h.pending(function(){var t=st(n,l,!0);o.add(t)},this,!0),this):o.add(n)},this));h.waitForAll(function(){r&&this.beginApplyingChanges();ht.allowModification(o,function(){o.endUpdate()});r&&this.endApplyingChanges();!u&&t&&t.call(i||this)},this)},this)},this);u&&t&&t.call(i||this);r=!0},addChangesDetected:function(n){this._addEvent("changesDetected",n)},batchChanges:function(n,t,i){var r=!n&&!this._localUser;this._changeLog.batchChanges(n,this._localUser,i?t.bind(i):t,r)},changes:function(n,t,i){var r=[],u=lr.call(this,n,t);return u.forEach(function(n){i?r.addRange(n.changes.filter(yl)):r.addRange(n.changes)}),r},get_ServerTimezoneOffset:function(){var n=0;return this._serverInfo!==null&&(n=this._serverInfo.TimeZoneOffset),n},set_ServerInfo:function(n){this._serverInfo=this._serverInfo?r.extend(this._serverInfo,n):n},get_localUser:function(){return this._localUser},set_localUser:function(n){this._localUser=n}});k.prototype.triggersRoundtrip=function(n){this.addChanged(function(t){context.server.isApplyingChanges()||nu(function(){setTimeout(function(){t.meta.type.model.server.roundtrip(t,n)},100)})})};var di="static",ci=/^(\d{4})-(\d{2})-(\d{2})T(\d{2})\:(\d{2})\:(\d{2})(\.\d{3})?Z$/g,ge="$2/$3/$1 $4:$5:$6 GMT",no=/[hHmts]/;li=gp.dontDoubleUp({callbackArg:2,thisPtrArg:3,partitionedArg:1,partitionedFilter:nw});ro={};tt={None:0,Force:1,ForceAndWait:2,Lazy:3};dl=bt.prototype.get;bt.prototype.get=function(n,t,i){var u=dl.apply(this,arguments),f,r;return u||i||(f=ro[this.get_fullName()],f&&(r=f[n],r&&(u=r.callback.call(r.thisPtr)))),u};vr.mixin({load:uw.dontDoubleUp({callbackArg:3,thisPtrArg:4,groupBy:0})}),function(){var n=new vr;vr.register=function(t){u.register(t,n)};vr.unregister=function(t){u.unregister(t,n)}}();uf=0;er("ObjectLazyLoader",function(){return uf>0});ut.mixin({load:fw.dontDoubleUp({callbackArg:3,thisPtrArg:4,groupBy:0})}),function(){var n=new ut;ut.addPaths=function(t,i){var r=n._typePaths[t],u,f;for(r||(r=n._typePaths[t]=[]),u=0;u<i.length;u++)f=i[u],r.indexOf(f)<0&&r.push(f)};ut.getRelativePaths=function(n){return ut.getRelativePathsForType(n.meta.type)};ut.getRelativePathsForType=function(t){var s=[],u,i,f,r,h,e,o;for(u in n._typePaths)if(i=a.getJsType(u),i&&i.meta)for(f=n._typePaths[u],r=0;r<f.length;r++)h=f[r].expression,e=a.property(h,i.meta),e.get_isStatic()||(o=e.rootedPath(t),o&&s.push(o));return s.distinct()};ut.isRegistered=function(t){return u.isRegistered(t,n)};ut.register=function(t){if(!ut.isRegistered(t)){if(t.meta.type.get_origin()!=="server")throw new Error(f("Cannot lazy load instance of non-server-origin type: {0}|{1}",t.meta.type.get_fullName(),t.meta.id));u.register(t,n)}};ut.unregister=function(t){u.unregister(t,n)}}();ht.mixin({load:ew.dontDoubleUp({callbackArg:3,thisPtrArg:4,groupBy:0})}),function(){function i(t,i){if(n.indexOf(t)<0&&i.get_changes().mapToArray(function(n){return n.newItems||[]}).concat(i.get_changes().mapToArray(function(n){return n.oldItems||[]})).some(function(n){return!n.meta.isNew}))throw new Error(f("{0} list {1}.{2} was modified but it has not been loaded.",this._isStatic?"Static":"Non-static",this._isStatic?this._containingType.get_fullName():"this<"+this._containingType.get_fullName()+">",this._name));}var t=new ht,n=[];ht.register=function(n,r){var f=[],o=i.bind(r);return f._collectionChangeHandler=o,e.addCollectionChanged(f,o),f._ownerId=r.get_isStatic()?di:n.meta.id,f._ownerProperty=r,u.register(f,t),f};ht.unregister=function(n){e.removeCollectionChanged(n,n._collectionChangeHandler);u.unregister(n,t);delete n._ownerId;delete n._ownerProperty;delete n._collectionChangeHandler};ht.allowModification=function(t,i,r){n.push(t);i.call(r||this);n.remove(t)}}();d=new ExoWeb.Signal("Context : allSignals");ExoWeb.registerActivity("Context: allSignals",function(){return d.isActive()});ei.mixin(ExoWeb.Functor.eventing);ei.mixin({addReady:function(n,t){var i=yr===0;this._addEvent("ready",t?n.bind(t):n,null,!0);i&&d.waitForAll(function(){this._raiseEvent("ready")},this)},isPending:function(){return yr>0},beginContextReady:ExoWeb.Functor(),endContextReady:ExoWeb.Functor()});ei.ready=function(n){yr--;var t=yr===0;t&&d.waitForAll(function(){n._raiseEvent("ready")})};ei.query=function(n,t){var i=yr!==undefined;i||(yr=0);yr++;new gl(n,t).execute(function(){ei.ready(n)})};gl.mixin({execute:ExoWeb.FunctionChain.prepare(function(n,t){this.batch=ExoWeb.Batch.start("context query");this.options.changes&&yp.call(this.context.server,this.options.changes);d.isActive()||(this._predictiveModelPending=d.pending(null,this,!0));u.register(this.context,{load:function(n,t,i,r,f){d.waitForAll(function(){u.unregister(n,this);r&&r instanceof Function&&r.call(f||this)},this,!0)}});n.call(t||this)},function(n,t){this.options.model&&(this.context.server.beginCapturingChanges(),ExoWeb.eachProp(this.options.model,function(n,t){if(!t.hasOwnProperty("from")||!t.hasOwnProperty("id")&&!t.hasOwnProperty("ids"))throw new Error('The model query "'+n+'" requires a from and id or ids clause.');if(t.hasOwnProperty("id")&&t.hasOwnProperty("ids"))throw new Error('The model query "'+n+'" must specify either id or ids, not both.');if(this.state[n]={signal:new ExoWeb.Signal("createContext."+n),isArray:!1},this._predictiveModelPending?delete this._predictiveModelPending:d.pending(null,this,!0),!t.hasOwnProperty("ids")||t.ids instanceof Array)if(!t.hasOwnProperty("id")||t.id instanceof Array){this.state[n].isArray=!0;var i=[];e.makeObservable(i);this.context.model[n]=i}else t.ids=[t.id],delete t.id;else t.ids=[t.ids];t.ids=ur(t.ids,yv(sy));t.newIds=dr(t.ids,vi(th()));t.normalized=ExoWeb.Model.PathTokens.normalizePaths(t.include);ut.addPaths(t.from,t.normalized);t.inScope!==!1&&t.ids.length>0&&(this.state[n].scopeQuery={from:t.from,ids:t.ids,include:t.include?t.include:[],inScope:!0,forLoad:!1})},this));this._predictiveModelPending&&(delete this._predictiveModelPending,d.oneDone());n.call(t||this)},function(n,t){var i=[],r=this.context.model.meta,e=this.options.instances,f=new ExoWeb.Signal("ContextQuery$fetchTypes");e&&(!this.options.types||this.options.types instanceof Array)&&hr(this.options.instances,function(n){var t=r.type(n);(!t||u.isRegistered(t))&&i.push(n)},this);this.options.types&&this.options.types instanceof Array&&this.options.types.map(function(n){return n.from||n}).filter(function(n){var t=r.type(n);return!t||u.isRegistered(t)}).forEach(function(n){i.contains(n)||i.push(n)});i.length>0&&li(r,i,f.pending(),this);this.options.model&&(!this.options.types||this.options.types instanceof Array)&&ExoWeb.eachProp(this.options.model,function(n,t){tw(this.context.model.meta,t.from,t.normalized,f.pending())},this);f.waitForAll(n,t)},function(n,t){if(this.options.instances||this.options.conditions||this.options.types&&!(this.options.types instanceof Array)){var i=new cu(this.context.model.meta,this.context.server,{instances:this.options.instances,conditions:this.options.conditions,types:this.options.types&&this.options.types instanceof Array?null:this.options.types,serverInfo:this.options.serverInfo});i.execute(function(){this.options.changes&&this.options.changes.forEach(function(n){n.type==="InitNew"&&rt(this.context.server.model,n.instance.type,null,!1,function(t){var i=t.meta.get(n.instance.id,!0);i&&(i.meta.isNew=!0)},this)},this);n.call(t||this)},this)}else n.call(t||this)},function(n,t){if(this.options.model&&ExoWeb.config.individualQueryLoading!==!0){var r=[],i;ExoWeb.eachProp(this.options.model,function(n,t){if(!t.load&&t.ids.length>0){var u=ExoWeb.Model.Model.getJsType(t.from,!0),f=ur(t.ids,function(i,r){if(!u)return!0;var f=u.meta.get(lu(this.context.server._translator,t.from,i),!1);if(f===undefined)return!0;this.state[n].isArray?this.context.model[n][r]=f:this.context.model[n]=f},this);f.length>0&&(i===undefined&&(i=new ExoWeb.Signal("batch query"),i.pending(null,this,!0)),i.waitForAll(this.state[n].signal.pending(null,this,!0),this,!0),r.push({from:t.from,ids:f,include:t.include||[],inScope:!0,forLoad:!0}))}},this);r.length>0&&ep(r,null,function(n){au(this.context.model.meta,n.instances,function(){n.conditions?rf(this.context.model.meta,n.conditions,null,function(){i.oneDone()}):i.oneDone()},this)},function(n){throw new Error(f("Failed to load batch query (HTTP: {0}, Timeout: {1})",n._statusCode,n._timedOut));},this)}n.call(t||this)},function(n,t){this.options.model&&ExoWeb.eachProp(this.options.model,function(n,t){t.load?(this.state[n].objectJson=t.load.instances,this.state[n].conditionsJson=t.load.conditions):ExoWeb.config.individualQueryLoading===!0&&rt(this.context.model.meta,t.from,null,!0,function(i){var u=ur(t.ids,function(r,u){var f=i.meta.get(lu(this.context.server._translator,t.from,r),!1);if(f===undefined)return!0;this.state[n].isArray?this.context.model[n][u]=f:this.context.model[n]=f},this),r,e;u.length>0&&(r=[],e=n,ExoWeb.eachProp(this.options.model,function(n){n!==e&&this.state[n].scopeQuery&&r.push(this.state[n].scopeQuery)},this),be(t.from,u,t.include||[],!0,null,r,this.state[n].signal.pending(function(t){this.state[n].objectJson=t.instances;this.state[n].conditionsJson=t.conditions},this,!0),this.state[n].signal.orPending(function(n){throw new Error(f("Failed to load {0}|{1} (HTTP: {3}, Timeout: {4})",t.from,t.ids,n._statusCode,n._timedOut));},this,!0),this))},this)},this);n.call(t||this)},function(n,t){this.options.model&&ExoWeb.eachProp(this.options.model,function(n,t){if(!t.load&&t.ids.length===0){var i=t.include?t.include.filter(function(n){return!n.startsWith("this.")&&!n.startsWith("this{")}):null;i&&i.length>0&&be(null,null,i,!1,null,d.pending(function(n){au(this.context.model.meta,n.instances,d.pending(function(){n.conditions&&rf(this.context.model.meta,n.conditions,null,d.pending())}),this)},this,!0),d.orPending(function(n){throw new Error(f("Failed to load {0}|{1} (HTTP: {2}, Timeout: {3})",t.from,t.ids,n._statusCode,n._timedOut));},this,!0))}},this);n.call(t||this)},function(n,t){this.options.model&&ExoWeb.eachProp(this.options.model,function(n,t){this.state[n].signal.waitForAll(function(){if(t.newIds&&d.pending(),!this.state[n].isArray&&this.context.model[n]||this.state[n].isArray&&!t.ids.some(function(t,i){return!this.context.model[n][i]})){d.oneDone();return}if(t.ids.length>0){var i=new et("processing response");this.state[n].objectJson&&(au(this.context.model.meta,this.state[n].objectJson,i.pending(null,this),this,!0),delete this.state[n].objectJson);i.waitForAll(this.state[n].signal.pending(function(){var i=this.context.model.meta.type(t.from);if(!i)throw new Error(f("Could not get type {0} required to process query results.",t.from));kr(t.ids,function(r,u){var f=lu(this.context.server._translator,t.from,r),e=i.get(f,!1);if(e==null)throw new Error("Could not get "+t.from+" with id = "+f+(r!==f?"("+r+")":"")+".");this.state[n].isArray||this.context.model[n]?this.state[n].isArray&&!this.context.model[n][u]&&(this.context.model[n][u]=e):this.context.model[n]=e},this);this.state[n].conditionsJson?rf(this.context.model.meta,this.state[n].conditionsJson,null,function(){d.oneDone()},this):d.oneDone()},this),this)}else d.oneDone();this.state[n].objectJson&&au(this.context.model.meta,this.state[n].objectJson,d.pending());t.newIds&&(this.state[n].signal.waitForAll(function(){this.state[n].isArray?foreach(t.newIds,function(i){this.context.model[n][i]=new(this.context.model.meta.type(t.from).get_jstype())},this):this.context.model[n]=new(this.context.model.meta.type(t.from).get_jstype())},this),d.oneDone())},this)},this,!0);n.call(t||this)},function(n,t){this.options.model&&ExoWeb.eachProp(this.options.model,function(n){this.state[n].scopeQuery&&vp.call(this.context.server,this.state[n].scopeQuery)},this);n.call(t||this)},function(n,t){d.waitForAll(function(){this.context.model.meta.notifyBeforeContextReady();ExoWeb.Batch.end(this.batch)},this,!0);n.call(t||this)})});Sys.activateDom=!1;th=function(){return"$newId"};n.$newId=th;var na=!1,uo,gi=[],ih=new ExoWeb.Functor,ta=new et,ff=null,rh=new ExoWeb.Functor,fo=new ExoWeb.Functor;n.$exoweb=sw;ef={};eo={};n.$extend=function(n,t,i){if(n==null)throw new l("typeInfo");if(Object.prototype.toString.call(n)==="[object Array]"){var r=new ExoWeb.Signal("extend"),u=[];n.forEach(function(n,t){if(n.constructor!==String)throw new h("typeInfo","string",n);uh(n,r.pending(function(n){u[t]=n}),i)});r.waitForAll(function(){t.apply(i||this,u)})}else if(n.constructor===String)uh(n,t,i);else throw new h("typeInfo","string|array",n);};n.$extendSubtypes=function(n,t,i){var f,r;if(n==null)throw new l("typeName");if(n.constructor!==String)throw new h("typeName","string",n);f=ExoWeb.Model.Model.getJsType(n,!0);f&&Array.forEach(f.meta.derivedTypes||[],function(n){n&&u.isLoaded(n)&&(t.call(i||this,n.get_jstype()),Array.forEach(n.derivedTypes||[],arguments.callee.spliceArguments(1,2)))});r=eo[n];r||(r=eo[n]=ExoWeb.Functor());r.add(i?t.bind(i):t)};n.$extendProperties=function(n,t,i,r){if(n==null)throw new l("typeName");if(n.constructor!==String)throw new h("typeName","string",n);t&&t instanceof Function&&(r=i,i=t,t=!1);uh(n,function(n){n.meta.get_properties().forEach(function(n){(t===!0||n.get_origin()!=="server")&&i.call(r||this,n,!0)});n.meta.addPropertyAdded(function(n,t){i.call(r||this,t.property,!1)})})};fh=["show","hide","enable","disable","render","dispose","addClass","removeClass"];g.mixin({link_show:function(){this._action==="show"&&r(this._element).is(".toggle-on")||this._action==="hide"&&r(this._element).is(".toggle-off")?this.set_state("on"):this.set_state("off")},add_showing:function(n){this._addHandler("showing",n)},remove_showing:function(n){this._removeHandler("showing",n)},add_hiding:function(n){this._addHandler("hiding",n)},remove_hiding:function(n){this._removeHandler("hiding",n)},do_show:function(){if(this._visible===undefined||this._visible===!1){var n=new pr;this._pendingEventArgs=n;this._visible===!1&&Sys.Observer.raiseEvent(this,"showing",n);n.waitForAll(function(){this._pendingEventArgs=null;this._effect=="slide"&&this._visible===!1?r(this._element).slideDown():this._effect=="fade"&&this._visible===!1?r(this._element).fadeIn():r(this._element).show();this.set_state("on");Sys.Observer.raiseEvent(this,"shown");this._visible=!0;this._pendingActions()},this,!0)}},do_hide:function(){if(this._visible===undefined||this._visible===!0){var n=new pr;this._pendingEventArgs=n;this._visible===!0&&Sys.Observer.raiseEvent(this,"hiding",n);n.waitForAll(function(){this._pendingEventArgs=null;this._effect=="slide"&&this._visible===!0?r(this._element).slideUp():this._effect=="fade"&&this._visible===!0?r(this._element).fadeOut():r(this._element).hide();this.set_state("off");Sys.Observer.raiseEvent(this,"hidden");this._visible=!1;this._pendingActions()},this,!0)}},add_on:function(n){this._addHandler("on",n)},remove_on:function(n){this._removeHandler("on",n)},add_off:function(n){this._addHandler("off",n)},remove_off:function(n){this._removeHandler("off",n)},add_shown:function(n){this._addHandler("shown",n)},remove_shown:function(n){this._removeHandler("shown",n)},add_hidden:function(n){this._addHandler("hidden",n)},remove_hidden:function(n){this._removeHandler("hidden",n)},get_visible:function(){return this._visible},link_disable:function(){this._action==="disable"&&r(this._element).is(".toggle-on")||this._action==="enable"&&r(this._element).is(".toggle-off")?(r("select,input,textarea,a,button,optgroup,option",this._element).andSelf().attr("disabled","disabled"),this.set_state("off")):this.set_state("on")},do_enable:function(){r("select,input,textarea,a,button,optgroup,option",this._element).andSelf().removeAttr("disabled");this.set_state("on")},do_disable:function(){r("select,input,textarea,a,button,optgroup,option",this._element).andSelf().attr("disabled","disabled");this.set_state("off")},link_render:function(){var t,n;if(this._context=null,this._action==="render"&&r(this._element).is(".toggle-on")||this._action==="dispose"&&r(this._element).is(".toggle-off")){if(t=this.get_templateContext(),!this._ctxIdx&&this._element.childNodes.length>0)throw new Error("A toggle control is attached to the node, which expects a template context id, but no id was specified.");n=new Sys.UI.TemplateContext(this._ctxIdx);n.data=t.dataItem;n.components=[];n.nodes=[];n.dataItem=t.dataItem;n.index=0;n.parentContext=t;n.containerElement=this._element;n.template=this._getTemplate();n.template._ensureCompiled();this._context=n;Sys.Application._linkContexts(t,this,t.dataItem,this._element,n,this._contentTemplate);n.initializeComponents();n._onInstantiated(null,!0);this.set_state("on");r(this._element).show()}else this.set_state("off"),r(this._element).hide()},init_render:function(){if(!this._template&&!r(this._element).is(".sys-template"))throw new Error('When using toggle in render/dispose mode, the element should be marked with the "sys-template" class.');this._template=new Sys.UI.Template(this._element);this._template._ensureCompiled();r(this._element).empty();r(this._element).removeClass("sys-template")},do_render:function(){var n,t,i;r(this._element).show();this._context||(n=this.get_templateContext(),t=new Sys.Data.DataEventArgs(n.dataItem),Sys.Observer.raiseEvent(this,"rendering",t),r(this._element).empty(),i=this._context=this._template.instantiateIn(this._element,n.dataItem,n.dataItem,0,null,n,this._contentTemplate),i.initializeComponents(),Sys.Observer.raiseEvent(this,"rendered",t));this.set_state("on")},do_dispose:function(){if(r(this._element).hide(),this._context){var n=new Sys.Data.DataEventArgs;Sys.Observer.raiseEvent(this,"rendering",n);this._context.dispose();this._context=null;r(this._element).empty();Sys.Observer.raiseEvent(this,"rendered",n)}this.set_state("off")},add_rendering:function(n){this._addHandler("rendering",n)},remove_rendering:function(n){this._removeHandler("rendering",n)},add_rendered:function(n){this._addHandler("rendered",n)},remove_rendered:function(n){this._removeHandler("rendered",n)},do_addClass:function(){var n=r(this._element);n.is("."+this._className)||(n.addClass(this._className),this.set_state("on"),Sys.Observer.raiseEvent(this,"classAdded"))},do_removeClass:function(){var n=r(this._element);n.is("."+this._className)&&(n.removeClass(this._className),this.set_state("off"),Sys.Observer.raiseEvent(this,"classRemoved"))},add_classAdded:function(n){this._addHandler("classAdded",n)},remove_classAdded:function(n){this._removeHandler("classAdded",n)},add_classRemoved:function(n){this._addHandler("classRemoved",n)},remove_classRemoved:function(n){this._removeHandler("classRemoved",n)}});g.mixin({link_hide:g.prototype.link_show,init_hide:g.prototype.init_show,undo_hide:g.prototype.do_show,undo_show:g.prototype.do_hide,link_enabled:g.prototype.link_disable,init_disable:g.prototype.init_enable,undo_disable:g.prototype.do_enable,undo_enable:g.prototype.do_disable,link_dispose:g.prototype.link_render,init_dispose:g.prototype.init_render,undo_render:g.prototype.do_dispose,undo_dispose:g.prototype.do_render,undo_addClass:g.prototype.do_removeClass,undo_removeClass:g.prototype.do_addClass});g.mixin({_generatesContext:function(){return this._action==="render"||this._action==="dispose"},_getTemplate:function(){return this._template},_setTemplate:function(n){this._template=n},_setTemplateCtxId:function(n){this._ctxIdx=n},get_templateContext:function(){return this._parentContext||(this._parentContext=Sys.UI.Template.findContext(this._element)),this._parentContext},set_templateContext:function(n){this._parentContext=n},get_action:function(){return this._action},set_action:function(n){if(!Array.contains(fh,n))throw new Error(f('Invalid toggle action "{0}". Possible values are "{1}".',n,fh.join(", ")));this._action=n;this.execute()},get_className:function(){return this._className},set_className:function(n){this._className=n;this._action||(this._action="addClass");this.execute()},get_class:function(){return c("The toggle:class property is deprecated (see issue #1). Consider using toggle:classname instead."),this._className},set_class:function(n){c("The toggle:class property is deprecated (see issue #1). Consider using toggle:classname instead.");this._className=n;this._action||(this._action="addClass");this.execute()},get_on:function(){return this._on},set_on:function(n){var t=n!==this._on;t?(this._on&&this._on instanceof Array&&e.removeCollectionChanged(this._on,this._collectionChangedHandler),this._on=n,this._on&&this._on instanceof Array&&(this._collectionChangedHandler=this.execute.bind(this),e.addCollectionChanged(this._on,this._collectionChangedHandler)),this.execute()):this._when&&this._when instanceof Function&&(this._on=n,this.execute())},get_when:function(){return this._when},set_when:function(n){this._when=n;this.execute()},set_strictMode:function(n){this._strictMode=n},get_strictMode:function(){return this._strictMode},get_groupName:function(){return this._groupName},set_groupName:function(n){this._groupName=n},get_effect:function(){return this._effect},set_effect:function(n){this._effect=n},get_state:function(){return this._state},set_state:function(n){this._state=n;this._stateClass(n);Sys.Observer.raiseEvent(this,n)},equals:function(){var t,n;if(this._when===undefined){if(t=Object.prototype.toString.call(this._on),this._strictMode===!0){if(this._on.constructor!==Boolean)throw new Error("With strict mode enabled, toggle:on should be a value of type Boolean.");return this._on}return t==="[object Array]"?this._on.length>0:!!this._on}if(this._when instanceof Function){if(n=this._when(this._on),this._strictMode===!0){if(n===null||n===undefined||n.constructor!==Boolean)throw new Error("With strict mode enabled, toggle:when function should return a value of type Boolean.");return n}return!!n}return this._on===this._when},canExecute:function(){return this.get_isInitialized()&&this._element!==undefined&&this._element!==null&&this.hasOwnProperty("_on")},execute:function(){if(this.canExecute()){var n=this[(this.equals()===!0?"do_":"undo_")+this._action].bind(this);this._pendingEventArgs?this._pendingActions.add(n,function(){return!this._pendingEventArgs}.bind(this),!0):n()}},addContentTemplate:function(){if(this._action!=="render"&&this._action!=="dispose"&&this.get_templateContext()===Sys.Application._context)throw Error.invalidOperation("invalidSysContentTemplate");Sys.UI.IContentTemplateConsumer.prototype.addContentTemplate.apply(this,arguments)},dispose:function(){this._template&&this._template.dispose();this._context&&this._context.dispose();this._action=this._className=this._collectionChangedHandler=this._contentTemplate=this._context=this._ctxIdx=this._groupName=this._on=this._parentContext=this._state=this._strictMode=this._template=this._visible=this._when=null;ExoWeb.UI.Toggle.callBaseMethod(this,"dispose")},link:function(){var n=this["link_"+this._action];n&&n.call(this);ExoWeb.UI.Toggle.callBaseMethod(this,"link")},initialize:function(){if(g.callBaseMethod(this,"initialize"),this._pendingActions=new ExoWeb.Functor,this.get_isLinkPending())this.link();else{var n=this["init_"+this._action];n&&n.call(this);this.execute()}},_stateClass:function(n){n=="on"?r(this._element).addClass("toggle-on").removeClass("toggle-off"):r(this._element).removeClass("toggle-on").addClass("toggle-off")}});ExoWeb.UI.Toggle=g;g.registerClass("ExoWeb.UI.Toggle",Sys.UI.Control,Sys.UI.ITemplateContextConsumer,Sys.UI.IContentTemplateConsumer);pr.prototype.pending=function(){return this._signal.pending.apply(this._signal,arguments)};pr.prototype.waitForAll=function(){this._signal.waitForAll.apply(this._signal,arguments)};ExoWeb.UI.ActionEventArgs=pr;pr.registerClass("ExoWeb.UI.ActionEventArgs",Sys.EventArgs);of.mixin({_execute:function(){this._visible.length===0&&this._children.length>0?r(this._element).hide():r(this._element).show()},_toggleAdded:function(n,t){t.control.get_groupName()!==this._name||Array.contains(this._children,t)||(this._children.push(t),t.control.get_state()==="on"&&this._add(t),t.control.add_on(this._onHandler),t.control.add_off(this._offHandler))},_toggleRemoved:function(n,t){Array.contains(this._children,t)&&(t.control.remove_on(this._onHandler),t.control.remove_off(this._offHandler),this._remove(t),this._children.remove(t),this._execute())},_toggleOn:function(n){this._add(n.get_element());this._execute()},_toggleOff:function(n){this._remove(n.get_element());this._execute()},get_name:function(){return this._name},set_name:function(n){this._name=n},_add:function(n){this._visible.indexOf(n)<0&&this._visible.push(n)},_remove:function(n){this._visible.remove(n)},initialize:function(){of.callBaseMethod(this,"initialize");this._children=[];this._visible=[];this._onHandler=this._toggleOn.bind(this);this._offHandler=this._toggleOff.bind(this);r(":toggle",this._element).ever(this._toggleAdded.bind(this),this._toggleRemoved.bind(this));this._execute()}});ExoWeb.UI.ToggleGroup=of;of.registerClass("ExoWeb.UI.ToggleGroup",Sys.UI.Control);oo={};wr.prototype={get_name:function(){return this._name},set_name:function(n){this._name=n},get_nameArray:function(){return this._name&&!this._nameArray&&(this._nameArray=this._name.trim().split(/\s+/)),this._nameArray},get_kind:function(){return this._kind},set_kind:function(n){this._kind=n},get_dataType:function(){return this._dataType},set_dataType:function(n){ExoWeb.isType(n,Function)?(this._dataType=ii(n),this._dataTypeCtor=n):ExoWeb.isType(n,String)&&(this._dataType=n)},get_dataTypeCtor:function(){return!this._dataTypeCtor&&ExoWeb.isType(this._dataType,String)&&(this._dataTypeCtor=ExoWeb.getCtor(this._dataType)),this._dataTypeCtor},get_isReference:function(){return this._isReference},set_isReference:function(n){if(n&&n.constructor===String){var t=n.toLowerCase().trim();t==="true"?n=!0:t==="false"?n=!1:(this._isReferenceText=n,n=null)}this._isReference=n},get_isList:function(){return this._isList},set_isList:function(n){if(n&&n.constructor===String){var t=n.toLowerCase().trim();t==="true"?n=!0:t==="false"?n=!1:(this._isListText=n,n=null)}this._isList=n},get_aspects:function(){if(!this._aspects){var n=this._aspects={};this._isList!==null&&this._isList!==undefined&&(n.isList=this._isList);this._isReference!==null&&this._isReference!==undefined&&(n.isReference=this._isReference);this.get_dataType()!==null&&this.get_dataType()!==undefined&&(n.dataType=this.get_dataTypeCtor())}return this._aspects},isCorrectKind:function(n){return n instanceof ExoWeb.View.Adapter?this._kind==="@":this._kind===undefined},_namesSatisfiedBy:function(n){return!this.get_nameArray()||!this.get_nameArray().some(function(t){return!n.contains(t)})},_aspectsSatisfiedBy:function(n){var t=!0;return hr(this.get_aspects(),function(i,r){if(!n.hasOwnProperty(i)||r===null||r===undefined||i!=="dataType"&&n[i]!==r||i==="dataType"&&n[i]!==r&&!(n[i]&&n[i].meta&&n[i].meta.isSubclassOf(r.meta)))return t=!1}),t},matches:function(n,t){if(this._namesSatisfiedBy(t)){var i;return n&&n.aspects&&n.aspects instanceof Function?i=n.aspects():(i={isList:n&&n instanceof Array,isReference:n&&n instanceof ExoWeb.Model.Entity},i.dataType=n===null||n===undefined?null:n instanceof ExoWeb.Model.Entity?n.meta.type.get_jstype():n instanceof Array?Array:n instanceof Object?Object:n.constructor),this._aspectsSatisfiedBy(i)}},toString:function(){return f('<{0} name="{1}" kind="{2}" datatype="{3}" isreference="{4}" islist="{5}" />',this._element.tagName.toLowerCase(),this._name||"",this._kind||"",this._dataType||"",wu(this._isReference)?"":this._isReference,wu(this._isList)?"":this._isList)},dispose:function(){this._aspects=this._contentTemplate=this._dataType=this._dataTypeCtor=this._isList=this._isListText=this._isReference=this._isReferenceText=this._kind=this._name=this._nameArray=null;ExoWeb.UI.Template.callBaseMethod(this,"dispose")},initialize:function(){if(wr.callBaseMethod(this,"initialize"),r(this._element).addClass("exoweb-template").hide(),this._element.control.constructor!==String){var t=this._element,i=t.tagName.toLowerCase(),n=oo[i];n||(n=oo[i]=[]);n.push(t)}}};ua=0;so=new ExoWeb.Signal("external templates");wr.load=function(n,t){var u="exoweb-templates-"+ua++,f=fa,e=fa=new ExoWeb.Signal(u),i=so.pending(e.pending(function(){Sys.Application.activateElement(this)}));r(function(){var e=r("<div id='"+u+"'/>").hide().appendTo("body"),s,o;t&&t.isLocal===!0?(s=r("#"+n),i.call(s.get(0))):(o=ExoWeb.cache(n),o?(e.append(o),i.call(e.get(0))):e.load(n,function(t,r,u){(u.state&&u.state()==="resolved"||u.isResolved&&u.isResolved())&&(ExoWeb.cache(n,t),f?f.waitForAll(i,this):i.call(this))}))})};ExoWeb.UI.Template=wr;wr.registerClass("ExoWeb.UI.Template",Sys.UI.Control,Sys.UI.IContentTemplateConsumer);ai=0;er("Content rendering",function(){return ai<0&&c("Number of content controls rendering should never dip below zero."),ai>0});sf.prototype={get_template:function(){return this._template},set_template:function(n){this._template=n},get_data:function(){return this._data},set_data:function(n){var t=(n===undefined||n===null)&&this._data!==undefined&&this._data!==null;this._changedHandler&&(e.removeCollectionChanged(this._data,this._changedHandler),delete this._changedHandler);this._data=n;n instanceof Array&&(this._changedHandler=this._collectionChanged.bind(this),e.addCollectionChanged(n,this._changedHandler));this.update(t)},get_disabled:function(){return this._disabled===undefined?!1:!!this._disabled},set_disabled:function(n){var t,i;if(n.constructor===Boolean)t=n;else if(n.constructor===String)t=n.toLowerCase()=="true"?!0:n.toLowerCase()=="false"?!1:undefined;else throw new Error('Invalid value for property "disabled": '+n);i=this._disabled;this._disabled=t;i===!0&&t===!1&&this.update()},get_contexts:function(){return[this._context]},get_templateContext:function(){return this._parentContext||(this._parentContext=Sys.UI.Template.findContext(this._element)),this._parentContext},set_templateContext:function(n){this._parentContext=n},get_isRendered:function(){return this._isRendered},add_rendering:function(n){this._addHandler("rendering",n)},remove_rendering:function(n){this._removeHandler("rendering",n)},add_rendered:function(n){this._addHandler("rendered",n)},remove_rendered:function(n){this._removeHandler("rendered",n)},add_error:function(n){this._addHandler("error",n)},remove_error:function(n){this._removeHandler("error",n)},_collectionChanged:function(){this.update(!0)},_initializeResults:function(){this._context&&this._context.initializeComponents()},_generatesContext:function(){return!0},_setTemplateCtxId:function(n){this._ctxIdx=n},_findTemplate:function(){var n,t;if(this._contentTemplate&&(n=this._contentTemplate),this._template&&(n?(n+=" ",n+=this._template):n=this._template),t=hw(this._element.tagName.toLowerCase(),this._data,n?n.trim().split(/\s+/):[]),!t)throw new Error(f("This content region does not match any available templates. Tag={0}, Data={1}, Template={2}",this._element.tagName.toLowerCase(),this._data,n||""));return t},_canRender:function(n){return(this._data!==undefined&&this._data!==null||n===!0)&&this.get_isInitialized()&&this._element!==undefined&&this._element!==null&&!this.get_disabled()},_getResultingTemplateNames:function(n){var i,t,r;return this._contentTemplate?(i=this._contentTemplate,this._template&&(i+=" "+this._template)):i=this._template?this._template:"",t=i.trim().split(/\s+/).distinct(),t.length>0&&(r=n.control.get_nameArray(),r&&dr(t,function(n){return r.indexOf(n)>=0})),n.control._contentTemplate&&t.addRange(n.control._contentTemplate.trim().split(/\s+/)),t},_render:function(){var t=this._element,f,i,e;if(r(t).empty(),f=this.get_templateContext(),this._context=null,i=this._data,i!==null&&i!==undefined){var u=this._findTemplate(),o=new Sys.UI.Template(u),n=r(u).attr("class");n&&(n=r.trim(n.replace("exoweb-template","").replace("sys-template","")),r(t).addClass(n));e=this._getResultingTemplateNames(u);this._context=o.instantiateIn(t,this._data,this._data,0,null,f,e.join(" "));this._initializeResults()}},_renderStart:function(n){this._canRender(n)&&(ai++,so.waitForAll(function(){if(this._element===undefined||this._element===null){ai--;return}var n=new Sys.Data.DataEventArgs(this._data);Sys.Observer.raiseEvent(this,"rendering",n);this._isRendered=!1;try{this._render();this._isRendered=!0;Sys.Observer.raiseEvent(this,"rendered",n)}finally{ai--}},this))},_link:function(){var f,t,i;if(!this._ctxIdx&&this._element&&this._element.childNodes.length>0)throw new Error("A content control is attached to the node, which expects a template context id, but no id was specified.");if(this._data!==null&&this._data!==undefined||this._element&&this._element.childNodes.length>0){var r=this.get_templateContext(),u=this._findTemplate(),n=new Sys.UI.TemplateContext(this._ctxIdx);for(n.data=this._data,n.components=[],n.nodes=[],n.dataItem=this._data,n.index=0,n.parentContext=r,n.containerElement=this._element,n.template=new Sys.UI.Template(u),n.template._ensureCompiled(),this._context=n,f=this._getResultingTemplateNames(u),t=this._element,Sys.Application._linkContexts(r,this,this._data,t,n,f.join(" ")),i=0;i<t.childNodes.length;i++)n.nodes.push(t.childNodes[i]);n._onInstantiated(null,!0);this._initializeResults()}},link:function(){this._linkInProgress||(this._linkInProgress=!0,ai++,so.waitForAll(function(){if(this._element===undefined||this._element===null){ExoWeb.UI.Content.callBaseMethod(this,"link");ai--;return}try{delete this._linkInProgress;this._isRendered=!0;this._context=null;this._link();ExoWeb.UI.Content.callBaseMethod(this,"link")}finally{ai--}},this))},update:function(n){this.get_isLinkPending()?this.hasOwnProperty("_data")&&this.link():this._canRender(n)&&this._renderStart(n)},dispose:function(){this._context&&this._context.dispose();this._changedHandler&&(e.removeCollectionChanged(this._data,this._changedHandler),this._changedHandler=null);this._contentTemplate=this._context=this._ctxIdx=this._data=this._disabled=this._isRendered=this._parentContext=this._template=null;ExoWeb.UI.Content.callBaseMethod(this,"dispose")},initialize:function(){sf.callBaseMethod(this,"initialize");r(this._element).is(".sys-template")&&(r(this._element).children().length>0?c('Content control is marked with the "sys-template" class, which means that its children will be ignored and discarded.'):c('No need to mark a content control with the "sys-template" class.'));this.update()}};ExoWeb.UI.Content=sf;sf.registerClass("ExoWeb.UI.Content",Sys.UI.Control,Sys.UI.ITemplateContextConsumer,Sys.UI.IContentTemplateConsumer);hf=0;er("DataView rendering",function(){return hf<0&&c("Number of dataview controls rendering should never dip below zero."),hf>0});ea=Sys.UI.DataView.prototype.refresh;Sys.UI.DataView.prototype.refresh=function(){hf++;this.get_element()?ea.apply(this,arguments):c("Attempting to refresh, but DataView was being disposed.");hf--};cf.prototype={get_source:function(){return this._source},set_source:function(n){this._source=n},get_loadingClass:function(){return this._loadingClass},set_loadingClass:function(n){this._loadingClass=n},get_url:function(){return this._url},set_url:function(n){this._url=n},get_path:function(){var n=this.get_source(),t=this.get_url();return n instanceof ExoWeb.Model.Entity&&(t=n.toString(t)),f(t,n)},initialize:function(){cf.callBaseMethod(this,"initialize");var i=this.get_path(),n=this.get_element(),t=this.get_loadingClass();r(n).addClass(t);r(n).load(i,function(i,u){if(r(n).removeClass(t),u!="success"&&u!="notmodified")throw new Error("Failed to load html: status = "+u);})}};ExoWeb.UI.Html=cf;cf.registerClass("ExoWeb.UI.Html",Sys.UI.Control);lf.prototype={get_script:function(){return this._script},set_script:function(n){this._script=n},get_scriptObject:function(){if(!this._scriptObject){var t=this._script.startsWith("window")?this._script.substring(7):this._script;this._scriptObject=ExoWeb.evalPath(n,t)}return this._scriptObject},get_typeName:function(){return this._typeName},set_typeName:function(n){this._typeName=n},get_class:function(){return c("The behavior:class property is deprecated (see issue #1). Consider using behavior:typename instead."),this._typeName},set_class:function(n){c("The behavior:class property is deprecated (see issue #1). Consider using behavior:typename instead.");this._typeName=n},get_dontForceLoad:function(){return this._dontForceLoad},set_dontForceLoad:function(n){this._dontForceLoad=n},get_ctorFunction:function(){return this._ctorFunction||(this._ctorFunction=ExoWeb.getCtor(this._typeName)),this._ctorFunction},get_properties:function(){var n,t,i;if(!this._properties){this._properties={};for(n in this)if(n.startsWith("prop_")&&!n.startsWith("prop_add_")){if(t=this.get_ctorFunction(),!t)throw new Error(f("Could not evaulate type '{0}'.",this._typeName));if(i=Sys.Application._mapToPrototype(n.substring(5),t),!i)throw new Error(f("Property '{0}' could not be found on type '{1}'.",n.substring(5),this._typeName));this._properties[i]=this[n]}}return this._properties},get_events:function(){var n,t,i;if(!this._events){this._events={};for(n in this)if(n.startsWith("prop_add_")){if(t=this.get_ctorFunction(),!t)throw new Error(f("Could not evaulate type '{0}'.",this._typeName));if(i=Sys.Application._mapToPrototype(n.substring(9),t),!i)throw new Error(f("Event '{0}' could not be found on type '{1}'.",n.substring(9),this._typeName));this._events[i]=this[n]}}return this._events},_create:function(){r.contains(document.body,this._element)&&(this._behavior=t(this.get_ctorFunction(),this.get_properties(),this.get_events(),null,this._element))},initialize:function(){lf.callBaseMethod(this,"initialize");this._dontForceLoad?this._create():Sys.require([this.get_scriptObject()],this._create.bind(this))}};ExoWeb.UI.Behavior=lf;lf.registerClass("ExoWeb.UI.Behavior",Sys.UI.Control);ExoWeb.UI.getParentContext=eh;ExoWeb.UI.getParentContextData=function(){return eh.apply(this,arguments).data};n.$parentContextData=function(n,t,i,r,u){return eh({target:n,index:t,level:i,dataType:r,ifFn:u}).data};n.$isLast=lw;Sys._Application.mixin(nt.eventing);Sys._Application.prototype.addBeforeCreateAdapter=function(n){this._addEvent("beforeCreateAdapter",n)};Sys._Application.prototype.removeBeforeCreateAdapter=function(n){this._removeEvent("beforeCreateAdapter",n)};Sys.Application.registerMarkupExtension("@",function(n,t,i,r){var o,u,f,s;if(r.required&&c('Adapter markup extension does not support the "required" property.'),o=r.path||r.$default,delete r.$default,r.source?(u=r.source,delete r.source):u=i.dataItem,o)Sys.Application._raiseEvent("beforeCreateAdapter",[Sys.Application,{source:u,path:o,properties:r}]),f=new kt(u,o,r.format,r),i.components.push(f);else{if(!(u instanceof kt))throw new Error('No path was specified for the "@" markup extension, and the source is not an adapter.');for(s in r)if(r.hasOwnProperty(s)&&s!=="isLinkPending")throw new Error('Additional adapter properties cannot be specified when deferring to another adapter (no path specified). Found property "'+s+'".');f=u}f.ready(function(){e.setValue(n,t,f)})},!1);oh=[];sa=/^set_(.*)$/;ExoWeb.eachProp(Sys.Binding.prototype,function(n){var t=sa.exec(n);t&&oh.push(t[1])});Sys.Application.registerMarkupExtension("#",function(n,t,i,r){var u,e,f,o;r.required&&c('Meta markup extension does not support the "required" property.');Sys.Component.isInstanceOfType(n)?e=n.get_element():Sys.UI.DomElement.isDomElement(n)&&(e=n);u=Sys._merge({source:i.dataItem,templateContext:i,target:n,targetProperty:t,property:e.nodeName==="SELECT"?"systemValue":"displayValue"},r);delete r.$default;for(f in r)r.hasOwnProperty(f)&&oh.indexOf(f)>=0&&delete r[f];u.path=u.path||u.$default;delete u.$default;o=u.source=new kt(u.source||i.dataItem,u.path,u.format,r);u.path=u.property;delete u.property;i.components.push(o);i.components.push(Sys.Binding.bind(u))},!1);Sys.Application.registerMarkupExtension("?",function(n,t,i,r){function l(){var l=c(),i=o.conditions().filter(function(n){return(!s||s.indexOf(n.type.code)>=0)&&(!h||sc(h,n.type.sets.map(function(n){return n.name})).length>0)&&(!c||n.targets.some(function(n){return n.target===l}))});if(u.single===!0){if(i.length>1)throw new Error(f('Multiple conditions were found for type "{0}".',u.type));i=i.length===0?null:i[0]}e.setValue(n,r.targetProperty||t,i)}var u=Sys._merge({source:i.dataItem,templateContext:i,targetProperty:t},r),o=u.source.meta;u.type=u.type||u.$default;delete u.$default;u.single=u.single&&(u.single===!0||u.single.toString().toLowerCase()==="true");var s=u.type?u.type.split(","):null,h=u.set?u.set.split(","):null,c=function(){return u.target&&u.target.constructor===String?sr(u.source,u.target):u.target};l();o.addConditionsChanged(l,o)},!1);vu.mixin({_setTarget:function(n){this._isTargetElement&&(this._targetPath==="innerText"||this._targetPath==="innerHTML")?(n&&!ir(n)&&(n=n.toString()),Sys.Application._clearContent(this._target),this._targetPath==="innerHTML"?this._target.innerHTML=n:this._target.appendChild(document.createTextNode(n)),e.raisePropertyChanged(this._target,this._targetPath)):this._isTargetElement&&n===null?e.setValue(this._target,this._targetPath,""):e.setValue(this._target,this._targetPath,n)},_queue:function(n){if(this._pendingValue){this._pendingValue=n;return}this._pendingValue=n;s.whenDone(function(){var n=this._pendingValue;(delete this._pendingValue,this._disposed!==!0)&&this._setTarget(n)},this)},_getValue:function(n){if(n===null){if(this._options.hasOwnProperty("nullValue"))return this._options.nullValue}else{if(this._options.format)return ti(n.constructor,this._options.format).convert(n);if(this._options.transform){this._transformFn||(this._transformFn=new Function("list","$index","$dataItem","return $transform(list, true)."+this._options.transform+";"));var t=this._transformFn(n,this._templateContext.index,this._templateContext.dataItem);if(t.live!==or.prototype.live)throw new Error('Invalid transform result: may only contain "where", "orderBy", "select", "selectMany", and "groupBy".');return t.live()}}return n},_require:function(t,i){var f=this._valueRevision=ExoWeb.randomText(8,!0),r=!0;u.evalAll(t,this._options.required,function(){this._value&&this._value===t&&this._valueRevision===f&&(r?i.call(this):n.setTimeout(i.bind(this),1))},null,null,this,u.evalAll,!1,t,[],!0);r=!1},_update:function(n,t,i){this._disposed!==!0&&(this._collectionChangedHandler&&(e.removeCollectionChanged(this._value,this._collectionChangedHandler),delete this._value,delete this._collectionChangedHandler),this._value=n,n&&n instanceof Array&&this._options.required&&(this._collectionChangedHandler=this._collectionChanged.bind(this),e.makeObservable(n),e.addCollectionChanged(n,this._collectionChangedHandler)),this._options.required?this._updateWatchedItems(n,t,i,function(){this._queue(this._getValue(n))}):this._queue(this._getValue(n)))},_updateWatchedItems:function(n,t,i,r){t&&t.length>0&&(t.forEach(function(n){e.removePathChanged(n,this._options.required,this._watchedItemPathChangedHandler)},this),delete this._watchedItemPathChangedHandler);n?this._require(n,function(){this._disposed!==!0&&(i&&i.length>0&&(this._watchedItemPathChangedHandler=this._watchedItemPathChanged.bind(this),kr(i,function(n){e.addPathChanged(n,this._options.required,this._watchedItemPathChangedHandler,!0)},this)),r&&r.call(this))}):r&&r.call(this)},_collectionChanged:function(n,t){if(this._options.required){var i=t.get_changes().mapToArray(function(n){return n.oldItems||[]}),r=t.get_changes().mapToArray(function(n){return n.newItems||[]});this._updateWatchedItems(n,i,r)}},_watchedItemPathChanged:function(){this._update(this._sourcePathResult)},_sourcePathChanged:function(){var n=this._sourcePathResult;this._sourcePathResult=sr(this._source,this._sourcePath);n!==this._sourcePathResult&&this._update(this._sourcePathResult,af(n),af(this._sourcePathResult))},_evalSuccess:function(t,i,r){if(this._source=r,!this._disposed)if(delete this._evalSuccessHandler,this._sourcePath&&(this._sourcePathChangedHandler=this._sourcePathChanged.bind(this),e.addPathChanged(this._source,this._sourcePath,this._sourcePathChangedHandler,!0)),this._sourcePathResult=t,this._updateImmediately)this._update(t,null,af(t));else{var u=this;n.setTimeout(function(){u._update(t,null,af(t))},1)}},_evalFailure:function(n){if(!this._disposed){delete this._evalFailureHandler;throw new Error(f("Couldn't evaluate path '{0}', {1}",this._sourcePath,n));}},dispose:function(){this._disposed||(this._disposed=!0,this._collectionChangedHandler&&(e.removeCollectionChanged(this._value,this._collectionChangedHandler),this._collectionChangedHandler=null),this._sourcePathChangedHandler&&(e.removePathChanged(this._source,this._sourcePath,this._sourcePathChangedHandler),this._sourcePathChangedHandler=null),this._watchedItemPathChangedHandler&&(af(this._sourcePathResult).forEach(function(n){e.removePathChanged(n,this._options.required,this._watchedItemPathChangedHandler)},this),this._watchedItemPathChangedHandler=null),this._evalSuccessHandler&&(this._evalSuccessHandler=null),this._evalFailureHandler&&(this._evalFailureHandler=null),this._isTargetElement=this._options=this._pendingValue=this._source=this._sourcePath=this._sourcePathResult=this._target=this._targetPath=this._templateContext=this._transformFn=this._value=this._valueRevision=null);vu.callBaseMethod(this,"dispose")}});ExoWeb.View.Binding=vu;vu.registerClass("ExoWeb.View.Binding",Sys.Component,Sys.UI.ITemplateContextConsumer);Sys.Application.registerMarkupExtension("~",function(t,i,r,u){var e,s,l=u.path||u.$default||null,h,o,f,c;u.source?u.source.constructor===String?(h=new Function("$element","$index","$dataItem","$context","return "+u.source+";"),o=null,Sys.Component.isInstanceOfType(t)?o=t.get_element():Sys.UI.DomElement.isDomElement(t)&&(o=t),e=h(o,r.index,r.dataItem,r),s=[]):e=u.source:r.dataItem?e=r.dataItem:(e=n,s=[]);f={};u.hasOwnProperty("required")&&(f.required=u.required);u.hasOwnProperty("transform")&&(f.transform=u.transform);u.hasOwnProperty("format")&&(f.format=u.format);u.hasOwnProperty("nullValue")&&(f.nullValue=u.nullValue);c=new vu(r,e,l,t,u.targetProperty||i,f,s);r.components.push(c)},!1);kt.mixin({_extendProperties:function(n){var u,t,i,r;if(n){u=["label","helptext"];this.isType(Boolean)&&u.push("nullOption");this._extendedProperties=[];for(t in n)(i=this["get_"+t],r=this["set_"+t],!i||Array.contains(u,t))&&(this._extendedProperties.push(t),i&&i instanceof Function||(i=this["get_"+t]=function(n,t){return function(){return n["_"+t]}}(this,t)),r&&r instanceof Function||(r=this["set_"+t]=function(n,t){return function(i){n["_"+t]=i}}(this,t)),r.call(this,n[t]))}},_initPropertyChain:function(){var t,n;if(this._target instanceof kt){if(!this._target.get_isEntity())throw new Error("Adapter source is not an entity.");t=this._target._propertyChain.get_jstype().meta}else{if(n=this._target,!(n instanceof v))throw new Error("Adapter source is not an entity, found "+(n!=null?typeof n:"null"));t=n.meta.type}if(this._propertyChain=a.property(this._propertyPath,t),!this._propertyChain)throw new Error(f('Property "{0}" could not be found.',this._propertyPath));this._target instanceof kt&&(this._propertyChain instanceof k&&(this._propertyChain=new it(this._propertyChain.get_containingType(),[this._propertyChain],[])),this._propertyChain.prepend(this._target.get_propertyChain()),this._parentAdapter=this._target,this._target=this._target.get_target())},_loadForFormatAndRaiseChange:function(n){nu(function(){var t=new ExoWeb.Signal("Adapter.displayValue");this._doForFormatPaths(n,function(i){ee(function(){u.evalAll(n,i,t.pending(),t.orPending(),null,null,function(){ee(u.evalAll.bind(this,arguments))},!1,n,[])},this)});t.waitForAll(function(){e.raisePropertyChanged(this,"displayValue");e.raisePropertyChanged(this,"systemValue")},this)},this)},_doForFormatPaths:function(n,t,i){n!==undefined&&n!==null&&this._format&&this._format.getPaths().forEach(t,i||this)},_unsubscribeFromFormatChanges:function(n){this._doForFormatPaths(n,function(n){var t=this._formatSubscribers[n];t&&t.chain&&t.chain.removeChanged(t.handler)})},_subscribeToFormatChanges:function(n){this._doForFormatPaths(n,function(t){a.property(t,this._propertyChain.lastProperty().get_jstype().meta,!0,function(i){var r=this._formatSubscribers[t]={chain:i,handler:this._loadForFormatAndRaiseChange.bind(this).prependArguments(n)},u=n instanceof Array?n:[n];u.forEach(function(n){i.addChanged(r.handler,n,!1,!0)})},this)})},_ensureObservable:function(){var n=this,t;this._observable||(e.makeObservable(this),this._targetChangedHandler=this._onTargetChanged.bind(this),this._propertyChain.addChanged(this._targetChangedHandler,this._target,!1,!0),this._formatSubscribers={},this._propertyChain.lastTarget(this._target)&&(t=this._propertyChain.value(this._target),this._subscribeToFormatChanges(t)),this._propertyChain.addChanged(function(t,i){n._unsubscribeFromFormatChanges(i.oldValue);n._subscribeToFormatChanges(i.newValue)},this._target,!1,!0),this._observable=!0)},_onTargetChanged:function(n,t){var l=this,s=this.get_rawValue(),r,o;if(this._settingRawValue||u.eval(s,null,function(){e.raisePropertyChanged(l,"rawValue")}),this._loadForFormatAndRaiseChange(s),r=this._propertyChain.properties(),o=r.length,o>1&&t.triggeredBy!==this._propertyChain.lastProperty()){if(t.oldValue){for(var h,c=r.indexOf(t.triggeredBy)+1,f=this._propertyChain.lastTarget(this._target),i=t.oldValue;i&&c<o-1;)h=r[c++],i=h.value(i);i&&i!==f&&(this.get_conditions().clear(),this._conditionsChangedHandler&&i.meta.removeConditionsChanged(this._conditionsChangedHandler))}this.get_conditions()&&f&&(this.get_conditions().addRange(f.meta.conditions(this.get_propertyChain().lastProperty())),this._conditionsChangedHandler&&f.meta.addConditionsChanged(this._conditionsChangedHandler,this.get_propertyChain()))}this._settingRawValue||(this._options&&Array.forEach(this._options,function(n){(t.newValue instanceof Array||n.get_rawValue()==t.newValue||n.get_rawValue()==t.oldValue)&&e.raisePropertyChanged(n,"selected")}),ha.call(this),yu.call(this))},_setValue:function(n){var t=this._propertyChain,i;this._formatError&&(this.get_conditions().remove(this._formatError),this._formatError=undefined);n instanceof ExoWeb.Model.FormatError?(this._formatError=n.createCondition(t.lastTarget(this._target),t.lastProperty()),this.get_conditions().insert(0,this._formatError)):(i=t.value(this._target)!==n,this.set_rawValue(n,i))},ready:function(n,t){this._readySignal.waitForAll(n,t,!0)},toString:function(){var t,n;t=this._target===null?"null":this._target===undefined?"undefined":ii(this._target.constructor);try{n=this.get_rawValue();n===null?n="null":n===undefined?n="undefined":n.constructor!==String&&(n=n.toString())}catch(i){n="[error]"}return f("<{0}>.{1}: {2}",[t,this._propertyPath,n])},isType:function(n){if(this._jstype&&this._jstype instanceof Function)return this._jstype===n;for(var t=this._propertyChain.get_jstype();t!==null;t=t.getBaseType())if(t===n)return!0;return!1},aspects:function(){return this._aspects||(this._aspects={isList:this.get_isList(),isReference:this.get_isEntity()||this.get_isEntityList(),dataType:this.get_dataType()}),this._aspects},get_isList:function(){return this._propertyChain.get_isList()},get_isEntity:function(){return this._propertyChain.get_isEntityType()},get_isEntityList:function(){return this._propertyChain.get_isEntityListType()},get_isStatic:function(){return this._propertyChain.get_isStatic()},get_target:function(){return this._target},get_propertyPath:function(){return this._propertyPath},get_propertyChain:function(){return this._propertyChain},get_format:function(){return this._format},get_dataType:function(){return this._propertyChain.get_jstype()},get_label:function(){return this._label||this._propertyChain.get_label()},get_helptext:function(){return this._helptext||this._propertyChain.get_helptext()||""},get_nullOption:function(){return this.isType(Boolean)?this.hasOwnProperty("_nullOption")?this._nullOption:!1:!0},get_values:function(){if(this._ensureObservable(),this.get_isList()){var n=this,t=this._propertyChain.value(this._target);return t.map(function(t,i){return new ch(n,i)})}throw new Error("Adapter values are only available for list properties.");},get_rawValue:function(){return this._ensureObservable(),this._propertyChain.value(this._target)},set_rawValue:function(n,t){var r=this._propertyChain,i,u;if(t===undefined&&(t=r.value(this._target)!==n),t){this._settingRawValue=!0;try{i=this._target;u=i===null?"null":i===undefined?"undefined":i instanceof ExoWeb.Model.Entity?i.meta.type.get_fullName():i instanceof ExoWeb.View.Adapter?"Adapter":i instanceof ExoWeb.View.OptionAdapter?"OptionAdapter":i instanceof ExoWeb.View.OptionGroupAdapter?"OptionGroupAdapter":ii(i.constructor);ExoWeb.config.enableBatchChanges?context.server.batchChanges(f("adapter: {0}.{1}",u,this._propertyPath),function(){r.value(i,n)}):r.value(i,n)}finally{this._settingRawValue=!1}}},get_systemValue:function(){var n=this.get_rawValue();return this.get_isEntity()?n?v.toIdString(n):"":this.isType(Boolean)?n===!0?"true":n===!1?"false":"":this.isType(String)?n:(c("Possible incorrect usage of systemValue for a type that is not supported"),n?n.toString():"")},set_systemValue:function(n){if(this.get_isEntity())if(n){var t=v.fromIdString(n);u.isRegistered(t)?u.load(t,null,!0,function(){this._setValue(t)},this):this._setValue(t)}else this._setValue(null);else if(this.isType(Boolean))n==="true"?this._setValue(!0):n==="false"?this._setValue(!1):this._setValue(null);else if(this.isType(String))n?this._setValue(n):this._setValue(null);else throw new Error("Cannot set systemValue property of Adapters for non-entity types.");},get_displayValue:function(){var t,n=this.get_rawValue();return t=this._format?n instanceof Array?n.map(function(n){return this._format.convert(n)},this):this._format.convert(n):n instanceof Array?n.map(function(n){return n===null||n===undefined?"":n.toString()},this):n===null||n===undefined?"":n.toString(),t instanceof Array?t.join(", "):t},set_displayValue:function(t){var i,r,u;if(this.get_isEntity())throw new Error("Cannot set displayValue property of Adapters for entity types.");else if(this.get_isList())throw new Error("Cannot set displayValue property of Adapters for list types.");else i=t,t=this._format?this._format.convertBack(t):t,this._setValue(t),!ExoWeb.config.autoReformat||t instanceof ExoWeb.Model.FormatError||(r=this.get_displayValue(),i!=r&&(u=this,n.setTimeout(function(){e.raisePropertyChanged(u,"displayValue")},1)))},dispose:function(){var u=this._disposed,t=null,i,n,f,r;if(!u){if(this._disposed=!0,ha.call(this),t=this._options,this._extendedProperties){for(i=this._extendedProperties,n=0,f=i.length;n<f;n++)this["_"+i[n]]=null;this._extendedProperties=null}this._targetChangedHandler&&(this._propertyChain.removeChanged(this._targetChangedHandler),this._targetChangedHandler=null);this._unsubscribeFromFormatChanges(this.get_rawValue());r=this._propertyChain.lastTarget(this._target);r&&this._conditionsChangedHandler&&r.meta.removeConditionsChanged(this._conditionsChangedHandler);this._allowedValues=this._allowedValuesMayBeNull=this._aspects=this._format=this._formatSubscribers=this._helptext=this._jstype=this._settingRawValue=this._label=this._observable=this._options=this._allowedValuesTransform=this._parentAdapter=this._propertyChain=this._propertyPath=this._readySignal=this._target=null}kt.callBaseMethod(this,"dispose");u||(e.disposeObservable(this),t&&t.forEach(e.disposeObservable))}});kt.mixin({get_conditions:function(){var n,t,i;return this._conditions||(n=this.get_propertyChain().lastTarget(this._target),t=this._conditions=n?n.meta.conditions(this.get_propertyChain().lastProperty()):[],e.makeObservable(this._conditions),n&&(i=this._conditionsChangedHandler=aw.prependArguments(t),n.meta.addConditionsChanged(i,this.get_propertyChain()))),this._conditions},get_firstErrorOrWarning:function(){var n,t;return this.hasOwnProperty("_firstErrorOrWarning")||(n=this.get_conditions(),this._firstErrorOrWarning=ho(n,!0),t=this,n.add_collectionChanged(function(){var i=ho(n,!0);t._firstErrorOrWarning!==i&&(t._firstErrorOrWarning=i,e.raisePropertyChanged(t,"firstErrorOrWarning"))})),this._firstErrorOrWarning},get_firstError:function(){var n,t;return this.hasOwnProperty("_firstError")||(n=this.get_conditions(),this._firstError=ho(n),t=this,n.add_collectionChanged(function(){var i=ho(n);t._firstError!==i&&(t._firstError=i,e.raisePropertyChanged(t,"firstError"))})),this._firstError},get_hasError:function(){var t,n;return this.hasOwnProperty("_hasError")||(t=this.get_conditions(),this._hasError=!!this.get_firstError(),n=this,t.add_collectionChanged(function(){var t=!!n.get_firstError();n._hasError!==t&&(n._hasError=t,e.raisePropertyChanged(n,"hasError"))})),this._hasError}});kt.mixin({get_options:function(){var f,n,i,t,r;if(!this.hasOwnProperty("_options"))if(this.isType(Boolean))this._options=[sh.call(this,!0),sh.call(this,!1)];else{if(f=this._propertyChain.lastProperty(),n=f.rule(ExoWeb.Model.Rule.allowedValues),!n){this._allowedValuesRuleExistsHandler=vw.bind(this);f.addRuleRegistered(this._allowedValuesRuleExistsHandler);this._options=null;return}if(i=this._propertyChain.lastTarget(this._target),t=n.values(i,!!this._allowedValuesMayBeNull),t===undefined&&(n.source instanceof k||n.source instanceof it)){c("Adapter forced eval of allowed values. Rule: "+n);u.eval(n.source.get_isStatic()?null:i,n.source.get_path(),yu.bind(this));this._options=null;return}if(!t){this._allowedValuesExistHandler=yw.bind(this);n.addChanged(this._allowedValuesExistHandler,i);n.ignoreValidation||hh.call(this);this._options=null;return}if(u.isRegistered(t)){c("Adapter forced loading of allowed values list. Rule: "+n);u.load(t,null,!0,yu.bind(this),this);this._options=null;return}if(n.ignoreValidation||hh.call(this,t),r=t.slice(),ExoWeb.Observer.makeObservable(r),this._allowedValuesChangedHandler=pw.bind(this).prependArguments(r),n.addChanged(this._allowedValuesChangedHandler,i,!1,!0),this._allowedValuesTransform){if(transformedAllowedValues=new Function("$array","{ return $transform($array, true)."+this._allowedValuesTransform+"; }")(r),transformedAllowedValues.live!==or.prototype.live)throw new Error('Invalid options transform result: may only contain "where", "orderBy", "select", "selectMany", and "groupBy".');}else transformedAllowedValues=$transform(r,!0);this._options=transformedAllowedValues.select(sh.bind(this)).live()}return this._options}});ExoWeb.View.Adapter=kt;kt.registerClass("ExoWeb.View.Adapter",Sys.Component,Sys.UI.ITemplateContextConsumer);vf.prototype={_loadForFormatAndRaiseChange:function(n){if(n===undefined||n===null){e.raisePropertyChanged(this,"displayValue");e.raisePropertyChanged(this,"systemValue");return}var t=new ExoWeb.Signal("OptionAdapter.displayValue");this._parent._doForFormatPaths(n,function(i){u.evalAll(n,i,t.pending())},this);t.waitForAll(function(){e.raisePropertyChanged(this,"displayValue");e.raisePropertyChanged(this,"systemValue")},this)},_subscribeToFormatChanges:function(n){this._parent._doForFormatPaths(n,function(t){a.property(t,n.meta.type,!0,function(i){var r=this._formatSubscribers[t]={chain:i,handler:this._loadForFormatAndRaiseChange.bind(this).prependArguments(n)};i.addChanged(r.handler,n)},this)},this)},_ensureObservable:function(){this._observable||(e.makeObservable(this),this._formatSubscribers={},this._subscribeToFormatChanges(this._obj),this._observable=!0)},get_parent:function(){return this._parent},get_rawValue:function(){return this._obj},get_displayValue:function(){var n=this._parent.get_format();return n?n.convert(this._obj):this._obj},set_displayValue:function(n){if(this._parent.get_isEntity())throw new Error("Cannot set displayValue property of OptionAdapters for entity types.");else{var t=this.get_selected();t&&this.set_selected(!1);n=this._format?this._format.convertBack(n):n;this._obj=n;t&&this.set_selected(!0)}},get_systemValue:function(){return this._obj===null||this._obj===undefined?"":this._parent.get_isEntity()?v.toIdString(this._obj):this._obj.toString()},get_selected:function(){var n=this._parent.get_rawValue();return n instanceof Array?Array.contains(n,this._obj):n===this._obj},set_selected:function(n){var t=this._parent.get_rawValue();if(t instanceof Array){this._parent._settingRawValue=!0;try{n&&!Array.contains(t,this._obj)?t.add(this._obj):!n&&Array.contains(t,this._obj)&&t.remove(this._obj)}finally{this._parent._settingRawValue=!1}}else n?this._parent.set_rawValue(this._obj):this._parent.set_rawValue(null)},get_conditions:function(){return this._parent.get_conditions()}};ExoWeb.View.OptionAdapter=vf;ch.prototype={_loadForFormatAndRaiseChange:function(n){if(n===undefined||n===null){e.raisePropertyChanged(this,"displayValue");e.raisePropertyChanged(this,"systemValue");return}var t=new ExoWeb.Signal("ListValueAdapter.displayValue");this._parent._doForFormatPaths(n,function(i){u.evalAll(n,i,t.pending())},this);t.waitForAll(function(){e.raisePropertyChanged(this,"displayValue");e.raisePropertyChanged(this,"systemValue")},this)},_ensureObservable:function(){this._observable||(e.makeObservable(this),this._formatSubscribers={},this._observable=!0)},get_parent:function(){return this._parent},get_isEntity:function(){return this._parent.get_isEntity()},get_options:function(){var n=this;return this._parent.get_options().map(function(t){return new vf(n,t._obj)})},get_rawValue:function(){return this._parent.get_rawValue()[this._index]},get_displayValue:function(){var n=this._parent._format,t=this._parent.get_rawValue()[this._index];return n?n.convert(t):t},set_displayValue:function(n){if(this._parent.get_isEntity())throw new Error("Cannot set displayValue property of OptionAdapters for entity types.");else{n=this._format?this._parent._format.convertBack(n):n;var t=this._parent.get_rawValue();t.beginUpdate();t.removeAt(this._index);t.insert(this._index,n);t.endUpdate()}},get_systemValue:function(){return this._obj===null||this._obj===undefined?"":this._parent.get_isEntity()?v.toIdString(this._obj):this._obj.toString()},get_conditions:function(){return this._parent.get_conditions()},_doForFormatPaths:function(n,t,i){return this._parent._doForFormatPaths(n,t,i)},get_format:function(){return this._parent._format}};ExoWeb.View.ListValueAdapter=ch;lo.prototype={get_parent:function(){return this._parent},get_rawValue:function(){return this._obj},get_displayValue:function(){var n=this._obj;return n!==null&&n!==undefined&&n.formats&&n.formats.$display&&(n=n.formats.$display.convert(n)),n},get_systemValue:function(){var n=this._obj;return n!==null&&n!==undefined&&n.formats&&n.formats.$system&&(n=n.formats.$system.convert(n)),n},get_options:function(){return this._options},get_conditions:function(){return this._parent.get_conditions()}};ExoWeb.View.OptionGroupAdapter=lo;lo.registerClass("ExoWeb.View.OptionGroupAdapter"),function(){function i(n){Sys.UI.DomElement.isDomElement(n)&&r(n).is("input[type=radio]:checked")&&r("input[type=radio][name='"+n.name+"']").each(function(){var i,t;if(this!==n&&this.__msajaxbindings!==undefined)for(i=this.__msajaxbindings,t=0;t<i.length;t++)i[t]._lastTarget=i[t]._lastSource=!1})}function u(n,t){Sys.UI.DomElement.isDomElement(n)&&r(n).is("input[type=radio]:checked")&&!t&&r(n).removeAttr("checked")}var n=Sys.Binding.prototype._targetChanged,t;Sys.Binding.prototype._targetChanged=function(){var t=this.get_source(),r,u=ExoWeb.config.enableBatchChanges;t===null?r="null":t===undefined?r="undefined":t instanceof ExoWeb.Model.Entity?r=t.meta.type.get_fullName():t instanceof ExoWeb.View.Adapter?(r="Adapter",u=!1):t instanceof ExoWeb.View.OptionAdapter?(r="OptionAdapter",t.get_parent().get_isList()||(u=!1)):r=t instanceof ExoWeb.View.OptionGroupAdapter?"OptionGroupAdapter":ii(t.constructor);u?context.server._changeLog.batchChanges(f("binding: {0}.{1}",r,this.get_path()),context.server._localUser,n.bind(this,arguments),!0):n.apply(this,arguments);this._disposed||i(this._target)};t=Sys.Binding.prototype._sourceChanged;Sys.Binding.prototype._sourceChanged=function(n){var i=n===!1;t.apply(this,[n]);this._disposed||i||u(this._target,this._lastSource)};Sys.UI.DataView.prototype._loadData=function(n){var t,i,r;this._swapData(this._data,n);t=this._data;this._data=n;this._setData=!0;this._stale=!1;n&&n instanceof Array&&t&&t instanceof Array?(i=t.slice(),r=fr(i,n,!0),this._collectionChanged(n,new Sys.NotifyCollectionChangedEventArgs(r))):(this._dirty=!0,this._isActive()?(this.get_isLinkPending()?this.link():this.refresh(),this.raisePropertyChanged("data")):this._changed=!0)}}();ExoWeb.View.getFinalSrcObject=la;ExoWeb.View.getFinalPathStep=aa;ExoWeb.View.getBindingInfo=ww;var va=function(n){return n.type instanceof ExoWeb.Model.ConditionType.Error},ya=function(n){return n.type instanceof ExoWeb.Model.ConditionType.Error||n.type instanceof ExoWeb.Model.ConditionType.Warning},bw=function(n,t,i){ya(t.conditionTarget.condition)&&$(this).trigger("validated",[n.conditions(i)])},kw=function(n){$(this).trigger("validated",[n.filter(ya)])},dw=function(t,i){var f,o,e,h,c,l,a;if(n.ExoWeb&&(f=r(t),f.attr("__validating")===undefined)){for(o=f.liveBindings(),e=0;e<o.length;e++){var v=o[e],y=ExoWeb.View.getFinalSrcObject(v),p=ExoWeb.View.getFinalPathStep(v),u=y.meta||y,s=null;u instanceof ExoWeb.Model.ObjectMeta?(h=u.type.property(p),c=bw.bind(t).spliceArguments(2,0,h),i&&(s={instance:{type:u.type.get_fullName(),id:u.id},handler:c}),u.addConditionsChanged(c,h)):u&&u.get_conditions&&(l=u.get_conditions(),a=kw.bind(t),i&&(s={collection:l,handler:a}),ExoWeb.Observer.addCollectionChanged(l,a));i&&f.data("validated",s)}f.attr("__validating",!0)}};r.fn.validated=function(n,t){return this.each(function(){r(this).bind("validated",n);dw(this,t)}),this};r.fn.rules=function(t){return!n.Sys||!n.ExoWeb||!ExoWeb.Model?[]:r(this).liveBindings().map(function(n){return ExoWeb.View.getBindingInfo(n)}).filter(function(n){return!!n.property}).map(function(n){return n.property.rule(t)})};r.fn.errors=function(){return!n.Sys||!n.ExoWeb||!ExoWeb.Model?[]:r(this).liveBindings().mapToArray(function(n){var i=n.get_source(),t;return i instanceof ExoWeb.View.Adapter?i.get_conditions().filter(va):(t=ExoWeb.View.getBindingInfo(n),!t.target||!t.property)?[]:t.target.meta.conditions(t.property).filter(va)})};yf=!1;r.expr[":"].rule=function(t,i,u){if(yf===!1){if(!(n.ExoWeb&&ExoWeb.Model))return!1;yf=!0}var f=u[3],e=ExoWeb.Model.Rule[f];if(!e)throw new Error("Unknown rule in selector: "+f);return r(t).rules(e).length>0};r.expr[":"].bound=function(t){if(yf===!1){if(!(n.ExoWeb&&ExoWeb.Model))return!1;yf=!0}return r(t).liveBindings().length>0};lh=!1;r.expr[":"].dataview=function(t){if(lh===!1){if(!(n.Sys!==undefined&&Sys.UI!==undefined&&t.control!==undefined&&Sys.UI.DataView!==undefined))return!1;lh=!0}return t.control instanceof Sys.UI.DataView};ah=!1;r.expr[":"].content=function(t){if(ah===!1){if(!(n.ExoWeb!==undefined&&ExoWeb.UI!==undefined&&t.control!==undefined&&ExoWeb.UI.Content!==undefined&&t.control))return!1;ah=!0}return t.control instanceof ExoWeb.UI.Content};vh=!1;r.expr[":"].toggle=function(t){if(vh===!1){if(!(n.ExoWeb!==undefined&&ExoWeb.UI!==undefined&&t.control!==undefined&&ExoWeb.UI.Toggle!==undefined&&t.control))return!1;vh=!0}return t.control instanceof ExoWeb.UI.Toggle};r.expr[":"].control=function(n,t,i){var r=i[3],u=new Function("{return "+r+";}");return n.control instanceof u()};r.fn.control=function(n,t){if(arguments.length===0)return this.get(0).control;if(arguments.length==1)return this.get(0).control["get_"+n]();this.each(function(){this.control["set_"+n](t)})};r.fn.commands=function(n){var t=this.control();t.add_command(function(t,i){var r=n[i.get_commandName()];r&&r(t,i)})};r.fn.liveBindings=function(){var n=[];return this.each(function(){this.__msajaxbindings&&Array.addRange(n,this.__msajaxbindings)}),n};var pa={added:[],deleted:[],bound:[],unbound:[]},wt=function(n,t,i,u){var h=Object.prototype.toString.call(t)==="[object Array]",y=h?t.length:1,c,p,s,l,w,e=0,o,a,v,f;if(y!==0){for(c=pa[i],e=-1,p=c.length,s=[];++e<p;)(f=c[e],f.source&&f.source!==u)||(!f.context||h&&f.context===n||r.contains(f.context,n))&&s.push(f);if(l=s.length,l!==0)for(w=i==="added"||i==="deleted",e=-1;++e<y;)if(o=h?t[e]:t,o.nodeType===1)for(v=0,a=r(o);v<l;)f=s[v++],a.is(f.selector)&&f.action.apply(o,[0,o]),w&&o.children.length>0&&a.find(f.selector).each(f.action)}},wa=!1,ba=!1,ka=!1,da=!1,ga=!1,nv=!1;tv=r("body").context;pf=function(t,i,r,u,f){var s,h,l,e,o,c;for(h=0,s=pa[r],l=s.length;h<l;)if(o=s[h++],o.context===t&&o.source===u&&o.selector===i){e=o;break}e?e.action.add?e.action.add(f):(c=e.action,n.ExoWeb?(e.action=ExoWeb.Functor(),e.action.add(c),e.action.add(f)):e.action=function(){c.apply(this,arguments);f.apply(this,arguments)}):(e={selector:i,action:f},t&&(e.context=t),s.push(e))};r.fn.ever=function(t){var f,e=this.selector,r,u,i,o;if(this.context!==tv&&(f=this.context),typeof t=="function")u=this,i={context:f,selector:e,added:t,deleted:arguments[1]};else{if(i=t,n.ExoWeb)for(o in i)i.hasOwnProperty(o)&&!/^(selector|source|added|deleted|bound|unbound)$/.test(o)&&c('Unexpected option "'+o+'"');if(f&&(i.context=f),i.added&&(u=this,i.selector&&(u=u.find(i.selector))),i.bound&&(r=this,i.selector&&(r=r.find(i.selector)),r=r.filter(":bound")),e)i.selector=i.selector?e.replace(/,/g," "+i.selector+",")+" "+i.selector:e;else if(!i.selector)throw new Error("Ever requires a selector");n.ExoWeb&&i.source&&(i.added||i.deleted||c("The source option only applies to added and deleted handlers"),i.source!=="template"&&i.source!=="updatePanel"&&c('Unexpected source "'+i.source+'"'))}return i.added&&(u.length>0&&u.each(i.added),pf(i.context,i.selector,"added",i.source,i.added)),i.deleted&&pf(i.context,i.selector,"deleted",i.source,i.deleted),i.bound&&(r.length>0&&r.each(i.bound),pf(i.context,i.selector,"bound",i.source,i.bound)),i.unbound&&pf(i.context,i.selector,"unbound",i.source,i.unbound),gw(),null};dt={appRoot:null,aliasRequests:!1};ExoWeb.DotNet.config=dt;nr=n.location.pathname;wf=nr.lastIndexOf("/");wf>0&&wf<nr.length-1?nr=nr.substring(0,wf+1):wf===0&&nr.length>1&&(nr+="/");iv=n.location.port?"{0}//{1}:{2}":"{0}//{1}";rv=f(iv,n.location.protocol,n.location.hostname,n.location.port);ExoWeb.Mapper.setEventProvider(function(n,t,i,r,u,f,e,o){br({type:"Post",path:dt.aliasRequests&&n!=="GetType"&&n!=="LogError"?n:"Request",data:{events:[{type:n,include:r,instance:t,event:i}],queries:f,changes:u},onSuccess:e,onFailure:o})});ExoWeb.Mapper.setRoundtripProvider(function(n,t,i,r,u,f){var e=[];n&&e.push({from:n.type,ids:[n.id],include:t,inScope:!0,forLoad:!0});e.addRange(r);br({type:"Post",path:dt.aliasRequests?"Roundtrip":"Request",data:{changes:i,queries:e},onSuccess:u,onFailure:f})});ExoWeb.Mapper.setObjectProvider(function(n,t,i,r,u,f,e,o){br({type:"Post",path:dt.aliasRequests?"LoadObject":"Request",data:{queries:[{from:n,ids:t,include:i,inScope:r,forLoad:!0}].concat(f),changes:u},onSuccess:e,onFailure:o})});ExoWeb.Mapper.setQueryProvider(function(n,t,i,r,u){br({type:"Post",path:dt.aliasRequests?"Query":"Request",data:{changes:t,queries:n.concat(i)},onSuccess:r,onFailure:u})});ExoWeb.Mapper.setSaveProvider(function(n,t,i,r,u){br({type:"Post",path:dt.aliasRequests?"Save":"Request",data:{events:[{type:"Save",instance:n}],queries:i,changes:t},onSuccess:r,onFailure:u})});ExoWeb.Mapper.setListProvider(function(n,t,i,r,u,f,e){br({type:"Post",path:dt.aliasRequests?"LoadList":"Request",data:{queries:[{from:n,ids:t===null?[]:[t],include:i,inScope:!1,forLoad:!0}].concat(u),changes:r},onSuccess:f,onFailure:e})});ExoWeb.Mapper.setTypeProvider(function(n,t,i){if(n.length===1){var r={type:n[0],config:dt};ExoWeb.cacheHash&&(r.cachehash=ExoWeb.cacheHash);Sys.Net.WebServiceProxy.invoke(yh(),"GetType",!0,r,t,i,null,1e6,!1,null)}else br({type:"Post",path:dt.aliasRequests?"GetTypes":"Request",data:{types:n},onSuccess:t,onFailure:i})});ao=!1;ExoWeb.setLogErrorProvider(function(n,t,i){if(ao===!1)try{ao=!0;Sys.Net.WebServiceProxy.invoke(yh(),"LogError",!1,n,function(){t&&t.apply(this,arguments)},function(){i&&i.apply(this,arguments)},null,1e6,!1,null)}finally{ao=!1}});fp(function(n,t){var r,u,f,i;if(n===Date)return t==="g"?t=Date._expandFormat(Sys.CultureInfo.CurrentCulture.dateTimeFormat,"d")+" "+Date._expandFormat(Sys.CultureInfo.CurrentCulture.dateTimeFormat,"t"):t==="G"&&(t=Date._expandFormat(Sys.CultureInfo.CurrentCulture.dateTimeFormat,"d")+" "+Date._expandFormat(Sys.CultureInfo.CurrentCulture.dateTimeFormat,"T")),new fi({description:"",specifier:t,convert:function(n){return n.localeFormat(t)},convertBack:function(n){var i,r,u;if(t==="t"?(r=Date._expandFormat(Sys.CultureInfo.CurrentCulture.dateTimeFormat,"d")+" "+Date._expandFormat(Sys.CultureInfo.CurrentCulture.dateTimeFormat,"t"),u=new Date(1970,0,1).localeFormat("d"),i=Date.parseLocale(u+" "+n,r)):i=Date.parseLocale(n,t),i===null)throw new Error("Invalid date format");return i}});if(n===Number){var e=t.match(/[$c]+/i),s=t.match(/[%p]+/i),h=t.match(/[dnfg]0/i),c=Sys.CultureInfo.CurrentCulture.numberFormat.CurrencyDecimalDigits;return new fi({description:e?o["format-currency"]:s?o["format-percentage"]:h?o["format-integer"]:o["format-decimal"],specifier:t,convert:function(n){return t.toLowerCase()==="g"?n.toString():n.localeFormat(t)},convertBack:function(n){var i=1,t,r;if(n.match(/^\(.*\)$/)&&(n=n.substring(1,n.length-1),i=-1),e?(t=Number.parseLocale(n.replace(Sys.CultureInfo.CurrentCulture.numberFormat.CurrencySymbol,""))*i,r=t.toString(),r.indexOf(".")>-1&&r.length-(r.indexOf(".")+1)>c&&(t=NaN)):t=s?Number.parseLocale(n.replace(Sys.CultureInfo.CurrentCulture.numberFormat.PercentSymbol,""))/100*i:h&&!rr(Number.parseLocale(n))?NaN:Number.parseLocale(n)*i,isNaN(t))throw new Error("Invalid format");return t}})}return n===Boolean?(t&&t.toLowerCase()==="g"?(r="True",u="False",f=""):(i=t.split(";"),r=i.length>0?i[0]:"",u=i.length>1?i[1]:"",f=i.length>2?i[2]:""),new fi({description:"",specifier:t,convert:function(n){return n===!0?r:n===!1?u:f},convertBack:function(n){return n.toLowerCase()===r.toLowerCase()?!0:n.toLowerCase()===u.toLowerCase()?!1:null}})):new fi({description:"",specifier:"",convert:function(n){return n.toString()},convertBack:function(n){return n}})});tp({makeObservable:Sys.Observer.makeObservable,disposeObservable:Sys.Observer.disposeObservable,addCollectionChanged:Sys.Observer.addCollectionChanged,removeCollectionChanged:Sys.Observer.removeCollectionChanged,addPropertyChanged:function(n,t,i){n.__propertyChangeHandlers||(n.__propertyChangeHandlers={},Sys.Observer.addPropertyChanged(n,uv));var r=n.__propertyChangeHandlers[t];r||(n.__propertyChangeHandlers[t]=r=ExoWeb.Functor());r.add(i)},removePropertyChanged:function(n,t,i){var r=n.__propertyChangeHandlers?n.__propertyChangeHandlers[t]:null,u,f;if(r&&(r.remove(i),r.isEmpty())){delete n.__propertyChangeHandlers[t];u=!1;for(f in n.__propertyChangeHandlers)n.__propertyChangeHandlers.hasOwnProperty(f)&&(u=!0);u||(n.__propertyChangeHandlers=null,Sys.Observer.removePropertyChanged(n,uv))}},raisePropertyChanged:Sys.Observer.raisePropertyChanged,setValue:Sys.Observer.setValue});ExoWeb.updateArray=function(n,t){n.beginUpdate&&n.endUpdate&&n.beginUpdate();fr(n,t);n.beginUpdate&&n.endUpdate&&n.endUpdate()}}(n.ExoJQuery||jQuery);Sys.UI.Template.allowedProtocols.push("mailto");Sys.UI.Template.allowedProtocols.push("file");Sys.UI.Template.allowedProtocols.push("intent");ExoWeb.config.autoActivation=!1;ExoWeb.config.allowTypeLazyLoading=!1;ExoWeb.config.enableBatchChanges=!1;ExoWeb.config.allowObjectLazyLoading=!0;ExoWeb.config.allowListLazyLoading=!0;ExoWeb.config.calculationErrorDefault=null,function(t){function i(){try{var i=$parentContextData(this),r=i.get_target(),n=r.meta.type.rules.filter(function(n){return n instanceof ExoWeb.Model.RangeRule&&n.property===i.get_propertyChain()})[0].range(r);n.min?t(this).attr("min",n.min.format("yyyy-MM-dd")):t(this).attr("min","1000-01-01");n.max?t(this).attr("max",n.max.format("yyyy-MM-dd")):t(this).attr("max","9999-12-31")}catch(u){}this.value?t(this).removeClass("c-datepicker-empty"):t(this).addClass("c-datepicker-empty")}function u(){if(t(this).attr("min","1000-01-01").attr("max","9999-12-31"),t(this).attr("novalidate",""),t(this).closest(".c-editor").addClass("c-use-native-datetime-fields"),t(this).closest(".c-editor-date").next(".c-editor-date-icon").remove(),i.call(this),t(this).siblings('[type="text"]').attr("tabindex",-1),!Cognito.isDeviceType("iphone|ipod|ipad")){Cognito.isDeviceType("android")&&t(this).attr("tabindex",-1);t(this).on("click",function(){t(this).siblings('[type="text"]').focus()})}}function f(){var n={},r=Sys.CultureInfo.CurrentCulture.name.substring(0,2),i={},u;i[r]={days:Sys.CultureInfo.CurrentCulture.dateTimeFormat.DayNames,daysShort:Sys.CultureInfo.CurrentCulture.dateTimeFormat.AbbreviatedDayNames,daysMin:Sys.CultureInfo.CurrentCulture.dateTimeFormat.ShortestDayNames,months:Sys.CultureInfo.CurrentCulture.dateTimeFormat.MonthNames,monthsShort:Sys.CultureInfo.CurrentCulture.dateTimeFormat.AbbreviatedMonthNames,today:Cognito.resources.today,clear:Cognito.resources.clear};n={format:Sys.CultureInfo.CurrentCulture.dateTimeFormat.ShortDatePattern.toLowerCase(),language:Sys.CultureInfo.CurrentCulture.name.substring(0,2),dates:i,weekStart:Sys.CultureInfo.CurrentCulture.dateTimeFormat.FirstDayOfWeek};u=t(this).datepicker(n).on("changeDate",function(){$simulateMutationEvent(this,"change",!1,!0)})}function e(){var i=t(this).data("datepicker"),n;i&&(n=i.picker,n&&n.is&&n.is(":visible")&&i.hide())}function r(){this.value?t(this).removeClass("c-timepicker-empty"):t(this).addClass("c-timepicker-empty")}function o(){if(t(this).attr("step",900),t(this).attr("novalidate",""),t(this).closest(".c-editor").addClass("c-use-native-datetime-fields"),t(this).closest(".c-editor-time").next(".c-editor-time-icon").remove(),r.call(this),t(this).siblings('[type="text"]').attr("tabindex",-1),!Cognito.isDeviceType("iphone|ipod|ipad")){Cognito.isDeviceType("android")&&t(this).attr("tabindex",-1);t(this).on("click",function(){t(this).siblings('[type="text"]').focus()})}}function s(){var n=Sys.CultureInfo.CurrentCulture.dateTimeFormat.LongTimePattern;if(n.match("^h?h[:.]mm[:.]ss tt$"))t(this).timepicker({AMDesignator:Sys.CultureInfo.CurrentCulture.dateTimeFormat.AMDesignator,PMDesignator:Sys.CultureInfo.CurrentCulture.dateTimeFormat.PMDesignator,timeSeparator:Sys.CultureInfo.CurrentCulture.dateTimeFormat.TimeSeparator,twoDigitHourFormat:n.substring(0,2)=="hh"}).on("changeTime.timepicker",function(){$simulateMutationEvent(this,"change",!1,!0)});else if(n.match("^H?H[:.]mm[:.]ss$"))t(this).timepicker({showMeridian:!1,timeSeparator:Sys.CultureInfo.CurrentCulture.dateTimeFormat.TimeSeparator,twoDigitHourFormat:n.substring(0,2)=="HH"}).on("changeTime.timepicker",function(){$simulateMutationEvent(this,"change",!1,!0)})}function h(){var i=t(this).parent();n.setTimeout(function(){var n=i.children().first(),r=i.find("img");n.length&&r.length&&(n.jSignature({"background-color":"transparent",color:r.css("color"),"decor-color":"#eee",height:150,width:"100%"}),r.attr("src").length||i.closest(".c-readonly").not(".c-field, .c-section").length?(n.hide(),r.attr("src").length&&(i.addClass("c-signature-present"),i.closest(".c-editor").find("> div").addClass("c-signature-present"),n.jSignature("importData",r.attr("src")))):r.hide(),t(n).parents(".c-signature").hasClass("c-readonly")&&t(n).jSignature("disable"),n.bind("change",function(){var t=$parentContextData(this);n.jSignature("getData","native").length!==0&&n.is(":visible")&&(t.set_Svg("data:"+n.jSignature("getData","svgbase64").join(",")),t.set_Png("data:"+n.jSignature("getData","image").join(",")),n.parent().addClass("c-signature-present"))}))},0)}function c(){t(this).typeahead({minLength:0,source:null})}function l(){t.fn.placeholder&&t(this).placeholder()}ExoWeb.setLogErrorProvider(function(){!Cognito.config.reportErrors});t(document.documentElement).ever({selector:"input[type=text].c-datepicker",bound:f,unbound:e});t(document.documentElement).ever({selector:"input[type=date].c-datepicker",bound:u});t(document.documentElement).on("input change focus","input[type=date].c-datepicker",i);t(document.documentElement).ever({selector:"div.c-signature img",bound:h});t(document.documentElement).ever({selector:"input[type=text].c-timepicker",bound:s});t(document.documentElement).ever({selector:"input[type=time].c-timepicker",bound:o});t(document.documentElement).on("input change focus","input[type=time].c-timepicker",r);t(document.documentElement).ever({selector:"input.c-autocomplete",bound:c});t(document.documentElement).ever({selector:"input,textarea",bound:l});t(document.documentElement).ever({selector:"input.c-mask",bound:function(){var n=t(this).attr("data-mask");t(this).mask(n,{autoclear:!1,autoinit:!1})},unbound:function(){t(this).unmask()}});t(document.documentElement).on("show","input[type=text].c-datepicker",function(){try{var i=$parentContextData(this),r=i.get_target(),n=r.meta.type.rules.filter(function(n){return n instanceof ExoWeb.Model.RangeRule&&n.property===i.get_propertyChain()})[0].range(r);n.min?t(this).datepicker("setStartDate",n.min):t(this).datepicker("setStartDate",null);n.max?t(this).datepicker("setEndDate",n.max):t(this).datepicker("setEndDate",null)}catch(u){}});t(document.documentElement).on("click",".c-signature-present .c-signature-glyph",function(){var i=$parentContextData(this);i.set_Svg(null);i.set_Png(null);t(this).parent().removeClass("c-signature-present");t(this).parent().children().first().jSignature("reset").show();t(this).parent().children("img").hide();n.setTimeout(Cognito.resize)});t(document.documentElement).on("click",".c-toggle--container",function(){t(this).siblings('[type="checkbox"]').trigger("click").trigger("focus")})}(ExoJQuery||jQuery);n.Cognito=n.Cognito||{};Cognito.ieSupportLoaded=!1;n.console||(console={log:function(){},error:function(){},debug:function(){},warn:function(){}}),function(t){function l(){t.event.trigger({type:"heartbeat.cognito"});n.setTimeout(l,6e4)}function nt(n,i){t(document).on(n,i)}function tt(){var i,r,u,f,e;return arguments.length===2?(i=arguments[0],r=arguments[1]):arguments.length===1&&(typeof arguments[0]=="string"?i=arguments[0]:(r=arguments[0],i=r.event)),u={},r&&r.data&&(u=r.data),i?(f=t.Event(i),t(document).trigger(f,[u]),n.jQuery&&t!==n.jQuery&&(e=new n.jQuery.Event(i),n.jQuery(document).trigger(e,[u])),f):void 0}function it(n){var i=document.getElementsByTagName("head")[0]||document.documentElement,t=document.createElement("script");t.type="text/javascript";t.async=!1;t.defer=!1;i.insertBefore(t,i.firstChild);t.src=n}function rt(){return u.serverTimeOffset?new Date((new Date).getTime()+u.serverTimeOffset):new Date}function ut(){return new Date(u.serverTimeOffset)}function a(){var e=function(t){var r,u;if(!t.action)return!1;for(r=0;r<t.dependencies.length;r++)if(u=i[t.dependencies[r]],!(u==!0))return!1;try{return t.action(ExoJQuery),t.action=null,a(t.name),!0}catch(f){return console.error(f),n.appInsights&&appInsights.trackException(f,"Cognito.ready",{readyActionName:t.name}),i[t.name]=!1,!1}},u,r,t,f;if(arguments.length==1){if(u=i[arguments[0]],i[arguments[0]]=!0,u)for(t=0;t<u.length;t++)i[u[t]]!==!1&&e(u[t])}else if(r={name:arguments[0],dependencies:arguments.length==3?typeof arguments[1]=="string"?[arguments[1]]:arguments[1]:[],action:arguments.length==3?arguments[2]:arguments[1]},!e(r))for(t=0;t<r.dependencies.length;t++)f=i[r.dependencies[t]],f?f instanceof Array&&f.push(r):i[r.dependencies[t]]=[r]}function ft(n){n instanceof Function&&Cognito.ready(n.name||"Unknown","ExoWeb.dom",n)}function et(){arguments[0]instanceof Function&&(t.isReady?arguments[0].call(n,ExoJQuery):Cognito._afterReadyEvents.push(arguments[0]))}function ot(){arguments[0]instanceof Function&&$exoweb({contextReady:arguments[0]})}function v(i){var u,e,o,f,r,s;if(i.module=i.module||"",i.mode=i.mode||Cognito.config.mode,i.method=i.method||"GET",i.endpoint=i.endpoint||"",i.data=i.data||{},i.dataType=i.dataType||"json",i.success=i.success||function(){},i.error=i.error||function(t,i){n.console&&console.error(i)},i.complete=i.complete||function(){},i.async=typeof i.async=="undefined"?!0:i.async,i.contentType=i.overrideContentType?i.contentType:i.contentType||"application/json; charset=utf-8",i.uploadProgress=i.uploadProgress||null,i.context=i.context||null,i.passive=i.passive||!1,i.method.toUpperCase()==="GET"&&(i.contentType="text/plain"),i.data.meta&&(i.contentType="application/json+cognito; charset=utf-8",i.data=Cognito.serialize(i.data)),typeof i.data!="string"&&i.contentType&&i.contentType.indexOf("application/json")===0&&(i.data=JSON.stringify(i.data)),u=i.data,typeof i.data!="string")for(e in u)if(u.hasOwnProperty(e)&&u[e]instanceof Array)for(o=u[e],delete u[e],f=0;f<o.length;f++)u[e+"["+f+"]"]=o[f]instanceof Object?JSON.stringify(o[f]):o[f];if(i.endpoint===""){n.console&&console.error("endpoint is required");return}t.browser.msie&&parseInt(t.browser.version,10)<10&&(i.endpoint+=i.endpoint.indexOf("?")==-1?"?":"&",i.endpoint+="me1="+i.method,i.endpoint+="&ct1="+encodeURIComponent(i.contentType),t("#g-recaptcha-response")[0]?i.endpoint+="&xrec1="+encodeURIComponent(grecaptcha.getResponse()):t("#c-nobots")[0]&&(i.endpoint+="&xnobots1="+encodeURIComponent(t("#c-nobots").val())),Cognito.config.sessionToken&&(i.endpoint+="&token="+encodeURIComponent(Cognito.config.sessionToken)));try{document.cookie.indexOf("TestId=")>=0&&(i.endpoint+=i.endpoint.indexOf("?")==-1?"?":"&",i.endpoint+="TestId="+encodeURIComponent(document.cookie.substr(document.cookie.indexOf("TestId=")+7,36)))}catch(h){}r={};Cognito.config.sessionToken&&(r["X-SessionToken"]=Cognito.config.sessionToken,r["X-Requested-With"]="XMLHttpRequest");i.passive===!0&&(r["X-Passive-Request"]=1);t.inArray(i.method.toUpperCase(),["GET","POST"])===-1&&(r["X-HTTP-Method-Override"]=i.method,i.method="POST");t("#g-recaptcha-response")[0]?r["X-Recaptcha"]=grecaptcha.getResponse():t("#c-nobots")[0]&&(r["X-NoBots"]=t("#c-nobots").val());i.uploadProgress&&(i.xhr=function(){var n=t.ajaxSettings.xhr();return n.upload&&(n.upload.onprogress=function(n){var t=0,r=n.loaded||n.position,u=n.total;n.lengthComputable&&(t=Math.ceil(r/u*100));i.uploadProgress(n,r,u,t)}),n});s=Cognito.config.baseUrl;i.module.length!==0&&(s+=i.module+"/"+i.mode+"/");s+=i.endpoint;t.event.trigger({type:"cognito.serviceRequest"});t.ajax({contentType:i.contentType,type:i.method,url:s,dataType:i.dataType,async:i.async,data:i.data,success:function(n,r,u){var f=u.getResponseHeader("X-SessionToken"),e,o;try{e=u.getResponseHeader("X-Server-Time");e&&(o=new Date(e),Cognito.config.serverTimeOffset=o.getTime()-(new Date).getTime())}catch(s){}f&&(Cognito.config.sessionToken=f,Cognito.Messaging.trigger("session-token-updated",{data:{token:f}}),t.event.trigger({type:"received-session-token",token:Cognito.config.sessionToken}));i.success(n,r,u)},error:function(n,r,u){n.status===419?(t("#c-core-timeout").length===0&&t(".cognito:first").append("<div id='c-core-timeout'>Your request has timed out, click <a href='javascript: document.location.reload()'>here<\/a> to reload<\/div>"),t(".cognito").children().hide(),t("#c-core-timeout").show()):n.status===400&&n.responseText==="captcha"&&(t("#g-recaptcha-response")[0]||grecaptcha.render("c-recaptcha-div",{theme:"clean",sitekey:Cognito.config.recaptchaKey}));i.context?i.error.call(this,n,r,u,i.context):i.error.call(this,n,r,u)},complete:i.complete,beforeSend:i.beforeSend,processData:i.processData,headers:r,context:i.context?i.context:this,xhr:i.xhr})}function st(n){Cognito.config.key&&v({endpoint:"session/token/"+Cognito.config.key,success:function(t){Cognito.config.sessionToken=t.token;n&&n()}})}function ht(n,i,r){var f=typeof r=="undefined"?!0:r,u=t(i);u.length==0?Cognito.ready("cognito-load-content","ExoWeb.dom",function(t){t(i).append(n)}):u.append(n)}function ct(n,t,i){var e,o,r,s,f,u;i=i||{};i.mode=i.mode||"public";i.target=i.target||"";i.view=i.view||"";i.success=i.success||function(){};i.args=i.args||{};e=n+"/"+i.mode;i.view!==""&&(e+="?view="+i.view);o=location.href;location.hash&&(o=location.href.replace(location.hash,"")+decodeURIComponent(location.hash));t.embedUrl=t.embedUrl||o;r="";for(s in t)f=t[s],typeof f=="object"&&(f=JSON.stringify(f)),r+=s+"="+encodeURIComponent(f)+"&";r+=document.location.search?"$qs="+encodeURIComponent(document.location.search.substring(1)):"";r.length>0&&r[r.length]==="&"&&(r=r.substring(0,r.length-1));i.target===""&&(i.target=".cognito:first");u={method:"GET",dataType:"text",async:i.async||!1,endpoint:e,success:function(n){Cognito.loadContent(n,i.target);i.success()},error:i.error};r&&r.length>1e3?(u.method="POST",u.contentType="application/x-www-form-urlencoded",u.data=r):u.endpoint+=(e.indexOf("?")>-1?"&":"?")+r;Cognito.serviceRequest(u);return}function lt(n,i){i=i||{};i.target=i.target||"";i.view=i.view||"";i.args=i.args||"";var r=n+"/admin/loadconfig";i.view!==""&&(r+="?view="+i.view);i.args!==""&&(r+=(r.indexOf("?")>-1?"&":"?")+"args="+i.args);i.target===""&&(t("#cognito-interface").length==0&&document.write('<div id="cognito-interface"><\/div>'),i.target="#cognito-interface");Cognito.serviceRequest({method:"GET",dataType:"text",async:!1,endpoint:r,success:function(n){Cognito.loadContent(n,i.target)}})}function y(n,t){var r=t.get_format().toString(),i;return r==="d"?new Date(n.substr(0,4),n.substr(5,2)-1,n.substr(8,2)):r==="t"?(i=new Date(n),isNaN(i.getDate())?new Date(1970,0,1,n.substr(0,2),n.substr(3,2),n.substr(6,2)):i):new Date(n)}function p(n,i,u){if(!i)return null;var o=!1,e=null;return context.server.ignoreChanges(function(){var a,v,d,h,c,s,l,b,w,g,k,nt;if(r||(r=[],f=[],o=!0),i instanceof Array){e=[];t.each(i,function(t,i){e.push(p(n,i))});o&&(r.forEach(function(n){for(var i,t=n.meta.type;t;t=t.baseType)i=t._getEventHandler("initExisting"),i&&i(n,{})}),r=null);return}if(i.$type?n=context.model.meta.type(i.$type).get_jstype():Cognito.dynamicTypes&&(n=Cognito.getDynamicType(n,i)||n),a={},v=!1,u)v=!0;else{if(i.Id!=null&&i.Id!=undefined)if(d=n.meta.property("Id"),d&&d.get_containingType().get_fullName()==="Cognito.DynamicEntity")u=new n(n.meta.newId());else{if(u=n.meta.get(i.Id.toString()),u){e=u;o&&(r=null);return}u=new n(i.Id.toString())}else u=new n(n.meta.newId());r.push(u)}i.$version&&(u.$version=i.$version);i.$etag&&(u.$etag=i.$etag);for(h in i)if(c=n.meta.property(h),c!==null)if(s=i[h],l=c.get_jstype(),c.get_isValueType())l===Date&&s&&s.constructor===String&&(s=y(s,c)),v?u.set(h,s):a[h]=s;else if(c.get_isList()&&s instanceof Array)if(v){for(v&&u.meta.type.property(h)&&(b=u.get(h)),w=0,w;w<s.length;w++)g=b[w],g?Cognito.deserialize(l,s[w],g):b.add(Cognito.deserialize(l,s[w]));b.splice(w)}else if(Cognito.Forms&&Cognito.Forms.FormEntry&&c.get_jstype().meta.baseType===Cognito.Forms.FormEntry.meta&&s.length>0&&typeof s[0]=="string")for(a[h]=s,k=0;k<s.length;k++)f.push({instance:u,property:c,id:s[k]});else a[h]=s.map(function(n){return Cognito.deserialize(l,n)});else s&&c.get_jstype().meta._isEnum?v?u.set(h,l.meta.get(s)):a[h]=l.meta.get(s):v?s?(nt=u.get(h),nt?Cognito.deserialize(l,s,nt):u.set(h,Cognito.deserialize(l,s,new l))):u.set(h,null):c.get_jstype().meta.baseType===Cognito.Forms.FormEntry.meta&&typeof s=="string"?(a[h]=s,f.push({instance:u,property:c,id:s})):a[h]=Cognito.deserialize(l,s);v||u.init(a);u._lazyLoader&&u._lazyLoader.allProps.constructor.unregister(u,u._lazyLoader.allProps);o&&(f.length>0?(u.meta._instancesPendingLoad=f,u.meta._instancesPendingInit=r):r.forEach(function(n){for(var i,t=n.meta.type;t;t=t.baseType)i=t._getEventHandler("initExisting"),i&&i(n,{})}),r=null);e=u})(),e}function w(n){return n.getFullYear()+(n.getMonth()<9?"-0":"-")+(n.getMonth()+1)+(n.getDate()<10?"-0":"-")+n.getDate()}function b(n){return(n.getHours()<10?"0":"")+n.getHours()+(n.getMinutes()<10?":0":":")+n.getMinutes()+(n.getSeconds()<10?":0":":")+n.getSeconds()}function e(n){var r,u,f,o,h,s,i,c,t,l;if(n==null)return null;if(r=null,n instanceof Array)for(r=[],u=0;u<n.length;u++)f=n[u],f instanceof Cognito.Forms.FormEntry?r.push(f.get_Id()):r.push(e(f));else for(r={},o=n.meta.type,o.baseType&&(r.$type=o.get_fullName()),n.$version&&(r.$version=n.$version),n.$etag&&(r.$etag=n.$etag),h=o.get_allproperties(),s=0;s<h.length;s++)i=h[s],i.get_origin()=="server"&&i.get_isPersisted()&&(i.get_isValueType()?(t=i.value(n),t&&i.get_jstype()===Date&&(c=i.get_format().toString(),c==="d"?t=w(t):c==="t"&&(t=b(t))),r[i.get_name()]=t):i.get_isStatic()||(t=i.value(n),l=i.get_jstype().meta.type.baseType,r[i.get_name()]=t&&i.get_jstype().meta._isEnum&&!i._isList?t.get_Id():t&&!i._isList&&l&&l.get_fullName()==="Cognito.Lookup"?t.get_Code():t&&t instanceof Cognito.Forms.FormEntry?t.get_Id():e(t)));return r}function o(n){if(n!=null&&(!n.meta||!n.meta.isNew))return n instanceof Array?t.each(n,function(){o(this)}):(t.each(n.meta.type.rules,function(){(this instanceof ExoWeb.Model.ConditionRule||ExoWeb.Model.Rule.requiredRatingScale&&this instanceof ExoWeb.Model.Rule.requiredRatingScale)&&(this.invocationTypes&2)==0&&this.execute.call(this,n)}),t.each(n.meta.type.get_allproperties(),function(){this.get_origin()!="server"||!this.get_isPersisted()||this.get_isValueType()||this.get_isStatic()||Cognito.isPropertyLookup(this)||o(this.value(n))})),n}function s(n){if(n!=null)return n instanceof Array?t.each(n,function(){s(this)}):(t.each(n.meta.conditions(),function(){this.targets&&this.targets.length>0&&this.targets[0].target==n&&this.destroy()}),n.meta.destroy(),t.each(n.meta.type.get_allproperties(),function(){this.get_origin()!="server"||!this.get_isPersisted()||this.get_isValueType()||this.get_isStatic()||Cognito.isPropertyLookup(this)||s(this.value(n))})),n}function at(n){if(n){var t=n.replace(/([^\s])([^\s]*)/g,function(n,t,i){return t.toUpperCase()+i});return t=t.replace(/[^0-9a-zA-Z\u00aa\u00b5\u00ba\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u02bb-\u02c1\u02d0-\u02d1\u02e0-\u02e4\u02ee\u0370-\u0373\u0376-\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0523\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0621-\u064a\u0660-\u0669\u066e-\u066f\u0671-\u06d3\u06d5\u06e5-\u06e6\u06ee-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07c0-\u07ea\u07f4-\u07f5\u07fa\u0904-\u0939\u093d\u0950\u0958-\u0961\u0966-\u096f\u0971-\u0972\u097b-\u097f\u0985-\u098c\u098f-\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc-\u09dd\u09df-\u09e1\u09e6-\u09f1\u0a05-\u0a0a\u0a0f-\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32-\u0a33\u0a35-\u0a36\u0a38-\u0a39\u0a59-\u0a5c\u0a5e\u0a66-\u0a6f\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2-\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0-\u0ae1\u0ae6-\u0aef\u0b05-\u0b0c\u0b0f-\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32-\u0b33\u0b35-\u0b39\u0b3d\u0b5c-\u0b5d\u0b5f-\u0b61\u0b66-\u0b6f\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99-\u0b9a\u0b9c\u0b9e-\u0b9f\u0ba3-\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0be6-\u0bef\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58-\u0c59\u0c60-\u0c61\u0c66-\u0c6f\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0-\u0ce1\u0ce6-\u0cef\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d28\u0d2a-\u0d39\u0d3d\u0d60-\u0d61\u0d66-\u0d6f\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32-\u0e33\u0e40-\u0e46\u0e50-\u0e59\u0e81-\u0e82\u0e84\u0e87-\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa-\u0eab\u0ead-\u0eb0\u0eb2-\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0ed0-\u0ed9\u0edc-\u0edd\u0f00\u0f20-\u0f29\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8b\u1000-\u102a\u103f-\u1049\u1050-\u1055\u105a-\u105d\u1061\u1065-\u1066\u106e-\u1070\u1075-\u1081\u108e\u1090-\u1099\u10a0-\u10c5\u10d0-\u10fa\u10fc\u1100-\u1159\u115f-\u11a2\u11a8-\u11f9\u1200-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u1676\u1681-\u169a\u16a0-\u16ea\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u17e0-\u17e9\u1810-\u1819\u1820-\u1877\u1880-\u18a8\u18aa\u1900-\u191c\u1946-\u196d\u1970-\u1974\u1980-\u19a9\u19c1-\u19c7\u19d0-\u19d9\u1a00-\u1a16\u1b05-\u1b33\u1b45-\u1b4b\u1b50-\u1b59\u1b83-\u1ba0\u1bae-\u1bb9\u1c00-\u1c23\u1c40-\u1c49\u1c4d-\u1c7d\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u2094\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2183-\u2184\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2c6f\u2c71-\u2c7d\u2c80-\u2ce4\u2d00-\u2d25\u2d30-\u2d65\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3006\u3031-\u3035\u303b-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31b7\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fc3\ua000-\ua48c\ua500-\ua60c\ua610-\ua62b\ua640-\ua65f\ua662-\ua66e\ua680-\ua697\ua722-\ua788\ua78b-\ua78c\ua7fb-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8d0-\ua8d9\ua900-\ua925\ua930-\ua946\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa50-\uaa59\uac00-\ud7a3\uf900-\ufa2d\ufa30-\ufa6a\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff10-\uff19\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]/g,""),/^[\u0030-\u003A\u0660-\u066A\u06F0-\u06FA\u07C0-\u07CA\u0966-\u0970\u09E6-\u09F0\u0A66-\u0A70\u0AE6-\u0AF0\u0B66-\u0B70\u0BE6-\u0BF0\u0C66-\u0C70\u0CE6-\u0CF0\u0D66-\u0D70\u0DE6-\u0DF0\u0E50-\u0E5A\u0ED0-\u0EDA\u0F20-\u0F2A\u1040-\u104A\u1090-\u109A\u17E0-\u17EA\u1810-\u181A\u1946-\u1950\u19D0-\u19DA\u1A80-\u1A8A\u1A90-\u1A9A\u1B50-\u1B5A\u1BB0-\u1BBA\u1C40-\u1C4A\u1C50-\u1C5A\uA620-\uA62A\uA8D0-\uA8DA\uA900-\uA90A\uA9D0-\uA9DA\uA9F0-\uA9FA\uAA50-\uAA5A\uABF0-\uABFA\uFF10-\uFF1A]/.test(t)&&(t="_"+t),t}return null}function vt(n){var r;if(typeof n=="undefined"||n===null)return"";if(typeof n!="number")throw new Error("Function `toBase62` recieved invalid 'number' parameter of type '"+typeof n+"'.");else if(n===0)return"";for(var i="",t=n;t>0;)r=t%62,t=Math.floor(t/62),i="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(r)+i;return i}function yt(n){var r,i,t;if(typeof n=="undefined"||n===null)return 0;if(typeof n!="string")throw new Error("Function `fromBase62` recieved invalid 'text' parameter of type '"+typeof n+"'.");else if(n.length===0)return 0;for(r="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",i=0,t=n.length-1;t>=0;t--){var u=n[t],f=r.indexOf(u),e=n.length-1-t,o=Math.pow(62,e);i+=o*f}return i}function pt(n,t,i,r){var s,f,e,u,o;if(n>65535)throw new Error("Value "+n+" exceeds maximum unsigned short value of 65535.");if(s=n>255?2:1,t>65535)throw new Error("Value "+t+" exceeds maximum unsigned short value of 65535.");if(f=t>255?2:1,s>1&&f>1)throw new Error("Both values "+n+" and "+t+" exceeds maximum byte value of 255.");return e=0,u=arguments.length>2&&typeof i=="number"?i:Math.floor(Math.random()*255),u=u&255,e+=t,e+=n<<(f===2?16:8)>>>0,s===1&&f===1&&(e+=u<<16,u=arguments.length>3&&typeof r=="number"?r:Math.floor(Math.random()*255),u=u&255),o=0,o+=f,o+=s<<2,o+=u<<4&240,e+(o<<24>>>0)}function wt(n){var t=(n&4278190080)>>>24,i,r=t&3,u,f;return i=r===2?n&65535:n&255,f=(t&15)>>2&3,u=r===2?n>>>16&255:f===2?n>>>8&65535:n>>>8&255,[u,i]}function bt(n,t){t instanceof Cognito.Forms.FormEntry||(n&&t.set_ParentSection&&(t._ParentSection=n),n&&t.set_Form&&(t._Form=n instanceof Cognito.Forms.FormEntry?n:n.get_Form()))}function h(n,t){try{if(n>65535)throw new Error("Value "+n+" exceeds maximum unsigned short value of 65535.");if(t>65535)throw new Error("Value "+t+" exceeds maximum unsigned short value of 65535.");var i=pt(n,t,Math.floor(Math.random()*255),Math.floor(Math.random()*255));return vt(i)}catch(u){return"R-"+ExoWeb.randomText(10,!0)}}function kt(n){return n instanceof Cognito.Forms.FormEntry?{Form:n}:{Form:n.get_Form(),ParentSection:n}}function dt(n,t,i){var u=n instanceof Cognito.Forms.FormEntry?n:n.get_Form(),f=u.get_Entry()?u.get_Entry().get_Version()||0:0,r=h(f+1,t.length);r=d(t,i,r);i.set_Id(r);t.add(i)}function gt(n,t,i){var u,r,i,f;i=Cognito.deleteEntity(i);u=t.indexOf(i);t.remove(i);var e=n instanceof Cognito.Forms.FormEntry?n:n.get_Form(),o=e.get_Entry()?e.get_Entry().get_Version()||0:0,s=[];for(r=u>=0?u:0;r<t.length;r++)if(i=t[r],i.get_Id())try{var l=yt(i.get_Id()),c=wt(l),a=c[0],v=c[1];a===o+1&&(s.push(i),v!==r&&i.set_Id(h(o+1,r)))}catch(y){}f=k(t);s.forEach(function(n){var i=d(t,n,n.get_Id(),f);i!==n.get_Id()&&(n.set_Id(i),f[i]=n)})}function k(n){for(var i,r={},t=0;t<n.length;t++)n[t]&&(i=n[t].get_Id(),i&&!r.hasOwnProperty(i)&&(r[i]=n[t]));return r}function d(n,t,i,r){var u,f;if(r||(r=k(n)),u=r[i],!u||u===t)return i;for(f=0;f<10;f++)if(i="R-"+ExoWeb.randomText(10+f,!0),u=r[i],!u)return i;return null}function ni(n,t,i){var r=n.value(null);r._lazyLoader&&r._lazyLoader.allProps.constructor.unregister(r,r._lazyLoader.allProps);i&&(n.get_containingType()._isEnum=!0);r.push.apply(r,t)}function ti(n){return Cognito.hasOwnProperty(n)?Cognito[n]:new Cognito.Module(n)}function ii(n,t,i,r,u){Cognito.serviceRequest({endpoint:n+"/"+t+"/File",method:"GET",data:{id:i},success:function(n){n&&r&&r.apply(this,[n])},error:function(){u&&u.apply()}})}function ri(n,t){var r,i;if(n instanceof String||!n.meta||(n=n.meta.get_fullName()),r=Cognito.dynamicTypes[n],r){if(t instanceof Object&&(t=t[r.Discriminator].Id),i=r.Types[t],i)return i;if(i=context.model.meta.type(n+"."+Cognito.config.organizationCode),i)return i.get_jstype()}}function ui(n){var r=[],u,f,i;return t.grep(n.get_options(),function(n){r.push(n.get_rawValue())}),u=null,f=t.isArray(n.get_rawValue()),u=f?t(n.get_rawValue()).not(r).get()[0]?t(n.get_rawValue()).not(r).get()[0]:"":r.contains(n.get_rawValue())?"":n.get_rawValue(),i=new ExoWeb.View.OptionAdapter(n,u),i.isFillInOption=!0,i.get_otherSelected=function(){return i.get_selected()&&!!i.get_displayValue()},i.set_otherSelected=function(n){i.set_selected(n);n||i.set_displayValue(null);Sys.Observer.raisePropertyChanged(this,"otherSelected")},n.get_options().concat([i])}function c(n,t){var s,u,i,r,f,e,o;if(n.meta.conditions().length>0)if(t){if(n.meta.conditions().filter(function(n){return n.type.code===t}).length>0)return!1}else return!1;for(s=n.meta.type.get_properties(),u=0;u<s.length;u++)if(i=s[u],!i.get_isStatic()&&i.get_isPersisted()&&!Cognito.isPropertyLookup(i))if(r=i.get_fieldName(),n[r]&&n[r].meta&&n[r].meta instanceof ExoWeb.Model.ObjectMeta){if(!c(n[r],t))return!1}else if(i.get_isList()&&(f=n[r],f))for(e=0;e<f.length;e++)if(o=f[e],o.meta&&o.meta instanceof ExoWeb.Model.ObjectMeta&&!c(o,t))return!1;return!0}function fi(n,t){return n.get_All().filter(function(n){return n.get_Name()===t})[0]}function ei(n,t){var e=n.split("?");if(n.indexOf("?")>=0){var i=n.substr(0,n.indexOf("?")+1),r=n.substr(i.length),u=ExoWeb.Model.Format.fromTemplate(t.meta.type,i,function(n){return n}).convert(t),f=ExoWeb.Model.Format.fromTemplate(t.meta.type,r,function(n){return encodeURIComponent(n)}).convert(t);return u+f}return ExoWeb.Model.Format.fromTemplate(t.meta.type,n,function(n){return n}).convert(t)}function oi(n){return n?n.replace(/\n/g,"<br/>"):n}function si(n){return n.match(/Windows NT/i)?"windows-desktop":n.match(/Android/i)?"android":n.match(/webOS/i)?"webos":n.match(/iPhone/i)?"iphone":n.match(/iPod/i)?"ipod":n.match(/iPad/i)?"ipad":n.match(/Windows Phone/i)?"windows-phone":n.match(/SymbianOS/i)?"symbian":n.match(/RIM/i)||n.match(/BB/i)?"blackberry":"unknown"}function g(n){Object.defineProperty(this,"name",{value:n});Object.defineProperty(this,"model",{value:{}});Cognito.config.modules.push(this)}var u,i,r,f;document.documentElement.setAttribute("xmlns:sys","javascript:Sys");document.documentElement.setAttribute("xmlns:dataview","javascript:Sys.UI.DataView");document.documentElement.setAttribute("xmlns:content","javascript:ExoWeb.UI.Content");document.documentElement.setAttribute("xmlns:toggle","javascript:ExoWeb.UI.Toggle");document.documentElement.setAttribute("xmlns:template","javascript:ExoWeb.UI.Template");u={sessionToken:"",baseUrl:"",formsUrl:"",websiteBaseUrl:"",currentUser:null,mode:"",organizationCode:"",loginAttempts:0,maxLoginAttempts:1,isReady:!1,tokenUpdated:null,authenticate:null,serverTimeOffset:0,redirectUrl:"",errorCount:0,maxClientErrors:10,scripts:[],modules:[],resources:{}};Cognito.config=u=t.extend({},u,Cognito.config);Cognito.resources=t.extend({},Cognito.resources);Cognito._afterReadyEvents=[];Cognito._domReadyEvents=[];$exoweb({init:function(){var n=context.model.meta.addType("Cognito.CurrentUserType");n.addProperty({name:"Id",type:String});n.addProperty({name:"FullName",type:String});n.addProperty({name:"EmailAddress",type:String})},contextReady:function(){Cognito.ready("ExoWeb.context")},domReady:function(){try{var i=n.frameElement;if(i&&t(i.parentElement).is(".c-modal-content-container")&&i.contentWindow.location.href&&i.hasAttribute("src")&&!i.getAttribute("src"))return}catch(r){}Cognito.viewport=t(t(".cognito")[0]);Sys.Browser.agent==Sys.Browser.InternetExplorer?Sys.Browser.version>=12?t(".cognito:first").addClass("c-edge"):t(".cognito:first").addClass("c-ie"):Sys.Browser.agent==Sys.Browser.Firefox?t(".cognito:first").addClass("c-firefox"):Sys.Browser.agent==Sys.Browser.Safari?t(".cognito:first").addClass("c-safari"):Sys.Browser.agent==Sys.Browser.Opera&&t(".cognito:first").addClass("c-opera");Cognito.ready("ExoWeb.dom");n.setTimeout(function(){Cognito.heartbeat();t.each(Cognito._afterReadyEvents,function(){this.call(n,ExoJQuery)})},0);Cognito.config.isReady=!0}});Cognito.heartbeat=l;Cognito.on=nt;Cognito.fire=tt;Cognito.getScript=it;Cognito.now=rt;Cognito.serverNow=ut;i={};Cognito.readyDependencies=i;Cognito.ready=a;Cognito.domReady=ft;Cognito.afterDomReady=et;Cognito.modelReady=ot;Cognito.serviceRequest=v;Cognito.renewToken=st;Cognito.loadContent=ht;Cognito.load=ct;Cognito.loadConfig=lt;Cognito.deserializeDate=y;Cognito.deserialize=p;Cognito.normalizeDateValue=w;Cognito.normalizeTimeValue=b;Cognito.serialize=e;Cognito.isPropertyLookup=function(n){return Cognito.Forms.FormEntry&&n.get_jstype().meta&&n.get_jstype().meta.type.baseType===Cognito.Forms.FormEntry.meta};Cognito.validate=o;Cognito.deleteEntity=s;Cognito.getNormalizedName=at;Cognito.initializeParents=bt;Cognito.generateListItemId=h;Cognito.getParentInitializer=kt;Cognito.addListItem=dt;Cognito.removeListItem=gt;Cognito.populateLookup=ni;Cognito.addModule=ti;Cognito.loadFileData=ii;Cognito.getDynamicType=ri;Cognito.getOdataFilter=function(n){var i="",u,r,f,t;for(u in n)r=n[u],r&&(r instanceof Array?(t="",r.forEach(function(n){var i=u+" eq '"+n+"'";t=t==""?"("+i:t+" or "+i}),t=t+")",i=i==""?t:i+" and "+t):(f="startswith("+u+", '"+r+"')",i=i==""?f:i+" and "+f));return i};Cognito.getChoiceOptions=ui;Cognito.isModelValid=c;Cognito.getEnumWithName=fi;Cognito.getJsType=function(n){if(n===null)return null;var t=context.model.meta.types().filter(function(t){return t.get_fullName().toLowerCase()===n.toLowerCase()});return t.length>0?t[0].get_jstype():null};Cognito.formatUrl=ei;Cognito.formatText=oi;Cognito.escapeHtml=function(n){return n?n.replace(/&/g,"&").replace(/""/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">"):n};Cognito.escapeAndFormat=function(n){return Cognito.formatText(Cognito.escapeHtml(n))};Cognito.maskText=function(n){return n?n.replace(/./g,"*"):n};Cognito.isDeviceType=function(n){var t=si(navigator.userAgent),i=n.split("|");return i.some(function(n){return n.toLowerCase()===t})};Cognito.resize=function(n,i){var n,r;if(n&&i)n=n,r=t(i);else if(Cognito.viewport)n=Cognito.viewport.width(),r=Cognito.viewport;else return;n<=414?r.addClass("c-sml").removeClass("c-med").removeClass("c-lrg"):n<800?r.removeClass("c-sml").addClass("c-med").removeClass("c-lrg"):r.removeClass("c-sml").removeClass("c-med").addClass("c-lrg");n>414&&n<=525?r.addClass("c-smed"):r.removeClass("c-smed");t.event.trigger({type:"resize.cognito"})};Cognito.afterDomReady(function(t){t(n).resize(Cognito.resize);Cognito.resize()});g.mixin({serviceRequest:function(n){n.module=this.name;Cognito.serviceRequest(n)}});Cognito.Module=g;Array.prototype.some||(Array.prototype.some=function(n){"use strict";var i,r,u,t;if(this===void 0||this===null)throw new TypeError;if(i=Object(this),r=i.length>>>0,typeof n!="function")throw new TypeError;for(u=arguments.length>=2?arguments[1]:void 0,t=0;t<r;t++)if(t in i&&n.call(u,i[t],t,i))return!0;return!1})}(n.ExoJQuery||jQuery),function(){function n(n,t){t.name=t.name||"RequiredName";t.message=t.message||"Name is required.";var i=t.property instanceof ExoWeb.Model.Property?t.property:n.property(t.property);t.onChangeOf=t.onChangeOf?t.onChangeOf.concat([i.get_name()+".First",i.get_name()+".Last"]):[i.get_name()+".First",i.get_name()+".Last"];t.fn?(Object.defineProperty(this,"isRequired",{value:t.fn,writable:!0}),t.fn=null):Object.defineProperty(this,"isRequired",{value:t.isRequired!=!1});ExoWeb.Model.ValidatedPropertyRule.apply(this,[n,t])}function t(n,t){t.name=t.name||"RequiredSignature";t.message=t.message||Cognito.resources.get("required");var i=t.property instanceof ExoWeb.Model.Property?t.property:n.property(t.property);t.onChangeOf=t.onChangeOf?t.onChangeOf.concat(i.get_name()+".Svg"):i.get_name()+".Svg";t.fn?(Object.defineProperty(this,"isRequired",{value:t.fn,writable:!0}),t.fn=null):Object.defineProperty(this,"isRequired",{value:t.isRequired!=!1});ExoWeb.Model.ValidatedPropertyRule.apply(this,[n,t])}function i(n,t){t.name=t.name||"Address";t.message=t.message||"Address is required.";var i=t.property instanceof ExoWeb.Model.Property?t.property:n.property(t.property);t.onChangeOf=t.onChangeOf?t.onChangeOf.concat([i.get_name()+".Line1",i.get_name()+".City",i.get_name()+".State",i.get_name()+".PostalCode",i.get_name()+".Country"]):[i.get_name()+".Line1",i.get_name()+".City",i.get_name()+".State",i.get_name()+".PostalCode",i.get_name()+".Country"];t.fn?(Object.defineProperty(this,"isRequired",{value:t.fn,writable:!0}),t.fn=null):Object.defineProperty(this,"isRequired",{value:t.isRequired===!0});t.enforceableFields&&Object.defineProperty(this,"enforceableFields",{value:t.enforceableFields});ExoWeb.Model.ValidatedPropertyRule.apply(this,[n,t])}function r(n,t){t.name=t.name||"UniqueValue";t.message=t.message||"Value must be unique";Object.defineProperty(this,"sourceObject",{value:t.sourceObject});Object.defineProperty(this,"sourcePath",{value:t.sourcePath});ExoWeb.Model.ValidatedPropertyRule.apply(this,[n,t]);t.onInitExisting=!1}function u(n,t){var i,r,u;t.name=t.name||"RequiredRatingScale";i=t.property instanceof ExoWeb.Model.Property?t.property:n.property(t.property);Object.defineProperty(this,"property",{value:i});t.fn?(Object.defineProperty(this,"isRequired",{value:t.fn,writable:!0}),t.fn=null):Object.defineProperty(this,"isRequired",{value:t.isRequired!=!1});t.onInitNew=!0;r=[];u=i.get_name()+".";t.onChangeOf.forEach(function(i){i.indexOf(u)===0&&r.push(ExoWeb.Model.Rule.ensureConditionType(t.name+"."+i,n,ExoWeb.Model.ConditionType.Error))});Object.defineProperty(this,"conditionTypes",{value:r});ExoWeb.Model.Rule.apply(this,[n,t])}function f(n,t){return n.indexOf(t,n.length-t.length)!==-1}n.prototype=new ExoWeb.Model.ValidatedPropertyRule;n.prototype.constructor=n;n.mixin({execute:function(n){var f,e,o;this.isRequired.constructor===String&&(this.isRequired=this.rootType.compileExpression(this.isRequired));var u=this.property.value(n),i=this.message,r=this.properties,t=u;if(this.isRequired.constructor===Boolean)t=t&&this.isRequired;else{try{f=this.isRequired.call(n)}catch(s){f=!1}t=t&&f}t&&(e=!ExoWeb.Model.RequiredRule.hasValue(u.get_First()),o=!ExoWeb.Model.RequiredRule.hasValue(u.get_Last()),e&&o?(i=Cognito.resources.get("required-name-first-and-last"),r=[this.property.get_name(),this.property.get_name()+"{First,Last}"]):e?(i=Cognito.resources.get("required-name-first"),r=[this.property.get_name(),this.property.get_name()+"{First}"]):o?(i=Cognito.resources.get("required-name-last"),r=[this.property.get_name(),this.property.get_name()+"{Last}"]):t=!1);this.conditionType.when(t,n,r,i)}});ExoWeb.Model.Rule.requiredName=n;t.prototype=new ExoWeb.Model.ValidatedPropertyRule;t.prototype.constructor=t;t.mixin({assert:function(n){var i;this.isRequired.constructor===String&&(this.isRequired=this.rootType.compileExpression(this.isRequired));var r=this.property.value(n),u=this.message,f=this.properties,t=r;if(this.isRequired.constructor===Boolean)t=t&&this.isRequired;else{try{i=this.isRequired.call(n)}catch(e){i=!1}t=t&&i}return t&&!ExoWeb.Model.RequiredRule.hasValue(r.get_Svg())}});ExoWeb.Model.Rule.requiredSignature=t;i.prototype=new ExoWeb.Model.ValidatedPropertyRule;i.prototype.constructor=i;i.mixin({execute:function(n){var t,i=[],f=function(n,r,u){var e=0,s,f,h,o;for(t="",i.push(n),s=u.length-1;s>=0;s--)(f=u[s],h=r.get(f),ExoWeb.Model.RequiredRule.hasValue(r.get(f)))||(i.push(n+"."+f),o=Cognito.resources["address-"+f.toLowerCase()],f==="PostalCode"&&r.get_Country()===Cognito.resources.get("united-states")&&(o=Cognito.resources["address-zip-code"]),t=e==0?o:e==1?String.format(Cognito.resources.get("this-and-that"),o,t):String.format(Cognito.resources.get("this-comma-that"),o,t),e++);e>0&&(t=String.format(e==1?Cognito.resources.get("required-one"):Cognito.resources.get("required-many"),t))},r=this.property.value(n),u;if(r){if(this.isRequired.constructor===String&&(this.isRequired=this.rootType.compileExpression(this.isRequired)),this.isRequired.constructor===Boolean)u=this.isRequired;else try{u=this.isRequired.call(n,n)}catch(o){u=!1}u&&f(this.property.get_name(),r,this.enforceableFields||[]);r.get_Country()===Cognito.resources.get("united-states")&&(t||!ExoWeb.Model.RequiredRule.hasValue(r.get_PostalCode())||/^\s*(\d{5})(-\d{4})?\s*$/.test(r.get_PostalCode())||(t=Cognito.resources.get("address-zip-code-invalid"),i.push(this.property.get_name()),i.push(this.property.get_name()+".PostalCode")))}this.conditionType.when(!!t,n,i,t)}});ExoWeb.Model.Rule.address=i;r.prototype=new ExoWeb.Model.ValidatedPropertyRule;r.prototype.constructor=r;r.mixin({onRegister:function(){ExoWeb.Model.ValidatedPropertyRule.prototype.onRegister.call(this)},isValid:function(n,t,i){if(!this.sourceObject||!this.sourcePath){ExoWeb.logWarning('Unique rule on type "'+t.get_containingType().get_fullName()+'" has not been initialized.');return}if(i===undefined||i===null)return!0;var u=this.values(n),r=null;return Array.forEach(u,function(u){t.value(u).toLowerCase()==i.toLowerCase()&&u.get_Id()!=n.get_Id()&&(r=u)}),r==null||r==undefined},values:function(){if(!this.sourceObject||!this.sourcePath){ExoWeb.logWarning('Unique rule on type "'+this.prop.get_containingType().get_fullName()+'" has not been initialized.');return}return this.sourceObject["get_"+this.sourcePath]()}});ExoWeb.Model.Rule.unique=r;ExoWeb.Model.Property.prototype.unique=function(n,t,i){return new ExoWeb.Model.Rule.unique(this.get_containingType(),{property:this,message:i,sourcePath:t,sourceObject:n}),this};u.prototype=new ExoWeb.Model.Rule;u.prototype.constructor=u;u.mixin({execute:function(n){var e,o,u,i;this.isRequired.constructor===String&&(this.isRequired=this.rootType.compileExpression(this.isRequired));var t=this.property.value(n),h=Cognito.resources.get("required"),u=this.properties;if(t){if(this.isRequired.constructor===Boolean)e=this.isRequired;else{try{o=this.isRequired.call(n)}catch(v){o=!1}e=o}for(u=t.meta.type.get_properties(),i=0;i<u.length;i++){var r=u[i],c=r.get_fieldName(),l=e&&!ExoWeb.Model.RequiredRule.hasValue(t[c]),a=h.replace("{property}",r.get_label()),s=this.conditionTypes.filter(function(n){return f(n.code,r.get_name())})[0];s&&s.when(l,t,[r.get_name()],a)}}}});ExoWeb.Model.Rule.requiredRatingScale=u}();Cognito.sessionInit&&Cognito.sessionInit()})(window)