var BaseClass,NULL,CLMS,__decorate,_createMSXMLDocumentObject,System,__extends,Joove;(function(n){var t=function(){function t(n){this.cmdStack=[];this._masterPageEntryPoint=n}return t.prototype.checkSize=function(n){var i=CLMS.Framework.Utilities.SizeOf(n),t=i/1048576;t>=this._maximumModelSizeInMB&&console.error("Received a very large object: "+t.toFixed(2)+" MB. Consider optimizing your Form Model.")},t.prototype.get=function(t,i){var r=this,f,e,u;r.running=!0;f=window._context.currentController;e=window._context.currentAction;t===!0&&(f=window._context.currentMasterPageController,e=r._masterPageEntryPoint);u=window._context.urlQuery;window._context.isModal===!0&&(u+=u.indexOf("?")==-1?"?":"&",u+=n.Core.isModalParamName+"=true");$.ajax({url:""+window._context.siteRoot+f+"/_API_"+e+u,type:"GET",cache:!1,success:function(t,u,f){n.Session.ResetSessionExpirationTimeOut();r.checkSize(t);i&&i.success(t,u,f)},error:function(t,r,u){i&&i.error?i.error(t,r,u):n.Core.handleError(t)},complete:function(n,t){r.running=!1;setTimeout(function(){r.runOnCompleteHook(n)},500);i&&i.complete&&i.complete(n,t)}})},t.prototype.registerOnCompleteHook=function(n){this.running?this.cmdStack.push(n):n(null)},t.prototype.runOnCompleteHook=function(n){while(this.cmdStack.length>0){var t=this.cmdStack.shift();t(n)}},t}();n.BackEndInformationAggregator=t})(Joove||(Joove={})),function(n){var i=function(){function n(n){n===void 0&&(n=!1);this.clear();this._running=!1;n&&this.start()}return n.prototype.clear=function(){this._startTime=0;this._endTime=0},n.prototype.start=function(){this.clear();this._running=!0;this._startTime=performance.now()},n.prototype.stop=function(){this._endTime=performance.now();this._running=!1},n.prototype.getMilliseconds=function(){return this._running&&this.stop(),this._endTime-this._startTime},n}(),t=function(){function n(n,t,i){t===void 0&&(t=null);i===void 0&&(i=null);this.controller=n;this.action=t;this.information=i}return n.prototype.asString=function(){var n=this.controller;return this.action&&(n=n+";"+this.action),this.information&&(n=n+";"+this.information),n},n}(),r=function(){function n(){}return n}(),u=function(){function n(n,t){this.ID=n;this.ElapsedMilliseconds=t}return n}(),f=function(){function f(n){this._enabled=n;this._watches={}}return f.prototype.start=function(n,r,u){(r===void 0&&(r=null),u===void 0&&(u=null),this._enabled!==!1)&&(this._watches[new t(n,r,u).asString()]=new i(!0))},f.prototype.stop=function(n,i,r){(i===void 0&&(i=null),r===void 0&&(r=null),this._enabled!==!1)&&this._watches[new t(n,i,r).asString()].stop()},f.prototype.waitAndSend=function(n){var t=this;n===void 0&&(n=1e3);setTimeout(function(){t.send()},n)},f.prototype.send=function(){var t,i,f;if(this._watches!={}){t=[];for(i in this._watches)t.add(new u(i,this._watches[i].getMilliseconds()));t.length>0&&(f=new r,f.FrontEndMetricsDTOList=t,n.Ajax.ajax({url:""+window._context.siteRoot+window._context.currentController+"/_LogFrontEndPerformanceMeasurements",method:"POST",data:f,success:function(n){n.result==!1&&console.log("Error logging the Front End Performance Measurements. Exception Message: "+n.exception)},error:function(n){console.error("Error while sending the Front End Performance Measurements back to the Server:",n)}}));this._watches={}}},f}();n.PerformanceManager=f}(Joove||(Joove={})),function(n){var e=function(){function t(){this.availableCommands={DATALIST_REFRESH:"dataListRefresh",DATALIST_CLEAR_SELECTED_ITEMS:"dataListClearItems",DATALIST_UPDATE_SIZE:"dataListUpdateSize",GRID_GOTO_LAST_PAGE:"gridGotoLastPage",GRID_GOTO_PREV_PAGE:"gridGotoPrevPage",GRID_GOTO_NEXT_PAGE:"gridGotoNextPage",GRID_GOTO_FIRST_PAGE:"gridGotoFirstPage",GRID_GOTO_PAGE:"gridGotoPage",GRID_SAVE_STATE:"gridSaveState",GRID_CLEAR_STATE:"gridClearState",GRID_GO_TO_SAVED_PAGE:"gridGoToSavedPage",SHOW_MESSAGE:"showMessage",SHOW_MODAL:"showModal",HIDE_MODAL:"hideModal",CHART_REFRESH:"chartRefresh",PUSH_TO_NAVIGATION_HISTORY:"pushToHistory",CLOSE_FORM:"closeForm",REDIRECT:"redirect",GRID_REFRESH:"gridRefresh",MAP_REFRESH:"mapRefresh",MAP_DIRECTIONS:"mapDirections",MAP_FITCONTENT:"mapFitToContent",EXPORT_FORM_TO_PDF:"exportFormToPdf",EXPORT_CONTROL_TO_PDF:"exportControlToPdf",EXECUTE_JS:"executeJs",DROPDOWN_REFRESH:"dropdownRefresh",COMMIT_ALL_FILES:"commitAllFiles",CALENDAR_REFRESH:"calendarRefresh",SET_DIRTY:"setDirty",DOWNLOAD:"download",ImageRefresh:"imageRefresh"}}return t.prototype.executeCommands=function(n){var t,i,r;if(n!=null)for(t=0;t<n.length;t++){if(i=n[t],r=this.availableCommands[i.Command],r==null){console.error("Client command "+i.Command+" does not exist in the command set!");continue}this[r](i.Params)}},t.prototype.commitAllFiles=function(){},t.prototype.executeJs=function(args){eval(args[0])},t.prototype.setDirty=function(n){var t=n[0]==!0;window._context.isDirty=t},t.prototype.calendarRefresh=function(t){var r=t[0],u=$("[jb-id='"+r+"']"),i=n.Common.getDirectiveScope(u);i._helper.clearCache();i._helper.refresh()},t.prototype.mapRefresh=function(t){var i=t[0],r=n.Widgets.MapControl.instancesDic[i];r!=undefined?r.getData(!0):console.log("WARNING (Client Commander): Map instance "+i+" not found in mapRefresh function")},t.prototype.mapDirections=function(t){var i=t[0],u=t[1],f=t[2],r=n.Widgets.MapControl.instancesDic[i];r!=undefined?r.displayDirections(u,f,google.maps.TravelMode.DRIVING):console.log("WARNING (Client Commander): Map instance "+i+" not found in mapDirections function")},t.prototype.mapFitToContent=function(t){var i=t[0],r=n.Widgets.MapControl.instancesDic[i];r!=undefined?r.fitToContent():console.log("WARNING (Client Commander): Map instance "+i+" not found in mapFitToContent function")},t.prototype.redirect=function(n){var t=n[0],i,r;if(t==null||t.length===0){console.error("Url for redirection is null or empty!");return}if(n.length===1)window.location.href=t;else{i="_parent";n.length>1&&(i=n[1]);r=window.open(t,i);try{r.focus()}catch(u){console.error("Your browser does not allow popups. Please, disable it, or add this site to your exception list, if you are using a Pop-Up Blocker.")}}},t.prototype.closeForm=function(){try{window.location.href===window.parent.location.href?window._historyManager.back():window.parent._commander.hideModal("ControllerActionModal")}catch(n){console.error("Error closing form!",n);window._historyManager.back()}},t.prototype.pushToHistory=function(){window._historyManager.pushToHistory(window.location.href)},t.prototype.showModal=function(n){Array.isArray(n)&&(n=n[0]);window._popUpManager.showModalControl(n)},t.prototype.hideModal=function(n){Array.isArray(n)&&(n=n[0]);window._popUpManager.hideModalControl(n)},t.prototype.showMessage=function(t){var u=t[0],e=t.length>1?t[1]:"Success",f=t.length>2?t[2]:null,r=null,i;n.Common.stringIsNullOrEmpty(f)===!1&&(r=function(){window.location.href=f});i="";u!=null&&(i=typeof u=="string"?u:JSON.stringify(n.Cycles.decycleObject(u),null,2));switch(e){case"Error":window._popUpManager.error("",i,r);break;case"Info":window._popUpManager.info("",i,r);break;case"Warning":window._popUpManager.warning("",i,r);break;case"Success":default:window._popUpManager.success("",i,r)}},t.prototype.chartRefresh=function(t){var u=n.Widgets.ChartHelper.GetChartName(t[0]),i=n.Widgets.ChartHelper.instancesDic[u],r,f;if(i==null){console.error("Chart instance not found. Name: "+u);return}if(r=n.Common.getIndexKeyOfControl($(n.Common.getLastClickedElement())),n.Common.stringIsNullOrEmpty(r)||i[r]==null)for(f in i)i[f].updateChart();else i[r].updateChart()},t.prototype.dataListApplyPredefinedFilters=function(t){var r=t[0],i=n.Widgets.DataListControl.instancesDic[r];if(i==null){console.log("Datalist instance not found. Name:"+r);return}i.isInitialized&&n.Common.getDirectiveScope(i.$element).$applyFilters()},t.prototype.dataListClearFilters=function(t){var r=t[0],i=n.Widgets.DataListControl.instancesDic[r];if(i==null){console.log("Datalist instance not found. Name:"+r);return}i.isInitialized&&(i.removeAllCustomFilters(),i.dataTableInstance.draw(!1))},t.prototype.dataListRefresh=function(t){var r=t[0],i=n.Widgets.DataListControl.instancesDic[r];if(i==null){console.log("Datalist instance not found. Name:"+r);return}i.isInitialized&&i.dataTableInstance.draw(!1)},t.prototype.dataListClearItems=function(t){var r=t[0],i=n.Widgets.DataListControl.instancesDic[r];if(i==null){console.log("Datalist instance not found. Name:"+r);return}i.isInitialized&&i.deselectAll()},t.prototype.dataListUpdateSize=function(t){var r=t[0],i=n.Widgets.DataListControl.instancesDic[r];if(i==null){console.log("Datalist instance not found. Name:"+r);return}i.isInitialized&&setTimeout(function(){i.updateDataTableSize()},100)},t.prototype.gridGotoLastPage=function(n){var i=n[0],t=!1;n.length>1&&(t=n[1]);this.getGridDirectiveScope(i,function(n){n.$gotoLastPage(t)})},t.prototype.gridGotoPrevPage=function(n){var t=n[0];this.getGridDirectiveScope(t,function(n){n.$prevPage()})},t.prototype.gridGotoNextPage=function(n){var t=n[0];this.getGridDirectiveScope(t,function(n){n.$nextPage()})},t.prototype.gridGotoFirstPage=function(n){var t=n[0];this.getGridDirectiveScope(t,function(n){n.$gotoFirstPage()})},t.prototype.gridGotoPage=function(n){var t=n[0],i=n[1]-1;this.getGridDirectiveScope(t,function(n){n.$gotoPage(i)})},t.prototype.gridRefresh=function(n){var t=n[0];this.getGridDirectiveScope(t,function(n){n.$refresh?n.$refresh():n.$gotoPage(0,!1,!0)})},t.prototype.gridSaveState=function(n){var t=n[0];this.getGridDirectiveScope(t,function(n){var i=n.$currentPage;window.localStorage.setItem(t+"_currentPage",JSON.stringify(i))})},t.prototype.gridGoToSavedPage=function(n){var t=n[0];this.getGridDirectiveScope(t,function(n){var i=JSON.parse(window.localStorage.getItem(t+"_currentPage"));i!==null&&n.$gotoPage(i,!1,!0)})},t.prototype.gridClearState=function(n){var t=n[0];window.localStorage.removeItem(t+"_currentPage")},t.prototype.imageRefresh=function(n){var t=n[0];this.getImageDirectiveScope(t,function(n){n.download(!0,function(t){n.setImage(t)})})},t.prototype.exportFormToPdf=function(t){var i=t[0],r=t[1]||!1;n.Common.exportToPdf({usePrintMedia:r,filename:i})},t.prototype.exportControlToPdf=function(t){var i=t[0],r=t[1],u=t[2]||!1;n.Common.exportToPdf({filename:i,$element:$("[jb-id='"+r+"']"),usePrintMedia:u})},t.prototype.dropdownRefresh=function(t){var i=t[0];$("[jb-id='"+i+"']").each(function(t,i){n.Common.getDirectiveScope($(i)).fetchData()})},t.prototype.download=function(n){var t=n[0];window.open(window._context.siteRoot+window._context.currentController+"/DownloadFile?id="+t,"_blank")},t.prototype.getImageDirectiveScope=function(t,i,r){var e=this,u=this.getControlByName(t),f;u.length>1?(console.warn("Client Commander: Image command affecting more than 1 Images with name '"+t+"' (propably inside context!)"),u.each(function(){var f=this,u;r=r||0;n.Common.directiveScopeIsReady($(this))?(u=n.Common.getDirectiveScope($(this)),i(u)):r<30&&setTimeout(function(){f.getImageDirectiveScope(t,i,++r)},50)})):(r=r||0,n.Common.directiveScopeIsReady(u)?(f=n.Common.getDirectiveScope(u),i(f)):r<30&&setTimeout(function(){e.getImageDirectiveScope(t,i,++r)},50))},t.prototype.getGridDirectiveScope=function(t,i,r){var e=this,u=this.getControlByName(t),f;u.length>1&&console.warn("Client Commander: Grid command affecting more than 1 Grids with name '"+t+"' (propably inside context!)");r=r||0;n.Common.directiveScopeIsReady(u)?(f=n.Common.getDirectiveScope(u),i(f)):r<30&&setTimeout(function(){e.getGridDirectiveScope(t,i,++r)},50)},t.prototype.getControlByName=function(n){var t=$("[jb-id='"+n+"']");return t.length===0&&console.error("Client Commander: Control with name: '"+n+"' not Found"),t},t}(),i,r,u,t,f;n.ClientCommander=e;i=function(){function n(){}return n}();n.DebugConsoleStatus=i;r=function(){function n(){this._storageKey="_debugConsole";this.debugConsoleStatus=JSON.parse(window.localStorage.getItem(this._storageKey));this.debugConsoleStatus==null&&(this.debugConsoleStatus=new i)}return n.prototype.savePosition=function(n,t){n!=null&&(this.debugConsoleStatus.top=n);t!=null&&(this.debugConsoleStatus.left=t);window.localStorage.setItem(this._storageKey,JSON.stringify(this.debugConsoleStatus))},n.prototype.saveSize=function(n,t,i){n===void 0&&(n=0);t===void 0&&(t=0);i===void 0&&(i=0);n>0&&(this.debugConsoleStatus.width=n);t>0&&(this.debugConsoleStatus.bodyHeight=t);i>0&&(this.debugConsoleStatus.footerHeight=i);window.localStorage.setItem(this._storageKey,JSON.stringify(this.debugConsoleStatus))},n.prototype.saveVisibility=function(n,t){t===void 0&&(t=!1);this.debugConsoleStatus.visible=n;this.debugConsoleStatus.minimized=n===!1?!1:t;window.localStorage.setItem(this._storageKey,JSON.stringify(this.debugConsoleStatus))},n.prototype.clear=function(){window.localStorage.removeItem(this._storageKey)},n}();n.DebugConsoleManager=r;u=function(){function n(){this._storageKey="_navigationHistory";this._maxHistory=20;this.urls=JSON.parse(window.localStorage.getItem(this._storageKey));this.urls==null&&(this.urls=[])}return n.prototype.pushToHistory=function(n){var t=this.urls.length>0?this.urls[this.urls.length-1]:window._context.siteRoot;(n=this.trimLastQuestionmarkFromURL(n),n!=null&&n.trim().length!==0&&n.trim()!==t)&&(this.urls.length>=this._maxHistory&&this.urls.splice(0,1),this.urls.push(n),this.save())},n.prototype.save=function(){window.localStorage.setItem(this._storageKey,JSON.stringify(this.urls))},n.prototype.clear=function(){window.localStorage.removeItem(this._storageKey)},n.prototype.navigate=function(n){this.pushToHistory(n);window.location.href=n},n.prototype.trimLastQuestionmarkFromURL=function(n){return n!=null&&n[n.length-1]==="?"&&(n=n.substr(0,n.length-1)),n},n.prototype.back=function(){var n=this.urls.length>0?this.urls[this.urls.length-1]:window._context.siteRoot,t=this.trimLastQuestionmarkFromURL(window.location.href);n===t&&(n=this.urls.length>1?this.urls[this.urls.length-2]:window._context.siteRoot);this.navigate(n)},n}();n.HistoryManager=u,function(n){n[n.LOADED=0]="LOADED";n[n.LOADING=1]="LOADING"}(t=n.ScriptState||(n.ScriptState={}));f=function(){function n(n){this.scriptsStates=n;this.scriptsStates={}}return n.prototype.requireScript=function(n,i,r){var u=this;return this.scriptsStates[n]===t.LOADED?new Promise(function(n){n(!0)}):(this.scriptsStates[n]=t.LOADING,new Promise(function(f){var e=document.createElement("script"),o;e.setAttribute("src",i);o=function(){u.scriptsStates[n]=t.LOADED;r&&r();f(!0)};e.onload=o;document.head.appendChild(e)}))},n.prototype.isScriptLoaded=function(n){return this.scriptsStates[n]===t.LOADED},n.prototype.waitForScriptLoad=function(n,t){var i=setInterval(function(){eval("typeof "+n)!=="undefined"&&(clearInterval(i),t())},50)},n}();n.ScriptLoaderManager=f}(Joove||(Joove={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){function i(n){return new ut(n)}function wt(n){var t=0,i,r,u;if(n.length===0)return t;for(i=0,r=n.length;i<r;i++)u=n.charCodeAt(i),t=(t<<5)-t+u|0;return t}function tt(t,i){var u=n.EMPTY,r;if(!isNaN(i))for(r=0;r<i;r++)u+=t;return u}function bt(t,i){var u,r,f,e;if(i===void 0&&(i=1),t instanceof Array){for(u=n.EMPTY,r=0,f=t;r<f.length;r++)e=f[r],u+=String.fromCharCode(e);return u}return tt(String.fromCharCode(t),i)}function st(n){return n.replace(/[-[\]\/{}()*+?.\\^$|]/g,"\\$&")}function l(t,i,r){if(i===n.EMPTY)return t;if(i){var u=st(i instanceof Array?i.join():i);return t.replace(new RegExp("^["+u+"]+|["+u+"]+$","g"+(r?"i":"")),n.EMPTY)}return t.replace(/^\s+|\s+$/g,n.EMPTY)}function ht(n){for(var i=[],t=1;t<arguments.length;t++)i[t-1]=arguments[t];return ct(n,i)}function ct(n,t){var r=t instanceof Array;return n.replace(/\{([^{}]*)}/g,function(n,u){var o=u,e,f;r&&(e=parseInt(u),isNaN(e)||(o=e));f=t[o];switch(typeof f){case i.STRING:case i.NUMBER:case i.BOOLEAN:return f;default:return f&&i.hasMemberOfType(f,"toString",i.FUNCTION)?f.toString():n}})}function lt(n,t){return!i.isString(n)||!t?!1:n===t?!0:(t.length<n.length,null)}function kt(n,t){var r=lt(n,t);return i.isBoolean(r)?r:n.indexOf(t)===0}function dt(n,t){var r=lt(n,t);return i.isBoolean(r)?r:n.lastIndexOf(t)===n.length-t.length}function gt(n,t,i){var r,u;return(t===void 0&&(t=""),n==null)?null:(r=t.toString(),Array.isArray(t)==!0&&(r=t.join("")),u=n.split(new RegExp("["+r+"]")),i===!0)?u.linq.where(function(n){return n!=null&&n.trim()!=""}).toArray():u}function f(n){return Math.floor(n)}var p=null,it,at,u,v,h,d,t,o,c,s,e,ni,ft,y,vt,ti,et,ii,ri,yt,ui,fi;n.EMPTY="";var r=void 0,g="boolean",a="number",w="string",nt="symbol",b="object",rt=typeof r,k=typeof function(){},pt="length",ot={},ut=function(){function n(n,t){this.isBoolean=!1;this.isNumber=!1;this.isString=!1;this.isTrueNaN=!1;this.isObject=!1;this.isFunction=!1;this.isUndefined=!1;this.isNull=!1;this.isPrimitive=!1;this.isSymbol=!1;switch(this.type=typeof n){case g:this.isBoolean=!0;this.isPrimitive=!0;break;case a:this.isNumber=!0;this.isTrueNaN=isNaN(n);this.isFinite=isFinite(n);this.isValidNumber=!this.isTrueNaN;this.isPrimitive=!0;break;case w:this.isString=!0;this.isPrimitive=!0;break;case nt:this.isSymbol=!0;break;case b:this.target=n;n===null?(this.isNull=!0,this.isNullOrUndefined=!0,this.isPrimitive=!0):(this.isArray=n instanceof Array,this.isObject=!0);break;case k:this.target=n;this.isFunction=!0;break;case rt:this.isUndefined=!0;this.isNullOrUndefined=!0;this.isPrimitive=!0;break;default:throw"Fatal type failure.  Unknown type: "+this.type;}t&&t(this);Object.freeze(this)}return n.prototype.member=function(t){var i=this.target;return n.getFor(i&&t in i?i[t]:r)},n.getFor=function(t){var r=typeof t,i;switch(r){case b:case k:return new n(t)}return i=ot[r],i||(ot[r]=i=new n(t)),i},n.prototype.is=function(n){return this.target instanceof n},n.prototype.as=function(n){return this.target instanceof n?this.target:null},n}();n.TypeInfo=ut;n.Type=i,function(n){function f(n,t){return n instanceof t}function e(n,t){return n instanceof t?n:null}function o(n){return n==null}function s(n){return typeof n===g}function h(n,t){return t===void 0&&(t=!1),typeof n===a&&(!t||!isNaN(n))}function c(n){return typeof n===a&&isNaN(n)}function l(n){return typeof n===w}function t(n,t){t===void 0&&(t=!1);var i=typeof n;switch(i){case g:case w:case a:return!0;case rt:return t;case b:return n===null}return!1}function v(n,i){return i===void 0&&(i=!1),typeof n===nt?!0:t(n,i)}function y(n){var t=typeof n;switch(t){case w:case a:case nt:return!0}return!1}function p(n){return typeof n===k}function d(n,t){return t===void 0&&(t=!1),typeof n===b&&(t||n!==null)}function tt(n){return isNaN(n)?NaN:n}function it(n){return ut.getFor(n)}function i(n,i,u){return u===void 0&&(u=!0),n&&!t(n)&&i in n&&(u||n[i]!==r)}function u(n,t,r){return i(n,t)&&typeof n[t]===r}function ft(n,t){return u(n,t,k)}function et(t){return t instanceof Array||n.isString(t)||!n.isFunction(t)&&i(t,pt)}n.BOOLEAN=g;n.NUMBER=a;n.STRING=w;n.OBJECT=b;n.SYMBOL=nt;n.UNDEFINED=rt;n.FUNCTION=k;n.is=f;n.as=e;n.isNullOrUndefined=o;n.isBoolean=s;n.isNumber=h;n.isTrueNaN=c;n.isString=l;n.isPrimitive=t;n.isPrimitiveOrSymbol=v;n.isPropertyKey=y;n.isFunction=p;n.isObject=d;n.numberOrNaN=tt;n.of=it;n.hasMember=i;n.hasMemberOfType=u;n.hasMethod=ft;n.isArrayLike=et}(i=n.Type||(n.Type={}));n.getHashCode=wt;n.repeat=tt;n.fromChars=bt;n.escapeRegExp=st;n.trim=l;n.format=ht;n.supplant=ct;n.startsWith=kt;n.endsWith=dt;n.split=gt;it=function(){function n(message,innerException,beforeSealing){var _,stack;this.message=message;_=this;this.name=_.getName();this.data={};innerException&&(_.data.innerException=innerException);beforeSealing&&beforeSealing(_);try{stack=eval("new System.Error()").stack;stack=stack&&stack.replace(/^Error\n/,"").replace(/(.|\n)+\s+at new.+/,"")||"";this.stack=_.toStringWithoutBrackets()+stack}catch(ex){}Object.freeze(_)}return n.prototype.getName=function(){return"Exception"},n.prototype.toString=function(){return"["+this.toStringWithoutBrackets()+"]"},n.prototype.toStringWithoutBrackets=function(){var n=this,t=n.message;return n.name+(t?": "+t:"")},n.prototype.dispose=function(){var n=this.data,t;for(t in n)n.hasOwnProperty(t)&&delete n[t]},n}();n.Exception=it;at=function(){function n(t){var i=this;if(this.Equals=function(t){return n.IsGuid(t)&&i.value===t},this.IsEmpty=function(){return i.value===n.EMPTY},this.ToString=function(){return i.value},this.toString=function(){return i.value},this.ToJSON=function(){return i.value},!t)throw new TypeError("Invalid argument; `value` has no value.");this.value=n.EMPTY;t&&t instanceof n?this.value=t.toString():t&&Object.prototype.toString.call(t)==="[object String]"&&n.IsGuid(t)&&(this.value=t)}return n.gen=function(n){for(var i="",t=0;t<n;t++)i+=((1+Math.random())*65536|0).toString(16).substring(1);return i},n.IsGuid=function(t){return t&&(t instanceof n||this._validator.test(t.toString()))},n.NewGuid=function(){var t=n.gen;return new n([t(2),t(1),t(1),t(1),t(3)].join("-"))},n.Parse=function(t){if(this.IsGuid(t))return new n(t);throw new Error("Can't parse this to Guid");},n.Raw=function(){var t=n.gen;return[t(2),t(1),t(1),t(1),t(3)].join("-")},n._validator=new RegExp("^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$","i"),n.EMPTY="00000000-0000-0000-0000-000000000000",n}();n.Guid=at,function(n){function t(n,t,i){return i===void 0&&(i=!0),n===t||!i&&n===t||e(n)&&o(t)}function s(n,f,e){return(e===void 0&&(e=!0),t(n,f,e))?0:n&&i.hasMember(n,r)?n.compareTo(f):f&&i.hasMember(f,r)?-f.compareTo(n):n>f||e&&(n===0&&f===0||n===null&&f===u)?1:f>n||e&&(f===0&&n===0||f===null&&n===u)?-1:NaN}function f(n,r,u,e){var s,c,a,o;if(u===void 0&&(u=!0),e===void 0&&(e=0),t(n,r,!0))return!0;if(n==null||r==null)return u?i.isObject(n)?!Object.keys(n).length:i.isObject(r)?!Object.keys(r).length:n==null&&r==null:!1;if(i.isObject(n)&&i.isObject(r)){var h=Object.keys(n),l=Object.keys(r),v=h.length;if(v!==l.length)return!1;for(h.sort(),l.sort(),s=0;s<v;s++)if(o=h[s],o!==l[s]||!t(n[o],r[o],!0))return!1;if(e>0)for(c=0,a=h;c<a.length;c++)if(o=a[c],!f(n[o],r[o],u,e-1))return!1;return!0}return!1}var e=i.isTrueNaN,o=i.isTrueNaN,u=void 0,r;n.areEqual=t;r="compareTo";n.compare=s;n.areEquivalent=f}(u=n.Compare||(n.Compare={})),function(n){function h(n){return n&&n.hasOwnProperty(e)&&n.hasOwnProperty(s)}function o(n,i){if(i===void 0&&(i=r),u(n,i+f+e),n===null)throw new t.ArgumentNullException(i+f+e);return n}function c(n,i){if(i===void 0&&(i=r),n.length!==2)throw new t.ArgumentException(i,"KeyValuePair tuples must be of length 2.");o(n[0],i)}function u(n,i){if(n===l)throw new t.ArgumentException(i,p);return n}function w(n,f){var e,s;if(i.isArrayLike(n))c(n),e=n[0],s=u(n[1],a);else if(h(n))e=o(n.key),s=u(n.value,v);else throw new t.ArgumentException(r,y);return f(e,s)}var l=void 0,f=".",e="key",s="value",r="item",a=r+"[1]",v=r+f+s,y="Invalid type.  Must be a KeyValuePair or Tuple of length 2.",p="Cannot equal undefined.";n.isKeyValuePair=h;n.assertKey=o;n.assertTuple=c;n.assertNotUndefined=u;n.extractKeyValue=w}(v=n.KeyValueExtractModule||(n.KeyValueExtractModule={}));n.Integer=f,function(n){function f(n){var t=n|0;if(isNaN(n))throw"'n' is not a number.";if(n!==-1&&t===-1)throw"'n' is too large to be a 32 bit integer.";return t}function r(n){return typeof n===u&&isFinite(n)&&n===Math.floor(n)}function e(n){return n===(n|0)}function i(n,i){var u=r(n);if(!u)throw new t.ArgumentException(i||"n","Must be a integer.");return u}function o(n,r){var u=i(n,r)&&n>=0;if(!u)throw new t.ArgumentOutOfRangeException(r||"n",n,"Must be a valid integer greater than or equal to zero.");return u}function s(n,r){var u=i(n,r)&&n>0;if(!u)throw new t.ArgumentOutOfRangeException(r||"n",n,"Must be greater than zero.");return u}n.MAX_32_BIT=2147483647;n.MAX_VALUE=9007199254740991;var u="number";n.as32Bit=f;n.is=r;n.is32Bit=e;n.assert=i;n.assertZeroOrGreater=o;n.assertPositive=s}(f=n.Integer||(n.Integer={}));h=function(){function n(){}return n.prototype.Identity=function(n){return n},n.prototype.True=function(){return!0},n.prototype.False=function(){return!1},n.prototype.Blank=function(){},n}();n.Functions=h;d=new h,function(n){n.Identity=d.Identity;n.True=d.True;n.False=d.False;n.Blank=d.Blank}(h=n.Functions||(n.Functions={}));Object.freeze(h),function(n){var t=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.prototype.getName=function(){return"SystemException"},t}(it),i,r,u,f,e,o;n.SystemException=t;i=function(n){function t(t,i,r,u){var e=this,f=t?"{"+t+"} ":"";return n.call(this,l(f+(i||"")),r,function(n){n.paramName=t;u&&u(n)})||this}return __extends(t,n),t.prototype.getName=function(){return"ArgumentException"},t}(t);n.ArgumentException=i;r=function(n){function t(t,i,r){return i===void 0&&(i="'"+t+"' is null (or undefined)."),n.call(this,t,i,r)||this}return __extends(t,n),t.prototype.getName=function(){return"ArgumentNullException"},t}(i);n.ArgumentNullException=r;u=function(n){function t(t,i,r,u){return r===void 0&&(r=" "),n.call(this,t,"("+i+") "+r,u,function(n){n.actualValue=i})||this}return __extends(t,n),t.prototype.getName=function(){return"ArgumentOutOfRangeException"},t}(i);n.ArgumentOutOfRangeException=u;f=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.prototype.getName=function(){return"InvalidOperationException"},t}(t);n.InvalidOperationException=f;e=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.prototype.getName=function(){return"NullReferenceException"},t}(t);n.NullReferenceException=e;o=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.prototype.getName=function(){return"NotImplementedException"},t}(t);n.NotImplementedException=o}(t=n.Exceptions||(n.Exceptions={})),function(n){function r(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];u(t,!1)}function l(n,t){try{return t(n)}finally{f(n,!1)}}function f(n,t){if(n&&typeof n==i.OBJECT&&typeof n.dispose=="function")if(t)try{n.dispose()}catch(r){return r}else n.dispose();return null}function u(n,t,i){var r,s,e,h,o;for(i===void 0&&(i=0),s=n?n.length:0;i<s;i++)if(e=n[i],e)if(t)h=f(e,!0),h&&(r||(r=[]),r.push(h));else{o=!1;try{f(e,!1);o=!0}finally{!o&&i+1<s&&u(n,!1,i+1)}if(!o)break}return r}var h=function(n){function t(t,i,r){return n.call(this,i||"",r,function(n){n.objectName=t})||this}return __extends(t,n),t.prototype.getName=function(){return"ObjectDisposedException"},t.prototype.toString=function(){var t=this,n=t.objectName;return n=n?"{"+n+"} ":"","["+t.name+": "+n+t.message+"]"},t.throwIfDisposed=function(n,i,r){if(n.wasDisposed)throw new t(i,r);return!0},t}(t.InvalidOperationException),o;n.ObjectDisposedException=h;o=function(){function n(n){this.__finalizer=n;this.__wasDisposed=!1}return Object.defineProperty(n.prototype,"wasDisposed",{get:function(){return this.__wasDisposed},enumerable:!0,configurable:!0}),n.prototype.throwIfDisposed=function(n,t){if(t===void 0&&(t=this._disposableObjectName),this.__wasDisposed)throw new h(t,n);return!0},n.prototype.dispose=function(){var n=this;if(!n.__wasDisposed){n.__wasDisposed=!0;try{n._onDispose()}finally{n.__finalizer&&(n.__finalizer(),n.__finalizer=void 0)}}},n.prototype._onDispose=function(){},n}();n.DisposableBase=o;n.dispose=r,function(n){function i(n,t){t===void 0&&(t=!1);n&&f(n,t)}function r(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];t.deferred(i)}function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return u(t,!0)}function t(n,t){if(n&&n.length)return u(n.slice(),t)}n.single=i;n.deferred=r;n.withoutException=e;n.these=t,function(n){function t(n,t){t===void 0&&(t=0);n&&n.length&&(t>=0||(t=0),setTimeout(u,t,n.slice(),!0))}function i(n,t){if(n&&n.length)return u(n,t)}n.deferred=t;n.noCopy=i}(t=n.these||(n.these={}))}(r=n.dispose||(n.dispose={}));n.using=l;n.disposeSingle=f;var a="ObjectPool",c="_maxSize",e=65536,v="Must be at valid number least 1.",y="Must be less than or equal to "+e+".",p=function(n){function i(i,r,u){var o=n.call(this)||this,f,h;if(o._maxSize=i,o._generator=r,o._recycler=u,o.autoClearTimeout=5e3,isNaN(i)||i<1)throw new t.ArgumentOutOfRangeException(c,i,v);if(i>e)throw new t.ArgumentOutOfRangeException(c,i,y);return o._localAbsMaxSize=Math.min(i*2,e),f=o,f._disposableObjectName=a,f._pool=[],f._trimmer=new s.Tasks.TaskHandler(function(){return f._trim()}),h=function(){return f._clear()},f._flusher=new s.Tasks.TaskHandler(h),f._autoFlusher=new s.Tasks.TaskHandler(h),o}return __extends(i,n),Object.defineProperty(i.prototype,"maxSize",{get:function(){return this._maxSize},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"count",{get:function(){var n=this._pool;return n?n.length:0},enumerable:!0,configurable:!0}),i.prototype._trim=function(){for(var n=this._pool;n.length>this._maxSize;)r.single(n.pop(),!0)},i.prototype.trim=function(n){this.throwIfDisposed();this._trimmer.start(n)},i.prototype._clear=function(){var n=this,t=n._pool;n._trimmer.cancel();n._flusher.cancel();n._autoFlusher.cancel();r.these.noCopy(t,!0);t.length=0},i.prototype.clear=function(n){this.throwIfDisposed();this._flusher.start(n)},i.prototype.toArrayAndClear=function(){var n=this,t;return n.throwIfDisposed(),n._trimmer.cancel(),n._flusher.cancel(),t=n._pool,n._pool=[],t},i.prototype.dump=function(){return this.toArrayAndClear()},i.prototype._onDispose=function(){n.prototype._onDispose.call(this);var t=this;t._generator=null;t._recycler=null;r(t._trimmer,t._flusher,t._autoFlusher);t._trimmer=null;t._flusher=null;t._autoFlusher=null;t._pool.length=0;t._pool=null},i.prototype.extendAutoClear=function(){var n=this,t;n.throwIfDisposed();t=n.autoClearTimeout;isFinite(t)&&!n._autoFlusher.isScheduled&&n._autoFlusher.start(t)},i.prototype.add=function(n){var t=this,i;t.throwIfDisposed();t._pool.length>=t._localAbsMaxSize?r(n):(t._recycler&&t._recycler(n),t._pool.push(n),i=t._maxSize,i<e&&t._pool.length>i&&t._trimmer.start(500));t.extendAutoClear()},i.prototype._onTaken=function(){var n=this,t=n._pool.length;t<=n._maxSize&&n._trimmer.cancel();t&&n.extendAutoClear()},i.prototype.tryTake=function(){var n=this;n.throwIfDisposed();try{return n._pool.pop()}finally{n._onTaken()}},i.prototype.take=function(n){var i=this;if(i.throwIfDisposed(),!i._generator&&!n)throw new t.ArgumentException("factory","Must provide a factory if on was not provided at construction time.");try{return i._pool.pop()||n&&n()||i._generator()}finally{i._onTaken()}},i}(o);n.ObjectPool=p}(o=n.Disposable||(n.Disposable={})),function(n){function l(n){return i.hasMemberOfType(n,it,i.FUNCTION)}function rt(n,t,i){var u=t?t(n):n;return u&&l(u)?r.wrap(u):i(u)}function ut(n,t,i){try{var u=i?i(t):t;return n&&n.resolve(u),null}catch(r){return n&&n.reject(r),r}}function w(n,t,i,r){try{var u=r?r(i):i;n&&n(u)}catch(f){t&&t(f)}}function ft(n,t,i){n instanceof h?n.thenThis(t,i):n.then(t,i)}function g(n,t,i){return n instanceof h?n.thenSynchronous(t,i):n.then(t,i)}function ct(){return new o.ObjectDisposedException("Promise","An underlying promise-result was disposed.")}var u=void 0,f=null,tt="Promise",ht=tt+"State",it="then",d="target",et=function(n){function t(t,i,r){var u=n.call(this)||this;return u._state=t,u._result=i,u._error=r,u._disposableObjectName=ht,u}return __extends(t,n),t.prototype._onDispose=function(){this._state=u;this._result=u;this._error=u},t.prototype.getState=function(){return this._state},Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isPending",{get:function(){return this.getState()===r.State.Pending},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSettled",{get:function(){return this.getState()!=r.State.Pending},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isFulfilled",{get:function(){return this.getState()===r.State.Fulfilled},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isRejected",{get:function(){return this.getState()===r.State.Rejected},enumerable:!0,configurable:!0}),t.prototype.getResult=function(){return this._result},Object.defineProperty(t.prototype,"result",{get:function(){return this.throwIfDisposed(),this.getResult()},enumerable:!0,configurable:!0}),t.prototype.getError=function(){return this._error},Object.defineProperty(t.prototype,"error",{get:function(){return this.throwIfDisposed(),this.getError()},enumerable:!0,configurable:!0}),t}(o.DisposableBase),h,v,b,y,k,nt,r,c,ot,p,a,st;n.PromiseState=et;h=function(n){function t(){var t=n.call(this,r.State.Pending)||this;return t._disposableObjectName=tt,t}return __extends(t,n),t.prototype.then=function(n,t){var i=this;return this.throwIfDisposed(),new r(function(r,u){i.thenThis(function(t){return w(r,u,t,n)},function(n){return t?w(r,u,n,t):u(n)})})},t.prototype.thenAllowFatal=function(n,t){var i=this;return this.throwIfDisposed(),new r(function(r,u){i.thenThis(function(t){return r(n?n(t):t)},function(n){return u(t?t(n):n)})})},t.prototype.done=function(n,t){var i=this;s.defer(function(){return i.thenThis(n,t)})},t.prototype.delayFromNow=function(n){var t=this;return n===void 0&&(n=0),this.throwIfDisposed(),new r(function(i,r){s.defer(function(){t.thenThis(function(n){return i(n)},function(n){return r(n)})},n)},!0)},t.prototype.delayAfterResolve=function(n){var t=this;return(n===void 0&&(n=0),this.throwIfDisposed(),this.isSettled)?this.delayFromNow(n):new r(function(i,r){t.thenThis(function(t){return s.defer(function(){return i(t)},n)},function(t){return s.defer(function(){return r(t)},n)})},!0)},t.prototype["catch"]=function(n){return this.then(u,n)},t.prototype.catchAllowFatal=function(n){return this.thenAllowFatal(u,n)},t.prototype["finally"]=function(n){return this.then(n,n)},t.prototype.finallyAllowFatal=function(n){return this.thenAllowFatal(n,n)},t.prototype.finallyThis=function(n,t){this.throwIfDisposed();var i=t?n:function(){return s.deferImmediate(n)};return this.thenThis(i,i),this},t}(et);n.PromiseBase=h;v=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.prototype.thenSynchronous=function(n,t){this.throwIfDisposed();try{switch(this.state){case r.State.Fulfilled:return n?rt(this._result,n,r.resolve):this;case r.State.Rejected:return t?rt(this._error,t,r.resolve):this}}catch(i){return new k(i)}throw new Error("Invalid state for a resolved promise.");},t.prototype.thenThis=function(n,t){this.throwIfDisposed();switch(this.state){case r.State.Fulfilled:n&&n(this._result);break;case r.State.Rejected:t&&t(this._error)}return this},t}(h);n.Resolvable=v;b=function(n){function t(t,i,r){var u=n.call(this)||this;return u._result=i,u._error=r,u._state=t,u}return __extends(t,n),t}(v);n.Resolved=b;y=function(n){function t(t){return n.call(this,r.State.Fulfilled,t)||this}return __extends(t,n),t}(b);n.Fulfilled=y;k=function(n){function t(t){return n.call(this,r.State.Rejected,u,t)||this}return __extends(t,n),t}(b);n.Rejected=k;nt=function(n){function i(i){var f=n.call(this)||this;if(f._target=i,!i)throw new t.ArgumentNullException(d);if(!l(i))throw new t.ArgumentException(d,"Must be a promise-like object.");return i.then(function(n){f._state=r.State.Fulfilled;f._result=n;f._error=u;f._target=u},function(n){f._state=r.State.Rejected;f._error=n;f._target=u}),f}return __extends(i,n),i.prototype.thenSynchronous=function(t,i){this.throwIfDisposed();var u=this._target;return u?new r(function(n,r){ft(u,function(i){return w(n,r,i,t)},function(t){return i?w(n,null,t,i):r(t)})},!0):n.prototype.thenSynchronous.call(this,t,i)},i.prototype.thenThis=function(t,i){this.throwIfDisposed();var r=this._target;return r?(ft(r,t,i),this):n.prototype.thenThis.call(this,t,i)},i.prototype._onDispose=function(){n.prototype._onDispose.call(this);this._target=u},i}(v);r=function(n){function i(t,i){i===void 0&&(i=!1);var r=n.call(this)||this;return t&&r.resolveUsing(t,i),r}return __extends(i,n),i.prototype.thenSynchronous=function(t,r){if(this.throwIfDisposed(),this._state)return n.prototype.thenSynchronous.call(this,t,r);var u=new i;return(this._waiting||(this._waiting=[])).push(a.PromiseCallbacks.init(t,r,u)),u},i.prototype.thenThis=function(t,i){return(this.throwIfDisposed(),this._state)?n.prototype.thenThis.call(this,t,i):((this._waiting||(this._waiting=[])).push(a.PromiseCallbacks.init(t,i)),this)},i.prototype._onDispose=function(){n.prototype._onDispose.call(this);this._resolvedCalled=u},i.prototype.resolveUsing=function(n,r){var f=this;if(r===void 0&&(r=!1),!n)throw new t.ArgumentNullException("resolver");if(this._resolvedCalled)throw new t.InvalidOperationException(".resolve() already called.");if(this.state)throw new t.InvalidOperationException("Already resolved: "+i.State[this.state]);this._resolvedCalled=!0;var u=0,e=function(n){u?console.warn(u==-1?"Rejection called multiple times":"Rejection called after fulfilled."):(u=-1,f._resolvedCalled=!1,f.reject(n))},o=function(n){u?console.warn(u==1?"Fulfill called multiple times":"Fulfill called after rejection."):(u=1,f._resolvedCalled=!1,f.resolve(n))};r?n(o,e):s.deferImmediate(function(){return n(o,e)})},i.prototype._emitDisposalRejection=function(n){var t=n.wasDisposed;return t&&this._rejectInternal(ct()),t},i.prototype._resolveInternal=function(n){var r=this,t,f,e,o;if(!this.wasDisposed){while(n instanceof h){if(t=n,this._emitDisposalRejection(t))return;switch(t.state){case i.State.Pending:t.thenSynchronous(function(n){return r._resolveInternal(n)},function(n){return r._rejectInternal(n)});return;case i.State.Rejected:this._rejectInternal(t.error);return;case i.State.Fulfilled:n=t.result}}if(l(n))n.then(function(n){return r._resolveInternal(n)},function(n){return r._rejectInternal(n)});else if(this._state=i.State.Fulfilled,this._result=n,this._error=u,f=this._waiting,f){for(this._waiting=u,e=0,o=f;e<o.length;e++){var s=o[e],c=s.onFulfilled,v=s.promise;a.PromiseCallbacks.recycle(s);ut(v,n,c)}f.length=0}}},i.prototype._rejectInternal=function(n){var t,r,u;if(!this.wasDisposed&&(this._state=i.State.Rejected,this._error=n,t=this._waiting,t)){for(this._waiting=null,r=0,u=t;r<u.length;r++){var f=u[r],o=f.onRejected,e=f.promise;a.PromiseCallbacks.recycle(f);o?ut(e,n,o):e&&e.reject(n)}t.length=0}},i.prototype.resolve=function(n,r){if(r===void 0&&(r=!1),this.throwIfDisposed(),n==this)throw new t.InvalidOperationException("Cannot resolve a promise as itself.");if(this._state){if(!r||this._state==i.State.Fulfilled&&this._result===n)return;throw new t.InvalidOperationException("Changing the fulfilled state/value of a promise is not supported.");}if(this._resolvedCalled){if(r)throw new t.InvalidOperationException(".resolve() already called.");return}this._resolveInternal(n)},i.prototype.reject=function(n,r){if(r===void 0&&(r=!1),this.throwIfDisposed(),this._state){if(!r||this._state==i.State.Rejected&&this._error===n)return;throw new t.InvalidOperationException("Changing the rejected state/value of a promise is not supported.");}if(this._resolvedCalled){if(r)throw new t.InvalidOperationException(".resolve() already called.");return}this._rejectInternal(n)},i}(v);n.Promise=r;c=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.prototype.map=function(n){var i=this;return this.throwIfDisposed(),new t(function(t){i.thenThis(function(i){return t(i.map(n))})},!0)},t.prototype.reduce=function(n,t){return this.thenSynchronous(function(i){return i.reduce(n,t)})},t.fulfilled=function(n){return new t(function(){return n},!0)},t}(r);n.ArrayPromise=c;ot="PromiseCollection";p=function(n){function t(t){var i=n.call(this)||this;return i._disposableObjectName=ot,i._source=t&&t.slice()||[],i}return __extends(t,n),t.prototype._onDispose=function(){n.prototype._onDispose.call(this);this._source.length=0;this._source=null},Object.defineProperty(t.prototype,"promises",{get:function(){return this.throwIfDisposed(),this._source.slice()},enumerable:!0,configurable:!0}),t.prototype.all=function(){return this.throwIfDisposed(),r.all(this._source)},t.prototype.race=function(){return this.throwIfDisposed(),r.race(this._source)},t.prototype.waitAll=function(){return this.throwIfDisposed(),r.waitAll(this._source)},t.prototype.map=function(n){var t=this;return this.throwIfDisposed(),new c(function(i){t.all().thenThis(function(t){return i(t.map(n))})},!0)},t.prototype.pipe=function(n){return this.throwIfDisposed(),new t(this._source.map(function(t){return g(t,n)}))},t.prototype.reduce=function(n,t){return this.throwIfDisposed(),r.wrap(this._source.reduce(function(t,i,r,u){return g(t,function(t){return g(i,function(i){return n(t,i,r,u)})})},l(t)?t:new y(t)))},t}(o.DisposableBase);n.PromiseCollection=p,function(n){var t;(function(n){function i(){return t||(t=new o.ObjectPool(40,r,function(n){n.onFulfilled=f;n.onRejected=f;n.promise=f}))}function r(){return{onFulfilled:f,onRejected:f,promise:f}}function u(n,t,r){var u=i().take();return u.onFulfilled=n,u.onRejected=t,u.promise=r,u}function e(n){i().add(n)}var t;n.init=u;n.recycle=e})(t=n.PromiseCallbacks||(n.PromiseCallbacks={}))}(a||(a={})),function(n){function s(t){return new n(t)}function a(n){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];if(!n&&!r.length)throw new t.ArgumentNullException("promises");return new p((n instanceof Array?n:[n]).concat(r))}function v(n){for(var f=[],i,r=1;r<arguments.length;r++)f[r-1]=arguments[r];if(!n&&!f.length)throw new t.ArgumentNullException("promises");return(i=(n instanceof Array?n:[n]).concat(f),!i.length||i.every(function(n){return!n}))?new c(function(n){return n(i)},!0):new c(function(n,t){var o=[],s=i.length,f;o.length=s;var r=new e.Set(i.map(function(n,t){return t})),h=function(){t=u;n=u;i.length=0;i=u;r.dispose();r=u},c=function(){var t=n;t&&!r.count&&(h(),t(o))},l=function(t,i){n&&(o[i]=t,r.remove(i),c())},a=function(n){var i=t;i&&(h(),i(n))},v=function(n){var t=i[n];t?t.then(function(t){return l(t,n)},a):r.remove(n);c()};for(f=0;r&&f<s;f++)v(f)})}function w(n){for(var u=[],i,r=1;r<arguments.length;r++)u[r-1]=arguments[r];if(!n&&!u.length)throw new t.ArgumentNullException("promises");return(i=(n instanceof Array?n:[n]).concat(u),!i.length||i.every(function(n){return!n}))?new c(function(n){return n(i)},!0):new c(function(n,t){for(var s=i.length,r=new e.Set(i.map(function(n,t){return t})),h=function(){t=f;n=f;r.dispose();r=f},c=function(){var t=n;t&&!r.count&&(h(),t(i))},o=function(n){r&&(r.remove(n),c())},l=function(n){var t=i[n];t?t.then(function(){return o(n)},function(){return o(n)}):o(n)},u=0;r&&u<s;u++)l(u)})}function b(r){for(var l=[],u,c,o,s,e=1;e<arguments.length;e++)l[e-1]=arguments[e];if(u=r&&(r instanceof Array?r:[r]).concat(l),!u||!u.length||!(u=u.filter(function(n){return n!=null})).length)throw new t.ArgumentException("Nothing to wait for.");if(c=u.length,c==1)return i(u[0]);for(o=0;o<c;o++)if(s=u[o],s instanceof h&&s.isSettled)return s;return new n(function(n,t){for(var s=function(){t=f;n=f;u.length=0;u=f},e=function(n,t){n&&(s(),n(t))},h=function(t){return e(n,t)},c=function(n){return e(t,n)},o,i=0,r=u;i<r.length;i++){if(o=r[i],!n)break;o.then(h,c)}})}function o(n){return l(n)?i(n):new y(n)}function g(t,i){return i===void 0&&(i=!1),new n(t,i)}function tt(n){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];if(!n&&!r.length)throw new t.ArgumentNullException("resolutions");return new p((n instanceof Array?n:[n]).concat(r).map(function(n){return o(n)}))}function rt(t,i){return new p(t.map(function(t){return new n(function(n,r){try{n(i(t))}catch(u){r(u)}})}))}function ut(n){return new k(n)}function i(n){if(!n)throw new t.ArgumentNullException(d);return l(n)?n instanceof h?n:new nt(n):new y(n)}function ft(n){if(!n)throw new t.ArgumentNullException(it);return new nt({then:n})}var r;(function(n){n[n.Pending=0]="Pending";n[n.Fulfilled=1]="Fulfilled";n[n.Rejected=-1]="Rejected"})(r=n.State||(n.State={}));Object.freeze(r);n.factory=s;n.group=a;n.all=v;n.waitAll=w;n.race=b;n.resolve=o;n.using=g;n.resolveAll=tt;n.map=rt;n.reject=ut;n.wrap=i;n.createFrom=ft}(r=n.Promise||(n.Promise={}));st=function(n){function i(i){var r=n.call(this)||this;if(r._resolver=i,!i)throw new t.ArgumentNullException("resolver");return r._resolvedCalled=!0,r}return __extends(i,n),i.prototype._onDispose=function(){n.prototype._onDispose.call(this);this._resolver=u},i.prototype._onThen=function(){var n=this._resolver;n&&(this._resolver=u,this._resolvedCalled=!1,this.resolveUsing(n))},i.prototype.thenSynchronous=function(t,i){return this._onThen(),n.prototype.thenSynchronous.call(this,t,i)},i.prototype.thenThis=function(t,i){return this._onThen(),n.prototype.thenThis.call(this,t,i)},i.prototype.delayFromNow=function(t){var o=this,r,f,e;return(t===void 0&&(t=0),this.throwIfDisposed(),!this._resolver||this.isSettled)?n.prototype.delayFromNow.call(this,t):(f=!1,e=s.defer(function(){f=!0;r&&r()},t),new i(function(n,t){r=function(){o.thenThis(function(t){return n(t)},function(n){return t(n)});e.dispose();e=u;r=u};f&&r()}))},i.prototype.delayAfterResolve=function(t){var h=this,f,e,r,o;return(t===void 0&&(t=0),this.throwIfDisposed(),!this._resolver||this.isSettled)?n.prototype.delayAfterResolve.call(this,t):(r=function(){e&&(e.dispose(),e=u);f&&f();r=u},o=function(){r&&(e=s.defer(r,t))},n.prototype.thenThis.call(this,o,o),o=null,new i(function(n,i){h.isPending?(h.thenThis(function(i){return s.defer(function(){return n(i)},t)},function(n){return s.defer(function(){return i(n)},t)}),r()):(f=function(){h.thenThis(function(t){return n(t)},function(n){return i(n)})},r||f())}))},i}(r);n.LazyPromise=st}(c=n.Promises||(n.Promises={})),function(n){var u,r;(function(r){function p(n,t){var i,u,r;for(t||(t={}),i=0,u=Object.keys(n);i<u.length;i++)r=u[i],t[r]===h&&(t[r]=n[r]);return t}function nt(n,t,i,r){t&&(n.onmessage=t);i&&(n.onerror=i);r!==h&&n.postMessage(r)}var e=!1,f,a,u,w,v,b,k;self.onmessage=function(code){try{eval(code.data)}catch(e){}},function(n){n[n.Created=0]="Created";n[n.WaitingToRun=1]="WaitingToRun";n[n.Running=2]="Running";n[n.RanToCompletion=3]="RanToCompletion";n[n.Cancelled=4]="Cancelled";n[n.Faulted=5]="Faulted"}(f=r.TaskStatus||(r.TaskStatus={}));var s=16,h=void 0,l=typeof self!==i.UNDEFINED?self.URL?self.URL:self.webkitURL:null,d=!!(e||self.Worker),g={evalPath:h,maxConcurrency:navigator.hardwareConcurrency||4,allowSynchronous:!0,env:{},envNamespace:"env"};a=function(n){function t(t,i){return n.call(this,function(n,r){nt(t,function(t){n(t.data)},function(n){r(n)},i)},!0)||this}return __extends(t,n),t}(c.Promise),function(t){function i(n){var t=r[n];return t||(r[n]=t=new o.ObjectPool(8),t.autoClearTimeout=3e3),t}function u(t){if(t){t.onerror=null;t.onmessage=null;var r=t.__key;r?i(r).add(t):n.deferImmediate(function(){return t.terminate()})}return null}function f(n){return i(n).tryTake()}function e(t,i){var r=new n.Worker(i);return r.__key=t,r.dispose||(r.dispose=function(){r.onmessage=null;r.onerror=null;r.dispose=null;r.terminate()}),r}var r={};t.recycle=u;t.tryGet=f;t.getNew=e}(u||(u={}));w=function(){function t(n){this.options=p(g,n);this._requiredScripts=[];this._requiredFunctions=[];this.ensureClampedMaxConcurrency()}return t.maxConcurrency=function(n){return new t({maxConcurrency:n})},t.prototype._getWorkerSource=function(n,t){var o=this._requiredScripts,l=this._requiredFunctions,r="",i,u,f;for(!e&&o.length&&(r+='importScripts("'+o.join('","')+'");\r\n'),i=0,u=l;i<u.length;i++){var s=u[i],h=s.name,a=s.fn,c=a.toString();r+=h?"var "+h+" = "+c+";":c}return t=JSON.stringify(t||{}),f=this.options.envNamespace,r+(e?'process.on("message", function(e) {global.'+f+" = "+t+";process.send(JSON.stringify(("+n.toString()+")(JSON.parse(e).data)))})":"self.onmessage = function(e) {var global = {}; global."+f+" = "+t+";self.postMessage(("+n.toString()+")(e.data))}")},t.prototype.require=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this.requireThese(t)},t.prototype.requireThese=function(n){for(var t,r=0,u=n;r<u.length;r++){t=u[r];switch(typeof t){case i.STRING:this._requiredScripts.push(t);break;case i.FUNCTION:this._requiredFunctions.push({fn:t});break;case i.OBJECT:this._requiredFunctions.push(t);break;default:throw new TypeError("Invalid type.");}}return this},t.prototype._spawnWorker=function(t,i){var f=this._getWorkerSource(t,i),r,o,s,c,a;if(n.Worker===h)return h;if(r=u.tryGet(f),r)return r;if(o=this._requiredScripts,s=this.options.evalPath,!s){if(e)throw new Error("Can't use NodeJS without eval.js!");if(o.length)throw new Error("Can't use required scripts without eval.js!");if(!l)throw new Error("Can't create a blob URL in this browser!");}return e||o.length||!l?(r=u.getNew(f,s),r.postMessage(f)):l&&(c=new Blob([f],{type:"text/javascript"}),a=l.createObjectURL(c),r=u.getNew(f,a)),r},t.prototype.startNew=function(n,t,i){var r=this,e=this.ensureClampedMaxConcurrency(),f=e?r._spawnWorker(t,p(r.options.env,i||{})):null;if(f)return new a(f,n).finallyThis(function(){return u.recycle(f)});if(r.options.allowSynchronous)return this.startLocal(n,t);throw new Error(e?"Workers do not exist and synchronous operation not allowed!":"'maxConcurrency' set to 0 but 'allowSynchronous' is false.");},t.prototype.startLocal=function(n,t){return new c.Promise(function(i,r){try{i(t(n))}catch(u){r(u)}})},t.prototype.pipe=function(n,t,i){var r,s,h;if(n&&n.length){var l=n.length,y=t.toString(),e=this.ensureClampedMaxConcurrency(),f,o=0,p=function(){var s=e?v._spawnWorker(y,i):null,h;if(!s){if(!v.options.allowSynchronous)throw new Error(e?"Workers do not exist and synchronous operation not allowed!":"'maxConcurrency' set to 0 but 'allowSynchronous' is false.");return{value:c.Promise.map(n,t)}}r||(r=n.map(function(){return new c.Promise}));h=function(){if(f&&(s=u.recycle(s)),s)if(o<l){var t=o++,i=r[t],e=new a(s,n[t]);e.thenSynchronous(function(n){i.resolve(n);h()},function(n){f||(f=n,i.reject(n),s=u.recycle(s))}).finallyThis(function(){return e.dispose()})}else s=u.recycle(s)};h()},v=this;for(s=0;!f&&o<Math.min(l,e);s++)if(h=p(s),typeof h=="object")return h.value}return new c.PromiseCollection(r)},t.prototype.ensureClampedMaxConcurrency=function(){var n=this.options.maxConcurrency;return n&&n>s&&(this.options.maxConcurrency=n=s,console.warn("More than "+s+" workers can reach worker limits and cause unexpected results.  maxConcurrency reduced to "+s+".")),n||n===0?n:s},t.prototype.map=function(n,t,i){var r=this;return!n||!n.length?c.ArrayPromise.fulfilled(n&&[]):(n=n.slice(),new c.ArrayPromise(function(f,e){var h=[],o=n.length,y,p;h.length=o;var w=t.toString(),b=r.ensureClampedMaxConcurrency(),s,l=0,v=0,k=function(){var y=r._spawnWorker(w,i),p;if(!y){if(!r.options.allowSynchronous)throw new Error("Workers do not exist and synchronous operation not allowed!");return f(c.Promise.map(n,t).all()),{value:void 0}}p=function(){if(s&&(y=u.recycle(y)),y)if(l<o){var t=l++,i=new a(y,n[t]);i.thenSynchronous(function(n){h[t]=n;p()},function(n){s||(s=n,e(n),y=u.recycle(y))}).thenThis(function(){if(v++,v>o)throw Error("Resolved count exceeds data length.");v===o&&f(h)}).finallyThis(function(){return i.dispose()})}else y=u.recycle(y)};p()};for(y=0;!s&&l<Math.min(o,b);y++)if(p=k(y),typeof p=="object")return p.value}))},Object.defineProperty(t,"isSupported",{get:function(){return d},enumerable:!0,configurable:!0}),t.options=function(n){return new t(n)},t.require=function(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];return(new t).requireThese(i)},t.requireThese=function(n){return(new t).requireThese(n)},t.startNew=function(n,i,r){return(new t).startNew(n,i,r)},t.map=function(n,i,r){return(new t).map(n,i,r)},t}();r.Parallel=w;v=function(n){function t(){var t=n.call(this)||this;return t._disposableObjectName="TaskHandlerBase",t._timeoutId=null,t._status=f.Created,t}return __extends(t,n),Object.defineProperty(t.prototype,"isScheduled",{get:function(){return!!this._timeoutId},enumerable:!0,configurable:!0}),t.prototype.start=function(n){n===void 0&&(n=0);this.throwIfDisposed();this.cancel();this._status=f.WaitingToRun;n>0||(n=0);isFinite(n)&&(this._timeoutId=setTimeout(t._handler,n,this))},t.prototype.runSynchronously=function(){this.throwIfDisposed();t._handler(this)},t.prototype.getStatus=function(){return this._status},Object.defineProperty(t.prototype,"status",{get:function(){return this.getStatus()},enumerable:!0,configurable:!0}),t._handler=function(n){n.cancel();n._status=f.Running;try{n._onExecute();n._status=f.RanToCompletion}catch(t){n._status=f.Faulted}},t.prototype._onDispose=function(){this.cancel();this._status=null},t.prototype.cancel=function(){var n=this._timeoutId;return n?(clearTimeout(n),this._timeoutId=null,this._status=f.Cancelled,!0):!1},t}(o.DisposableBase);r.TaskHandlerBase=v;b=function(n){function i(i){var r=n.call(this)||this;if(r._action=i,!i)throw new t.ArgumentNullException("action");return r}return __extends(i,n),i.prototype._onExecute=function(){this._action()},i.prototype._onDispose=function(){n.prototype._onDispose.call(this);this._action=null},i}(v);r.TaskHandler=b;k=function(n){function i(i){var r=n.call(this)||this;if(!i)throw new t.ArgumentNullException("valueFactory");return r._result=new y(i,!1),r}return __extends(i,n),i.prototype._onExecute=function(){this._result.getValue()},i.prototype.getResult=function(){return this._result.value},i.prototype.getState=function(){var n=this._result;return n&&{status:this.getStatus(),result:n.isValueCreated?n.value:void 0,error:n.error}},i.prototype.start=function(t){this.getStatus()==f.Created&&n.prototype.start.call(this,t)},i.prototype.runSynchronously=function(){this.getStatus()==f.Created&&n.prototype.runSynchronously.call(this)},Object.defineProperty(i.prototype,"state",{get:function(){return this.getState()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"result",{get:function(){return this.throwIfDisposed(),this.runSynchronously(),this.getResult()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"error",{get:function(){return this.throwIfDisposed(),this._result.error},enumerable:!0,configurable:!0}),i.prototype._onDispose=function(){n.prototype._onDispose.call(this);var t=this._result;t&&(this._result=null,t.dispose())},i}(v);r.Task=k})(u=n.Tasks||(n.Tasks={}));r=function(){function n(){}return n.sleep=function(n){if(!(n<=0))for(var t=(new Date).getTime(),i=t+n;(new Date).getTime()<i;);},n}();n.Thread=r}(s=n.Threading||(n.Threading={})),function(e){function y(n,i){if(!n)return null;if(!i)throw new t.ArgumentNullException("list");var r=n.external;return r||(n.external=r=new lt(i,n)),r||null}function g(n,i){if(!n)throw new t.ArgumentNullException("node");if(!i)throw new t.ArgumentNullException("list");if(n.list!=i)throw new t.InvalidOperationException("Provided node does not belong to this list.");var r=n._nodeInternal;if(!r)throw new t.InvalidOperationException("Provided node is not valid.");return r}function st(n){if(n){var t=n.external;t&&(t._list=r,t._nodeInternal=r);n.external=r}}function nt(n,i){if(i===void 0&&(i="node"),n==null)throw new t.ArgumentNullException(i);if(n.next||n.previous)throw new t.InvalidOperationException("Cannot add a node to a LinkedNodeList that is already linked.");}function yt(n,t){var i,r,u,f;if(t===void 0&&(t=1),n&&t)for(i=0,r=Object.keys(n);i<r.length;i++)u=r[i],f=n[u],delete n[u],yt(f,t-1)}var kt="CollectionBase",dt="Cannot modify a disposed collection.",gt="Cannot modify a read-only collection.",ft=!1,ni=!1,ti=!1,ii="../../System.Linq/Linq",k="",ri="Cannot call forEach on an endless enumerable. Would result in an infinite loop that could hang the current process.",c,l,b,et,d,ot,w,ct,lt,p,at,s,vt,ui,tt,rt,pt,ut,wt,a,bt,fi;(function(n){function s(n){if(n)throw new e(ri);return!0}function rt(n,t){var r,u;return(t===void 0&&(t=Infinity),i.isArrayLike(n)&&(r=Math.min(n.length,t),isFinite(r)))?r>65535?new Array(r):(u=[],u.length=r,u):[]}function st(t){if(!t)return n.EmptyEnumerator;if(t instanceof Array)return new d(t);if(i.isArrayLike(t))return new y(function(){return{source:t,length:t.length,pointer:0,step:1}});if(!i.isPrimitive(t)){if(l(t))return t.getEnumerator();if(i.isFunction(t))return new g(t);if(p(t))return t;if(w(t))return new nt(t)}throw new e;}function l(n){return i.hasMemberOfType(n,"getEnumerator",i.FUNCTION)}function ht(n){return i.isArrayLike(n)||l(n)}function p(n){return i.hasMemberOfType(n,"moveNext",i.FUNCTION)}function w(n){return i.hasMemberOfType(n,"next",i.FUNCTION)}function a(n,t,r){var u,f;if(r===void 0&&(r=Infinity),n===k)return 0;if(n&&r>0){if(i.isArrayLike(n)){for(s(!isFinite(r)&&!isFinite(n.length)),u=0;u<Math.min(n.length,r);u++)if(t(n[u],u)===!1)break;return u}if(p(n)){for(s(!isFinite(r)&&n.isEndless),u=0;r>u&&n.moveNext();)if(t(n.current,u++)===!1)break;return u}if(l(n))return s(!isFinite(r)&&n.isEndless),o.using(n.getEnumerator(),function(n){return a(n,t,r)});if(w(n)){for(s(!isFinite(r)),u=0,f=void 0;r>u&&!(f=n.next()).done;)if(t(f.value,u++)===!1)break;return u}}return-1}function ut(n,t){if(t===void 0&&(t=Infinity),n===k)return[];if(!isFinite(t)&&n instanceof Array)return n.slice();var i=rt(n,t);if(-1===a(n,function(n,t){i[t]=n},t))throw new e;return i}function ct(n,t,i){if(i===void 0&&(i=Infinity),n===k)return[];if(!isFinite(i)&&n instanceof Array)return n.map(t);var r=rt(n,i);if(-1===a(n,function(n,i){r[i]=t(n,i)},i))throw new e;return r}function b(n){if(v||(v=new o.ObjectPool(40,function(){return new lt},function(n){return n.yieldBreak()})),!n)return v.take();v.add(n)}var u=void 0,r=function(){function n(n,t,i){i===void 0&&(i=!1);this.value=n;typeof t=="boolean"?this.done=t:(this.index=t,this.done=i);Object.freeze(this)}return n}(),tt,v,c,y,d,g,nt,ot,f,e;n.IteratorResult=r,function(n){function t(){return n.Done}n.Done=new n(u,u,!0);n.GetDone=t}(r=n.IteratorResult||(n.IteratorResult={}));Object.freeze(r);tt=function(){function t(){this.isEndless=!1}return t.prototype.getEnumerator=function(){return n.EmptyEnumerator},t}();n.EmptyEnumerable=tt;n.EmptyEnumerator=Object.freeze({current:void 0,moveNext:h.False,tryMoveNext:h.False,nextValue:h.Blank,next:r.GetDone,"return":r.GetDone,end:h.Blank,reset:h.Blank,dispose:h.Blank,isEndless:!1});n.throwIfEndless=s;n.from=st;n.isEnumerable=l;n.isEnumerableOrArrayLike=ht;n.isEnumerator=p;n.isIterator=w;n.forEach=a;n.toArray=ut;n.map=ct;var lt=function(){function n(){this._current=u;this._index=NaN}return Object.defineProperty(n.prototype,"current",{get:function(){return this._current},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this._index},enumerable:!0,configurable:!0}),n.prototype.yieldReturn=function(n){return this._current=n,isNaN(this._index)?this._index=0:this._index++,!0},n.prototype.yieldBreak=function(){return this._current=u,this._index=NaN,!1},n.prototype.dispose=function(){this.yieldBreak()},n}(),ft="EnumeratorBase",et=function(n){function t(t,r,u,f){var e=n.call(this)||this;return e._initializer=t,e._tryGetNext=r,e._disposableObjectName=ft,e.reset(),i.isBoolean(f)?e._isEndless=f:i.isBoolean(u)&&(e._isEndless=u),i.isFunction(u)&&(e._disposer=u),e}return __extends(t,n),Object.defineProperty(t.prototype,"current",{get:function(){var n=this._yielder;return n&&n.current},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"index",{get:function(){var n=this._yielder;return n?n.index:NaN},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isEndless",{get:function(){return this._isEndless},enumerable:!0,configurable:!0}),t.prototype.reset=function(){var n=this,t;n.throwIfDisposed();t=n._yielder;n._yielder=null;n._state=0;t&&b(t)},t.prototype._assertBadState=function(){var n=this;switch(n._state){case 3:n.throwIfDisposed("This enumerator caused a fault and was disposed.");break;case 5:n.throwIfDisposed("This enumerator was manually disposed.")}},t.prototype.tryGetCurrent=function(n){return(this._assertBadState(),this._state===1)?(n(this.current),!0):!1},Object.defineProperty(t.prototype,"canMoveNext",{get:function(){return this._state<2},enumerable:!0,configurable:!0}),t.prototype.moveNext=function(){var n=this,t;n._assertBadState();try{switch(n._state){case 0:n._yielder=n._yielder||b();n._state=1;t=n._initializer;t&&t();case 1:return n._tryGetNext(n._yielder)?!0:(this.dispose(),n._state=2,!1);default:return!1}}catch(i){this.dispose();n._state=3;throw i;}},t.prototype.tryMoveNext=function(n){return this.moveNext()?(n(this.current),!0):!1},t.prototype.nextValue=function(){return this.moveNext()?this.current:u},t.prototype.next=function(){return this.moveNext()?new r(this.current,this.index):r.Done},t.prototype.end=function(){this._ensureDisposeState(4)},t.prototype["return"]=function(n){var t=this;t._assertBadState();try{return n===u||t._state===2||t._state===4?r.Done:new r(n,u,!0)}finally{t.end()}},t.prototype._ensureDisposeState=function(n){var t=this;t.wasDisposed||(t.dispose(),t._state=n)},t.prototype._onDispose=function(){var n=this,t,i;n._isEndless=!1;t=n._disposer;n._initializer=null;n._disposer=null;i=n._yielder;n._yielder=null;this._state=5;i&&b(i);t&&t()},t}(o.DisposableBase);n.EnumeratorBase=et;c=function(){function n(){this.reset()}return Object.defineProperty(n.prototype,"current",{get:function(){return this._current},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"canMoveNext",{get:function(){return this._canMoveNext()},enumerable:!0,configurable:!0}),n.prototype.tryMoveNext=function(n){return this.moveNext()?(n(this._current),!0):!1},n.prototype.incrementIndex=function(){var n=this._index;return this._index=n=isNaN(n)?0:n+1,n},n.prototype.nextValue=function(){return this.moveNext(),this._current},n.prototype.next=function(){return this.moveNext()?new r(this._current,this._index):r.Done},n.prototype.end=function(){this.dispose()},n.prototype["return"]=function(n){try{return n!==u&&this._canMoveNext()?new r(n,u,!0):r.Done}finally{this.dispose()}},n.prototype.reset=function(){this._current=u;this._index=NaN},n.prototype.dispose=function(){this.reset()},n.prototype.getIsEndless=function(){return this._canMoveNext()},Object.defineProperty(n.prototype,"isEndless",{get:function(){return this.getIsEndless()},enumerable:!0,configurable:!0}),n}();n.SimpleEnumerableBase=c;y=function(n){function t(t){var r=this,i;return r=n.call(this,function(){var u,n,r;if(i=t(),i&&i.source){if(u=i.length,u<0)throw new f("length must be zero or greater");if(!isFinite(u))throw new f("length must finite number");if(u&&i.step===0)throw new f("Invalid IndexEnumerator step value (0).");if(n=i.pointer,n){if(n!=Math.floor(n))throw new f("Invalid IndexEnumerator pointer value ("+n+") has decimal.");}else n=0;if(i.pointer=n,r=i.step,r){if(r!=Math.floor(r))throw new f("Invalid IndexEnumerator step value ("+r+") has decimal.");}else r=1;i.step=r}},function(n){var r=i&&i.source?i.length:0,t;return!r||isNaN(r)?n.yieldBreak():(t=i.pointer,i.pointer==null&&(i.pointer=0),i.step||(i.step=1),i.pointer=i.pointer+i.step,t<r&&t>=0?n.yieldReturn(i.source[t]):n.yieldBreak())},function(){i&&(i.source=null)})||this,r._isEndless=!1,r}return __extends(t,n),t}(et);n.IndexEnumerator=y;d=function(n){function t(t,r,u){return r===void 0&&(r=0),u===void 0&&(u=1),n.call(this,function(){var n=i.isFunction(t)?t():t;return{source:n,pointer:r,length:n?n.length:0,step:u}})||this}return __extends(t,n),t}(y);n.ArrayEnumerator=d;g=function(n){function t(t){var i=n.call(this)||this;return i._factory=t,i}return __extends(t,n),t.prototype._canMoveNext=function(){return this._factory!=null},t.prototype.moveNext=function(){var n=this,t=n._factory;return t?(n._current=t(n._current,n.incrementIndex()),!0):!1},t.prototype.dispose=function(){n.prototype.dispose.call(this);this._factory=null},t}(c);n.InfiniteEnumerator=g;nt=function(n){function t(t,i){var r=n.call(this)||this;return r._iterator=t,r._isEndless=i,r}return __extends(t,n),t.prototype._canMoveNext=function(){return this._iterator!=null},t.prototype.moveNext=function(n){var t=this,i=t._iterator,r;if(i)if(r=arguments.length?i.next(n):i.next(),t._current=r.value,r.done)t.dispose();else return!0;return!1},t.prototype.dispose=function(){n.prototype.dispose.call(this);this._iterator=null},t.prototype.getIsEndless=function(){return Boolean(this._isEndless)&&n.prototype.getIsEndless.call(this)},t}(c);n.IteratorEnumerator=nt;ot=function(n){function t(t,i){i===void 0&&(i=!1);var r=n.call(this)||this;return r._allowReset=i,r._buffer=ut(t),r._pointer=r._buffer.length,r}return __extends(t,n),t.prototype._canMoveNext=function(){var n=this._pointer;return!isNaN(n)&&n>0},t.prototype.moveNext=function(){var i=this;if(i._canMoveNext()){var r=this._pointer,u=Math.floor(Math.random()*r),n=this._buffer,f=n[u],t=r-1;return n[u]=n[t],n[t]=null,this._allowReset||t%32!=0||(n.length=t),this._pointer=t,i._current=f,i.incrementIndex(),!0}return!1},t.prototype.reset=function(){if(this._allowReset){if(!this._buffer)throw"Randomizer cannot be reset.  Already disposed.";this._pointer=this._buffer.length;n.prototype.reset.call(this)}else throw"Reset not allowed.  To allow for reset, specify so when constructing.";},t.prototype.dispose=function(){n.prototype.reset.call(this);var t=this._buffer;this._buffer=null;this._pointer=NaN;t&&(t.length=0)},t.prototype.getIsEndless=function(){return!1},t}(c);n.Randomizer=ot;f=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t}(it);n.Error=f;e=function(n){function t(t){return n.call(this,t||"Unsupported enumerable.")||this}return __extends(t,n),t.prototype.getName=function(){return ft},t}(t.SystemException);n.UnsupportedEnumerableException=e})(c=e.Enumeration||(e.Enumeration={}));l=function(i){function r(n,t){var f,r;return t===void 0&&(t=u.areEqual),f=i.call(this)||this,f._equalityComparer=t,r=f,r._disposableObjectName=kt,r._importEntries(n),r._updateRecursion=0,r._modifiedCount=0,r._version=0,f}return __extends(r,i),Object.defineProperty(r.prototype,"count",{get:function(){return this.getCount()},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"length",{get:function(){return this.getCount()},enumerable:!0,configurable:!0}),r.prototype.getIsReadOnly=function(){return!1},Object.defineProperty(r.prototype,"isReadOnly",{get:function(){return this.getIsReadOnly()},enumerable:!0,configurable:!0}),r.prototype.assertModifiable=function(){if(this.throwIfDisposed(dt),this.getIsReadOnly())throw new t.InvalidOperationException(gt);return!0},r.prototype.assertVersion=function(n){if(n!==this._version)throw new t.InvalidOperationException("Collection was modified.");return!0},r.prototype._onModified=function(){},r.prototype._signalModification=function(n){var t=this;if(n&&t._modifiedCount++,t._modifiedCount&&!this._updateRecursion){t._modifiedCount=0;t._version++;try{t._onModified()}catch(i){console.error(i)}return!0}return!1},r.prototype._incrementModified=function(){this._modifiedCount++},Object.defineProperty(r.prototype,"isUpdating",{get:function(){return this._updateRecursion!=0},enumerable:!0,configurable:!0}),r.prototype.handleUpdate=function(n){var t,i;if(!n)return!1;t=this;t.assertModifiable();t._updateRecursion++;i=!1;try{(i=n())&&t._modifiedCount++}finally{t._updateRecursion--}return t._signalModification(),i},r.prototype.add=function(n){var t=this;t.assertModifiable();t._updateRecursion++;try{t._addInternal(n)&&t._modifiedCount++}finally{t._updateRecursion--}t._signalModification()},r.prototype.push=function(n){this.add(n)},r.prototype.remove=function(n,t){var i,r;t===void 0&&(t=Infinity);i=this;i.assertModifiable();i._updateRecursion++;r=NaN;try{(r=i._removeInternal(n,t))&&i._modifiedCount++}finally{i._updateRecursion--}return i._signalModification(),r},r.prototype.clear=function(){var n=this,t;n.assertModifiable();n._updateRecursion++;t=NaN;try{(t=n._clearInternal())&&n._modifiedCount++}finally{n._updateRecursion--}return n._signalModification(),t},r.prototype._onDispose=function(){i.prototype._onDispose.call(this);this._clearInternal();this._version=0;this._updateRecursion=0;this._modifiedCount=0;var n=this._linq;this._linq=void 0;n&&n.dispose()},r.prototype._importEntries=function(n){var f=this,i=0,t,r,u;if(n)if(n instanceof window.ARRAY_BUFFER)for(t=0,r=n;t<r.length;t++)u=r[t],this._addInternal(u)&&i++;else c.forEach(n,function(n){f._addInternal(n)&&i++});return i},r.prototype.importEntries=function(n){var t=this,i;if(!n)return 0;t.assertModifiable();t._updateRecursion++;i=NaN;try{(i=t._importEntries(n))&&t._modifiedCount++}finally{t._updateRecursion--}return t._signalModification(),i},r.prototype.filter=function(n){if(!n)throw new t.ArgumentNullException("predicate");var r=!this.getCount(),i=[];return r&&this.forEach(function(t,r){n(t,r)&&i.push(t)}),i},r.prototype.any=function(n){var i=this.getCount(),t;return i?n?(t=!1,this.forEach(function(i,r){return!(t=n(i,r))}),t):Boolean(i):!1},r.prototype.some=function(n){return this.any(n)},r.prototype.contains=function(n){var t=this._equalityComparer;return this.any(function(i){return t(n,i)})},r.prototype.forEach=function(n,t){if(this.wasDisposed)return 0;if(t){var i=this.toArray();try{return c.forEach(i,n)}finally{i.length=0}}else return c.forEach(this.getEnumerator(),n)},r.prototype.copyTo=function(n,i){var r,u,f;if(i===void 0&&(i=0),!n)throw new t.ArgumentNullException("target");if(r=this.getCount(),r)for(u=r+i,n.length<u&&(n.length=u),f=this.getEnumerator();f.moveNext();)n[i++]=f.current;return n},r.prototype.toArray=function(){var n=this.getCount();return n?this.copyTo(n>65536?new Array(n):[]):[]},Object.defineProperty(r.prototype,"linq",{get:function(){var e,r;if(this.throwIfDisposed(),e=this._linq,!e){r=void 0;try{r=eval("require")}catch(ex){}if(this._linq=e=n.Linq.Enumerable.from(this),!e)throw ft?"using .linq to load and initialize a ILinqEnumerable is currently only supported within a NodeJS environment. Import System.Linq/Linq and use Enumerable.from(e) instead. You can also preload the Linq module as a dependency or use .linqAsync(callback) for AMD/RequireJS.":"There was a problem importing System.Linq/Linq";}return e},enumerable:!0,configurable:!0}),r.prototype.linqAsync=function(callback){var _this=this,e;if(this.throwIfDisposed(),e=this._linq,!e)if(ft)eval("require")([ii],function(n){if(e=_this._linq,e||(_this._linq=e=n.default.from(_this)),!e)throw"There was a problem importing System.Linq/Linq";callback&&callback(e);callback=void 0});else if(ni&&ti)e=this.linq;else throw"Cannot find a compatible loader for importing System.Linq/Linq";return e&&callback&&callback(e),e},r}(o.DisposableBase);e.CollectionBase=l;b=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.prototype.getCount=function(){return this._getCount()},t.prototype.getIsReadOnly=function(){return!0},t.prototype._addInternal=function(){return!1},t.prototype._removeInternal=function(){return 0},t.prototype._clearInternal=function(){return 0},t.prototype.getEnumerator=function(){return this._getEnumerator()},t}(l);e.ReadOnlyCollectionBase=b;et=c.from;d=function(n){function r(r){var f=n.call(this)||this,u;if(!r)throw new t.ArgumentNullException("collection");return u=f,i.isArrayLike(r)?(u._getCount=function(){return r.length},u._getEnumerator=function(){return et(r)}):(u._getCount=function(){return r.count},u._getEnumerator=function(){return r.getEnumerator()}),f}return __extends(r,n),r.prototype._getCount=function(){return this.throwIfDisposed(),this.__getCount()},r.prototype._getEnumerator=function(){return this.throwIfDisposed(),this.__getEnumerator()},r.prototype._onDispose=function(){n.prototype._onDispose.call(this);this.__getCount=null;this.__getEnumerator=null},r}(b);e.ReadOnlyCollectionWrapper=d;ot=function(n){function i(t){var i=n.call(this)||this;return i._enumerator=t.getEnumerator(),i._cached=[],i}return __extends(i,n),i.prototype._onDispose=function(){var t,i;n.prototype._onDispose.call(this);t=this._enumerator;this._enumerator=null;t&&t.dispose();i=this._cached;this._cached=null;i&&(i.length=0)},i.prototype._getCount=function(){this.finish();var n=this._cached;return n?n.length:0},i.prototype._getEnumerator=function(){var n=this,t;return new c.EnumeratorBase(function(){t=0},function(i){n.throwIfDisposed();var r=n._cached;return t<r.length||n.getNext()?i.yieldReturn(r[t++]):i.yieldBreak()})},i.prototype.get=function(n){this.throwIfDisposed();f.assertZeroOrGreater(n);for(var i=this._cached;i.length<=n&&this.getNext(););if(n<i.length)return i[n];throw new t.ArgumentOutOfRangeException("index","Greater than total count.");},i.prototype.indexOf=function(n){this.throwIfDisposed();for(var i=this._cached,t=i.indexOf(n);t==-1&&this.getNext(function(r){r==n&&(t=i.length-1)}););return t},i.prototype.contains=function(n){return this.indexOf(n)!=-1},i.prototype.getNext=function(n){var t=this._enumerator,i;return t?t.moveNext()?(i=t.current,this._cached.push(i),n&&n(i),!0):(t.dispose(),this._enumerator=null,!1):!1},i.prototype.finish=function(){while(this.getNext());},i}(b);e.LazyList=ot;w=function(){function n(n,t,i){this.value=n;this.previous=t;this.next=i}return n.prototype.assertDetached=function(){if(this.next||this.previous)throw new t.InvalidOperationException("Adding a node that is already placed.");return!0},n}();ct=function(n){function t(t,i){i===void 0&&(i=u.areEqual);var f=n.call(this,r,i)||this;return f._listInternal=new p,f._importEntries(t),f}return __extends(t,n),t.prototype.assertVersion=function(t){return this._listInternal?this._listInternal.assertVersion(t):n.prototype.assertVersion.call(this,t)},t.prototype._onDispose=function(){n.prototype._onDispose.call(this);var t=this._listInternal;this._listInternal=null;t.dispose()},t.prototype.getCount=function(){var n=this._listInternal;return n?n.unsafeCount:0},t.prototype._addInternal=function(n){return this._listInternal.addNode(new w(n)),!0},t.prototype._removeInternal=function(n,t){t===void 0&&(t=Infinity);var i=this,u=i._equalityComparer,f=i._listInternal,r=0;return f.forEach(function(f){return f&&u(n,f.value)&&i._removeNodeInternal(f)&&r++,r<t},!0),r},t.prototype._clearInternal=function(){var n=this._listInternal;return n.forEach(function(n){return st(n)}),n.clear()},t.prototype.forEach=function(t,i){return i===void 0&&(i=!1),this.throwIfDisposed(),i?n.prototype.forEach.call(this,t,i):this._listInternal.forEach(function(n,i){return t(n.value,i)})},t.prototype.getEnumerator=function(){return this.throwIfDisposed(),p.valueEnumeratorFrom(this._listInternal)},t.prototype._findFirst=function(n){for(var i=this,r=i._equalityComparer,t=i._listInternal&&i._listInternal.first;t;){if(r(n,t.value))return t;t=t.next}return null},t.prototype._findLast=function(n){for(var i=this,r=i._equalityComparer,t=i._listInternal&&i._listInternal.last;t;){if(r(n,t.value))return t;t=t.previous}return null},t.prototype.removeOnce=function(n){return this.remove(n,1)!==0},Object.defineProperty(t.prototype,"first",{get:function(){var n=this._listInternal;return n&&y(n.first,this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstValue",{get:function(){var n=this._listInternal,t=n&&n.first;return t?t.value:r},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"last",{get:function(){var n=this._listInternal;return y(n.last,this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lastValue",{get:function(){var n=this._listInternal,t=n&&n.last;return t?t.value:r},enumerable:!0,configurable:!0}),t.prototype.getValueAt=function(n){var t=this._listInternal,i=t&&t.getNodeAt(n);return i?i.value:r},t.prototype.getNodeAt=function(n){var t=this._listInternal;return t&&y(t.getNodeAt(n),this)},t.prototype.find=function(n){var t=this._listInternal;return t&&y(this._findFirst(n),this)},t.prototype.findLast=function(n){var t=this._listInternal;return t&&y(this._findLast(n),this)},t.prototype.addFirst=function(n){this.assertModifiable();this._listInternal.addNodeBefore(new w(n));this._signalModification(!0)},t.prototype.addLast=function(n){this.add(n)},t.prototype._removeNodeInternal=function(n){var t=this;return n&&t._listInternal.removeNode(n)?(st(n),t._signalModification(!0),!0):!1},t.prototype.removeFirst=function(){var n=this;return n.assertModifiable(),n._removeNodeInternal(n._listInternal.first)},t.prototype.removeLast=function(){var n=this;return n.assertModifiable(),n._removeNodeInternal(n._listInternal.last)},t.prototype.removeAt=function(n){var t=this;return t.assertModifiable(),t._removeNodeInternal(t._listInternal.getNodeAt(n))},t.prototype.removeNode=function(n){var t=this;return t.assertModifiable(),t._removeNodeInternal(g(n,t))},t.prototype.addBefore=function(n,t){var i=this;i.assertModifiable();i._listInternal.addNodeBefore(new w(t),g(n,i));i._signalModification(!0)},t.prototype.addAfter=function(n,t){var i=this;i.assertModifiable();i._listInternal.addNodeAfter(new w(t),g(n,i));i._signalModification(!0)},t}(l);e.LinkedList=ct;lt=function(){function n(n,t){this._list=n;this._nodeInternal=t}return n.prototype.throwIfDetached=function(){if(!this._list)throw new Error("This node has been detached from its list and is no longer valid.");},Object.defineProperty(n.prototype,"list",{get:function(){return this._list},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"previous",{get:function(){return this.throwIfDetached(),y(this._nodeInternal.previous,this._list)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"next",{get:function(){return this.throwIfDetached(),y(this._nodeInternal.next,this._list)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.throwIfDetached(),this._nodeInternal.value},set:function(n){this.throwIfDetached();this._nodeInternal.value=n},enumerable:!0,configurable:!0}),n.prototype.addBefore=function(n){this.throwIfDetached();this._list.addBefore(this,n)},n.prototype.addAfter=function(n){this.throwIfDetached();this._list.addAfter(this,n)},n.prototype.remove=function(){var n=this,t=n._list;t&&t.removeNode(this);n._list=r;n._nodeInternal=r},n.prototype.dispose=function(){this.remove()},n}();p=function(){function n(){this._first=null;this._last=null;this.unsafeCount=0;this._version=0}return n.prototype.assertVersion=function(n){if(n!==this._version)throw new t.InvalidOperationException("Collection was modified.");return!0},Object.defineProperty(n.prototype,"first",{get:function(){return this._first},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return this._last},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"count",{get:function(){for(var n=this._first,t=0;n;)t++,n=n.next;return t},enumerable:!0,configurable:!0}),n.prototype.forEach=function(n,t){var r=this,i=null,u=r.first,e=r._version,f=0;do t||r.assertVersion(e),i=u,u=i&&i.next;while(i&&n(i,f++)!==!1);return f},n.prototype.map=function(n){if(!n)throw new t.ArgumentNullException("selector");var i=[];return this.forEach(function(t,r){i.push(n(t,r))}),i},n.prototype.clear=function(){var t=this,n,r=0,u=0,i;for(n=t._first,t._first=null;n;)r++,i=n,n=n.next,i.next=null;for(n=t._last,t._last=null;n;)u++,i=n,n=n.previous,i.previous=null;return r!==u&&console.warn("LinkedNodeList: Forward versus reverse count does not match when clearing. Forward: "+r+", Reverse: "+u),t._version++,t.unsafeCount=0,r},n.prototype.dispose=function(){this.clear()},n.prototype.contains=function(n){return this.indexOf(n)!=-1},n.prototype.getNodeAt=function(n){if(n<0)return null;for(var t=this._first,i=0;t&&i++<n;)t=t.next||null;return t},n.prototype.find=function(n){var t=null;return this.forEach(function(i,r){if(n(i,r))return t=i,!1}),t},n.prototype.indexOf=function(n){if(n&&(n.previous||n.next)){var i=0,t=void 0,r=this._first;do{if(t=r,t===n)return i;i++}while(r=t&&t.next)}return-1},n.prototype.removeFirst=function(){return!!this._first&&this.removeNode(this._first)},n.prototype.removeLast=function(){return!!this._last&&this.removeNode(this._last)},n.prototype.removeNode=function(n){var o;if(n==null)throw new t.ArgumentNullException("node");var i=this,u=n.previous||null,f=n.next||null,r=!1,e=!1;if(u?u.next=f:i._first==n?i._first=f:r=!0,f?f.previous=u:i._last==n?i._last=u:e=!0,r!==e)throw new t.ArgumentException("node",ht("Provided node is has no {0} reference but is not the {1} node!",r?"previous":"next",r?"first":"last"));return o=!r&&!e,o&&(i._version++,i.unsafeCount--,n.previous=null,n.next=null),o},n.prototype.addNode=function(n){this.addNodeAfter(n)},n.prototype.addNodeBefore=function(n,t){var i,r;t===void 0&&(t=null);nt(n);i=this;t||(t=i._first);t?(r=t.previous,n.previous=r,n.next=t,t.previous=n,r&&(r.next=n),t==i._first&&(i._first=n)):i._first=i._last=n;i._version++;i.unsafeCount++},n.prototype.addNodeAfter=function(n,t){var i,r;t===void 0&&(t=null);nt(n);i=this;t||(t=i._last);t?(r=t.next,n.next=r,n.previous=t,t.next=n,r&&(r.previous=n),t==i._last&&(i._last=n)):i._first=i._last=n;i._version++;i.unsafeCount++},n.prototype.replace=function(n,i){if(n==null)throw new t.ArgumentNullException("node");if(n!=i){nt(i,"replacement");var r=this;i.previous=n.previous;i.next=n.next;n.previous&&(n.previous.next=i);n.next&&(n.next.previous=i);n==r._first&&(r._first=i);n==r._last&&(r._last=i);r._version++}},n.valueEnumeratorFrom=function(n){if(!n)throw new t.ArgumentNullException("list");var i,r,u;return new c.EnumeratorBase(function(){i=null;r=n.first;u=n._version},function(t){return r?(n.assertVersion(u),i=r,r=i&&i.next,t.yieldReturn(i.value)):t.yieldBreak()})},n.copyValues=function(n,i,r){if(r===void 0&&(r=0),n&&n.first){if(!i)throw new t.ArgumentNullException("array");n.forEach(function(n,t){i[r+t]=n.value})}return i},n}();e.LinkedNodeList=p;at=function(n){function t(t,i){i===void 0&&(i=u.areEqual);var f=n.call(this,r,i)||this;return t instanceof Array?f._source=t.slice():(f._source=[],f._importEntries(t)),f}return __extends(t,n),t.prototype._onDispose=function(){n.prototype._onDispose.call(this);this._source=null},t.prototype.getCount=function(){return this._source.length},t.prototype._addInternal=function(n){return this._source.push(n),!0},t.prototype._removeInternal=function(n,t){return t===void 0&&(t=Infinity),a.remove(this._source,n,t,this._equalityComparer)},t.prototype._clearInternal=function(){var n=this._source.length;return this._source.length=0,n},t.prototype._importEntries=function(t){var r,f,e,u;if(i.isArrayLike(t)){if(r=t.length,!r)return 0;for(f=this._source,e=f.length,f.length+=r,u=0;u<r;u++)f[u+e]=t[u];return r}return n.prototype._importEntries.call(this,t)},t.prototype.get=function(n){return this._source[n]},t.prototype.set=function(n,t){var i=this._source;return n<i.length&&u.areEqual(t,i[n])?!1:(i[n]=t,this._signalModification(!0),!0)},t.prototype.indexOf=function(n){return a.indexOf(this._source,n,this._equalityComparer)},t.prototype.insert=function(n,t){var i=this,r=i._source;n<r.length?i._source.splice(n,0,t):i._source[n]=t;i._signalModification(!0)},t.prototype.removeAt=function(n){return a.removeIndex(this._source,n)?(this._signalModification(!0),!0):!1},t.prototype.contains=function(n){return a.contains(this._source,n,this._equalityComparer)},t.prototype.copyTo=function(n,t){return a.copyTo(this._source,n,0,t)},t.prototype.getEnumerator=function(){var n=this,i,t,r;return n.throwIfDisposed(),new c.EnumeratorBase(function(){i=n._source;r=n._version;t=0},function(u){if(t)n.throwIfDisposed();else if(n.wasDisposed)return u.yieldBreak();return(n.assertVersion(r),t>=i.length)?u.yieldBreak():u.yieldReturn(i[t++])})},t.prototype.forEach=function(n,t){var i=this._source;return c.forEach(t?i.slice():this,n)},t.prototype.addRange=function(n){var t=this;n.toArray().forEach(function(n){return t.add(n)})},t}(l);e.List=at,function(n){function i(n,i){if(n<0)throw new t.ArgumentOutOfRangeException(i,n,"Must be greater than zero");return!0}function r(n,t){return f.assert(n,t),i(n,t)}n.AU=a;n.MINIMUM_GROW=4;n.SHRINK_THRESHOLD=32;n.GROW_FACTOR_HALF=100;n.DEFAULT_CAPACITY=n.MINIMUM_GROW;n.emptyArray=Object.freeze([]);n.assertZeroOrGreater=i;n.assertIntegerZeroOrGreater=r}(s||(s={}));vt=function(n){function e(t,f){var c,e,o,h;return f===void 0&&(f=u.areEqual),c=n.call(this,r,f)||this,e=c,e._head=0,e._tail=0,e._size=0,t?i.isNumber(t)?(o=t,s.assertIntegerZeroOrGreater(o,"capacity"),e._array=o?s.AU.initialize(o):s.emptyArray):(h=t,e._array=s.AU.initialize(i.isArrayLike(h)?h.length:s.DEFAULT_CAPACITY),e._importEntries(h)):e._array=s.emptyArray,e._capacity=e._array.length,c}return __extends(e,n),e.prototype.getCount=function(){return this._size},e.prototype._addInternal=function(n){var t=this,f=t._size,i=t._capacity,r,u;return f==i&&(r=i*s.GROW_FACTOR_HALF,r<i+s.MINIMUM_GROW&&(r=i+s.MINIMUM_GROW),t.setCapacity(r),i=t._capacity),u=t._tail,t._array[u]=n,t._tail=(u+1)%i,t._size=f+1,!0},e.prototype._removeInternal=function(){throw new t.NotImplementedException("ICollection<T>.remove is not implemented in Queue<T> since it would require destroying the underlying array to remove the item.");},e.prototype._clearInternal=function(){var n=this,t=n._array,i=n._head,r=n._tail,u=n._size;return i<r?s.AU.clear(t,i,r):(s.AU.clear(t,i),s.AU.clear(t,0,r)),n._head=0,n._tail=0,n._size=0,n.trimExcess(),u},e.prototype._onDispose=function(){n.prototype._onDispose.call(this);var t=this;t._array!=s.emptyArray&&(t._array.length=t._capacity=0,t._array=s.emptyArray)},e.prototype.dump=function(n){n===void 0&&(n=Infinity);var t=this,i=[];if(isFinite(n)){if(f.assertZeroOrGreater(n),n!==0)while(n--&&t._tryDequeueInternal(function(n){i.push(n)}));}else while(t._tryDequeueInternal(function(n){i.push(n)}));return t.trimExcess(),t._signalModification(),i},e.prototype.forEach=function(t){return n.prototype.forEach.call(this,t,!0)},e.prototype.setCapacity=function(n){var t=this,i,r,f;if(s.assertIntegerZeroOrGreater(n,"capacity"),i=t._array,r=t._capacity,n>r&&t.throwIfDisposed(),n!=r){var u=t._head,o=t._tail,e=t._size;if(i!=s.emptyArray&&n>r&&u<o){i.length=t._capacity=n;t._version++;return}f=s.AU.initialize(n);e>0&&(u<o?s.AU.copyTo(i,f,u,0,e):(s.AU.copyTo(i,f,u,0,r-u),s.AU.copyTo(i,f,0,r-u,o)));t._array=f;t._capacity=n;t._head=0;t._tail=e==n?0:e;t._signalModification(!0)}},e.prototype.enqueue=function(n){this.add(n)},e.prototype._tryDequeueInternal=function(n){var t=this;if(!t._size)return!1;var r=t._array,i=t._head,u=t._array[i];return r[i]=null,t._head=(i+1)%t._capacity,t._size--,t._incrementModified(),n(u),!0},e.prototype.dequeue=function(n){var u,i;if(n===void 0&&(n=!1),u=this,u.assertModifiable(),i=r,!this.tryDequeue(function(n){i=n})&&n)throw new t.InvalidOperationException("Cannot dequeue an empty queue.");return i},e.prototype.tryDequeue=function(n){var t=this;return t._size?(t.assertModifiable(),this._tryDequeueInternal(n))?(t._size<t._capacity/2&&t.trimExcess(s.SHRINK_THRESHOLD),t._signalModification(),!0):!1:!1},e.prototype._getElement=function(n){s.assertIntegerZeroOrGreater(n,"index");var t=this;return t._array[(t._head+n)%t._capacity]},e.prototype.peek=function(n){if(n===void 0&&(n=!1),this._size==0){if(n)throw new t.InvalidOperationException("Cannot call peek on an empty queue.");return r}return this._array[this._head]},e.prototype.trimExcess=function(n){var t=this,i=t._size;i<Math.floor(t._capacity*.9)&&(!n&&n!==0||isNaN(n)||n<i)&&t.setCapacity(i)},e.prototype.getEnumerator=function(){var n=this,t,i,r;return n.throwIfDisposed(),new c.EnumeratorBase(function(){i=n._version;r=n._size;t=0},function(u){return(n.throwIfDisposed(),n.assertVersion(i),t==r)?u.yieldBreak():u.yieldReturn(n._getElement(t++))})},e}(l);e.Queue=vt,function(n){function t(n,t){var r=n||{},i;for(i in t)t.hasOwnProperty(i)&&(r[i]=t[i]);return r}function r(n,t){var r=n||{},i;for(i in t)t.hasOwnProperty(i)&&!r.hasOwnProperty(i)&&(r[i]=t[i]);return r}function i(n){return t({},n)}function u(n,r){return t(i(n),r)}function f(n,t){for(var i in n)t.hasOwnProperty(i)||delete n[i]}n.apply=t;n.ensure=r;n.copy=i;n.merge=u;n.trim=f}(ui=e.MapUtility||(e.MapUtility={}));tt=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.prototype.getName=function(){return"KeyNotFoundException "},t}(t.SystemException);e.KeyNotFoundException=tt,function(n){function w(n){return bt.getIdentifier(n,typeof n!=i.BOOLEAN)}var e=o.using,a=u.areEqual,r=t.ArgumentNullException,s=c.forEach,v=c.EmptyEnumerator,y=void 0,f="other",h;n.getId=w;h=function(n){function t(t){var i=n.call(this,y,a)||this;return i._importEntries(t),i}return __extends(t,n),t.prototype._getSet=function(){var n=this._set;return n||(this._set=n=new p),n},t.prototype.getCount=function(){return this._set?this._set.unsafeCount:0},t.prototype.exceptWith=function(n){var t=this;if(!n)throw new r(f);s(n,function(n){t._removeInternal(n)&&t._incrementModified()});t._signalModification()},t.prototype.intersectWith=function(n){var i,u;if(!n)throw new r(f);i=this;n instanceof t?(u=i._set,u&&u.forEach(function(t){!n.contains(t.value)&&i._removeInternal(t.value)&&i._incrementModified()},!0),i._signalModification()):e(i.newUsing(n),function(n){return i.intersectWith(n)})},t.prototype.isProperSubsetOf=function(n){var i=this;if(!n)throw new r(f);return n instanceof t?n.isProperSupersetOf(this):e(this.newUsing(n),function(n){return n.isProperSupersetOf(i)})},t.prototype.isProperSupersetOf=function(n){var o=this,i,u;if(!n)throw new r(f);return i=!0,n instanceof t?(i=this.isSupersetOf(n),u=n.getCount()):u=e(this.newUsing(),function(t){return s(n,function(n){return t.add(n),i=o.contains(n)}),t.getCount()}),i&&this.getCount()>u},t.prototype.isSubsetOf=function(n){var i=this;if(!n)throw new r(f);return n instanceof t?n.isSupersetOf(this):e(this.newUsing(n),function(n){return n.isSupersetOf(i)})},t.prototype.isSupersetOf=function(n){var i=this,t;if(!n)throw new r(f);return t=!0,s(n,function(n){return t=i.contains(n)}),t},t.prototype.overlaps=function(n){var i=this,t;if(!n)throw new r(f);return t=!1,s(n,function(n){return!(t=i.contains(n))}),t},t.prototype.setEquals=function(n){if(!n)throw new r(f);return this.getCount()==(n instanceof t?n.getCount():e(this.newUsing(n),function(n){return n.getCount()}))&&this.isSubsetOf(n)},t.prototype.symmetricExceptWith=function(n){if(!n)throw new r(f);var i=this;n instanceof t?(s(n,function(n){i.contains(n)?i._removeInternal(n)&&i._incrementModified():i._addInternal(n)&&i._incrementModified()}),i._signalModification()):e(this.newUsing(n),function(n){return i.symmetricExceptWith(n)})},t.prototype.unionWith=function(n){this.importEntries(n)},t.prototype._clearInternal=function(){var n=this._set;return n?n.clear():0},t.prototype._onDispose=function(){n.prototype._onDispose.call(this);this._set=null},t.prototype.contains=function(n){return!(!this.getCount()||!this._getNode(n))},t.prototype.getEnumerator=function(){var n=this,t;return n.throwIfDisposed(),t=n._set,t&&n.getCount()?p.valueEnumeratorFrom(t):v},t.prototype.forEach=function(t,i){return i?n.prototype.forEach.call(this,t,i):this._set.forEach(function(n,i){return t(n.value,i)})},t.prototype._removeNode=function(n){return!!n&&this.remove(n.value)!=0},t.prototype.removeFirst=function(){var n=this._set;return this._removeNode(n&&n.first)},t.prototype.removeLast=function(){var n=this._set;return this._removeNode(n&&n.last)},t}(l);n.SetBase=h}(rt=e.InternalSet||(e.InternalSet={}));pt=rt.SetBase;ut=function(n){function u(r,u){var f=n.call(this)||this;if(i.isFunction(r))f._keyGenerator=r;else{if(!u)throw new t.ArgumentNullException("keyGenerator");f._keyGenerator=u;f._importEntries(r)}return f}return __extends(u,n),u.prototype.newUsing=function(n){return new u(n,this._keyGenerator)},u.prototype._addInternal=function(n){var u=this,e=typeof n,t=u._registry,i=t&&t[e],o=u._keyGenerator(n),f;return!i||i[o]===r?(t||(u._registry=t={}),i||(t[e]=i={}),f={value:n},u._getSet().addNode(f),i[o]=f,!0):!1},u.prototype._clearInternal=function(){return yt(this._registry,2),n.prototype._clearInternal.call(this)},u.prototype._onDispose=function(){n.prototype._onDispose.call(this);this._registry=null;this._keyGenerator=r},u.prototype._getNode=function(n){var t=this._registry,i=t&&t[typeof n];return i&&i[this._keyGenerator(n)]},u.prototype._removeInternal=function(n,t){var r;if(t===void 0&&(t=Infinity),t===0)return 0;var u=this._registry,i=u&&u[typeof n],f=i&&i[n];return f&&(delete i[n],r=this._set,r&&r.removeNode(f))?1:0},u}(pt);e.HashSet=ut;wt=function(n){function t(t){return n.call(this,t,rt.getId)||this}return __extends(t,n),t}(ut);e.Set=wt,function(n){function o(n){f.assert(n,"length");var t;return n>65536?t=new Array(n):(t=[],t.length=n),t}function et(n,t){var r,u,e,f,o,i;if(t===void 0&&(t=!1),!n||!n.length)return 0;if(r=0,t)for(u=0,e=n;u<e.length;u++)i=e[u],isNaN(i)||(r+=i);else for(f=0,o=n;f<o.length;f++){if(i=o[f],isNaN(i))return NaN;r+=i}return r}function ot(n,t){var r,u,f,o,e,s,i;if(t===void 0&&(t=!1),!n||!n.length)return NaN;if(r=0,t)for(u=0,f=0,o=n;f<o.length;f++)i=o[f],isNaN(i)||(r+=i,u++);else for(u=n.length,e=0,s=n;e<s.length;e++){if(i=s[e],isNaN(i))return NaN;r+=i}return!u||isNaN(r)?NaN:r/u}function st(n,t){var r,e,u,o,f,s,i;if(t===void 0&&(t=!1),!n||!n.length)return NaN;if(r=1,t){for(e=!1,u=0,o=n;u<o.length;u++)i=o[u],isNaN(i)||(r*=i,e=!0);if(!e)return NaN}else for(f=0,s=n;f<s.length;f++){if(i=s[f],isNaN(i))return NaN;r*=i}return r}function ht(n,t){var f,e,i,r,u;if(t===void 0&&(t=!1),f=n?n.length:0,f<2)return NaN;for(e=n[0],i=!1,r=1;r<f;r++){if(u=n[r],u===0)return NaN;if(isNaN(u)){if(!t)return NaN}else e/=u,i||(i=!0)}return i?e:NaN}function y(n,t,i,r){var f,e,o,h,s,c,u;if(!n||!n.length)return NaN;if(f=t,i){for(e=!1,o=0,h=n;o<h.length;o++)u=h[o],isNaN(u)||(r(u,f)&&(f=u),e||(e=!0));if(!e)return NaN}else for(s=0,c=n;s<c.length;s++){if(u=c[s],isNaN(u))return NaN;r(u,f)&&(f=u)}return f}function ct(n,t){return t===void 0&&(t=!1),y(n,+Infinity,t,function(n,t){return n<t})}function lt(n,t){return t===void 0&&(t=!1),y(n,-Infinity,t,function(n,t){return n>t})}function at(n){for(var t=n.length,i,r;--t;)i=Math.floor(Math.random()*(t+1)),r=n[t],n[t]=n[i],n[i]=r;return n}function w(n,t,r){var e,f;if(r===void 0&&(r=u.areEqual),e=n&&n.length,e){if(n instanceof Array&&!i.isTrueNaN(t))return n.indexOf(t);for(f=0;f<e;f++)if(r(n[f],t))return f}return-1}function b(n,t,i){return i===void 0&&(i=u.areEqual),w(n,t,i)!=-1}function vt(n,i,u,f){var o,e,s;if(f===void 0&&(f=Infinity),!n||!n.length||f===0)return 0;if(f<0)throw new t.ArgumentOutOfRangeException("max",f,r);for(f||(f=Infinity),o=0,e=0,s=n.length;e<s;e++)if(n[e]===i&&(n[e]=u,++o,o==f))break;return o}function k(n,i,r,u){if(r===void 0&&(r=0),n){if(f.assertZeroOrGreater(r,"start"),u||u===0||(u=n.length),f.assert(u,"stop"),u<r)throw new t.ArgumentOutOfRangeException("stop",u,"is less than start");for(var e=r;e<u;e++)n[e]=i}}function yt(n,t,i){t===void 0&&(t=0);k(n,null,t,i)}function pt(n,i,r){if(r===void 0&&(r=u.areEqual),!n)throw new t.ArgumentNullException("array",e);var f=n.length,o=!f||!b(n,i,r);return o&&(n[f]=i),o}function wt(n,r){var f,u;if(!n)throw new t.ArgumentNullException("array",e);if(!i.isFunction(r))throw new t.ArgumentException("predicate","Must be a function.");if(f=n.length,!i.isNumber(f,!0)||f<0)throw new t.ArgumentException("array","Does not have a valid length.");if(n instanceof Array){for(u=0;u<f;u++)if(r(n[u],u))return u}else for(u=0;u<f;u++)if(u in n&&r(n[u],u))return u;return-1}function bt(n,t){if(n&&t)for(var i=0;i<n.length;i++)if(t(n[i],i)===!1)break}function kt(n,t){if(n&&t)for(var i=0;i<n.length;i++)n[i]=t(n[i],i)}function dt(n,i){if(!n)throw new t.ArgumentNullException("array",e);if(f.assert(i,"index"),i<0)throw new t.ArgumentOutOfRangeException("index",i,r);var u=i<n.length;return u&&n.splice(i,1),u}function gt(n,i,f,e){var s,h,c,o;if(f===void 0&&(f=Infinity),e===void 0&&(e=u.areEqual),!n||!n.length||f===0)return 0;if(f<0)throw new t.ArgumentOutOfRangeException("max",f,r);if(s=0,f&&isFinite(f)){for(h=[],o=0,c=n.length;o<c;o++)if(e(n[o],i)&&(h.push(o),++s,s==f))break;for(o=h.length-1;o>=0;o--)n.splice(h[o],1)}else for(o=n.length-1;o>=0;o--)e(n[o],i)&&(n.splice(o,1),++s);return s}function ni(n,i){var e,u;if(f.assert(i,"count"),i<0)throw new t.ArgumentOutOfRangeException("count",i,r);for(e=o(i),u=0;u<i;u++)e[u]=n;return e}function g(n,i,u){var e,f;if(u===void 0&&(u=1),isNaN(n)||!isFinite(n))throw new t.ArgumentOutOfRangeException("first",n,c);if(isNaN(i)||!isFinite(i))throw new t.ArgumentOutOfRangeException("count",i,c);if(i<0)throw new t.ArgumentOutOfRangeException("count",i,r);for(e=o(i),f=0;f<i;f++)e[f]=n,n+=u;return e}function ti(n,i,r){if(r===void 0&&(r=1),r==0)throw new t.ArgumentOutOfRangeException("step",r,p);return g(n,(i-n)/r,r)}function ii(n){var t={};return n.filter(function(n){return!(n in t)&&(t[n]=!0)})}function nt(n,t){var r,u,i,f;for(t===void 0&&(t=0),r=[],u=0;u<n.length;u++)if(i=n[u],i instanceof Array)for(t>0&&(i=nt(i,t-1)),f=0;f<i.length;f++)r.push(i[f]);else r.push(i);return r}function it(n,t){if(n&&t&&n===t||!n&&!t)return!0;if(!n||!t)return!1;var i=n.length;return i!==t.length?!1:i===0?!0:i}function ui(n,t,r){var f,u,e;if(t===void 0&&(t=!0),r===void 0&&(r=s.areEqual),!n)throw new Error("ArgumentNullException: 'arrays' cannot be null.");if(n.length<2)throw new Error("Cannot compare a set of arrays less than 2.");for(i.isFunction(t)&&(r=t,t=!0),f=n[0],u=1,e=n.length;u<e;u++)if(!rt(f,n[u],t,r))return!1;return!0}function rt(n,t,r,u){var e,f;if(r===void 0&&(r=!0),u===void 0&&(u=s.areEqual),e=it(n,t),i.isBoolean(e))return e;for(i.isFunction(r)&&(u=r,r=!0),f=0;f<e;f++)if(!u(n[f],t[f],r))return!1;return!0}function ut(n,t){var r,i,u;if(!n||n.length<2)return n;for(r=n.length,r>65536?i=new Array(r):(i=[],i.length=r),u=0;u<r;u++)i[u]=n[u];return i.sort(t),i}function fi(n,t,r){var f,u;if(r===void 0&&(r=s.compare),f=it(n,t),i.isBoolean(f))return f;for(n=ut(n,r),t=ut(t,r),u=0;u<f;u++)if(r(n[u],t[u])!==0)return!1;return!0}function l(n,t,i){return(t===void 0&&(t=0),i===void 0&&(i=Infinity),!n)?n:ft(n,o(Math.min(i,Math.max(n.length-t,0))),t,0,i)}function ft(n,i,u,f,o){var h,c,l,s;if(u===void 0&&(u=0),f===void 0&&(f=0),o===void 0&&(o=Infinity),!n)throw new t.ArgumentNullException("source",e);if(!i)throw new t.ArgumentNullException("destination",e);if(u<0)throw new t.ArgumentOutOfRangeException("sourceIndex",u,r);if(h=n.length,!h)return i;if(u>=h)throw new t.ArgumentOutOfRangeException("sourceIndex",u,"Must be less than the length of the source array.");if(i.length<0)throw new t.ArgumentOutOfRangeException("destinationIndex",f,r);if(c=n.length-u,isFinite(o)&&o>c)throw new t.ArgumentOutOfRangeException("sourceIndex",u,"Source index + length cannot exceed the length of the source array.");for(o=Math.min(o,c),l=f+o,l>i.length&&(i.length=l),s=0;s<o;s++)i[f+s]=n[u+s];return i}function v(n,t,i){v.unsafe(l(n),t,i)}var s=u,h,p,c,ri,tt,e,r,a;(function(n){function r(n){return n instanceof Array?n:[n]}function e(n,t,f){t===void 0&&(t=1);f===void 0&&(f=NaN);var e=!i.isTrueNaN(f);return function(o,s){for(var y=r(n(o)),p=r(n(s)),w=Math.min(y.length,p.length),c=t instanceof Array?t:null,v,h=0;h<w;h++){var l=y[h],a=p[h],b=c?h<c.length?c[h]:1:t;if(e&&(i.isTrueNaN(l)&&(l=f),i.isTrueNaN(a)&&(a=f)),v=u.compare(l,a),v!==0)return b*v}return 0}}function s(n){var f,r,i,u,e;if(!n)throw new t.ArgumentNullException("target");for(f=n.length,r=1;r<f;r++)for(i=r,u=void 0;i>0&&n[u=i-1]>n[i];)e=n[i],n[i]=n[u],n[u]=e,i--;return n}var f,h;(function(n){function r(n){if(!n)throw new t.ArgumentNullException("target");var r=n.length;return n.length<2?n:i(n,0,r-1)}function i(n,t,r){var f,o,u,e;if(t<r){for(f=void 0,o=Math.floor((t+r)/2),f=n[o],n[o]=n[r],n[r]=f,u=t,e=t;e<r;e++)n[e]<n[r]&&(f=n[u],n[u]=n[e],n[e]=f,u++);f=n[u];n[u]=n[r];n[r]=f;i(n,t,u-1);i(n,u+1,r)}return n}n.quickSort=r})(f=n.QuickSort||(n.QuickSort={}));n.createComparer=e;n.insertionSort=s,function(n){function r(n){if(!n)throw new t.ArgumentNullException("target");var r=n.length;return r<2?n:i(n,0,r,o(r))}function i(n,t,r,u){var f,e,h;if(r-t>1){for(f=Math.floor((t+r)/2),i(n,t,f,u),i(n,f,r,u),e=0,h=n.length;e<h;e++)u[e]=n[e];for(var c=t,o=t,s=f;o<f&&s<r;)n[c++]=u[o]>u[s]?u[s++]:u[o++];while(o<f)n[c++]=u[o++]}return n}n.mergeSort=r}(h=n.MergeSort||(n.MergeSort={}))})(h=n.Sorting||(n.Sorting={}));n.initialize=o;n.sum=et;n.average=ot;n.product=st;n.quotient=ht;n.min=ct;n.max=lt;n.shuffle=at;p="Cannot be zero.";c="Must be a valid finite number";n.indexOf=w;n.contains=b;n.replace=vt;n.updateRange=k;n.clear=yt;n.register=pt;n.findIndex=wt;n.forEach=bt;n.applyTo=kt;n.removeIndex=dt;n.remove=gt;n.repeat=ni;n.range=g;n.rangeUntil=ti;n.distinct=ii;n.flatten=nt,function(n){function i(n,i,r,u){return r===void 0&&(r=1),u===void 0&&(u=NaN),n.sort(t(i,r,u))}n.quick=h.QuickSort.quickSort;var t=h.createComparer;n.using=i}(ri=n.ArraySort||(n.ArraySort={}));tt=function(n){function t(t){var i=n.call(this,t)||this;return i.__getValueAt=function(n){return t[n]},i}return __extends(t,n),t.prototype._onDispose=function(){n.prototype._onDispose.call(this);this.__getValueAt=null},t.prototype.getValueAt=function(n){return this.throwIfDisposed(),this.__getValueAt(n)},t}(d);n.ReadOnlyArrayWrapper=tt;n.areAllEqual=ui;n.areEqual=rt;n.areEquivalent=fi;n.copy=l;e="Cannot be null.";r="Cannot be less than zero.";n.copyTo=ft;a=void 0;n.dispatch=v,function(n){function t(n,t,r){var u,e,f;if(n&&n.length)for(u=0,e=n.length;u<e;u++)if(f=n[u],f)try{f(t)}catch(o){if(r)i.isFunction(r)&&r(o,u);else throw o;}}function r(n,t,r){var f,u,o,e;if(!n)return n;if(f=l(n),n.length)for(u=0,o=f.length;u<o;u++){e=f[u];try{f[u]=e?e(t):a}catch(s){if(f[u]=a,r)i.isFunction(r)&&r(s,u);else throw s;}}return f}n.unsafe=t;n.mapped=r}(v=n.dispatch||(n.dispatch={}))}(a=e.ArrayModule||(e.ArrayModule={})),function(n){function w(n,t){if(t===void 0&&(t=!1),i.isPropertyKey(n))return n;if(n===null)return it;if(n===r)return i.UNDEFINED;if(i.hasMethod(n,rt))return n.getSymbol();if(i.hasMethod(n,ut))return n.getHashCode();if(t){if(i.isFunction(t))return t(n);throw"Cannot create known identity.";}return typeof n.toString==i.FUNCTION?n.toString():Object.prototype.toString.call(n)}function h(n){if(s||(s=new o.ObjectPool(20,function(){return new p},function(n){return n.clear()})),!n)return s.take();s.add(n)}var y=t.ArgumentOutOfRangeException,d=t.InvalidOperationException,r=void 0,it="null",rt="getSymbol",ut="getHashCode",e,b,s,k,g,nt;n.getIdentifier=w;e=function(n){function i(t){return n.call(this,t)||this}return __extends(i,n),i.prototype._onValueModified=function(){},i.prototype._addInternal=function(n){var i=this;if(!n)throw new t.ArgumentNullException("item","Dictionaries must use a valid key/value pair. '"+n+"' is not allowed.");return v.extractKeyValue(n,function(n,t){return i.addByKeyValue(n,t)})},i.prototype._clearInternal=function(){for(var i=this,r=0,u,n=0,t=i.keys;n<t.length;n++)u=t[n],i.removeByKey(u)&&r++;return r},i.prototype.contains=function(n){var t=this;return!n||!this.getCount()?!1:v.extractKeyValue(n,function(n,i){var r=t.getValue(n);return u.areEqual(i,r)})},i.prototype._removeInternal=function(n){var t=this;return n?v.extractKeyValue(n,function(n,i){var r=t.getValue(n);return u.areEqual(i,r)&&t.removeByKey(n)?1:0}):0},Object.defineProperty(i.prototype,"keys",{get:function(){return this.getKeys()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"values",{get:function(){return this.getValues()},enumerable:!0,configurable:!0}),i.prototype.addByKeyValue=function(n,t){var u,i;if(t===r)throw new d("Cannot add 'undefined' as a value.");if(u=this,u.containsKey(n)){i=new d("Adding a key/value when the key already exists.");i.data.key=n;i.data.value=t;throw i;}return u.setValue(n,t)},i.prototype.getAssuredValue=function(n){var t=this.getValue(n);if(t===r)throw new tt("Key '"+n+"' not found.");return t},i.prototype.tryGetValue=function(n,t){var i=this.getValue(n);return i!==r?(t(i),!0):!1},i.prototype.setValue=function(n,t){var i=this,r,f;return i.assertModifiable(),r=!1,f=i.getValue(n),!u.areEqual(t,f)&&i._setValueInternal(n,t)&&(r=!0,i._onValueModified(n,t,f)),i._signalModification(r),r},i.prototype.containsKey=function(n){return!!this._getEntry(n)},i.prototype.containsValue=function(n){for(var t=this.getEnumerator();t.moveNext();)if(u.areEqual(t.current,n,!0))return t.dispose(),!0;return!1},i.prototype.removeByKey=function(n){return this.setValue(n,r)},i.prototype.removeByValue=function(n){for(var i=this,e=0,f,t=0,r=i.getKeys();t<r.length;t++)f=r[t],u.areEqual(i.getValue(f),n,!0)&&(i.removeByKey(f),e++);return e},i.prototype.importEntries=function(t){return n.prototype.importEntries.call(this,t)},i.prototype._importEntries=function(n){var i=this,t;return n?(t=0,c.forEach(n,function(n){return v.extractKeyValue(n,function(n,r){i._setValueInternal(n,r)&&t++})}),t):0},i.prototype.getEnumerator=function(){var n=this,u,t,f,i;return n.throwIfDisposed(),i=0,new c.EnumeratorBase(function(){n.throwIfDisposed();u=n._version;t=n.getKeys();f=t.length},function(e){for(n.throwIfDisposed(),n.assertVersion(u);i<f;){var o=t[i++],s=n.getValue(o);if(s!==r)return e.yieldReturn({key:o,value:s})}return e.yieldBreak()})},i}(l);n.DictionaryBase=e;b=function(){function n(n,t,i,r){this.key=n;this.value=t;this.previous=i;this.next=r}return n}();k=function(n){function t(){var t=n!==null&&n.apply(this,arguments)||this;return t._count=0,t._map={},t}return __extends(t,n),t.prototype._onDispose=function(){n.prototype._onDispose.call(this);this._map=null},t.prototype._getEntry=function(n){return this.containsKey(n)?{key:n,value:this.getAssuredValue(n)}:null},t.prototype.containsKey=function(n){return n!=null&&this._count!=0&&this._map[n]!==r},t.prototype.containsValue=function(n){var t,i;if(!this._count)return!1;t=this._map;for(i in t)if(t.hasOwnProperty(i)&&u.areEqual(t[i],n))return!0;return!1},t.prototype.getValue=function(n){return n==null||!this._count?r:this._map[n]},t.prototype._setValueInternal=function(n,t){var u=this,i=u._map,f=i[n];return f!==t?(t===r?n in i&&(delete i[n],u._count--):(i.hasOwnProperty(n)||u._count++,i[n]=t),!0):!1},t.prototype.importMap=function(n){var t=this;return t.handleUpdate(function(){var r=!1,i;for(i in n)n.hasOwnProperty(i)&&t.setValue(i,n[i])&&(r=!0);return r})},t.prototype.toMap=function(n){var u=this,f={},t,i;if(u._count)for(t in u._map)u._map.hasOwnProperty(t)&&(i=u._map[t],n&&(i=n(t,i)),i!==r&&(f[t]=i));return f},t.prototype.getKeys=function(){return Object.keys(this._map)},t.prototype.getValues=function(){var n,t,i;if(!this._count)return[];for(n=Object.keys(this._map),t=0,i=n.length;t<i;t++)n[t]=this._map[n[t]];return n},t.prototype.getCount=function(){return this._count},t}(e);n.StringKeyDictionary=k;g=function(n){function t(){var t=n.call(this)||this;return t._order=[],t}return __extends(t,n),t.prototype.indexOfKey=function(n){var t=this._order;return t.length?t.indexOf(n,0):-1},t.prototype.getValueByIndex=function(n){f.assertZeroOrGreater(n);var t=this._order;if(n<t.length)return this.getAssuredValue(t[n]);throw new y("index",n);},t.prototype.setValue=function(t,i,u){var f=this,e=f.indexOfKey(t)!=-1;return!e&&(i!==r||u)?f._order.push(t):e&&i===r&&!u&&a.remove(f._order,t),n.prototype.setValue.call(this,t,i)},t.prototype.setByIndex=function(n,t){var i=this,r=i._order;if(n<0)throw new y("index",n,"Is less than zero.");if(n>=r.length)throw new y("index",n,"Is greater than the count.");return i.setValue(r[n],t)},t.prototype.importValues=function(n){var t=this;return t.handleUpdate(function(){for(var r=!1,i=0;i<n.length;i++)t.setByIndex(i,n[i])&&(r=!0);return r})},t.prototype.setValues=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this.importValues(t)},t.prototype.removeByIndex=function(n){return this.setByIndex(n,r)},t.prototype.getKeys=function(){var n=this,t=n._order;return t.length&&t.filter(function(t){return n.containsKey(t)})||[]},t}(k);n.OrderedStringKeyDictionary=g;nt=function(n){function t(t){var i=n.call(this)||this;return i._keyGenerator=t,i._entries=h(),i._buckets={},i}return __extends(t,n),t.prototype._onDispose=function(){n.prototype._onDispose.call(this);var t=this;t._entries=null;t._buckets=null;t._hashGenerator=null},t.prototype.getCount=function(){return this._entries&&this._entries.unsafeCount||0},t.prototype._getBucket=function(n,t){if(n==null||!t&&!this.getCount())return null;i.isPrimitiveOrSymbol(n)||console.warn("Key type not indexable and could cause Dictionary to be extremely slow.");var u=this._buckets,r=u[n];return t&&!r&&(u[n]=r=h()),r||null},t.prototype._getBucketEntry=function(n,t,i){if(n==null||!this.getCount())return null;var f=this,r=f._keyGenerator,u=r?r(n):n;return i||(i=f._getBucket(t||w(u))),i&&(r?i.find(function(n){return r(n.key)===u}):i.find(function(n){return n.key===u}))},t.prototype._getEntry=function(n){var t=this._getBucketEntry(n);return t&&t.value},t.prototype.getValue=function(n){var t=this._getEntry(n);return t?t.value:r},t.prototype._setValueInternal=function(n,t){var f=this,p=f._buckets,a=f._entries,k=f._keyGenerator?f._keyGenerator(n):n,e=w(k),i=f._getBucket(e),o=i&&f._getBucketEntry(n,e,i),s,c,v,y,l;if(o)if(s=i,t===r){if(c=s.removeNode(o),v=a.removeNode(o.value),c&&!s.count&&(delete p[e],h(s),i=null),c!==v)throw"Entries and buckets are out of sync.";if(c)return!0}else return y=o.value.value,o.value.value=t,!u.areEqual(t,y);else if(t!==r){if(i||(i=f._getBucket(e,!0)),!i)throw new Error('"'+e+'" cannot be added to lookup table.');return l=new b(n,t),a.addNode(l),i.addNode(new b(n,l)),!0}return!1},t.prototype._clearInternal=function(){var i=this,n=i._buckets,t,r;for(t in n)n.hasOwnProperty(t)&&(r=n[t],delete n[t],h(r));return i._entries.clear()},t.prototype.getEnumerator=function(){var n=this,i,t;return n.throwIfDisposed(),new c.EnumeratorBase(function(){n.throwIfDisposed();i=n._version;t=n._entries.first},function(r){if(t){n.throwIfDisposed();n.assertVersion(i);var u={key:t.key,value:t.value};return t=t.next||null,r.yieldReturn(u)}return r.yieldBreak()})},t.prototype.getKeys=function(){for(var t=this,i=[],n=t._entries&&t._entries.first;n;)i.push(n.key),n=n.next;return i},t.prototype.getValues=function(){for(var t=this,i=[],n=t._entries&&t._entries.first;n;)i.push(n.value),n=n.next;return i},t}(e);n.Dictionary=nt}(bt=e.Dictionaries||(e.Dictionaries={})),function(n){var t=u,i=function(){function n(n,i,r){i===void 0&&(i=t.compare);r===void 0&&(r=1);this._next=n;this._comparer=i;this._order=r}return Object.defineProperty(n.prototype,"order",{get:function(){return this._order},enumerable:!0,configurable:!0}),n.prototype.generateSortedIndexes=function(n){var i=this,t;return n==null?[]:(t=n.map(function(n,t){return t}),t.sort(function(t,r){return i.compare(n[t],n[r])}),t)},n.prototype.compare=function(n,t){var i=this,r=i._comparer(n,t);return r==0&&i._next?i._next.compare(n,t):i._order*r},n}(),r;n.SortContext=i;r=function(n){function i(i,r,u,f){u===void 0&&(u=1);f===void 0&&(f=t.compare);var e=n.call(this,i,f,u)||this;return e._keySelector=r,e}return __extends(i,n),i.prototype.compare=function(i,r){var u=this,f=u._keySelector,e;return!f||f===h.Identity?n.prototype.compare.call(this,i,r):(e=t.compare(f(i),f(r)),e===0&&u._next)?u._next.compare(i,r):u._order*e},i}(i);n.KeySortedContext=r}(fi=e.Sorting||(e.Sorting={}))}(e=n.Collections||(n.Collections={})),function(t){function i(n){return Math.floor(Math.random()*n)}function o(n,t){var r=Math.abs(n);return r===0||r===1&&!t?0:(t&&(n+=n/r),i(n))}function s(n){for(var i=n.length,r=e.ArrayModule.initialize(i),t=0;t<i;t++)r[t]=n[t];return r}function c(n,t){return t===void 0&&(t=null),t==null&&(t=n,n=0),n=Math.ceil(n),t=Math.floor(t),r(t-n)+n}function r(n,t){return f.assert(n,"boundary"),o(n,t)}function l(n,t,i){var r,u;for(f.assert(n),r=[],r.length=n,u=0;u<n;u++)r[u]=o(t,i);return r}function a(n){return e.ArrayModule.shuffle(n)}function v(n){return e.ArrayModule.shuffle(s(n))}function u(n,t){t!==Infinity&&f.assertZeroOrGreater(t);switch(t){case 0:return[];case 1:return[u.one(n,!0)];default:var i=h(s(n));return t<i.length&&(i.length=t),i}}var h=n.Collections.ArrayModule.shuffle;t.integer=c;t.next=r,function(n){function r(n,i){return t.next(n,i)}function u(n){if(n===void 0&&(n=Number.MAX_VALUE),isNaN(n))throw"'boundary' is not a number.";return Math.random()*n}function e(n,t,r){f.assert(n,"min");f.assert(t,"max");var u=t-n;return u===0?n:(r&&(u+=u/Math.abs(u)),n+i(u))}n.integer=r;n.float=u;n.inRange=e}(r=t.next||(t.next={}));t.integers=l;t.shuffle=a;t.copy=v;t.select=u,function(n){function t(n,t){if(n&&n.length)return n[i(n.length)];if(t)throw"Cannot select from an empty set.";}n.one=t}(u=t.select||(t.select={}))}(ni=n.Random||(n.Random={}));ft=function(n){function i(i,r,u){u===void 0&&(u=!1);var f=n.call(this)||this;if(f._valueFactory=i,f._trapExceptions=r,f._allowReset=u,f._disposableObjectName="ResolverBase",!i)throw new t.ArgumentNullException("valueFactory");return f._isValueCreated=!1,f}return __extends(i,n),i.prototype.getError=function(){return this._error},Object.defineProperty(i.prototype,"error",{get:function(){return this.getError()},enumerable:!0,configurable:!0}),i.prototype.getValue=function(){var n=this,t,i;if(n.throwIfDisposed(),n._isValueCreated===null)throw new Error("Recursion detected.");if(!n._isValueCreated&&n._valueFactory){n._isValueCreated=null;try{if(t=void 0,!n._isValueCreated&&(t=n._valueFactory))return n._isValueCreated=null,this._allowReset||(this._valueFactory=p),i=t(),n._value=i,n._error=void 0,i}catch(r){if(n._error=r,!n._trapExceptions)throw r;}finally{n._isValueCreated=!0}}return n._value},Object.defineProperty(i.prototype,"canReset",{get:function(){return this._allowReset&&!!this._valueFactory},enumerable:!0,configurable:!0}),i.prototype._onDispose=function(){this._valueFactory=p;this._value=p;this._isValueCreated=p},i.prototype.tryReset=function(){var n=this;return n._valueFactory?(n._isValueCreated=!1,n._value=p,n._error=void 0,!0):!1},i}(o.DisposableBase);n.ResolverBase=ft;y=function(n){function t(t,i,r){i===void 0&&(i=!1);r===void 0&&(r=!1);var u=n.call(this,t,i,r)||this;return u._disposableObjectName="Lazy",u._isValueCreated=!1,u}return __extends(t,n),Object.defineProperty(t.prototype,"isValueCreated",{get:function(){return!!this._isValueCreated},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),t.prototype.equals=function(n){return this===n},t.prototype.valueEquals=function(n){return this.equals(n)||this.value===n.value},t.create=function(n,i,r){return i===void 0&&(i=!1),r===void 0&&(r=!1),new t(n,i,r)},t}(ft);n.Lazy=y;vt=function(n){function t(t,i){i===void 0&&(i=!1);var r=n.call(this,t,i,!0)||this;return r._disposableObjectName="ResettableLazy",r}return __extends(t,n),t.create=function(n,i){return i===void 0&&(i=!1),new t(n,i)},t}(y);n.ResettableLazy=vt,function(n){function a(n,i,r,u){try{n.apply(r,u)}catch(e){if(f){i&&i.exit();setTimeout(t,0);i&&i.enter();throw e;}else setTimeout(function(){throw e;},0)}i&&i.exit()}function v(){s||(s=!0,r())}function w(n,t,i){var r=l.take();return r.task=n,r.domain=f&&process.domain,r.context=t,r.args=i&&i.slice(),r.canceller=function(){if(!r)return!1;var n=Boolean(c.removeNode(r));return l.add(r),n},c.addNode(r),v(),{cancel:r.canceller,dispose:function(){r&&r.canceller()}}}function b(n){y.enqueue(n);v()}function t(){for(var n;n=c.first;){var i=n.task,t=n.domain,r=n.context,u=n.args;n.canceller();t&&t.enter();a(i,t,r,u)}while(y.tryDequeue(function(n){a(n)}));s=!1}function g(n,t,i){return new k(n,t,i)}function nt(n,t,i){return i===void 0&&(i=Infinity),new d(n,t,i)}var f=!1,r,s=!1,l=new o.ObjectPool(40,function(){return null},function(n){n.task=null;n.domain=null;n.context=null;n.args&&(n.args.length=0);n.args=null;n.canceller=null}),u,h;n.deferImmediate=w;n.runAfterDeferred=b;f?r=function(){process.nextTick(t)}:typeof setImmediate===i.FUNCTION?r=typeof window!==i.UNDEFINED?setImmediate.bind(window,t):function(){setImmediate(t)}:typeof MessageChannel!==i.UNDEFINED?(u=new MessageChannel,u.port1.onmessage=function(){r=h;u.port1.onmessage=t;t()},h=function(){u.port2.postMessage(0)},r=function(){setTimeout(t,0);h()}):r=function(){setTimeout(t,0)};var c=new e.LinkedNodeList,y=new e.Queue,p=function(){function n(){}return n.prototype.dispose=function(){this.cancel()},n}(),k=function(n){function t(i,r,u){r===void 0&&(r=0);var f=n.call(this)||this;return r>0||(r=0),f._id=setTimeout(t.handler,r,i,f,u),f}return __extends(t,n),t.prototype.cancel=function(){var n=this._id;return n?(clearTimeout(n),this._id=null,!0):!1},t.handler=function(n,t,i){t.cancel();n(i)},t}(p),d=function(n){function t(i,r,u){u===void 0&&(u=Infinity);var f=n.call(this)||this;if(f._remaining=u,r==null)throw"'interval' must be a valid number.";if(r<0)throw"'interval' cannot be negative.";return f._id=setInterval(t.handler,r,i,f),f}return __extends(t,n),t.prototype.cancel=function(){var n=this._id;return n?(clearInterval(n),this._id=null,!0):!1},t.handler=function(n,t){--t._remaining||t.cancel();n()},t}(p);n.defer=g;n.interval=nt;n.Worker=self.Worker}(s=n.Threading||(n.Threading={})),function(n){function a(n,t){var u=0,i,r;for(t||(t={});i=c[u++];)r=n[i],r&&(t[i]=r);return t}function b(n){var r=n;if(i.isString(r)){if(!r||(r=l(r).toLowerCase().replace(/[^a-z0-9+.-]+$/g,u),!r))return null;if(s.isValid(r))return r}else if(r==null)return r;throw new t.ArgumentOutOfRangeException("scheme",n,"Invalid scheme.");}function ft(n){if(n===0)return n;if(!n)return null;var r;if(i.isNumber(n)){if(r=n,r>=0&&isFinite(r))return r}else if(i.isString(n)&&(r=parseInt(n))&&!isNaN(r))return ft(r);throw new t.ArgumentException("port","invalid value");}function k(n){if(!n.host){if(n.userInfo)throw new t.ArgumentException("host","Cannot include user info when there is no host.");if(i.isNumber(n.port,!0))throw new t.ArgumentException("host","Cannot include a port when there is no host.");}var r=n.host||u;return r&&(n.userInfo&&(r=n.userInfo+ut+r),isNaN(n.port)||(r+=":"+n.port),r=rt+r),r}function ot(n){return n&&(n.indexOf(p)!==0?p:u)+n}function st(n){return n&&(n.indexOf(w)!==0?w:u)+n}function ht(n){var t=n.path,i=n.query;return u+(t||u)+(ot(i)||u)}function ct(n){var r=b(n.scheme),o=k(n),f=ht(n),s=st(n.fragment),e=u+(r&&r+":"||u)+(o||u),i=u+(f||u)+(s||u);if(e&&i&&r&&!o)throw new t.ArgumentException("authority","Cannot format schemed Uri with missing authority.");return e&&f&&f.indexOf(y)!==0&&(i=y+i),e+i}function lt(n,i){var f,e,o,s,h;if(!n)return new t.ArgumentException("url","Nothing to parse.");if(e={},f=n.indexOf(w),f!=-1&&(e.fragment=n.substring(f+1)||r,n=n.substring(0,f)),f=n.indexOf(p),f!=-1&&(e.query=n.substring(f+1)||r,n=n.substring(0,f)),f=n.indexOf(rt),f!=-1){if(o=l(n.substring(0,f)),s=/:$/,!s.test(o))return new t.ArgumentException("url","Scheme was improperly formatted");o=l(o.replace(s,u));try{e.scheme=b(o)||r}catch(c){return c}n=n.substring(f+2)}if(f=n.indexOf(y),f!=-1&&(e.path=n.substring(f),n=n.substring(0,f)),f=n.indexOf(ut),f!=-1&&(e.userInfo=n.substring(0,f)||r,n=n.substring(f+1)),f=n.indexOf(":"),f!=-1){if(h=parseInt(l(n.substring(f+1))),isNaN(h))return new t.ArgumentException("url","Port was invalid.");e.port=h;n=n.substring(0,f)}return n=l(n),n&&(e.host=n),i(a(e)),null}function d(n,t){if(!n)return u;var i=[];return e.Enumeration.isEnumerableOrArrayLike(n)?e.ArrayModule.forEach(n,function(n){return v.extractKeyValue(n,function(n,t){return yt(i,n,t)})}):Object.keys(n).forEach(function(t){return yt(i,t,n[t])}),(i.length&&t?nt:u)+i.join(f)}function vt(n,t,i){n.push(t+h+pt(i))}function yt(n,t,i){e.Enumeration.isEnumerableOrArrayLike(i)?e.ArrayModule.forEach(i,function(i){return vt(n,t,i)}):vt(n,t,i)}function pt(n){if(wt(n)){var t=n.toUriComponent();if(t&&t.indexOf(f)!=1)throw".toUriComponent() did not encode the value.";return t}return encodeURIComponent(et.toString(n))}function wt(n){return i.hasMemberOfType(n,kt,i.FUNCTION)}function o(n,t,i,r){var l,e,c,o,s,a,u;if(i===void 0&&(i=!0),r===void 0&&(r=!0),n&&(n=n.replace(/^\s*\?+/,"")))for(l=n.split(f),e=0,c=l;e<c.length;e++)o=c[e],s=o.indexOf(h),s!=-1&&(a=o.substring(0,s),u=o.substring(s+1),r&&(u=decodeURIComponent(u)),i&&(u=et.toPrimitive(u)),t(a,u))}function bt(n,t,i){t===void 0&&(t=!0);i===void 0&&(i=!0);var r={};return o(n,function(n,t){if(n in r){var i=r[n];i instanceof Array||(r[n]=i=[i]);i.push(t)}else r[n]=t},t,i),r}function dt(n,t,i){t===void 0&&(t=!0);i===void 0&&(i=!0);var r=[];return o(n,function(n,t){r.push({key:n,value:t})},t,i),r}var g,s,tt,it,c,at;(function(n){n[n.Basic=0]="Basic";n[n.DNS=1]="DNS";n[n.IPv4=2]="IPv4";n[n.IPv6=3]="IPv6";n[n.Unknown=4]="Unknown"})(g=n.UriHostNameType||(n.UriHostNameType={}));Object.freeze(g),function(n){function t(t){return n.All.indexOf(t)!==-1}n.File="file";n.FTP="ftp";n.GOPHER="gopher";n.HTTP="http";n.HTTPS="https";n.LDAP="ldap";n.MAILTO="mailto";n.PIPE="net.pipe";n.TCP="net.tcp";n.NEWS="news";n.NNTP="nntp";n.TELNET="telnet";n.UUID="uuid";n.All=Object.freeze([n.File,n.FTP,n.GOPHER,n.HTTP,n.HTTPS,n.LDAP,n.MAILTO,n.PIPE,n.TCP,n.NEWS,n.NNTP,n.TELNET,n.UUID]);n.isValid=t}(s=n.Scheme||(n.Scheme={}));var nt="?",f="&",h="=",kt="toUriComponent";Object.freeze(s),function(n){n.Query=nt;n.Entry=f;n.KeyValue=h}(tt=n.Separator||(n.Separator={}));it=function(){function n(n,t,r,u,f,e,o){var s=this;this.scheme=b(n)||null;this.userInfo=t||null;this.host=r||null;this.port=ft(u);this.authority=s.getAuthority()||null;this.path=f||null;i.isString(e)||(e=d(e));this.query=ot(e)||null;Object.freeze(this.queryParams=s.query?bt(s.query):{});this.pathAndQuery=s.getPathAndQuery()||null;this.fragment=st(o)||null;this.absoluteUri=s.getAbsoluteUri();this.baseUri=s.absoluteUri.replace(/[?#].*/,"");Object.freeze(this)}return n.prototype.equals=function(t){return this===t||this.absoluteUri==n.toString(t)},n.from=function(t,r){var u=i.isString(t)?n.parse(t):t;return new n(u&&u.scheme||r&&r.scheme,u&&u.userInfo||r&&r.userInfo,u&&u.host||r&&r.host,u&&i.isNumber(u.port,!0)?u.port:r&&r.port,u&&u.path||r&&r.path,u&&u.query||r&&r.query,u&&u.fragment||r&&r.fragment)},n.parse=function(n,t){t===void 0&&(t=!0);var i=null,r=lt(n,function(n){i=n});if(t&&r)throw r;return i},n.tryParse=function(n,t){return!lt(n,t)},n.copyOf=function(n){return a(n)},n.prototype.copyTo=function(n){return a(this,n)},n.prototype.updateQuery=function(t){var i=this.toMap();return i.query=t,n.from(i)},n.prototype.getAbsoluteUri=function(){return ct(this)},n.prototype.getAuthority=function(){return k(this)},n.prototype.getPathAndQuery=function(){return ht(this)},Object.defineProperty(n.prototype,"pathSegments",{get:function(){return this.path&&this.path.match(/^[/]|[^/]*[/]|[^/]+$/g)||[]},enumerable:!0,configurable:!0}),n.prototype.toMap=function(){return this.copyTo({})},n.prototype.toString=function(){return this.absoluteUri},n.toString=function(t){return t instanceof n?t.absoluteUri:ct(t)},n.getAuthority=function(n){return k(n)},n}();n.Uri=it,function(n){n[n.scheme=0]="scheme";n[n.userInfo=1]="userInfo";n[n.host=2]="host";n[n.port=3]="port";n[n.path=4]="path";n[n.query=5]="query";n[n.fragment=6]="fragment"}(c=n.Fields||(n.Fields={}));Object.freeze(c);var y="/",rt="//",p=tt.Query,w="#",u="",ut="@";at=function(n){function t(t,i){i===void 0&&(i=!0);var r=n.call(this)||this;return r.importQuery(t,i),r}return __extends(t,n),t.init=function(n,i){return i===void 0&&(i=!0),new t(n,i)},t.prototype.importQuery=function(n,t){return t===void 0&&(t=!0),i.isString(n)?this.importFromString(n,t):e.Enumeration.isEnumerableOrArrayLike(n)?this.importEntries(n):this.importMap(n),this},t.prototype.importFromString=function(n,t,i){t===void 0&&(t=!0);i===void 0&&(i=!0);var r=this;return o(n,function(n,t){if(r.containsKey(n)){var i=r.getValue(n);i instanceof Array?i.push(t):r.setValue(n,[i,t])}else r.setValue(n,t)},t,i),this},t.prototype.encode=function(n){return d(this,n)},t.prototype.toString=function(){return this.encode()},t}(e.Dictionaries.OrderedStringKeyDictionary);n.QueryBuilder=at;n.encode=d;n.encodeValue=pt;n.isUriComponentFormattable=wt;n.parse=o;n.parseToMap=bt;n.parseToArray=dt}(ti=n.Uri||(n.Uri={})),function(n){function s(n,t){var s=n,h;switch(typeof s){case i.STRING:return s;case i.BOOLEAN:return s?u:f;case i.NUMBER:return r+s;default:if(s==null)return s;if(e(s))return s.serialize();if(t)return t;h=new o("Attempting to serialize unidentifiable type.");h.data.value=s;throw h;}}function e(n){return i.hasMemberOfType(n,"serialize",i.FUNCTION)}function h(n,t,e){var o,s,h;if(n){t&&(n=n.toLowerCase());switch(n){case"null":return null;case i.UNDEFINED:return void 0;case u:return!0;case f:return!1;default:if(o=n.replace(/^\s+|,|\s+$/g,r),o)if(/^\d+$/g.test(o)){if(s=parseInt(o),!isNaN(s))return s}else if(h=parseFloat(n),!isNaN(h))return h;e&&(n=e(n))}}return n}var o=t.InvalidOperationException,r="",u="true",f="false";n.toString=s;n.isSerializable=e;n.toPrimitive=h}(et=n.Serialization||(n.Serialization={})),function(n){var t="",f="i",v="g",o="m",y="u",c="w",p="y",k,s,l,r,h,u,a,w,d,b,g;(function(n){n.IGNORE_CASE=f;n.I=f;n.GLOBAL=v;n.G=v;n.MULTI_LINE=o;n.M=o;n.UNICODE=y;n.U=y;n.STICKY=p;n.Y=p;n.IGNORE_PATTERN_WHITESPACE=c;n.W=c})(k=n.RegexOptions||(n.RegexOptions={}));s=function(){function n(n,i){for(var a=[],u,r,h,y,v,l,s,p,e=2;e<arguments.length;e++)a[e-2]=arguments[e];if(!n)throw new Error("'pattern' cannot be null or empty.");if(r=(i&&(i instanceof Array?i:[i]).concat(a)||a).join(t).toLowerCase(),n instanceof RegExp?(h=n,h.ignoreCase&&r.indexOf(f)===-1&&(r+=f),h.multiline&&r.indexOf(o)===-1&&(r+=o),u=h.source):u=n,y=r.indexOf(c)!=-1,r=r.replace(/[gw]/g,t),v=[],l=u.match(/(?!\(\?<)(\w+)(?=>)/g),l){for(s=0,p=l.length;s<p;s++)v[s+1]=l[s];u=u.replace(/\?<\w+>/g,t);this._keys=v}y&&(u=u.replace(/\s+/g,"\\s*"));this._re=new RegExp(u,r);Object.freeze(this)}return n.prototype.match=function(n,t){var o,f,i,p,s,e,c;if(t===void 0&&(t=0),o=this,!n||t>=n.length||!(f=this._re.exec(n.substring(t))))return u.Empty;t>0||(t=0);var l=t+f.index,a=l,v=[],y={};for(i=0,p=f.length;i<p;++i)s=f[i],e=h,s!=null&&(e=new r(s,a),e.freeze()),i&&o._keys&&i<o._keys.length&&(y[o._keys[i]]=e),v.push(e),i!==0&&(a+=s.length);return c=new u(f[0],l,v,y),c.freeze(),c},n.prototype.matches=function(n){for(var i=[],t,r=0,u=n&&n.length||0;r<u&&(t=this.match(n,r))&&t.success;)i.push(t),r=t.index+t.length;return Object.freeze(i),i},n.prototype.replace=function(n,i,r){var o,c;if(r===void 0&&(r=Infinity),!n||i==null||!(r>0))return n;for(var e=[],u=0,s=n.length,l=typeof i=="function",f,h=0;h<r&&u<s&&(f=this.match(n,u))&&f.success;)o=f.index,c=f.length,u!==o&&e.push(n.substring(u,o)),e.push(l?i(f,h++):i),u=o+c;return u<s&&e.push(n.substring(u)),e.join(t)},n.prototype.isMatch=function(n){return this._re.test(n)},n.isMatch=function(t,i,r){var u=new n(i,r);return u.isMatch(t)},n.replace=function(t,i,r,u){var f=new n(i,u);return f.replace(t,r)},n}();n.Regex=s;l=function(){function n(n,i){n===void 0&&(n=t);i===void 0&&(i=-1);this.value=n;this.index=i}return Object.defineProperty(n.prototype,"length",{get:function(){var n=this.value;return n&&n.length||0},enumerable:!0,configurable:!0}),n.prototype.freeze=function(){Object.freeze(this)},n}();n.Capture=l;r=function(n){function i(i,r){return i===void 0&&(i=t),r===void 0&&(r=-1),n.call(this,i,r)||this}return __extends(i,n),Object.defineProperty(i.prototype,"success",{get:function(){return this.index!=-1},enumerable:!0,configurable:!0}),Object.defineProperty(i,"Empty",{get:function(){return h},enumerable:!0,configurable:!0}),i}(l);n.Group=r;h=new r;h.freeze();u=function(n){function i(i,r,u,f){i===void 0&&(i=t);r===void 0&&(r=-1);u===void 0&&(u=[]);f===void 0&&(f={});var e=n.call(this,i,r)||this;return e.groups=u,e.namedGroups=f,e}return __extends(i,n),i.prototype.freeze=function(){if(!this.groups)throw new Error("'groups' cannot be null.");if(!this.namedGroups)throw new Error("'groupMap' cannot be null.");Object.freeze(this.groups);Object.freeze(this.namedGroups);n.prototype.freeze.call(this)},Object.defineProperty(i,"Empty",{get:function(){return a},enumerable:!0,configurable:!0}),i}(r);n.Match=u;a=new u;a.freeze();w=function(){function n(n){this._pattern=n instanceof s?n:new s(n)}return n.prototype.matches=function(n){var i=this,t;return new e.Enumeration.EnumeratorBase(function(){t=0},function(r){var u=i._pattern.match(n,t);return u.success?(t=u.index+u.length,r.yieldReturn(u)):r.yieldBreak()})},n.matches=function(t,i){return t&&i?new n(i).matches(t):e.Enumeration.EmptyEnumerator},n}();n.RegexMatchEnumerator=w,function(n){function r(n,t,i){return i===void 0&&(i=f),i&&t>0?tt(i,t-n.length)+n:n}function u(n,t,i){return i===void 0&&(i=f),i&&t>0?n+tt(i,t-n.length):n}function o(n,u,f){if(f===void 0&&(f=e),!i.isNumber(n,!0))throw new Error("Cannot pad non-number.");return n||(n=0),r(n+t,u,f+t)}function s(n,r,f){if(f===void 0&&(f=e),!i.isNumber(n,!0))throw new Error("Cannot pad non-number.");return n||(n=0),u(n+t,r,f+t)}function h(n,t,u){if(i.isString(n))return r(n,t,u);if(i.isNumber(n,!0))return o(n,t,u);throw new Error("Invalid source type.");}function c(n,t,r){if(i.isString(n))return u(n,t,r);if(i.isNumber(n,!0))return s(n,t,r);throw new Error("Invalid source type.");}var f=" ",e="0";n.padStringLeft=r;n.padStringRight=u;n.padNumberLeft=o;n.padNumberRight=s;n.padLeft=h;n.padRight=c}(d=n.Padding||(n.Padding={}));b=function(){function n(){for(var i=[],t,n=0;n<arguments.length;n++)i[n]=arguments[n];t=this;t._latest=null;t._partArray=[];t.appendThese(i)}return n.prototype.appendSingle=function(n){if(n!=null){var t=this;t._latest=null;switch(typeof n){case i.OBJECT:case i.FUNCTION:n=n.toString()}t._partArray.push(n)}},n.prototype.appendThese=function(n){var t=this;return n.forEach(function(n){return t.appendSingle(n)}),t},n.prototype.append=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this.appendThese(t),this},n.prototype.appendLine=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this.appendLines(t),this},n.prototype.appendLines=function(n){var t=this;return n.forEach(function(n){n!=null&&(t.appendSingle(n),t._partArray.push("\r\n"))}),t},Object.defineProperty(n.prototype,"isEmpty",{get:function(){return this._partArray.length===0},enumerable:!0,configurable:!0}),n.prototype.toString=function(){var n=this._latest;return!n==null&&(this._latest=n=this._partArray.join()),n},n.prototype.join=function(n){return this._partArray.join(n)},n.prototype.clear=function(){this._partArray.length=0;this._latest=null},n.prototype.dispose=function(){this.clear()},n}();n.StringBuilder=b,function(n){var t=function(){function n(){}return n.GetBytes=function(n){for(var i=new ArrayBuffer(n.length*2),u=new Uint16Array(i),t=0,r=n.length;t<r;t++)u[t]=n.charCodeAt(t);return i},n.GetString=function(n){return String.fromCharCode.apply(null,new Uint16Array(n))},n}();n.UTF8=t;n.Unicode=t}(g=n.Encoding||(n.Encoding={}))}(ii=n.Text||(n.Text={})),function(n){var t=function(){function n(){}return n.UrlEncode=function(n){return encodeURI(n)},n.UrlDecode=function(n){return decodeURI(n)},n}();n.HttpUtility=t}(ri=n.Web||(n.Web={})),function(f){function w(n,t){return e.fromMilliseconds(n.getTotalMilliseconds(),t)}function s(n,t){return Math.abs(n)!==1&&(t+="s"),t}var e,a,v,o,b,h,c,p,l;(function(n){n[n.Ticks=0]="Ticks";n[n.Milliseconds=1]="Milliseconds";n[n.Seconds=2]="Seconds";n[n.Minutes=3]="Minutes";n[n.Hours=4]="Hours";n[n.Days=5]="Days"})(e=f.TimeUnit||(f.TimeUnit={})),function(n){function i(t,i){i===void 0&&(i=n.Milliseconds);switch(i){case n.Days:t*=24;case n.Hours:t*=60;case n.Minutes:t*=60;case n.Seconds:t*=1e3;case n.Milliseconds:return t;case n.Ticks:return t/1e4;default:throw new Error("Invalid TimeUnit.");}}function t(t,i){switch(i){case n.Days:return t/864e5;case n.Hours:return t/36e5;case n.Minutes:return t/6e4;case n.Seconds:return t/1e3;case n.Milliseconds:return t;case n.Ticks:return t*1e4;default:throw new Error("Invalid TimeUnit.");}}function r(n,i){return n&&t(n.getTotalMilliseconds(),i)}function u(t){if(isNaN(t)||t>n.Days||t<n.Ticks||Math.floor(t)!==t)throw new Error("Invalid TimeUnit.");return!0}n.toMilliseconds=i;n.fromMilliseconds=t;n.from=r;n.assertValid=u}(e=f.TimeUnit||(f.TimeUnit={}));a=u.areEqual;v=function(){function n(t,i){t===void 0&&(t=new Date);i===void 0&&(i=1);this._kind=i;t instanceof n?(this._value=t.toJsDate(),i===r&&(this._kind=t._kind)):this._value=t instanceof Date?new Date(t.getTime()):t===r?new Date:new Date(t)}return n.prototype.toJsDate=function(){return new Date(this._value.getTime())},Object.defineProperty(n.prototype,"kind",{get:function(){return this._kind},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"year",{get:function(){return this._value.getFullYear()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"month",{get:function(){return this._value.getMonth()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"calendarMonth",{get:function(){return this._value.getMonth()+1},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"calendar",{get:function(){return{year:this.year,month:this.calendarMonth,day:this.day}},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"day",{get:function(){return this._value.getDate()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"dayIndex",{get:function(){return this._value.getDate()-1},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"dayOfWeek",{get:function(){return this._value.getDay()},enumerable:!0,configurable:!0}),n.prototype.addMilliseconds=function(t){return t=t||0,new n(this._value.getTime()+t,this._kind)},n.prototype.addSeconds=function(n){return n=n||0,this.addMilliseconds(n*1e3)},n.prototype.addMinutes=function(n){return n=n||0,this.addMilliseconds(n*6e4)},n.prototype.addHours=function(n){return n=n||0,this.addMilliseconds(n*36e5)},n.prototype.addDays=function(n){return n=n||0,this.addMilliseconds(n*864e5)},n.prototype.addMonths=function(t){t=t||0;var i=this.toJsDate();return i.setMonth(i.getMonth()+t),new n(i,this._kind)},n.prototype.addYears=function(t){t=t||0;var i=this.toJsDate();return i.setFullYear(i.getFullYear()+t),new n(i,this._kind)},n.prototype.add=function(n){return this.addMilliseconds(n.getTotalMilliseconds())},n.prototype.subtract=function(n){return this.addMilliseconds(-n.getTotalMilliseconds())},n.prototype.timePassedSince=function(t){return n.between(t,this)},Object.defineProperty(n.prototype,"date",{get:function(){var t=this;return new n(new Date(t.year,t.month,t.day),t._kind)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"timeOfDay",{get:function(){var i=this,t=i._time,n;return t||(n=this._value,i._time=t=new h(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())),t},enumerable:!0,configurable:!0}),n.prototype.toTimeStamp=function(){return c.from(this)},Object.defineProperty(n,"now",{get:function(){return new n},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"toUniversalTime",{get:function(){var i=this,t;return i._kind!=1?new n(i,i._kind):(t=i._value,new n(new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds()),2))},enumerable:!0,configurable:!0}),n.prototype.equals=function(t,i){var r,u;return(i===void 0&&(i=!1),!t)?!1:t==this?!0:t instanceof Date?(r=this._value,t==r||t.getTime()==r.getTime()):t instanceof n?i&&(u=t._kind,!u&&this._kind||u!=this._kind)?!1:this.equals(t._value):i?!1:this.equals(t.toJsDate())},n.prototype.compareTo=function(i){if(!i)throw new t.ArgumentNullException("other");if(i===this)return 0;i instanceof n&&(i=i._value);var r=this._value.getTime();return i instanceof Date?r-i.getTime():r-i.toJsDate().getTime()},n.prototype.equivalent=function(t){if(!t)return!1;if(t==this)return!0;if(t instanceof Date){var i=this._value;return i.toUTCString()===t.toUTCString()}return t instanceof n&&this.equals(t,!0)?!0:this.equivalent(t.toJsDate())},Object.defineProperty(n,"today",{get:function(){return n.now.date},enumerable:!0,configurable:!0}),Object.defineProperty(n,"tomorrow",{get:function(){var t=n.today;return t.addDays(1)},enumerable:!0,configurable:!0}),n.between=function(t,i){var r=t instanceof n?t._value:t,u=i instanceof n?i._value:i;return new l(u.getTime()-r.getTime())},n.isLeapYear=function(n){return n%4==0&&n%100!=0||n%400==0},n.daysInMonth=function(n,t){return new Date(n,t+1,0).getDate()},n.from=function(t,i,r){i===void 0&&(i=0);r===void 0&&(r=1);var u;return typeof t=="object"?(r=t.day,i=t.month,u=t.year):u=t,new n(new Date(u,i,r))},n.fromCalendarDate=function(t,i,r){i===void 0&&(i=1);r===void 0&&(r=1);var u;return typeof t=="object"?(r=t.day,i=t.month,u=t.year):u=t,new n(new Date(u,i-1,r))},n}();f.DateTime=v;o=function(){function n(n){n===void 0&&(n=0);this._quantity=n;this._resetTotal()}return n.prototype.getTotalMilliseconds=function(){return this._quantity},Object.defineProperty(n.prototype,"direction",{get:function(){return u.compare(this.getTotalMilliseconds(),0)},enumerable:!0,configurable:!0}),n.prototype.equals=function(n){return a(this.getTotalMilliseconds(),n&&n.total&&n.total.milliseconds)},n.prototype.compareTo=function(n){return u.compare(this.getTotalMilliseconds(),n&&n.total&&n.total.milliseconds)},n.prototype._resetTotal=function(){var t=this,n=this._total;(!n||n.isValueCreated)&&(this._total=y.create(function(){var n=t.getTotalMilliseconds();return Object.freeze({ticks:n*1e4,milliseconds:n,seconds:n/1e3,minutes:n/6e4,hours:n/36e5,days:n/864e5})}))},Object.defineProperty(n.prototype,"total",{get:function(){return this._total.value},enumerable:!0,configurable:!0}),n.prototype.getTotal=function(n){return e.fromMilliseconds(this.getTotalMilliseconds(),n)},n}();f.TimeQuantity=o;b=function(n){function t(t,i){var r=n.call(this,typeof t=="number"?t:w(t,i))||this;return r._units=i,e.assertValid(i),r}return __extends(t,n),Object.defineProperty(t.prototype,"value",{get:function(){return this._quantity},set:function(n){this._quantity=n;this._resetTotal()},enumerable:!0,configurable:!0}),t.prototype.getTotalMilliseconds=function(){return e.toMilliseconds(this._quantity,this._units)},Object.defineProperty(t.prototype,"units",{get:function(){return this._units},enumerable:!0,configurable:!0}),t.prototype.to=function(n){return n===void 0&&(n=this.units),t.from(this,n)},t.from=function(n,i){return i===void 0&&(i=e.Milliseconds),new t(n,i)},t}(o);h=function(n){function t(){for(var r=[],f=0;f<arguments.length;f++)r[f]=arguments[f];var i=n.call(this,r.length>1?t.millisecondsFromTime(r[0]||0,r[1]||0,r.length>2&&r[2]||0,r.length>3&&r[3]||0):r.length>0&&r[0]||0)||this,e=Math.abs(i.getTotalMilliseconds()),u=Math.floor(e);return i.tick=(e-u)*1e4,i.days=u/864e5|0,u-=i.days*864e5,i.hour=u/36e5|0,u-=i.hour*36e5,i.minute=u/6e4|0,u-=i.minute*6e4,i.second=u/1e3|0,u-=i.second*1e3,i.millisecond=u,Object.freeze(i),i}return __extends(t,n),t.from=function(n,i,r,u){return r===void 0&&(r=0),u===void 0&&(u=0),new t(n,i,r,u)},t.millisecondsFromTime=function(n,t,i,r){i===void 0&&(i=0);r===void 0&&(r=0);var u=n;return u*=60,u+=t,u*=60,u+=i,u*=1e3,u+r},t.prototype.toString=function(){var n=this,t=[];return n.days&&t.push(s(n.days,"day")),n.hour&&t.push(s(n.hour,"hour")),n.minute&&t.push(s(n.minute,"minute")),n.second&&t.push(s(n.second,"second")),t.length>1&&t.splice(t.length-1,0,"and"),t.join(", ").replace(", and, "," and ")},t}(o);f.ClockTime=h;c=function(){function t(n,t,i,r,u,f,e,o){i===void 0&&(i=1);r===void 0&&(r=0);u===void 0&&(u=0);f===void 0&&(f=0);e===void 0&&(e=0);o===void 0&&(o=0);this.year=n;this.month=t;this.day=i;this.hour=r;this.minute=u;this.second=f;this.millisecond=e;this.tick=o;Object.freeze(this)}return t.prototype.toJsDate=function(){var n=this;return new Date(n.year,n.month,n.day,n.hour,n.minute,n.second,n.millisecond+n.tick/1e4)},t.from=function(i){if(i instanceof Date||!n.Type.hasMember(i,"toJsDate")||(i=i.toJsDate()),i instanceof Date)return new t(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds());throw Error("Invalid date type.");},t}();f.TimeStamp=c;l=function(n){function t(t,i){i===void 0&&(i=e.Milliseconds);var r=this,u=e.toMilliseconds(t,i);return r=n.call(this,u)||this,r.ticks=u*1e4,r.milliseconds=u,r.seconds=u/1e3,r.minutes=u/6e4,r.hours=u/36e5,r.days=u/864e5,r._time=y.create(function(){return new h(r.getTotalMilliseconds())}),Object.freeze(r),r}return __extends(t,n),Object.defineProperty(t.prototype,"total",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){return this._time.value},enumerable:!0,configurable:!0}),t.prototype.add=function(n){if(i.isNumber(n))throw new Error("Use .addUnit(value:number,units:TimeUnit) to add a numerical value amount.  Default units are milliseconds.\n.add only supports quantifiable time values (ITimeTotal).");return new t(this.getTotalMilliseconds()+n.total.milliseconds)},t.prototype.addUnit=function(n,i){return i===void 0&&(i=e.Milliseconds),new t(this.getTotalMilliseconds()+e.toMilliseconds(n,i))},t.from=function(n,i){return new t(n,i)},t.fromDays=function(n){return new t(n,e.Days)},t.fromHours=function(n){return new t(n,e.Hours)},t.fromMinutes=function(n){return new t(n,e.Minutes)},t.fromSeconds=function(n){return new t(n,e.Seconds)},t.fromMilliseconds=function(n){return new t(n,e.Milliseconds)},t.fromTicks=function(n){return new t(n,e.Ticks)},Object.defineProperty(t,"zero",{get:function(){return p||(p=new t(0))},enumerable:!0,configurable:!0}),t}(o);f.TimeSpan=l}(yt=n.Time||(n.Time={})),function(n){function i(){return(new Date).getTime()}var t=yt.TimeSpan,r=function(){function n(){this.reset()}return n.getTimestampMilliseconds=function(){return i()},Object.defineProperty(n.prototype,"isRunning",{get:function(){return this._isRunning},enumerable:!0,configurable:!0}),n.startNew=function(){var t=new n;return t.start(),t},n.measure=function(n){var r=i();return n(),new t(i()-r)},n.prototype.start=function(){var n=this;n._isRunning||(n._startTimeStamp=i(),n._isRunning=!0)},n.prototype.stop=function(){var n=this;n._isRunning&&(n._elapsed+=n.currentLapMilliseconds,n._isRunning=!1)},n.prototype.restart=function(){this.stop();this.start()},n.prototype.reset=function(){var n=this;n._elapsed=0;n._isRunning=!1;n._startTimeStamp=NaN},n.prototype.lap=function(){var n=this;if(n._isRunning){var r=i(),f=n._startTimeStamp,u=r-f;return n._startTimeStamp=r,n._elapsed+=u,new t(u)}return t.zero},Object.defineProperty(n.prototype,"currentLapMilliseconds",{get:function(){return this._isRunning?i()-this._startTimeStamp:0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"currentLap",{get:function(){return this._isRunning?new t(this.currentLapMilliseconds):t.zero},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"elapsedMilliseconds",{get:function(){var n=this,t=n._elapsed;return n._isRunning&&(t+=n.currentLapMilliseconds),t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"elapsed",{get:function(){return new t(this.elapsedMilliseconds)},enumerable:!0,configurable:!0}),n}();n.Stopwatch=r}(ui=n.Diagnostics||(n.Diagnostics={})),function(n){function t(n){return n===32||n>=9&&n<=13||n===133||n===160}function i(n){return 65<=n&&n<=90||97<=n&&n<=122||n>=128&&n!==133&&n!==160}function r(n){return 48<=n&&n<=57||65<=n&&n<=90||97<=n&&n<=122||n>=128&&n!==133&&n!==160}function u(n,t){if(arguments.length===1)return 48<=n&&n<=57;var i=n.charCodeAt(t);return 48<=i&&i<=57}n.isWhiteSpace=t;n.isLetter=i;n.isLetterOrDigit=r;n.isDigit=u}(fi=n.Char||(n.Char={}))}(System||(System={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){function ri(){return 0}function ui(){return 1}function tt(n){return n!=null}function et(){return rt}function ht(n,t){if(t)if(t.moveNext())n.enqueue(t);else return t&&t.dispose(),null;return t}function ct(n,t){t===void 0&&(t=null);var i=new dt(t,n.keySelector,n.order,n.comparer);return n.parent?ct(n.parent,i):i}function u(n){if(n)throw new wt("Enumerable");return!0}function h(n){for(var i=[],t=1;t<arguments.length;t++)i[t-1]=arguments[t];return it(n,i)}function it(n,t){var i=h.fromAny(n);if(!i)throw new yt;return t&&t.length?i.merge(t):i}var rt=n.Collections.Enumeration.EmptyEnumerator,r=n.Collections.Enumeration.EnumeratorBase,o=n.Collections.Enumeration,nt=n.Collections.Enumeration.ArrayEnumerator,w=n.Collections.Enumeration.throwIfEndless,lt=n.Collections.Enumeration.IndexEnumerator,at=n.Collections.Enumeration.isEnumerator,vt=n.Collections.Enumeration.isIterator,yt=n.Collections.Enumeration.UnsupportedEnumerableException,pt=n.Disposable.DisposableBase,wt=n.Disposable.ObjectDisposedException,p=n.Disposable.using,ut=n.Disposable.dispose,bt=n.Disposable.disposeSingle,b=n.Collections.Dictionaries.Dictionary,k=n.Collections.Queue,kt=n.Collections.ArrayModule.initialize,dt=n.Collections.Sorting.KeySortedContext,gt=n.Collections.LazyList,ni=n.Collections.ArrayModule,ft=n.Collections.ArrayModule.copy,ti=n.Functions,s=n.Exceptions.ArgumentNullException,c=n.Exceptions.ArgumentOutOfRangeException,a=n.Compare.areEqual,ii=n.Compare.compare,d={},l=void 0,i=null,fi=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.prototype.Greater=function(n,t){return n>t?n:t},t.prototype.Lesser=function(n,t){return n<t?n:t},t}(ti),e=Object.freeze(new fi),v=function(t){function v(n,i){var r=t.call(this,i)||this;return r._enumeratorFactory=n,r._isEndless=!0,r._disposableObjectName="InfiniteLinqEnumerable",r}return __extends(v,t),Object.defineProperty(v.prototype,"isEndless",{get:function(){return this._isEndless},enumerable:!0,configurable:!0}),v.prototype.getEnumerator=function(){return this.throwIfDisposed(),this._enumeratorFactory()},v.prototype._onDispose=function(){t.prototype._onDispose.call(this);this._enumeratorFactory=null},v.prototype.asEnumerable=function(){var n=this;return n.throwIfDisposed(),new v(function(){return n.getEnumerator()})},v.prototype.doAction=function(n,t,e,o){var c=this,h;if(c.throwIfDisposed(),h=e||undefined,!n)throw new s("action");return new f(function(){var i,f=0;return new r(function(){u(!n);t&&t();f=0;i=c.getEnumerator()},function(t){for(u(!n);i.moveNext();){var e=i.current,r=n(e,f++);if(r===!1||r===0)return t.yieldBreak();if(r!==2)return t.yieldReturn(e)}return o&&o(f),!1},function(){i&&i.dispose()},h)},function(){n=i},h)},v.prototype.force=function(){this.throwIfDisposed();this.doAction(ri).getEnumerator().moveNext()},v.prototype.skip=function(t){var i=this;return(i.throwIfDisposed(),!isFinite(t))?new v(et):(n.Integer.assert(t,"count"),this.where(function(n,i){return i>=t}))},v.prototype.take=function(t){if(!(t>0))return h.empty();var i=this;if(i.throwIfDisposed(),!isFinite(t))throw new c("count",t,"Must be finite.");return n.Integer.assert(t,"count"),i.doAction(function(n,i){return i<t},null,!1)},v.prototype.elementAt=function(n){var t=this.elementAtOrDefault(n,d);if(t===d)throw new c("index",n,"is greater than or equal to the number of elements in source");return t},v.prototype.elementAtOrDefault=function(t,i){var u=this,r;return u.throwIfDisposed(),n.Integer.assertZeroOrGreater(t,"index"),r=t,p(this.getEnumerator(),function(n){for(var t=0;n.moveNext();){if(t==r)return n.current;t++}return i})},v.prototype.first=function(){var n=this.firstOrDefault(d);if(n===d)throw new Error("first:The sequence is empty.");return n},v.prototype.firstOrDefault=function(n){var t=this;return t.throwIfDisposed(),p(this.getEnumerator(),function(t){return t.moveNext()?t.current:n})},v.prototype.single=function(){var n=this;return n.throwIfDisposed(),p(this.getEnumerator(),function(n){if(n.moveNext()){var t=n.current;if(!n.moveNext())return t;throw new Error("single:sequence contains more than one element.");}throw new Error("single:The sequence is empty.");})},v.prototype.singleOrDefault=function(n){var t=this;return t.throwIfDisposed(),p(this.getEnumerator(),function(t){if(t.moveNext()){var i=t.current;if(!t.moveNext())return i}return n})},v.prototype.any=function(){var n=this;return n.throwIfDisposed(),p(this.getEnumerator(),function(n){return n.moveNext()})},v.prototype.isEmpty=function(){return!this.any()},v.prototype.traverseDepthFirst=function(t,o){o===void 0&&(o=e.Identity);var s=this,c=!s.throwIfDisposed(),l=s._isEndless;return new f(function(){var e,f,a;return new r(function(){u(c);f=s.getEnumerator();e=[];a=0},function(i){var l,r,s;for(u(c);;){if(f.moveNext())return l=o(f.current,a),e[a++]=f,r=t(f.current),s=!n.Type.isString(r)&&h.fromAny(r),f=s?s.getEnumerator():rt,i.yieldReturn(l);if(a==0)return!1;f.dispose();f=e[--a];e.length=a}},function(){try{f&&f.dispose()}finally{e&&(ut.these.noCopy(e),e.length=0,e=i)}},l)},function(){c=!0},l)},v.prototype.flatten=function(){return this.selectMany(function(t){var i=!n.Type.isString(t)&&h.fromAny(t);return i?i.flatten():[t]})},v.prototype.pairwise=function(n){var r=this,t;if(r.throwIfDisposed(),!n)throw new s("selector");return this.select(function(r,u){var f=u?n(t,r,u):i;return t=r,f}).skip(1)},v.prototype.scan=function(n,t){var i=this;if(i.throwIfDisposed(),!n)throw new s("func");return t===l?this.select(function(i,r){return t=r?n(t,i,r):i}):this.select(function(i,r){return t=n(t,i,r)})},v.prototype.select=function(n){return this._filterSelected(n)},v.prototype._selectMany=function(n,t){var e=this,h;if(e.throwIfDisposed(),!n)throw new s("collectionSelector");return h=e._isEndless,t||(t=function(n,t){return t}),new f(function(){var s,f,c=0;return new r(function(){u(!n);s=e.getEnumerator();f=l;c=0},function(i){if(u(!n),f===l&&!s.moveNext())return!1;do{if(!f){var r=n(s.current,c++);if(!r)continue;f=o.from(r)}if(f.moveNext())return i.yieldReturn(t(s.current,f.current));f.dispose();f=null}while(s.moveNext());return!1},function(){s&&s.dispose();bt(f,!1);s=i;f=null},h)},function(){n=i},h)},v.prototype.selectMany=function(n,t){return this._selectMany(n,t)},v.prototype._filterSelected=function(n,t){n===void 0&&(n=e.Identity);var i=this,o=!i.throwIfDisposed();if(!n)throw new s("selector");return new f(function(){var f,e=0;return new r(function(){u(!n);e=0;f=i.getEnumerator()},function(i){for(u(o);f.moveNext();){var r=e++,s=n(f.current,r);if(!t||t(s,r++))return i.yieldReturn(s)}return!1},function(){f&&f.dispose()},i._isEndless)},function(){o=!1},i._isEndless)},v.prototype.choose=function(n){return n===void 0&&(n=e.Identity),this._filterSelected(n,tt)},v.prototype.where=function(n){return this._filterSelected(e.Identity,n)},v.prototype.nonNull=function(){return this.where(function(n){return n!=null&&n!=l})},v.prototype.ofType=function(t){var i;switch(t){case Number:i=n.Type.NUMBER;break;case String:i=n.Type.STRING;break;case Boolean:i=n.Type.BOOLEAN;break;case Function:i=n.Type.FUNCTION;break;default:return this.where(function(n){return n instanceof t})}return this.where(function(n){return tt(n)&&typeof n===i})},v.prototype.except=function(n,t){var i=this,e=!i.throwIfDisposed(),s=i._isEndless;return new f(function(){var f,h;return new r(function(){u(e);f=i.getEnumerator();h=new b(t);n&&o.forEach(n,function(n){h.addByKeyValue(n,!0)})},function(n){for(u(e);f.moveNext();){var t=f.current;if(!h.containsKey(t))return h.addByKeyValue(t,!0),n.yieldReturn(t)}return!1},function(){f&&f.dispose();h.clear()},s)},function(){e=!0},s)},v.prototype.distinct=function(n){return this.except(i,n)},v.prototype.distinctUntilChanged=function(n){n===void 0&&(n=e.Identity);var t=this,i=!t.throwIfDisposed(),o=t._isEndless;return new f(function(){var f,e,s=!0;return new r(function(){u(i);f=t.getEnumerator()},function(t){for(u(i);f.moveNext();){var r=n(f.current);if(s)s=!1;else if(a(e,r))continue;return e=r,t.yieldReturn(f.current)}return!1},function(){f&&f.dispose()},o)},function(){i=!0},o)},v.prototype.defaultIfEmpty=function(n){var t=this,e=!t.throwIfDisposed(),o=t._isEndless;return new f(function(){var f,s;return new r(function(){s=!0;u(e);f=t.getEnumerator()},function(t){return(u(e),f.moveNext())?(s=!1,t.yieldReturn(f.current)):s?(s=!1,t.yieldReturn(n)):!1},function(){f&&f.dispose();f=i},o)},null,o)},v.prototype.zip=function(n,t){var u=this;return u.throwIfDisposed(),new f(function(){var f,e,s=0;return new r(function(){s=0;f=u.getEnumerator();e=o.from(n)},function(n){return f.moveNext()&&e.moveNext()&&n.yieldReturn(t(f.current,e.current,s++))},function(){f&&f.dispose();e&&e.dispose();f=i;e=i})})},v.prototype.zipMultiple=function(n,t){var u=this;return(u.throwIfDisposed(),!n.length)?h.empty():new f(function(){var e,s,f,h=0;return new r(function(){e=new k(n);h=0;s=u.getEnumerator();f=i},function(n){if(s.moveNext())for(;;){while(!f)if(e.count){var r=e.dequeue();r&&(f=o.from(r))}else return n.yieldBreak();if(f.moveNext())return n.yieldReturn(t(s.current,f.current,h++));f.dispose();f=i}return n.yieldBreak()},function(){s&&s.dispose();f&&f.dispose();e&&e.dispose();s=i;f=i;e=i})})},v.prototype.join=function(n,t,u,o,s){s===void 0&&(s=e.Identity);var c=this;return new f(function(){var f,v,a,y=0;return new r(function(){f=c.getEnumerator();v=h.from(n).toLookup(u,e.Identity,s)},function(n){for(var i,r;;){if(a){if(i=a[y++],i!==l)return n.yieldReturn(o(f.current,i));a=null;y=0}if(f.moveNext())r=t(f.current),a=v.get(r);else return n.yieldBreak()}},function(){f&&f.dispose();a=null;f=i;v=i})})},v.prototype.groupJoin=function(n,t,u,o,s){s===void 0&&(s=e.Identity);var c=this;return new f(function(){var f,l;return new r(function(){f=c.getEnumerator();l=h.from(n).toLookup(u,e.Identity,s)},function(n){return f.moveNext()&&n.yieldReturn(o(f.current,l.get(t(f.current))))},function(){f&&f.dispose();f=i;l=i})})},v.prototype.merge=function(n){var t=this,u=t._isEndless;return!n||n.length==0?t:new f(function(){var f,e;return new r(function(){f=t.getEnumerator();e=new k(n)},function(n){for(;;){while(!f&&e.tryDequeue(function(n){f=o.from(n)}));if(f&&f.moveNext())return n.yieldReturn(f.current);if(f){f.dispose();f=i;continue}return n.yieldBreak()}},function(){f&&f.dispose();f=i;e&&e.dispose();e=i},u)},null,u)},v.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this.merge(t)},v.prototype.union=function(n,t){t===void 0&&(t=e.Identity);var u=this,s=u._isEndless;return new f(function(){var e,f,h;return new r(function(){e=u.getEnumerator();h=new b(t)},function(t){var i;if(f===l){while(e.moveNext())if(i=e.current,!h.containsKey(i))return h.addByKeyValue(i,null),t.yieldReturn(i);f=o.from(n)}while(f.moveNext())if(i=f.current,!h.containsKey(i))return h.addByKeyValue(i,null),t.yieldReturn(i);return!1},function(){e&&e.dispose();f&&f.dispose();e=i;f=i},s)},null,s)},v.prototype.insertAt=function(t,u){var h,e,s;return n.Integer.assertZeroOrGreater(t,"index"),h=t,e=this,e.throwIfDisposed(),s=e._isEndless,new f(function(){var t,n,f=0,c=!1;return new r(function(){f=0;t=e.getEnumerator();n=o.from(u);c=!1},function(i){return f==h&&(c=!0,n.moveNext())?i.yieldReturn(n.current):t.moveNext()?(f++,i.yieldReturn(t.current)):!c&&n.moveNext()&&i.yieldReturn(n.current)},function(){t&&t.dispose();t=i;n&&n.dispose();n=i},s)},null,s)},v.prototype.alternateMultiple=function(n){var t=this,u=t._isEndless;return new f(function(){var s,o,f,e;return new r(function(){e=new nt(h.toArray(n));f=t.getEnumerator();var i=f.moveNext();o=i?1:0;i&&(s=f.current)},function(n){switch(o){case 0:return n.yieldBreak();case 2:if(e.moveNext())return n.yieldReturn(e.current);e.reset();o=1}var i=s,t=f.moveNext();return o=t?2:0,t&&(s=f.current),n.yieldReturn(i)},function(){f&&f.dispose();e&&e.dispose();f=i;e=i},u)},null,u)},v.prototype.alternateSingle=function(n){return this.alternateMultiple(h.make(n))},v.prototype.alternate=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this.alternateMultiple(t)},v.prototype.catchError=function(n){var t=this,e=!t.throwIfDisposed();return new f(function(){var f;return new r(function(){try{u(e);f=t.getEnumerator()}catch(n){}},function(t){if(f)try{if(u(e),f.moveNext())return t.yieldReturn(f.current)}catch(i){n(i)}return!1},function(){f&&f.dispose();f=i})})},v.prototype.finallyAction=function(n){var t=this,e=!t.throwIfDisposed();return new f(function(){var f;return new r(function(){u(e);f=t.getEnumerator()},function(n){return u(e),f.moveNext()?n.yieldReturn(f.current):!1},function(){try{f&&f.dispose();f=i}finally{n()}})})},v.prototype.buffer=function(t){if(t<1||!isFinite(t))throw new Error("Invalid buffer size.");n.Integer.assert(t,"size");var e=this,o=e._isEndless,u;return new f(function(){var n;return new r(function(){n=e.getEnumerator()},function(i){var r=kt(t);for(u=0;u<t&&n.moveNext();)r[u++]=n.current;return r.length=u,!!u&&i.yieldReturn(r)},function(){n&&n.dispose();n=i},o)},null,o)},v.prototype.share=function(){var t=this,n;return t.throwIfDisposed(),new f(function(){return n||(n=t.getEnumerator())},function(){n&&n.dispose();n=i},t._isEndless)},v}(pt),f,y;t.InfiniteLinqEnumerable=v;f=function(t){function f(n,i,r){var u=t.call(this,n,i)||this;return u._isEndless=r,u._disposableObjectName="LinqEnumerable",u}return __extends(f,t),f.prototype.asEnumerable=function(){var n=this;return n.throwIfDisposed(),new f(function(){return n.getEnumerator()})},f.prototype.skip=function(n){return t.prototype.skip.call(this,n)},f.prototype.skipWhile=function(n){return this.throwIfDisposed(),this.doAction(function(t,i){return n(t,i)?2:1})},f.prototype.takeWhile=function(n){if(this.throwIfDisposed(),!n)throw new s("predicate");return this.doAction(function(t,i){return n(t,i)?1:0},null,null)},f.prototype.takeUntil=function(n,t){if(this.throwIfDisposed(),!n)throw new s("predicate");if(!t)return this.doAction(function(t,i){return n(t,i)?0:1},null,null);var i=!1;return this.doAction(function(t,r){return i?0:(i=n(t,r),1)},function(){i=!1},null)},f.prototype.traverseBreadthFirst=function(n,t){t===void 0&&(t=e.Identity);var o=this,s=!o.throwIfDisposed(),c=o._isEndless;return new f(function(){var f,a=0,e,l;return new r(function(){u(s);f=o.getEnumerator();a=0;e=[];l=0},function(i){for(u(s);;){if(f.moveNext())return e[l++]=f.current,i.yieldReturn(t(f.current,a));if(!l)return i.yieldBreak();var r=h.from(e).selectMany(n);if(r.any())a++,e=[],l=0,f.dispose(),f=r.getEnumerator();else return i.yieldBreak()}},function(){f&&f.dispose();f=i;e.length=0},c)},function(){s=!0},c)},f.prototype.forEach=function(n,t){t===void 0&&(t=Infinity);var i=this;if(i.throwIfDisposed(),!n)throw new s("action");return w(i.isEndless),t>0?p(i.getEnumerator(),function(r){w(!isFinite(t)&&r.isEndless);for(var u=0;t>u&&i.throwIfDisposed()&&r.moveNext();)if(n(r.current,u++)===!1)break;return u}):0},f.prototype.toArray=function(n){return n?this.where(n).toArray():this.copyTo([])},f.prototype.toList=function(t){var i=this.toArray(t);return new n.Collections.List(i)},f.prototype.copyTo=function(t,i,r){if(i===void 0&&(i=0),r===void 0&&(r=Infinity),this.throwIfDisposed(),!t)throw new s("target");return n.Integer.assertZeroOrGreater(i),o.forEach(this,function(n,r){t[r+i]=n},r),t},f.prototype.toLookup=function(n,t,i){t===void 0&&(t=e.Identity);i===void 0&&(i=e.Identity);var r=new b(i);return this.forEach(function(i,u){var f=n(i,u),e=t(i,u),o=r.getValue(f);o!==l?o.push(e):r.addByKeyValue(f,[e])}),new ei(r)},f.prototype.toMap=function(n,t){var i={};return this.forEach(function(r,u){i[n(r,u)]=t(r,u)}),i},f.prototype.toDictionary=function(n,t,i){i===void 0&&(i=e.Identity);var r=new b(i);return this.forEach(function(i,u){return r.addByKeyValue(n(i,u),t(i,u))}),r},f.prototype.toJoinedString=function(n,t){return n===void 0&&(n=""),t===void 0&&(t=e.Identity),this.select(t).toArray().join(n)},f.prototype.takeExceptLast=function(t){var u,e;return(t===void 0&&(t=1),u=this,!(t>0))?u:isFinite(t)?(n.Integer.assert(t,"count"),e=t,new f(function(){var t,n;return new r(function(){t=u.getEnumerator();n=new k},function(i){while(t.moveNext())if(n.enqueue(t.current),n.count>e)return i.yieldReturn(n.dequeue());return!1},function(){t&&t.dispose();t=i;n&&n.dispose();n=i})})):h.empty()},f.prototype.skipToLast=function(t){if(!(t>0))return h.empty();var i=this;return isFinite(t)?(n.Integer.assert(t,"count"),i.reverse().take(t).reverse()):i},f.prototype.select=function(n){return t.prototype.select.call(this,n)},f.prototype.selectMany=function(n,t){return this._selectMany(n,t)},f.prototype.choose=function(n){return n===void 0&&(n=e.Identity),this._filterSelected(n,tt)},f.prototype.reverse=function(){var n=this,t=!n.throwIfDisposed();return w(n._isEndless),new f(function(){var i,f=0;return new r(function(){u(t);n.throwIfDisposed();i=n.toArray();f=i.length},function(n){return!!f&&n.yieldReturn(i[--f])},function(){i.length=0})},function(){t=!0})},f.prototype.shuffle=function(){var t=this,e=!t.throwIfDisposed();return w(t._isEndless),new f(function(){var f,s,o;return new r(function(){u(e);f=t.toArray();s=o=f.length},function(t){if(!o)return t.yieldBreak();var r=n.Random.integer(o),u=f[r];return f[r]=f[--o],f[o]=i,o%32==0&&(f.length=o),t.yieldReturn(u)},function(){f.length=0})},function(){e=!0})},f.prototype.count=function(n){var t=0;return this.forEach(n?function(i,r){n(i,r)&&++t}:function(){++t}),t},f.prototype.all=function(n){if(!n)throw new s("predicate");var t=!0;return this.forEach(function(i,r){if(!n(i,r))return t=!1,!1}),t},f.prototype.every=function(n){return this.all(n)},f.prototype.any=function(n){if(!n)return t.prototype.any.call(this);var i=!1;return this.forEach(function(t,r){return i=n(t,r),!i}),i},f.prototype.some=function(n){return this.any(n)},f.prototype.contains=function(n,t){if(t){var i=t(n);return this.any(function(n){return a(t(n),i)})}return this.any(function(t){return a(t,n)})},f.prototype.indexOf=function(n,t){var i=-1;return this.forEach(t?function(r,u){if(a(t(r,u),t(n,u),!0))return i=u,!1}:function(t,r){if(a(t,n,!0))return i=r,!1}),i},f.prototype.lastIndexOf=function(n,t){var i=-1;return this.forEach(t?function(r,u){a(t(r,u),t(n,u),!0)&&(i=u)}:function(t,r){a(t,n,!0)&&(i=r)}),i},f.prototype.intersect=function(n,t){var e=this,h;if(e.throwIfDisposed(),!n)throw new s("second");return h=e.isEndless,new f(function(){var f,s,c;return new r(function(){u(!n);f=e.getEnumerator();s=new b(t);c=new b(t);o.forEach(n,function(n){s.addByKeyValue(n,!0)})},function(n){while(f.moveNext()){var t=f.current;if(!c.containsKey(t)&&s.containsKey(t))return c.addByKeyValue(t,!0),n.yieldReturn(t)}return n.yieldBreak()},function(){f&&f.dispose();s&&f.dispose();c&&f.dispose();f=i;s=i;c=i},h)},function(){n=i},h)},f.prototype.sequenceEqual=function(n,t){return t===void 0&&(t=a),this.throwIfDisposed(),p(this.getEnumerator(),function(i){return p(o.from(n),function(n){for(w(i.isEndless&&n.isEndless);i.moveNext();)if(!n.moveNext()||!t(i.current,n.current))return!1;return!n.moveNext()})})},f.prototype.ofType=function(n){return this.throwIfDisposed(),t.prototype.ofType.call(this,n)},f.prototype.orderBy=function(n){return n===void 0&&(n=e.Identity),this.throwIfDisposed(),new g(this,n,1)},f.prototype.orderUsing=function(n){return this.throwIfDisposed(),new g(this,null,1,null,n)},f.prototype.orderUsingReversed=function(n){return this.throwIfDisposed(),new g(this,null,-1,null,n)},f.prototype.orderByDescending=function(n){return n===void 0&&(n=e.Identity),this.throwIfDisposed(),new g(this,n,-1)},f.prototype.buffer=function(n){return t.prototype.buffer.call(this,n)},f.prototype.groupBy=function(n,t,i){var r=this;return t||(t=e.Identity),new f(function(){return r.toLookup(n,t,i).getEnumerator()})},f.prototype.partitionBy=function(n,t,o,s){o===void 0&&(o=function(n,t){return new st(n,t)});s===void 0&&(s=e.Identity);var h=this;return t||(t=e.Identity),new f(function(){var f,c,l,e,v;return new r(function(){if(u(!t),f=h.getEnumerator(),f.moveNext()){var i=f.current;c=n(i);l=s(c);e=[t(i)];v=1}else e=null},function(i){var h,r,y;if(u(!t),!e)return i.yieldBreak();while(h=f.moveNext())if(r=f.current,a(l,s(n(r))))e[v++]=t(r);else break;return y=o(c,e),h?(r=f.current,c=n(r),l=s(c),e=[t(r)],v=1):e=null,i.yieldReturn(y)},function(){f&&f.dispose();f=i;e=null})},function(){t=i})},f.prototype.flatten=function(){return t.prototype.flatten.call(this)},f.prototype.pairwise=function(n){return t.prototype.pairwise.call(this,n)},f.prototype.aggregate=function(n,t){return this.forEach(function(i,r){t=r?n(t,i,r):i}),t},f.prototype.average=function(t){t===void 0&&(t=n.Type.numberOrNaN);var i=0,r=this.sum(function(n,r){return i++,t(n,r)});return isNaN(r)||!i?NaN:r/i},f.prototype.max=function(){return this.aggregate(e.Greater)},f.prototype.min=function(){return this.aggregate(e.Lesser)},f.prototype.maxBy=function(n){return n===void 0&&(n=e.Identity),this.aggregate(function(t,i){return n(t)>n(i)?t:i})},f.prototype.minBy=function(n){return n===void 0&&(n=e.Identity),this.aggregate(function(t,i){return n(t)<n(i)?t:i})},f.prototype.sum=function(t){t===void 0&&(t=n.Type.numberOrNaN);var i=0,r=0;return this.forEach(function(n,u){var f=t(n,u);f=Joove.Common.parseToNumber(f);isNaN(f)&&(f=0);isFinite(f)?i+=Number(f):r+=f>0?1:-1}),isNaN(i)?0:r?r*Infinity:i},f.prototype.product=function(t){t===void 0&&(t=n.Type.numberOrNaN);var i=1,r=!1;return this.forEach(function(n,u){r=!0;var f=t(n,u);if(isNaN(f))return i=NaN,!1;if(f==0)return i=0,!1;i*=f}),r&&isNaN(i)?NaN:i},f.prototype.quotient=function(t){t===void 0&&(t=n.Type.numberOrNaN);var r=0,i=NaN;return this.forEach(function(n,u){var f=t(n,u);if(r++,r===1)i=f;else{if(isNaN(f)||f===0||!isFinite(f))return i=NaN,!1;i/=f}}),r===1&&(i=NaN),i},f.prototype.last=function(){var i=this,n,t;if(i.throwIfDisposed(),n=l,t=!1,i.forEach(function(i){t=!0;n=i}),!t)throw new Error("last:No element satisfies the condition.");return n},f.prototype.lastOrDefault=function(n){var r=this,t,i;return r.throwIfDisposed(),t=l,i=!1,r.forEach(function(n){i=!0;t=n}),i?t:n},f.prototype.memoize=function(){var n=new gt(this);return new f(function(){return n.getEnumerator()},function(){n.dispose();n=null},this.isEndless)},f.prototype.throwWhenEmpty=function(){return this.doAction(ui,null,this.isEndless,function(n){if(!n)throw"Collection is empty.";})},f}(v);t.LinqEnumerable=f;y=function(n){function t(t,i){var r=n.call(this,t,i,!1)||this;return r._disposableObjectName="FiniteEnumerable",r}return __extends(t,n),t}(f);t.FiniteEnumerable=y;var ot=function(t){function r(n){var r=t.call(this,function(){return i.throwIfDisposed(),new nt(function(){return i.throwIfDisposed("The underlying ArrayEnumerable was disposed.","ArrayEnumerator"),i._source})})||this,i=r;return i._disposableObjectName="ArrayEnumerable",i._source=n,r}return __extends(r,t),r.prototype._onDispose=function(){t.prototype._onDispose.call(this);this._source=i},Object.defineProperty(r.prototype,"source",{get:function(){return this._source},enumerable:!0,configurable:!0}),r.prototype.toArray=function(){var n=this;return n.throwIfDisposed(),o.toArray(n._source)},r.prototype.asEnumerable=function(){var n=this;return n.throwIfDisposed(),new r(this._source)},r.prototype.forEach=function(n,t){t===void 0&&(t=Infinity);var i=this;return i.throwIfDisposed(),o.forEach(i._source,n,t)},r.prototype.any=function(n){var i=this,r,u;return i.throwIfDisposed(),r=i._source,u=r.length,!!u&&(!n||t.prototype.any.call(this,n))},r.prototype.count=function(n){var r=this,u,i;return r.throwIfDisposed(),u=r._source,i=u.length,i&&(n?t.prototype.count.call(this,n):i)},r.prototype.elementAtOrDefault=function(t,i){var u=this,r;return u.throwIfDisposed(),n.Integer.assertZeroOrGreater(t,"index"),r=u._source,t<r.length?r[t]:i},r.prototype.last=function(){var r=this,n,i;return r.throwIfDisposed(),n=r._source,i=n.length,i?n[i-1]:t.prototype.last.call(this)},r.prototype.lastOrDefault=function(n){var r=this,t,i;return r.throwIfDisposed(),t=r._source,i=t.length,i?t[i-1]:n},r.prototype.skip=function(n){var t=this;return(t.throwIfDisposed(),!(n>0))?t:new f(function(){return new nt(function(){return t._source},n)})},r.prototype.takeExceptLast=function(n){n===void 0&&(n=1);var t=this;return t.throwIfDisposed(),t.take(t._source.length-n)},r.prototype.skipToLast=function(n){var t=this,i;return(t.throwIfDisposed(),!(n>0))?h.empty():isFinite(n)?(i=t._source?t._source.length:0,t.skip(i-n)):t},r.prototype.reverse=function(){var n=this,t=!n.throwIfDisposed();return new f(function(){return n.throwIfDisposed(),new lt(function(){var i=n._source;return u(t||!i),{source:i,pointer:i.length-1,length:i.length,step:-1}})},function(){t=!0})},r.prototype.memoize=function(){return this.asEnumerable()},r.prototype.sequenceEqual=function(i,u){return(u===void 0&&(u=a),n.Type.isArrayLike(i))?ni.areEqual(this.source,i,!0,u):i instanceof r?i.sequenceEqual(this.source,u):t.prototype.sequenceEqual.call(this,i,u)},r.prototype.toJoinedString=function(n,i){n===void 0&&(n="");i===void 0&&(i=e.Identity);var r=this._source;return!i&&r instanceof Array?r.join(n):t.prototype.toJoinedString.call(this,n,i)},r}(y),st=function(n){function t(t,i){var r=n.call(this,i)||this;return r._groupKey=t,r._disposableObjectName="Grouping",r}return __extends(t,n),Object.defineProperty(t.prototype,"key",{get:function(){return this._groupKey},enumerable:!0,configurable:!0}),t}(ot),ei=function(){function n(n){this._dictionary=n}return Object.defineProperty(n.prototype,"count",{get:function(){return this._dictionary.count},enumerable:!0,configurable:!0}),n.prototype.get=function(n){return this._dictionary.getValue(n)||null},n.prototype.contains=function(n){return this._dictionary.containsKey(n)},n.prototype.getEnumerator=function(){var t=this,n;return new r(function(){n=t._dictionary.getEnumerator()},function(t){if(!n.moveNext())return!1;var i=n.current;return t.yieldReturn(new st(i.key,i.value))},function(){n&&n.dispose();n=i})},n}(),g=function(n){function t(t,r,u,f,e){e===void 0&&(e=ii);var o=n.call(this,i)||this;return o.source=t,o.keySelector=r,o.order=u,o.parent=f,o.comparer=e,w(t&&t.isEndless),o._disposableObjectName="OrderedEnumerable",o}return __extends(t,n),t.prototype.createOrderedEnumerable=function(n,i){return this.throwIfDisposed(),new t(this.source,n,i,this)},t.prototype.thenBy=function(n){return this.createOrderedEnumerable(n,1)},t.prototype.thenUsing=function(n){return new t(this.source,null,1,this,n)},t.prototype.thenByDescending=function(n){return this.createOrderedEnumerable(n,-1)},t.prototype.thenUsingReversed=function(n){return new t(this.source,null,-1,this,n)},t.prototype.getEnumerator=function(){var u=this,n,t,f;return u.throwIfDisposed(),f=0,new r(function(){u.throwIfDisposed();f=0;n=h.toArray(u.source);t=ct(u).generateSortedIndexes(n)},function(i){return u.throwIfDisposed(),f<t.length?i.yieldReturn(n[t[f++]]):!1},function(){n&&(n.length=0);n=i;t&&(t.length=0);t=i},!1)},t.prototype._onDispose=function(){var t=this;n.prototype._onDispose.call(this);t.source=i;t.keySelector=i;t.order=i;t.parent=i},t}(y);t.Enumerable=h,function(t){function st(n){for(var i=[],t=1;t<arguments.length;t++)i[t-1]=arguments[t];return it(n,i)}function a(t,i){if(n.Type.isObject(t)||n.Type.isString(t)){if(t instanceof v)return t;if(n.Type.isArrayLike(t))return new ot(t);if(nt.isEnumerable(t))return new f(function(){return t.getEnumerator()},null,t.isEndless);if(at(t))return new f(function(){return t},null,t.isEndless);if(vt(t))return a(new tt(t))}else if(n.Type.isFunction(t))return new v(function(){return new rt(t)});return i}function ct(n){switch(n?n.length:0){case 0:return h();case 1:return it(n[0]);default:return h().merge(n)}}function lt(n){return a(n)||h()}function yt(n){return n instanceof f?n.toArray():o.toArray(n)}function pt(t){var i=this.toArray(t);return new n.Collections.List(i)}function p(t){return new v(function(){return new r(null,function(i){return u(!t),i.yieldReturn(n.Random.select.one(t))},!0)},function(){t.length=0;t=i})}function wt(n){var t=n&&n.length;if(!t||!isFinite(t))throw new c("length",length);return p(ft(n))}function bt(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(!t.length)throw new c("length",length);return p(t)}function w(n){return new v(function(){var t=0;return new r(function(){t=0},function(i){return u(!n),t>=n.length&&(t=0),i.yieldReturn(n[t++])},!0)},function(){n.length=0;n=i})}function kt(n){var t=n&&n.length;if(!t||!isFinite(t))throw new c("length",length);return w(ft(n))}function dt(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(!t.length)throw new c("length",length);return w(t)}function h(){return new y(et)}function b(i,u){return(u===void 0&&(u=Infinity),!(u>0))?t.empty():isFinite(u)&&n.Integer.assert(u,"count")?new y(function(){var t=u,n=0;return new r(function(){n=0},function(r){return n++<t&&r.yieldReturn(i)},null,!1)}):new f(function(){return new r(null,function(n){return n.yieldReturn(i)},!0)})}function gt(n,t){if(!n)throw new s("initializer");return new v(function(){var u;return new r(function(){n&&(u=n())},function(t){return n?t.yieldReturn(u):t.yieldBreak()},function(){u=i;t&&t(u)},!0)},function(){n=i;t=l})}function ni(n){return b(n,1)}function d(t,i,u){if(u===void 0&&(u=1),!isFinite(t))throw new c("start",t,"Must be a finite number.");if(!(i>0))return h();if(!u)throw new c("step",u,"Must be a valid value");if(!isFinite(u))throw new c("step",u,"Must be a finite number.");return n.Integer.assert(i,"count"),new y(function(){var n,e=i,f=0;return new r(function(){f=0;n=t},function(t){var r=f++<e&&t.yieldReturn(n);return r&&f<i&&(n+=u),r},!1)})}function ti(n,t,i){return i===void 0&&(i=1),i=Math.abs(i)*-1,d(n,t,i)}function g(n,t){if(n===void 0&&(n=0),t===void 0&&(t=1),!isFinite(n))throw new c("start",n,"Must be a finite number.");if(!t)throw new c("step",t,"Must be a valid value");if(!isFinite(t))throw new c("step",t,"Must be a finite number.");return new v(function(){var i;return new r(function(){i=n},function(n){var r=i;return i+=t,n.yieldReturn(r)},!0)})}function ii(n,t){return n===void 0&&(n=0),t===void 0&&(t=1),g(n,-t)}function ri(n,t,i){if(i===void 0&&(i=1),isNaN(t)||!isFinite(t))throw new c("to",t,"Must be a finite number.");if(i&&!isFinite(i))throw new c("step",i,"Must be a finite non-zero number.");return i=Math.abs(i),new y(function(){var u;return new r(function(){u=n},n<t?function(n){var r=u<=t&&n.yieldReturn(u);return r&&(u+=i),r}:function(n){var r=u>=t&&n.yieldReturn(u);return r&&(u-=i),r},!1)})}function ui(t,i,u){if(u===void 0&&(u=""),t==null)throw new s("input");var f=typeof t;if(f!==n.Type.STRING)throw new Error("Cannot exec RegExp matches of type '"+f+"'.");return i instanceof RegExp&&(u+=i.ignoreCase?"i":"",u+=i.multiline?"m":"",i=i.source),u.indexOf("g")===-1&&(u+="g"),new y(function(){var n;return new r(function(){n=new RegExp(i,u)},function(i){var r=n.exec(t);return r!=null?i.yieldReturn(r):i.yieldBreak()})})}function fi(f,e){if(e===void 0&&(e=Infinity),!f)throw new s("factory");return isNaN(e)||e<=0?t.empty():isFinite(e)&&n.Integer.assert(e,"count")?new y(function(){var t=e,n=0;return new r(function(){n=0},function(i){u(!f);var r=n++;return r<t&&i.yieldReturn(f(r))},!1)},function(){f=i}):new v(function(){var n=0;return new r(function(){n=0},function(t){return u(!f),t.yieldReturn(f(n++))},!0)},function(){f=i})}function ei(n,t,f){if(f===void 0&&(f=!1),!t)throw new s("factory");return new v(function(){var o=0,i,e;return new r(function(){o=0;i=n;e=!f},function(n){u(!t);var r=o++;return e?e=!1:i=t(i,r),n.yieldReturn(i)},!0)},function(){t=i})}function oi(n,t,i){return i===void 0&&(i=Infinity),o.forEach(n,t,i)}function si(n,t){return o.map(n,t)}function hi(n){var t=n.takeUntil(function(n){return n===+Infinity},!0).aggregate(e.Greater);return t===l?NaN:t}function ci(n){var t=n.takeUntil(function(n){return n===-Infinity},!0).aggregate(e.Lesser);return t===l?NaN:t}function li(n){if(!n)throw new s("enumerables");var t=!1;return new f(function(){var e,f,s;return new r(function(){u(t);s=0;e=new k;f=o.from(n)},function(n){var r,s;if(u(t),r=null,f){while(!r&&f.moveNext())s=f.current,r=ht(e,s?o.from(s):i);r||(f=null)}while(!r&&e.tryDequeue(function(n){r=ht(e,o.from(n))}));return r?n.yieldReturn(r.current):n.yieldBreak()},function(){e&&(ut.these.noCopy(e.dump()),e=i);f&&f.dispose();f=null})},function(){t=!0})}var nt=n.Collections.Enumeration,tt=n.Collections.Enumeration.IteratorEnumerator,rt=n.Collections.Enumeration.InfiniteEnumerator;t.from=st;t.fromAny=a;t.fromThese=ct;t.fromOrEmpty=lt;t.toArray=yt;t.toList=pt;t._choice=p;t.choice=wt;t.chooseFrom=bt;t.cycle=kt;t.cycleThrough=dt;t.empty=h;t.repeat=b;t.repeatWithFinalize=gt;t.make=ni;t.range=d;t.rangeDown=ti;t.toInfinity=g;t.toNegativeInfinity=ii;t.rangeTo=ri;t.matches=ui;t.generate=fi;t.unfold=ei;t.forEach=oi;t.map=si;t.max=hi;t.min=ci;t.weave=li}(h=t.Enumerable||(t.Enumerable={}))})(t=n.Linq||(n.Linq={}))}(System||(System={})),function(n){var t=function(){function t(){this.partialViewResources={};this.resources=null}return t.prototype.init=function(){try{if(this.resources=(new DOMParser).parseFromString(this.prepareXmlString(window.resourcesXmlSerialized),"text/xml").documentElement,window.partialViewResources!=null)for(var n in window.partialViewResources)this.partialViewResources.hasOwnProperty(n)||(this.partialViewResources[n]=(new DOMParser).parseFromString(this.prepareXmlString(window.partialViewResources[n]),"text/xml").documentElement)}catch(t){console.error("Could not load Resources: "+t.message)}document.title=this.getPageTitle()},t.prototype.prepareXmlString=function(t){return t=n.Common.replaceAll(t,"&gt;",">"),t=n.Common.replaceAll(t,"&lt;","<"),n.Common.replaceAll(t,"&quot;",'"')},t.prototype.getResource=function(n,t){try{return(t||this.resources).querySelector("[Key='"+n+"']").getAttribute("Value")}catch(i){return console.warn("Could not get resource '"+n+"': "+i.message),""}},t.prototype.getGlobalResource=function(n){return this.getResource("GLOBAL_"+n)},t.prototype.getLocalResource=function(t,i,r){i&&(t="MASTER_"+t);var u=null;return n.Common.stringIsNullOrEmpty(r)||(u=this.partialViewResources[r]),this.getResource(t,u)},t.prototype.getPageTitle=function(){return this.getLocalResource("RES_PAGETITLE_"+window._context.currentAction)+" | "+this.getGlobalResource("RES_SITE_ApplicationTitle")},t.prototype.getListResources=function(){return{NextPage:this.getGlobalResource("RES_LIST_PAGER_NextPage"),PreviousPage:this.getGlobalResource("RES_LIST_PAGER_PreviousPage"),Ok:this.getGlobalResource("RES_LIST_VIEWS_Ok"),Cancel:this.getGlobalResource("RES_LIST_VIEWS_Cancel"),AddFilter:this.getGlobalResource("RES_LIST_FILTERS_AddFilter"),FiltersPopUpTitle:this.getGlobalResource("RES_LIST_FILTERS_DialogTitle"),NoFiltersDefined:this.getGlobalResource("RES_LIST_FILTERS_NoFilterDefined"),Column:this.getGlobalResource("RES_LIST_FILTERS_Column_Header"),Operator:this.getGlobalResource("RES_LIST_FILTERS_Operators_Header"),Criteria:this.getGlobalResource("RES_LIST_FILTERS_FilterValue_Header"),RowOperator:this.getGlobalResource("RES_LIST_FILTERS_RowOperator_Header"),Or:this.getGlobalResource("RES_LIST_FILTERS_RowOperatorTypes_Or"),And:this.getGlobalResource("RES_LIST_FILTERS_RowOperatorTypes_And"),Range:this.getGlobalResource("RES_LIST_FILTERS_Operators_Range"),EqualTo:this.getGlobalResource("RES_LIST_FILTERS_Operators_EqualTo"),Like:this.getGlobalResource("RES_LIST_FILTERS_Operators_Like"),NotEqualTo:this.getGlobalResource("RES_LIST_FILTERS_Operators_NotEqualTo"),GreaterThan:this.getGlobalResource("RES_LIST_FILTERS_Operators_GreaterThan"),GreaterThanOrEqualTo:this.getGlobalResource("RES_LIST_FILTERS_Operators_GreaterThanOrEqualTo"),LessThan:this.getGlobalResource("RES_LIST_FILTERS_Operators_LessThan"),LessThanOrEqualTo:this.getGlobalResource("RES_LIST_FILTERS_Operators_LessThanOrEqualTo"),Order:this.getGlobalResource("RES_LIST_PREFERENCES_Order"),Visible:this.getGlobalResource("RES_LIST_PREFERENCES_Visible"),Sorting:this.getGlobalResource("RES_LIST_PREFERENCES_Sorting"),SortOrder:this.getGlobalResource("RES_LIST_PREFERENCES_SortOrder"),PreferencesPopUpTitle:this.getGlobalResource("RES_LIST_PREFERENCES_DialogTitle"),Rearrange:this.getGlobalResource("RES_LIST_PREFERENCES_Rearrange"),Search:this.getGlobalResource("RES_LIST_TOOLBAR_Search"),ShowQuickFilters:this.getGlobalResource("RES_LIST_TOOLBAR_ShowQuickFilters"),HideQuickFilters:this.getGlobalResource("RES_LIST_TOOLBAR_HideQuickFilters"),Of:this.getGlobalResource("RES_LIST_PAGER_Of"),Items:this.getGlobalResource("RES_LIST_PAGER_Items"),PerPage:this.getGlobalResource("RES_LIST_PAGER_PerPage"),Pages:this.getGlobalResource("RES_LIST_PAGE_Pages"),PredefinedView:this.getGlobalResource("RES_LIST_TOOLBAR_PredefinedView"),ResetTooltip:this.getGlobalResource("RES_LIST_TOOLBAR_RefreshResetButtonTooltip"),ResetConfirmation:this.getGlobalResource("RES_LIST_TOOLBAR_ResetConfrmation"),RefreshTooltip:this.getGlobalResource("RES_LIST_TOOLBAR_RefreshButtonTooltip"),PreferencesTooltip:this.getGlobalResource("RES_LIST_TOOLBAR_PreferencesButtonTooltip"),FiltersTooltip:this.getGlobalResource("RES_LIST_TOOLBAR_FilterButtonTooltip"),SaveCurrentView:this.getGlobalResource("RES_LIST_VIEWS_Save"),OverwriteCurrentView:this.getGlobalResource("RES_LIST_VIEWS_Overwrite"),DeleteCurrentView:this.getGlobalResource("RES_LIST_VIEWS_Remove"),DeleteCurrentViewCommand:this.getGlobalResource("RES_LIST_VIEWS_Delete"),DeleteCurrentViewConfirmation:this.getGlobalResource("RES_LIST_VIEWS_RemovePrompt"),SaveCurrentViewNameAlert:this.getGlobalResource("RES_LIST_VIEWS_NameAlert"),ViewName:this.getGlobalResource("RES_LIST_VIEWS_Name"),IsDefault:this.getGlobalResource("RES_LIST_VIEWS_IsDefault"),MakeDefault:this.getGlobalResource("RES_LIST_VIEWS_MakeDefault"),MakeDefaultConfirmation:this.getGlobalResource("RES_LIST_VIEWS_MakeDefaultConfirmation"),PrevPageTooltip:this.getGlobalResource("RES_LIST_PAGER_PreviousPage"),NextPageTooltip:this.getGlobalResource("RES_LIST_PAGER_NextPage"),NoResults:this.getGlobalResource("RES_LISTFORM_NORESULTS_NoResults"),Ascending:this.getGlobalResource("RES_LIST_PREFERENCES_SortingType_ASC"),Descending:this.getGlobalResource("RES_LIST_PREFERENCES_SortingType_DESC"),FiltersApplied:this.getGlobalResource("RES_LISTFORM_FiltersApplied"),GrandTotal:this.getGlobalResource("RES_LIST_AGGREGATORS_GrandTotal"),PageTotal:this.getGlobalResource("RES_LIST_AGGREGATORS_PageTotal"),GrandAverage:this.getGlobalResource("RES_LIST_AGGREGATORS_GrandAverage"),PageAverage:this.getGlobalResource("RES_LIST_AGGREGATORS_PageAverage"),GrandCount:this.getGlobalResource("RES_LIST_AGGREGATORS_GrandCount"),PageCount:this.getGlobalResource("RES_LIST_AGGREGATORS_PageCount"),GroupingOrder:this.getGlobalResource("RES_LIST_TOOLBAR_GroupingOrder"),Page:this.getGlobalResource("RES_LIST_TOOLBAR_Page"),Export:this.getGlobalResource("RES_LIST_EXPORT_ExportOK"),MoveColumnLeft:this.getGlobalResource("RES_LIST_MoveColumnLeft_Tooltip"),MoveColumnRight:this.getGlobalResource("RES_LIST_MoveColumnRight_Tooltip"),SortASC:this.getGlobalResource("RES_LIST_SortASC_Tooltip"),SortDESC:this.getGlobalResource("RES_LIST_SortDESC_Tooltip"),Unsort:this.getGlobalResource("RES_LIST_UnSort_Tooltip"),FirstPageTooltip:this.getGlobalResource("RES_LIST_PAGER_FirstPage"),LastPageTooltip:this.getGlobalResource("RES_LIST_PAGER_LastPage"),HasNoValue:this.getGlobalResource("RES_LIST_FILTERS_Operators_HasNoValue"),HasValue:this.getGlobalResource("RES_LIST_FILTERS_Operators_HasValue"),CalculateCount:this.getGlobalResource("RES_LIST_AGGREGATORS_CalculateCount"),CalculateSum:this.getGlobalResource("RES_LIST_AGGREGATORS_CalculateSum"),CalculateAverage:this.getGlobalResource("RES_LIST_AGGREGATORS_CalculateAverage"),CommonActions:this.getGlobalResource("RES_LIST_TOOLBAR_CommonActions"),True:this.getGlobalResource("RES_LIST_FILTERS_True"),False:this.getGlobalResource("RES_LIST_FILTERS_False"),Apply:this.getGlobalResource("RES_LIST_FILTERS_Apply"),ClearAll:this.getGlobalResource("RES_LIST_FILTERS_ClearAll"),ApplyQuickFilter:this.getGlobalResource("RES_LIST_FILTERS_ApplyQuickFilter"),ClearQuickFilter:this.getGlobalResource("RES_LIST_FILTERS_ClearQuickFilter"),ExportType:this.getGlobalResource("RES_LIST_EXPORT_ExportTo"),ExportRange:this.getGlobalResource("RES_LIST_EXPORT_PrintRange"),ExportRangeCurrent:this.getGlobalResource("RES_LIST_EXPORT_ExportRange_CurrentPage"),ExportRange100:this.getGlobalResource("RES_LIST_EXPORT_ExportRange_Top100Pages"),ExportRangeAll:this.getGlobalResource("RES_LIST_EXPORT_ExportRange_AllPages"),ExportOnlyGroups:this.getGlobalResource("RES_LIST_EXPORT_ExportOnlyGroups"),RequiredFiltersMissingMessage:this.getGlobalResource("RES_LIST_RequiredFiltersMissingMessage"),RequiredFiltersMissingTitle:this.getGlobalResource("RES_LIST_RequiredFiltersMissingTitle"),SubGroups:this.getGlobalResource("RES_LISTFORM_SubGroups"),VisibleExport:this.getGlobalResource("RES_LIST_EXPORT_Visible"),ColumnExport:this.getGlobalResource("RES_LIST_EXPORT_Column"),SumHeader:this.getGlobalResource("RES_LIST_EXPORT_SumHeader"),AverageHeader:this.getGlobalResource("RES_LIST_EXPORT_AverageHeader"),PortraitOrientation:this.getGlobalResource("RES_LIST_EXPORT_PortraitOrientation"),IncludeGridLines:this.getGlobalResource("RES_LIST_EXPORT_IncludeGridLines"),FileName:this.getGlobalResource("RES_LIST_EXPORT_FileName"),DisplayColumns:this.getGlobalResource("RES_LIST_EXPORT_DisplayColumns"),HeaderColor:this.getGlobalResource("RES_LIST_EXPORT_HeaderColor"),OddColor:this.getGlobalResource("RES_LIST_EXPORT_OddColor"),EvenColor:this.getGlobalResource("RES_LIST_EXPORT_EvenColor"),GroupColor:this.getGlobalResource("RES_LIST_EXPORT_GroupColor"),AggregateColor:this.getGlobalResource("RES_LIST_EXPORT_AggregateColor"),CountHeader:this.getGlobalResource("RES_LIST_EXPORT_CountHeader"),TotalNonGroupCount:this.getGlobalResource("RES_LIST_EXPORT_TotalNonGroupCount"),GetGroupsClosed:this.getGlobalResource("RES_LISTFORM_GetGroupsClosed"),PrevStateTooltip:this.getGlobalResource("RES_LISTFORM_PrevStateTooltip"),DisplayGroupItems:this.getGlobalResource("RES_LISTFORM_DisplayGroupItems"),ClearAggregators:this.getGlobalResource("RES_LIST_AGGREGATORS_ClearAll"),DownloadCsv:this.getGlobalResource("RES_LIST_Import_DownloadCsv"),UploadCsv:this.getGlobalResource("RES_LIST_Import_UploadCsv"),Import:this.getGlobalResource("RES_LIST_Import_Import"),PreferedEncoding:this.getGlobalResource("RES_LIST_Import_PreferedEncoding"),ImportResults:this.getGlobalResource("RES_LIST_Import_ImportResults"),ImportedRecords:this.getGlobalResource("RES_LIST_Import_ImportedRecords"),FailedRecords:this.getGlobalResource("RES_LIST_Import_FailedRecords"),ErrorDetails:this.getGlobalResource("RES_LIST_Import_ErrorDetails"),RowNumber:this.getGlobalResource("RES_LIST_Import_RowNumber"),ErrorDescription:this.getGlobalResource("RES_LIST_Import_ErrorDescription"),ErrorMessage:this.getGlobalResource("RES_LIST_Import_ErrorMessage"),SelectAllRecordsPromptText:this.getGlobalResource("RES_LIST_FILTERS_SelectAll"),SelectAllPageRecordsText:this.getGlobalResource("RES_LIST_SelectAllCheckBox_Tooltip"),DeselectAllRecordsPromptText:this.getGlobalResource("RES_LIST_DeselectAllRecordsPromptText"),DeselectAllPageRecordsText:this.getGlobalResource("RES_LIST_DeselectAllPageRecordsText")}},t.prototype.getDataListResources=function(){return{Ok:this.getGlobalResource("RES_DATALIST_FILTERS_Ok"),Cancel:this.getGlobalResource("RES_DATALIST_FILTERS_Cancel"),ClearAll:this.getGlobalResource("RES_DATALIST_FILTERS_ClearAll"),RequiredFiltersMissingMessage:this.getGlobalResource("RES_DATALIST_FILTERS_RequiredFiltersMissingMessage"),AddFilter:this.getGlobalResource("RES_DATALIST_FILTERS_AddFilter"),FiltersPopUpTitle:this.getGlobalResource("RES_DATALIST_FILTERS_DialogTitle"),Operator:this.getGlobalResource("RES_DATALIST_FILTERS_Operators_Header"),Criteria:this.getGlobalResource("RES_DATALIST_FILTERS_FilterValue_Header"),RowOperator:this.getGlobalResource("RES_DATALIST_FILTERS_RowOperator_Header"),Or:this.getGlobalResource("RES_DATALIST_FILTERS_RowOperatorTypes_Or"),And:this.getGlobalResource("RES_DATALIST_FILTERS_RowOperatorTypes_And"),HasNoValue:this.getGlobalResource("RES_DATALIST_FILTERS_Operators_HasNoValue"),HasValue:this.getGlobalResource("RES_DATALIST_FILTERS_Operators_HasValue"),Range:this.getGlobalResource("RES_DATALIST_FILTERS_Operators_Range"),EqualTo:this.getGlobalResource("RES_DATALIST_FILTERS_Operators_EqualTo"),Like:this.getGlobalResource("RES_DATALIST_FILTERS_Operators_Like"),NotEqualTo:this.getGlobalResource("RES_DATALIST_FILTERS_Operators_NotEqualTo"),GreaterThan:this.getGlobalResource("RES_DATALIST_FILTERS_Operators_GreaterThan"),GreaterThanOrEqualTo:this.getGlobalResource("RES_DATALIST_FILTERS_Operators_GreaterThanOrEqualTo"),LessThan:this.getGlobalResource("RES_DATALIST_FILTERS_Operators_LessThan"),LessThanOrEqualTo:this.getGlobalResource("RES_DATALIST_FILTERS_Operators_LessThanOrEqualTo"),CountHeader:this.getGlobalResource("RES_DATALIST_EXPORT_CountHeader"),VisibleExport:this.getGlobalResource("RES_DATALIST_EXPORT_Visible"),ColumnExport:this.getGlobalResource("RES_DATALIST_EXPORT_Column"),SumHeader:this.getGlobalResource("RES_DATALIST_EXPORT_SumHeader"),AverageHeader:this.getGlobalResource("RES_DATALIST_EXPORT_AverageHeader"),Export:this.getGlobalResource("RES_DATALIST_EXPORT_ExportOK"),HeaderColor:this.getGlobalResource("RES_DATALIST_EXPORT_HeaderColor"),OddColor:this.getGlobalResource("RES_DATALIST_EXPORT_OddColor"),EvenColor:this.getGlobalResource("RES_DATALIST_EXPORT_EvenColor"),GroupColor:this.getGlobalResource("RES_DATALIST_EXPORT_GroupColor"),AggregateColor:this.getGlobalResource("RES_DATALIST_EXPORT_AggregateColor"),DisplayColumns:this.getGlobalResource("RES_DATALIST_EXPORT_DisplayColumns"),TotalNonGroupCount:this.getGlobalResource("RES_DATALIST_EXPORT_TotalNonGroupCount"),Search:this.getGlobalResource("RES_DATALIST_Search"),PortraitOrientation:this.getGlobalResource("RES_DATALIST_EXPORT_PortraitOrientation"),IncludeGridLines:this.getGlobalResource("RES_DATALIST_EXPORT_IncludeGridLines"),FileName:this.getGlobalResource("RES_DATALIST_EXPORT_FileName"),NoResults:this.getGlobalResource("RES_DATALIST_NoResults"),Info:this.getGlobalResource("RES_DATALIST_Info"),PageSize:this.getGlobalResource("RES_DATALIST_PageSize"),Records:this.getGlobalResource("RES_DATALIST_Records"),Refresh:this.getGlobalResource("RES_DATALIST_Refresh"),Reset:this.getGlobalResource("RES_DATALIST_Reset"),All:this.getGlobalResource("RES_DATALIST_All"),Loading:this.getGlobalResource("RES_DATALIST_Loading"),Processing:this.getGlobalResource("RES_DATALIST_Processing"),First:this.getGlobalResource("RES_DATALIST_PAGER_First"),Last:this.getGlobalResource("RES_DATALIST_PAGER_Last"),Next:this.getGlobalResource("RES_DATALIST_PAGER_Next"),Previous:this.getGlobalResource("RES_DATALIST_PAGER_Previous"),True:this.getGlobalResource("RES_DATALIST_FILTERS_True"),False:this.getGlobalResource("RES_DATALIST_FILTERS_False"),CalculateCount:this.getGlobalResource("RES_DATALIST_AGGREGATORS_CalculateCount"),CalculateSum:this.getGlobalResource("RES_DATALIST_AGGREGATORS_CalculateSum"),CalculateAverage:this.getGlobalResource("RES_DATALIST_AGGREGATORS_CalculateAverage"),ColumnVisibility:this.getGlobalResource("RES_DATALIST_BUTTONS_ColumnVisibility"),Copy:this.getGlobalResource("RES_DATALIST_BUTTONS_Copy"),CopyTitle:this.getGlobalResource("RES_DATALIST_BUTTONS_CopyTitle"),CopySuccessSingle:this.getGlobalResource("RES_DATALIST_BUTTONS_CopySuccessSingle"),CopySuccessMulti:this.getGlobalResource("RES_DATALIST_BUTTONS_CopySuccessMulti"),GrandTotal:this.getGlobalResource("RES_DATALIST_AGGREGATORS_GrandTotal"),PageTotal:this.getGlobalResource("RES_DATALIST_AGGREGATORS_PageTotal"),GrandAverage:this.getGlobalResource("RES_DATALIST_AGGREGATORS_GrandAverage"),PageAverage:this.getGlobalResource("RES_DATALIST_AGGREGATORS_PageAverage"),GrandCount:this.getGlobalResource("RES_DATALIST_AGGREGATORS_GrandCount"),PageCount:this.getGlobalResource("RES_DATALIST_AGGREGATORS_PageCount"),SelectAllRecordsText:this.getGlobalResource("RES_DATALIST_SelectAllRecordsText"),DeselectAllRecordsText:this.getGlobalResource("RES_DATALIST_DeselectAllRecordsText"),SelectAllPageRecordsText:this.getGlobalResource("RES_DATALIST_SelectAllPageRecordsText"),DeselectAllPageRecordsText:this.getGlobalResource("RES_DATALIST_DeselectAllPageRecordsText"),ExportType:this.getGlobalResource("RES_DATALIST_EXPORT_ExportTo"),ExportRange:this.getGlobalResource("RES_DATALIST_EXPORT_PrintRange"),ExportRangeCurrent:this.getGlobalResource("RES_DATALIST_EXPORT_ExportRange_CurrentPage"),ExportRange100:this.getGlobalResource("RES_DATALIST_EXPORT_ExportRange_Top100Pages"),ExportRangeAll:this.getGlobalResource("RES_DATALIST_EXPORT_ExportRange_AllPages"),ExportOnlyGroups:this.getGlobalResource("RES_DATALIST_EXPORT_ExportOnlyGroups"),OneRowSelected:this.getGlobalResource("RES_DATALIST_OneRowSelected"),MulitpleRowsSelected:this.getGlobalResource("RES_DATALIST_MulitpleRowsSelected"),DialogOkButton:this.getDefaultOkText(),DialogCancelButton:this.getDefaultCancelText(),Grouping:this.getGlobalResource("RES_DATALIST_Grouping"),Column:this.getGlobalResource("RES_DATALIST_Column"),GroupingOrder:this.getGlobalResource("RES_DATALIST_GroupingOrder"),GetGroupsClosed:this.getGlobalResource("RES_DATALIST_GetGroupsClosed"),MergedGroupLevels:this.getGlobalResource("RES_DATALIST_MergedGroupLevels"),ViewName:this.getGlobalResource("RES_DATALIST_VIEWS_ViewName"),View:this.getGlobalResource("RES_DATALIST_VIEWS_View"),Views:this.getGlobalResource("RES_DATALIST_VIEWS_Views"),DeleteView:this.getGlobalResource("RES_DATALIST_VIEWS_DeleteView"),SaveView:this.getGlobalResource("RES_DATALIST_VIEWS_SaveView"),InvalidViewName:this.getGlobalResource("RES_DATALIST_VIEWS_InvalidViewName"),IsViewDefault:this.getGlobalResource("RES_DATALIST_VIEWS_IsViewDefault"),DeleteConfirmation:this.getGlobalResource("RES_DATALIST_VIEWS_DeleteConfirmation"),ActiveView:this.getGlobalResource("RES_DATALIST_VIEWS_ActiveView"),Import:this.getGlobalResource("RES_DATALIST_Import"),ImportDownload:this.getGlobalResource("RES_DATALIST_DownloadImportTemplate"),ImportUpload:this.getGlobalResource("RES_DATALIST_UploadImportFile"),ImportEncoding:this.getGlobalResource("RES_DATALIST_ImportDataEncoding"),ImportResult:this.getGlobalResource("RES_DATALIST_ImportResult"),ImportSuccess:this.getGlobalResource("RES_DATALIST_ImportResultSuccess"),ImportError:this.getGlobalResource("RES_DATALIST_ImportResultErrors"),ImportErrorList:this.getGlobalResource("RES_DATALIST_ImportResultErrorList"),ClearSearch:this.getGlobalResource("RES_DATALIST_ClearSearch"),QuickFilters:this.getGlobalResource("RES_DATALIST_QuickFilters"),Actions:this.getGlobalResource("RES_DATALIST_Actions"),SelectionActions:this.getGlobalResource("RES_DATALIST_SelectionActions"),MaxSelectedRowsLimitationTitle:this.getGlobalResource("RES_DATALIST_MaxSelectedRowsLimitationTitle"),MaxSelectedRowsLimitationMessage:this.getGlobalResource("RES_DATALIST_MaxSelectedRowsLimitationMessage"),ExportTitle:this.getGlobalResource("RES_DATALIST_ExportTitle")}},t.prototype.getFilterWidgetResource=function(){return{ClearAll:this.getGlobalResource("RES_LIST_FILTERS_ClearAll"),AddFilter:this.getGlobalResource("RES_LIST_FILTERS_AddFilter"),FiltersPopUpTitle:this.getGlobalResource("RES_LIST_FILTERS_DialogTitle"),NoFiltersDefined:this.getGlobalResource("RES_LIST_FILTERS_NoFilterDefined"),Column:this.getGlobalResource("RES_LIST_FILTERS_Column_Header"),Operator:this.getGlobalResource("RES_LIST_FILTERS_Operators_Header"),Criteria:this.getGlobalResource("RES_LIST_FILTERS_FilterValue_Header"),RowOperator:this.getGlobalResource("RES_LIST_FILTERS_RowOperator_Header"),Or:this.getGlobalResource("RES_LIST_FILTERS_RowOperatorTypes_Or"),And:this.getGlobalResource("RES_LIST_FILTERS_RowOperatorTypes_And"),Range:this.getGlobalResource("RES_LIST_FILTERS_Operators_Range"),EqualTo:this.getGlobalResource("RES_LIST_FILTERS_Operators_EqualTo"),Like:this.getGlobalResource("RES_LIST_FILTERS_Operators_Like"),NotEqualTo:this.getGlobalResource("RES_LIST_FILTERS_Operators_NotEqualTo"),GreaterThan:this.getGlobalResource("RES_LIST_FILTERS_Operators_GreaterThan"),GreaterThanOrEqualTo:this.getGlobalResource("RES_LIST_FILTERS_Operators_GreaterThanOrEqualTo"),LessThan:this.getGlobalResource("RES_LIST_FILTERS_Operators_LessThan"),LessThanOrEqualTo:this.getGlobalResource("RES_LIST_FILTERS_Operators_LessThanOrEqualTo"),HasNoValue:this.getGlobalResource("RES_LIST_FILTERS_Operators_HasNoValue"),HasValue:this.getGlobalResource("RES_LIST_FILTERS_Operators_HasValue"),SelectAllRecordsPromptText:this.getGlobalResource("RES_LIST_FILTERS_SelectAll"),True:this.getGlobalResource("RES_LIST_FILTERS_True"),False:this.getGlobalResource("RES_LIST_FILTERS_False"),Apply:this.getGlobalResource("RES_LIST_FILTERS_Apply"),ApplyQuickFilter:this.getGlobalResource("RES_LIST_FILTERS_ApplyQuickFilter"),ClearQuickFilter:this.getGlobalResource("RES_LIST_FILTERS_ClearQuickFilter"),FiltersApplied:this.getGlobalResource("RES_LISTFORM_FiltersApplied"),ShowQuickFilters:this.getGlobalResource("RES_LIST_TOOLBAR_ShowQuickFilters"),HideQuickFilters:this.getGlobalResource("RES_LIST_TOOLBAR_HideQuickFilters")}},t.prototype.getChartResources=function(){return $.extend(this.getFilterWidgetResource(),{Ok:this.getGlobalResource("RES_LIST_VIEWS_Ok"),Cancel:this.getGlobalResource("RES_LIST_VIEWS_Cancel"),QuickFilters:this.getGlobalResource("RES_WEBFORM_QuickFilters"),NoRecords:this.getGlobalResource("RES_WEBFORM_NoRecordsFound_MessageTitle"),PreferencesPopUpTitle:this.getGlobalResource("RES_LIST_PREFERENCES_DialogTitle")})},t.prototype.getComboBoxDefaultText=function(t,i){var u=n.Core.getElementName(t),f=t.closest("[jb-type='PartialView']").attr("jb-partial-name"),r=this.getLocalResource("RES_COMBO_"+u+"_PROMPT",i,f);return r==null&&(r="Please select"),r},t.prototype.getEmptyRequiredFieldMessage=function(n,t,i){var r=this.getLocalResource("RES_CONTROL_"+n+"_RequiredMessage",t,i);return r==null||r.trim().length==0?this.getRequiredFieldsMissingText()+" ("+n+")":r},t.prototype.getComboBoxManualValueDisplay=function(n,t,i,r){return this.getLocalResource("RES_"+n+"_VALUE_"+t,i,r)},t.prototype.getRadioButtonManualValueDisplay=function(n,t,i,r){return this.getLocalResource("RES_"+n+"_VALUE_"+t,i,r)},t.prototype.getComboBoxNoDataText=function(t,i){var u=n.Core.getElementName(t),f=t.closest("[jb-type='PartialView']").attr("jb-partial-name"),r=this.getLocalResource("RES_COMBO_"+u+"_NODATA",i,f);return(r==null||r.trim()==="")&&(r="No data!"),r},t.prototype.getDataListColumnCaption=function(n,t,i,r,u){t==="_key"&&(t="key");var f=i?"PICKLIST":"LIST";return this.getLocalResource("RES_"+f+"_"+n+"_COLUMN_"+t,u,r)},t.prototype.getListColumnCaption=function(t,i,r,u){var f=n.Core.getElementName(t),s=t.closest("[jb-type='PartialView']").attr("jb-partial-name"),e,o;return i==="_key"&&(i="key"),e=r?"RES_PICKLIST_":"RES_LIST_",o=r?f.replace("_PickList",""):f,this.getLocalResource(e+o+"_COLUMN_"+i,u,s)},t.prototype.getPickListModalTitle=function(t,i){var r=n.Core.getElementName(t),u=t.closest("[jb-type='PartialView']").attr("jb-partial-name");return this.getLocalResource("RES_PICKLIST_"+r+"_PAGETITLE",i,u)},t.prototype.getDefaultOkText=function(){return this.getGlobalResource("RES_SITE_PREFS_OKButtonText")},t.prototype.getDefaultCancelText=function(){return this.getGlobalResource("RES_SITE_PREFS_CancelButtonText")},t.prototype.getNullValueText=function(){return this.getGlobalResource("RES_SITE_NullValue")},t.prototype.getRequiredFieldsMissingText=function(){return this.getGlobalResource("RES_WEBFORM_FIELD_RequiredMissingTitle")},t.prototype.getInvalidBindingFieldsText=function(){return this.getGlobalResource("RES_WEBFORM_FIELD_InvalidBindingsTitle")},t.prototype.getItemsRequireAttentionText=function(){return this.getGlobalResource("RES_WEBFORM_VALIDATIONS_RequireYourAttention")},t.prototype.getFileUploadTitle=function(){return this.getGlobalResource("RES_WEBFORM_FileUploadTitle")},t.prototype.getImageUploadTitle=function(){return this.getGlobalResource("RES_WEBFORM_ImageUploadTitle")},t.prototype.getFileUploadSuccess=function(){return this.getGlobalResource("RES_WEBFORM_FileUploadSuccess")},t.prototype.getFileUploadLoading=function(){return this.getGlobalResource("RES_WEBFORM_FileUploadLoading")},t.prototype.getFileUploadError=function(){return this.getGlobalResource("RES_WEBFORM_FileUploadError")},t.prototype.getFileNotFound=function(){return this.getGlobalResource("RES_WEBFORM_FileNotFound")},t.prototype.getLoadingMessage=function(){return this.getGlobalResource("RES_WEBFORM_LoadingMessage")},t.prototype.getButtonConfirmation=function(n,t,i){return this.getLocalResource("RES_BUTTON_"+n+"_ConfirmationMessage",t,i)},t.prototype.getEventConfirmation=function(n,t,i){var r=this.getLocalResource("RES_"+n+"_ConfirmationMessage",t,i);return r==null||r.trim()==""?this.getButtonConfirmation(n,t,i):r},t.prototype.getPopupBlockedTitle=function(){return this.getGlobalResource("RES_SITE_POPUP_BLOCKED_TITLE")},t.prototype.getPopupBlockedMessage=function(){return this.getGlobalResource("RES_SITE_POPUP_BLOCKED_MESSAGE")},t.prototype.getPicklistClearConfirmation=function(){return this.getGlobalResource("RES_WEBFORM_Picklist_ClearAllConfirmation")},t.prototype.getSesionExpiredMessage=function(){return this.getGlobalResource("RES_SITE_SessionExpiredErrorMessage")},t.prototype.getSesionAboutToExpireMessage=function(){return this.getGlobalResource("RES_SITE_SessionRefreshMessage")},t.prototype.getSesionRefreshedMessage=function(){return this.getGlobalResource("RES_SITE_SessionRefreshedMessage")},t.prototype.getTooLargeFileMessage=function(n,t,i){var r=this.getGlobalResource("RES_WEBFORM_Too_Large_File"),u=t/1024,f=i/1024;return r=r.replace("{FILE}",n),r=r.replace("{SIZE}",u.toFixed(1)+""),r.replace("{MAX}",f.toFixed(1)+"")},t}();n.ResourcesManager=t}(Joove||(Joove={})),function(n){var u=function(){function n(){}return n.Error="Error",n.Success="Success",n.Info="Info",n.Warning="Warning",n.Alert="Alert",n}(),i,t,r;n.MessageType=u;i={INFO:"info",WARNING:"warning",ERROR:"error",SUCCESS:"success",ALERT:"alert",CUSTOM:null},function(n){n[n.PopUp=1]="PopUp";n[n.Modal=2]="Modal"}(t=n.OpenPopUpTypes||(n.OpenPopUpTypes={}));r=function(){function r(){this.spinnerId="JbLoadingSpinner";this.showLoadingTimeout=null;this.hideLoadingTimeout=null;this.popUpVisible=!1;this.confirmationVisible=!1;this.openPopUpStack=[];this.isIE=n.Core.isIE();this.previouslyFocusedElement=null;this.popUps=[]}return r.prototype.resetFocus=function(){this.previouslyFocusedElement!=null&&($(this.previouslyFocusedElement).focus(),this.previouslyFocusedElement=null)},Object.defineProperty(r.prototype,"isLoading",{get:function(){var n=$("#"+this.spinnerId).length>0,t=$("#"+this.spinnerId).is(":visible");return n&&t},enumerable:!0,configurable:!0}),r.prototype.registerPopUp=function(n){if(n.name==null||n.name.trim()===""){console.error("Please provide a pop up name");return}this.popUps[n.name]!=null&&console.warn("A pop up is already registered and will be overwritten. Name: "+n.name);this.popUps[n.name]=n},r.prototype.showPopUp=function(n){var t=this.popUps[n];if(t==null){console.error("Not found registered pop up with name: "+n);return}this.showCustomPopUp(t);this.hideScrollbars();this.disableKeyboardEvents();this.disableMouseWheelScroll();this.popUpVisible=!0},r.prototype.getModalParent=function(n){if(n==null)return null;var t=n.closest("[jb-type='Modal']");return t!=null&&t.length>0&&t[0]!=null?t[0]:null},r.prototype.hidePopUp=function(n,i){var r,u,f;if(i===void 0&&(i=!1),r=$("[jb-type='Modal'][data-name='"+n+"'], [jb-type='Slide'][data-name='"+n+"']"),this.popUpVisible=!1,r.length===0){console.error("Not found pop up with name: "+n);return}u=this.popUps[n];u!=null&&(f=u.parentModal,f!=null&&($(f).show(),this.popUpVisible=!0));r.hasClass("slide-popup")?r.css("right","-"+r.width()+"px"):this.isIE?r.hide():r.fadeOut();r.removeClass("popup-visible");i!==!0&&u!=null&&u.closeCallback&&u.closeCallback();this.removeFromOpenPopUpStack(n,t.PopUp);this.handleOpenPopUpStack();this.popUpVisible=this.openPopUpStack.length>0;this.popUpVisible===!1&&(this.showScrollbars(),this.enableKeyboardEvents(),this.enableMouseWheelScroll(),$(".jb-modal-overlay").hide())},r.prototype.addToOpenPopUpStack=function(n,t){this.openPopUpStack.some(function(i){return i.name===n&&i.type===t})||this.openPopUpStack.push({name:n,type:t})},r.prototype.removeFromOpenPopUpStack=function(n,t){for(var i=this.openPopUpStack.length-1;i>=0;i--)if(this.openPopUpStack[i].name===n&&this.openPopUpStack[i].type===t){this.openPopUpStack.splice(i,1);break}},r.prototype.handleOpenPopUpStack=function(){if(this.openPopUpStack.length!==0){var i,n=this.openPopUpStack[this.openPopUpStack.length-1];switch(n.type){case t.PopUp:i=$("[jb-type='Modal'][data-name='"+n.name+"'], [jb-type='Slide'][data-name='"+n.name+"']");break;case t.Modal:i=$("[jb-type='Modal'][data-name^='"+n.name+"'], [jb-type='Slide'][data-name^='"+n.name+"'], [jb-id='"+n.name+"']")}i.show()}},r.prototype.hideAllPopUps=function(){var i,n,t;for($("[jb-type='Modal']").hide(),$(".jb-modal-overlay").hide(),i=$("[jb-type='Slide']"),n=0;n<i.length;n++)t=i.eq(n),t.removeClass("popup-visible"),t.css("right","-"+t.width()+"px");this.popUpVisible=!1;this.showScrollbars();this.enableKeyboardEvents();this.enableMouseWheelScroll()},r.prototype.destroyPopUp=function(n){var t=$("[jb-type='Modal'][data-name='"+n+"']");t.remove();delete this.popUps[n]},r.prototype.error=function(n,t,r){this.showSimplePopUp(i.ERROR,n,t,r)},r.prototype.success=function(n,t,r){this.showSimplePopUp(i.SUCCESS,n,t,r)},r.prototype.warning=function(n,t,r){this.showSimplePopUp(i.WARNING,n,t,r)},r.prototype.info=function(n,t,r){this.showSimplePopUp(i.INFO,n,t,r)},r.prototype.question=function(n,t,i){this.popUpVisible=!0;this.confirmationVisible=!0;var r=this;swal({title:n,text:t,type:"warning",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:window._resourcesManager.getGlobalResource("RES_SITE_PREFS_OKButtonText"),cancelButtonText:window._resourcesManager.getGlobalResource("RES_SITE_PREFS_CancelButtonText"),closeOnConfirm:!0},function(n){r.popUpVisible=!1;r.confirmationVisible=!1;r.hideLoadingPopUp(0);i&&i(n)})},r.prototype.alert=function(n,t){this.popUpVisible=!0;var i=this;swal({title:n,text:t,type:"warning",html:!0,showCancelButton:!1,showConfirmButton:!1,allowEscapeKey:!1,allowOutsideClick:!1})},r.prototype.showModalControl=function(n,i){var c=this,r,s,h;i=i||{};this.hideAllPopUps();r=$("[jb-type='Modal'][jb-id='"+n+"']");$("<div class='jb-modal-overlay modal-control-overlay' style='display: block;' />").insertBefore(r);var l=r.find("[jb-type='ModalBody']"),f=l.height(),o=window.innerHeight,u=r.width(),e=window.innerWidth;if(f>o&&(f=Math.floor(o*.8)),u>e&&(u=Math.floor(e*.8)),!(i.draggable===!1||r.attr("jb-draggable")=="false")){var y=e-u,p=o-f;r.draggable({handle:"[jb-type='ModalHeader']"});r.find("[jb-type='ModalHeader']").css({cursor:"move"})}s="auto";h="auto";r.length>0&&r[0].style&&(r[0].style.overflowX!=null&&r[0].style.overflowX.trim()!=""&&(s=r[0].style.overflowX),r[0].style.overflowY!=null&&r[0].style.overflowY.trim()!=""&&(h=r[0].style.overflowY));var a=i.draggable===!1?document.documentElement.scrollLeft||document.body.scrollLeft:0,w=i.draggable===!1?document.documentElement.scrollTop||document.body.scrollTop:0,v=i.draggable===!0?"absolute":"fixed",b=r.find("[jb-type='ModalHeader']").height(),k=r.find("[jb-type='ModalFooter']").height();l.css({"min-height":f+"px","overflow-x":s,"overflow-y":h,"max-height":"calc(100vh - 300px)","max-width":u+"px"});r.css({left:e/2-u/2+a+"px",top:"100px",position:v});this.isIE?(r.show(),this.popUpVisible=!0):(r.fadeIn(),setTimeout(function(){c.popUpVisible=!0},1e3));r.find("[jb-id='_modalCancelButton']").on("click",function(){c.hideModalControl(n,i)});this.hideScrollbars();this.disableKeyboardEvents();this.popUpVisible=!0;this.addToOpenPopUpStack(n,t.Modal)},r.prototype.hideModalControl=function(n){var u=$("[jb-type='Modal'][data-name^='"+n+"'].popup-visible, [jb-type='Slide'][data-name^='"+n+"'].popup-visible, [jb-id='"+n+"']:visible"),r,i;if(u.siblings(".modal-control-overlay").remove(),n=="ControllerActionModal"&&(i=u.attr("jb-type"),i=="Modal"&&(i="PopUp"),this.hidePopUp(n+i,!0)),$(".jb-modal-overlay").hide(),u.length===0){console.error("PopUp Manager: uncaught selector case during hideModalControl");return}u.length>1&&console.error("PopUp Manager: selector case during hideModalControl found "+u.length+" PopUps!");u.removeClass("popup-visible");u.hide();this.removeFromOpenPopUpStack(n,t.Modal);this.handleOpenPopUpStack();this.popUpVisible=this.openPopUpStack.length>0;this.popUpVisible===!1&&(this.showScrollbars(),this.enableKeyboardEvents(),this.enableMouseWheelScroll());r=this.popUps[n];r==null&&n=="ControllerActionModal"&&(i=u.attr("jb-type"),i=="Modal"&&(i="PopUp"),r=r||this.popUps["ControllerActionModal"+i]);r!=null&&(r.closeCallback&&r.closeCallback(),r.destroyOnHide&&this.destroyPopUp(r.name))},r.prototype.toHTML=function(n){try{var t=(new DOMParser).parseFromString(n,"text/html");t&&t.body&&t.body.childNodes&&t.body.childNodes.length!=0&&[].slice.call(t.body.childNodes).some(function(n){return n.nodeType===1})==!1&&(n=$("<div />",{html:n}).text())}catch(i){}return n},r.prototype.showSimplePopUp=function(n,t,i,r){t=this.toHTML(t);i=this.toHTML(i);this.popUpVisible=!0;var u=this;swal({type:n,title:t,text:i,html:!0},function(){setTimeout(function(){u.popUpVisible=!1;u.hideLoadingPopUp(0);r&&r();u.resetFocus()},200)})},r.prototype.showConfirmPopUp=function(){console.error("Confirm not implemented yet")},r.prototype.showLoadingPopUp=function(t){var r=this,u,i;this.isLoading||(u=t||1500,i=this,this.showLoadingTimeout=setTimeout(function(){if(n.Ajax.pendingRequestsWithOverlay()!==0&&!i.confirmationVisible&&!i.popUpVisible){var t=$("#"+r.spinnerId);t.length===0&&(t=$('<div id="'+r.spinnerId+'">                                    <div class="spinner">                                      <div class="rect1"><\/div>                                      <div class="rect2"><\/div>                                      <div class="rect3"><\/div>                                      <div class="rect4"><\/div>                                      <div class="rect5"><\/div>                                    <\/div>                                  <\/div>'),t.css({position:"fixed",right:"20px",bottom:"50px","z-index":"99999999","background-color":"rgba(255, 255, 255, 0.89)",padding:"5px",border:"1px solid #ccc","border-radius":"5px"}),t.find(".spinner").css({height:"40px",width:"40px"}),t.appendTo("body"));t.show()}},u))},r.prototype.hideLoadingPopUp=function(t){var u=this,r,i;this.isLoading!==!1&&(r=t||1e3,i=this,this.hideLoadingTimeout=setTimeout(function(){if(!(n.Ajax.pendingRequestsWithOverlay()>0)&&!i.confirmationVisible&&!i.popUpVisible){var t=$("#"+u.spinnerId);t.hide()}},r))},r.prototype.showCustomPopUp=function(n){var c=this,r,u,i,e,o,s,h,f;if(this.hideAllPopUps(),r=$("[jb-type='Modal'][data-name='"+n.name+"'], [jb-type='Slide'][data-name='"+n.name+"']"),u=this,r.length>0){n.overlay!==!1&&$(".jb-modal-overlay").show();n.cancelButton===!0&&r.find(".modal-header .popup-close-button").hide();this.resizePopUp(n,r,!0);this.reloadContent(n,r,!0);this.isIE?r.show():r.fadeIn();this.addToOpenPopUpStack(n.name,t.PopUp);return}i=n.mode=="Slide"?$("#JooveBoxControlTemplates > [jb-type='Slide']").clone():$("#JooveBoxControlTemplates > [jb-type='Modal']").clone();i.attr("data-name",n.name);i.addClass(n.cssClass);(n.overlay!==!1||n.mode=="Slide")&&$(".jb-modal-overlay").show();$(window).on("resize",function(){i.hasClass("popup-visible")&&c.resizePopUp(n,i,!1)});n.cancelButton===!0&&i.find(".modal-header .popup-close-button").hide();this.resizePopUp(n,i,!0);this.reloadContent(n,i,!1);i.find("[jb-id='_modalTitle']").text(n.title);i.find("[jb-id='_modalCancelButton']").on("click",function(){u.hidePopUp(n.name);n.destroyOnHide&&u.destroyPopUp(n.name)});if(e=i.find("[jb-id='_modalOKButton']"),o=i.find("[jb-id='_modalCancelButton']:not('.popup-close-button')"),e.toggle(n.okButton),o.toggle(n.cancelButton),n.okButton){e.html(n.okText||window._resourcesManager.getDefaultOkText());e.on("click",function(){if(n.okCallback!=null){var t=n.okCallback(i);t||i.find("[jb-id='_modalCancelButton']").click()}else i.find("[jb-id='_modalCancelButton']").click()})}if(n.cancelButton&&o.html(n.cancelText||window._resourcesManager.getDefaultCancelText()),n.onShowCallback!=null)n.onShowCallback(i);if(n.dismissible===!0&&n.mode!="Slide"&&(s=$("[jb-type='ModalHeader']"),s.length>0)){h="_CloseLabel";f=$("[jb-type='ModalHeader']").find("[jb-id='"+h+"']");f.length>0==!1&&(f=$('<i jb-id="'+h+'" jb-type="Iconism" class="glyphicon glyphicon-remove jb-control" style="float: right; cursor: pointer" ui-role-font-size="lg"><\/i>'),f.appendTo(s));f.on("click",function(){n.closeCallback!=null&&n.closeCallback(i);u.hidePopUp(n.name);n.destroyOnHide&&u.destroyPopUp(n.name)})}this.addToOpenPopUpStack(n.name,t.PopUp)},r.prototype.reloadContent=function(n,t,i){var u,r;if(n!=null&&t!=null&&(n.url!=null&&(u="<iframe class='jb-modal-iframe' src='"+n.url+"'><\/iframe",n.mode=="Slide"?t.append(u):(r=t.find("[jb-type='ModalBody']"),r.empty(),r.append(u))),n.$elementContent!=null&&(n.mode=="Slide"?n.$elementContent.appendTo(t):(r=t.find("[jb-type='ModalBody']"),n.$elementContent.appendTo(r))),i===!0&&n.onShowCallback!=null))n.onShowCallback(t)},r.prototype.resizePopUp=function(n,t,i){var r=500,u=500,f="px",e=window.innerHeight,o=window.innerWidth,s,h;if(n.startMaximized?(n.draggable=!1,r=100,u=100,f="%"):(n.width!=null&&isNaN(n.width)&&n.width.indexOf("%")>-1?r=Math.round(o*(n.width.replace("%","")/100)):n.width!=null&&isNaN(n.width)===!1&&(r=n.width),n.height!=null&&isNaN(n.height)&&n.height.indexOf("%")>-1?u=Math.round(e*(n.height.replace("%","")/100)):n.height!=null&&isNaN(n.height)===!1&&(u=n.height)),n.mode=="Slide")t.css({width:r+"px",right:"-"+r+"px"}),i&&t.appendTo("body");else{if(n.okButton||n.cancelButton||(s=t.find("[jb-type='ModalFooter']"),s.length>0&&s.remove()),t.find("[jb-type='ModalContent']").css({width:r+f,height:u+f}),i&&t.appendTo("body"),n.draggable){var c=document.documentElement.scrollLeft||document.body.scrollLeft,l=document.documentElement.scrollTop||document.body.scrollTop,a=50+c,v=50+l,y=o-r+c,p=e-u+l;t.draggable({handle:"[jb-type='ModalHeader']",containment:[a,v,y,p]});t.find("[jb-type='ModalHeader']").css({cursor:"move"})}n.resizable&&t.resizable({minHeight:n.minHeight||250,minWidth:n.minHeight||250})}h=this;n.mode!="Slide"?(n.startMaximized===!0?t.css({left:"0",right:"0",top:document.documentElement.scrollTop+"px",bottom:"0",margin:"0","z-index":"999999999",width:"100vw",height:"100vh",position:"absolute"}):t.css({left:o/2-r/2+(n.draggable!==!1?document.documentElement.scrollLeft||document.body.scrollLeft:0)+"px",top:e/2-u/2+(n.draggable!==!1?document.documentElement.scrollTop||document.body.scrollTop:0)+"px",position:n.draggable!==!1?"absolute":"fixed"}),this.isIE?(t.show(),t.addClass("popup-visible"),h.popUpVisible=!0):t.fadeIn(function(){setTimeout(function(){t.addClass("popup-visible");h.popUpVisible=!0},500)})):setTimeout(function(){t.addClass("popup-visible");t.css("right","0px");t.css("top","0px")},500)},r.prototype.hideScrollbars=function(){$("html").css({overflow:"hidden"})},r.prototype.showScrollbars=function(){$("html").css({overflow:n.Common.detectBrowser()=="IE"?"visible":"initial"})},r.prototype.disableMouseWheelScroll=function(){jQuery("html").eq(0).on("mousewheel",function(n){return $(n.target).parents().toArray().some(function(n){return $(n).hasClass("data-list")})})},r.prototype.enableMouseWheelScroll=function(){jQuery("html").eq(0).unbind("mousewheel")},r.prototype.disableKeyboardEvents=function(){jQuery("html").eq(0).on("keydown",function(n){if([33,34,35,36,38,40].indexOf(n.keyCode)>-1)return n.stopPropagation(),n.preventDefault(),!1})},r.prototype.enableKeyboardEvents=function(){jQuery("html").eq(0).unbind("keydown")},r}();n.PopUpManager=r}(Joove||(Joove={})),function(n){var i=function(){function t(n){var i=this;this.getControlVariableByElement=function(n,t){var r=i.getAllControlVariablesByElement(t);return i.findVariableByNameInArray(n,r)};this.getSControlVariable=function(n,t,r,u,f){var e=i.getAllControlVariables(t,r,u,f);return i.findVariableByNameInArray(n,e)};this.getCssClassesByRole=function(n,t){var r=n.attr("jb-type"),u=n.attr("ui-role-variation")||"",f=r+"|"+t+"|"+u;return i.theme.controlRoleClasses[f]};this.getAllControlVariablesByElement=function(n){var t=n.attr("jb-type"),r=n.attr("ui-role-color")||null,u=n.attr("ui-role-size")||null,f=n.attr("ui-role-variation")||"";return i.getAllControlVariables(t,f,r,u)};this.getAllControlVariables=function(n,t,r,u){var o=n+"||"+t,s=n+"|"+r+"|"+t,h=n+"|"+u+"|"+t,c=i.theme.controlSpecificVariables[o],l=i.theme.controlSpecificVariables[s],a=i.theme.controlSpecificVariables[h],f=function(n,t){var i,r,f,u,e;if(n==null)return t;for(i=0;i<n.length;i++){for(r=n[i],f=!1,u=0;u<t.length;u++)if(e=t[u],e.name==r.name){f=!0;e.value=r.value;break}f===!1&&t.push(r)}return t},e=f(c,[]);return e=f(a,e),f(l,e)};this.theme=n||t.DefaultTheme;this.theme.controlSpecificVariables==null&&(this.theme.controlSpecificVariables=t.DefaultControlSpecificVariables);this.theme.defaultClassesByState==null&&(this.theme.defaultClassesByState=t.DefaultClasses);this.theme.statesToClassMappings==null&&(this.theme.statesToClassMappings=t.DefaultStatesToClassMappings)}return t.prototype.findVariableByNameInArray=function(n,t){if(t==null)return null;for(var i=0;i<t.length;i++)if(t[i].name.trim()==n.trim())return t[i];return null},t.prototype.getControlTypeTree=function(n){for(var r=n.parents("[jb-type]"),i="",t=r.length-1;t>=0;t--)i+=this.getControlTreePartOfControl(r.eq(t)),i+=".";return i+this.getControlTreePartOfControl(n)},t.prototype.getControlTreePartOfControl=function(n){var t="",i;return t+=n.attr("jb-type"),i=this.getControlStateAttribute(n),i.trim()!==""&&(t+=":"+i),t},t.prototype.getControlStateAttribute=function(n){var i="",r,u;for(r in t.DefaultClasses)if(t.DefaultClasses.hasOwnProperty(r)){if(u=t.DefaultClasses[r],u===""||n.hasClass(u)===!1)continue;i!==""&&(i+="|");i+=r}return i},t.prototype.pathsAreMatching=function(n,t){var e,o,i,y,a,f;if(n===t)return!0;if(e=this.getPathWithoutStates(n),o=this.getPathWithoutStates(t),e!==o&&e.endsWith("."+o)===!1)return!1;var s=n.split("."),v=t.split("."),h=[];for(i=s.length-v.length;i<s.length;i++)h.push(s[i]);for(i=0;i<h.length;i++){var p=h[i],w=v[i],c=p.split(":"),l=w.split(":"),u=c.length>1?c[1]:null,r=l.length>1?l[1]:null;if(u!==r&&r!=null&&r.trim()!=""){if((u==null||u==="")&&r!==""||(y=u.split("|"),a=r.split("|"),l.length>c))return!1;for(f=0;f<a.length;f++)if(y.indexOf(a[f])===-1)return!1}}return!0},t.prototype.getPathWithoutStates=function(n){for(var r=n.split("."),t="",i=0;i<r.length;i++)t!==""&&(t+="."),t+=r[i].split(":")[0];return t},t.prototype.getClassMappingsByTypeAndState=function(n,t,i){var f,r,u;if(i=this.theme.statesToClassMappings[i],i==null||i==={})return[];f=this.getControlTypeTree(n);r=[];for(u in i)i.hasOwnProperty(u)&&this.pathsAreMatching(f,u)&&(r=r.concat(i[u]));return r},t.prototype.setControlState=function(n,i){var r=this.getOppositeState(i),u,f;r!=null&&this.removeControlState(n,r);u=t.DefaultClasses[i];n.addClass(u);f=this.getClassMappingsByTypeAndState(n,n.attr("jb-type"),i);n.addClass(f.join(" "))},t.prototype.removeControlState=function(n,i){var r=t.DefaultClasses[i],u=this.getClassMappingsByTypeAndState(n,n.attr("jb-type"),i);n.removeClass(r);n.removeClass(u.join(" "))},t.prototype.getOppositeState=function(n){for(var i,r=0;r<t.StateTransitions.length;r++){if(i=t.StateTransitions[r],i.from===n)return i.to;if(i.inverse===!0&&i.to===n)return i.from}return null},t.prototype.getActiveClassesOfElementByState=function(n,t){for(var u=this.getClassMappingsByTypeAndState(n,n.attr("jb-type"),t),e=n.attr("class").split(" "),f=[],r,i=0;i<u.length;i++)(r=u[i],e.indexOf(r)!==-1)&&f.push(r);return f},t.prototype.transferClassesOfStateToOtherElement=function(n,t,i){var r=this.getActiveClassesOfElementByState(n,i);r!=null&&r.length!==0&&t.addClass(r.join(" "))},t.prototype.transferRemovalOfClassesOfStateToOtherElement=function(n,t,i){var r=this.getActiveClassesOfElementByState(n,i);r!=null&&r.length!==0&&t.removeClass(r.join(" "))},t.prototype.toggleFieldsetSate=function(n){var i=$(n),r=i.hasClass(t.DefaultClasses[t.States.Expanded])===!0?t.States.Collapsed:t.States.Expanded,u=i.closest("[jb-type='FieldSet']"),f=u.children("[jb-type='FieldSetBody']").eq(0);r==t.States.Expanded?(i.html("&#9650;"),f.show()):(i.html("&#9660;"),f.hide());this.setFieldsetState(u,r)},t.prototype.setFieldsetState=function(i,r){var s=i.children("[jb-type='FieldSetHeader']").children("[jb-type='FieldSetToggleStateIcon']").eq(0),h=i.children("[jb-type='FieldSetBody']").eq(0),e,u,o,f;if(r==t.States.Expanded)for(e=i.find("table[jb-id][jb-type='DataList']"),u=0;u<e.length;u++)o=n.Core.GetClientSideName(e.eq(u)),f=n.Widgets.DataListControl.instancesDic[o],f!=undefined?f.isInitialized&&f.updateDataTableSize():console.error("Couldn't find instance of datalist control with client id: "+o);this.setControlState(s,r);this.setControlState(i,r);this.setControlState(h,r)},t.prototype.toggleTreeNodeState=function(n){var i=$(n).closest("[jb-type='TreeNodeItem']"),r=i.hasClass(t.DefaultClasses[t.States.Expanded])===!0?t.States.Collapsed:t.States.Expanded;this.applyTreeNodeState(i,r)},t.prototype.applyTreeNodeState=function(n,i){n.children("[jb-type='TreeNode']").toggle(i==t.States.Expanded);this.setControlState(n,i)},t.States={None:"",Required:"Required",Readonly:"Readonly",Collapsed:"Collapsed",Expanded:"Expanded",Disabled:"Disabled",Active:"Active",GridWithAlternateRowStyle:"GridWithAlternateRowStyle",SimpleButton:"SimpleButton",ImageButton:"ImageButton",LinkButton:"LinkButton",SubMenu:"SubMenu",Direct:"Direct",NoIcon:"NoIcon",RequiredEmpty:"RequiredEmpty",DataValidationFailed:"DataValidationFailed",InvalidDataForBinding:"InvalidDataForBinding",TabsOrientationTop:"TabsOrientationTop",TabsOrientationBottom:"TabsOrientationBottom",TabsOrientationRight:"TabsOrientationRight",TabsOrientationLeft:"TabsOrientationLeft"},t.StateTransitions=[{from:t.States.Collapsed,to:t.States.Expanded,inverse:!0},{from:t.States.Disabled,to:t.States.Active,inverse:!0}],t.DefaultStatesToClassMappings={},t.DefaultControlSpecificVariables={},t.DefaultClasses={None:"",Required:"jb-required",Readonly:"jb-readonly",Collapsed:"jb-collapsed",Expanded:"jb-expanded",Disabled:"jb-disabled",Active:"jb-active",GridWithAlternateRowStyle:"jb-alternate-rows",SimpleButton:"jb-simple-btn",ImageButton:"jb-image-btn",LinkButton:"jb-link-btn",SubMenu:"jb-submenu",Direct:"jb-direct-link",NoIcon:"jb-no-icon",RequiredEmpty:"jb-required-empty",DataValidationFailed:"jb-dv-failed",InvalidDataForBinding:"jb-invalid-binding",TabsOrientationTop:"jb-tabs-top",TabsOrientationBottom:"jb-tabs-bottom",TabsOrientationRight:"jb-tabs-right",TabsOrientationLeft:"jb-tabs-left"},t.DefaultTheme={controlSpecificVariables:t.DefaultControlSpecificVariables,defaultClassesByState:t.DefaultClasses,statesToClassMappings:t.DefaultStatesToClassMappings},t}(),t;n.ThemeManager=i;t=function(){function t(){}return t.prototype.enable=function(){var n=this;window.addEventListener("message",function(t){if(n.validateOrigin(t)===!1)console.log("ERROR! ThemeEditor RPC command is invalid!");else n.onCommandReceived(t.data)});$(document).ready(function(){n.sendReadyMessage()});this.sendReadyMessage()},t.prototype.sendReadyMessage=function(){window.top.postMessage({command:"isReady"},"*")},t.prototype.validateOrigin=function(){return!0},t.prototype.onCommandReceived=function(n){switch(n.command){case"refreshStyle":this.updateStylesheet(n.style,n.imports);this.applyDefaultRolesToElements(n.defaultRoles);this.applyThemeRulesToElements(n.elementsData);break;case"selectElement":this.selelectElement(n.element);break;case"drawIcons":this.drawIcons(n.icons);break;case"selectIcon":this.selectIcon(n.icon);break;default:console.log("ERROR! ThemeEditor RPC unkown command: "+n.command)}},t.prototype.drawIcons=function(n){for(var u="",i,r=0;r<n.length;r++)i=n[r],u+="<div class='icon-container' jb-icon=\""+i.Name+"\" style='margin: 1vw; display: inline-block; float: left; font-size: 4vh'><"+i.TagName+' jb-type="Iconism" class="'+i.CssClasses+'"><\/'+i.TagName+"><\/div>";$("#"+t.IconLibraryId).remove();$("[jb-type='BodyContainer'] .form-root-element").append("<section style='margin: 10px;' class='icon-lib' id='"+t.IconLibraryId+"'>"+u+"<\/section>")},t.prototype.updateStylesheet=function(n,i){console.log("Updating stylesheet...");$("link[jb-theme-import]").remove();$("style[jb-theme-import]").remove();$("head").append("<link jb-theme-import rel='stylesheet' type='text/css' href='"+i+"'>");$("head").append("<style jb-theme-import>"+n+"<\/style>");$("head").append("<style>.jb-control."+t.SelectedMarkClass+"[jb-type][jb-default-classes], input[type='file']."+t.SelectedMarkClass+", .select2-container."+t.SelectedMarkClass+", .icon-container."+t.SelectedMarkClass+" { position: relative !important; outline: 4px solid #ffc107 !important; outline-offset: 2px !important; outline-style: dashed !important; }<\/style>")},t.prototype.selectIcon=function(n){var i=$("#"+t.IconLibraryId+" > [jb-icon='"+n+"']");$("."+t.SelectedMarkClass).removeClass(t.SelectedMarkClass);i.addClass(t.SelectedMarkClass);this.scrollToElement(i)},t.prototype.selelectElement=function(n){var u="[jb-type='"+n+"']",i,r;["Button"].indexOf(n)>-1&&(u+=":visible");i=$(u);r=i.eq(0);this.scrollToElement(r);$("."+t.SelectedMarkClass).removeClass(t.SelectedMarkClass);switch(n){case"DataList":i.closest(".data-list-control.jb-control").addClass(t.SelectedMarkClass);break;case"DropDownBox":case"FileAttachment":i.next().addClass(t.SelectedMarkClass);break;default:i.addClass(t.SelectedMarkClass)}console.log(r[0])},t.prototype.scrollToElement=function(n){var t=n.offset().top,i=n.height(),r=$(window).height(),u,f;u=i<r?t-(r/2-i/2):t;f=700;$("html, body").animate({scrollTop:u},f)},t.prototype.clearThemeCssClassFromElement=function(n){var t=n.attr("jb-theme-classes");t!=null&&t.trim()!=""&&n.removeClass(t)},t.prototype.applyDefaultRolesToElements=function(n){for(var t,i,r=0;r<n.length;r++)t=n[r],i=$("[jb-no-roles][jb-type='"+t.type+"']"),i.removeAttr("ui-role-color").removeAttr("ui-role-element-size").removeAttr("ui-role-font-size"),t.colorRole!=null&&i.attr("ui-role-color",t.colorRole),t.sizeRole!=null&&(t.type=="Label"||t.type=="Iconism"||t.type=="HyperLink"?i.attr("ui-role-font-size",t.sizeRole):i.attr("ui-role-element-size",t.sizeRole))},t.prototype.applyThemeRulesToElements=function(n){$("[data-theme-applied]").removeAttr("data-theme-applied");for(var t=0;t<n.length;t++)this.applyThemeRule(n[t])},t.prototype.applyThemeRule=function(n){var u,r,t,i;if(n.type!="ResponsiveColumn")for(u=this.createElementSelector(n),r=$(u),t=0;t<r.length;t++)i=r.eq(t),this.applyThemeDefinedClassesToElement(i,n.classes),this.applyThemeDefinedAttributesToElement(i,n.attributes),this.updateThemeVariables(n.variables,n.type),i.attr("data-theme-applied","true")},t.prototype.applyThemeDefinedClassesToElement=function(n,t){var i=n.attr("data-theme-applied")=="true",r;i===!1&&this.clearThemeCssClassFromElement(n);n.addClass(t);i===!0?(r=n.attr("jb-theme-classes"),n.attr("jb-theme-classes",r+" "+t)):n.attr("jb-theme-classes",t)},t.prototype.applyThemeDefinedAttributesToElement=function(n,t){var e=n.attr("jb-theme-attributes"),u,f,i,r;if(e!=null)for(u=e.split(";"),i=0;i<u.length;i++)n.removeAttr(u[i]);if(n.removeAttr("jb-theme-attributes"),t!=null&&t.length!=0){for(f="",i=0;i<t.length;i++)r=t[i],n.attr(r.Name,r.Value),f+=r.Name+";";n.attr("jb-theme-attributes",f)}},t.prototype.createElementSelector=function(n){var t="[jb-type='"+n.type+"']";return n.colorRole!=null&&(t+="[ui-role-color='"+n.colorRole+"']"),n.sizeRole!=null&&(t+=n.type=="Label"||n.type=="Iconism"||n.type=="HyperLink"?"[ui-role-font-size='"+n.sizeRole+"']":"[ui-role-element-size='"+n.sizeRole+"']"),t+(n.variation!=null&&n.variation.trim()!=""?"[ui-variation='"+n.variation+"']":":not([ui-variation])")},t.prototype.updateThemeVariables=function(n,t){n!=null&&(window._themeManager.theme.controlSpecificVariables[n.key]=n.value,t=="Chart"&&this.reloadCharts())},t.prototype.reloadCharts=function(){var i,r,t,u;if(n.Widgets!=null&&n.Widgets.ChartHelper!=null&&n.Widgets.ChartHelper.instancesDic!=null){i=n.Widgets.ChartHelper.instancesDic;for(r in i)if(t=i[r],t!=null)for(u in t)t[u].Init()}},t.SelectedMarkClass="theme-editor-selection",t.IconLibraryId="icons-library",t}();n.ThemeRPC=t}(Joove||(Joove={})),function(n){var t=function(){function t(){}return t.ajax=function(i){var f,s;if(i.ignoreQueue=i.ignoreQueue?i.ignoreQueue:!1,i.doInBackground!==!0){if(t._isRequestInProgress&&i.ignoreQueue===!1){t._requestQueue.push(i);return}i.ignoreQueue===!1?t._pendingRequests++:t._responseQueue.push(i);i.modalOverlay!==!1&&i.ignoreQueue===!1&&t._pendingRequestsWithOverlay++}var e=n.Common.cloneObject(i.data),o=t.reduceViewModelData(e),u=JSON.stringify(o),r={url:i.url,async:i.async?i.async:!0,dataType:i.dataType?i.dataType:null,method:i.method?i.method:"GET",data:null,headers:null,processData:i.processData?i.processData:!0,cache:!1,contentType:window._context.ajaxContentType,beforeSend:function(n,r){i.doInBackground===!0?i.beforeSend&&i.beforeSend(n,r):(i.modalOverlay!==!1&&i.ignoreQueue===!1&&t.showProgressBar(),i.beforeSend&&i.beforeSend(n,r),i.ignoreQueue===!1?t._isRequestInProgress=!0:t._requestQueue.push(i))},complete:function(){n.Session.ResetSessionExpirationTimeOut();i.doInBackground===!0?i.complete&&i.complete():(i.ignoreQueue===!1&&t._pendingRequests--,i.modalOverlay!==!1&&i.ignoreQueue===!1&&(t._pendingRequestsWithOverlay--,t.hideProgressBar()),i.complete&&i.complete(),i.ignoreQueue===!1&&(t._isRequestInProgress=!1,t.checkForPending()))},success:function(n,r,u){if(i.ignoreQueue===!1||i.doInBackground===!0)i.success(n,r,u);else{var f=function(){t._responseQueue[0]==i?(i.success(n,r,u),t._responseQueue.shift()):setTimeout(function(){f()},50)};f()}},error:function(n,t,r){i.error&&i.error(n,t,r)}};r.method!="GET"&&(r.headers==null&&(r.headers={}),r.headers.RequestVerificationToken=window._antiForgeryKey);window._context.zipRequests===!0&&r.method!="GET"&&window.JSZip!=null&&u.length>3e3?(f=new window.JSZip,f.file("form.data",u),s=f.generateAsync({compression:"DEFLATE",type:"blob"}).then(function(n){var t=r.beforeSend;r.beforeSend=function(n,i){t!=null&&t(n,i);n.setRequestHeader("IsZipped",!0)};r.data=n;r.processData=!1;delete r.contentType;$.ajax(r)})):(r.data=this.sanitizeSerializedData(u),$.ajax(r))},t._getUnwantedProperties=function(){var n=[];return n.add("DomainModel"),n},t.deleteUnwantedPropertiesSafe=function(i,r){var e,u,o,f;if((r===void 0&&(r=null),i==null)||n.Common.valueIsObject(i)==!1&&n.Common.isArray(i)==!1)return i;r==null&&(r=t._getUnwantedProperties());e={};for(u in i)if(i.hasOwnProperty(u)!=!1&&r.contains(u)!=!0)if(i[u]!=null&&n.Common.isArray(i[u])==!1)r.contains(i[u])||(console.info(i[u]),e[u]=t._deleteUnwantedProperties(i[u],r));else if(n.Common.isArray(i[u])){for(o=[],f=0;f<i[u].length;f++)r.contains(i[u][f])||(console.info(i[u][f]),o.push(t._deleteUnwantedProperties(i[u][f],r)));console.info(o);e[u]=o}else r.contains(i[u])||(console.info(i[u]),e[u]=t._deleteUnwantedProperties(i[u],r));return e},t._deleteUnwantedProperties=function(n,i){var r,u;if(i===void 0&&(i=null),n==null)return n;for(i==null&&(i=t._getUnwantedProperties()),r=0;r<i.length;r++){u=i[r];try{delete n[u]}catch(f){console&&console.error("Joove.Ajax._deleteUnwantedProperties caugh en exception while trying to remove property ["+u+"] from value ["+n+"]")}}return n},t.reduceViewModelData=function(t){var f={},i,e,r,u;if(t!=null&&t._reduceData!=null)return t._reduceData(!0);for(i in t)if(t.hasOwnProperty(i)!==!1)if(t[i]!=null&&t[i]._reduceData!=null)u=t[i]._reduceData(!0),f[i]=u;else if(n.Common.isArray(t[i])){for(e=[],r=0;r<t[i].length;r++)u=t[i][r]._reduceData==null?t[i][r]:t[i][r]._reduceData(!0),e.push(u);f[i]=e}else f[i]=t[i];return f},t.checkForPending=function(){t._requestQueue.length>0&&t.ajax(t._requestQueue.shift())},t.showProgressBar=function(){window._popUpManager.showLoadingPopUp()},t.hideProgressBar=function(){window._popUpManager.hideLoadingPopUp()},t.pendingRequestsWithOverlay=function(){return t._pendingRequestsWithOverlay},t.sanitizeSerializedData=function(t){var i=window._sanitizationDic,r,u;if(i==null||i.length==0)return t;for(r=0;r<i.length;r++)(u=i[r],t.indexOf(u.what)!=-1)&&(t=n.Common.replaceAll(t,u.what,u.with));return t},t._requestQueue=[],t._responseQueue=[],t._isRequestInProgress=!1,t._pendingRequests=0,t._pendingRequestsWithOverlay=0,t}();n.Ajax=t}(Joove||(Joove={})),function(n){var e=function(){function n(){}return n}(),r,f,i,t,u;n.FriendlyMessageDTO=e;r=function(){function n(n){if(this.dto=n,this.dto.Entries!=null)for(var t=0;t<this.dto.Entries.length;t++)f.enchance(this.dto.Entries[t])}return n}();n.FriendlyMessage=r;f=function(){function n(){}return n.enchance=function(n){u.initDict();var t=u.SemanticsDictionary[n.AppdevSemantic.toString()];n.friendlyMessage=t.FriendlyMessage;n.icon=t.Icon},n}();n.FriendlyMessageEntryDTO=f;i=function(){function n(n,t){t===void 0&&(t="default");this.FriendlyMessage=n;this.Icon=t}return n}();n.SemanticCollection=i,function(n){n[n.None=0]="None";n[n.CalculatedExpression=1]="CalculatedExpression";n[n.CondionalFormating=2]="CondionalFormating";n[n.ControllerAction=3]="ControllerAction";n[n.Form=4]="Form";n[n.Logic=5]="Logic";n[n.ControllerActionEntry=6]="ControllerActionEntry";n[n.ControllerActionImplementation=7]="ControllerActionImplementation";n[n.Datasource=8]="Datasource";n[n.DataSourceDataBinding=9]="DataSourceDataBinding";n[n.DataSourceGetFullRecordset=10]="DataSourceGetFullRecordset";n[n.DataSourceEntryPoint=11]="DataSourceEntryPoint";n[n.DataSourceFilter=12]="DataSourceFilter";n[n.DataSourceGroupBy=13]="DataSourceGroupBy";n[n.DataSourceDataAccess=14]="DataSourceDataAccess";n[n.DataSourceGrid=15]="DataSourceGrid";n[n.DataSourceGridEntry=16]="DataSourceGridEntry";n[n.DataSourceAggregators=17]="DataSourceAggregators";n[n.DataValidation=18]="DataValidation";n[n.DataValidationCondition=19]="DataValidationCondition";n[n.DataValidationMesage=20]="DataValidationMesage";n[n.ConditionalFormatting=21]="ConditionalFormatting";n[n.ConditionalFormattingEvaluation=22]="ConditionalFormattingEvaluation";n[n.ControlOnChangeAction=23]="ControlOnChangeAction";n[n.ControllerEntryPoint=24]="ControllerEntryPoint";n[n.CalculatedExpressionValueMethod=25]="CalculatedExpressionValueMethod"}(t=n.AppDevSemantic||(n.AppDevSemantic={}));u=function(){function u(){}return u.initDict=function(){this.SemanticsDictionary==null&&(this.SemanticsDictionary={},this.SemanticsDictionary[t[t.None]]=new i("",""),this.SemanticsDictionary[t[t.CalculatedExpression]]=new i("Calculated Expression","glyphicon glyphicon-text-background"),this.SemanticsDictionary[t[t.CondionalFormating]]=new i("Conditional Formatting","glyphicon glyphicon-pencil"),this.SemanticsDictionary[t[t.ControllerAction]]=new i("Controller Action","glyphicon glyphicon-random"),this.SemanticsDictionary[t[t.Form]]=new i("Form","glyphicon glyphicon-modal-window"),this.SemanticsDictionary[t[t.Logic]]=new i("Logic","glyphicon glyphicon-retweet"),this.SemanticsDictionary[t[t.ControllerActionEntry]]=new i("Controller Action Entry","glyphicon glyphicon-log-in"),this.SemanticsDictionary[t[t.ControllerActionImplementation]]=new i("Controller Action Implementation","glyphicon glyphicon-indent-left"),this.SemanticsDictionary[t[t.Datasource]]=new i("Data Set","glyphicon glyphicon-tasks"),this.SemanticsDictionary[t[t.DataSourceDataBinding]]=new i("Data Set Binding","glyphicon glyphicon-tasks"),this.SemanticsDictionary[t[t.DataSourceGetFullRecordset]]=new i("Data Set Get Full Record Set","glyphicon glyphicon-tasks"),this.SemanticsDictionary[t[t.DataSourceEntryPoint]]=new i("Data Set Entry Point","glyphicon glyphicon-log-in"),this.SemanticsDictionary[t[t.DataSourceFilter]]=new i("Data Set Filter","glyphicon glyphicon-filter"),this.SemanticsDictionary[t[t.DataSourceGroupBy]]=new i("Data Set GroupBy","glyphicon glyphicon-duplicate"),this.SemanticsDictionary[t[t.DataSourceDataAccess]]=new i("Data Set Data Access","glyphicon glyphicon-equalizer"),this.SemanticsDictionary[t[t.DataSourceGrid]]=new i("Data Set Grid","glyphicon glyphicon-list"),this.SemanticsDictionary[t[t.DataSourceGridEntry]]=new i("Data Set Grid Entry","glyphicon glyphicon-list"),this.SemanticsDictionary[t[t.DataSourceAggregators]]=new i("Data Source Aggregators","glyphicon glyphicon-sort-by-attributes"),this.SemanticsDictionary[t[t.DataValidation]]=new i("Data Validation","glyphicon glyphicon-ok"),this.SemanticsDictionary[t[t.DataValidationCondition]]=new i("Data Validation Condition","glyphicon glyphicon-saved"),this.SemanticsDictionary[t[t.DataValidationMesage]]=new i("Data  Validation Message","glyphicon glyphicon-comment"),this.SemanticsDictionary[t[t.ConditionalFormatting]]=new i("Conditional Formatting","glyphicon glyphicon-pencil"),this.SemanticsDictionary[t[t.ConditionalFormattingEvaluation]]=new i("Conditional Formatting Evaluation","glyphicon glyphicon-refresh"),this.SemanticsDictionary[t[t.ControlOnChangeAction]]=new i("Control OnChange Action","glyphicon glyphicon-flash"),this.SemanticsDictionary[t[t.ControllerEntryPoint]]=new i("Controller Entry Point","glyphicon glyphicon-log-in"),this.SemanticsDictionary[t[t.CalculatedExpressionValueMethod]]=new i("Calculated Expression Value Method","glyphicon glyphicon-text-size"))},u.isHandledError=function(n){return n==null||!n.trim||n.trim()==""?!1:(n=n.toLowerCase().trim(),n=="timeout"||n=="error"||n=="abort"||n=="parsererror")?!0:!1},u.getMessageStringForAjaxError=function(n,t){var i="",u,r;switch(n.toLowerCase().trim()){case"timeout":i="Timeout";break;case"abort":i="Abort";break;case"parsererror":i="Parser";break;default:i="Generic"}if(u="RES_CONTROLLER_ACTION_"+i+"Error"+t,r=window.$form.$resGlobal(u),r==null||r=="")switch(t){case"Title":return"Error";case"Message":return"Caught an unknown error, while communicating with the Server.";default:return""}return r},u.getAjaxErrorMessage=function(n){var t=u.getMessageStringForAjaxError("","Title"),i=u.getMessageStringForAjaxError("","Message"),r;return n&&(t=u.getMessageStringForAjaxError(n.toLowerCase().trim(),"Title"),i=u.getMessageStringForAjaxError(n.toLowerCase().trim(),"Message")),r={Type:"Error",Data:JSON.stringify({Title:t,OriginalExceptionMessage:i})},JSON.stringify(r)},u.getMessageObject=function(t){try{var i=n.Common.modelToJson(t.responseText),u=JSON.parse(i.Data);return new r(u)}catch(f){return console.error("Could not parse Exception Message Object!",f),new r({Entries:[],ExceptionType:"Unknown",OriginalExceptionMessage:"",OriginalStackTrace:"",Title:""})}},u.showPopUp=function(n,t){var u,e,i,f,r;if(t===void 0&&(t=""),u="",e="",n.dto.Title!=null&&n.dto.Title.trim()!==""&&(u+='<div class="row"><h4>'+n.dto.Title+"<\/h4><\/div>"),window._context.mode==="Development"){if(n.dto.Entries!=null){for(i=0;i<n.dto.Entries.length;i++)f="",n.dto.Entries[i].icon!=null&&n.dto.Entries[i].icon.trim()!==""&&(f+='<span style="margin-right: 5px" class="'+n.dto.Entries[i].icon+'"><\/span>'),n.dto.Entries[i].friendlyMessage!=null&&n.dto.Entries[i].friendlyMessage.trim()!==""&&(f+="<span>"+n.dto.Entries[i].friendlyMessage+"<\/span>: "),e+='<li class="list-group-item">'+f+"<b>"+n.dto.Entries[i].AppdevIdentifier+"<\/b><\/li>";u+='<ul id="errorlist" class="list-group">'+e+"<\/ul>"}console.log(n.dto.OriginalExceptionMessage,n.dto.OriginalStackTrace,n.dto)}r=n.dto.ExceptionType;r&&r.toLowerCase&&r.toLowerCase()!="businessexception"&&r.toLowerCase()!="constraintexception"&&r.toLocaleLowerCase()!="staleobjectstateexception"&&(u+=t!=null&&t.trim()!==""?'<div class="row"><p>If this error persists, please <a href="'+t+'" target="_blank">contact Administrator<\/a><\/p><\/div>':'<div class="row"><p>If this error persists, please contact Administrator<\/p><\/div>');window._popUpManager.error(window._resourcesManager.getGlobalResource("RES_WEBFORM_GenericErrorTitle"),u)},u.errorIsHtml=function(n){return n!=null&&n.responseText!=null&&n.responseText.trim().toLowerCase().indexOf("<!doctype html>")==0},u.displayHtmlError=function(n,t){var i=n.responseText;t===!0?(document.open(),document.write(i),document.close()):(window._popUpManager.error("Request Error","See console for details"),$("body").show(),console.log(i))},u.handleMessage=function(t){var s=document.body.style.display==="none",i,o,f,l;if(u.errorIsHtml(t)===!0){u.displayHtmlError(t,s);return}var h=n.Common.modelToJson(t.responseText),c=window._context.siteRoot+h.RedirectURL,a=s===!0&&h.RedirectURL!=null;if(a===!0){window.location.href=c;return}this.initDict();try{i=this.getMessageObject(t)}catch(v){o=new e;o.OriginalExceptionMessage=t;i=new r(o)}f=i.dto.ExceptionType;f&&f.toLowerCase&&f.toLowerCase()=="validationexception"?(l=new n.JbRule({name:"Dummy",group:"_ValidationException_"}),n.Validation.Bindings.refresh(l,i.dto.OriginalExceptionMessage,!0,[])):this.showPopUp(i,c)},u.SemanticsDictionary=null,u}();n.FriendlyMessageGenerator=u}(Joove||(Joove={})),function(n){var t=function(){function n(){}return n}();n.ViewModel=t}(BaseClass||(BaseClass={})),function(n){var t=function(){function t(t){t===void 0&&(t=[]);this._debug=n.Common.isInDebugMode()===!0;this._uniqueTypeClassInstances={};this._freshInstances=[];this._seen=[];this.discriminatorProp="___";this.addFreshArrayOfInstances(t)}return t.prototype.isInstanceOfTypeClass=function(n){var t,i;if(n==null)return!1;t=["_clientKey","_key","_originalTypeClassName","_typeHash"];for(i in t)if(t.hasOwnProperty(i)!==!1&&typeof n[t[i]]!="undefined")return!0;return!1},t.prototype.mergeObject=function(t,i){var u=this,r=[],f=function(t,i){var o,e,f;if(t!=null&&!n.Common.valueIsPrimitive(t)&&!(r.indexOf(t)>-1))for(r.push(t),i==null&&(i={}),o=Object.keys(t),e=0;e<o.length;e++)f=o[e],n.Common.isArray(t[f])?i[f]=u.mergeArray(t[f],i[f]):i.hasOwnProperty(f)===!1&&(i[f]=t[f])};return f(t,i),i},t.prototype.mergeArray=function(t,i){if(t==null)return i;if(i==null)return t;var r=function(t){for(var i=t.concat(),u,r=0;r<i.length;++r)for(u=r+1;u<i.length;++u)n.Common.classInstancesAreNotSame(i[r],i[u])||i.splice(u--,1);return i};return r((i||[]).concat(t))},t.prototype.getCorrespondingUniqueInstance=function(t){if(t==null||n.Common.valueIsPrimitive(t)===!0)return null;var i=n.Common.getClassInstanceKey(t);return i==null?null:this._uniqueTypeClassInstances[i]},t.prototype.mergeWithUniqueInstance=function(t){var i=this.getCorrespondingUniqueInstance(t),r,u;return i==null?(r=this.getCorrespondingFreshInstance(t),r!=null&&(this.updateInstance(t,r),this._debug===!0&&console.log("Merged object with corresponding Fresh instance. Result:",t)),u=n.Common.getClassInstanceKey(t),u!=null&&(this._uniqueTypeClassInstances[u]=t),this._debug===!0&&console.log("Added Unique Instance:",t),t):(this.mergeObject(t,i),i)},t.prototype.addFreshInstance=function(t,i){var r=this,u=i==null?[]:i;return function(t){var e,s,f,h,i,o;if(t!=null){if(Object.prototype.toString.apply(t)!=="[object Array]")for(e=0;e<u.length;e++)if(n.Common.objectsAreEqual(u[e],t,!0))return;if(u.push(t),r.isInstanceOfTypeClass(t)!==!1){for(s=!1,f=0;f<r._freshInstances.length;f++)n.Common.classInstancesAreNotSame(t,r._freshInstances[f])!==!0&&(r._freshInstances[f]=t,s=!0);s===!1&&(r._freshInstances.push(t),r._debug===!0&&console.log("Added new Fresh instance:",t));for(h in t)if(t.hasOwnProperty(h)!==!1)if(i=t[h],n.Common.isArray(i)===!0)for(o=0;o<i.length;o++)r.addFreshInstance(i[o],u);else{if(r.isInstanceOfTypeClass(i)===!1)continue;r.addFreshInstance(i,u)}}}}(t)},t.prototype.addFreshArrayOfInstances=function(n){if(n!=null)for(var t=0;t<n.length;t++)this.addFreshInstance(n[t])},t.prototype.getCorrespondingFreshInstance=function(t){var i,r;if(t==null||n.Common.valueIsPrimitive(t))return null;for(i=0;i<this._freshInstances.length;i++)if(r=this._freshInstances[i],n.Common.classInstancesAreSame(r,t))return r;return null},t.prototype.updateInstance=function(n,t){if(n==null||t==null)return n;if(this.isInstanceOfTypeClass(n)!==!1&&this.isInstanceOfTypeClass(t)!==!1){for(var i in t)t.hasOwnProperty(i)!==!1&&(n[i]=t[i]);return n}},t.prototype.reconstructReferences=function(n){this.reconstructReferencesPrive(n);for(var t in this._seen)delete this._seen[t][this.discriminatorProp],delete this._seen[t].$id;return n},t.prototype.reconstructReferencesPrive=function(t,i,r){var u,e,f;if(t==null||t[this.discriminatorProp]==!0||n.Common.valueIsPrimitive(t)===!0)return t;if(this._seen.push(t),t[this.discriminatorProp]=!0,this._debug===!0&&i==null&&r==null&&(console.log("Reconstructing references in root object:",t),console.log("Fresh Instances collection:",this._freshInstances)),n.Common.isArray(t))for(u=0;u<t.length;u++)this.reconstructReferencesPrive(t[u],t,u);else{this._debug===!0&&i!=null&&r!=null&&(console.log("Reconstructing references in child object '"+r+"'"),console.log("Parent is:",i),console.log("Child object is:",t));this.isInstanceOfTypeClass(t)===!0&&(e=this.mergeWithUniqueInstance(t),i!=null&&r!=null&&i.hasOwnProperty(r)===!0&&(i[r]=e,this._debug===!0&&console.log("Pointed to unique merged instance:",e)));for(f in t)t.hasOwnProperty(f)!==!1&&this.reconstructReferencesPrive(t[f],t,f)}return t},t}();n.ReferencesReconstructor=t}(Joove||(Joove={}));var __extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),__decorate=this&&this.__decorate||function(n,t,i,r){var f=arguments.length,u=f<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,e,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(n,t,i,r);else for(o=n.length-1;o>=0;o--)(e=n[o])&&(u=(f<3?e(u):f>3?e(t,i,u):e(t,i))||u);return f>3&&u&&Object.defineProperty(t,i,u),u},$$$=function(n,t){var i="[jb-id='"+n+"']";return t==null?$(i):t.find(i)},timeout=function(n,t){return t===void 0&&(t=!0),function(i,r,u){try{u===undefined&&(u=Object.getOwnPropertyDescriptor(i,r));var f=u.value;u.value=function(){for(var u=this,r=[],i=0;i<arguments.length;i++)r[+i]=arguments[i];t!=null||t===!0?setTimeout(function(){f.apply(u,r)},n):f.apply(this,r)}}catch(e){}}},Joove;(function(n){var e=function(){function n(n,t,i,r){this.labelPrefix=n;this.$bar=$(i,r);this.$label=$(t,r)}return n.prototype.update=function(n){this.$bar!=null&&(this.$bar.attr("aria-valuenow",n),this.$bar.css("width",n+"%"));this.$label!=null&&this.$label.html(this.labelPrefix+" ("+n+"%)")},n.prototype.clear=function(){this.$bar!=null&&(this.$bar.attr("aria-valuenow",0),this.$bar.css("width","0%"))},n}(),r,u,t,f,i,o;n.ProgressBar=e;r=function(){function n(){this.AlreadySeen=new window.Map([]);this.fillDb=!1;this._db={};this.Reset()}return n.prototype.Reset=function(){this.AlreadySeen=new window.Map([])},n.prototype.Add=function(t,i){this.AlreadySeen.set(n.GetViewModelKeyForCaching(t),i)},n.prototype.Has=function(t){return this.AlreadySeen.get(n.GetViewModelKeyForCaching(t))!=null},n.prototype.Get=function(t){return this.AlreadySeen.get(n.GetViewModelKeyForCaching(t))},n.prototype.addToDb=function(n){var i,r,t;if(this.fillDb!=!1&&n!=null&&n._key!=null&&n._originalTypeClassName!=null){i=n._originalTypeClassName+"_"+n._key;this._db[i]==null&&(this._db[i]={});r=this._db[i];for(t in n)t[0]!="_"&&t[0]!="$"&&(r[t]=n[t])}},n.prototype.getDb=function(){return this._db},n.GetViewModelKeyForCaching=function(n){return n},n}();n.DTOHelper=r;u=function(){function n(){}return n.Name=function(){return window._context.appName},n}();n.Application=u;t=function(){function n(){}return n.CurrentLanguage=function(){return{Id:window._context.languageId,Code:window._context.language,Name:window._context.languageName,DateTimeFormat:{LongDatePattern:window._context.longDatePattern,LongTimePattern:window._context.longTimePattern,MonthDayPattern:window._context.monthDayPattern,RFC1123Pattern:window._context.RFC1123Pattern,ShortDatePattern:window._context.shortDatePattern,ShortTimePattern:window._context.shortTimePattern,YearMonthPattern:window._context.yearMonthPattern}}},n.CurrentLocale=function(){return{Id:window._context.localeId,Code:window._context.locale,Name:window._context.localeName,DateTimeFormat:{LongDatePattern:window._context.longDatePattern,LongTimePattern:window._context.longTimePattern,MonthDayPattern:window._context.monthDayPattern,RFC1123Pattern:window._context.RFC1123Pattern,ShortDatePattern:window._context.shortDatePattern,ShortTimePattern:window._context.shortTimePattern,YearMonthPattern:window._context.yearMonthPattern}}},n.ResetSessionExpirationTimeOut=function(){if(clearTimeout(n.SessionAboutToExpireTimeOut),clearTimeout(n.SessionTimeOut),window._context.currentUsername!=null&&window._context.currentUsername!="")var t=window._context.sessionTimeOutMins*6e4,i=t-3e4},n.ShowSessionIsAboutToExpireModal=function(){window._popUpManager.warning("",window._resourcesManager.getSesionAboutToExpireMessage(),function(){n.RefreshSession()})},n.ShowSessionExpiredModal=function(){window._popUpManager.error("",window._resourcesManager.getSesionExpiredMessage())},n.RefreshSession=function(){n.PingServer(function(){window._popUpManager.success("",window._resourcesManager.getSesionRefreshedMessage())})},n.SessionConflict=function(){clearTimeout(n.SessionAboutToExpireTimeOut);clearTimeout(n.SessionTimeOut);window._popUpManager.alert("","User <b>"+window._context.currentUsername+"<\/b> has signed in from another device.<br/><br/> Please refresh page to sign in again.")},n.PingServer=function(n){i.executeControllerActionNew({verb:"GET",action:"_ping",controller:window._context.currentMasterPageController,cb:function(){n&&n()}})},n}();n.Session=t;f=function(n){function t(t){var i=n.call(this,t)||this;return i.name="ValidationException",i.stack=(new Error).stack,i}return __extends(t,n),t}(Error);n.ValidationException=f;i=function(){function i(){}return i.GetOptions=function(t,i){var r=t.attr(i);if(r==null)return{};try{return JSON.parse(n.Common.replaceAll(r,"'",'"'))}catch(u){return console.error("Could not parse options: "+r),{}}},i.ApplicationLocale=function(){return n.GlobalizationManager.GetCurrentLocaleManager().SortName},i.ApplicationLanguage=function(){return n.GlobalizationManager.GetCurrentLocaleManager().SortNameLanguage},i.checkAppVersion=function(){var t=localStorage.getItem("_appVersion"),n=window._appVersion;t!==n&&(console.warn("New App Version '"+n+"' (old '"+t+"')! Clearing local storage..."),localStorage.clear(),localStorage.setItem("_appVersion",n))},i.checkDbStatus=function(n){var t=localStorage.getItem("lastDbErrorShown"),r;t!=null&&(r=+new Date-+new Date(t),r<9e4)||i.executeControllerActionNew({controller:n,action:"_GetDbErrors",verb:"GET",cb:function(n){localStorage.setItem("lastDbErrorShown",(new Date).toISOString());n.Errors!=null&&n.Errors.length>0&&window._popUpManager.error("Database update errors",n.Errors+"<hr><h2>Update script<\/h2>"+n.Script)}})},i.isIE=function(){return typeof Event!="function"},i.EncodeIfNeeded=function(n,t){var u="/"+t,r,i;try{return n&&n.toLowerCase()!="get"?u:(r="YYYY-MM-DDThh:mm:ss.SSS",t._isAMomentObject===!0?(i=t.utc().format(r),"/"+encodeURI(i)):Object.prototype.toString.call(t)==="[object Date]"?(console.log(t),i=moment.utc(t).format(r),"/"+encodeURI(i)):"/"+encodeURI(t))}catch(f){return console&&console.error(f),u}},i.executeRedirectControllerAction=function(t,r,u,f,e,o,s){var w="",a,h,v,y,p;if(f!=null&&typeof f=="object")for(h=0;h<f.length;h++)w+=i.EncodeIfNeeded(u,f[h]);if($("#navigationForm > input[type='hidden']").remove(),u.toLowerCase()==="post"){e=e||{};a=n.Common.cloneObject(e);for(h in a)a.hasOwnProperty(h)&&(v=$('<input type="hidden" />'),v.val(JSON.stringify(a[h])),v.attr("name","data_"+h),$("#navigationForm").append(v))}var c=$("#navigationForm"),b=""+r+w,l=""+window._context.siteRoot+t;b!=""&&(l+="/"+b);(o!=null||window._context.isModal===!0)&&(l+=l.indexOf("?")==-1?"?":"&",l+=i.isModalParamName+"=true");c.attr({method:u,action:l});n.Common.controlKeyWasPressed()||s?c.attr("target","_blank"):c.removeAttr("target");o!=null?(y=$("<iframe class='jb-modal-iframe'><\/iframe>"),p=c.clone(!0),window._popUpManager.registerPopUp({name:"ControllerActionModal"+o.mode,width:o.width,mode:o.mode,height:o.height,startMaximized:o.maximized,title:o.title,$elementContent:y,destroyOnHide:!0,draggable:!0,okButton:o.okButton,cancelButton:o.cancelButton,onShowCallback:function(){p.appendTo(y.contents().find("body"));p.submit()},closeCallback:o.onClose}),window._popUpManager.showPopUp("ControllerActionModal"+o.mode)):c.submit()},i.executeControllerActionNew=function(t){var u,r,f;if(t==null)throw"Parameter 'options' cannot be null";if(n.Common.stringIsNullOrEmpty(t.controller))throw"Parameter 'options.controller' must have a value";if(n.Common.stringIsNullOrEmpty(t.action))throw"Parameter 'options.action' must have a value";if(t.verb=(t.verb||"POST").toUpperCase(),u=t.postData||{},u._isDirty=window._context.isDirty,t.rulesInfo==null&&t.verb!=="GET"&&(t.rulesInfo=window._ruleEngine.getServerRulesInfo(n.EvaluationTimes.OnSubmit),u.rules=t.rulesInfo.info),r="",t.queryData!=null&&typeof t.queryData=="object")for(f=0;f<t.queryData.length;f++)r+="/"+t.queryData[f];var e=new n.SpamControlHelper(t.event),o=function(n){i.handleServerResponse(t.controller,n,t.cb,t.rulesInfo,t.modalOptions,t.rootModelInfo)},s=function(r){if(t.onErrorCb==null)n.FriendlyMessageGenerator.isHandledError(r.statusText)&&(r.responseText=n.FriendlyMessageGenerator.getAjaxErrorMessage(r.statusText)),i.handleError(r);else t.onErrorCb(r)};n.Ajax.ajax({url:""+window._context.siteRoot+t.controller+"/"+t.action+r+"?"+i.currentControllerActionParamName+"="+window._context.currentAction+"&"+i.isModalParamName+"="+window._context.isModal,method:t.verb,ignoreQueue:t.ignoreQueue,data:u,beforeSend:function(){e.Disable()},complete:function(){e.Enable();window._performanceManager&&window._performanceManager.send()},success:function(n){window._performanceManager&&window._performanceManager.start(window._context.currentController,"_ExecuteControllerAction",t.controller+"/"+t.action+r);o(n);window._performanceManager&&window._performanceManager.stop(window._context.currentController,"_ExecuteControllerAction",t.controller+"/"+t.action+r)},error:function(n){n!=null&&n.status==200?o(n.responseText):s(n)}})},i.executeControllerAction=function(n,t,r,u,f,e,o,s,h,c){typeof e=="function"&&(o=e,e=null);i.executeControllerActionNew({controller:n,action:t,verb:r,queryData:u,postData:f,cb:o,onErrorCb:c,modalOptions:s,rulesInfo:h})},i.prepareDataForFileAction=function(t,i){var r=window[t.attr("jb-id")+"_ProjectionScema"],u,f;return r!=null?n.Common.project(i,r):(u=n.Common.cloneObject(i),f=n.Ajax.reduceViewModelData(u),f)},i.uploadFile=function(r){for(var u=new FormData,c=n.Common.cloneObject(r.model),l=JSON.stringify(c),e,s,f=0;f<r.files.length;f++)u.append("files[]",r.files[f]);if(u.append("model",l),u.append("indexes",r.indexesKey),e="",r.targetUrl==null){var a=i.getPartialOwnerControlElement(r.$element),h=window._context.currentController,o="";a.length>0?(o=i.getPartialOwnerControl(r.$element),u.append("actionName",i.getElementName(r.$element)+"_Upload"),u.append("controlName",i.getPartialOwnerControlElementId(r.$element))):o=i.getElementName(r.$element)+"_Upload";s="/";window._context.siteRoot.slice(-1)=="/"&&(s="");e=""+window._context.siteRoot+s+h+"/"+o}else e=r.targetUrl;$.ajax({url:e,type:"POST",data:u,cache:!1,headers:{RequestVerificationToken:window._antiForgeryKey},processData:!1,contentType:!1,success:function(n,u,f){if(t.ResetSessionExpirationTimeOut(),r.onSuccess)r.onSuccess(n,u,f);n.Type==="Data"&&i.handleServerResponse(h,n)},error:function(n,t,i){if(r.onError)r.onError(n,t,i);console.error(n,t,i)},complete:function(n,t){if(r.onComplete)r.onComplete(n,t);r.withProgressBar!==!1&&r.$progressBar.clear()},xhr:function(){var n=$.ajaxSettings.xhr();return n.upload&&r.withProgressBar!==!1&&n.upload.addEventListener("progress",function(n){if(n.lengthComputable){var t=Math.floor(n.loaded*100/n.total);r.$progressBar.update(t)}},!1),n}})},i.handleServerResponse=function(t,r,u,f,e,o){var s=null,h;if(r==null||r.Type==null){u&&u(r);return}switch(r.Type){case"Redirect":if(r.ClientCommands!=null)try{window._commander.executeCommands(r.ClientCommands)}catch(c){console.warn("failed to execute client commands",r.ClientCommands)}r.Url!=null&&r.Url.trim()!==""?e!=null?console.error("Redirecting to URL inside modal after ajax call not implemented!"):r.Url==="CLOSE_FORM"?window._commander.closeForm():window.location.href=r.Url:i.executeRedirectControllerAction(r.Controller,r.Action,r.Method,r.QueryParameters,r.PostParameters,e);return;case"Data":i.updateViewModel(t,r.Data,o);window._ruleEngine.update(n.EvaluationTimes.OnChange,null,s);u&&typeof u=="function"&&u(r.Data);break;case"ActionReturnValue":i.updateViewModel(t,r.Data,o);u&&u(r.Value);break;case"Error":n.FriendlyMessageGenerator.handleMessage(r);break;case"UpdateInstance":u&&u(r.Data);window._ruleEngine.update(n.EvaluationTimes.OnChange,null,s);break;case"RuleEvaluation":s=u;f!=null&&(h=JSON.parse(r.Data),h.Model!=null&&i.updateViewModel(t,h,o),window._ruleEngine.applyServerRulesResult(h.RuleEvaluations,f),s&&s());break;case"Unauthorized":alert("Unauthorized: TODO show appropriate message.");break;default:u&&u(r)}},i.handleError=function(t){n.FriendlyMessageGenerator.handleMessage(t)},i.updateViewModel=function(t,r,u){var f,e,s,h,o;if(window._performanceManager&&window._performanceManager.start(window._context.currentController,"_UpdateViewModel"),f=i.getScope(t),f.model==null&&(f.model={}),e=typeof r=="string"?JSON.parse(r):r,e.IsOptimized!==!0){if(u!=null)for(o in u)u.hasOwnProperty(o)&&o.indexOf("__InitialSelection")==-1&&i.assignModelPath(f.model,u[o],e.Model[o]);else e.Model==null&&e.ClientResponse!=null?i.parseClientResponse(f.model,e.ClientResponse):i.syncProperties(f.model,e.Model);f.model=f.dehydrate();f.model=(new n.ReferencesReconstructor).reconstructReferences(f.model)}else{if(f.model=JSON.parse(JSON.stringify(f.model)),s=new n.DTOHelper,s.fillDb=!0,f.model=f.dehydrate(s),h=[],u!=null)for(o in u)u.hasOwnProperty(o)&&o.indexOf("__InitialSelection")==-1&&i.assignModelPath(f.model,u[o],e.Model[o]);else i.syncPropertiesDeep(f.model,e.Model,s.getDb(),h);f.model=f.dehydrate();f.model=new n.ReferencesReconstructor(h).reconstructReferences(f.model)}i.applyScope(f);window._commander.executeCommands(e.ClientCommands);e.ClientCommands=[];window.viewDTO=e;window["scope_"+window._context.currentMasterPageController]&&window["scope_"+window._context.currentMasterPageController].model&&(window["scope_"+window._context.currentMasterPageController].model=f.model);window._performanceManager&&window._performanceManager.stop(window._context.currentController,"_UpdateViewModel")},i.parseClientResponse=function(n,t){for(var u,r=0;r<t.length;r++)u=t[r],i.nullSafeValueAssignToPath(u.Value,u.Path,n)},i.nullSafeValueAssignToPath=function(n,t,i){for(var f=t.split("."),u,r=0;r<f.length;r++)u=f[r],i[u]==null&&(i[u]={}),r==f.length-1?i[u]=n:i=i[u]},i.syncProperties=function(n,t){for(var i in t)t.hasOwnProperty(i)&&i.indexOf("__InitialSelection")==-1&&(n[i]=t[i])},i.syncPropertiesDeep=function(t,i,r,u){var f,s,l,e,h;t==null&&(t={});var c=i._originalTypeClassName+"_"+i._key,o=r[c],a=i._updatedProperties==null?[]:i._updatedProperties;for(f in i)if(i.hasOwnProperty(f)&&f.indexOf("__InitialSelection")==-1){if(s=f[0]=="_"||f[0]=="$"||o==null||o[f]===undefined||a.indexOf(f)!=-1,n.Common.isArray(i[f]))for(t[f]==null&&(t[f]=[]),i[f]!=null&&t[f].length>i[f].length&&(l=t[f].length-i[f].length,t[f].splice(i[f].length,l)),e=0;e<i[f].length;e++)t[f].length<=e?i[f][e]==null||n.Common.valueIsPrimitive(i[f][e])?t[f].push(i[f][e]):(h={},this.syncPropertiesDeep(h,i[f][e],r,u),t[f].push(h)):this.syncPropertiesDeep(t[f][e],i[f][e],r,u);if(n.Common.valueIsObject(i[f])){if(s)u.push(t[f]);else if(r[c][f]===null){t[f]=null;continue}this.syncPropertiesDeep(t[f],i[f],r,u)}else t[f]=s?i[f]:o[f]}},i.getScope=function(t){return window._context.currentMasterPageController===t?n.Common.getMasterScope():n.Common.getScope()},i.getModel=function(t){return window._context.currentMasterPageController===t?n.Common.getMasterModel():n.Common.getModel()},i.registerPartialColumnInfo=function(n,t,r,u){var f=20,e=500,o=0,s=setInterval(function(){var h=i.getPartialByName(n,u);h.length>0||o>=f?(h.length==0?console.log("ERROR: Registering partial columns for control '"+t+"' did not find partial element after "+f*e+"ms."):console.log("REGISTRED!"),clearInterval(s),h.each(function(n,i){var u=$(i),f=u.attr("jb-id");window[f+"_"+t+"_ColumnInfo"]=r})):o++},e)},i.unRegisterPartialColumnInfo=function(n,t,r){var u=i.getPartialByName(n,r);u.each(function(n,i){var r=$(i),u=r.attr("jb-id");delete window[u+"_"+t+"_ColumnInfo"]})},i.getPartialByName=function(n,t){return t==null?$('[jb-partial-name="'+n+'"]'):t.find('[jb-partial-name="'+n+'"]')},i.getPartialModelValue=function(name,pathInPartial,$context){return eval("Joove.Common.getModel()."+pathInPartial)},i.getPartialOwnerControlElement=function(n){return n.closest("[jb-type='PartialView']")},i.getPartialOwnerControlElementId=function(n){return i.getPartialOwnerControlElement(n).attr("jb-id")},i.getPartialOwnerControl=function(n){return i.getPartialOwnerControlElement(n).attr("jb-partial-name")},i.getPartialViewControlOriginalName=function(n){var r=n.attr("jb-id"),u=i.getPartialOwnerControlElement(n),t;return u.length===0?null:(t=i.getPartialOwnerControlElementId(n),r.indexOf(t)!==0)?null:r.substring(t.length)},i.getPartialControlModelInfo=function(n){var t=i.getPartialOwnerControlElement(n);return t.length===0?null:JSON.parse(t.attr("jb-partial-model"))},i.getRootModelForControl=function(t,r){var f=r?n.Common.getMasterModel():n.Common.getModel(),h=i.getPartialOwnerControlElement(t),e,o,c,s,u,l;if(h.length>0){e={};o=i.getPartialControlModelInfo(t);for(u in o)o.hasOwnProperty(u)&&(c=o[u],e[u]=i.evaluateModelPath(f,c));s=h.attr("jb-id");for(u in f)f.hasOwnProperty(u)&&u.indexOf(s)===0&&u.indexOf("SelectedItemKeys")!==-1&&(l=u.replace(s,""),e[l]=f[u]);f=e}return f},i.evaluateModelPath=function(n,t){var r,i;if(t.indexOf("model.")===-1)throw"Partial views inside context are not yet supported";for(t=t.substring(6),r=t.split("."),i=0;i<r.length;i++)if(n=n[r[i]],n==null)break;return n},i.assignModelPath=function(n,t,r){var u=i.evaluateModelPath(n,t);i.syncProperties(u,r)},i.getControllerForElement=function(n,t){var i=n.closest("[jb-type='PartialView']");return i.length>0?i.attr("jb-partial-name"):t?window._context.currentMasterPageController:window._context.currentController},i.GetServerSideElementNameFromId=function(n,t){var r=$$$(n,t);return i.GetServerSideElementName(r)},i.GetServerSideElementName=function(n){var t=i.getPartialOwnerControlElement(n);return t.length==0?i.getElementName(n):""+i.getElementName(n)},i.GetElementNameFromId=function(n,t){var r=$$$(n,t);return i.GetClientSideName(r)},i.GetClientSideName=function(n){var t=i.getPartialOwnerControlElement(n),r;return t.length==0?i.getElementName(n):(r=t.attr("jb-id"),r+"_"+i.getElementName(n))},i.getElementName=function(n){var t=n.attr("jb-id"),i=n.closest("[jb-type='PartialView']");return i.length>0?t.replace(i.attr("jb-id"),""):t},i.applyScope=function(t,r){t==null&&(t=n.Common.getScope());clearTimeout(i._scopeApplicationTimeout);r===!0?t.$$phase||t.$apply():i._scopeApplicationTimeout=setTimeout(function(){t.$$phase||t.$apply()},10)},i.onChange=function(t,r,u){if(n.Validation.Bindings.gridIsBoundToValidationsSummary(t)!==!0){var f=typeof Event!="function";$(t).attr("jb-type")==="DateTimeBox"||document.activeElement!==t||f||($(t).blur(),$(t).focus());u||$(t).attr("joove-ds-filter")=="true"||(window._context.isDirty=!0);setTimeout(function(){var u,e,f;if(t.tagName!=null&&t.tagName.toLowerCase()!=="table"&&t.tagName.toLocaleLowerCase()!=="img"){if(u=$(t),r=r||u.val(),$(t).attr("jb-type")==="CheckBox"&&(r=$(t).is(":checked")),e=i.elementData(u,"old-value"),r===e)return;i.elementData(u,"old-value",r)}for(n.Validation.UiHelper.updateEmptyRequiredFieldsState(n.Validation.UiHelper.lastEvaluatedValidationGroups,!1),window._ruleEngine.update(n.EvaluationTimes.OnChange).then(function(){setTimeout(function(){n.Validation.UiHelper.markDataValidationRelatedControls(!0)},50)}),f=0;f<i._onChangeCallBacks.length;f++)i._onChangeCallBacks[f]()},50)}},i.elementData=function(t,r,u){var e=n.Common.getIndexesOfControl(t).key,f=t.attr("jb-id")+e+"[data]";return u!==undefined&&(i._megaDictionary[f]=u),i._megaDictionary[f]},i.setBoClassPropertyFromInstance=function(n,t,r){var f=t._originalTypeClassName,u,e;if(f==null){console.warn("Could not find full class name on instance!",t);return}u=f.split(".");e=u[u.length-1];i.setBoClassProperty(e,n,t,r)},i.setBoClassProperty=function(n,t,i,r){var f=window._appDomain[n],u;if(f==null){console.warn("Could not find BO class with name: "+n);return}if(u=f["set"+t],u==null){console.warn("Could not find set method in class with name: set"+t+" in class "+n);i!=null&&(i[t]=r);return}u(i,r)},i._scopeApplicationTimeout=null,i._onChangeCallBacks=[],i.currentControllerActionParamName="_currentControllerAction",i.isModalParamName="IsModal",i._megaDictionary={},__decorate([timeout(2e3)],i,"unRegisterPartialColumnInfo",null),i}();n.Core=i;o=function(){function n(){}return n}()})(Joove||(Joove={})),function(n){var a,t,r,u,f,v,s,e,h,c,o,i,l;(function(n){n[n.None=0]="None";n[n.MANUAL=1]="MANUAL";n[n.BUSINESSOBJECT=2]="BUSINESSOBJECT";n[n.WEBSERVICE=4]="WEBSERVICE";n[n.VIEWMODEL=8]="VIEWMODEL";n[n.WORKITEM=16]="WORKITEM"})(a=n.DataSourceTypes||(n.DataSourceTypes={})),function(n){n[n.NONE=0]="NONE";n[n.EQUAL_TO=1]="EQUAL_TO";n[n.NOT_EQUAL_TO=2]="NOT_EQUAL_TO";n[n.LESS_THAN=3]="LESS_THAN";n[n.GREATER_THAN=4]="GREATER_THAN";n[n.LESS_THAN_OR_EQUAL_TO=5]="LESS_THAN_OR_EQUAL_TO";n[n.GREATER_THAN_OR_EQUAL_TO=6]="GREATER_THAN_OR_EQUAL_TO";n[n.LIKE=7]="LIKE";n[n.RANGE=8]="RANGE";n[n.HAS_VALUE=9]="HAS_VALUE";n[n.HAS_NO_VALUE=10]="HAS_NO_VALUE"}(t=n.FilterOperators||(n.FilterOperators={})),function(n){n[n.NONE=0]="NONE";n[n.AND=1]="AND";n[n.OR=2]="OR"}(r=n.RowOperators||(n.RowOperators={})),function(n){n[n.ASC=0]="ASC";n[n.DESC=1]="DESC";n[n.NONE=2]="NONE"}(u=n.OrderByDirections||(n.OrderByDirections={})),function(n){n[n.SUM=0]="SUM";n[n.AVERAGE=1]="AVERAGE";n[n.COUNT=2]="COUNT"}(f=n.AggregatorTypes||(n.AggregatorTypes={})),function(n){n[n.EXPANDED=0]="EXPANDED";n[n.COLLAPSED=1]="COLLAPSED"}(v=n.GroupState||(n.GroupState={}));s=function(){function i(n,t){t===void 0&&(t=null);this.model=n;this.partialViewControlName=t;this.limit=0}return i.prototype.GetSource=function(){return null},i.prototype.GetContext=function(t){try{return n.Core.GetOptions(t,"joove-dataset-indexes")}catch(i){return{}}},i.prototype.Retrieve=function(n,t,i,r){var e=this.GetOrderBy(t),o=this.GetFilterBy(n,t),u=e(System.Linq.Enumerable.from(this.GetSource(r)).where(o)).where(this.ExcludeKeys(t.excludeKeys)).toArray(),f=[];return f=t.startRow==0&&t.pageSize==-1?u.toArray():u.linq.skip(t.startRow).take(t.pageSize).toArray(),i.length<=0?{Data:f,TotalRows:u.length,Groups:this.GroupBy(u,t),RuleEvaluations:null}:this.GroupBy(u,t,i)},i.prototype.ChartMapper=function(n,t,i,r){return r===void 0&&(r=null),function(u){return{Item:u,Radius:r!=null?r.map(function(n){return u[n]}):[],Label:u[n],Values:t.map(function(n){return u[n]}),ValueLabels:i}}},i.prototype.ChartMapperAggregation=function(n,t,i,r){r===void 0&&(r=!0);var u=null;return function(n){var t={Item:n,Label:n.KeyFormatted,Radius:[],Values:[],ValueLabels:u||[]};return r?n.SubGroups.forEach(function(n){n.Aggregates.length>0&&(t.ValueLabels.push(n.KeyFormatted),n.Aggregates.forEach(function(i,r){r==0?t.Values[t.ValueLabels.indexOf(n.KeyFormatted)]=i.Value:t.Radius[t.ValueLabels.indexOf(n.KeyFormatted)]=i.Value}))}):n.Aggregates.forEach(function(n){t.Values.push(n.Value);t.ValueLabels.push(i[n.Column.toLowerCase()])}),u==null&&(u=t.ValueLabels),t}},i.prototype.GetOrderBy=function(n){var i=this.Sort,t,r;return n.orderBy&&n.orderBy.length>0&&(t=n.orderBy[0].column.name,r=n.orderBy[0].direction,i=function(n){return r==0?n.orderByDescending(function(n){return n[t]}):n.orderBy(function(n){return n[t]})}),i},i.prototype.ExcludeKeys=function(n){return function(t){return n==null||n.indexOf(t._key)==-1}},i.prototype.GetFilterBy=function(n,i){var f=this.Filter(n),r,u,h,c;if(i.filters&&i.filters.length>0){for(r=[],u=0;u<i.filters.length;u++){var e=i.filters[u],o=e.column.name,l=e.operator,s=e.value;switch(l){case t.EQUAL_TO:r.push("DataItem."+o+" === '"+s+"'");break;case t.LIKE:r.push("String(DataItem."+o+").includes('"+s+"')")}}h=f;c=r.join(" || ");f=function(DataItem,index,items){return h(DataItem,index,items)&&eval(c)}}return f},i.prototype.GroupBy=function(n,t,i){var u=this,r;return(i===void 0&&(i=[]),!t.groupBy||t.groupBy.length<=0)?i.length>0?i.map(function(t){return u.CalculateAggregation(n,t)}):null:(r=this.GetGroup("","ROOT",new o(new e("ROOT","object",null),0,0,0)),r.SubGroups=this.RetrieveGroup(n,r,t.groupBy,"",0,i),i.length>0?(r.Aggregates=i.map(function(t){return u.CalculateAggregation(n,t)}),{Data:null,TotalRows:0,Groups:r,RuleEvaluations:null}):r)},i.prototype.RetrieveGroup=function(n,t,i,r,u,f){var e=this,o,s;return f===void 0&&(f=[]),o=i[u],s=o.column.name,u++,t.SubGroups=n.linq.groupBy(function(n){return n[s]}).select(function(n){var h=s+"/---/"+String(n.key).replace(" ","___"),t=e.GetGroup(r+"___"+h,n.key,o);return u<i.length?t.SubGroups=e.RetrieveGroup(n.source.toArray(),t,i,h,u,f):t.UniqueItemKeys=n.source.linq.select(function(n){return n.Id}).toArray(),t.Aggregates=f.map(function(t){return e.CalculateAggregation(n.source.toArray(),t)}),t.Items=n.source.toArray(),t}).toArray(),t.SubGroups},i.prototype.GetGroup=function(n,t,i){return{Aggregates:[],Column:{Formatting:i.column.formatting,IsEncrypted:i.column.isEncrypted,MambaDataType:i.column.mambaDataType,Name:i.column.name},Identifier:n,Key:t,KeyFormatted:t,StateType:0,SubGroups:[],UniqueItemKeys:null}},i.prototype.CalculateAggregation=function(n,t){var i={Column:t.column,Type:String(t.type),Value:null,ValueFormatted:null},r=function(n){return n[i.Column]};return t.type==f.COUNT&&(r=function(){return 1}),i.Value=n.map(r).linq.aggregate(function(n,t){return n+t}),t.type==f.AVERAGE&&(i.Value=i.Value/n.length),i.ValueFormatted=String(i.Value),i},i}();n.IViewModelDataset=s;e=function(){function t(n,t,i,r,u){u===void 0&&(u=!1);this.name=n;this.mambaDataType=t;this.formatting=i;this.searchable=r||!0;this.caption=n;this.dataType=t;this.isEncrypted=u}return t.prototype.getMambaDataType=function(){var t=this.mambaDataType;return n.Common.getMambaDataType(t)},t}();n.ColumnInfo=e;h=function(){function n(n,t,i,r,u){this.column=n;this.value=t;this.rowOperator=i;this.operator=r;this.secondValue=u}return n}();n.FilterInfo=h;c=function(){function n(n,t){this.column=n;this.direction=t}return n}();n.OrderByInfo=c;o=function(){function n(n,t,i,r){this.column=n;this.state=t;this.inactive=i;this.getGroupsClosed=r}return n}();n.GroupByInfo=o;i=function(){function t(t,i,r,u,f,e,o){this.startRow=i;this.pageSize=r;this.filters=u;this.orderBy=f;this.excludeKeys=e;this.groupBy=o;this.indexes=n.Common.getIndexesOfControl(t).indexes}return t.prototype.setExludeKeys=function(n){this.excludeKeys=n},t}();n.DatasourceRequest=i;l=function(){function f(){}return f.getFetchViewModelDatasetClientSideHandler=function(t,i,r){var u=f.getDataSetNameFromControl(t),e=n.Core.getPartialOwnerControl(t),o;return e!=null?r==!0?(o=t.closest("div[jb-partial-name='"+e+"']").attr("jb-id"),n.Common.getScope().datasets[e][u](o)):n.Common.getScope().datasets[e][u]:r==!0?n.Common.getScope().datasets[u]():n.Common.getScope().datasets[u]},f.couldUseFetchViewModelDataseClientSideHandler=function(n,t){return f.getFetchViewModelDatasetClientSideHandler(n,t,!1)!=null},f.fetchItemFromViewModelDataset=function(n,t,i){try{return f.fetchItemsFromViewModelDataset(n,[t],i).linq.firstOrDefault()}catch(r){return null}},f.fetchItemsFromViewModelDataset=function(n,t,i){try{var r=f.getFetchViewModelDatasetClientSideHandler(n,i,!0);return r.GetSource().linq.where(function(n){return t.indexOf(n._key)!==-1}).toArray()}catch(u){return null}},f.fetchViewModelDataset=function(t,i,r,u){var h;try{var e=f.getFetchViewModelDatasetClientSideHandler(t,i,!0),o=e.PackInputs(t),s=n.Common.getIndexesOfControl(t).indexes;return t.attr("jb-type")=="Chart"?(h=n.Core.getPartialOwnerControl(t),h==null?e[t.attr("jb-id")+"Retrieve"](o,r,u,s):e[n.Core.getPartialViewControlOriginalName(t)+"Retrieve"](o,r,u,s)):e.Retrieve(o,r,u,s)}catch(c){return console.error("Could not fetch VM DataSet",c),[]}},f.parseStringToFilterOperator=function(n){return n==="EQUAL_TO"?t.EQUAL_TO:n==="NOT_EQUAL_TO"?t.NOT_EQUAL_TO:n==="LESS_THAN"?t.LESS_THAN:n==="GREATER_THAN"?t.GREATER_THAN:n==="LESS_THAN_OR_EQUAL_TO"?t.LESS_THAN_OR_EQUAL_TO:n==="GREATER_THAN_OR_EQUAL_TO"?t.GREATER_THAN_OR_EQUAL_TO:n==="LIKE"?t.LIKE:n==="RANGE"?t.RANGE:n==="HAS_VALUE"?t.HAS_VALUE:n==="HAS_NO_VALUE"?t.HAS_NO_VALUE:n==="NONE"?t.NONE:(console.error("Could not parse string to Filter Operator! ->"+n),t.NONE)},f.parseStringToRowOperator=function(n){return n==="NONE"?r.NONE:n==="AND"?r.AND:n==="OR"?r.OR:(console.error("Could not parse string to Row Operator! ->"+n),r.NONE)},f.parseStringToOrderByDirection=function(n){return n==="NONE"?u.NONE:n==="DESC"?u.DESC:n==="ASC"?u.ASC:(console.error("Could not parse string to Order By Direction! ->"+n),u.NONE)},f.getDataSetColumnInfo=function(n){return window[n+"_ColumnInfo"]},f.getDataSetColumnInfoFromControl=function(n){return this.getDataSetColumnInfo(this.getDataSetNameFromControl(n))},f.getDatasetType=function(n){return parseInt(n.attr("joove-dateset-type"))},f.getDataSetNameFromControl=function(n){return n.attr("joove-dataset")},f.getDtoTypeFromControl=function(n){return n.attr("jb-dto")},f.getControlsUsingDataSet=function(n){return $(".jb-control[joove-dataset='"+n+"']")},f.getOnStartFetchDatasetActionForControl=function(t,i){var r=t.attr("joove-on-start-fetch-dataset");return r==null?null:n.Common.getAction(r,i)},f.getOnFinishFetchDatasetActionForControl=function(t,i){var r=t.attr("joove-on-finish-fetch-dataset");return r==null?null:n.Common.getAction(r,i)},f.getSelectedItems=function(t,i){var u,f,r;return t.length>1&&i!=null&&(u=t.eq(0).attr("jb-id"),f=n.Common.getContextItemElement($(i.target)),t=f.find($("[jb-id='"+u+"']")).eq(0)),r=n.Common.getDirectiveScope(t),Array.isArray(r.selectedItems)?r.selectedItems:[r.selectedItems]},f.getSelectedItem=function(n,t){var i=f.getSelectedItems(n,t);return i.length===0?null:i[0]},f.GetOnChangeHandler=function(t){var f=n.Core.getPartialOwnerControl(t),r=t.attr("ng-master"),o=r&&r.toString()&&r.toString().toLowerCase()=="true",e=r?n.Common.getMasterScope():n.Common.getScope(),u=e.eventCallbacks,i;return u==null?null:f==null?(i=t.attr("jb-id"),u[i+"OnChange"]):(i=n.Core.getPartialViewControlOriginalName(t),u[""+f][i+"OnChange"])},f.HasOnChangeHandler=function(n){return f.GetOnChangeHandler(n)!=null},f.invokeOnChangeHandler=function(t){var r=f.GetOnChangeHandler(t),i,u;r==null||t.hasClass("jb-disabled")||(i=n.Common.createEvent("onchange"),Object.defineProperty(i,"target",{value:t.get(0)}),u=n.Common.getContextFromElement(t),setTimeout(function(){r(i,null,u)},500))},f.isMambaDataTypeNumber=function(n){return["int","long","float","double","decimal"].indexOf(n)>-1},f.getDatasetControlInputs=function($control){var parents=n.Common.getContextOfControl($control),inputExpressions=n.Core.GetOptions($control,"joove-dataset-inputs"),inputs={},code="",p,inp;for(p in parents)code+="var "+p+" = parents['"+p+"'];";for(inp in inputExpressions)code+="try { inputs['"+inp+"'] = "+inputExpressions[inp]+"; } catch (_e) { inputs['"+inp+"'] = null ;}";return eval(code),inputs},f.addToQueue=function(n,t,i){var r=f.getQueueKey(n,t,i),u=f._queue[r];u!=null?f._queue[r].callbacks.push(i):f._queue[r]={postData:t,url:n,callbacks:i==null?[]:[i]}},f.removeFromQueue=function(n,t,i){var r=f.getQueueKey(n,t,i);delete f._queue[r]},f.getFromQueue=function(n,t,i){var r=f.getQueueKey(n,t,i);return f._queue[r]},f.getQueueKey=function(t,i){return t+"_"+n.Common.serializeIndexes(i.datasourceRequest.indexes)},f.requestForSameControlIsInQueue=function(n,t,i){var r=f.getQueueKey(n,t,i);return f._queue[r]!=null},f.makeDatasourceRequest=function(t,i,r,u){var e,o;if(i.datasourceRequest.indexes==null){console.warn("Got null indexes for ds request. Aborting...");return}if(t+=t.indexOf("?")>-1?"&":"?",t+=n.Core.currentControllerActionParamName+"="+window._context.currentAction,t+="&"+n.Core.isModalParamName+"="+window._context.isModal,e=f.requestForSameControlIsInQueue(t,i,u),f.makeAsyncRequests===!0){if(e)return;o=u==null?[]:[u];u.onStart&&u.onStart(i);f.callBackEnd(t,i,r,o)}else{if(f.addToQueue(t,i,u),e)return;setTimeout(function(){var n=f.getFromQueue(t,i,u);u.onStart&&u.onStart(i);f.callBackEnd(n.url,n.postData,r,n.callbacks)},f._throttle)}},f.callBackEnd=function(t,i,r,u){n.Ajax.ajax({url:t,method:"POST",data:i,doInBackground:f.makeAsyncRequests===!0,success:function(t){var o=n.Common.modelToJson(t.Data),e;for(n.Cycles.reconstructObject(o),e=0;e<u.length;e++)if(u[e].success&&u[e].success(o),u[e].onFinish)u[e].onFinish(o.Data);f.updateTotalRowValues(r,o);n.DeveloperApi.onDatasourceRequestCompleted(r,o,i);window._ruleEngine.applyDataSetRulesResult(o.RuleEvaluations)},error:function(t,i,r){n.Core.handleError(t);for(var f=0;f<u.length;f++)u[f].error&&u[f].error(t,i,r)},complete:function(n){for(var r=0;r<u.length;r++)u[r].complete&&u[r].complete(n);f.makeAsyncRequests!==!0&&f.removeFromQueue(t,i,u)}})},f.updateTotalRowValues=function(n,t){var u=t==null?0:t.TotalRows,e=$("[jb-id='"+n+"']"),i=f.getDataSetNameFromControl(e),r;i!=null&&i.trim()!=""&&(r="$"+i+"_TotalRows",window.$form[r]=u)},f.fetchDatasourceForJsApi=function(n){var u=n.forMaster===!0?window._context.currentMasterPageController:window._context.currentController,o=""+window._context.siteRoot+u+"/"+u+"_"+n.dsName+"_Datasource",s=$("[jb-type='Body']"),t=new i(s,n.startRow,n.pageSize),e,r;t.DtoProperties=n.fields;t.filters=n.filters;t.orderBy=n.ordering;t.groupBy=n.grouping;e={model:window.$form.model,datasourceRequest:t,aggregatorsRequest:f.getAggregatorsRequest(t)};r={};r.success=function(t){n.done&&n.done(t)};r.error=function(t){n.error&&n.error(t)};r.complete=function(t){n.complete&&n.complete(t)};f.makeDatasourceRequest(o,e,n.dsName,r)},f.fetch=function(t,r,u,e,o,s){var l=f.getDatasetType(t),c,h;switch(l){case n.DataSourceTypes.None:break;case n.DataSourceTypes.MANUAL:c=n.Core.getElementName(t);h=[c,s,u,o];f.invokeClientSideDatasource(f.fetchManualDatasource,h,e);break;case n.DataSourceTypes.VIEWMODEL:h=[t,s,u||new i(t,0,-1),o];f.invokeClientSideDatasource(f.fetchViewModelDataset,h,e);break;case n.DataSourceTypes.WEBSERVICE:case n.DataSourceTypes.BUSINESSOBJECT:case n.DataSourceTypes.WORKITEM:default:o.length<=0?f.fetchDatasource(t,r,u,e,s):f.fetchDatasourceAggregators(t,r,u,o,e,s)}},f.invokeClientSideDatasource=function(n,t,i){var r=n.apply(void 0,t);i.onStart&&i.onStart();i.success(r);i.onFinish&&i.onFinish(r)},f.fetchManualDatasource=function(n,t){var r="dataFor"+n,i;return t===!0&&(r+="Master"),i=window[r],{Data:i,TotalRows:i.length,Groups:null,RuleEvaluations:null}},f.fetchDatasource=function(t,r,u,e,o){var s,h,v;if(t.attr("jb-type")!=="DropDownBox"||(s=n.Common.getDirectiveScope(t),s.requestInitialValueOnly!==!0||(h=f.getInitialValue(t,r,e),h==f.NO_VALUE))){var y=n.Core.getControllerForElement(t,o),c=window[n.Core.getElementName(t)+"_ProjectionScema"],l=n.Core.getRootModelForControl(t,o),a={model:c==null?l:n.Common.project(l,c),datasourceRequest:u||new i(t,0,99999),aggregatorsRequest:f.getAggregatorsRequest(u)};n.Logger.debug("fetchDatasource("+r+")",a);v=""+window._context.siteRoot+y+"/"+r+"_Datasource";e.onStart=f.getOnStartFetchDatasetActionForControl(t,o)||function(){};e.onFinish=f.getOnFinishFetchDatasetActionForControl(t,o)||function(){};f.makeDatasourceRequest(v,a,r,e)}},f.getAggregatorsRequest=function(n){return n==null?null:n.aggregators==null?null:JSON.parse(JSON.stringify(n.aggregators))},f.fetchDatasourceAggregators=function(t,r,u,e,o,s){var h=n.Core.getControllerForElement(t,s),c={model:n.Core.getRootModelForControl(t,s),datasourceRequest:u||new i(t,0,99999),aggregatorsRequest:JSON.parse(JSON.stringify(e||[]))},l=window._context.siteRoot+h+"/"+r+"_DatasourceAggregators";f.makeDatasourceRequest(l,c,r,o)},f.updateSelectedKeysInModel=function(t,i,r,u,f){var e=f===!0?n.Common.getMasterModel():n.Common.getModel(),h=n.Common.serializeIndexes(u),o=t+"SelectedItemKeys",c=!1,l={Indexes:h,SelectedItems:i,FullRecordsetSelected:r},s;for(e[o]==null&&(e[o]=[]),s=0;s<e[o].length;s++)if(e[o][s].Indexes===h){e[o][s]=l;c=!0;break}c===!1&&e[o].push(l)},f.requestSelectedItemsfromServer=function(t,r,u,e,o,s,h,c,l){var a=n.Core.getControllerForElement(r,l),v=f.getDtoTypeFromControl(r),y,p;e?(s=s||[],y={model:n.Core.getRootModelForControl(r,l),dataType:v,keys:s.join(),indexes:n.Common.getIndexesOfControl(r).key,datasourceRequest:h||new i(r,0,99999)},n.Core.executeControllerActionNew({controller:a,action:t+"_GetFullRecordset",verb:"POST",queryData:[],postData:y,cb:function(t){c(n.Common.modelToJson(t))}})):(p=r.attr("jb-id"),n.Core.executeControllerActionNew({controller:a,action:"UpdateInstance",verb:"POST",queryData:[],postData:{keys:o.join(),dataType:v,jbID:p},cb:function(t){c(n.Common.modelToJson(t))}}))},f.getKeys=function(t){var r,i,u;if(t==null)return[];if(r=[],t.constructor===Array)for(u=0;u<t.length;u++)(i=f.getObjectKey(t[u]),n.Common.keyHasDefaultValue(i)!==!0)&&r.push(i);else i=f.getObjectKey(t),n.Common.keyHasDefaultValue(i)===!1&&r.push(i);return r},f.getObjectKey=function(t){return n.Common.valueIsObject(t)?t._key:t},f.watchDependencies=function(t,i,r,u){var o,h,s,f,e,c,l;if(u=u||"data-dependencies",o=i.attr(u),o!=null&&o.trim()!=="")for(h=o.trim().split(";"),s=0;s<h.length;s++)f=h[s],e=void 0,f.indexOf("$context")===0?(c=f.split(".")[1],l=i.closest("[data-context-item='"+c+"']"),e=angular.element(l).scope(),f=f.replace("$context.","")):e=t,f.indexOf("[]")===-1?e.$watch(f,function(t,i){n.Common.objectsAreEqual(t,i)||r&&r(t)}):e.$watchCollection(f.replace("[]",""),function(t,i){n.Common.objectsAreEqual(t,i)||r&&r(t)})},f.getInitialValueModelPath=function(t,i){var r=n.Core.getPartialOwnerControlElementId(i);return r==null?t+"__InitialSelection":""+r+t+"__InitialSelection"},f.getInitialValueFromModel=function(t,i){return n.Common.getModel()[f.getInitialValueModelPath(t,i)]},f.isInitialSelectionAvailable=function(n,t){var i=f.getInitialValueFromModel(n,t);return typeof i!="undefined"},f.removeInitialValue=function(t,i){delete n.Common.getModel()[f.getInitialValueModelPath(t,i)]},f.getInitialValue=function(t,i,r){var c=n.Common.getIndexesOfControl(t),s=c.key,e,l,u,o,h;if(s===""&&(s="_"),e=f.getInitialValueFromModel(i,t),l=function(i){var u=n.Common.getDirectiveScope(t);u.requestInitialValueOnly=!1;u.refreshDataFromServerOnFocus=!0;r.success&&r.success({Data:i})},e==null)return console.log("No preselected data found for "+i),f.NO_VALUE;for(u=null,o=0;o<e.length;o++)if(h=e[o],h.Indexes===s){u=h.SelectedItems;break}return u==null?(console.log("No preselected data found for "+i+" at indexes: "+c.key),f.NO_VALUE):(l(u),u)},f.sortControlsBoundToDataSet=function(t,i,r){for(var o=f.getControlsUsingDataSet(t),s,e,u=0;u<o.length;u++)(s=o.eq(u),e=n.Common.getDirectiveScope(s),e!=null&&e.$sortBy!=null)&&e.$sortBy(r,i)},f.applyFiltersToControlsBoundToDataSet=function(t,i){for(var e=f.getControlsUsingDataSet(t),o,u,r=0;r<e.length;r++)(o=e.eq(r),u=n.Common.getDirectiveScope(o),u!=null&&u.$applyFilters!=null)&&u.$applyFilters(i)},f.clearFiltersToControlsBoundToDataSet=function(t,i){for(var e=f.getControlsUsingDataSet(t),o,u,r=0;r<e.length;r++)(o=e.eq(r),u=n.Common.getDirectiveScope(o),u!=null&&u.$clearFilters!=null)&&u.$clearFilters(i)},f._throttle=500,f._queue={},f.makeAsyncRequests=!1,f.NO_VALUE="NO_VALUE",f.addFilterToDataSet=function(t,i,r,u,e,o,s){for(var l=f.getControlsUsingDataSet(t),a,c,v,h=0;h<l.length;h++)(a=l.eq(h),c=n.Common.getDirectiveScope(a),c!=null)&&(v=c.$addFilter,v!=null)&&c.$addFilter(i,r,u,e,o,s)},f.addGlobalFilterToDataSet=function(t,i,r){for(var o=f.getControlsUsingDataSet(t),s,e,h,u=0;u<o.length;u++)(s=o.eq(u),e=n.Common.getDirectiveScope(s),e!=null)&&(h=e.$globalFilter,h!=null)&&e.$globalFilter(i,r)},f}();n.DatasourceManager=l}(Joove||(Joove={})),function(n){var i=function(){function t(t){if(this.$element=this.findElement(t),this.$element!=null&&this.$element.attr!=null){this.fromActiveElement=document.activeElement===this.$element.get(0);var i=this.$element.attr("jb-nospam");i==="true"&&(this.cfHelper=new n.ConditionalFormattingsHelper,this.shouldRun=!0)}}return t.prototype.findElement=function(n){var t,i;return n==null?null:n.currentTarget&&(t=$(n.currentTarget),t&&t.length>0)?$(t).eq(0):(i=$("[jb-id='"+n+"']"),i&&i.length>0)?$(i).eq(0):null},t.prototype.Enable=function(){if(this.shouldRun==!0&&(this.cfHelper.applyFormatting(this.$element,"Enable",null,null),this.fromActiveElement!==!1)){var n=document.activeElement!=null&&document.activeElement!=document.body;n===!1&&this.$element.focus()}},t.prototype.Disable=function(){this.shouldRun==!0&&this.cfHelper.applyFormatting(this.$element,"Disable",null,null)},t}(),t;n.SpamControlHelper=i;t=function(){function t(){}return t.prototype.applyFormatting=function(n,t,i,r){var u=n.attr("jb-type");switch(t){case"Enable":this.enableControl(n,u);break;case"Hide":this.hideControl(n,u,i);break;case"Disable":this.disableControl(n,u);break;case"ChangeStyle":this.changeStyleOfControl(n,[i],r,u);break;case"MakeReadOnly":this.makeControlReadOnly(n,u);break;case"Show":this.showControl(n,u,i);break;case"MakeEditable":this.makeControlEditable(n,u);break;case"Expand":this.expandControl(n,u);break;case"Collapse":this.collapseControl(n,u);break;case"ApplyCssClass":this.applyCssClassToControl(n,i,u);break;case"RemoveCssClass":this.removeCssClassFromControl(n,i,u);break;case"Active":this.makeControlActive(n,u);break;case"Required":this.makeControlRequired(n,u);break;case"NotRequired":this.makeControlNotRequired(n,u);break;case"SetColorRole":this.setColorRole(n,i,u)}},t.prototype.makeControlRequired=function(t,i){t.addClass(n.Validation.Constants.nowRequiredMark).removeClass(n.Validation.Constants.nowNotRequiredMark);switch(i){case"DropDownBox":window._themeManager.setControlState(t,n.ThemeManager.States.Required);this.applyOnSelect2Widget(t,function(i){window._themeManager.transferClassesOfStateToOtherElement(t,i,n.ThemeManager.States.Required)});break;default:window._themeManager.setControlState(t,n.ThemeManager.States.Required)}},t.prototype.makeControlNotRequired=function(t,i){t.addClass(n.Validation.Constants.nowNotRequiredMark).removeClass(n.Validation.Constants.nowRequiredMark);n.Validation.UiHelper.unmarkEmptyRequired(t);switch(i){case"DropDownBox":this.applyOnSelect2Widget(t,function(i){window._themeManager.transferRemovalOfClassesOfStateToOtherElement(t,i,n.ThemeManager.States.Required)});window._themeManager.removeControlState(t,n.ThemeManager.States.Required);break;default:window._themeManager.removeControlState(t,n.ThemeManager.States.Required)}},t.prototype.makeControlActive=function(n,t){switch(t){case"TabPage":var i=this.getTabPageTitle(n);i.click();break;default:console.error("Activating control '"+t+"' is not implemented!")}},t.prototype.hideControl=function(t,i,r,u){var a=this,h,c,e,o,s;u===void 0&&(u=0);switch(i){case"CheckBox":h=this.getCheckBoxContainer(t);h.hide().addClass("cf-hidden");break;case"TabPage":c=this.getTabPageTitle(t);c.hide().addClass("cf-hidden");t.hide();break;case"DropDownBox":this.applyOnSelect2Widget(t,function(n){n.hide()});break;case"RichTextBox":t.hide().prev("trix-toolbar").hide();break;case"FileAttachment":t.hide();e=t.next();e!=null&&e[0]!=null&&e[0].type=="file"&&(e.hide(),$("label[for='"+e[0].id+"']").hide());break;case"DataList":if(r!=null){var v=r.split("###"),l=n.Core.GetElementNameFromId(t.attr("jb-id")),f=n.Widgets.DataListControl.instancesDic[l];if(f==undefined)console.error("Could not get datalist control instance with id: "+l);else if(f.isInitialized)for(o=f.options.showRowNumbers?1:0;o<f.dataTableInstance.columns().count();o++){if(s=f.getColumnInfoForElement($(f.dataTableInstance.column(o).header())),s==undefined){f.handleError("DATALIST ERROR: ColumnInfo not found for column with index "+o);continue}v.contains(s.name)&&f.dataTableInstance.column(o).visible(!1)}else u<20&&(u=u||0,setTimeout(function(){a.hideControl(t,i,r,++u)},500))}else t.parents(".datatables-wrapper").eq(0).hide();break;default:t.hide()}t.addClass("cf-hidden")},t.prototype.showControl=function(t,i,r,u){var a=this,h,c,e,o,s;u===void 0&&(u=0);switch(i){case"CheckBox":h=this.getCheckBoxContainer(t);h.show().removeClass("cf-hidden");break;case"TabPage":c=this.getTabPageTitle(t);c.show().removeClass("cf-hidden");t.hasClass("jb-active")&&t.show();break;case"DropDownBox":this.applyOnSelect2Widget(t,function(n){n.show()});break;case"RichTextBox":t.show().prev("trix-toolbar").show();break;case"FileAttachment":t.show();e=t.next();e!=null&&e[0]!=null&&e[0].type=="file"&&(e.show(),$("label[for='"+e[0].id+"']").show());break;case"DataList":if(r!=null){var v=r.split("###"),l=n.Core.GetElementNameFromId(t.attr("jb-id")),f=n.Widgets.DataListControl.instancesDic[l];if(f==undefined)console.error("Could not get datalist control instance with id: "+l);else if(f.isInitialized)for(o=f.options.showRowNumbers?1:0;o<f.dataTableInstance.columns().count();o++){if(s=f.getColumnInfoForElement($(f.dataTableInstance.column(o).header())),s==undefined){f.handleError("DATALIST ERROR: ColumnInfo not found for column with index "+o);continue}v.contains(s.name)&&f.dataTableInstance.column(o).visible(!0)}else u<20&&(u=u||0,setTimeout(function(){a.showControl(t,i,r,++u)},500))}else t.parents(".datatables-wrapper").eq(0).show();break;default:t.show()}t.hasClass("data-list-control")===!0&&$(window).trigger("resize");t.removeClass("cf-hidden")},t.prototype.changeStyleOfControl=function(n,t,i,r){for(var f,e,u=0;u<t.length;u++)f=t[u],e=f.substring(0,f.lastIndexOf("_")),this.applyCssClassToControl(n,e+"_"+i,r),this.removeCssClassFromControl(n,e+"_"+!i,r)},t.prototype.makeControlReadOnly=function(t,i){window._themeManager.setControlState(t,n.ThemeManager.States.Readonly);switch(i){case"DropDownBox":this.disableDropDown(t);break;case"OptionButton":t.find("input[type='radio']").prop("disabled",!0);break;case"DateTimeBox":t.prop("disabled",!0);break;case"CheckBox":t.data("oldclick",t.attr("onclick"));t.attr("onclick","return false;");break;case"FileAttachment":t.find(".remove").hide();t.next("input[type='file']").prop("disabled",!0);t.next("input[type='file']").hide();break;case"RichTextBox":t.get(0).contentEditable="false";break;default:t.prop("readonly",!0)}},t.prototype.makeControlEditable=function(t,i){switch(i){case"DropDownBox":this.enableDropDown(t);break;case"OptionButton":t.find("input[type='radio']").prop("disabled",!1);break;case"DateTimeBox":t.prop("disabled",!1);break;case"CheckBox":var r=t.data("oldclick");r==null||r===""?t.removeAttr("onclick"):t.attr("onclick",r);break;case"FileAttachment":t.find(".remove").show();t.next("input[type='file']").prop("disabled",!1);t.next("input[type='file']").show();break;case"RichTextBox":t.get(0).contentEditable="true";break;default:t.prop("readonly",!1)}window._themeManager.removeControlState(t,n.ThemeManager.States.Readonly)},t.prototype.expandControl=function(t,i){switch(i){case"FieldSet":var r=t.find(' > [jb-type="FieldSetHeader"] .toggle-state-icon'),u=n.ThemeManager.DefaultClasses[n.ThemeManager.States.Expanded].split(" ");u.some(function(n){return r.hasClass(n)})||t.find(".toggle-state-icon").get(0).click();break;default:console.error("Expanding control '"+i+"' is not implemented!")}},t.prototype.collapseControl=function(t,i){switch(i){case"FieldSet":var r=t.find(' > [jb-type="FieldSetHeader"] .toggle-state-icon'),u=n.ThemeManager.DefaultClasses[n.ThemeManager.States.Collapsed].split(" ");u.some(function(n){return r.hasClass(n)})||t.find(".toggle-state-icon").get(0).click();break;default:console.error("Collapsing control '"+i+"' is not implemented!")}},t.prototype.applyCssClassToControl=function(n,t,i){switch(i){case"DropDownBox":n.addClass(t);this.applyOnSelect2Widget(n,function(n){n.addClass(t)});break;case"CheckBox":var r=n.attr("jb-id");$("[jb-id='"+r+"_State']",n.parent()).addClass(t);break;default:n.addClass(t)}},t.prototype.removeCssClassFromControl=function(n,t,i){switch(i){case"CheckBox":var r=n.attr("jb-id");$("[jb-id='"+r+"_State']",n.parent()).removeClass(t);break;case"DropDownBox":n.removeClass(t);this.applyOnSelect2Widget(n,function(n){n.removeClass(t)});break;default:n.removeClass(t)}},t.prototype.setColorRole=function(n,t,i){var r=n.attr("ui-role-color"),u=window._themeManager.getCssClassesByRole(n,t),f=r==null||r.trim()==""?"":window._themeManager.getCssClassesByRole(n,r);n.attr("ui-role-color",t);n.removeClass(f);n.addClass(u);switch(i){case"TabContainer":this.setColorRole(n.find("[jb-type='TabHeader']").eq(0),t,"TabHeader");this.setColorRole(n.find("[jb-type='TabContent']").eq(0),t,"TabContent");this.setColorRole(n.find("[jb-type='TabPage']").eq(0),t,"TabPage");break;case"FieldSet":this.setColorRole(n.find("[jb-type='FieldSetBody']").eq(0),t,"FieldSetBody");this.setColorRole(n.find("[jb-type='FieldSetHeader']").eq(0),t,"FieldSetHeader");this.setColorRole(n.find("[jb-type='FieldSetFooter']").eq(0),t,"FieldSetFooter");break;case"Grid":case"DataSourceGrid":case"Table":this.setColorRole(n.children("[jb-type='tHeader']").eq(0),t,"tHeader");this.setColorRole(n.children("[jb-type='tBody']").eq(0),t,"tBody");this.setColorRole(n.children("[jb-type='tFooter']").eq(0),t,"tFooter");this.setColorRole(n.find("[jb-type='Pager']").eq(0),t,"Pager");this.setColorRole(n.find("[jb-type='AddItemLabel']").eq(0),t,"AddItemLabel")}},t.prototype.disableControl=function(t,i){var u,r,f;switch(i){case"TabContainer":case"TabHeaderPageTitle":case"FieldSet":case"TabPage":for(u=this.getChildrenOfContainer(t,i),r=0;r<u.length;r++)f=u.eq(r),this.disableControl(f,f.attr("jb-type"));break;case"DropDownBox":this.disableDropDown(t);break;case"OptionButton":t.find("input[type='radio']").prop("disabled",!0);break;case"FileAttachment":this.makeControlReadOnly(t,i);break;case"RichTextBox":t.get(0).contentEditable="false";break;default:t.attr("disabled","true");t.css("pointer-events","none")}window._themeManager.setControlState(t,n.ThemeManager.States.Disabled)},t.prototype.enableControl=function(t,i){var u,r,f;switch(i){case"TabContainer":case"TabHeaderPageTitle":case"FieldSet":case"TabPage":for(u=this.getChildrenOfContainer(t,i),r=0;r<u.length;r++)f=u.eq(r),this.enableControl(f,f.attr("jb-type"));break;case"DropDownBox":this.enableDropDown(t);break;case"OptionButton":t.find("input[type='radio']").prop("disabled",!1);break;case"FileAttachment":this.makeControlEditable(t,i);break;case"RichTextBox":t.get(0).contentEditable="true";break;default:t.removeAttr("disabled");t.css("pointer-events","auto")}window._themeManager.removeControlState(t,n.ThemeManager.States.Disabled)},t.prototype.getChildrenOfContainer=function(n,t){switch(t){case"TabContainer":return n.children("[jb-type='TabHeader']").children("[jb-type='TabHeaderPageTitle']");case"TabHeaderPageTitle":var i=n.data("index"),r=n.closest("[jb-type='TabContainer']"),u=r.children("[jb-type='TabContent']").children("[data-index='"+i+"']").eq(0);return u.find("[jb-type]");default:return n.find("[jb-type]")}},t.prototype.getCheckBoxContainer=function(n){return n.parent()},t.prototype.getTabPageTitle=function(n){var t=n.data("index"),i=n.closest("[jb-type='TabContainer']");return i.children("[jb-type='TabHeader']").children("[data-index='"+t+"']").eq(0)},t.prototype.enableDropDown=function(t){t.removeAttr("readonly");t.prop("disabled",!1);this.applyOnSelect2Widget(t,function(i){window._themeManager.transferRemovalOfClassesOfStateToOtherElement(t,i,n.ThemeManager.States.Readonly)})},t.prototype.disableDropDown=function(t){t.attr("readonly","readonly");t.prop("disabled",!0);this.applyOnSelect2Widget(t,function(i){window._themeManager.transferClassesOfStateToOtherElement(t,i,n.ThemeManager.States.Readonly)})},t.prototype.applyOnSelect2Widget=function(n,t,i){var u=this,r=n.next(".select2");if(i=i||0,(r==null||r.length==0)&&i<100){setTimeout(function(){u.applyOnSelect2Widget(n,t,++i)},50);return}t&&t(r)},t}();n.ConditionalFormattingsHelper=t}(Joove||(Joove={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}();Date.prototype.addDays=function(n){return this.setDate(this.getDate()+n),this};String.prototype.format||(String.prototype.format=function(){var n=arguments;return this.replace(/{(\d+)}/g,function(t,i){return typeof n[i]!="undefined"?n[i]:t})});String.prototype.hashCode||(String.prototype.hashCode=function(){var n=0,t=this.length,i=0;if(t>0)while(i<t)n=(n<<5)-n+this.charCodeAt(i++)|0;return n});Array.prototype.linq||Object.defineProperty(Array.prototype,"linq",{get:function(){return System.Linq.Enumerable.from(this)},enumerable:!1,configurable:!0});Array.prototype.add||Object.defineProperty(Array.prototype,"add",{value:function(n){return this==null?[n]:this.push(n)},enumerable:!1,configurable:!0});Array.prototype.toArray||Object.defineProperty(Array.prototype,"toArray",{value:function(){return this},enumerable:!1,configurable:!0});Array.prototype.addManyNew||Object.defineProperty(Array.prototype,"addManyNew",{value:function(n,t){for(var i=0;i<n;i++)this.push(t());return this},enumerable:!1,configurable:!0});Array.prototype.clear||Object.defineProperty(Array.prototype,"clear",{value:function(){return this==null?this:(this.splice(0,this.length),this)},enumerable:!1,configurable:!0});Array.prototype.contains||Object.defineProperty(Array.prototype,"contains",{value:function(n){if(this==null)return!1;var t=new System.Collections.List(this);return t.contains(n)},enumerable:!1,configurable:!0});Array.prototype.remove||Object.defineProperty(Array.prototype,"remove",{value:function(n){if(this!=null){var t=this.indexOf(n);if(t!=-1)return this.splice(t,1),this}},enumerable:!1,configurable:!0});Array.prototype.addRange||Object.defineProperty(Array.prototype,"addRange",{value:function(n){if(n!=null&&this!=null){for(var t=0;t<n.length;t++)this.push(n[t]);return this}},enumerable:!1,configurable:!0});Array.prototype.insert||Object.defineProperty(Array.prototype,"insert",{value:function(n,t){this.splice(n,0,t)},enumerable:!1,configurable:!0});Array.prototype.toCollection||Object.defineProperty(Array.prototype,"toCollection",{value:function(){return new System.Collections.List(this)},enumerable:!1,configurable:!0});Math.round10||(Math.round10=function(n,t){return Joove.Common.decimalAdjust("round",n,t)});Math.floor10||(Math.floor10=function(n,t){return Joove.Common.decimalAdjust("floor",n,t)});Math.ceil10||(Math.ceil10=function(n,t){return Joove.Common.decimalAdjust("ceil",n,t)});Math.sign||(Math.sign=function(n){return Number(n>0)-Number(n<0)||+n});NULL=Object.freeze({}),function(n){var t;(function(t){var i,r,u,f,e,o,s,h,c,l,a,v;(function(n){function t(n){var u,f,e=n.split(":"),i=e[0],h=e[1],r=e[2],t,o,s;return i.indexOf(".")!==-1&&(o=i.split("."),u=o[0],i=o[1]),r.indexOf(".")!==-1&&(s=r.split("."),r=s[0],f=s[1]),t=new System.Time.TimeSpan(0,System.Time.TimeUnit.Days),u!=null&&(t=t.addUnit(parseInt(u),System.Time.TimeUnit.Days)),i!=null&&(t=t.addUnit(parseInt(i),System.Time.TimeUnit.Hours)),h!=null&&(t=t.addUnit(parseInt(h),System.Time.TimeUnit.Minutes)),r!=null&&(t=t.addUnit(parseInt(r),System.Time.TimeUnit.Seconds)),f!=null&&(t=t.addUnit(parseInt(f),System.Time.TimeUnit.Milliseconds)),t}n.Parse=t})(i=t.Timespan||(t.Timespan={})),function(n){function t(n,t,i){var r=moment(n);return i!=null&&r.locale(i.Code),t==null&&r.format(),r.format(Joove.Common.changeDateTimeFormat(t)).toUpperCase()}function i(n,t,i){return i!=null?(i=typeof i=="string"?Joove.Common.changeDateTimeFormat(i):i.map(function(n){return typeof n=="string"?Joove.Common.changeDateTimeFormat(n):n}),moment(n,i,t)):moment(n,t||"en-US")}function r(n,t){var i=Joove.Common.dateDiff(n,t);return Math.sign(i.milliseconds)}n.ToString=t;n.ParseExact=i;n.Compare=r}(r=t.DateTime||(t.DateTime={})),function(n){function t(n){return n=="true"}n.Parse=t}(u=t.Boolean||(t.Boolean={})),function(n){function t(n){if(n==null)return null;var t=parseInt(n);return isNaN(t)?null:t}n.Parse=t}(f=t.Integer||(t.Integer={})),function(n){function t(n){if(n==null)return null;var t=parseInt(n);return isNaN(t)?null:t}n.Parse=t}(e=t.Long||(t.Long={})),function(n){function t(n){if(n==null)return null;var t=parseFloat(n);return isNaN(t)?null:t}n.Parse=t}(o=t.Float||(t.Float={})),function(n){function t(n){if(n==null)return null;var t=parseFloat(n);return isNaN(t)?null:t}n.Parse=t}(s=t.Decimal||(t.Decimal={})),function(n){function t(n){if(n==null)return null;var t=parseFloat(n);return isNaN(t)?null:t}n.Parse=t}(h=t.Double||(t.Double={})),function(n){function t(n,t,i){return i===void 0&&(i=!1),i===!0&&(n=n==null?"":n.toLocaleLowerCase(),t=t==null?"":t.toLocaleLowerCase()),n.localeCompare(t)}function i(n,t){return t.join(n)}function r(){throw new System.Exceptions.NotImplementedException("CLMS.Framework.String.IsSingular: Not Implemented yet!");}function u(){throw new System.Exceptions.NotImplementedException("CLMS.Framework.String.IsPlural: Not Implemented yet!");}function f(){throw new System.Exceptions.NotImplementedException("CLMS.Framework.String.Singularize: Not Implemented yet!");}function e(){throw new System.Exceptions.NotImplementedException("CLMS.Framework.String.Pluralize: Not Implemented yet!");}function o(n){for(var i=[],r,t=1;t<arguments.length;t++)i[t-1]=arguments[t];return(r=n).format.apply(r,i)}function s(n,t){return n instanceof Array?n.join(""):n.toString()+t}function h(n,t,i){return n.replace(new RegExp(t),i)}function c(n){return n==="undefined"||Joove.Common.stringIsNullOrEmpty(n)}function l(n,t){return Array(t+1).join(n)}n.Empty="";n.Compare=t;n.Join=i;n.IsSingular=r;n.IsPlural=u;n.Singularize=f;n.Pluralize=e;n.Format=o;n.Concat=s;n.SplitCamelCase=h;n.IsNullOrEmpty=c;n.FillWith=l}(c=t.String||(t.String={})),function(n){function c(){window._context.isModal===!0&&setTimeout(function(){$("[jb-type='TextBox'], [jb-type='TextArea'], [jb-type='RichTextBox'], [jb-type='PasswordTextBox'], [jb-type='DateTimeBox'], [jb-type='PasswordTextBox']").eq(0).focus()},500)}function l(n,t,i,r){i==NULL&&(i=function(){});r==NULL&&(r=function(){});n.apply(void 0,t).then(i).catch(r).then(function(){Joove.Core.applyScope(Joove.Common.getScope())})}function a(n){throw new System.Exceptions.NotImplementedException(n+": Not Implemented yet!");}function v(n,t,i){t===void 0&&(t="_blank");i===void 0&&(i=!0);var r=window.open(n,t);try{r.focus()}catch(u){i==!0&&window._popUpManager.warning(window._resourcesManager.getPopupBlockedTitle(),window._resourcesManager.getPopupBlockedMessage())}}function y(n){var i=new URLSearchParams(location.search),t,r;if(i&&i.has(n))return i.get(n);if(window._context&&window._context.routeData&&window._context.routeData.length&&window._context.routeData.length>0)for(t=0;t<window._context.routeData.length;t++)if(r=window._context.routeData[t],r.key.toLowerCase()==n.toLowerCase())return r.value;return""}function p(n){for(var t=[n],r=0,u,e,f,i=0;i<t.length;i++)switch(typeof t[i]){case"boolean":r+=4;break;case"number":r+=8;break;case"string":r+=2*t[i].length;break;case"object":if(Object.prototype.toString.call(t[i])!="[object Array]")for(u in t[i])r+=2*u.length;for(u in t[i]){for(e=!1,f=0;f<t.length;f++)if(t[f]===t[i][u]){e=!0;break}e||t.push(t[i][u])}}return r}var i,r,u,f,e,t,o,s,h;n.FocusOnFirstInputElementOfModal=c;n.ExecuteRequest=l;n.ThrowException=a;n.OpenWindow=v;n.GetURIParameterValue=y;n.SizeOf=p;i=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t}(System.Exceptions.NotImplementedException);n.ValidationException=i;r=function(){function n(){}return n}();n.MambaRuntimeType=r;u=function(){function n(){}return n}();n.Path=u;f=function(){function n(){}return n.SendMail=function(n,i,r,u,f,e,o,s){u===void 0&&(u="");f===void 0&&(f="");e===void 0&&(e="");o===void 0&&(o=null);s===void 0&&(s=!1);n instanceof t},n}();n.Email=f;e=function(){function n(){}return n.prototype.ToJson=function(n){return JSON.stringify(n)},n.prototype.FromJson=function(n){return Joove.Common.toJson(n)},n.prototype.ToXml=function(n,t){var r=function(n,t,i){var f="",e,s,o,u;if(n instanceof Array)for(e=0,s=n.length;e<s;e++)f+=i+r(n[e],t,i+"\t")+"\n";else if(typeof n=="object"){o=!1;f+=i+"<"+t;for(u in n)n.hasOwnProperty(u)&&(u.charAt(0)==="@"?f+=" "+u.substr(1)+'="'+n[u].toString()+'"':o=!0);if(f+=o?">":"/>",o){for(u in n)n.hasOwnProperty(u)&&(u==="#text"?f+=n[u]:u==="#cdata"?f+="<![CDATA["+n[u]+"]\]>":u.charAt(0)!=="@"&&(f+=r(n[u],u,i+"\t")));f+=(f.charAt(f.length-1)==="\n"?i:"")+"<\/"+t+">"}}else f+=i+"<"+t+">"+n.toString()+"<\/"+t+">";return f},u="",i;for(i in n)n.hasOwnProperty(i)&&(u+=r(n[i],i,""));return t?u.replace(/\t/g,t):u.replace(/\t|\n/g,"")},n.prototype.FromXml=function(n){return jQuery.parseXML(n)},n.prototype.ParseEnum=function(){throw new System.Exceptions.NotImplementedException(name+": Not Implemented yet!");},n}();n.Serializer=e;t=function(){function n(){this.To=[];this.CC=[];this.Bcc=[]}return n}();n.EMailMessage=t;o=function(){function n(){}return n}();n.DataAccessContext=o;s=function(){function n(){}return n}();n.PagedResults=s;h=function(){function n(){}return n.ConvertToDateTime=function(n,t){return t===void 0&&(t=!0),Joove.Common.convertToDateTime(n)},n.ConvertToInt=function(n,t){return t===void 0&&(t=!0),Joove.Common.convertToNumber(n)},n.ConvertToDouble=function(n,t){return t===void 0&&(t=!0),Joove.Common.convertToNumber(n)},n.ConvertToGuid=function(n,t){return t===void 0&&(t=!0),System.Guid.Parse(n)},n.ConvertToDecimal=function(n,t){return t===void 0&&(t=!0),Joove.Common.convertToNumber(n)},n.ConvertToLong=function(n,t){return t===void 0&&(t=!0),Joove.Common.convertToNumber(n)},n.Base64Decode=function(n){return decodeURIComponent(window.escape(window.atob(n)))},n.Base64Encode=function(n){return window.btoa(window.unescape(encodeURIComponent(n)))},n.GetMD5Hash=function(){throw new System.Exceptions.NotImplementedException("GetMD5: Not Implemented yet!");},n.IsTypePrimitiveOrSimple=function(){throw new System.Exceptions.NotImplementedException("IsTypePrimitiveOrSimple: Not Implemented yet!");},n.IsTypeCollection=function(){throw new System.Exceptions.NotImplementedException("IsTypeCollection: Not Implemented yet!");},n.IsPropertyPrimitiveOrSimple=function(){throw new System.Exceptions.NotImplementedException("IsPropertyPrimitiveOrSimple: Not Implemented yet!");},n.IsPropertyCollection=function(){throw new System.Exceptions.NotImplementedException("IsPropertyCollection: Not Implemented yet!");},n}();n.Common=h}(l=t.Utilities||(t.Utilities={})),function(n){var i=function(){function n(){}return n.IsPropertyDirty=function(){var n=t.Instance.Session;throw new System.Exceptions.NotImplementedException("IsPropertyDirty: Not Implemented yet!");},n}(),t;n.DataManager=i;t=function(){function n(){}return n.prototype.OpenSession=function(){throw new System.Exceptions.NotImplementedException("OpenSession: Not Implemented yet!");},n.prototype.OpenSessionWithTransaction=function(){throw new System.Exceptions.NotImplementedException("OpenSessionWithTransaction: Not Implemented yet!");},n.prototype.BeginTransaction=function(){throw new System.Exceptions.NotImplementedException("BeginTransaction: Not Implemented yet!");},n.prototype.CommitChanges=function(n){n===void 0&&(n=null);throw new System.Exceptions.NotImplementedException("CommitChanges: Not Implemented yet!");},n.prototype.Dispose=function(){throw new System.Exceptions.NotImplementedException("BeginTransaction: Not Implemented yet!");},n.prototype.ExecuteInTransaction=function(){throw new System.Exceptions.NotImplementedException("BeginTransaction: Not Implemented yet!");},n}();n.MiniSessionManager=t}(a=t.Data||(t.Data={})),function(t){function i(n,t){var i=Joove.Common.nullSafe(n,null),r=Joove.Common.nullSafe(t,null);return i==r}function r(n,t){var i=Joove.Common.nullSafe(n,null),r=Joove.Common.nullSafe(t,null);return i!=r}function u(n,t){var i=Joove.Common.nullSafe(n,null),r=Joove.Common.nullSafe(t,null);return i<r}function f(n,t){var i=Joove.Common.nullSafe(n,null),r=Joove.Common.nullSafe(t,null);return i>r}function e(t,i){var r=Joove.Common.nullSafe(t,null),u=Joove.Common.nullSafe(i,null);return n.Framework.Number.Equal(t,i)||r<=u}function o(t,i){var r=Joove.Common.nullSafe(t,null),u=Joove.Common.nullSafe(i,null);return n.Framework.Number.Equal(t,i)||r>=u}t.Equal=i;t.NotEqual=r;t.LessThan=u;t.GreaterThan=f;t.LessThanOrEqual=e;t.GreaterThanOrEqual=o}(v=t.Number||(t.Number={}))})(t=n.Framework||(n.Framework={}))}(CLMS||(CLMS={})),function(n){var s,t,i,u,f,e,r,o;(function(n){n[n.TOP=0]="TOP";n[n.TOP_RIGHT=1]="TOP_RIGHT";n[n.TOP_LEFT=2]="TOP_LEFT";n[n.RIGHT=3]="RIGHT";n[n.LEFT=4]="LEFT";n[n.BOTTOM_RIGHT=5]="BOTTOM_RIGHT";n[n.BOTTOM_LEFT=6]="BOTTOM_LEFT";n[n.BOTTOM=7]="BOTTOM"})(s=n.Placement||(n.Placement={})),function(n){n[n.COLLECTION=0]="COLLECTION";n[n.DICTIONARY=1]="DICTIONARY";n[n.FUNC=2]="FUNC";n[n.COLLECTIONBASE=3]="COLLECTIONBASE";n[n.STRING=4]="STRING";n[n.BOOL=5]="BOOL";n[n.INT=6]="INT";n[n.DOUBLE=7]="DOUBLE";n[n.DECIMAL=8]="DECIMAL";n[n.FLOAT=9]="FLOAT";n[n.LONG=10]="LONG";n[n.DATETIME=11]="DATETIME";n[n.CHAR=12]="CHAR";n[n.GUID=13]="GUID";n[n.BYTE=14]="BYTE";n[n.OBJECT=15]="OBJECT";n[n.RUNTIMETYPE=16]="RUNTIMETYPE";n[n.RUNTIMEPROPERTY=17]="RUNTIMEPROPERTY";n[n.EXCEPTION=18]="EXCEPTION";n[n.TIMESPAN=19]="TIMESPAN";n[n.BUSINESSEXCEPTION=20]="BUSINESSEXCEPTION";n[n.NUMBER=21]="NUMBER"}(t=n.MambaDataType||(n.MambaDataType={}));i=function(){var n=1;return function(){return n++}}();u=function(){function n(){}return n.info=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];CLMS.Framework.Utilities.DebugHelper.Instance().Info(t)},n.debug=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];CLMS.Framework.Utilities.DebugHelper.Instance().Debug(t)},n.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];CLMS.Framework.Utilities.DebugHelper.Instance().Error(t)},n}();n.Logger=u;f=function(){function t(){}return t.DeepEqual=function(i,r,u){var s,p,c,l,a,v,y,o,h,f,e;if(u===void 0&&(u=null),i===r)return!0;if(s=Array.isArray(i),p=Array.isArray(r),s!=p)return n.Logger.info("Array is not equal",i,r),!1;if(s&&s){if(c=i.length,c!=r.length)return!1;for(f=0;f<c;f++)if(!t.DeepEqual(i[f],r[f],u))return n.Logger.info("Array is not equal",i[f],r[f]),!1;return!0}if(l=i instanceof Date,a=r instanceof Date,l!=a)return!1;if(l&&a)return i.getTime()==r.getTime();if(v=i instanceof RegExp,y=r instanceof RegExp,v!=y)return!1;if(v&&y)return i.toString()==r.toString();if(i instanceof Object&&r instanceof Object){if(o=Object.keys(i),h=o.length,h!==Object.keys(r).length)return n.Logger.info("Object is not equal",i,r),!1;for(f=0;f<h;f++)if(!Object.prototype.hasOwnProperty.call(r,o[f]))return n.Logger.info("Property is missing",r,o[f]),!1;for(f=0;f<h;f++)if((e=o[f],u==null||!u(e))&&!t.DeepEqual(i[e],r[e],u))return n.Logger.info("Object is not equal",i[e],r[e]),!1;return!0}return!1},t.IsEqual=function(n,t,i){switch(i){case"bool":case"int":case"float":case"double":case"decimal":case"char":return String(n)===String(t);default:return n==t}},t}();n.Comparator=f;e=function(){function r(){}return r.safeDeepPropertySet=function(n,t,i){for(var u=typeof t=="string"?t.split("."):t,r=0,o=u.length,f=n,e;r<o;++r)e=f[u[r]],f=f[u[r]]=r===o-1?i:e==null?{}:e},r.safeDeepPropertyAccess=function(n,t,i){for(var r=0,u=t.split?t.split("."):t;n&&r<u.length;)n=n[u[r++]];return n===undefined?i:n},r.project=function(n,t,i,u,f){var o,h,e,c,s;if(i===void 0&&(i=null),u===void 0&&(u=null),f===void 0&&(f=!1),n==null||t==null)return null;if(r.valueIsPrimitive(n)||(o={},h=!1,i!=null&&(u==null&&(u=0),h=!0),f===!0&&r.isEmptyObject(t)))return n;for(e in t)if(n[e]!==undefined&&t[e]!==null){if(n[e]==null){o[e]=null;continue}if(r.isArray(n[e])){for(c=[],s=0;s<n[e].length;s++)(h==!1||s==i[u])&&c.push(r.project(n[e][s],t[e],i,u+1,f));o[e]=c}else o[e]=r.valueIsObject(n[e])?r.project(n[e],t[e],i,u,f):n[e]}return o},r.isEmptyObject=function(n){for(var t in n)if(Object.prototype.hasOwnProperty.call(n,t))return!1;return!0},r.dateDiff=function(n,t){var i=moment(n),r=moment(t);return new System.Time.TimeSpan(i.diff(r))},r.stringContains=function(n,t,i){return i===void 0&&(i=!0),i?n.toLowerCase().indexOf(t.toLowerCase())!==-1:n.indexOf(t)!==-1},r.stringIsNullOrEmpty=function(n){return n==null||n===""},r.stringEndsWith=function(n,t){return n.indexOf(t,this.length-t.length)!==-1},r.decimalAdjust=function(n,t,i){return typeof i=="undefined"||+i==0?Math[n](t):(t=+t,i=+i,t===null||isNaN(t)||!(typeof i=="number"&&i%1==0))?NaN:t<0?-r.decimalAdjust(n,-t,i):(t=t.toString().split("e"),t=Math[n](+(t[0]+"e"+(t[1]?+t[1]-i:-i))),t=t.toString().split("e"),+(t[0]+"e"+(t[1]?+t[1]+i:i)))},r.round=function(n,t){return r.decimalAdjust("round",n,t)},r.ceil=function(n,t){return r.decimalAdjust("ceil",n,t)},r.floor=function(n,t){return r.decimalAdjust("floor",n,t)},r.sign=function(n){return Number(n>0)-Number(n<0)||+n},r.createDate=function(n,t,i,r,u,f){var e=new Date;return e.setFullYear(n,t,i),r!=null&&e.setHours(r),u!=null&&e.setMinutes(u),f!=null&&e.setSeconds(f),e},r.createEvent=function(n){if(typeof Event=="function")return new Event(n);var t=document.createEvent("Event");return t.initEvent(n,!0,!0),t},r.isVisibleOnViewPort=function(n){var r=window.innerWidth,i=window.innerHeight,t=n.get(0).getBoundingClientRect();return t.left<i-t.width,null},r.toggleDebugMode=function(n){localStorage.setItem("__debug",n+"")},r.isInDebugMode=function(){return localStorage.getItem("__debug")=="true"},r.getMatch=function(n,t,i){i===void 0&&(i=null);try{var r=n.exec(t);return r&&r.length>0?r[0]:i?i:null}catch(u){if(i)return i;console.error(u)}},r.getMatches=function(n,t,i){i===void 0&&(i=null);try{var r=t.match(n);return r&&r.length>0?r:i?i:null}catch(u){if(i)return i;console.error(u)}},r.isValidEmail=function(n){if(n==null)return!1;return/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(n)},r.isValidUrl=function(n){if(n==null)return!1;var t=new RegExp("^(?:(?:https?|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))\\.?)(?::\\d{2,5})?(?:[/?#]\\S*)?$","i");return t.test(n)?!0:!1},r.modelToJson=function(n){return JSON.parse(n)},r.cloneObject=function(n){if(n==null)return null;if(r.valueIsObject(n)===!1)return n;for(var i,t,u,f,e,o,s=[{source:n,target:Object.create(Object.getPrototypeOf(n))}],h=s[0].target,c=[n],l=[h];f=s.shift();)for(u=Object.getOwnPropertyNames(f.source),i=0;i<u.length;i++){if(t=Object.getOwnPropertyDescriptor(f.source,u[i]),!t.value||r.valueIsObject(t.value)===!1){Object.defineProperty(f.target,u[i],t);continue}if(e=t.value,t.value=Array.isArray(e)?[]:Object.create(Object.getPrototypeOf(e)),o=c.indexOf(e),o!==-1){t.value=l[o];Object.defineProperty(f.target,u[i],t);continue}c.push(e);l.push(t.value);Object.defineProperty(f.target,u[i],t);s.push({source:e,target:t.value})}return h},r.valueIsObject=function(n){return typeof n=="object"&&n!==null&&n instanceof Boolean==!1&&n instanceof Date==!1&&n instanceof Number==!1&&n instanceof RegExp==!1&&n instanceof String==!1},r.valueIsPrimitive=function(n){return!r.valueIsObject(n)&&!r.isArray(n)},r.setKeyAsClientKey=function(n){n!=null&&n._clientKey==null&&n._key!=null&&(n._clientKey=n._key)},r.objectsAreEqual=function(n,t,i){return(r.setKeyAsClientKey(n),r.setKeyAsClientKey(t),i===!0&&n!=null&&t!=null&&n._typeHash!=t._typeHash)?!1:n===t?!0:(n==null||n==undefined)&&(t==null||t==undefined)?!0:n!=null&&t!=null&&(n._clientKey||t._clientKey)&&t._clientKey===n._clientKey?!0:n==null||t==null?!1:typeof t._key!="undefined"&&r.keyHasDefaultValue(n._key)===!1&&t._key===n._key?!0:typeof t.$$hashKey!="undefined"&&t.$$hashKey===n.$$hashKey?!0:!1},r.getClassInstanceKey=function(n){if(n._originalTypeClassName==null)return null;var t=n._originalTypeClassName;return n._clientKey!=null?t+"_"+n._clientKey:n._key==null||n._key==0||n._key==""?null:t+"_"+n._key},r.collectionsAreEqual=function(n,t){if(n==null&&t==null)return!0;if(n==null&&t!=null||n!=null&&t==null||n.length!=t.length)return!1;for(var i=0;i<n.length;i++)if(r.objectsAreEqual(n[i],t[i])===!1)return!1;return!0},r.updateInstanceReferencesAccrossModel=function(t){var i=new n.ReferencesReconstructor;i.addFreshInstance(t);i.reconstructReferences(window.$form.model)},r.updateManyInstanceReferencesAccrossModel=function(t){var i=new n.ReferencesReconstructor;i.addFreshArrayOfInstances(t);i.reconstructReferences(window.$form.model)},r.replaceAll=function(n,t,i){return n==null?null:n.split(t).join(i)},r.getDirectiveScope=function(n){var t=n.data("jb-directive-id");return window["directive_"+t]},r.setDirectiveScope=function(n,t){var r=i();window["directive_"+r]=t;n.data("jb-directive-id",r)},r.directiveScopeIsReady=function(n){return n.data("jb-ready")===!0},r.markDirectiveScopeAsReady=function(n){return n.data("jb-ready",!0)},r.markDirectiveScopeAsNotReady=function(n){return n.data("jb-ready",!1)},r.parentGridsAreReady=function(n){for(var i=n.parents("[jb-type='Grid']"),u,t=0;t<i.length;t++)if(u=i.eq(0),r.directiveScopeIsReady(u)===!1)return!1;return!0},r.getContextFromElement=function(n){var i=[],r=n.attr("data-context-items"),u,f,t;if(r==null||r.trim()=="")return i;for(u=r.split(","),f=angular.element(n.get(0)).scope(),t=0;t<u.length;t++)i.push(f[u[t]]);return i},r.getRepeatersOfElement=function(n){var t="[ng-repeat], [ng-repeat-start], [ng-repeat-end]",i=n.parents(t);return i.length!==0?i:n.parents("[jb-original-collection]").siblings(t)},r.getFullBindingPathOfControl=function(n,t){var o=t.split("."),i,e,u,f;if(o[0]==="model")return t;i={};e=r.getRepeatersOfElement(n);e.each(function(n,t){var e=$(t).attr("ng-repeat")||$(t).attr("ng-repeat-start")||$(t).attr("ng-repeat-end"),f=e.split(" in "),u,r;if(f.length!==2||(u=f[0].trim(),u==""))return alert("getFullBindingPathOfControl: unexpeted syntax of ng-repeat"),!1;if(r=$(t).attr("jb-original-collection"),r==null||r.trim()=="")return alert("getFullBindingPathOfControl: could not find the 'jb-original-collection' attribute"),!1;i[u]={collectionName:r,positionInCollection:$(t).attr("data-context-index")}});for(u in i)i.hasOwnProperty(u)&&(f=i[u],f.collectionName=r.fixBindingPath(i,f.collectionName));return r.fixBindingPath(i,t)},r.fixBindingPath=function(n,t){var r=t.split("."),u=r[0],i,f;return u==="model"?t:(r.splice(0,1),i=n[u],i==null)?(alert("getFullBindingPathOfControl: I didn't find parent element"),null):(f=i.collectionName+"["+i.positionInCollection+"]",f+"."+r.join("."))},r.getAction=function(n,t){var u,i;return(t===void 0&&(t=!1),u=function(){return null},n==null||n.trim()=="")?u:(i=null,i=t===!0?r.getMasterScope():r.getScope(),i==null)?(console.error("Could not find the required scope!"),u):i.actions[n]},r.executeAction=function(n){for(var u=[],i,t=1;t<arguments.length;t++)u[t-1]=arguments[t];if(i=r.getAction(n,!0),i==null){console.error("Action '"+n+"' not found");return}i.apply(null,u)},r.executeEventCallback=function(n){for(var u=[],i,t=1;t<arguments.length;t++)u[t-1]=arguments[t];if(i=r.getScope().eventCallbacks[n],i==null&&(i=r.getMasterScope().eventCallbacks[n]),i==null){console.error("Event callback '"+n+"' not found");return}Array.prototype.splice.call(u,0,1);i.apply(null,u)},r.getScope=function(){return window["scope_"+window._context.currentController]},r.getModel=function(){return r.getScope().model},r.getMasterScope=function(){return window["scope_"+window._context.currentMasterPageController]},r.getMasterModel=function(){return r.getMasterScope().model},r.serializeIndexes=function(n){for(var t="",i=0;i<n.length;i++)t+=n[i]+"_";return t===""&&(t="_"),t},r.getContextItemElement=function(n){return n.closest("[data-context-index]")},r.getIndexesOfControl=function(n){var f=n.parents("[data-context-index]").toArray(),t,i,r,u;for(n.attr("data-context-index")!=null&&f.unshift(n),t=[],i="",r=0;r<f.length;r++){if(u=parseInt($(f[r]).attr("data-context-index")),isNaN(u)){t=null;i=null;break}t.push(u);i+=u+"_"}return{indexes:t,key:i}},r.getContextOfControl=function(n){var i=n.parents("[data-context-index]").toArray(),r,t,u,f;for(n.attr("data-context-index")!=null&&i.unshift(n),r={},t=0;t<i.length;t++)u=$(i[t]).attr("data-context-item"),f=angular.element(i[t]).scope()[u],r[u]=f;return r},r.getIndexKeyOfControl=function(t){var i=n.Common.getIndexesOfControl(t);return i==null?null:i.key},r.toHTML=function(n){if(n==null)return n;try{var i=new DOMParser,t=i.parseFromString(n,"text/html");return t.body.textContent==="null"?n:t.body.textContent}catch(r){return console.error("Failed to parse value as HTML"),n}},r.formatNumber=function(n,t){return numeral(n).format(t)},r.formatDate=function(n,t){var i=moment(n);return i.isValid()?i.format(t):""},r.getUtcDateFromRawString=function(n,t,i){var r,u;return n==null||n.trim()===""||n==="Invalid date"?null:(r=moment(n,t),i===!0&&(r.set("hours",12),r.set("minutes",0)),u=moment.utc(r),u.toDate())},r.getDateStringFromUtc=function(n,t){if(n==null)return"";var i=moment.utc(n).toDate(),r=moment(i);return r.format(t)},r.trackObject=function(n){return r.valueIsObject(n)===!1||n==null?n:(n._clientKey==null&&(n._clientKey=i()*-1),n._clientKey)},r.eventPreventsDefaultFormAction=function(n){var t=$(n.target),i;if(!window._popUpManager.popUpVisible&&!window._popUpManager.isLoading)return t.context!=null&&(i=t.context.tagName.toLowerCase(),i=="trix-editor"||i=="textarea"||i=="button"&&n.which===13)?!0:t.parent().hasClass("chosen-search")?(t.blur(),!0):(t.hasClass("quick-filter"),!1)},r.setControlKeyPressed=function(n){window.ctrlPressed=n!=null&&n.ctrlKey;setTimeout(function(){window.ctrlPressed=!1},1e3)},r.controlKeyWasPressed=function(){return window.ctrlPressed===!0},r.setLastClickedElement=function(n){window.lastClickedElement=n==null||n.target==null?null:n.target},r.getLastClickedElement=function(){return window.lastClickedElement},r.detectBrowser=function(){var n=!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0,t=typeof window.InstallTrigger!="undefined",i=Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0,r=!!window.chrome&&!n,u=/*@cc_on!@*/!1||!!document.documentMode;return n?"Opera":t?"Firefox":i?"Safari":r?"Chrome":u?"IE":""},r.getScrollbarSize=function(){var t=document.createElement("p"),n,r,i;return t.style.width="100%",t.style.height="200px",n=document.createElement("div"),n.style.position="absolute",n.style.top="0px",n.style.left="0px",n.style.visibility="hidden",n.style.width="200px",n.style.height="150px",n.style.overflow="hidden",n.appendChild(t),document.body.appendChild(n),r=t.offsetWidth,n.style.overflow="scroll",i=t.offsetWidth,r===i&&(i=n.clientWidth),document.body.removeChild(n),r-i},r.toJson=function(n){return JSON.parse(n.replace(/'/g,'"').replace(/[\t\n\r]/g,""))},r.forceNumberFormat=function(n){if(n)return n.replace(",",".").trim()},r.parseFloat=function(n){var t=parseFloat(r.forceNumberFormat(n));return isNaN(t)&&(t=0),t},r.convertToNumber=function(n){if(n.toLowerCase()==="nan")return NaN;var t=Number(n);return isNaN(t)?null:t},r.convertToBoolean=function(n){return n.toLowerCase(),n==="true"||n==="false"?n==="true":null},r.convertToDateTime=function(n){var t=new Date(Date.parse(n));return isNaN(t.getTime())?null:t},r.guessStringMambaDataType=function(n){return r.convertToBoolean(n)!==null?t.BOOL:r.convertToNumber(n)!==null?t.NUMBER:r.convertToDateTime(n)!==null?t.DATETIME:t.STRING},r.getMambaDataType=function(n){var i=n.toUpperCase();return i==="INT"||i==="DOUBLE"||i==="DECIMAL"||i==="FLOAT"||i==="LONG"||i==="BYTE"?t.NUMBER:t[i]},r.parseToDecimal=function(n,t){var r,u;if(n==null)return null;n=n.toString();var f=t[0],e=t[1],o=3,s=new RegExp("^\\s*([+-]?(?:(?:\\d{1,3}(?:\\"+f+"\\d{"+o+",3})+)|\\d*))(?:\\"+e+"(\\d*))?\\s*$"),i=n.match(s);return(i!=null&&i.length===3)?(r=i[1],u=i[2],{integerPart:r,fractionPart:u}):null},r.localizeNumber=function(n,t){var f,i,u;if(t===void 0&&(t=null),n==null)return null;if(f=n,n=n.toString(),n!=null&&(n.indexOf("e")>-1||n.indexOf("E")>-1)&&(n=f.toFixed(20)),t=t||[".",","],i=r.parseToDecimal(n,t),i==null&&(t=[",","."],i=r.parseToDecimal(n,t)),i==null)throw{msg:"Number has an invalid format"};return(u=r.replaceAll(i.integerPart,t[0],window._context.groupSeparator),i.fractionPart!=null)?""+u+window._context.decimalSeparator+i.fractionPart:""+u},r.delocalizeNumber=function(n,t){var i,u;if(t===void 0&&(t=null),n==null)return null;if(n=n.toString(),t=t||[window._context.groupSeparator,window._context.decimalSeparator],i=r.parseToDecimal(n,t),i==null)throw{msg:"Number has an invalid format"};return(u=r.replaceAll(i.integerPart,t[0],""),i.fractionPart!=null)?u+"."+i.fractionPart:""+u},r.getCurrenctNumberSeperator=function(){return[window._context.groupSeparator,window._context.decimalSeparator]},r.parseToNumber=function(n,t,i){var u,f,e;return(t===void 0&&(t=null),i===void 0&&(i=!0),n==null)?null:typeof n=="number"?n:(n=n.toString(),t=t||[window._context.groupSeparator||".",window._context.decimalSeparator||","],u=r.parseToDecimal(n,t),u==null)?NaN:(f=u.integerPart.replace(new RegExp("\\"+t[0],"g"),""),e=parseFloat(f+"."+u.fractionPart),e)},r.autoParse=function(n){var t=parseFloat(n);return isNaN(t)?n==="true"?!0:n==="false"?!1:n:t},r.setNumberLocalizationSettings=function(){window.numeral!=null&&numeral.locales!=null&&numeral.locales._custom==null&&(numeral.register("locale","_custom",{delimiters:{thousands:window._context.groupSeparator,decimal:window._context.decimalSeparator},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(n){return n===1?"st":"nd"},currency:{symbol:"€"}}),numeral.locale("_custom"))},r.isArray=function(n){return n!=null&&n.constructor===Array&&n.length!=null},r.safeNumber=function(n){return n===undefined?0:n},r.nullSafe=function(n,t){try{return n()}catch(i){return window._context.mode!=="Production"&&console.warn("Expression '"+n+"' throws null point exception"),t}},r.autocompleteFix=function(){var n,i,t;if($("input[type='password'][ng-model]").length!==0)for(n=[],n.push.apply(n,$("input[type='password'][ng-model]")),n.push.apply(n,$("input[jb-type='TextBox'][ng-model]")),i=function(input){var $input=$(input),model=$input.attr("ng-model"),expression=model.replace("model.","Joove.Common.getModel().");try{eval(expression)!==$input.val()&&eval(expression+" = '"+$input.val()+"'")}catch(e){console.warn("Autocomplete error!",e)}},t=0;t<n.length;t++)i(n[t])},r.createRandomId=function(n){var t,i,r;for(n=n||5,t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=0;r<n;r++)t+=i.charAt(Math.floor(Math.random()*i.length));return t},r.digestScope=function(n){n==null&&(n=r.getScope());n.$$phase||n.$root==null||n.$root.$$phase||n.$digest()},r.requireScript=function(n,t,i){return window._scriptLoader.requireScript(n,t,i)},r.usePDFMaker=function(n){window._scriptLoader.isScriptLoaded("pdfmake")?pdfMake.createPdf(n.dd).download(n.filename):r.loadPdfMakeDependencies(n).then(function(){n.tableLayouts&&(pdfMake.tableLayouts=n.tableLayouts);r.usePDFMaker(n)})},r.loadPdfMakeDependencies=function(){var n=window._context.siteRoot+"/Scripts/Third-Party/pdfmaker";return r.requireScript("pdfmake",n+"/pdfmake.min.js").then(function(){return r.requireScript("vfs_fonts",n+"/vfs_fonts.js")}).then(function(){return!0})},r.loadJsPdfDependencies=function(n){var t=window._context.siteRoot+"/Scripts/Third-Party/jspdf";r.requireScript("jsPDF",t+"/jspdf.min.js",function(){r.requireScript("html2pdf",t+"/html2pdf.js",function(){r.exportToPdf(n)})})},r.exportToPdfUsePrintMedia=function(n,t){var i=new jsPDF("p","pt","letter");$(".jb-modal-overlay").show();html2pdf(n,i,function(n){n.save(t.filename);$(".jb-modal-overlay").hide()})},r.exportToPdf=function(n){var t,i;if($(".jb-modal-overlay").show(),window.jsPDF==null)r.loadJsPdfDependencies(n);else{if(t=n.$element||$("body"),n.usePrintMedia){r.exportToPdfUsePrintMedia(t,n);return}var f=t.width(),e=t.height(),u="rgba(0, 0, 0, 0)";n.$element!=null&&(u=n.$element.css("background-color"),n.$element.css("background-color")==="rgba(0, 0, 0, 0)"&&n.$element.css("background-color",$("body").css("background-color")));i=new jsPDF({orientation:"portrait",format:"custom",unit:"pt",pageWidth:f,pageHeight:e});$(".jb-modal-overlay").hide();n.$element!=null?i.addHTML(n.$element.get(0)):i.addHTML($("body").get(0),0,0,{},function(){});$(".jb-modal-overlay").show();setTimeout(function(){i.save(n.filename);$(".jb-modal-overlay").hide();n.$element!=null&&n.$element.css("background-color",u)},5e3)}},r.cast=function(n,t){return n==null||r.stringIsNullOrEmpty(n._originalTypeClassName)?n:n._originalTypeClassName==t?n:null},r.objectsAreEqualGenericDeepComparison=function(n,t){var i,f,u,e;return n===t?!0:typeof n!=typeof t?!1:typeof n=="number"&&isNaN(n)&&isNaN(t)?!0:(i=Object.prototype.toString.call(n),f=Object.prototype.toString.call(t),i!=f)?!1:i=="[object Boolean]"||i=="[object String]"||i=="[object Number]"?n.valueOf()==t.valueOf():i=="[object RegExp]"||i=="[object Date]"||i=="[object Error]"?n.toString()==t.toString():typeof n=="object"||typeof n=="function"?i=="[object Function]"&&n.toString()!=t.toString()?!1:(u=Object.keys(n),e=Object.keys(t),u.length!=e.length)?!1:u.every(function(n){return t.hasOwnProperty(n)})?u.every(function(i){return r.objectsAreEqualGenericDeepComparison(n[i],t[i])}):!1:!1},r.keyHasDefaultValue=function(n){if(n==null)return!0;var t=n.toString().trim();return t=="0"||t==""||t=="00000000-0000-0000-0000-000000000000"},r.changeDateTimeFormat=function(n){var t=n.replace(new RegExp("tt","g"),"a");return t=t.replace(new RegExp("d","g"),"D"),t=t.replace(new RegExp("y","g"),"Y"),t.replace(new RegExp("f","g"),"S")},r.classInstancesAreSame=function(n,t){return n._originalTypeClassName!=null&&t._originalTypeClassName!=null&&n._originalTypeClassName!==t._originalTypeClassName?!1:n._clientKey!=null&&n._clientKey===t._clientKey?!0:n._key!=null&&n._key!==0&&n._key!==""&&n._key===t._key?!0:!1},r.classInstancesAreNotSame=function(n,t){return r.classInstancesAreSame(n,t)===!1},r}();n.Common=e;r=function(){function n(n){this.el=n.$element.get(0);this.$el=n.$element;this.interval=n.interval||1e3;this.onEnterView=n.onEnter;this.onExitView=n.onExit;this.stopOnEnter=n.stopWhenEnters;this.stopOnExit=n.stopWhenExits;this.visibilityCheck=n.visibilityCheck;this.distanceThreshold=n.distanceThreshold||100}return n.prototype.start=function(){var n=this;this.onLoop();this.intervalObject=setInterval(function(){n.onLoop()},this.interval)},n.prototype.stop=function(){clearInterval(this.intervalObject)},n.prototype.onLoop=function(){var n=this.visibilityCheck===!1?!0:this.$el.is(":visible")===!0,t=n===!1?!1:this.isInViewPort()===!0;n&&t?(this.onEnterView&&this.onEnterView(),this.stopOnEnter===!0&&this.stop()):(this.onExitView&&this.onExitView(),this.stopOnExit===!0&&this.stop())},n.prototype.isInViewPort=function(){var n=this.el.getBoundingClientRect(),t=n.top-(window.innerHeight||document.documentElement.clientHeight),i=n.left-(window.innerWidth||document.documentElement.clientWidth);return n.top>=0&&n.left>=0&&t<=this.distanceThreshold&&i<=this.distanceThreshold},n}();n.ElementViewPortObserver=r;o=function(){function n(n,t){var i=this;this.$img=n;this.observer=new r({$element:this.$img,interval:1e3,stopWhenEnters:!0,visibilityCheck:t===!0,onEnter:function(){i.setImage()}});this.observer.start()}return n.prototype.setImage=function(){var n=this.$img.data("src");this.$img.attr("src",n)},n}();n.LazyImageLoader=o}(Joove||(Joove={})),function(n){var t=function(){function t(){}return t.reconstructObject=function(n){return t.mapObjectReferences(n),t.restoreObjectReferences(n),n},t.mapObjectReferences=function(i){"use strict";return function r(i){var u,f;if(n.Common.valueIsObject(i)===!1)return i;if(Object.prototype.toString.apply(i)==="[object Array]")for(u=0;u<i.length;u+=1)r(i[u]);else{typeof i.$id!="undefined"&&(t.referencesMap[i.$id]=i,delete i.$id);for(f in i)Object.prototype.hasOwnProperty.call(i,f)&&r(i[f])}return i}(i)},t.checkForDuplicateIds=function(t){"use strict";var i=[];return function r(t){var u,f;if(n.Common.valueIsObject(t)===!1)return t;if(Object.prototype.toString.apply(t)==="[object Array]")for(u=0;u<t.length;u+=1)r(t[u]);else{if(typeof t.$id!="undefined")if(i.indexOf(t.$id)>-1){console.log("Duplicate $id: "+t.$id);throw"$id already encountered!";}else i.push(t.$id);for(f in t)Object.prototype.hasOwnProperty.call(t,f)&&r(t[f])}return t}(t)},t.restoreObjectReferences=function(i){"use strict";return function r(i){var u,f;if(n.Common.valueIsObject(i)===!1)return i;if(Object.prototype.toString.apply(i)==="[object Array]")for(u=0;u<i.length;u+=1)i[u]=r(i[u]);else{if(typeof i.$ref!="undefined")return t.referencesMap[i.$ref];for(f in i)Object.prototype.hasOwnProperty.call(i,f)&&(i[f]=r(i[f]))}return i}(i)},t.decycleObject=function(i,r){"use strict";var u=r==null?[]:r;return function f(i){var e,s,o,r;if(n.Common.valueIsObject(i)===!1)return i;if(Object.prototype.toString.apply(i)!=="[object Array]")for(e=0;e<u.length;e++)if(n.Common.objectsAreEqual(u[e],i,!0))return{$ref:u[e].$id};if(Object.prototype.toString.apply(i)==="[object Array]"){for(s=[],o=0;o<i.length;o++)s[o]=f(i[o]);return s}typeof i.$ref=="undefined"&&typeof i.$id=="undefined"&&(i.$id=t.nextUniqueId().toString());u.push(i);for(r in i)if(i.hasOwnProperty(r)){if(r.indexOf("$$hashKey")===0){delete i[r];continue}Object.prototype.hasOwnProperty.call(i,r)&&(i[r]=f(i[r]))}return i}(i)},t.referencesMap={},t.nextUniqueId=function(){var n=1;return function(){return n++}}(),t}();n.Cycles=t}(Joove||(Joove={})),function(n){var i,t,r,u,f;(function(n){n[n.INFO=1]="INFO";n[n.WARN=2]="WARN";n[n.ERROR=3]="ERROR";n[n.SUCCESS=4]="SUCCESS";n[n.CUSTOM=5]="CUSTOM"})(i=n.DataValidationMessageType||(n.DataValidationMessageType={}));n.RuleTypes={ConditionalFormatting:"cf",DataValidation:"dv",CalculatedExpression:"ce"},function(n){n[n.OnLoad=1]="OnLoad";n[n.OnChange=2]="OnChange";n[n.OnSubmit=3]="OnSubmit"}(t=n.EvaluationTimes||(n.EvaluationTimes={}));r=function(){function n(){}return Object.defineProperty(n.prototype,"EvaluationScope",{get:function(){var n=this,t=new Promise(function(t){t(n.Status)}),i=new Promise(function(t){t(n.Expression)});return{Status:t,Expression:i}},enumerable:!0,configurable:!0}),n}();n.DataSetRuleEvaluationResult=r;u=function(){function t(n){this.evaluatedAtServer=!1;this.serverSideEvaluations=null;this.runsAtServer=!1;this.isDataSetRule=!1;this.init(n)}return t.prototype.init=function(t){this.name=t.name;this.contextControlName=t.contextControlName;this.isDataSetRule=t.isDataSetRule;this.type=t.type;this.partialView=t.partialView;this.getContext=t.getContext;this.evaluationTimes=t.evaluationTimes;this.group=t.group;this.evaluatedAtServer=t.evaluatedAtServer;this.dataValidationMessageType=t.dataValidationMessageType||i.ERROR;this.originalName=t.originalName;this.fromMasterPage=t.fromMasterPage;this.evaluateInContext=t.evaluateInContext;this.isRelatedToDataValidation=t.isRelatedToDataValidation;this.condition=t.condition==null?null:this.assureIsPromise(t.condition);this.expression=t.expression==null?null:this.assureIsPromise(t.expression);this.type===n.RuleTypes.ConditionalFormatting?this.runsAtServer=t.condition==null:this.type===n.RuleTypes.CalculatedExpression?this.runsAtServer=t.condition==null:this.type===n.RuleTypes.DataValidation&&(this.runsAtServer=t.condition==null)},t.prototype.assureIsPromise=function(t){var i=new n.FriendlyMessage({Title:"Rule evaluation",OriginalExceptionMessage:""});return function(r){return new Promise(function(u,f){try{u(t(r))}catch(e){window._context.mode!=="Production"&&n.FriendlyMessageGenerator.showPopUp(i);console.error(e);f("")}})}},t.prototype.getRuleAttribute=function(){return this.type+"-"+this.name},t.prototype.$affectedControls=function(){return $("["+this.getRuleAttribute()+"]")},t.prototype.findServerSideEvaluations=function(){var t,r,i;if(this.serverSideEvaluations=null,t=null,this.type===n.RuleTypes.ConditionalFormatting?t=window.viewDTO.ConditionalFormattings:this.type===n.RuleTypes.CalculatedExpression?t=window.viewDTO.CalculatedExpressions:this.type===n.RuleTypes.DataValidation&&(t=window.viewDTO.DataValidations),t!=null)for(r=0;r<t.length;r++)if(i=t[r],i.Name===this.name&&i.evaluated!==!0){i.evaluated=!0;this.serverSideEvaluations=i.Evaluations;break}},t.createRulesForPartialControls=function(n,t){for(var r=[],u,i=0;i<n.length;i++)u=t(n[i]),r=r.concat(u);return r},t}();n.JbRule=u;f=function(){function r(){this.onLoadHasRun=!1;this.conditionalFormattings=[];this.dataValidations=[];this.calculatedExpressions=[];this.serverRules=[];this.dataSetRules=[];this.cfHelper=new n.ConditionalFormattingsHelper;this.latestServerRulesResults=null;this.customRegisteredFunctions=[];this.isRunning=!1}return r.prototype.addServerRules=function(t){for(var i=0;i<t.length;i++)t[i].isDataSetRule===!1&&(t[i].runsAtServer||t[i].type===n.RuleTypes.DataValidation)&&this.serverRules.push(t[i])},r.prototype.addDataSetRules=function(n){for(var t=0;t<n.length;t++)n[t].isDataSetRule&&this.dataSetRules.push(n[t])},r.prototype.addConditionalFormattings=function(n){this.addServerRules(n);this.addDataSetRules(n);var t=this.conditionalFormattings.concat(n);this.conditionalFormattings=t},r.prototype.addDataValidations=function(n){this.addServerRules(n);this.addDataSetRules(n);var t=this.dataValidations.concat(n);this.dataValidations=t},r.prototype.addCalculatedExpressions=function(n){this.addServerRules(n);this.addDataSetRules(n);var t=this.calculatedExpressions.concat(n);this.calculatedExpressions=t},r.prototype.prepareRuleInfoForServerSideExecution=function(n){for(var s=[],r={},t,i,f,e,h,o,u=0;u<n.length;u++)if(t=n[u],i=t.$affectedControls(),i.length!==0||t.getContext==null){if(f=t.name+t.type,e={Name:t.name,Type:t.type,Indexes:[],PartialViewControls:[]},s.push(e),t.partialView!=null){this.prepareRuleInfoForPartialViews(i,e,r,t,f);continue}if(t.getContext==null)r[f]=i;else for(h=[],o=0;o<i.length;o++)this.prepareRuleInfoForControlInsideContext(i.eq(o),e,r,h,f)}return{info:s,controls:r}},r.prototype.prepareRuleInfoForPartialViews=function(n,t,i,r,u){for(var h=[],f=0;f<n.length;f++){var o=n.eq(f),s=o.closest("[jb-type='PartialView']").attr("jb-id"),e=s+u;t.PartialViewControls.indexOf(s)===-1&&t.PartialViewControls.push(s);r.getContext==null?(i[e]==null&&(i[e]=[]),i[e].push(o)):this.prepareRuleInfoForControlInsideContext(o,t,i,h,e)}},r.prototype.prepareRuleInfoForControlInsideContext=function(t,i,r,u,f){var e=n.Common.getIndexesOfControl(t),s=e.indexes,o=f+e.key;r[o]==null&&(r[o]=[]);u.indexOf(e.key)===-1&&(i.Indexes.push(s),u.push(e.key));r[o].push(t)},r.prototype.getRule=function(t,i,r){var u,f,e;for(r==null&&(u=this.conditionalFormattings,i===n.RuleTypes.DataValidation?u=this.dataValidations:i===n.RuleTypes.CalculatedExpression&&(u=this.calculatedExpressions),r=u),f=0;f<r.length;f++)if(e=r[f],e.name===t&&e.type===i)return e;return null},r.prototype.getServerRulesInfo=function(n){for(var r=[],i,t=0;t<this.serverRules.length;t++)(i=this.serverRules[t],this.ruleMustBeEvaluatedAtEvaluationTime(i,n)!==!1)&&r.push(i);return this.prepareRuleInfoForServerSideExecution(r)},r.prototype.ruleMustBeEvaluatedAtEvaluationTime=function(n,i){return i==null?!1:i!==t.OnSubmit?n.evaluationTimes.indexOf(i)>-1:n.evaluationTimes.indexOf(i)>-1||n.evaluationTimes.indexOf(t.OnChange)>-1},r.prototype.evaluatesServerRules=function(t,i,r,u){var f,e,o;if(t.length===0){u&&u();return}if(f=this.getServerRulesInfo(i),f.info.length===0){u&&u();return}e=n.Common.getModel();o={model:e,rules:f.info,group:null};n.Core.executeControllerAction(window._context.currentController,"GetRulesEvaluation","POST",[i],o,null,u,null,f)},r.prototype.updateRulesOfControl=function(t){this.latestServerRulesResults!=null&&(this.updateSpecificRulesOfControl(t,this.latestServerRulesResults.ConditionalFormattings||[],n.RuleTypes.ConditionalFormatting),this.updateSpecificRulesOfControl(t,this.latestServerRulesResults.CalculatedExpressions||[],n.RuleTypes.CalculatedExpression))},r.prototype.updateSpecificRulesOfControl=function(t,i,r){for(var l=n.Common.getIndexesOfControl(t).key,o,s,f,e,h,c,u=0;u<i.length;u++)if(o=this.getRule(i[u].Name,r),s=t.attr(o.getRuleAttribute()),!n.Common.stringIsNullOrEmpty(s)){if(f=i[u].Evaluations[0],i[u].Evaluations.length>1)for(f=null,e=0;e<i[u].Evaluations.length;e++)if(h=i[u].Evaluations[e],c=n.Common.serializeIndexes(h.Indexes),l===c){f=eval;break}f!=null&&this.applyCondionalFormatting(o,f,$(t))}},r.prototype.applyServerRulesResult=function(t,i){this.latestServerRulesResults=t;this.applyServerRules(t.DataValidations||[],n.RuleTypes.DataValidation,i).then(function(t){return n.Validation.UiHelper.refreshPanel(),t})},r.prototype.applyServerRules=function(t,i,r){for(var c=[],o,f,h,s,e=0;e<t.length;e++){var u=t[e],l=(u.PartialControl||"")+u.Name+i,a=this.getRule(u.Name,i);for(o=0;o<u.Evaluations.length;o++)f=u.Evaluations[o],h=l,f.Indexes!=null&&(s=n.Common.serializeIndexes(f.Indexes),s==="_"&&(s=""),h=l+s),c.push(this.applyRule(a,f,$(r.controls[h]),f.Indexes))}return Promise.all(c).then(function(n){return n.filter(function(n){return n}).length<=0})},r.prototype.applyDataSetRulesResult=function(t){var u,r,i;if(t!=null&&t.length!==0)for(u=0;u<t.length;u++)if(r=t[u],i=this.getRule(r.RuleName,n.RuleTypes.ConditionalFormatting,this.dataSetRules),i!=null&&i.contextControlName!=null&&i.contextControlName.trim()!==""){var h=r.Key,f="[jb-id='"+i.contextControlName+"']",e="[data-key='"+r.Key+"']",o="["+n.RuleTypes.ConditionalFormatting+"-"+i.name+"]",s=$(f+" "+e+" "+o);this.applyRule(i,r.EvaluationScope,s,[])}},r.prototype.update=function(n,i,u){var f=this;return this.onLoadHasRun==!1&&n==t.OnChange?Promise.resolve():n==t.OnChange?this.isRunning==!1?this.actualUpdate(n,i,u):(clearTimeout(r.lastChangeRequest),r.lastChangeRequest=setTimeout(function(){f.update(n,i,u)},250),Promise.resolve()):this.actualUpdate(n,i,u)},r.prototype.actualUpdate=function(i,r,u){var f=this,e;return this.isRunning=!0,e=function(){f.isRunning=!1;$(".hidden-before-rule-apply").removeClass("hidden-before-rule-apply");u&&u();n.Core.applyScope();i==t.OnLoad&&(f.onLoadHasRun=!0);for(var r=0;r<f.customRegisteredFunctions.length;r++)f.customRegisteredFunctions[r].func&&f.customRegisteredFunctions[r].func()},this.evaluateRules(i,r).then(function(){e()}).catch(function(t){f.isRunning=!1;n.Logger.error("Rule engine error",t)})},r.prototype.addCustomFunction=function(n,t){var i=$.grep(this.customRegisteredFunctions,function(t){return t.name==n})[0];i!=undefined?(console.log("Custom function: "+n+" already exists! Overiding..."),i.func=t):(console.log("Adding entry "+n),this.customRegisteredFunctions.push({name:n,func:t}))},r.prototype.removeCustomFunction=function(n){var t=$.grep(this.customRegisteredFunctions,function(t){return t.name==n})[0];if(t==undefined){console.log("Entry "+n+" doesn't exist. Exiting ...");return}console.log("Removing entry "+n);this.customRegisteredFunctions=$.grep(this.customRegisteredFunctions,function(t){return t.name!=n})},r.prototype.runClientDataValidations=function(n){return this._lastOnSubmitDatavalidation=(new Date).getTime(),this.evaluateDataValidations(t.OnSubmit,n)},r.prototype.updateDataValidationRelatedConditionals=function(){var i=this,n=this.conditionalFormattings.filter(function(n){return n.isRelatedToDataValidation===!0});n!=null&&n.length!=0&&n.map(function(n){return i.updateSingleRule(n.name,n.type,t.OnChange,[n.group])})},r.prototype.updateSingleRule=function(i,r,u,f){var o,s,e,h;if(r===n.RuleTypes.ConditionalFormatting?o=this.conditionalFormattings:r===n.RuleTypes.DataValidation?o=this.dataValidations:r===n.RuleTypes.CalculatedExpression&&(o=this.calculatedExpressions),s=o.filter(function(n){return n.name==i}),e=s==null||s.length==0?null:s[0],e==null){console.error("Could not find "+r+" rule: "+i);return}e.evaluatedAtServer===!0?(h={name:e.name,type:e.type},this.evaluatesServerRules([h],u,f)):this.evaluateRule(e,f,t.OnChange)},r.prototype.evaluateConditionalFormattings=function(n){for(var r=[],i,t=0;t<this.conditionalFormattings.length;t++)(i=this.conditionalFormattings[t],this.ruleMustBeEvaluatedAtEvaluationTime(i,n)!==!1)&&r.push(this.evaluateRule(i,null,n));return Promise.all(r).then(function(){return!0})},r.prototype.evaluateCalculatedExpressions=function(n){for(var r=[],i,t=0;t<this.calculatedExpressions.length;t++)(i=this.calculatedExpressions[t],this.ruleMustBeEvaluatedAtEvaluationTime(i,n)!==!1)&&r.push(this.evaluateRule(i,null,n));return Promise.all(r).then(function(){return!0})},r.prototype.evaluateDataValidations=function(i,r){var e=[],o,s,h,u,f;if(i==t.OnChange&&(o=(new Date).getTime()-this._lastOnSubmitDatavalidation,o<500))return new Promise(function(n){n()});for(r==null||r.length==0?r=n.Validation.UiHelper.lastEvaluatedValidationGroups:n.Validation.UiHelper.lastEvaluatedValidationGroups=r,s=r.indexOf(n.Validation.Constants.ALL_GROUPS)>-1,n.Validation.Bindings.removeValidationsThatDontBelongToGroups(r),h=function(n){var t=u.dataValidations[n],f;if(u.ruleMustBeEvaluatedAtEvaluationTime(t,i)===!1||s===!1&&r.filter(function(n){return n==t.group}).length==0)return"continue";f=u.evaluateRule(t,r,i);e.push(f)},u=this,f=0;f<this.dataValidations.length;f++)h(f);return Promise.all(e).then(function(n){return n.filter(function(n){return n}).length<=0}).then(function(t){return n.Validation.UiHelper.refreshPanel(),t})},r.prototype.evaluateRules=function(n,t){var i=this;return this.evaluateCalculatedExpressions(n).then(function(){i.evaluateConditionalFormattings(n)}).then(function(){i.evaluateDataValidations(n,t)})},r.prototype.evaluateRule=function(t){var o=this,r,e,u,h;if(t.runsAtServer)return new Promise(function(n){n(!1)});var i=t.$affectedControls(),s=[],f=[];if(t.getContext==null)return this.applyRule(t,{Status:t.condition(null),Expression:t.expression==null?null:t.expression(null)},i,[]);if(r=t.getContext(),r!=undefined&&r.length===1&&r[0]!=undefined&&r[0].length===0)f.push(new Promise(function(n){n(!1)}));else if(e=function(n,i){var u=o.getRuleParents(t,n.indexes),r,e;u!=null&&(r=s[n.key],r==null&&(r=s[n.key]={Status:t.condition(u),Expression:t.expression==null?null:t.expression(u)}),e=o.applyRule(t,r,i,n.indexes),f.push(e))},t.type===n.RuleTypes.DataValidation)n.Validation.Bindings.resetValidationOccurencesInSummary(t),t.evaluateInContext(function(t){var r=t.join("_")+"_",u={key:r,indexes:t},f=i.filter(function(t,i){return n.Common.getIndexKeyOfControl($(i))==r}).eq(0);e(u,f)}),n.Validation.Bindings.removeFromSummaryWhenNotTriggered(t),n.Validation.Bindings.removeFromMasterSummaryWhenNotTriggered(t);else for(u=0;u<i.length;u++)h=n.Common.getIndexesOfControl(i.eq(u)),e(h,i.eq(u));return Promise.all(f).then(function(n){return n.filter(function(n){return!n}).length<=0})},r.prototype.getRuleParents=function(n,t){var r=[],u=n.getContext(t),i,f;if(u==null)return null;for(i=0;i<u.length;i++){if(u[i]==null){r.push(null);break}r.push(u[i][t[i]])}return f=r.filter(function(n){return n==null}).length>0,f?null:r},r.prototype.applyRule=function(t,r,u,f){var e=this,o;return r.Status instanceof Promise==!1&&(o=JSON.parse(JSON.stringify(r)),r.Status=new Promise(function(n){n(o.Status)}),r.Expression=new Promise(function(n){n(o.Expression)})),r.Status.then(function(o){if(o===!1&&t.type===n.RuleTypes.CalculatedExpression)return o;if(t.type===n.RuleTypes.DataValidation&&(t.evaluatedCondition=o),t.type===n.RuleTypes.DataValidation&&(t.dataValidationMessageType==i.WARN||t.dataValidationMessageType==i.INFO))return r.Expression.then(function(){return e.applyDataValidation(t,r,f),!1});if(t.type===n.RuleTypes.ConditionalFormatting)e.applyCondionalFormatting(t,r,u);else{if(t.type===n.RuleTypes.DataValidation)return r.Expression.then(function(){return e.applyDataValidation(t,r,f),o});if(t.type===n.RuleTypes.CalculatedExpression)return r.Expression.then(function(){return e.applyCalculatedExpression(t,r,u),o})}return o})},r.prototype.applyCondionalFormatting=function(t,i,r){r=r||t.$affectedControls();var u=this;i.Status.then(function(i){for(var f=0;f<r.length;f++){var e=$(r[f]),s=e.attr(t.getRuleAttribute()),o=JSON.parse(n.Common.replaceAll(s,"`",'"')),h=i?o.whenTrue:o.whenFalse;u.applyConditionalFormattingOnControl(e,i,h)}})},r.prototype.applyConditionalFormattingOnControl=function(n,t,i){var r,u;if(i!=null)for(r=0;r<i.length;r++)u=this.parseConditionalFormattingToDoString(i[r]),this.cfHelper.applyFormatting(n,u.type,u.extraData,t)},r.prototype.parseConditionalFormattingToDoString=function(n){var t=n.split("|"),i=t[0],r=t.length>1?t[1]:null;return{type:i,extraData:r}},r.prototype.applyDataValidation=function(t,i,r){var u=this;i.Status.then(function(u){i.Expression.then(function(i){return n.Validation.Bindings.refresh(t,i,u,r),u})})},r.prototype.applyCalculatedExpression=function(n,t,i){var u=this,r=t.Expression;r!=null&&r.then(function(t){for(var r=0;r<i.length;r++)u.applyCalculatedExpressionOnControl($(i[r]),t,n.runsAtServer===!1)})},r.prototype.applyCalculatedExpressionOnControl=function(t,i,r){var s,e,o;if(i!=null&&i!==NULL){var f=t.attr("jb-type"),u=null,h=t.attr("bound-to-dataset");switch(f){case"Label":u=t.attr("ng-bind");break;case"TextBoxBase":case"TextBox":u=t.attr("ng-my-number")!=null?t.attr("ng-my-number"):t.attr("ng-model");break;case"CheckBox":case"TextArea":case"DropDownBox":case"RichTextBox":case"PasswordTextBox":u=t.attr("ng-model");break;case"DateTimeBox":u=t.attr("ng-target");break;default:console.error("Calculated Expression not implemented for control: "+f)}if(r&&n.Common.stringIsNullOrEmpty(u)===!1&&h!=="true")this.applyCalculatedExpressionToBinding(t,u,i);else{s=t.hasClass(n.ValueFormat.MarkClass);s===!0&&(e=n.Common.getDirectiveScope(t),e!=null&&(o=e.getValueFormat(),i=o==null?i:o.format(i)));switch(f){case"Label":t.text(i);break;case"TextBoxBase":case"TextBox":case"CheckBox":case"TextArea":case"DropDownBox":case"RichTextBox":case"PasswordTextBox":t.val(i);n.Core.elementData(t,"old-value",i);break;default:console.error("Calculated Expression not implemented for control: "+f)}}}},r.prototype.applyCalculatedExpressionToBinding=function(t,i,r){var u,f,e;if(!n.Common.stringIsNullOrEmpty(i)){u=n.Common.getFullBindingPathOfControl(t,i);f=t.attr("data-binding-type");switch(f){case"DateTime":e="__tmp"+u.replace(/[\[\]\.]/gi,"_");n.Common.getScope()[e]=new Date(r);n.Common.getScope().$eval(u+" = "+e+";");break;case"int":case"long":case"float":case"double":case"decimal":case"bool":n.Common.getScope().$eval(u+" = "+r+";");break;case"string":case"byte":case"Guid":case"char":n.Common.getScope().$eval(u+' = "'+r+'";');break;default:console.error("Could not apply calculated expression to binding of datatype: "+f)}}},r}();n.RuleEngine=f}(Joove||(Joove={})),function(n){var t;(function(t){var o=function(){function n(){}return n}(),u,f,e,i,r;t.BindingEntry=o;u=function(){function n(){}return n}();t.FormValidationOptions=u;f=function(){function t(){}return t.validateFormAndExecute=function(n,i){if(i.withDataValidationsCheck===!1&&i.withRequiredFieldsCheck===!1){n&&n();return}var u=!0;if(i.withRequiredFieldsCheck===!0)if(r.updateEmptyRequiredFieldsState(i.groups,!0),r.emptyRequiredFieldsExist()===!0){if(u=!1,i.withDataValidationsCheck===!1){r.showPanel();return}}else if(i.withDataValidationsCheck===!1){n&&n();return}i.withDataValidationsCheck===!0&&window._ruleEngine.runClientDataValidations(i.groups).then(function(){t.afterDataValidationsCheck(n,u)})},t.afterDataValidationsCheck=function(t,i){var o=window.$form._validations==null?[]:window.$form._validations.summary,u=o.filter(function(n){return n.triggered===!0&&n.rule!=null&&n.group!=="_ValidationException_"}),f,e;if(r.markDataValidationRelatedControls(!1),u.length==0&&i===!0){t&&t();return}(r.showPanel(),f=u.filter(function(t){return t.rule.dataValidationMessageType==n.DataValidationMessageType.ERROR}),i===!1||f.length>0)||(e=u.filter(function(t){return t.rule.dataValidationMessageType==n.DataValidationMessageType.WARN}),e.length==0?t&&t():window._popUpManager.question(window._resourcesManager.getGlobalResource("RES_WEBFORM_VALIDATIONS_Warning"),window._resourcesManager.getGlobalResource("RES_WEBFORM_VALIDATIONS_WarningConfirmation"),function(n){n===!0&&setTimeout(function(){t&&t()},1e3)}))},t}();t.Manager=f;e=function(){function t(){}return t.refresh=function(n,i,r,u){var f={rule:n,message:i,triggered:r,group:n.group,indexesInfo:{key:u.join("_")+"_",indexes:u}};t.handleNewEntry(f)},t.removeBindingOfControl=function(n){var t=n.attr("jb-id"),i,r,u;(delete window.$form._validations[t],delete window.$master._validations[t],i=window.$form._validations.summary.filter(function(n){return n.requiredControlId==t}),i.length!=0)&&(r=i[0],u=window.$form._validations.summary.indexOf(r),window.$form._validations.summary.splice(u,1))},t.refreshEmptyRequired=function(i,r){var u=n.Core.getPartialOwnerControl(i),f=i.attr("jb-id"),e=u==null||u.trim()==""?f:n.Core.getPartialViewControlOriginalName(i),o=window._resourcesManager.getEmptyRequiredFieldMessage(e,!1,u),s=window.$$$(f).eq(0).attr("dv-group"),h={requiredControlId:f,message:o,triggered:r,group:s,indexesInfo:n.Common.getIndexesOfControl(i)};t.handleNewEntry(h)},t.clearSummary=function(){window.$form._validations.summary=[]},t.removeAllDataValidationsFromSummary=function(){for(var i=[],t,n=0;n<window.$form._validations.summary.length;n++)t=window.$form._validations.summary[n],t.requiredControlId!=null&&t.requiredControlId.trim()!=""&&i.push(t);window.$form._validations.summary=i},t.removeAllRequiredFieldsFromSummary=function(){for(var i=[],t,n=0;n<window.$form._validations.summary.length;n++)t=window.$form._validations.summary[n],t.rule!=null&&i.push(t);window.$form._validations.summary=i},t.removeValidationsThatDontBelongToGroups=function(n){var r,t,u;if(!(n.indexOf(i.ALL_GROUPS)>-1)){for(r=[],t=0;t<window.$form._validations.summary.length;t++)u=window.$form._validations.summary[t],n.indexOf(u.group)>-1&&r.push(u);window.$form._validations.summary=r}},t.handleNewEntry=function(n){t.updateBindings(n);t.updateValidationsSummary(n);t.updateMasterValidationsSummary(n);t.updateBoundControl(n);t.triggerDataValidationRelatedConditionals()},t.triggerDataValidationRelatedConditionals=function(){clearTimeout(t.conditionalsTriggerTimeout);t.conditionalsTriggerTimeout=setTimeout(function(){window._ruleEngine.updateDataValidationRelatedConditionals()},200)},t.entryHasContext=function(n){return n.indexesInfo!=null&&n.indexesInfo.indexes.length>0},t.updateBoundControl=function(i){var f=i.rule==null?"jb_required_":"",e=i.rule==null?i.requiredControlId:i.rule.originalName,u=$("[jb-validation-target='"+f+e+"']"),r;t.entryHasContext(i)===!0?(r=u.filter(function(t,r){return n.Common.getIndexKeyOfControl($(r))==i.indexesInfo.key}),r.toggle(i.triggered),r.text(i.message)):u.toggle(i.triggered)},t.updateBindings=function(n){var i=n.rule==null?n.requiredControlId:n.rule.originalName,r=n.rule==null?window.$master!=null&&window.$master._validations!=null&&window.$master._validations[n.requiredControlId]!=null:n.rule.fromMasterPage;t.entryHasContext(n)===!0?t.updateValidationBindingInsideContext(n,r,i):t.updateValidationBindingWithoutContext(n,r,i)},t.updateValidationBindingWithoutContext=function(t,i,r){i?(window.$master._validations[r]==null&&(window.$master._validations[r]=new n.Validation.BindingEntry),window.$master._validations[r].message=t.triggered===!0?t.message:null,window.$master._validations[r].triggered=t.triggered):(window.$form._validations[r]==null&&(window.$form._validations[r]=new n.Validation.BindingEntry),window.$form._validations[r].message=t.triggered===!0?t.message:null,window.$form._validations[r].triggered=t.triggered)},t.updateValidationBindingInsideContext=function(n,t,i){t===!0&&window.$master._validations[i]==null?window.$master._validations[i]=[]:window.$form._validations[i]==null&&(window.$form._validations[i]=[]);var f=t?window.$master._validations[i].filter(function(t){return t.indexesInfo.key==n.indexesInfo.key}):window.$form._validations[i].filter(function(t){return t.indexesInfo.key==n.indexesInfo.key}),r=f==null||f.length==0?null:f[0],u=t?window.$master._validations[i].indexOf(r):window.$form._validations[i].indexOf(r);t===!0?r!=null&&u>-1?window.$master._validations[i][u]=n:window.$master._validations[i].push(n):r!=null&&u>-1?window.$form._validations[i][u]=n:window.$form._validations[i].push(n)},t.updateValidationsSummary=function(n){var i=n.rule==null?window.$form._validations.summary.filter(function(t){return t.requiredControlId==n.requiredControlId}):window.$form._validations.summary.filter(function(t){return t.rule!=null&&t.rule.name==n.rule.name}),r=i.length>0;t.entryHasContext(n)===!0?t.updatedValidationSummaryForEntryInContext(n,i,r):t.updatedValidationSummaryForEntryWithoutContext(n,i,r)},t.updateMasterValidationsSummary=function(n){var i=n.rule==null?window.$form._validationsMaster.summary.filter(function(t){return t.requiredControlId==n.requiredControlId}):window.$form._validationsMaster.summary.filter(function(t){return t.rule!=null&&t.rule.name==n.rule.name}),r=i.length>0;t.entryHasContext(n)===!0?t.updatedMasterValidationSummaryForEntryInContext(n,i,r):t.updatedMasterValidationSummaryForEntryWithoutContext(n,i,r)},t.resetAllRequiredFieldOccurencesInSummary=function(){var t,n;for(t in window.$form._validations.summary)(n=window.$form._validations.summary[t],n.requiredControlId!=null&&n.requiredControlId.trim()!="")&&(n.occurences=0,n.triggered=!1)},t.removeFromMasterSummaryNotTriggeredRequiredFields=function(t){t==null&&(t=[]);var i=r.getRequiredFieldsThatMustBeIgnored();(i.map(function(i){var r=$(i),u=n.Common.getIndexesOfControl(r).indexes.length>0;if(u===!1)return!0;t.push(r.attr("jb-id"))}),t.length!=0)&&t.map(function(n){var i=window.$form._validationsMaster.summary.filter(function(t){return t.requiredControlId==n}),t,r;i.length!=0&&((t=i[0],t.occurences>0)||(r=window.$form._validationsMaster.summary.indexOf(t),window.$form._validationsMaster.summary.splice(r,1)))})},t.removeFromSummaryNotTriggeredRequiredFields=function(t){t==null&&(t=[]);var i=r.getRequiredFieldsThatMustBeIgnored();(i.map(function(i){var r=$(i),u=n.Common.getIndexesOfControl(r).indexes.length>0;if(u===!1)return!0;t.push(r.attr("jb-id"))}),t.length!=0)&&t.map(function(n){var i=window.$form._validations.summary.filter(function(t){return t.requiredControlId==n}),t,r;i.length!=0&&((t=i[0],t.occurences>0)||(r=window.$form._validations.summary.indexOf(t),window.$form._validations.summary.splice(r,1)))})},t.resetValidationOccurencesInSummary=function(n){var t=window.$form._validations.summary.filter(function(t){return t.rule!=null&&t.rule.name==n.name});t.length!=0&&(t[0].occurences=0)},t.removeFromMasterSummaryWhenNotTriggered=function(n){var i=window.$form._validationsMaster.summary.filter(function(t){return t.rule!=null&&t.rule.name==n.name}),t,r;i.length!=0&&((t=i[0],t.occurences>0)||(r=window.$form._validationsMaster.summary.indexOf(t),window.$form._validationsMaster.summary.splice(r,1)))},t.removeFromSummaryWhenNotTriggered=function(n){var i=window.$form._validations.summary.filter(function(t){return t.rule!=null&&t.rule.name==n.name}),t,r;i.length!=0&&((t=i[0],t.occurences>0)||(r=window.$form._validations.summary.indexOf(t),window.$form._validations.summary.splice(r,1)))},t.updatedMasterValidationSummaryForEntryInContext=function(n,t,i){if(i!==!1||n.triggered!==!1)if(i===!0){var r=t[0],u=window.$form._validationsMaster.summary.indexOf(r);n.triggered===!0&&r.occurences++}else n.occurences=1,window.$form._validationsMaster.summary.push(n)},t.updatedMasterValidationSummaryForEntryWithoutContext=function(n,t,i){if(i!==!1||n.triggered!==!1)if(i===!0){var r=window.$form._validationsMaster.summary.indexOf(t[0]);n.triggered===!0?window.$form._validationsMaster.summary[r]=n:window.$form._validationsMaster.summary.splice(r,1)}else window.$form._validationsMaster.summary.push(n)},t.updatedValidationSummaryForEntryInContext=function(n,t,i){if(i!==!1||n.triggered!==!1)if(i===!0){var r=t[0],u=window.$form._validations.summary.indexOf(r);n.triggered===!0&&r.occurences++}else n.occurences=1,window.$form._validations.summary.push(n)},t.updatedValidationSummaryForEntryWithoutContext=function(n,t,i){if(i!==!1||n.triggered!==!1)if(i===!0){var r=window.$form._validations.summary.indexOf(t[0]);n.triggered===!0?window.$form._validations.summary[r]=n:window.$form._validations.summary.splice(r,1)}else window.$form._validations.summary.push(n)},t.gridIsBoundToValidationsSummary=function(n){return $(n).attr("ng-model")=="_validations.summary"},t.conditionalsTriggerTimeout=null,t}();t.Bindings=e;i=function(){function n(){}return n.ALL_GROUPS="_ALL_",n.dataValidationRoleMark="has-dv-role",n.emptyRequiredMark="has-required-role",n.nowRequiredMark="jb-now-required",n.nowNotRequiredMark="jb-now-not-required",n.prevColorAttr="prev-role",n.errorRole="danger",n.warningRole="warning",n.infoRole="info",n}();t.Constants=i;r=function(){function r(){}return r.showPanel=function(){r.disablePanel!==!0&&r.panelScope.show()},r.getAllRequiredFields=function(){var n=$("."+window._themeManager.theme.defaultClassesByState.Required);return n.toArray().filter(function(n){return $(n).hasClass("cf-hidden")===!1&&$(n).parents(".cf-hidden").length==0})},r.emptyRequiredFieldsExist=function(){return $("."+window._themeManager.theme.defaultClassesByState.RequiredEmpty).length>0},r.updateEmptyRequiredFieldsState=function(u,f){var o,h,s,a;for((u==null||u.length==0)&&(u=r.lastEvaluatedValidationGroups),r.handleConditionallyHiddenAndNotRequiredFields(),t.Bindings.removeValidationsThatDontBelongToGroups(u),t.Bindings.resetAllRequiredFieldOccurencesInSummary(),o=[],h=r.getAllRequiredFields(),s=0;s<h.length;s++){var e=$(h[s]),v=e.attr("dv-group"),y=r.fieldIsEmpty(e),c=u.indexOf(i.ALL_GROUPS)>-1||u.indexOf(v)>-1,p=e.attr("jb-id"),l=y===!0&&c===!0;c===!0&&(a=n.Common.getIndexesOfControl(e).indexes.length>0,a===!0&&o.push(p));l===!0&&f===!0?(t.UiHelper.markEmptyRequired(e),t.Bindings.refreshEmptyRequired(e,!0)):l===!1&&(t.UiHelper.unmarkEmptyRequired(e),t.Bindings.refreshEmptyRequired(e,!1))}t.Bindings.removeFromSummaryNotTriggeredRequiredFields(o);t.Bindings.removeFromMasterSummaryNotTriggeredRequiredFields(o)},r.getRequiredFieldsThatMustBeIgnored=function(){var n=r.getAllRequiredFields(),t=n.filter(function(n){return $(n).hasClass("cf-hidden")===!0||$(n).parents(".cf-hidden").length>0}),u=$("."+i.nowNotRequiredMark).toArray();return t.concat(u)},r.handleConditionallyHiddenAndNotRequiredFields=function(){var i=r.getRequiredFieldsThatMustBeIgnored();i.map(function(i){var r=$(i),u=n.Common.getIndexesOfControl(r).indexes.length>0;if(u===!0)return!0;t.Bindings.removeBindingOfControl(r)})},r.refreshPanel=function(){r.disablePanel!==!0&&n.Core.applyScope(r.panelScope)},r.navigateFromDvBoundControl=function(t){var e=$(t),i=e.attr("jb-validation-target"),s=i.indexOf("jb_required_")==0,u,o,f;(s===!0&&(i=i.replace("jb_required_","")),u=window.$form._validations[i],u!=null)&&(Array.isArray(u)===!0?(o=n.Common.getIndexesOfControl(e),f=u.filter(function(n){return n.indexesInfo.key==o.key}),f!=null&&f.length>0&&r.navigateToRelatedControl(f[0])):r.navigateToRelatedControl(u))},r.navigateToRelatedControl=function(n){var i=t.UiHelper.getAffectedControls(n);n.indexesInfo==null||n.indexesInfo.indexes==null||n.indexesInfo.indexes.length==0?t.UiHelper.setFocusOnField(i.eq(0)):t.UiHelper.navigateToRelatedControlInGrid(n,i.eq(0))},r.getAffectedControls=function(n){var t=n.requiredControlId!=null&&n.requiredControlId!="";return t===!0?$("[jb-id='"+n.requiredControlId+"']"):n.rule.$affectedControls()},r.navigateToRelatedControlInGrid=function(i,r,u){var l=9,e,f,s,a,h,o,c;if(u==undefined?u={currentGridIndex:i.indexesInfo.indexes.length-1,$firstRowOfCurrentGrid:null,changePageIsActive:!1,recursionsLeft:l,timeout:50}:r=t.UiHelper.getAffectedControls(i),u.currentGridIndex>=0)e=r.eq(0).parents("table[jb-type='Grid']").eq(u.currentGridIndex),u.changePageIsActive?(a=e.children("tbody").children("tr:first"),a.get(0)!=u.$firstRowOfCurrentGrid.get(0)||u.recursionsLeft<0?(u.currentGridIndex--,u.recursionsLeft=l,u.changePageIsActive=!1,t.UiHelper.navigateToRelatedControlInGrid(i,r,u)):(u.recursionsLeft--,setTimeout(function(){t.UiHelper.navigateToRelatedControlInGrid(i,r,u)},u.timeout))):(f=n.Common.getDirectiveScope(e),f!=undefined&&(s=Math.floor(i.indexesInfo.indexes[u.currentGridIndex]/f.$pageSize),s!=f.$currentPage?(f.$gotoPage(s),u.changePageIsActive=!0,u.$firstRowOfCurrentGrid=e.children("tbody").children("tr:first")):(u.changePageIsActive=!1,u.$firstRowOfCurrentGrid=null,u.currentGridIndex--),t.UiHelper.navigateToRelatedControlInGrid(i,r,u)));else for(h=t.UiHelper.getAffectedControls(i).toArray(),o=0;o<h.length;o++)if(c=$(h[o]),n.Common.getIndexesOfControl(c).key==i.indexesInfo.key){t.UiHelper.setFocusOnField(c);break}},r.markDataValidationRelatedControls=function(t){var i=function(i){var u,o;if(i!=null)for(u in i)if(u!="summary"){var f=i[u],s=Array.isArray(f),e=s===!0?f:[f];e.length!=0&&(o=e[0].rule,o!=null)&&(t!==!0||o.evaluationTimes.indexOf(n.EvaluationTimes.OnChange)!=-1)&&e.map(function(n){return r.applyDataValidationColorRoleToAffectedControls(n)})}};i(window.$master._validations);i(window.$form._validations)},r.applyDataValidationColorRoleToAffectedControls=function(u){var o=u.rule.$affectedControls(),e=[],f;u.indexesInfo!=null?o.each(function(t,i){var r=$(i),f=n.Common.getIndexesOfControl(r);f.key==u.indexesInfo.key&&e.push(i)}):e=$.makeArray(o);f=t.Constants.errorRole;u.rule.dataValidationMessageType==n.DataValidationMessageType.INFO?f=t.Constants.infoRole:u.rule.dataValidationMessageType==n.DataValidationMessageType.WARN&&(f=t.Constants.warningRole);e.map(function(n){u.triggered===!0&&(r.lastEvaluatedValidationGroups.indexOf(i.ALL_GROUPS)>-1||r.lastEvaluatedValidationGroups.indexOf(u.group)>-1)?t.UiHelper.changeColorRole($(n),f,!0):r.resetColorRole($(n),!0)})},r.changeColorRole=function(n,t,r){var u=r?i.dataValidationRoleMark:i.emptyRequiredMark,f=n.hasClass(i.dataValidationRoleMark)===!1&&n.hasClass(i.emptyRequiredMark)===!1;f===!0&&n.attr(i.prevColorAttr,n.attr("ui-role-color"));n.addClass(u);window._ruleEngine.cfHelper.setColorRole(n,t,n.attr("jb-type"))},r.resetColorRole=function(n,t){var u=t?i.dataValidationRoleMark:i.emptyRequiredMark,r;n.removeClass(u);r=n.attr(i.prevColorAttr)||"";window._ruleEngine.cfHelper.setColorRole(n,r,n.attr("jb-type"))},r.markEmptyRequired=function(t){r.changeColorRole(t,i.errorRole,!1);r.addStateToField(t,n.ThemeManager.States.RequiredEmpty)},r.unmarkEmptyRequired=function(t){r.removeStateFromField(t,n.ThemeManager.States.RequiredEmpty);r.resetColorRole(t,!1)},r.fieldIsEmpty=function(n){var f=n.attr("jb-type"),r,t,u,i;switch(f){case"OptionButton":return r=$('[type="radio"]:checked',n),r.length===0;case"DropDownBox":return(t=n.val(),t==null)?!0:t.indexOf("?")===-1?!1:(u=t.length-1,t[0]==="?"&&t[u]==="?");case"FileAttachment":return n.children("li").length===0;case"ImageBox":return i=n.next("input"),i.length>0&&(i.val()==null||i.val().trim()==="");default:return n.val()==null||n.val().trim()===""}},r.getEmptyRequiredFields=function(n){for(var f=r.getAllRequiredFields(),e=[],t=0;t<f.length;t++){var u=$(f[t]),o=u.attr("dv-group"),s=n.indexOf(i.ALL_GROUPS)>-1||n.indexOf(o)>-1;s!==!1&&r.fieldIsEmpty(u)!==!1&&e.push(u)}return $(e).map(function(){return this.toArray()})},r.setFocusOnField=function(n){for(var r=n.parents("div[class*='tab-pane'], div[jb-type='FieldSet']"),t,u,i=0;i<r.length;i++)t=r.eq(i),t.hasClass("tab-pane")&&t.parent().siblings("ul[jb-type='TabHeader']").find("li[jb-type='TabHeaderPageTitle'][data-index='"+t.attr("data-index")+"']").click(),t.attr("jb-type")=="FieldSet"&&t.hasClass("jb-collapsed")&&t.children("div[jb-type='FieldSetHeader']").children(".toggle-state-icon").click();u=n.attr("jb-type");switch(u){case"DropDownBox":n.trigger("chosen:activate");break;default:n.focus()}},r.addStateToField=function(n,t){window._themeManager.setControlState(n,t);var i=n.attr("jb-type");switch(i){case"DropDownBox":window._themeManager.transferClassesOfStateToOtherElement(n,n.next(),t);break;case"FileAttachment":window._themeManager.transferClassesOfStateToOtherElement(n,n.next("input[type='file']"),t)}},r.removeStateFromField=function(n,t){window._themeManager.removeControlState(n,t)},r.lastEvaluatedValidationGroups=[i.ALL_GROUPS],r}();t.UiHelper=r})(t=n.Validation||(n.Validation={}))}(Joove||(Joove={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){function l(){return{priority:1001,restrict:"AE",scope:!1,link:function(n,t){setTimeout(function(){window._ruleEngine.updateRulesOfControl(t)},15)}}}function a(){return{priority:1001,restrict:"AE",scope:{},link:function(t,i){n.Common.directiveScopeIsReady(i)||(i.css("min-height","25px"),i.addClass("jb-autosize"),setTimeout(function(){},600),n.Common.markDirectiveScopeAsReady(i))}}}function v(){return{priority:1001,restrict:"AE",scope:{model:"=ngModel",myNumber:"=ngMyNumber"},link:function(i,f){var o,e,s,h;if(!n.Common.directiveScopeIsReady(f)){n.Common.setDirectiveScope(f,i);o=f.data("binding-type");f.addClass(t.MarkClass);o==null&&(o="decimal");try{var c=f.attr("data-mask"),l=n.Common.replaceAll(c,"'",'"'),a=JSON.parse(l);e=new t(a)}catch(v){console.error("Could not parse input mask attribute to ValueFormat object!");e=new t({decimals:2,groups:!0})}s=null;h=null;e.live===!0?(h=new r,h.init(f,i,e,o)):(s=new u,s.init(f,i,e));i.valueIsValid=function(){return e.live===!0?h.valueIsValidNumber():s.valueIsValidNumber()};i.getValueFormat=function(){return e};n.Common.markDirectiveScopeAsReady(f)}}}}function y(){return{priority:1001,restrict:"AE",scope:{model:"=ngBind",format:"=jbFormat"},link:function(i,r){if(!n.Common.directiveScopeIsReady(r)){n.Common.setDirectiveScope(r,i);r.addClass(t.MarkClass);var u;try{u=new t(i.format)}catch(f){u=null;console.error("Could not initialize ValueFormat with provided options!",f)}i.$watch("model",function(n){if(n==null)r.text("");else if(u!=null){var t=u.format(n);r.text(t)}});i.getValueFormat=function(){return u};n.Common.markDirectiveScopeAsReady(r)}}}}function p(){return{priority:1001,restrict:"AE",scope:{model:"=jbMarkup"},link:function(t,i){if(!n.Common.directiveScopeIsReady(i)){n.Common.setDirectiveScope(i,t);t.$watch("model",function(n){(i.empty(),n!=null&&n.trim()!="")&&(n.indexOf("<")>-1?i.html(n):i.html(r(n)))});var r=function(n){return $("<div/>").html(n).text()};n.Common.markDirectiveScopeAsReady(i)}}}}var i=function(){function n(){this._defaultOptions={}}return n.prototype.setOptions=function(n){this._defaultOptions=n},n.prototype.$get=function(){return{getOptions:function(){return this._defaultOptions}}},n}(),f,e,o,s,r,t,u,h,c;n.BaseAngularProvider=i;f=function(){function n(){}return n.getUsedAngularModules=function(t){for(var u=n.allModules.concat(t||[]),r,i=0;i<u.length;i++){r=n.allModules[i];try{angular.module(r)}catch(f){angular.module(r,[])}}return u},n.allModules=["ngSanitize","joovegrid","treeNode","ruleApply","ngSimpleSelect","jbDatepicker","jbTabs","jbAutosize","jbMask","jbFormat","jbImage","jbAttachment","jbMap","jbChart","jooveDsGrid","jbProgress","angularTrix","jbDataList","jbDataPickList","jooveCalendar","jbCompositeFilters","jbQuickDateTimePicker","jbValidationUi","jbMarkup"],n}();n.ClmsAngular=f;e=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t}(i);angular.module("ruleApply",[]).provider("ruleApply",new e).directive("ruleApply",["$timeout","$interval","ruleApply",l]);o=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t}(i);angular.module("jbAutosize",[]).provider("jbAutosize",new o).directive("jbAutosize",["$timeout","$interval","jbAutosize",a]);s=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t}(i);angular.module("jbMask",[]).provider("jbMask",new s).directive("jbMask",["$timeout","$interval","jbMask",v]);r=function(){function t(){}return t.prototype.init=function(n,t,i,r){var f=this,u;this.$element=n;this.scope=t;this.dt=r;this.isRetartedBrowser=typeof Event!="function";u=i.getJqueryInputMaskOptions();u.onBeforeMask=function(n,t){return f.beforeMask(n,t)};n.inputmask(u);this.$element.on("change",function(){f.onInputChange()});this.watchNumberBindingForChanges()},t.prototype.watchNumberBindingForChanges=function(){var n=this;this.scope.$watch("myNumber",function(t){n.modelChangedByUserInput!==!0&&n.$element.val(t)})},t.prototype.onInputChange=function(){var t=this,n;this.modelChangedByUserInput=!0;n=this.getNumberUnformatted();this.updateBoundValueInModel(n);setTimeout(function(){t.modelChangedByUserInput=!1},10)},t.prototype.getNumberUnformatted=function(){return this.$element.inputmask("unmaskedvalue")},t.prototype.updateBoundValueInModel=function(t){this.scope.myNumber=t;n.Core.applyScope(this.scope)},t.prototype.valueIsValidNumber=function(){return!0},t.prototype.beforeMask=function(t,i){var r=t;return(this.dt=="decimal"||this.dt=="float"||this.dt=="double")&&(r=n.Common.localizeNumber(r,n.Common.getCurrenctNumberSeperator()),r.indexOf(window._context.decimalSeparator)==-1&&(r+=window._context.decimalSeparator,r+="000")),i.isNegative=!1,this.internetExplorerHack(),r},t.prototype.internetExplorerHack=function(){var n=this;this.isRetartedBrowser!==!1&&window._ruleEngine!=null&&window._ruleEngine.onLoadHasRun===!0&&setTimeout(function(){var t=n.scope.$eval(n.scope.myNumber),i=n.getNumberUnformatted();t!=i&&(n.$element.focus(),n.$element.change(),$("body").focus(),n.$element.focus())},50)},t}();n.LiveInputMask=r;t=function(){function t(t){t==null?(this.decimals=2,this.groups=!0):(this.dateFormat=t.dateFormat,this.prefix=t.prefix,this.postfix=t.postfix,this.decimals=t.decimals,this.signed=t.signed,this.showOnlyDecimalPart=t.showOnlyDecimalPart,this.groups=t.groups,this.live=t.live,this.asPercentage=t.asPercentage);this.dateMode=n.Common.stringIsNullOrEmpty(this.dateFormat)==!1;this.dateMode===!0?this.setMomentJsFormat():this.setNumeralJsFormat()}return t.prototype.setMomentJsFormat=function(){this.momentJsFormat=this.dateFormat},t.prototype.setNumeralJsFormat=function(){n.Common.setNumberLocalizationSettings();var t="";this.asPercentage===!0?(t="0",this.decimals>0&&(t+="."+new Array(this.decimals+1).join("0")),t+="%"):(this.showOnlyDecimalPart===!0?t=".":this.groups===!0?t+="0,0":t="0",this.signed===!0&&(t="+"+t),this.decimals>0?(this.showOnlyDecimalPart!==!0&&(t+="."),t+=new Array(this.decimals+1).join("0")):this.showOnlyDecimalPart===!0&&(t=".0"));this.numeralJsFormat=t},t.prototype.getJqueryInputMaskOptions=function(){return{alias:this.decimals==0||this.decimals==null?"integer":"decimal",autoGroup:this.groups==!0,digits:this.decimals,radixPoint:window._context.decimalSeparator,groupSeparator:window._context.groupSeparator,suffix:this.postfix,prefix:this.prefix,allowMinus:!0,rightAlign:!1,unmaskAsNumber:!0}},t.prototype.formatNumber=function(t){var r,u,i;return t==null?"":(r=numeral(t),r.value()==null)?"":(u=Math.round,i=r.format(this.numeralJsFormat,u),n.Common.stringIsNullOrEmpty(this.prefix)===!1&&(i=this.prefix+i),n.Common.stringIsNullOrEmpty(this.postfix)===!1&&(i+=this.postfix),i)},t.prototype.unformatNumber=function(n){var i,r,t;return n==null?null:n.trim&&n.trim()==""?null:n.toString&&n.toString()=="NaN"?null:typeof n=="number"?n:(i=window._context.groupSeparator,n=n.replace(new RegExp("\\"+i,"g"),""),r=window._context.decimalSeparator,n=n.replace(new RegExp("\\"+r,"g"),"."),n=n.replace(/[^\d.-]/g,""),t=parseFloat(n),isNaN(t)===!0?null:t)},t.prototype.formatDate=function(n){return moment(n).format(this.momentJsFormat)},t.prototype.unformatDate=function(n){return moment(n,this.momentJsFormat).toDate()},t.prototype.format=function(n,t){return this.dateMode===!0||t===!0?this.formatDate(n):this.formatNumber(n)},t.prototype.unformat=function(n){return this.dateMode===!0?this.unformatDate(n):this.unformatNumber(n)},t.MarkClass="jb-has-value-format",t}();n.ValueFormat=t;u=function(){function t(){this.numbersOnlyListenerClass="numbers-only-listener"}return t.prototype.init=function(n,t,i){var u=this,r;this.$input=n;this.scope=t;this.valueFormat=i;r=n.attr("data-binding-type");this.forceInteger=r=="long"||r=="int";this.$input.on("change",function(){u.onInputChange()});this.$input.on("focus",function(){u.addListenerForAllowingNumbersOnly()});this.watchNumberBindingForChanges()},t.prototype.watchNumberBindingForChanges=function(){var n=this;this.scope.$watch("myNumber",function(t){if(n.modelChangedByUserInput!==!0){var i=typeof t=="number"?t:n.valueFormat.unformat(t);n.setDisplayValueToInput(i)}})},t.prototype.onInputChange=function(){var r=this,i,t;this.modelChangedByUserInput=!0;var u=this.$input.val(),n=this.valueFormat.unformat(u),f=n!=null&&Number(n)===n;f===!0&&(this.forceInteger===!0&&n%1!=0?n=parseInt(n):(i=this.valueFormat.decimals,i==null&&(i=0),t=n.toString().split("."),i==0||t.length<2?n=parseInt(t[0]):(t[1]==""&&(t[1]="0"),n=parseFloat(t[0]+"."+t[1].substr(0,i)))));this.setDisplayValueToInput(n);this.updateBoundValueInModel(n);setTimeout(function(){r.modelChangedByUserInput=!1},10)},t.prototype.updateBoundValueInModel=function(t){this.scope.myNumber=t;n.Core.applyScope(this.scope)},t.prototype.setDisplayValueToInput=function(n){var t=this.valueFormat.format(n);this.$input.val(t)},t.prototype.addListenerForAllowingNumbersOnly=function(){var n=this;if(this.$input.hasClass(this.numbersOnlyListenerClass)!==!0){this.$input.on("keypress",function(t){var i=t.which?t.which:t.keyCode,f=i==43||i==45,r=i==46,u=i==44,e=i>31&&(i<48||i>57);return r===!0&&window._context.decimalSeparator==","?(n.insertTextAtCursor(","),!1):u===!0&&window._context.decimalSeparator=="."?(n.insertTextAtCursor("."),!1):e==!1||r||u||f});this.$input.addClass(this.numbersOnlyListenerClass)}},t.prototype.insertTextAtCursor=function(n){function f(n){var t,i,r;return document.selection?(n.focus(),t=document.selection.createRange(),i=t.text.length,t.moveStart("character",-n.value.length),r=t.text.length-i,{start:r,end:r+i}):n.selectionStart||n.selectionStart=="0"?{start:n.selectionStart,end:n.selectionEnd}:{start:0,end:0}}function e(n,t,i){if(n.setSelectionRange)n.focus(),n.setSelectionRange(t,i);else if(n.createTextRange){var r=n.createTextRange();r.collapse(!0);r.moveEnd("character",i);r.moveStart("character",t);r.select()}}var i=this.$input[0],t=f(i),r=this.$input.val()||"",o=r.substr(0,t.start),s=r.substr(t.end),u=t.start+1;this.$input.val(o+n+s);e(i,u,u)},t.prototype.valueIsValidNumber=function(){var n=this.$input.val(),t=this.valueFormat.unformat(n);return t!=null},t}();n.NumericMask=u;h=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t}(i);angular.module("jbFormat",[]).provider("jbFormat",new h).directive("jbFormat",["$timeout","$interval","jbFormat",y]);c=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t}(i);angular.module("jbMarkup",[]).provider("jbMarkup",new c).directive("jbMarkup",["$timeout","$interval","jbMarkup",p])}(Joove||(Joove={})),function(n){var t;(function(n){var t;(function(n){var i,t,r,u;(function(n){n[n.Debug=0]="Debug";n[n.Info=1]="Info";n[n.Warning=2]="Warning";n[n.Error=3]="Error";n[n.IDEF0Trace=4]="IDEF0Trace"})(i=n.DebugMessageType||(n.DebugMessageType={})),function(n){n[n.ALL=0]="ALL";n[n.DEBUG=1]="DEBUG";n[n.INFO=2]="INFO";n[n.WARN=3]="WARN";n[n.ERROR=4]="ERROR";n[n.FATAL=5]="FATAL";n[n.OFF=6]="OFF"}(t=n.LoggerLevel||(n.LoggerLevel={}));r=function(){function n(n,i){this._Name=n;this._Level=i;this._Level=window._context.mode==="Development"?t.ALL:t.OFF;this._Name=n}return Object.defineProperty(n.prototype,"IsDebugEnabled",{get:function(){return this._Level==t.DEBUG},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"IsInfoEnabled",{get:function(){return this._Level==t.INFO},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"IsWarnEnabled",{get:function(){return this._Level==t.WARN},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"IsErrorEnabled",{get:function(){return this._Level==t.ERROR},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"IsFatalEnabled",{get:function(){return this._Level==t.FATAL},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"Name",{get:function(){return"["+moment()+"] "+this._Name},enumerable:!0,configurable:!0}),n.prototype.Debug=function(n){switch(this._Level){case t.FATAL:case t.ERROR:case t.WARN:case t.INFO:case t.DEBUG:case t.ALL:n.unshift(this.Name);n.unshift("Debug");console.debug.apply(console,n)}},n.prototype.Info=function(n){switch(this._Level){case t.FATAL:case t.ERROR:case t.WARN:case t.INFO:n.unshift(this.Name);n.unshift("INFO");console.info.apply(console,n)}},n.prototype.Warn=function(n){switch(this._Level){case t.FATAL:case t.ERROR:case t.WARN:n.unshift(this.Name);n.unshift("Warn");console.info.apply(console,n)}},n.prototype.Error=function(n){switch(this._Level){case t.FATAL:case t.ERROR:n.unshift(this.Name);n.unshift("Error");console.error.apply(console,n)}},n.prototype.Fatal=function(n){switch(this._Level){case t.FATAL:n.unshift(this.Name);n.unshift("Fatal");console.error.apply(console,n)}},n}();n.Logger=r;u=function(){function n(){}return n.Instance=function(){return n._instance!=null?n._instance:(n._instance=new r("root"),n._instance)},n.Log=function(n,t,r){if(r===void 0&&(r=!1),window.console!=null)switch(n){case i.Debug:console.debug(t);break;case i.Info:console.info(t);break;case i.Warning:console.warn(t);break;case i.Error:console.error(t);break;case i.IDEF0Trace:console.trace(t)}if(r){var e=n.toString(),o=Joove.Common.cloneObject(t),u=Joove.Ajax.deleteUnwantedPropertiesSafe(o),f=u;(Joove.Common.valueIsObject(u)||Joove.Common.isArray(u))&&(f=Joove.Ajax.reduceViewModelData(u));var s=JSON.stringify(f),h=Joove.Ajax.sanitizeSerializedData(s),c=h;Joove.Core.executeControllerAction(window._context.currentController,"_Raise","POST",[],{eventName:"DebugMessage",parameters:[e,c]},null,null,null)}},n}();n.DebugHelper=u})(t=n.Utilities||(n.Utilities={}))})(t=n.Framework||(n.Framework={}))}(CLMS||(CLMS={})),function(n){var t=function(){function t(){}return t.init=function(n,i){try{t.exportShortcuts(n,i);t.extendScope(n)}catch(r){console.error("Could not initialize Js Developer API!");console.error(r)}},t.exportShortcuts=function(i,r){window.$form=i;window.$master=r;window.$actions=i.actions;window.$masterActions=r.actions;window.$updateBindings=function(){n.Core.applyScope(i);n.Core.applyScope(r)};window.$refreshLogic=function(t){window._ruleEngine.update(n.EvaluationTimes.OnChange,undefined,t)};window.$controlChanged=function(t,i,r){n.Core.onChange(t,i,r)};window.$closeForm=function(){window._commander.closeForm()};window.$showMessage=function(n,t,i){window._commander.showMessage([n,t,i])};window.$redirectToUrl=function(n,t){t==null?window._commander.redirect([n]):window._commander.redirect([n,t])};window.$redirectToAction=function(t,i){for(var u=[],r=2;r<arguments.length;r++)u[r-2]=arguments[r];n.Core.executeRedirectControllerAction(t,i,"GET",u,null,null)};window.$events={on:{},raise:function(t){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];n.Core.executeControllerAction(window._context.currentController,"_Raise","POST",[],{eventName:t,parameters:r},null,null,null)}};window.$dataSets={};window.$dataSets.get=function(n,i){t.fetchDataSource(n,!1,i)};window.$masterDataSets={};window.$masterDataSets.get=function(n,i){t.fetchDataSource(n,!0,i)};window.$info={action:window._context.currentAction,controller:window._context.currentController,masterForm:window._context.currentMasterPageController,siteRoot:window._context.siteRoot,pathAndQuery:window._context.urlQuery,devMode:window._context.mode=="Development",dirty:window._context.isDirty,modal:window._context.isModal};window.$localization={locale:window._context.locale,decimalSeparator:window._context.decimalSeparator,groupSeparator:window._context.groupSeparator}},t.extendScope=function(n){n.$res=function(n){return window._resourcesManager.getLocalResource(n)};n.$resMaster=function(n){return window._resourcesManager.getLocalResource(n,!0)};n.$resPartial=function(n,t){return window._resourcesManager.getLocalResource(n,!1,t)};n.$resGlobal=function(n){return window._resourcesManager.getGlobalResource(n)};n.$user=window._context.currentUser;n.$username=window._context.currentUsername;n.$appName=window._context.appName;n.$userHasPermission=function(n){return window._context.currentUserPermissions.indexOf(n)>-1};n.$userHasRole=function(n){return window._context.currentUserRoles.indexOf(n)>-1}},t.addFilterInfo=function(t,i){var f,u;if(t.filters!=null)for(f=new n.ColumnInfo(t.field,t.dataType),u=0;u<t.filters.length;u++){var r=t.filters[u],e=r.rowOperator==null?n.RowOperators.OR:n.RowOperators[r.rowOperator.toUpperCase()],o=r.operator==null?n.FilterOperators.LIKE:n.FilterOperators[r.operator.toUpperCase()];i.push(new n.FilterInfo(f,r.value,e,o,r.secondValue))}},t.addOrderByInfo=function(t,i){if(t.orderBy!=null){var r=new n.ColumnInfo(t.field,t.dataType);t.orderBy.toUpperCase()=="ASC"?i.push(new n.OrderByInfo(r,n.OrderByDirections.ASC)):t.orderBy.toUpperCase()=="DESC"&&i.push(new n.OrderByInfo(r,n.OrderByDirections.DESC))}},t.addGroupByInfo=function(t,i){var u,r,f;t.groupBy!=null&&t.groupBy!=!1&&(u=new n.ColumnInfo(t.field,t.dataType),r=t.groupBy.toString().toUpperCase(),r=="GROUPS"||r=="DATA"||r=="TRUE")&&(f=r=="GROUPS",i.push(new n.GroupByInfo(u,n.GroupState.EXPANDED,!1,f)))},t.fetchDataSource=function(i,r,u){var e={dsName:i,pageSize:u.pageSize||50,startRow:u.startRow||0,fields:u.fields,done:u.done,forMaster:r,error:u.error,complete:u.complete,filters:[],ordering:[],grouping:[]},o,f;if(u.args!=null)for(o=0;o<u.args.length;o++)(f=u.args[o],f!=null)&&(t.addFilterInfo(f,e.filters),t.addOrderByInfo(f,e.ordering),t.addGroupByInfo(f,e.grouping));n.DatasourceManager.fetchDatasourceForJsApi(e)},t.onDatasourceRequestCompleted=function(n,t,i){window.$form.dataSets==null&&(window.$form.dataSets={});window.$form.dataSets[n]=t;window.$form.dataSets[n].request=i},t}();n.DeveloperApi=t}(Joove||(Joove={}));__decorate=this&&this.__decorate||function(n,t,i,r){var f=arguments.length,u=f<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,e,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(n,t,i,r);else for(o=n.length-1;o>=0;o--)(e=n[o])&&(u=(f<3?e(u):f>3?e(t,i,u):e(t,i))||u);return f>3&&u&&Object.defineProperty(t,i,u),u},function(n){function t(){return function(t,i,r){try{var u=t[i];r.value=function(){var t=u();return n.Common.changeDateTimeFormat(t)}}catch(f){}}}var i=function(){function n(){}return n.prototype.LongDatePattern=function(){return window._context.longDatePattern},n.prototype.LongTimePattern=function(){return window._context.longTimePattern},n.prototype.ShortDatePattern=function(){return window._context.shortDatePattern},n.prototype.ShortTimePattern=function(){return window._context.shortTimePattern},n.prototype.GeneralShortTimePattern=function(){return this.ShortDatePattern()+" "+this.ShortTimePattern()},n.prototype.GeneralLongTimePattern=function(){return this.ShortDatePattern()+" "+this.LongTimePattern()},__decorate([t()],n.prototype,"LongDatePattern",null),__decorate([t()],n.prototype,"LongTimePattern",null),__decorate([t()],n.prototype,"ShortDatePattern",null),__decorate([t()],n.prototype,"ShortTimePattern",null),n}(),r;n.DateTimeFormat=i;r=function(){function n(){}return n.GetCurrentLocaleManager=function(){return n._instance!=null?n._instance:(n.init(),n._instance)},Object.defineProperty(n.prototype,"SortName",{get:function(){return window._context.locale},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"SortNameLanguage",{get:function(){return window._context.language},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"DateTimeFormat",{get:function(){return this.dateTimeFormat},enumerable:!0,configurable:!0}),n.init=function(){var t=new n;t.dateTimeFormat=new i;n._instance=t},n}();n.GlobalizationManager=r}(Joove||(Joove={}));_createMSXMLDocumentObject=window.CreateMSXMLDocumentObject,function(n){var t;(function(n){var t,i;Node.prototype.SelectSingleNode||(Node.prototype.SelectSingleNode=function(n){var t=(new DOMParser).parseFromString(this.outerHTML,"text/xml"),i;if(typeof ActiveXObject!="undefined")return t.setProperty("SelectionLanguage","XPath"),t.selectSingleNode(n);if(t.evaluate)return i=t.evaluate(n,t.firstElementChild,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null),i.singleNodeValue;window.console&&console.error("Your browser does not support the [evaluate] method!")});Node.prototype.SelectNodes||(Node.prototype.SelectNodes=function(n){var t=(new DOMParser).parseFromString(this.outerHTML,"text/xml");if(typeof ActiveXObject!="undefined")return t.setProperty("SelectionLanguage","XPath"),t.selectNodes(n);if(t.evaluate){for(var r=t.evaluate(n,t.firstElementChild,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null),u=[],i=r.iterateNext();i;)u.push(i),i=r.iterateNext();return u}window.console&&console.error("Your browser does not support the  [evaluate] method!")});t=function(){function n(){}return Object.defineProperty(n.prototype,"outerHTML",{get:function(){return this.xmlDocument.outerHTML},enumerable:!0,configurable:!0}),n.prototype.LoadXml=function(n){var i,t;if(typeof ActiveXObject!="undefined")return this.xmlDocument=new ActiveXObject("Microsoft.XMLDOM"),this.xmlDocument.loadXML(n),this.xmlDocument.setProperty("SelectionLanguage","XPath"),!0;if(window.DOMParser){i=new DOMParser;try{this.xmlDocument=i.parseFromString(n,"text/xml")}catch(r){return window.console&&console.error("XML Parsing Error: Text is not well-formed"),!1}}else{if(this.xmlDocument=_createMSXMLDocumentObject(),!this.xmlDocument)return window.console&&console.error("Cannot create XMLDocument object"),!1;this.xmlDocument.loadXML(n)}return(t=null,this.xmlDocument.parseError&&this.xmlDocument.parseError.errorCode!=0?t="XML Parsing Error: "+this.xmlDocument.parseError.reason+" at line "+this.xmlDocument.parseError.line+" at position "+this.xmlDocument.parseError.linepos:this.xmlDocument.documentElement?this.xmlDocument.documentElement.nodeName=="parsererror"&&(t=this.xmlDocument.documentElement.childNodes[0].nodeValue):t="XML Parsing Error!",t)?(window.console&&console.error(t),!1):(window.console&&console.info("Successfully parsed he XML Document"),!0)},n.prototype.SelectSingleNode=function(n){var t,i;return typeof ActiveXObject!="undefined"&&(t=this.xmlDocument.selectNodes(n),t.length>0)?t[0]:this.xmlDocument.evaluate?(i=this.xmlDocument.evaluate(n,this.xmlDocument,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null),i.singleNodeValue):(window.console&&console.error("Your browser does not support the [evaluate] method!"),null)},n.prototype.SelectNodes=function(n){if(typeof ActiveXObject!="undefined")return this.xmlDocument.selectNodes(n);if(this.xmlDocument.evaluate){for(var i=this.xmlDocument.evaluate(n,this.xmlDocument,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null),r=[],t=i.iterateNext();t;)r.push(t),t=i.iterateNext();return r}return window.console&&console.error("Your browser does not support the [evaluate] method!"),null},n}();n.XmlDocument=t;i=function(){function n(){}return n.prototype.visit=function(n,t,i){var u,r;for(i===void 0&&(i=null),t(i,n),u=n.children,r=0;r<u.length;r++)this.visit(u[r],t,n)},n.prototype.toObject=function(n,t,i){var u,f,r;for(i===void 0&&(i=null),u=t(i,n),f=n.children,r=0;r<f.length;r++)this.toObject(f[r],t,u);return u},n}();n.HtmlVisitor=i})(t=n.Xml||(n.Xml={}))}(System||(System={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var i,r,u,t,f,e;(function(n){n[n.Click=0]="Click";n[n.Change=1]="Change";n[n.Stop=2]="Stop"})(i=n.ActionType||(n.ActionType={})),function(n){n[n.UnChanged=0]="UnChanged";n[n.Changed=1]="Changed"}(r=n.StateType||(n.StateType={}));u=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t}(Error);n.AssertError=u;t=function(){function t(){}return t.sanitizeState=function(n){for(var u=Object.keys(n),i,r=0;r<u.length;r++){if(i=u[r],i.indexOf("_")===0||i==="Domain"){delete n[i];continue}Array.isArray(n[i])&&(n[i]=n[i].map(function(n){return t.sanitizeState(n)}));n[i]instanceof Object&&(n[i]=t.sanitizeState(n[i]))}try{return JSON.parse(JSON.stringify(n))}catch(f){console.log(n)}},t.getControlSelectorName=function(n){var t="",r=n.attr("jb-id"),i;return r!=null?t='[jb-id="'+r+'"]':(i=n.attr("class").split(/\s+/).filter(function(n){return n.indexOf("ng-scope")!=-1}),t=i.lenght>0?i.join("."):n.prop("tagName").toLowerCase()),""+t},t.getControl=function(n){return $($(n.controlName).get(n.index))},t.fullPath=function(n){for(var i=[];n.parent();){if(n.attr("jb-type")==="Body"){i.unshift('[jb-id="'+n.attr("jb-id")+'"]');break}else i.unshift(t.getControlSelectorName(n));n=n.parent()}return i.join(" > ")},t.getModelSnapshot=function(){return t.sanitizeState(n.Common.cloneObject(window.$form.model))},t.getHtmlSnapshot=function(){var t=new System.Xml.HtmlVisitor;return t.toObject(document.body,function(t,i){var r={childs:[]},e=i.className,u,f;return n.Common.stringIsNullOrEmpty(e)||(r.classes=e),u=i.getAttribute("style"),u!=null&&(r.style=u),i.children.length===0&&(f=i.textContent,n.Common.stringIsNullOrEmpty(f)||(r.text=f)),t!=null&&i.id!=="recorder"&&t.childs.push(r),r},null)},t}();n.RecorderUtilities=t;f=function(){function f(n){n===void 0&&(n=[]);this.steps=n;this.stepId=1;this.currentState=n[0];this.delay=1e3;this.fns=[]}return f.prototype.play=function(){for(var n=this,t=new Promise(function(n){n(!0)}),i=0;i<this.steps.length;i+=2)t=t.then(function(){return n.notify()}).then(function(){return n.step()}).then(function(){return n.forward()}).then(function(){return n.sleep()}).then(function(){return n.assertCurrentState()});return t},f.prototype.sleep=function(){var n=this;return new Promise(function(t){setTimeout(function(){return t()},n.delay)})},f.prototype.step=function(){var t=this;return new Promise(function(r){var f=t.getCurrentStep(),u;if(f==null)r(!1);else{u=$($(f.controlName).get(f.index));switch(f.type){case i.Click:u.click();break;case i.Change:u.val(n.Common.autoParse(f.newValue));u.change();u.blur();u.focus()}t.loadCurrentState();r(!0)}})},f.prototype.forward=function(){var n=this;return new Promise(function(t){if(n.finished())t();else{var i=n.getNextStep();t()}})},f.prototype.loadCurrentState=function(){var n=this.steps[this.stepId+1];n.$type===r.Changed&&(delete n.$type,this.currentState=n)},f.prototype.finished=function(){return this.stepId>this.steps.length},f.prototype.assertCurrentState=function(){var i=this;return new Promise(function(r,f){var e={view:t.getHtmlSnapshot(),model:t.sanitizeState(n.Common.cloneObject(window.$form.model))};n.Comparator.DeepEqual(i.getCurrentState(),e)?r(!0):f(new u("Model state is different"))})},f.prototype.isAction=function(n){return n==null?!1:n.type===i.Click},f.prototype.getCurrentStep=function(){return this.steps[this.stepId]},f.prototype.getCurrentState=function(){return this.currentState!=null&&delete this.currentState.$type,this.currentState},f.prototype.getNextStep=function(){return this.stepId=this.stepId+2,this.steps[this.stepId]},f.prototype.register=function(n){this.fns.push(n)},f.prototype.notify=function(){var n=this;this.fns.forEach(function(t){return t(n.stepId)})},f.prototype.numSteps=function(){return Math.floor(this.steps.length/2)},f}();n.Recording=f;e=function(){function u(){var n=this,t;this.currentState=null;this.beforeOnChangeState=null;this.states=[];t=this;this.isRecording=!1;setTimeout(function(){n.initListenner()},1e3)}return u.prototype.listen=function(n){this.isRecording&&(this.saveModelSnapshot(!0),n!=null&&this.states.push(this.parseRecordEvent(n)))},u.prototype.getRecording=function(){return new f(this.states)},u.prototype.start=function(){this.isRecording=!0;this.beforeOnChangeState={view:t.getHtmlSnapshot(),model:t.sanitizeState(n.Common.cloneObject(window.$form.model))}},u.prototype.pause=function(){this.isRecording=!1},u.prototype.stop=function(){this.isRecording&&(this.saveModelSnapshot(),this.isRecording=!1,this.currentState=null)},u.prototype.addState=function(n){this.isRecording&&(this.saveModelSnapshot(),n!=null&&this.states.push(this.parseEvent(n)))},u.prototype.parseRecordEvent=function(r){var u=$(r.element),f={type:r.type,controlName:t.fullPath(u)};return f.type===i.Change&&(f.newValue=n.Common.autoParse(u.val())),this.setIndex(f,u)},u.prototype.parseEvent=function(n){var r=$(n.currentTarget),u={type:i.Click,controlName:t.fullPath(r)};return this.setIndex(u,r)},u.prototype.setIndex=function(n,t){for(var r=$(n.controlName),i=0;i<r.length;i++)r.get(i)==t.get(0)&&(n.index=i);return n},u.prototype.saveModelSnapshot=function(t){if(t===void 0&&(t=!1),this.isRecording){this.currentState==null&&(this.states=[]);var u=this.getCurrentSnapshot(),i=this.getSnapshot(u,t);n.Comparator.DeepEqual(u,i)?this.states.push({$type:r.UnChanged}):(i.$type=r.Changed,this.currentState=i,this.states.push(i))}},u.prototype.getSnapshot=function(i,r){r===void 0&&(r=!1);var f=t.getHtmlSnapshot(),e=t.sanitizeState(n.Common.cloneObject(window.$form.model)),u={model:e,view:f};return i!=null&&(u.$type=i.$type),r&&(u=this.beforeOnChangeState,this.beforeOnChangeState={model:e,view:f}),u},u.prototype.getCurrentSnapshot=function(){return this.currentState},u.prototype.isLastItemSnapshot=function(){return this.getLastItem().$type!=null},u.prototype.getLastItem=function(){return this.states[this.states.length-1]},u.prototype.download=function(){var i,r,t;if(this.isRecording){n.Logger.info("Recorder is recording");return}if(this.states.length==0){n.Logger.info("Recording is empty");return}i=this.getInfo();i.states=this.states;r="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(i));t=document.createElement("a");t.href=r;t.download="recording-"+i.controller+"-"+i.action+"-"+moment().format("YYYYMMDDHHmmss")+".json";document.body.appendChild(t);t.click();document.body.removeChild(t)},u.prototype.initListenner=function(){this.initClickListener("TabHeaderPageTitle");this.initClickListener("FieldSetToggleStateIcon")},u.prototype.initClickListener=function(n){var t=this;$("[jb-type='"+n+"']").click(function(){t.listen({type:i.Click,element:this,controlType:n})})},u.prototype.getInfo=function(){return{action:window._context.currentAction,controller:window._context.currentController}},u}();n.Recorder=e}(Joove||(Joove={}))