iszolea-ui 1.2.85 → 1.2.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/js/index.development.js +125 -16
- package/dist/js/index.js +17 -17
- package/dist/types/Reports/Pages/CDM/ControlDisplay.d.ts +1 -0
- package/dist/types/Reports/Pages/CDM/Display/EditingManager/InlineEditingManager.d.ts +3 -0
- package/dist/types/Utils/PromiseQueue.d.ts +4 -1
- package/package.json +1 -1
package/dist/js/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Iszolea Corp ©
|
|
2
|
-
(()=>{var ei=Object.create;var tt=Object.defineProperty,ti=Object.defineProperties,oi=Object.getOwnPropertyDescriptor,ri=Object.getOwnPropertyDescriptors,ii=Object.getOwnPropertyNames,Yo=Object.getOwnPropertySymbols,ni=Object.getPrototypeOf,Jo=Object.prototype.hasOwnProperty,si=Object.prototype.propertyIsEnumerable;var Ko=(o,t,r)=>t in o?tt(o,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[t]=r,A=(o,t)=>{for(var r in t||(t={}))Jo.call(t,r)&&Ko(o,r,t[r]);if(Yo)for(var r of Yo(t))si.call(t,r)&&Ko(o,r,t[r]);return o},O=(o,t)=>ti(o,ri(t)),ai=o=>tt(o,"__esModule",{value:!0});var ht=(o,t)=>()=>(t||o((t={exports:{}}).exports,t),t.exports),ie=(o,t)=>{for(var r in t)tt(o,r,{get:t[r],enumerable:!0})},li=(o,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ii(t))!Jo.call(o,n)&&(r||n!=="default")&&tt(o,n,{get:()=>t[n],enumerable:!(i=oi(t,n))||i.enumerable});return o},mt=(o,t)=>li(ai(tt(o!=null?ei(ni(o)):{},"default",!t&&o&&o.__esModule?{get:()=>o.default,enumerable:!0}:{value:o,enumerable:!0})),o);var er=ht((exports,module)=>{var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(o,t,r){o instanceof String&&(o=String(o));for(var i=o.length,n=0;n<i;n++){var s=o[n];if(t.call(r,s,n,o))return{i:n,v:s}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||typeof Object.defineProperties=="function"?Object.defineProperty:function(o,t,r){o!=Array.prototype&&o!=Object.prototype&&(o[t]=r.value)};$jscomp.getGlobal=function(o){return typeof window<"u"&&window===o?o:typeof global<"u"&&global!=null?global:o};$jscomp.global=$jscomp.getGlobal(exports);$jscomp.polyfill=function(o,t,r,i){if(t){for(r=$jscomp.global,o=o.split("."),i=0;i<o.length-1;i++){var n=o[i];n in r||(r[n]={}),r=r[n]}o=o[o.length-1],i=r[o],t=t(i),t!=i&&t!=null&&$jscomp.defineProperty(r,o,{configurable:!0,writable:!0,value:t})}};$jscomp.polyfill("Array.prototype.findIndex",function(o){return o||function(t,r){return $jscomp.findInternal(this,t,r).i}},"es6","es3");$jscomp.checkStringArgs=function(o,t,r){if(o==null)throw new TypeError("The 'this' value for String.prototype."+r+" must not be null or undefined");if(t instanceof RegExp)throw new TypeError("First argument to String.prototype."+r+" must not be a regular expression");return o+""};$jscomp.polyfill("String.prototype.endsWith",function(o){return o||function(t,r){var i=$jscomp.checkStringArgs(this,t,"endsWith");t+="",r===void 0&&(r=i.length),r=Math.max(0,Math.min(r|0,i.length));for(var n=t.length;0<n&&0<r;)if(i[--r]!=t[--n])return!1;return 0>=n}},"es6","es3");$jscomp.polyfill("Array.prototype.find",function(o){return o||function(t,r){return $jscomp.findInternal(this,t,r).v}},"es6","es3");$jscomp.polyfill("String.prototype.startsWith",function(o){return o||function(t,r){var i=$jscomp.checkStringArgs(this,t,"startsWith");t+="";var n=i.length,s=t.length;r=Math.max(0,Math.min(r|0,i.length));for(var l=0;l<s&&r<n;)if(i[r++]!=t[l++])return!1;return l>=s}},"es6","es3");$jscomp.polyfill("String.prototype.repeat",function(o){return o||function(t){var r=$jscomp.checkStringArgs(this,null,"repeat");if(0>t||1342177279<t)throw new RangeError("Invalid count value");t|=0;for(var i="";t;)t&1&&(i+=r),(t>>>=1)&&(r+=r);return i}},"es6","es3");var COMPILED=!0,goog=goog||{};goog.global=exports||self;goog.isDef=function(o){return o!==void 0};goog.isString=function(o){return typeof o=="string"};goog.isBoolean=function(o){return typeof o=="boolean"};goog.isNumber=function(o){return typeof o=="number"};goog.exportPath_=function(o,t,r){o=o.split("."),r=r||goog.global,o[0]in r||typeof r.execScript>"u"||r.execScript("var "+o[0]);for(var i;o.length&&(i=o.shift());)!o.length&&goog.isDef(t)?r[i]=t:r=r[i]&&r[i]!==Object.prototype[i]?r[i]:r[i]={}};goog.define=function(o,t){if(!COMPILED){var r=goog.global.CLOSURE_UNCOMPILED_DEFINES,i=goog.global.CLOSURE_DEFINES;r&&r.nodeType===void 0&&Object.prototype.hasOwnProperty.call(r,o)?t=r[o]:i&&i.nodeType===void 0&&Object.prototype.hasOwnProperty.call(i,o)&&(t=i[o])}return t};goog.FEATURESET_YEAR=2012;goog.DEBUG=!0;goog.LOCALE="en";goog.TRUSTED_SITE=!0;goog.STRICT_MODE_COMPATIBLE=!1;goog.DISALLOW_TEST_ONLY_CODE=COMPILED&&!goog.DEBUG;goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING=!1;goog.provide=function(o){if(goog.isInModuleLoader_())throw Error("goog.provide cannot be used within a module.");if(!COMPILED&&goog.isProvided_(o))throw Error('Namespace "'+o+'" already declared.');goog.constructNamespace_(o)};goog.constructNamespace_=function(o,t){if(!COMPILED){delete goog.implicitNamespaces_[o];for(var r=o;(r=r.substring(0,r.lastIndexOf(".")))&&!goog.getObjectByName(r);)goog.implicitNamespaces_[r]=!0}goog.exportPath_(o,t)};goog.getScriptNonce=function(o){return o&&o!=goog.global?goog.getScriptNonce_(o.document):(goog.cspNonce_===null&&(goog.cspNonce_=goog.getScriptNonce_(goog.global.document)),goog.cspNonce_)};goog.NONCE_PATTERN_=/^[\w+/_-]+[=]{0,2}$/;goog.cspNonce_=null;goog.getScriptNonce_=function(o){return(o=o.querySelector&&o.querySelector("script[nonce]"))&&(o=o.nonce||o.getAttribute("nonce"))&&goog.NONCE_PATTERN_.test(o)?o:""};goog.VALID_MODULE_RE_=/^[a-zA-Z_$][a-zA-Z0-9._$]*$/;goog.module=function(o){if(!goog.isString(o)||!o||o.search(goog.VALID_MODULE_RE_)==-1)throw Error("Invalid module identifier");if(!goog.isInGoogModuleLoader_())throw Error("Module "+o+" has been loaded incorrectly. Note, modules cannot be loaded as normal scripts. They require some kind of pre-processing step. You're likely trying to load a module via a script tag or as a part of a concatenated bundle without rewriting the module. For more info see: https://github.com/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog.provide.");if(goog.moduleLoaderState_.moduleName)throw Error("goog.module may only be called once per module.");if(goog.moduleLoaderState_.moduleName=o,!COMPILED){if(goog.isProvided_(o))throw Error('Namespace "'+o+'" already declared.');delete goog.implicitNamespaces_[o]}};goog.module.get=function(o){return goog.module.getInternal_(o)};goog.module.getInternal_=function(o){if(!COMPILED){if(o in goog.loadedModules_)return goog.loadedModules_[o].exports;if(!goog.implicitNamespaces_[o])return o=goog.getObjectByName(o),o??null}return null};goog.ModuleType={ES6:"es6",GOOG:"goog"};goog.moduleLoaderState_=null;goog.isInModuleLoader_=function(){return goog.isInGoogModuleLoader_()||goog.isInEs6ModuleLoader_()};goog.isInGoogModuleLoader_=function(){return!!goog.moduleLoaderState_&&goog.moduleLoaderState_.type==goog.ModuleType.GOOG};goog.isInEs6ModuleLoader_=function(){if(goog.moduleLoaderState_&&goog.moduleLoaderState_.type==goog.ModuleType.ES6)return!0;var o=goog.global.$jscomp;return o?typeof o.getCurrentModulePath!="function"?!1:!!o.getCurrentModulePath():!1};goog.module.declareLegacyNamespace=function(){if(!COMPILED&&!goog.isInGoogModuleLoader_())throw Error("goog.module.declareLegacyNamespace must be called from within a goog.module");if(!COMPILED&&!goog.moduleLoaderState_.moduleName)throw Error("goog.module must be called prior to goog.module.declareLegacyNamespace.");goog.moduleLoaderState_.declareLegacyNamespace=!0};goog.declareModuleId=function(o){if(!COMPILED){if(!goog.isInEs6ModuleLoader_())throw Error("goog.declareModuleId may only be called from within an ES6 module");if(goog.moduleLoaderState_&&goog.moduleLoaderState_.moduleName)throw Error("goog.declareModuleId may only be called once per module.");if(o in goog.loadedModules_)throw Error('Module with namespace "'+o+'" already exists.')}if(goog.moduleLoaderState_)goog.moduleLoaderState_.moduleName=o;else{var t=goog.global.$jscomp;if(!t||typeof t.getCurrentModulePath!="function")throw Error('Module with namespace "'+o+'" has been loaded incorrectly.');t=t.require(t.getCurrentModulePath()),goog.loadedModules_[o]={exports:t,type:goog.ModuleType.ES6,moduleId:o}}};goog.setTestOnly=function(o){if(goog.DISALLOW_TEST_ONLY_CODE)throw o=o||"",Error("Importing test-only code into non-debug environment"+(o?": "+o:"."))};goog.forwardDeclare=function(o){};COMPILED||(goog.isProvided_=function(o){return o in goog.loadedModules_||!goog.implicitNamespaces_[o]&&goog.isDefAndNotNull(goog.getObjectByName(o))},goog.implicitNamespaces_={"goog.module":!0});goog.getObjectByName=function(o,t){o=o.split("."),t=t||goog.global;for(var r=0;r<o.length;r++)if(t=t[o[r]],!goog.isDefAndNotNull(t))return null;return t};goog.globalize=function(o,t){t=t||goog.global;for(var r in o)t[r]=o[r]};goog.addDependency=function(o,t,r,i){!COMPILED&&goog.DEPENDENCIES_ENABLED&&goog.debugLoader_.addDependency(o,t,r,i)};goog.ENABLE_DEBUG_LOADER=!0;goog.logToConsole_=function(o){goog.global.console&&goog.global.console.error(o)};goog.require=function(o){if(!COMPILED){if(goog.ENABLE_DEBUG_LOADER&&goog.debugLoader_.requested(o),goog.isProvided_(o)){if(goog.isInModuleLoader_())return goog.module.getInternal_(o)}else if(goog.ENABLE_DEBUG_LOADER){var t=goog.moduleLoaderState_;goog.moduleLoaderState_=null;try{goog.debugLoader_.load_(o)}finally{goog.moduleLoaderState_=t}}return null}};goog.requireType=function(o){return{}};goog.basePath="";goog.nullFunction=function(){};goog.abstractMethod=function(){throw Error("unimplemented abstract method")};goog.addSingletonGetter=function(o){o.instance_=void 0,o.getInstance=function(){return o.instance_?o.instance_:(goog.DEBUG&&(goog.instantiatedSingletons_[goog.instantiatedSingletons_.length]=o),o.instance_=new o)}};goog.instantiatedSingletons_=[];goog.LOAD_MODULE_USING_EVAL=!0;goog.SEAL_MODULE_EXPORTS=goog.DEBUG;goog.loadedModules_={};goog.DEPENDENCIES_ENABLED=!COMPILED&&goog.ENABLE_DEBUG_LOADER;goog.TRANSPILE="detect";goog.ASSUME_ES_MODULES_TRANSPILED=!1;goog.TRANSPILE_TO_LANGUAGE="";goog.TRANSPILER="transpile.js";goog.hasBadLetScoping=null;goog.useSafari10Workaround=function(){if(goog.hasBadLetScoping==null){try{var a=!eval('"use strict";let x = 1; function f() { return typeof x; };f() == "number";')}catch(o){a=!1}goog.hasBadLetScoping=a}return goog.hasBadLetScoping};goog.workaroundSafari10EvalBug=function(o){return"(function(){"+o+`
|
|
2
|
+
(()=>{var oi=Object.create;var tt=Object.defineProperty,ri=Object.defineProperties,ii=Object.getOwnPropertyDescriptor,ni=Object.getOwnPropertyDescriptors,si=Object.getOwnPropertyNames,ht=Object.getOwnPropertySymbols,ai=Object.getPrototypeOf,oo=Object.prototype.hasOwnProperty,qo=Object.prototype.propertyIsEnumerable;var Jo=(o,t,r)=>t in o?tt(o,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[t]=r,A=(o,t)=>{for(var r in t||(t={}))oo.call(t,r)&&Jo(o,r,t[r]);if(ht)for(var r of ht(t))qo.call(t,r)&&Jo(o,r,t[r]);return o},O=(o,t)=>ri(o,ni(t)),li=o=>tt(o,"__esModule",{value:!0});var Qo=(o,t)=>{var r={};for(var i in o)oo.call(o,i)&&t.indexOf(i)<0&&(r[i]=o[i]);if(o!=null&&ht)for(var i of ht(o))t.indexOf(i)<0&&qo.call(o,i)&&(r[i]=o[i]);return r};var mt=(o,t)=>()=>(t||o((t={exports:{}}).exports,t),t.exports),ie=(o,t)=>{for(var r in t)tt(o,r,{get:t[r],enumerable:!0})},di=(o,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of si(t))!oo.call(o,n)&&(r||n!=="default")&&tt(o,n,{get:()=>t[n],enumerable:!(i=ii(t,n))||i.enumerable});return o},ft=(o,t)=>di(li(tt(o!=null?oi(ai(o)):{},"default",!t&&o&&o.__esModule?{get:()=>o.default,enumerable:!0}:{value:o,enumerable:!0})),o);var or=mt((exports,module)=>{var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(o,t,r){o instanceof String&&(o=String(o));for(var i=o.length,n=0;n<i;n++){var s=o[n];if(t.call(r,s,n,o))return{i:n,v:s}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||typeof Object.defineProperties=="function"?Object.defineProperty:function(o,t,r){o!=Array.prototype&&o!=Object.prototype&&(o[t]=r.value)};$jscomp.getGlobal=function(o){return typeof window<"u"&&window===o?o:typeof global<"u"&&global!=null?global:o};$jscomp.global=$jscomp.getGlobal(exports);$jscomp.polyfill=function(o,t,r,i){if(t){for(r=$jscomp.global,o=o.split("."),i=0;i<o.length-1;i++){var n=o[i];n in r||(r[n]={}),r=r[n]}o=o[o.length-1],i=r[o],t=t(i),t!=i&&t!=null&&$jscomp.defineProperty(r,o,{configurable:!0,writable:!0,value:t})}};$jscomp.polyfill("Array.prototype.findIndex",function(o){return o||function(t,r){return $jscomp.findInternal(this,t,r).i}},"es6","es3");$jscomp.checkStringArgs=function(o,t,r){if(o==null)throw new TypeError("The 'this' value for String.prototype."+r+" must not be null or undefined");if(t instanceof RegExp)throw new TypeError("First argument to String.prototype."+r+" must not be a regular expression");return o+""};$jscomp.polyfill("String.prototype.endsWith",function(o){return o||function(t,r){var i=$jscomp.checkStringArgs(this,t,"endsWith");t+="",r===void 0&&(r=i.length),r=Math.max(0,Math.min(r|0,i.length));for(var n=t.length;0<n&&0<r;)if(i[--r]!=t[--n])return!1;return 0>=n}},"es6","es3");$jscomp.polyfill("Array.prototype.find",function(o){return o||function(t,r){return $jscomp.findInternal(this,t,r).v}},"es6","es3");$jscomp.polyfill("String.prototype.startsWith",function(o){return o||function(t,r){var i=$jscomp.checkStringArgs(this,t,"startsWith");t+="";var n=i.length,s=t.length;r=Math.max(0,Math.min(r|0,i.length));for(var l=0;l<s&&r<n;)if(i[r++]!=t[l++])return!1;return l>=s}},"es6","es3");$jscomp.polyfill("String.prototype.repeat",function(o){return o||function(t){var r=$jscomp.checkStringArgs(this,null,"repeat");if(0>t||1342177279<t)throw new RangeError("Invalid count value");t|=0;for(var i="";t;)t&1&&(i+=r),(t>>>=1)&&(r+=r);return i}},"es6","es3");var COMPILED=!0,goog=goog||{};goog.global=exports||self;goog.isDef=function(o){return o!==void 0};goog.isString=function(o){return typeof o=="string"};goog.isBoolean=function(o){return typeof o=="boolean"};goog.isNumber=function(o){return typeof o=="number"};goog.exportPath_=function(o,t,r){o=o.split("."),r=r||goog.global,o[0]in r||typeof r.execScript>"u"||r.execScript("var "+o[0]);for(var i;o.length&&(i=o.shift());)!o.length&&goog.isDef(t)?r[i]=t:r=r[i]&&r[i]!==Object.prototype[i]?r[i]:r[i]={}};goog.define=function(o,t){if(!COMPILED){var r=goog.global.CLOSURE_UNCOMPILED_DEFINES,i=goog.global.CLOSURE_DEFINES;r&&r.nodeType===void 0&&Object.prototype.hasOwnProperty.call(r,o)?t=r[o]:i&&i.nodeType===void 0&&Object.prototype.hasOwnProperty.call(i,o)&&(t=i[o])}return t};goog.FEATURESET_YEAR=2012;goog.DEBUG=!0;goog.LOCALE="en";goog.TRUSTED_SITE=!0;goog.STRICT_MODE_COMPATIBLE=!1;goog.DISALLOW_TEST_ONLY_CODE=COMPILED&&!goog.DEBUG;goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING=!1;goog.provide=function(o){if(goog.isInModuleLoader_())throw Error("goog.provide cannot be used within a module.");if(!COMPILED&&goog.isProvided_(o))throw Error('Namespace "'+o+'" already declared.');goog.constructNamespace_(o)};goog.constructNamespace_=function(o,t){if(!COMPILED){delete goog.implicitNamespaces_[o];for(var r=o;(r=r.substring(0,r.lastIndexOf(".")))&&!goog.getObjectByName(r);)goog.implicitNamespaces_[r]=!0}goog.exportPath_(o,t)};goog.getScriptNonce=function(o){return o&&o!=goog.global?goog.getScriptNonce_(o.document):(goog.cspNonce_===null&&(goog.cspNonce_=goog.getScriptNonce_(goog.global.document)),goog.cspNonce_)};goog.NONCE_PATTERN_=/^[\w+/_-]+[=]{0,2}$/;goog.cspNonce_=null;goog.getScriptNonce_=function(o){return(o=o.querySelector&&o.querySelector("script[nonce]"))&&(o=o.nonce||o.getAttribute("nonce"))&&goog.NONCE_PATTERN_.test(o)?o:""};goog.VALID_MODULE_RE_=/^[a-zA-Z_$][a-zA-Z0-9._$]*$/;goog.module=function(o){if(!goog.isString(o)||!o||o.search(goog.VALID_MODULE_RE_)==-1)throw Error("Invalid module identifier");if(!goog.isInGoogModuleLoader_())throw Error("Module "+o+" has been loaded incorrectly. Note, modules cannot be loaded as normal scripts. They require some kind of pre-processing step. You're likely trying to load a module via a script tag or as a part of a concatenated bundle without rewriting the module. For more info see: https://github.com/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog.provide.");if(goog.moduleLoaderState_.moduleName)throw Error("goog.module may only be called once per module.");if(goog.moduleLoaderState_.moduleName=o,!COMPILED){if(goog.isProvided_(o))throw Error('Namespace "'+o+'" already declared.');delete goog.implicitNamespaces_[o]}};goog.module.get=function(o){return goog.module.getInternal_(o)};goog.module.getInternal_=function(o){if(!COMPILED){if(o in goog.loadedModules_)return goog.loadedModules_[o].exports;if(!goog.implicitNamespaces_[o])return o=goog.getObjectByName(o),o??null}return null};goog.ModuleType={ES6:"es6",GOOG:"goog"};goog.moduleLoaderState_=null;goog.isInModuleLoader_=function(){return goog.isInGoogModuleLoader_()||goog.isInEs6ModuleLoader_()};goog.isInGoogModuleLoader_=function(){return!!goog.moduleLoaderState_&&goog.moduleLoaderState_.type==goog.ModuleType.GOOG};goog.isInEs6ModuleLoader_=function(){if(goog.moduleLoaderState_&&goog.moduleLoaderState_.type==goog.ModuleType.ES6)return!0;var o=goog.global.$jscomp;return o?typeof o.getCurrentModulePath!="function"?!1:!!o.getCurrentModulePath():!1};goog.module.declareLegacyNamespace=function(){if(!COMPILED&&!goog.isInGoogModuleLoader_())throw Error("goog.module.declareLegacyNamespace must be called from within a goog.module");if(!COMPILED&&!goog.moduleLoaderState_.moduleName)throw Error("goog.module must be called prior to goog.module.declareLegacyNamespace.");goog.moduleLoaderState_.declareLegacyNamespace=!0};goog.declareModuleId=function(o){if(!COMPILED){if(!goog.isInEs6ModuleLoader_())throw Error("goog.declareModuleId may only be called from within an ES6 module");if(goog.moduleLoaderState_&&goog.moduleLoaderState_.moduleName)throw Error("goog.declareModuleId may only be called once per module.");if(o in goog.loadedModules_)throw Error('Module with namespace "'+o+'" already exists.')}if(goog.moduleLoaderState_)goog.moduleLoaderState_.moduleName=o;else{var t=goog.global.$jscomp;if(!t||typeof t.getCurrentModulePath!="function")throw Error('Module with namespace "'+o+'" has been loaded incorrectly.');t=t.require(t.getCurrentModulePath()),goog.loadedModules_[o]={exports:t,type:goog.ModuleType.ES6,moduleId:o}}};goog.setTestOnly=function(o){if(goog.DISALLOW_TEST_ONLY_CODE)throw o=o||"",Error("Importing test-only code into non-debug environment"+(o?": "+o:"."))};goog.forwardDeclare=function(o){};COMPILED||(goog.isProvided_=function(o){return o in goog.loadedModules_||!goog.implicitNamespaces_[o]&&goog.isDefAndNotNull(goog.getObjectByName(o))},goog.implicitNamespaces_={"goog.module":!0});goog.getObjectByName=function(o,t){o=o.split("."),t=t||goog.global;for(var r=0;r<o.length;r++)if(t=t[o[r]],!goog.isDefAndNotNull(t))return null;return t};goog.globalize=function(o,t){t=t||goog.global;for(var r in o)t[r]=o[r]};goog.addDependency=function(o,t,r,i){!COMPILED&&goog.DEPENDENCIES_ENABLED&&goog.debugLoader_.addDependency(o,t,r,i)};goog.ENABLE_DEBUG_LOADER=!0;goog.logToConsole_=function(o){goog.global.console&&goog.global.console.error(o)};goog.require=function(o){if(!COMPILED){if(goog.ENABLE_DEBUG_LOADER&&goog.debugLoader_.requested(o),goog.isProvided_(o)){if(goog.isInModuleLoader_())return goog.module.getInternal_(o)}else if(goog.ENABLE_DEBUG_LOADER){var t=goog.moduleLoaderState_;goog.moduleLoaderState_=null;try{goog.debugLoader_.load_(o)}finally{goog.moduleLoaderState_=t}}return null}};goog.requireType=function(o){return{}};goog.basePath="";goog.nullFunction=function(){};goog.abstractMethod=function(){throw Error("unimplemented abstract method")};goog.addSingletonGetter=function(o){o.instance_=void 0,o.getInstance=function(){return o.instance_?o.instance_:(goog.DEBUG&&(goog.instantiatedSingletons_[goog.instantiatedSingletons_.length]=o),o.instance_=new o)}};goog.instantiatedSingletons_=[];goog.LOAD_MODULE_USING_EVAL=!0;goog.SEAL_MODULE_EXPORTS=goog.DEBUG;goog.loadedModules_={};goog.DEPENDENCIES_ENABLED=!COMPILED&&goog.ENABLE_DEBUG_LOADER;goog.TRANSPILE="detect";goog.ASSUME_ES_MODULES_TRANSPILED=!1;goog.TRANSPILE_TO_LANGUAGE="";goog.TRANSPILER="transpile.js";goog.hasBadLetScoping=null;goog.useSafari10Workaround=function(){if(goog.hasBadLetScoping==null){try{var a=!eval('"use strict";let x = 1; function f() { return typeof x; };f() == "number";')}catch(o){a=!1}goog.hasBadLetScoping=a}return goog.hasBadLetScoping};goog.workaroundSafari10EvalBug=function(o){return"(function(){"+o+`
|
|
3
3
|
;})();
|
|
4
4
|
`};goog.loadModule=function(o){var t=goog.moduleLoaderState_;try{if(goog.moduleLoaderState_={moduleName:"",declareLegacyNamespace:!1,type:goog.ModuleType.GOOG},goog.isFunction(o))var r=o.call(void 0,{});else if(goog.isString(o))goog.useSafari10Workaround()&&(o=goog.workaroundSafari10EvalBug(o)),r=goog.loadModuleFromSource_.call(void 0,o);else throw Error("Invalid module definition");var i=goog.moduleLoaderState_.moduleName;if(goog.isString(i)&&i)goog.moduleLoaderState_.declareLegacyNamespace?goog.constructNamespace_(i,r):goog.SEAL_MODULE_EXPORTS&&Object.seal&&typeof r=="object"&&r!=null&&Object.seal(r),goog.loadedModules_[i]={exports:r,type:goog.ModuleType.GOOG,moduleId:goog.moduleLoaderState_.moduleName};else throw Error('Invalid module name "'+i+'"')}finally{goog.moduleLoaderState_=t}};goog.loadModuleFromSource_=function(a){return eval(a),{}};goog.normalizePath_=function(o){o=o.split("/");for(var t=0;t<o.length;)o[t]=="."?o.splice(t,1):t&&o[t]==".."&&o[t-1]&&o[t-1]!=".."?o.splice(--t,2):t++;return o.join("/")};goog.loadFileSync_=function(o){if(goog.global.CLOSURE_LOAD_FILE_SYNC)return goog.global.CLOSURE_LOAD_FILE_SYNC(o);try{var t=new goog.global.XMLHttpRequest;return t.open("get",o,!1),t.send(),t.status==0||t.status==200?t.responseText:null}catch{return null}};goog.transpile_=function(o,t,r){var i=goog.global.$jscomp;i||(goog.global.$jscomp=i={});var n=i.transpile;if(!n){var s=goog.basePath+goog.TRANSPILER,l=goog.loadFileSync_(s);if(l){if(function(){(0,eval)(l+`
|
|
5
|
-
//# sourceURL=`+s)}.call(goog.global),goog.global.$gwtExport&&goog.global.$gwtExport.$jscomp&&!goog.global.$gwtExport.$jscomp.transpile)throw Error('The transpiler did not properly export the "transpile" method. $gwtExport: '+JSON.stringify(goog.global.$gwtExport));goog.global.$jscomp.transpile=goog.global.$gwtExport.$jscomp.transpile,i=goog.global.$jscomp,n=i.transpile}}return n||(n=i.transpile=function(g,p){return goog.logToConsole_(p+" requires transpilation but no transpiler was found."),g}),n(o,t,r)};goog.typeOf=function(o){var t=typeof o;if(t=="object")if(o){if(o instanceof Array)return"array";if(o instanceof Object)return t;var r=Object.prototype.toString.call(o);if(r=="[object Window]")return"object";if(r=="[object Array]"||typeof o.length=="number"&&typeof o.splice<"u"&&typeof o.propertyIsEnumerable<"u"&&!o.propertyIsEnumerable("splice"))return"array";if(r=="[object Function]"||typeof o.call<"u"&&typeof o.propertyIsEnumerable<"u"&&!o.propertyIsEnumerable("call"))return"function"}else return"null";else if(t=="function"&&typeof o.call>"u")return"object";return t};goog.isNull=function(o){return o===null};goog.isDefAndNotNull=function(o){return o!=null};goog.isArray=function(o){return goog.typeOf(o)=="array"};goog.isArrayLike=function(o){var t=goog.typeOf(o);return t=="array"||t=="object"&&typeof o.length=="number"};goog.isDateLike=function(o){return goog.isObject(o)&&typeof o.getFullYear=="function"};goog.isFunction=function(o){return goog.typeOf(o)=="function"};goog.isObject=function(o){var t=typeof o;return t=="object"&&o!=null||t=="function"};goog.getUid=function(o){return o[goog.UID_PROPERTY_]||(o[goog.UID_PROPERTY_]=++goog.uidCounter_)};goog.hasUid=function(o){return!!o[goog.UID_PROPERTY_]};goog.removeUid=function(o){o!==null&&"removeAttribute"in o&&o.removeAttribute(goog.UID_PROPERTY_);try{delete o[goog.UID_PROPERTY_]}catch{}};goog.UID_PROPERTY_="closure_uid_"+(1e9*Math.random()>>>0);goog.uidCounter_=0;goog.getHashCode=goog.getUid;goog.removeHashCode=goog.removeUid;goog.cloneObject=function(o){var t=goog.typeOf(o);if(t=="object"||t=="array"){if(typeof o.clone=="function")return o.clone();t=t=="array"?[]:{};for(var r in o)t[r]=goog.cloneObject(o[r]);return t}return o};goog.bindNative_=function(o,t,r){return o.call.apply(o.bind,arguments)};goog.bindJs_=function(o,t,r){if(!o)throw Error();if(2<arguments.length){var i=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,i),o.apply(t,n)}}return function(){return o.apply(t,arguments)}};goog.bind=function(o,t,r){return Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?goog.bind=goog.bindNative_:goog.bind=goog.bindJs_,goog.bind.apply(null,arguments)};goog.partial=function(o,t){var r=Array.prototype.slice.call(arguments,1);return function(){var i=r.slice();return i.push.apply(i,arguments),o.apply(this,i)}};goog.mixin=function(o,t){for(var r in t)o[r]=t[r]};goog.now=goog.TRUSTED_SITE&&Date.now||function(){return+new Date};goog.globalEval=function(o){if(goog.global.execScript)goog.global.execScript(o,"JavaScript");else if(goog.global.eval){if(goog.evalWorksForGlobals_==null){try{goog.global.eval("var _evalTest_ = 1;")}catch{}if(typeof goog.global._evalTest_<"u"){try{delete goog.global._evalTest_}catch{}goog.evalWorksForGlobals_=!0}else goog.evalWorksForGlobals_=!1}if(goog.evalWorksForGlobals_)goog.global.eval(o);else{var t=goog.global.document,r=t.createElement("SCRIPT");r.type="text/javascript",r.defer=!1,r.appendChild(t.createTextNode(o)),t.head.appendChild(r),t.head.removeChild(r)}}else throw Error("goog.globalEval not available")};goog.evalWorksForGlobals_=null;goog.getCssName=function(o,t){if(String(o).charAt(0)==".")throw Error('className passed in goog.getCssName must not start with ".". You passed: '+o);var r=function(n){return goog.cssNameMapping_[n]||n},i=function(n){n=n.split("-");for(var s=[],l=0;l<n.length;l++)s.push(r(n[l]));return s.join("-")};return i=goog.cssNameMapping_?goog.cssNameMappingStyle_=="BY_WHOLE"?r:i:function(n){return n},o=t?o+"-"+i(t):i(o),goog.global.CLOSURE_CSS_NAME_MAP_FN?goog.global.CLOSURE_CSS_NAME_MAP_FN(o):o};goog.setCssNameMapping=function(o,t){goog.cssNameMapping_=o,goog.cssNameMappingStyle_=t};!COMPILED&&goog.global.CLOSURE_CSS_NAME_MAPPING&&(goog.cssNameMapping_=goog.global.CLOSURE_CSS_NAME_MAPPING);goog.getMsg=function(o,t,r){return r&&r.html&&(o=o.replace(/</g,"<")),t&&(o=o.replace(/\{\$([^}]+)}/g,function(i,n){return t!=null&&n in t?t[n]:i})),o};goog.getMsgWithFallback=function(o,t){return o};goog.exportSymbol=function(o,t,r){goog.exportPath_(o,t,r)};goog.exportProperty=function(o,t,r){o[t]=r};goog.inherits=function(o,t){function r(){}r.prototype=t.prototype,o.superClass_=t.prototype,o.prototype=new r,o.prototype.constructor=o,o.base=function(i,n,s){for(var l=Array(arguments.length-2),g=2;g<arguments.length;g++)l[g-2]=arguments[g];return t.prototype[n].apply(i,l)}};goog.base=function(o,t,r){var i=arguments.callee.caller;if(goog.STRICT_MODE_COMPATIBLE||goog.DEBUG&&!i)throw Error("arguments.caller not defined. goog.base() cannot be used with strict mode code. See http://www.ecma-international.org/ecma-262/5.1/#sec-C");if(typeof i.superClass_<"u"){for(var n=Array(arguments.length-1),s=1;s<arguments.length;s++)n[s-1]=arguments[s];return i.superClass_.constructor.apply(o,n)}if(typeof t!="string"&&typeof t!="symbol")throw Error("method names provided to goog.base must be a string or a symbol");for(n=Array(arguments.length-2),s=2;s<arguments.length;s++)n[s-2]=arguments[s];s=!1;for(var l=o.constructor.prototype;l;l=Object.getPrototypeOf(l))if(l[t]===i)s=!0;else if(s)return l[t].apply(o,n);if(o[t]===i)return o.constructor.prototype[t].apply(o,n);throw Error("goog.base called from a method of one name to a method of a different name")};goog.scope=function(o){if(goog.isInModuleLoader_())throw Error("goog.scope is not supported within a module.");o.call(goog.global)};COMPILED||(goog.global.COMPILED=COMPILED);goog.defineClass=function(o,t){var r=t.constructor,i=t.statics;return r&&r!=Object.prototype.constructor||(r=function(){throw Error("cannot instantiate an interface (no constructor defined).")}),r=goog.defineClass.createSealingConstructor_(r,o),o&&goog.inherits(r,o),delete t.constructor,delete t.statics,goog.defineClass.applyProperties_(r.prototype,t),i!=null&&(i instanceof Function?i(r):goog.defineClass.applyProperties_(r,i)),r};goog.defineClass.SEAL_CLASS_INSTANCES=goog.DEBUG;goog.defineClass.createSealingConstructor_=function(o,t){if(!goog.defineClass.SEAL_CLASS_INSTANCES)return o;var r=!goog.defineClass.isUnsealable_(t),i=function(){var n=o.apply(this,arguments)||this;return n[goog.UID_PROPERTY_]=n[goog.UID_PROPERTY_],this.constructor===i&&r&&Object.seal instanceof Function&&Object.seal(n),n};return i};goog.defineClass.isUnsealable_=function(o){return o&&o.prototype&&o.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]};goog.defineClass.OBJECT_PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");goog.defineClass.applyProperties_=function(o,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(o[r]=t[r]);for(var i=0;i<goog.defineClass.OBJECT_PROTOTYPE_FIELDS_.length;i++)r=goog.defineClass.OBJECT_PROTOTYPE_FIELDS_[i],Object.prototype.hasOwnProperty.call(t,r)&&(o[r]=t[r])};goog.tagUnsealableClass=function(o){!COMPILED&&goog.defineClass.SEAL_CLASS_INSTANCES&&(o.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]=!0)};goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_="goog_defineClass_legacy_unsealable";!COMPILED&&goog.DEPENDENCIES_ENABLED&&(goog.inHtmlDocument_=function(){var o=goog.global.document;return o!=null&&"write"in o},goog.isDocumentLoading_=function(){var o=goog.global.document;return o.attachEvent?o.readyState!="complete":o.readyState=="loading"},goog.findBasePath_=function(){if(goog.isDef(goog.global.CLOSURE_BASE_PATH)&&goog.isString(goog.global.CLOSURE_BASE_PATH))goog.basePath=goog.global.CLOSURE_BASE_PATH;else if(goog.inHtmlDocument_()){var o=goog.global.document,t=o.currentScript;for(o=t?[t]:o.getElementsByTagName("SCRIPT"),t=o.length-1;0<=t;--t){var r=o[t].src,i=r.lastIndexOf("?");if(i=i==-1?r.length:i,r.substr(i-7,7)=="base.js"){goog.basePath=r.substr(0,i-7);break}}}},goog.findBasePath_(),goog.Transpiler=function(){this.requiresTranspilation_=null,this.transpilationTarget_=goog.TRANSPILE_TO_LANGUAGE},goog.Transpiler.prototype.createRequiresTranspilation_=function(){function a(o,t){e?d[o]=!0:t()?(c=o,d[o]=!1):e=d[o]=!0}function b(a){try{return!!eval(a)}catch(o){return!1}}var c="es3",d={es3:!1},e=!1,f=goog.global.navigator&&goog.global.navigator.userAgent?goog.global.navigator.userAgent:"";return a("es5",function(){return b("[1,].length==1")}),a("es6",function(){return f.match(/Edge\/(\d+)(\.\d)*/i)?!1:b('(()=>{"use strict";class X{constructor(){if(new.target!=String)throw 1;this.x=42}}let q=Reflect.construct(X,[],String);if(q.x!=42||!(q instanceof String))throw 1;for(const a of[2,3]){if(a==2)continue;function f(z={a}){let a=0;return z.a}{function f(){return 0;}}return f()==3}})()')}),a("es7",function(){return b("2 ** 2 == 4")}),a("es8",function(){return b("async () => 1, true")}),a("es9",function(){return b("({...rest} = {}), true")}),a("es_next",function(){return!1}),{target:c,map:d}},goog.Transpiler.prototype.needsTranspile=function(o,t){if(goog.TRANSPILE=="always")return!0;if(goog.TRANSPILE=="never")return!1;if(!this.requiresTranspilation_){var r=this.createRequiresTranspilation_();this.requiresTranspilation_=r.map,this.transpilationTarget_=this.transpilationTarget_||r.target}if(o in this.requiresTranspilation_)return this.requiresTranspilation_[o]?!0:!(!goog.inHtmlDocument_()||t!="es6"||"noModule"in goog.global.document.createElement("script"));throw Error("Unknown language mode: "+o)},goog.Transpiler.prototype.transpile=function(o,t){return goog.transpile_(o,t,this.transpilationTarget_)},goog.transpiler_=new goog.Transpiler,goog.protectScriptTag_=function(o){return o.replace(/<\/(SCRIPT)/ig,"\\x3c/$1")},goog.DebugLoader_=function(){this.dependencies_={},this.idToPath_={},this.written_={},this.loadingDeps_=[],this.depsToLoad_=[],this.paused_=!1,this.factory_=new goog.DependencyFactory(goog.transpiler_),this.deferredCallbacks_={},this.deferredQueue_=[]},goog.DebugLoader_.prototype.bootstrap=function(o,t){function r(){i&&(goog.global.setTimeout(i,0),i=null)}var i=t;if(o.length){t=[];for(var n=0;n<o.length;n++){var s=this.getPathFromDeps_(o[n]);if(!s)throw Error("Unregonized namespace: "+o[n]);t.push(this.dependencies_[s])}s=goog.require;var l=0;for(n=0;n<o.length;n++)s(o[n]),t[n].onLoad(function(){++l==o.length&&r()})}else r()},goog.DebugLoader_.prototype.loadClosureDeps=function(){this.depsToLoad_.push(this.factory_.createDependency(goog.normalizePath_(goog.basePath+"deps.js"),"deps.js",[],[],{},!1)),this.loadDeps_()},goog.DebugLoader_.prototype.requested=function(o,t){(o=this.getPathFromDeps_(o))&&(t||this.areDepsLoaded_(this.dependencies_[o].requires))&&(t=this.deferredCallbacks_[o])&&(delete this.deferredCallbacks_[o],t())},goog.DebugLoader_.prototype.setDependencyFactory=function(o){this.factory_=o},goog.DebugLoader_.prototype.load_=function(o){if(this.getPathFromDeps_(o)){var t=this,r=[],i=function(n){var s=t.getPathFromDeps_(n);if(!s)throw Error("Bad dependency path or symbol: "+n);if(!t.written_[s]){for(t.written_[s]=!0,n=t.dependencies_[s],s=0;s<n.requires.length;s++)goog.isProvided_(n.requires[s])||i(n.requires[s]);r.push(n)}};i(o),o=!!this.depsToLoad_.length,this.depsToLoad_=this.depsToLoad_.concat(r),this.paused_||o||this.loadDeps_()}else throw o="goog.require could not find: "+o,goog.logToConsole_(o),Error(o)},goog.DebugLoader_.prototype.loadDeps_=function(){for(var o=this,t=this.paused_;this.depsToLoad_.length&&!t;)(function(){var r=!1,i=o.depsToLoad_.shift(),n=!1;o.loading_(i);var s={pause:function(){if(r)throw Error("Cannot call pause after the call to load.");t=!0},resume:function(){r?o.resume_():t=!1},loaded:function(){if(n)throw Error("Double call to loaded.");n=!0,o.loaded_(i)},pending:function(){for(var l=[],g=0;g<o.loadingDeps_.length;g++)l.push(o.loadingDeps_[g]);return l},setModuleState:function(l){goog.moduleLoaderState_={type:l,moduleName:"",declareLegacyNamespace:!1}},registerEs6ModuleExports:function(l,g,p){p&&(goog.loadedModules_[p]={exports:g,type:goog.ModuleType.ES6,moduleId:p||""})},registerGoogModuleExports:function(l,g){goog.loadedModules_[l]={exports:g,type:goog.ModuleType.GOOG,moduleId:l}},clearModuleState:function(){goog.moduleLoaderState_=null},defer:function(l){if(r)throw Error("Cannot register with defer after the call to load.");o.defer_(i,l)},areDepsLoaded:function(){return o.areDepsLoaded_(i.requires)}};try{i.load(s)}finally{r=!0}})();t&&this.pause_()},goog.DebugLoader_.prototype.pause_=function(){this.paused_=!0},goog.DebugLoader_.prototype.resume_=function(){this.paused_&&(this.paused_=!1,this.loadDeps_())},goog.DebugLoader_.prototype.loading_=function(o){this.loadingDeps_.push(o)},goog.DebugLoader_.prototype.loaded_=function(o){for(var t=0;t<this.loadingDeps_.length;t++)if(this.loadingDeps_[t]==o){this.loadingDeps_.splice(t,1);break}for(t=0;t<this.deferredQueue_.length;t++)if(this.deferredQueue_[t]==o.path){this.deferredQueue_.splice(t,1);break}if(this.loadingDeps_.length==this.deferredQueue_.length&&!this.depsToLoad_.length)for(;this.deferredQueue_.length;)this.requested(this.deferredQueue_.shift(),!0);o.loaded()},goog.DebugLoader_.prototype.areDepsLoaded_=function(o){for(var t=0;t<o.length;t++){var r=this.getPathFromDeps_(o[t]);if(!r||!(r in this.deferredCallbacks_||goog.isProvided_(o[t])))return!1}return!0},goog.DebugLoader_.prototype.getPathFromDeps_=function(o){return o in this.idToPath_?this.idToPath_[o]:o in this.dependencies_?o:null},goog.DebugLoader_.prototype.defer_=function(o,t){this.deferredCallbacks_[o.path]=t,this.deferredQueue_.push(o.path)},goog.LoadController=function(){},goog.LoadController.prototype.pause=function(){},goog.LoadController.prototype.resume=function(){},goog.LoadController.prototype.loaded=function(){},goog.LoadController.prototype.pending=function(){},goog.LoadController.prototype.registerEs6ModuleExports=function(o,t,r){},goog.LoadController.prototype.setModuleState=function(o){},goog.LoadController.prototype.clearModuleState=function(){},goog.LoadController.prototype.defer=function(o){},goog.LoadController.prototype.areDepsLoaded=function(){},goog.Dependency=function(o,t,r,i,n){this.path=o,this.relativePath=t,this.provides=r,this.requires=i,this.loadFlags=n,this.loaded_=!1,this.loadCallbacks_=[]},goog.Dependency.prototype.getPathName=function(){var o=this.path,t=o.indexOf("://");return 0<=t&&(o=o.substring(t+3),t=o.indexOf("/"),0<=t&&(o=o.substring(t+1))),o},goog.Dependency.prototype.onLoad=function(o){this.loaded_?o():this.loadCallbacks_.push(o)},goog.Dependency.prototype.loaded=function(){this.loaded_=!0;var o=this.loadCallbacks_;this.loadCallbacks_=[];for(var t=0;t<o.length;t++)o[t]()},goog.Dependency.defer_=!1,goog.Dependency.callbackMap_={},goog.Dependency.registerCallback_=function(o){var t=Math.random().toString(32);return goog.Dependency.callbackMap_[t]=o,t},goog.Dependency.unregisterCallback_=function(o){delete goog.Dependency.callbackMap_[o]},goog.Dependency.callback_=function(o,t){if(o in goog.Dependency.callbackMap_){for(var r=goog.Dependency.callbackMap_[o],i=[],n=1;n<arguments.length;n++)i.push(arguments[n]);r.apply(void 0,i)}else throw Error("Callback key "+o+" does not exist (was base.js loaded more than once?).")},goog.Dependency.prototype.load=function(o){if(goog.global.CLOSURE_IMPORT_SCRIPT)goog.global.CLOSURE_IMPORT_SCRIPT(this.path)?o.loaded():o.pause();else if(goog.inHtmlDocument_()){var t=goog.global.document;if(t.readyState=="complete"&&!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING){if(/\bdeps.js$/.test(this.path)){o.loaded();return}throw Error('Cannot write "'+this.path+'" after document load')}if(!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING&&goog.isDocumentLoading_()){var r=goog.Dependency.registerCallback_(function(s){goog.DebugLoader_.IS_OLD_IE_&&s.readyState!="complete"||(goog.Dependency.unregisterCallback_(r),o.loaded())}),i=!goog.DebugLoader_.IS_OLD_IE_&&goog.getScriptNonce()?' nonce="'+goog.getScriptNonce()+'"':"";i='<script src="'+this.path+'" '+(goog.DebugLoader_.IS_OLD_IE_?"onreadystatechange":"onload")+`="goog.Dependency.callback_('`+r+`', this)" type="text/javascript" `+(goog.Dependency.defer_?"defer":"")+i+"><\/script>",t.write(goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createHTML(i):i)}else{var n=t.createElement("script");n.defer=goog.Dependency.defer_,n.async=!1,n.type="text/javascript",(i=goog.getScriptNonce())&&n.setAttribute("nonce",i),goog.DebugLoader_.IS_OLD_IE_?(o.pause(),n.onreadystatechange=function(){(n.readyState=="loaded"||n.readyState=="complete")&&(o.loaded(),o.resume())}):n.onload=function(){n.onload=null,o.loaded()},n.src=goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createScriptURL(this.path):this.path,t.head.appendChild(n)}}else goog.logToConsole_("Cannot use default debug loader outside of HTML documents."),this.relativePath=="deps.js"?(goog.logToConsole_("Consider setting CLOSURE_IMPORT_SCRIPT before loading base.js, or setting CLOSURE_NO_DEPS to true."),o.loaded()):o.pause()},goog.Es6ModuleDependency=function(o,t,r,i,n){goog.Dependency.call(this,o,t,r,i,n)},goog.inherits(goog.Es6ModuleDependency,goog.Dependency),goog.Es6ModuleDependency.prototype.load=function(o){function t(h,E){h=E?'<script type="module" crossorigin>'+E+"<\/script>":'<script type="module" crossorigin src="'+h+'"><\/script>',i.write(goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createHTML(h):h)}function r(h,E){var m=i.createElement("script");m.defer=!0,m.async=!1,m.type="module",m.setAttribute("crossorigin",!0);var S=goog.getScriptNonce();S&&m.setAttribute("nonce",S),E?m.textContent=goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createScript(E):E:m.src=goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createScriptURL(h):h,i.head.appendChild(m)}if(goog.global.CLOSURE_IMPORT_SCRIPT)goog.global.CLOSURE_IMPORT_SCRIPT(this.path)?o.loaded():o.pause();else if(goog.inHtmlDocument_()){var i=goog.global.document,n=this;if(goog.isDocumentLoading_()){var s=t;goog.Dependency.defer_=!0}else s=r;var l=goog.Dependency.registerCallback_(function(){goog.Dependency.unregisterCallback_(l),o.setModuleState(goog.ModuleType.ES6)});s(void 0,'goog.Dependency.callback_("'+l+'")'),s(this.path,void 0);var g=goog.Dependency.registerCallback_(function(h){goog.Dependency.unregisterCallback_(g),o.registerEs6ModuleExports(n.path,h,goog.moduleLoaderState_.moduleName)});s(void 0,'import * as m from "'+this.path+'"; goog.Dependency.callback_("'+g+'", m)');var p=goog.Dependency.registerCallback_(function(){goog.Dependency.unregisterCallback_(p),o.clearModuleState(),o.loaded()});s(void 0,'goog.Dependency.callback_("'+p+'")')}else goog.logToConsole_("Cannot use default debug loader outside of HTML documents."),o.pause()},goog.TransformedDependency=function(o,t,r,i,n){goog.Dependency.call(this,o,t,r,i,n),this.contents_=null,this.lazyFetch_=!goog.inHtmlDocument_()||!("noModule"in goog.global.document.createElement("script"))},goog.inherits(goog.TransformedDependency,goog.Dependency),goog.TransformedDependency.prototype.load=function(o){function t(){n.contents_=goog.loadFileSync_(n.path),n.contents_&&(n.contents_=n.transform(n.contents_),n.contents_&&(n.contents_+=`
|
|
6
|
-
//# sourceURL=`+n.path))}function r(){if(n.lazyFetch_&&t(),n.contents_){s&&o.setModuleState(goog.ModuleType.ES6);try{var
|
|
5
|
+
//# sourceURL=`+s)}.call(goog.global),goog.global.$gwtExport&&goog.global.$gwtExport.$jscomp&&!goog.global.$gwtExport.$jscomp.transpile)throw Error('The transpiler did not properly export the "transpile" method. $gwtExport: '+JSON.stringify(goog.global.$gwtExport));goog.global.$jscomp.transpile=goog.global.$gwtExport.$jscomp.transpile,i=goog.global.$jscomp,n=i.transpile}}return n||(n=i.transpile=function(g,p){return goog.logToConsole_(p+" requires transpilation but no transpiler was found."),g}),n(o,t,r)};goog.typeOf=function(o){var t=typeof o;if(t=="object")if(o){if(o instanceof Array)return"array";if(o instanceof Object)return t;var r=Object.prototype.toString.call(o);if(r=="[object Window]")return"object";if(r=="[object Array]"||typeof o.length=="number"&&typeof o.splice<"u"&&typeof o.propertyIsEnumerable<"u"&&!o.propertyIsEnumerable("splice"))return"array";if(r=="[object Function]"||typeof o.call<"u"&&typeof o.propertyIsEnumerable<"u"&&!o.propertyIsEnumerable("call"))return"function"}else return"null";else if(t=="function"&&typeof o.call>"u")return"object";return t};goog.isNull=function(o){return o===null};goog.isDefAndNotNull=function(o){return o!=null};goog.isArray=function(o){return goog.typeOf(o)=="array"};goog.isArrayLike=function(o){var t=goog.typeOf(o);return t=="array"||t=="object"&&typeof o.length=="number"};goog.isDateLike=function(o){return goog.isObject(o)&&typeof o.getFullYear=="function"};goog.isFunction=function(o){return goog.typeOf(o)=="function"};goog.isObject=function(o){var t=typeof o;return t=="object"&&o!=null||t=="function"};goog.getUid=function(o){return o[goog.UID_PROPERTY_]||(o[goog.UID_PROPERTY_]=++goog.uidCounter_)};goog.hasUid=function(o){return!!o[goog.UID_PROPERTY_]};goog.removeUid=function(o){o!==null&&"removeAttribute"in o&&o.removeAttribute(goog.UID_PROPERTY_);try{delete o[goog.UID_PROPERTY_]}catch{}};goog.UID_PROPERTY_="closure_uid_"+(1e9*Math.random()>>>0);goog.uidCounter_=0;goog.getHashCode=goog.getUid;goog.removeHashCode=goog.removeUid;goog.cloneObject=function(o){var t=goog.typeOf(o);if(t=="object"||t=="array"){if(typeof o.clone=="function")return o.clone();t=t=="array"?[]:{};for(var r in o)t[r]=goog.cloneObject(o[r]);return t}return o};goog.bindNative_=function(o,t,r){return o.call.apply(o.bind,arguments)};goog.bindJs_=function(o,t,r){if(!o)throw Error();if(2<arguments.length){var i=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,i),o.apply(t,n)}}return function(){return o.apply(t,arguments)}};goog.bind=function(o,t,r){return Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?goog.bind=goog.bindNative_:goog.bind=goog.bindJs_,goog.bind.apply(null,arguments)};goog.partial=function(o,t){var r=Array.prototype.slice.call(arguments,1);return function(){var i=r.slice();return i.push.apply(i,arguments),o.apply(this,i)}};goog.mixin=function(o,t){for(var r in t)o[r]=t[r]};goog.now=goog.TRUSTED_SITE&&Date.now||function(){return+new Date};goog.globalEval=function(o){if(goog.global.execScript)goog.global.execScript(o,"JavaScript");else if(goog.global.eval){if(goog.evalWorksForGlobals_==null){try{goog.global.eval("var _evalTest_ = 1;")}catch{}if(typeof goog.global._evalTest_<"u"){try{delete goog.global._evalTest_}catch{}goog.evalWorksForGlobals_=!0}else goog.evalWorksForGlobals_=!1}if(goog.evalWorksForGlobals_)goog.global.eval(o);else{var t=goog.global.document,r=t.createElement("SCRIPT");r.type="text/javascript",r.defer=!1,r.appendChild(t.createTextNode(o)),t.head.appendChild(r),t.head.removeChild(r)}}else throw Error("goog.globalEval not available")};goog.evalWorksForGlobals_=null;goog.getCssName=function(o,t){if(String(o).charAt(0)==".")throw Error('className passed in goog.getCssName must not start with ".". You passed: '+o);var r=function(n){return goog.cssNameMapping_[n]||n},i=function(n){n=n.split("-");for(var s=[],l=0;l<n.length;l++)s.push(r(n[l]));return s.join("-")};return i=goog.cssNameMapping_?goog.cssNameMappingStyle_=="BY_WHOLE"?r:i:function(n){return n},o=t?o+"-"+i(t):i(o),goog.global.CLOSURE_CSS_NAME_MAP_FN?goog.global.CLOSURE_CSS_NAME_MAP_FN(o):o};goog.setCssNameMapping=function(o,t){goog.cssNameMapping_=o,goog.cssNameMappingStyle_=t};!COMPILED&&goog.global.CLOSURE_CSS_NAME_MAPPING&&(goog.cssNameMapping_=goog.global.CLOSURE_CSS_NAME_MAPPING);goog.getMsg=function(o,t,r){return r&&r.html&&(o=o.replace(/</g,"<")),t&&(o=o.replace(/\{\$([^}]+)}/g,function(i,n){return t!=null&&n in t?t[n]:i})),o};goog.getMsgWithFallback=function(o,t){return o};goog.exportSymbol=function(o,t,r){goog.exportPath_(o,t,r)};goog.exportProperty=function(o,t,r){o[t]=r};goog.inherits=function(o,t){function r(){}r.prototype=t.prototype,o.superClass_=t.prototype,o.prototype=new r,o.prototype.constructor=o,o.base=function(i,n,s){for(var l=Array(arguments.length-2),g=2;g<arguments.length;g++)l[g-2]=arguments[g];return t.prototype[n].apply(i,l)}};goog.base=function(o,t,r){var i=arguments.callee.caller;if(goog.STRICT_MODE_COMPATIBLE||goog.DEBUG&&!i)throw Error("arguments.caller not defined. goog.base() cannot be used with strict mode code. See http://www.ecma-international.org/ecma-262/5.1/#sec-C");if(typeof i.superClass_<"u"){for(var n=Array(arguments.length-1),s=1;s<arguments.length;s++)n[s-1]=arguments[s];return i.superClass_.constructor.apply(o,n)}if(typeof t!="string"&&typeof t!="symbol")throw Error("method names provided to goog.base must be a string or a symbol");for(n=Array(arguments.length-2),s=2;s<arguments.length;s++)n[s-2]=arguments[s];s=!1;for(var l=o.constructor.prototype;l;l=Object.getPrototypeOf(l))if(l[t]===i)s=!0;else if(s)return l[t].apply(o,n);if(o[t]===i)return o.constructor.prototype[t].apply(o,n);throw Error("goog.base called from a method of one name to a method of a different name")};goog.scope=function(o){if(goog.isInModuleLoader_())throw Error("goog.scope is not supported within a module.");o.call(goog.global)};COMPILED||(goog.global.COMPILED=COMPILED);goog.defineClass=function(o,t){var r=t.constructor,i=t.statics;return r&&r!=Object.prototype.constructor||(r=function(){throw Error("cannot instantiate an interface (no constructor defined).")}),r=goog.defineClass.createSealingConstructor_(r,o),o&&goog.inherits(r,o),delete t.constructor,delete t.statics,goog.defineClass.applyProperties_(r.prototype,t),i!=null&&(i instanceof Function?i(r):goog.defineClass.applyProperties_(r,i)),r};goog.defineClass.SEAL_CLASS_INSTANCES=goog.DEBUG;goog.defineClass.createSealingConstructor_=function(o,t){if(!goog.defineClass.SEAL_CLASS_INSTANCES)return o;var r=!goog.defineClass.isUnsealable_(t),i=function(){var n=o.apply(this,arguments)||this;return n[goog.UID_PROPERTY_]=n[goog.UID_PROPERTY_],this.constructor===i&&r&&Object.seal instanceof Function&&Object.seal(n),n};return i};goog.defineClass.isUnsealable_=function(o){return o&&o.prototype&&o.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]};goog.defineClass.OBJECT_PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");goog.defineClass.applyProperties_=function(o,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(o[r]=t[r]);for(var i=0;i<goog.defineClass.OBJECT_PROTOTYPE_FIELDS_.length;i++)r=goog.defineClass.OBJECT_PROTOTYPE_FIELDS_[i],Object.prototype.hasOwnProperty.call(t,r)&&(o[r]=t[r])};goog.tagUnsealableClass=function(o){!COMPILED&&goog.defineClass.SEAL_CLASS_INSTANCES&&(o.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]=!0)};goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_="goog_defineClass_legacy_unsealable";!COMPILED&&goog.DEPENDENCIES_ENABLED&&(goog.inHtmlDocument_=function(){var o=goog.global.document;return o!=null&&"write"in o},goog.isDocumentLoading_=function(){var o=goog.global.document;return o.attachEvent?o.readyState!="complete":o.readyState=="loading"},goog.findBasePath_=function(){if(goog.isDef(goog.global.CLOSURE_BASE_PATH)&&goog.isString(goog.global.CLOSURE_BASE_PATH))goog.basePath=goog.global.CLOSURE_BASE_PATH;else if(goog.inHtmlDocument_()){var o=goog.global.document,t=o.currentScript;for(o=t?[t]:o.getElementsByTagName("SCRIPT"),t=o.length-1;0<=t;--t){var r=o[t].src,i=r.lastIndexOf("?");if(i=i==-1?r.length:i,r.substr(i-7,7)=="base.js"){goog.basePath=r.substr(0,i-7);break}}}},goog.findBasePath_(),goog.Transpiler=function(){this.requiresTranspilation_=null,this.transpilationTarget_=goog.TRANSPILE_TO_LANGUAGE},goog.Transpiler.prototype.createRequiresTranspilation_=function(){function a(o,t){e?d[o]=!0:t()?(c=o,d[o]=!1):e=d[o]=!0}function b(a){try{return!!eval(a)}catch(o){return!1}}var c="es3",d={es3:!1},e=!1,f=goog.global.navigator&&goog.global.navigator.userAgent?goog.global.navigator.userAgent:"";return a("es5",function(){return b("[1,].length==1")}),a("es6",function(){return f.match(/Edge\/(\d+)(\.\d)*/i)?!1:b('(()=>{"use strict";class X{constructor(){if(new.target!=String)throw 1;this.x=42}}let q=Reflect.construct(X,[],String);if(q.x!=42||!(q instanceof String))throw 1;for(const a of[2,3]){if(a==2)continue;function f(z={a}){let a=0;return z.a}{function f(){return 0;}}return f()==3}})()')}),a("es7",function(){return b("2 ** 2 == 4")}),a("es8",function(){return b("async () => 1, true")}),a("es9",function(){return b("({...rest} = {}), true")}),a("es_next",function(){return!1}),{target:c,map:d}},goog.Transpiler.prototype.needsTranspile=function(o,t){if(goog.TRANSPILE=="always")return!0;if(goog.TRANSPILE=="never")return!1;if(!this.requiresTranspilation_){var r=this.createRequiresTranspilation_();this.requiresTranspilation_=r.map,this.transpilationTarget_=this.transpilationTarget_||r.target}if(o in this.requiresTranspilation_)return this.requiresTranspilation_[o]?!0:!(!goog.inHtmlDocument_()||t!="es6"||"noModule"in goog.global.document.createElement("script"));throw Error("Unknown language mode: "+o)},goog.Transpiler.prototype.transpile=function(o,t){return goog.transpile_(o,t,this.transpilationTarget_)},goog.transpiler_=new goog.Transpiler,goog.protectScriptTag_=function(o){return o.replace(/<\/(SCRIPT)/ig,"\\x3c/$1")},goog.DebugLoader_=function(){this.dependencies_={},this.idToPath_={},this.written_={},this.loadingDeps_=[],this.depsToLoad_=[],this.paused_=!1,this.factory_=new goog.DependencyFactory(goog.transpiler_),this.deferredCallbacks_={},this.deferredQueue_=[]},goog.DebugLoader_.prototype.bootstrap=function(o,t){function r(){i&&(goog.global.setTimeout(i,0),i=null)}var i=t;if(o.length){t=[];for(var n=0;n<o.length;n++){var s=this.getPathFromDeps_(o[n]);if(!s)throw Error("Unregonized namespace: "+o[n]);t.push(this.dependencies_[s])}s=goog.require;var l=0;for(n=0;n<o.length;n++)s(o[n]),t[n].onLoad(function(){++l==o.length&&r()})}else r()},goog.DebugLoader_.prototype.loadClosureDeps=function(){this.depsToLoad_.push(this.factory_.createDependency(goog.normalizePath_(goog.basePath+"deps.js"),"deps.js",[],[],{},!1)),this.loadDeps_()},goog.DebugLoader_.prototype.requested=function(o,t){(o=this.getPathFromDeps_(o))&&(t||this.areDepsLoaded_(this.dependencies_[o].requires))&&(t=this.deferredCallbacks_[o])&&(delete this.deferredCallbacks_[o],t())},goog.DebugLoader_.prototype.setDependencyFactory=function(o){this.factory_=o},goog.DebugLoader_.prototype.load_=function(o){if(this.getPathFromDeps_(o)){var t=this,r=[],i=function(n){var s=t.getPathFromDeps_(n);if(!s)throw Error("Bad dependency path or symbol: "+n);if(!t.written_[s]){for(t.written_[s]=!0,n=t.dependencies_[s],s=0;s<n.requires.length;s++)goog.isProvided_(n.requires[s])||i(n.requires[s]);r.push(n)}};i(o),o=!!this.depsToLoad_.length,this.depsToLoad_=this.depsToLoad_.concat(r),this.paused_||o||this.loadDeps_()}else throw o="goog.require could not find: "+o,goog.logToConsole_(o),Error(o)},goog.DebugLoader_.prototype.loadDeps_=function(){for(var o=this,t=this.paused_;this.depsToLoad_.length&&!t;)(function(){var r=!1,i=o.depsToLoad_.shift(),n=!1;o.loading_(i);var s={pause:function(){if(r)throw Error("Cannot call pause after the call to load.");t=!0},resume:function(){r?o.resume_():t=!1},loaded:function(){if(n)throw Error("Double call to loaded.");n=!0,o.loaded_(i)},pending:function(){for(var l=[],g=0;g<o.loadingDeps_.length;g++)l.push(o.loadingDeps_[g]);return l},setModuleState:function(l){goog.moduleLoaderState_={type:l,moduleName:"",declareLegacyNamespace:!1}},registerEs6ModuleExports:function(l,g,p){p&&(goog.loadedModules_[p]={exports:g,type:goog.ModuleType.ES6,moduleId:p||""})},registerGoogModuleExports:function(l,g){goog.loadedModules_[l]={exports:g,type:goog.ModuleType.GOOG,moduleId:l}},clearModuleState:function(){goog.moduleLoaderState_=null},defer:function(l){if(r)throw Error("Cannot register with defer after the call to load.");o.defer_(i,l)},areDepsLoaded:function(){return o.areDepsLoaded_(i.requires)}};try{i.load(s)}finally{r=!0}})();t&&this.pause_()},goog.DebugLoader_.prototype.pause_=function(){this.paused_=!0},goog.DebugLoader_.prototype.resume_=function(){this.paused_&&(this.paused_=!1,this.loadDeps_())},goog.DebugLoader_.prototype.loading_=function(o){this.loadingDeps_.push(o)},goog.DebugLoader_.prototype.loaded_=function(o){for(var t=0;t<this.loadingDeps_.length;t++)if(this.loadingDeps_[t]==o){this.loadingDeps_.splice(t,1);break}for(t=0;t<this.deferredQueue_.length;t++)if(this.deferredQueue_[t]==o.path){this.deferredQueue_.splice(t,1);break}if(this.loadingDeps_.length==this.deferredQueue_.length&&!this.depsToLoad_.length)for(;this.deferredQueue_.length;)this.requested(this.deferredQueue_.shift(),!0);o.loaded()},goog.DebugLoader_.prototype.areDepsLoaded_=function(o){for(var t=0;t<o.length;t++){var r=this.getPathFromDeps_(o[t]);if(!r||!(r in this.deferredCallbacks_||goog.isProvided_(o[t])))return!1}return!0},goog.DebugLoader_.prototype.getPathFromDeps_=function(o){return o in this.idToPath_?this.idToPath_[o]:o in this.dependencies_?o:null},goog.DebugLoader_.prototype.defer_=function(o,t){this.deferredCallbacks_[o.path]=t,this.deferredQueue_.push(o.path)},goog.LoadController=function(){},goog.LoadController.prototype.pause=function(){},goog.LoadController.prototype.resume=function(){},goog.LoadController.prototype.loaded=function(){},goog.LoadController.prototype.pending=function(){},goog.LoadController.prototype.registerEs6ModuleExports=function(o,t,r){},goog.LoadController.prototype.setModuleState=function(o){},goog.LoadController.prototype.clearModuleState=function(){},goog.LoadController.prototype.defer=function(o){},goog.LoadController.prototype.areDepsLoaded=function(){},goog.Dependency=function(o,t,r,i,n){this.path=o,this.relativePath=t,this.provides=r,this.requires=i,this.loadFlags=n,this.loaded_=!1,this.loadCallbacks_=[]},goog.Dependency.prototype.getPathName=function(){var o=this.path,t=o.indexOf("://");return 0<=t&&(o=o.substring(t+3),t=o.indexOf("/"),0<=t&&(o=o.substring(t+1))),o},goog.Dependency.prototype.onLoad=function(o){this.loaded_?o():this.loadCallbacks_.push(o)},goog.Dependency.prototype.loaded=function(){this.loaded_=!0;var o=this.loadCallbacks_;this.loadCallbacks_=[];for(var t=0;t<o.length;t++)o[t]()},goog.Dependency.defer_=!1,goog.Dependency.callbackMap_={},goog.Dependency.registerCallback_=function(o){var t=Math.random().toString(32);return goog.Dependency.callbackMap_[t]=o,t},goog.Dependency.unregisterCallback_=function(o){delete goog.Dependency.callbackMap_[o]},goog.Dependency.callback_=function(o,t){if(o in goog.Dependency.callbackMap_){for(var r=goog.Dependency.callbackMap_[o],i=[],n=1;n<arguments.length;n++)i.push(arguments[n]);r.apply(void 0,i)}else throw Error("Callback key "+o+" does not exist (was base.js loaded more than once?).")},goog.Dependency.prototype.load=function(o){if(goog.global.CLOSURE_IMPORT_SCRIPT)goog.global.CLOSURE_IMPORT_SCRIPT(this.path)?o.loaded():o.pause();else if(goog.inHtmlDocument_()){var t=goog.global.document;if(t.readyState=="complete"&&!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING){if(/\bdeps.js$/.test(this.path)){o.loaded();return}throw Error('Cannot write "'+this.path+'" after document load')}if(!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING&&goog.isDocumentLoading_()){var r=goog.Dependency.registerCallback_(function(s){goog.DebugLoader_.IS_OLD_IE_&&s.readyState!="complete"||(goog.Dependency.unregisterCallback_(r),o.loaded())}),i=!goog.DebugLoader_.IS_OLD_IE_&&goog.getScriptNonce()?' nonce="'+goog.getScriptNonce()+'"':"";i='<script src="'+this.path+'" '+(goog.DebugLoader_.IS_OLD_IE_?"onreadystatechange":"onload")+`="goog.Dependency.callback_('`+r+`', this)" type="text/javascript" `+(goog.Dependency.defer_?"defer":"")+i+"><\/script>",t.write(goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createHTML(i):i)}else{var n=t.createElement("script");n.defer=goog.Dependency.defer_,n.async=!1,n.type="text/javascript",(i=goog.getScriptNonce())&&n.setAttribute("nonce",i),goog.DebugLoader_.IS_OLD_IE_?(o.pause(),n.onreadystatechange=function(){(n.readyState=="loaded"||n.readyState=="complete")&&(o.loaded(),o.resume())}):n.onload=function(){n.onload=null,o.loaded()},n.src=goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createScriptURL(this.path):this.path,t.head.appendChild(n)}}else goog.logToConsole_("Cannot use default debug loader outside of HTML documents."),this.relativePath=="deps.js"?(goog.logToConsole_("Consider setting CLOSURE_IMPORT_SCRIPT before loading base.js, or setting CLOSURE_NO_DEPS to true."),o.loaded()):o.pause()},goog.Es6ModuleDependency=function(o,t,r,i,n){goog.Dependency.call(this,o,t,r,i,n)},goog.inherits(goog.Es6ModuleDependency,goog.Dependency),goog.Es6ModuleDependency.prototype.load=function(o){function t(h,S){h=S?'<script type="module" crossorigin>'+S+"<\/script>":'<script type="module" crossorigin src="'+h+'"><\/script>',i.write(goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createHTML(h):h)}function r(h,S){var E=i.createElement("script");E.defer=!0,E.async=!1,E.type="module",E.setAttribute("crossorigin",!0);var y=goog.getScriptNonce();y&&E.setAttribute("nonce",y),S?E.textContent=goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createScript(S):S:E.src=goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createScriptURL(h):h,i.head.appendChild(E)}if(goog.global.CLOSURE_IMPORT_SCRIPT)goog.global.CLOSURE_IMPORT_SCRIPT(this.path)?o.loaded():o.pause();else if(goog.inHtmlDocument_()){var i=goog.global.document,n=this;if(goog.isDocumentLoading_()){var s=t;goog.Dependency.defer_=!0}else s=r;var l=goog.Dependency.registerCallback_(function(){goog.Dependency.unregisterCallback_(l),o.setModuleState(goog.ModuleType.ES6)});s(void 0,'goog.Dependency.callback_("'+l+'")'),s(this.path,void 0);var g=goog.Dependency.registerCallback_(function(h){goog.Dependency.unregisterCallback_(g),o.registerEs6ModuleExports(n.path,h,goog.moduleLoaderState_.moduleName)});s(void 0,'import * as m from "'+this.path+'"; goog.Dependency.callback_("'+g+'", m)');var p=goog.Dependency.registerCallback_(function(){goog.Dependency.unregisterCallback_(p),o.clearModuleState(),o.loaded()});s(void 0,'goog.Dependency.callback_("'+p+'")')}else goog.logToConsole_("Cannot use default debug loader outside of HTML documents."),o.pause()},goog.TransformedDependency=function(o,t,r,i,n){goog.Dependency.call(this,o,t,r,i,n),this.contents_=null,this.lazyFetch_=!goog.inHtmlDocument_()||!("noModule"in goog.global.document.createElement("script"))},goog.inherits(goog.TransformedDependency,goog.Dependency),goog.TransformedDependency.prototype.load=function(o){function t(){n.contents_=goog.loadFileSync_(n.path),n.contents_&&(n.contents_=n.transform(n.contents_),n.contents_&&(n.contents_+=`
|
|
6
|
+
//# sourceURL=`+n.path))}function r(){if(n.lazyFetch_&&t(),n.contents_){s&&o.setModuleState(goog.ModuleType.ES6);try{var S=n.contents_;if(n.contents_=null,goog.globalEval(S),s)var E=goog.moduleLoaderState_.moduleName}finally{s&&o.clearModuleState()}s&&goog.global.$jscomp.require.ensure([n.getPathName()],function(){o.registerEs6ModuleExports(n.path,goog.global.$jscomp.require(n.getPathName()),E)}),o.loaded()}}function i(){var S=goog.global.document,E=goog.Dependency.registerCallback_(function(){goog.Dependency.unregisterCallback_(E),r()}),y='<script type="text/javascript">'+goog.protectScriptTag_('goog.Dependency.callback_("'+E+'");')+"<\/script>";S.write(goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createHTML(y):y)}var n=this;if(goog.global.CLOSURE_IMPORT_SCRIPT)t(),this.contents_&&goog.global.CLOSURE_IMPORT_SCRIPT("",this.contents_)?(this.contents_=null,o.loaded()):o.pause();else{var s=this.loadFlags.module==goog.ModuleType.ES6;this.lazyFetch_||t();var l=1<o.pending().length,g=l&&goog.DebugLoader_.IS_OLD_IE_;if(l=goog.Dependency.defer_&&(l||goog.isDocumentLoading_()),g||l)o.defer(function(){r()});else{var p=goog.global.document;if(g=goog.inHtmlDocument_()&&"ActiveXObject"in goog.global,s&&goog.inHtmlDocument_()&&goog.isDocumentLoading_()&&!g){goog.Dependency.defer_=!0,o.pause();var h=p.onreadystatechange;p.onreadystatechange=function(){p.readyState=="interactive"&&(p.onreadystatechange=h,r(),o.resume()),goog.isFunction(h)&&h.apply(void 0,arguments)}}else!goog.DebugLoader_.IS_OLD_IE_&&goog.inHtmlDocument_()&&goog.isDocumentLoading_()?i():r()}}},goog.TransformedDependency.prototype.transform=function(o){},goog.TranspiledDependency=function(o,t,r,i,n,s){goog.TransformedDependency.call(this,o,t,r,i,n),this.transpiler=s},goog.inherits(goog.TranspiledDependency,goog.TransformedDependency),goog.TranspiledDependency.prototype.transform=function(o){return this.transpiler.transpile(o,this.getPathName())},goog.PreTranspiledEs6ModuleDependency=function(o,t,r,i,n){goog.TransformedDependency.call(this,o,t,r,i,n)},goog.inherits(goog.PreTranspiledEs6ModuleDependency,goog.TransformedDependency),goog.PreTranspiledEs6ModuleDependency.prototype.transform=function(o){return o},goog.GoogModuleDependency=function(o,t,r,i,n,s,l){goog.TransformedDependency.call(this,o,t,r,i,n),this.needsTranspile_=s,this.transpiler_=l},goog.inherits(goog.GoogModuleDependency,goog.TransformedDependency),goog.GoogModuleDependency.prototype.transform=function(o){return this.needsTranspile_&&(o=this.transpiler_.transpile(o,this.getPathName())),goog.LOAD_MODULE_USING_EVAL&&goog.isDef(goog.global.JSON)?"goog.loadModule("+goog.global.JSON.stringify(o+`
|
|
7
7
|
//# sourceURL=`+this.path+`
|
|
8
8
|
`)+");":'goog.loadModule(function(exports) {"use strict";'+o+`
|
|
9
9
|
;return exports});
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
`},goog.DebugLoader_.IS_OLD_IE_=!(goog.global.atob||!goog.global.document||!goog.global.document.all),goog.DebugLoader_.prototype.addDependency=function(o,t,r,i){t=t||[],o=o.replace(/\\/g,"/");var n=goog.normalizePath_(goog.basePath+o);for(i&&typeof i!="boolean"||(i=i?{module:goog.ModuleType.GOOG}:{}),r=this.factory_.createDependency(n,o,t,r,i,goog.transpiler_.needsTranspile(i.lang||"es3",i.module)),this.dependencies_[n]=r,r=0;r<t.length;r++)this.idToPath_[t[r]]=n;this.idToPath_[o]=n},goog.DependencyFactory=function(o){this.transpiler=o},goog.DependencyFactory.prototype.createDependency=function(o,t,r,i,n,s){return n.module==goog.ModuleType.GOOG?new goog.GoogModuleDependency(o,t,r,i,n,s,this.transpiler):s?new goog.TranspiledDependency(o,t,r,i,n,this.transpiler):n.module==goog.ModuleType.ES6?goog.TRANSPILE=="never"&&goog.ASSUME_ES_MODULES_TRANSPILED?new goog.PreTranspiledEs6ModuleDependency(o,t,r,i,n):new goog.Es6ModuleDependency(o,t,r,i,n):new goog.Dependency(o,t,r,i,n)},goog.debugLoader_=new goog.DebugLoader_,goog.loadClosureDeps=function(){goog.debugLoader_.loadClosureDeps()},goog.setDependencyFactory=function(o){goog.debugLoader_.setDependencyFactory(o)},goog.global.CLOSURE_NO_DEPS||goog.debugLoader_.loadClosureDeps(),goog.bootstrap=function(o,t){goog.debugLoader_.bootstrap(o,t)});goog.TRUSTED_TYPES_POLICY_NAME="";goog.identity_=function(o){return o};goog.createTrustedTypesPolicy=function(o){var t=null;if(typeof TrustedTypes>"u"||!TrustedTypes.createPolicy)return t;try{t=TrustedTypes.createPolicy(o,{createHTML:goog.identity_,createScript:goog.identity_,createScriptURL:goog.identity_,createURL:goog.identity_})}catch(r){goog.logToConsole_(r.message)}return t};goog.TRUSTED_TYPES_POLICY_=goog.TRUSTED_TYPES_POLICY_NAME?goog.createTrustedTypesPolicy(goog.TRUSTED_TYPES_POLICY_NAME+"#base"):null;var jspb={BinaryConstants:{},ConstBinaryMessage:function(){},BinaryMessage:function(){}};jspb.BinaryConstants.FieldType={INVALID:-1,DOUBLE:1,FLOAT:2,INT64:3,UINT64:4,INT32:5,FIXED64:6,FIXED32:7,BOOL:8,STRING:9,GROUP:10,MESSAGE:11,BYTES:12,UINT32:13,ENUM:14,SFIXED32:15,SFIXED64:16,SINT32:17,SINT64:18,FHASH64:30,VHASH64:31};jspb.BinaryConstants.WireType={INVALID:-1,VARINT:0,FIXED64:1,DELIMITED:2,START_GROUP:3,END_GROUP:4,FIXED32:5};jspb.BinaryConstants.FieldTypeToWireType=function(o){var t=jspb.BinaryConstants.FieldType,r=jspb.BinaryConstants.WireType;switch(o){case t.INT32:case t.INT64:case t.UINT32:case t.UINT64:case t.SINT32:case t.SINT64:case t.BOOL:case t.ENUM:case t.VHASH64:return r.VARINT;case t.DOUBLE:case t.FIXED64:case t.SFIXED64:case t.FHASH64:return r.FIXED64;case t.STRING:case t.MESSAGE:case t.BYTES:return r.DELIMITED;case t.FLOAT:case t.FIXED32:case t.SFIXED32:return r.FIXED32;default:return r.INVALID}};jspb.BinaryConstants.INVALID_FIELD_NUMBER=-1;jspb.BinaryConstants.FLOAT32_EPS=1401298464324817e-60;jspb.BinaryConstants.FLOAT32_MIN=11754943508222875e-54;jspb.BinaryConstants.FLOAT32_MAX=34028234663852886e22;jspb.BinaryConstants.FLOAT64_EPS=5e-324;jspb.BinaryConstants.FLOAT64_MIN=22250738585072014e-324;jspb.BinaryConstants.FLOAT64_MAX=17976931348623157e292;jspb.BinaryConstants.TWO_TO_20=1048576;jspb.BinaryConstants.TWO_TO_23=8388608;jspb.BinaryConstants.TWO_TO_31=2147483648;jspb.BinaryConstants.TWO_TO_32=4294967296;jspb.BinaryConstants.TWO_TO_52=4503599627370496;jspb.BinaryConstants.TWO_TO_63=9223372036854776e3;jspb.BinaryConstants.TWO_TO_64=18446744073709552e3;jspb.BinaryConstants.ZERO_HASH="\0\0\0\0\0\0\0\0";goog.dom={};goog.dom.NodeType={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12};goog.debug={};goog.debug.Error=function(o){if(Error.captureStackTrace)Error.captureStackTrace(this,goog.debug.Error);else{var t=Error().stack;t&&(this.stack=t)}o&&(this.message=String(o)),this.reportErrorToServer=!0};goog.inherits(goog.debug.Error,Error);goog.debug.Error.prototype.name="CustomError";goog.asserts={};goog.asserts.ENABLE_ASSERTS=goog.DEBUG;goog.asserts.AssertionError=function(o,t){goog.debug.Error.call(this,goog.asserts.subs_(o,t)),this.messagePattern=o};goog.inherits(goog.asserts.AssertionError,goog.debug.Error);goog.asserts.AssertionError.prototype.name="AssertionError";goog.asserts.DEFAULT_ERROR_HANDLER=function(o){throw o};goog.asserts.errorHandler_=goog.asserts.DEFAULT_ERROR_HANDLER;goog.asserts.subs_=function(o,t){o=o.split("%s");for(var r="",i=o.length-1,n=0;n<i;n++)r+=o[n]+(n<t.length?t[n]:"%s");return r+o[i]};goog.asserts.doAssertFailure_=function(o,t,r,i){var n="Assertion failed";if(r){n+=": "+r;var s=i}else o&&(n+=": "+o,s=t);o=new goog.asserts.AssertionError(""+n,s||[]),goog.asserts.errorHandler_(o)};goog.asserts.setErrorHandler=function(o){goog.asserts.ENABLE_ASSERTS&&(goog.asserts.errorHandler_=o)};goog.asserts.assert=function(o,t,r){return goog.asserts.ENABLE_ASSERTS&&!o&&goog.asserts.doAssertFailure_("",null,t,Array.prototype.slice.call(arguments,2)),o};goog.asserts.assertExists=function(o,t,r){return goog.asserts.ENABLE_ASSERTS&&o==null&&goog.asserts.doAssertFailure_("Expected to exist: %s.",[o],t,Array.prototype.slice.call(arguments,2)),o};goog.asserts.fail=function(o,t){goog.asserts.ENABLE_ASSERTS&&goog.asserts.errorHandler_(new goog.asserts.AssertionError("Failure"+(o?": "+o:""),Array.prototype.slice.call(arguments,1)))};goog.asserts.assertNumber=function(o,t,r){return goog.asserts.ENABLE_ASSERTS&&!goog.isNumber(o)&&goog.asserts.doAssertFailure_("Expected number but got %s: %s.",[goog.typeOf(o),o],t,Array.prototype.slice.call(arguments,2)),o};goog.asserts.assertString=function(o,t,r){return goog.asserts.ENABLE_ASSERTS&&!goog.isString(o)&&goog.asserts.doAssertFailure_("Expected string but got %s: %s.",[goog.typeOf(o),o],t,Array.prototype.slice.call(arguments,2)),o};goog.asserts.assertFunction=function(o,t,r){return goog.asserts.ENABLE_ASSERTS&&!goog.isFunction(o)&&goog.asserts.doAssertFailure_("Expected function but got %s: %s.",[goog.typeOf(o),o],t,Array.prototype.slice.call(arguments,2)),o};goog.asserts.assertObject=function(o,t,r){return goog.asserts.ENABLE_ASSERTS&&!goog.isObject(o)&&goog.asserts.doAssertFailure_("Expected object but got %s: %s.",[goog.typeOf(o),o],t,Array.prototype.slice.call(arguments,2)),o};goog.asserts.assertArray=function(o,t,r){return goog.asserts.ENABLE_ASSERTS&&!goog.isArray(o)&&goog.asserts.doAssertFailure_("Expected array but got %s: %s.",[goog.typeOf(o),o],t,Array.prototype.slice.call(arguments,2)),o};goog.asserts.assertBoolean=function(o,t,r){return goog.asserts.ENABLE_ASSERTS&&!goog.isBoolean(o)&&goog.asserts.doAssertFailure_("Expected boolean but got %s: %s.",[goog.typeOf(o),o],t,Array.prototype.slice.call(arguments,2)),o};goog.asserts.assertElement=function(o,t,r){return!goog.asserts.ENABLE_ASSERTS||goog.isObject(o)&&o.nodeType==goog.dom.NodeType.ELEMENT||goog.asserts.doAssertFailure_("Expected Element but got %s: %s.",[goog.typeOf(o),o],t,Array.prototype.slice.call(arguments,2)),o};goog.asserts.assertInstanceof=function(o,t,r,i){return!goog.asserts.ENABLE_ASSERTS||o instanceof t||goog.asserts.doAssertFailure_("Expected instanceof %s but got %s.",[goog.asserts.getType_(t),goog.asserts.getType_(o)],r,Array.prototype.slice.call(arguments,3)),o};goog.asserts.assertFinite=function(o,t,r){return!goog.asserts.ENABLE_ASSERTS||typeof o=="number"&&isFinite(o)||goog.asserts.doAssertFailure_("Expected %s to be a finite number but it is not.",[o],t,Array.prototype.slice.call(arguments,2)),o};goog.asserts.assertObjectPrototypeIsIntact=function(){for(var o in Object.prototype)goog.asserts.fail(o+" should not be enumerable in Object.prototype.")};goog.asserts.getType_=function(o){return o instanceof Function?o.displayName||o.name||"unknown type name":o instanceof Object?o.constructor.displayName||o.constructor.name||Object.prototype.toString.call(o):o===null?"null":typeof o};goog.array={};goog.NATIVE_ARRAY_PROTOTYPES=goog.TRUSTED_SITE;goog.array.ASSUME_NATIVE_FUNCTIONS=2012<goog.FEATURESET_YEAR;goog.array.peek=function(o){return o[o.length-1]};goog.array.last=goog.array.peek;goog.array.indexOf=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.indexOf)?function(o,t,r){return goog.asserts.assert(o.length!=null),Array.prototype.indexOf.call(o,t,r)}:function(o,t,r){if(r=r==null?0:0>r?Math.max(0,o.length+r):r,goog.isString(o))return goog.isString(t)&&t.length==1?o.indexOf(t,r):-1;for(;r<o.length;r++)if(r in o&&o[r]===t)return r;return-1};goog.array.lastIndexOf=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.lastIndexOf)?function(o,t,r){return goog.asserts.assert(o.length!=null),Array.prototype.lastIndexOf.call(o,t,r??o.length-1)}:function(o,t,r){if(r=r??o.length-1,0>r&&(r=Math.max(0,o.length+r)),goog.isString(o))return goog.isString(t)&&t.length==1?o.lastIndexOf(t,r):-1;for(;0<=r;r--)if(r in o&&o[r]===t)return r;return-1};goog.array.forEach=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.forEach)?function(o,t,r){goog.asserts.assert(o.length!=null),Array.prototype.forEach.call(o,t,r)}:function(o,t,r){for(var i=o.length,n=goog.isString(o)?o.split(""):o,s=0;s<i;s++)s in n&&t.call(r,n[s],s,o)};goog.array.forEachRight=function(o,t,r){var i=o.length,n=goog.isString(o)?o.split(""):o;for(--i;0<=i;--i)i in n&&t.call(r,n[i],i,o)};goog.array.filter=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.filter)?function(o,t,r){return goog.asserts.assert(o.length!=null),Array.prototype.filter.call(o,t,r)}:function(o,t,r){for(var i=o.length,n=[],s=0,l=goog.isString(o)?o.split(""):o,g=0;g<i;g++)if(g in l){var p=l[g];t.call(r,p,g,o)&&(n[s++]=p)}return n};goog.array.map=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.map)?function(o,t,r){return goog.asserts.assert(o.length!=null),Array.prototype.map.call(o,t,r)}:function(o,t,r){for(var i=o.length,n=Array(i),s=goog.isString(o)?o.split(""):o,l=0;l<i;l++)l in s&&(n[l]=t.call(r,s[l],l,o));return n};goog.array.reduce=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.reduce)?function(o,t,r,i){return goog.asserts.assert(o.length!=null),i&&(t=goog.bind(t,i)),Array.prototype.reduce.call(o,t,r)}:function(o,t,r,i){var n=r;return goog.array.forEach(o,function(s,l){n=t.call(i,n,s,l,o)}),n};goog.array.reduceRight=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.reduceRight)?function(o,t,r,i){return goog.asserts.assert(o.length!=null),goog.asserts.assert(t!=null),i&&(t=goog.bind(t,i)),Array.prototype.reduceRight.call(o,t,r)}:function(o,t,r,i){var n=r;return goog.array.forEachRight(o,function(s,l){n=t.call(i,n,s,l,o)}),n};goog.array.some=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.some)?function(o,t,r){return goog.asserts.assert(o.length!=null),Array.prototype.some.call(o,t,r)}:function(o,t,r){for(var i=o.length,n=goog.isString(o)?o.split(""):o,s=0;s<i;s++)if(s in n&&t.call(r,n[s],s,o))return!0;return!1};goog.array.every=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.every)?function(o,t,r){return goog.asserts.assert(o.length!=null),Array.prototype.every.call(o,t,r)}:function(o,t,r){for(var i=o.length,n=goog.isString(o)?o.split(""):o,s=0;s<i;s++)if(s in n&&!t.call(r,n[s],s,o))return!1;return!0};goog.array.count=function(o,t,r){var i=0;return goog.array.forEach(o,function(n,s,l){t.call(r,n,s,l)&&++i},r),i};goog.array.find=function(o,t,r){return t=goog.array.findIndex(o,t,r),0>t?null:goog.isString(o)?o.charAt(t):o[t]};goog.array.findIndex=function(o,t,r){for(var i=o.length,n=goog.isString(o)?o.split(""):o,s=0;s<i;s++)if(s in n&&t.call(r,n[s],s,o))return s;return-1};goog.array.findRight=function(o,t,r){return t=goog.array.findIndexRight(o,t,r),0>t?null:goog.isString(o)?o.charAt(t):o[t]};goog.array.findIndexRight=function(o,t,r){var i=o.length,n=goog.isString(o)?o.split(""):o;for(--i;0<=i;i--)if(i in n&&t.call(r,n[i],i,o))return i;return-1};goog.array.contains=function(o,t){return 0<=goog.array.indexOf(o,t)};goog.array.isEmpty=function(o){return o.length==0};goog.array.clear=function(o){if(!goog.isArray(o))for(var t=o.length-1;0<=t;t--)delete o[t];o.length=0};goog.array.insert=function(o,t){goog.array.contains(o,t)||o.push(t)};goog.array.insertAt=function(o,t,r){goog.array.splice(o,r,0,t)};goog.array.insertArrayAt=function(o,t,r){goog.partial(goog.array.splice,o,r,0).apply(null,t)};goog.array.insertBefore=function(o,t,r){var i;arguments.length==2||0>(i=goog.array.indexOf(o,r))?o.push(t):goog.array.insertAt(o,t,i)};goog.array.remove=function(o,t){t=goog.array.indexOf(o,t);var r;return(r=0<=t)&&goog.array.removeAt(o,t),r};goog.array.removeLast=function(o,t){return t=goog.array.lastIndexOf(o,t),0<=t?(goog.array.removeAt(o,t),!0):!1};goog.array.removeAt=function(o,t){return goog.asserts.assert(o.length!=null),Array.prototype.splice.call(o,t,1).length==1};goog.array.removeIf=function(o,t,r){return t=goog.array.findIndex(o,t,r),0<=t?(goog.array.removeAt(o,t),!0):!1};goog.array.removeAllIf=function(o,t,r){var i=0;return goog.array.forEachRight(o,function(n,s){t.call(r,n,s,o)&&goog.array.removeAt(o,s)&&i++}),i};goog.array.concat=function(o){return Array.prototype.concat.apply([],arguments)};goog.array.join=function(o){return Array.prototype.concat.apply([],arguments)};goog.array.toArray=function(o){var t=o.length;if(0<t){for(var r=Array(t),i=0;i<t;i++)r[i]=o[i];return r}return[]};goog.array.clone=goog.array.toArray;goog.array.extend=function(o,t){for(var r=1;r<arguments.length;r++){var i=arguments[r];if(goog.isArrayLike(i)){var n=o.length||0,s=i.length||0;o.length=n+s;for(var l=0;l<s;l++)o[n+l]=i[l]}else o.push(i)}};goog.array.splice=function(o,t,r,i){return goog.asserts.assert(o.length!=null),Array.prototype.splice.apply(o,goog.array.slice(arguments,1))};goog.array.slice=function(o,t,r){return goog.asserts.assert(o.length!=null),2>=arguments.length?Array.prototype.slice.call(o,t):Array.prototype.slice.call(o,t,r)};goog.array.removeDuplicates=function(o,t,r){t=t||o;var i=function(p){return goog.isObject(p)?"o"+goog.getUid(p):(typeof p).charAt(0)+p};r=r||i,i={};for(var n=0,s=0;s<o.length;){var l=o[s++],g=r(l);Object.prototype.hasOwnProperty.call(i,g)||(i[g]=!0,t[n++]=l)}t.length=n};goog.array.binarySearch=function(o,t,r){return goog.array.binarySearch_(o,r||goog.array.defaultCompare,!1,t)};goog.array.binarySelect=function(o,t,r){return goog.array.binarySearch_(o,t,!0,void 0,r)};goog.array.binarySearch_=function(o,t,r,i,n){for(var s=0,l=o.length,g;s<l;){var p=s+l>>1,h=r?t.call(n,o[p],p,o):t(i,o[p]);0<h?s=p+1:(l=p,g=!h)}return g?s:~s};goog.array.sort=function(o,t){o.sort(t||goog.array.defaultCompare)};goog.array.stableSort=function(o,t){for(var r=Array(o.length),i=0;i<o.length;i++)r[i]={index:i,value:o[i]};var n=t||goog.array.defaultCompare;for(goog.array.sort(r,function(s,l){return n(s.value,l.value)||s.index-l.index}),i=0;i<o.length;i++)o[i]=r[i].value};goog.array.sortByKey=function(o,t,r){var i=r||goog.array.defaultCompare;goog.array.sort(o,function(n,s){return i(t(n),t(s))})};goog.array.sortObjectsByKey=function(o,t,r){goog.array.sortByKey(o,function(i){return i[t]},r)};goog.array.isSorted=function(o,t,r){t=t||goog.array.defaultCompare;for(var i=1;i<o.length;i++){var n=t(o[i-1],o[i]);if(0<n||n==0&&r)return!1}return!0};goog.array.equals=function(o,t,r){if(!goog.isArrayLike(o)||!goog.isArrayLike(t)||o.length!=t.length)return!1;var i=o.length;r=r||goog.array.defaultCompareEquality;for(var n=0;n<i;n++)if(!r(o[n],t[n]))return!1;return!0};goog.array.compare3=function(o,t,r){r=r||goog.array.defaultCompare;for(var i=Math.min(o.length,t.length),n=0;n<i;n++){var s=r(o[n],t[n]);if(s!=0)return s}return goog.array.defaultCompare(o.length,t.length)};goog.array.defaultCompare=function(o,t){return o>t?1:o<t?-1:0};goog.array.inverseDefaultCompare=function(o,t){return-goog.array.defaultCompare(o,t)};goog.array.defaultCompareEquality=function(o,t){return o===t};goog.array.binaryInsert=function(o,t,r){return r=goog.array.binarySearch(o,t,r),0>r?(goog.array.insertAt(o,t,-(r+1)),!0):!1};goog.array.binaryRemove=function(o,t,r){return t=goog.array.binarySearch(o,t,r),0<=t?goog.array.removeAt(o,t):!1};goog.array.bucket=function(o,t,r){for(var i={},n=0;n<o.length;n++){var s=o[n],l=t.call(r,s,n,o);goog.isDef(l)&&(i[l]||(i[l]=[])).push(s)}return i};goog.array.toObject=function(o,t,r){var i={};return goog.array.forEach(o,function(n,s){i[t.call(r,n,s,o)]=n}),i};goog.array.range=function(o,t,r){var i=[],n=0,s=o;if(r=r||1,t!==void 0&&(n=o,s=t),0>r*(s-n))return[];if(0<r)for(o=n;o<s;o+=r)i.push(o);else for(o=n;o>s;o+=r)i.push(o);return i};goog.array.repeat=function(o,t){for(var r=[],i=0;i<t;i++)r[i]=o;return r};goog.array.flatten=function(o){for(var t=[],r=0;r<arguments.length;r++){var i=arguments[r];if(goog.isArray(i))for(var n=0;n<i.length;n+=8192){var s=goog.array.slice(i,n,n+8192);s=goog.array.flatten.apply(null,s);for(var l=0;l<s.length;l++)t.push(s[l])}else t.push(i)}return t};goog.array.rotate=function(o,t){return goog.asserts.assert(o.length!=null),o.length&&(t%=o.length,0<t?Array.prototype.unshift.apply(o,o.splice(-t,t)):0>t&&Array.prototype.push.apply(o,o.splice(0,-t))),o};goog.array.moveItem=function(o,t,r){goog.asserts.assert(0<=t&&t<o.length),goog.asserts.assert(0<=r&&r<o.length),t=Array.prototype.splice.call(o,t,1),Array.prototype.splice.call(o,r,0,t[0])};goog.array.zip=function(o){if(!arguments.length)return[];for(var t=[],r=arguments[0].length,i=1;i<arguments.length;i++)arguments[i].length<r&&(r=arguments[i].length);for(i=0;i<r;i++){for(var n=[],s=0;s<arguments.length;s++)n.push(arguments[s][i]);t.push(n)}return t};goog.array.shuffle=function(o,t){t=t||Math.random;for(var r=o.length-1;0<r;r--){var i=Math.floor(t()*(r+1)),n=o[r];o[r]=o[i],o[i]=n}};goog.array.copyByIndex=function(o,t){var r=[];return goog.array.forEach(t,function(i){r.push(o[i])}),r};goog.array.concatMap=function(o,t,r){return goog.array.concat.apply([],goog.array.map(o,t,r))};goog.crypt={};goog.crypt.stringToByteArray=function(o){for(var t=[],r=0,i=0;i<o.length;i++){var n=o.charCodeAt(i);255<n&&(t[r++]=n&255,n>>=8),t[r++]=n}return t};goog.crypt.byteArrayToString=function(o){if(8192>=o.length)return String.fromCharCode.apply(null,o);for(var t="",r=0;r<o.length;r+=8192){var i=goog.array.slice(o,r,r+8192);t+=String.fromCharCode.apply(null,i)}return t};goog.crypt.byteArrayToHex=function(o,t){return goog.array.map(o,function(r){return r=r.toString(16),1<r.length?r:"0"+r}).join(t||"")};goog.crypt.hexToByteArray=function(o){goog.asserts.assert(o.length%2==0,"Key string length must be multiple of 2");for(var t=[],r=0;r<o.length;r+=2)t.push(parseInt(o.substring(r,r+2),16));return t};goog.crypt.stringToUtf8ByteArray=function(o){for(var t=[],r=0,i=0;i<o.length;i++){var n=o.charCodeAt(i);128>n?t[r++]=n:(2048>n?t[r++]=n>>6|192:((n&64512)==55296&&i+1<o.length&&(o.charCodeAt(i+1)&64512)==56320?(n=65536+((n&1023)<<10)+(o.charCodeAt(++i)&1023),t[r++]=n>>18|240,t[r++]=n>>12&63|128):t[r++]=n>>12|224,t[r++]=n>>6&63|128),t[r++]=n&63|128)}return t};goog.crypt.utf8ByteArrayToString=function(o){for(var t=[],r=0,i=0;r<o.length;){var n=o[r++];if(128>n)t[i++]=String.fromCharCode(n);else if(191<n&&224>n){var s=o[r++];t[i++]=String.fromCharCode((n&31)<<6|s&63)}else if(239<n&&365>n){s=o[r++];var l=o[r++],g=o[r++];n=((n&7)<<18|(s&63)<<12|(l&63)<<6|g&63)-65536,t[i++]=String.fromCharCode(55296+(n>>10)),t[i++]=String.fromCharCode(56320+(n&1023))}else s=o[r++],l=o[r++],t[i++]=String.fromCharCode((n&15)<<12|(s&63)<<6|l&63)}return t.join("")};goog.crypt.xorByteArray=function(o,t){goog.asserts.assert(o.length==t.length,"XOR array lengths must match");for(var r=[],i=0;i<o.length;i++)r.push(o[i]^t[i]);return r};goog.string={};goog.string.internal={};goog.string.internal.startsWith=function(o,t){return o.lastIndexOf(t,0)==0};goog.string.internal.endsWith=function(o,t){var r=o.length-t.length;return 0<=r&&o.indexOf(t,r)==r};goog.string.internal.caseInsensitiveStartsWith=function(o,t){return goog.string.internal.caseInsensitiveCompare(t,o.substr(0,t.length))==0};goog.string.internal.caseInsensitiveEndsWith=function(o,t){return goog.string.internal.caseInsensitiveCompare(t,o.substr(o.length-t.length,t.length))==0};goog.string.internal.caseInsensitiveEquals=function(o,t){return o.toLowerCase()==t.toLowerCase()};goog.string.internal.isEmptyOrWhitespace=function(o){return/^[\s\xa0]*$/.test(o)};goog.string.internal.trim=goog.TRUSTED_SITE&&String.prototype.trim?function(o){return o.trim()}:function(o){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(o)[1]};goog.string.internal.caseInsensitiveCompare=function(o,t){return o=String(o).toLowerCase(),t=String(t).toLowerCase(),o<t?-1:o==t?0:1};goog.string.internal.newLineToBr=function(o,t){return o.replace(/(\r\n|\r|\n)/g,t?"<br />":"<br>")};goog.string.internal.htmlEscape=function(o,t){if(t)o=o.replace(goog.string.internal.AMP_RE_,"&").replace(goog.string.internal.LT_RE_,"<").replace(goog.string.internal.GT_RE_,">").replace(goog.string.internal.QUOT_RE_,""").replace(goog.string.internal.SINGLE_QUOTE_RE_,"'").replace(goog.string.internal.NULL_RE_,"�");else{if(!goog.string.internal.ALL_RE_.test(o))return o;o.indexOf("&")!=-1&&(o=o.replace(goog.string.internal.AMP_RE_,"&")),o.indexOf("<")!=-1&&(o=o.replace(goog.string.internal.LT_RE_,"<")),o.indexOf(">")!=-1&&(o=o.replace(goog.string.internal.GT_RE_,">")),o.indexOf('"')!=-1&&(o=o.replace(goog.string.internal.QUOT_RE_,""")),o.indexOf("'")!=-1&&(o=o.replace(goog.string.internal.SINGLE_QUOTE_RE_,"'")),o.indexOf("\0")!=-1&&(o=o.replace(goog.string.internal.NULL_RE_,"�"))}return o};goog.string.internal.AMP_RE_=/&/g;goog.string.internal.LT_RE_=/</g;goog.string.internal.GT_RE_=/>/g;goog.string.internal.QUOT_RE_=/"/g;goog.string.internal.SINGLE_QUOTE_RE_=/'/g;goog.string.internal.NULL_RE_=/\x00/g;goog.string.internal.ALL_RE_=/[\x00&<>"']/;goog.string.internal.whitespaceEscape=function(o,t){return goog.string.internal.newLineToBr(o.replace(/ /g,"  "),t)};goog.string.internal.contains=function(o,t){return o.indexOf(t)!=-1};goog.string.internal.caseInsensitiveContains=function(o,t){return goog.string.internal.contains(o.toLowerCase(),t.toLowerCase())};goog.string.internal.compareVersions=function(o,t){var r=0;o=goog.string.internal.trim(String(o)).split("."),t=goog.string.internal.trim(String(t)).split(".");for(var i=Math.max(o.length,t.length),n=0;r==0&&n<i;n++){var s=o[n]||"",l=t[n]||"";do{if(s=/(\d*)(\D*)(.*)/.exec(s)||["","","",""],l=/(\d*)(\D*)(.*)/.exec(l)||["","","",""],s[0].length==0&&l[0].length==0)break;r=s[1].length==0?0:parseInt(s[1],10);var g=l[1].length==0?0:parseInt(l[1],10);r=goog.string.internal.compareElements_(r,g)||goog.string.internal.compareElements_(s[2].length==0,l[2].length==0)||goog.string.internal.compareElements_(s[2],l[2]),s=s[3],l=l[3]}while(r==0)}return r};goog.string.internal.compareElements_=function(o,t){return o<t?-1:o>t?1:0};goog.string.TypedString=function(){};goog.string.Const=function(o,t){this.stringConstValueWithSecurityContract__googStringSecurityPrivate_=o===goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_&&t||"",this.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_=goog.string.Const.TYPE_MARKER_};goog.string.Const.prototype.implementsGoogStringTypedString=!0;goog.string.Const.prototype.getTypedStringValue=function(){return this.stringConstValueWithSecurityContract__googStringSecurityPrivate_};goog.string.Const.prototype.toString=function(){return"Const{"+this.stringConstValueWithSecurityContract__googStringSecurityPrivate_+"}"};goog.string.Const.unwrap=function(o){return o instanceof goog.string.Const&&o.constructor===goog.string.Const&&o.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_===goog.string.Const.TYPE_MARKER_?o.stringConstValueWithSecurityContract__googStringSecurityPrivate_:(goog.asserts.fail("expected object of type Const, got '"+o+"'"),"type_error:Const")};goog.string.Const.from=function(o){return new goog.string.Const(goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_,o)};goog.string.Const.TYPE_MARKER_={};goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_={};goog.string.Const.EMPTY=goog.string.Const.from("");goog.fs={};goog.fs.url={};goog.fs.url.createObjectUrl=function(o){return goog.fs.url.getUrlObject_().createObjectURL(o)};goog.fs.url.revokeObjectUrl=function(o){goog.fs.url.getUrlObject_().revokeObjectURL(o)};goog.fs.url.getUrlObject_=function(){var o=goog.fs.url.findUrlObject_();if(o!=null)return o;throw Error("This browser doesn't seem to support blob URLs")};goog.fs.url.findUrlObject_=function(){return goog.isDef(goog.global.URL)&&goog.isDef(goog.global.URL.createObjectURL)?goog.global.URL:goog.isDef(goog.global.webkitURL)&&goog.isDef(goog.global.webkitURL.createObjectURL)?goog.global.webkitURL:goog.isDef(goog.global.createObjectURL)?goog.global:null};goog.fs.url.browserSupportsObjectUrls=function(){return goog.fs.url.findUrlObject_()!=null};goog.html={};goog.html.trustedtypes={};goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY=goog.TRUSTED_TYPES_POLICY_NAME?goog.createTrustedTypesPolicy(goog.TRUSTED_TYPES_POLICY_NAME+"#html"):null;goog.i18n={};goog.i18n.bidi={};goog.i18n.bidi.FORCE_RTL=!1;goog.i18n.bidi.IS_RTL=goog.i18n.bidi.FORCE_RTL||(goog.LOCALE.substring(0,2).toLowerCase()=="ar"||goog.LOCALE.substring(0,2).toLowerCase()=="fa"||goog.LOCALE.substring(0,2).toLowerCase()=="he"||goog.LOCALE.substring(0,2).toLowerCase()=="iw"||goog.LOCALE.substring(0,2).toLowerCase()=="ps"||goog.LOCALE.substring(0,2).toLowerCase()=="sd"||goog.LOCALE.substring(0,2).toLowerCase()=="ug"||goog.LOCALE.substring(0,2).toLowerCase()=="ur"||goog.LOCALE.substring(0,2).toLowerCase()=="yi")&&(goog.LOCALE.length==2||goog.LOCALE.substring(2,3)=="-"||goog.LOCALE.substring(2,3)=="_")||3<=goog.LOCALE.length&&goog.LOCALE.substring(0,3).toLowerCase()=="ckb"&&(goog.LOCALE.length==3||goog.LOCALE.substring(3,4)=="-"||goog.LOCALE.substring(3,4)=="_")||7<=goog.LOCALE.length&&(goog.LOCALE.substring(2,3)=="-"||goog.LOCALE.substring(2,3)=="_")&&(goog.LOCALE.substring(3,7).toLowerCase()=="adlm"||goog.LOCALE.substring(3,7).toLowerCase()=="arab"||goog.LOCALE.substring(3,7).toLowerCase()=="hebr"||goog.LOCALE.substring(3,7).toLowerCase()=="nkoo"||goog.LOCALE.substring(3,7).toLowerCase()=="rohg"||goog.LOCALE.substring(3,7).toLowerCase()=="thaa")||8<=goog.LOCALE.length&&(goog.LOCALE.substring(3,4)=="-"||goog.LOCALE.substring(3,4)=="_")&&(goog.LOCALE.substring(4,8).toLowerCase()=="adlm"||goog.LOCALE.substring(4,8).toLowerCase()=="arab"||goog.LOCALE.substring(4,8).toLowerCase()=="hebr"||goog.LOCALE.substring(4,8).toLowerCase()=="nkoo"||goog.LOCALE.substring(4,8).toLowerCase()=="rohg"||goog.LOCALE.substring(4,8).toLowerCase()=="thaa");goog.i18n.bidi.Format={LRE:"\u202A",RLE:"\u202B",PDF:"\u202C",LRM:"\u200E",RLM:"\u200F"};goog.i18n.bidi.Dir={LTR:1,RTL:-1,NEUTRAL:0};goog.i18n.bidi.RIGHT="right";goog.i18n.bidi.LEFT="left";goog.i18n.bidi.I18N_RIGHT=goog.i18n.bidi.IS_RTL?goog.i18n.bidi.LEFT:goog.i18n.bidi.RIGHT;goog.i18n.bidi.I18N_LEFT=goog.i18n.bidi.IS_RTL?goog.i18n.bidi.RIGHT:goog.i18n.bidi.LEFT;goog.i18n.bidi.toDir=function(o,t){return typeof o=="number"?0<o?goog.i18n.bidi.Dir.LTR:0>o?goog.i18n.bidi.Dir.RTL:t?null:goog.i18n.bidi.Dir.NEUTRAL:o==null?null:o?goog.i18n.bidi.Dir.RTL:goog.i18n.bidi.Dir.LTR};goog.i18n.bidi.ltrChars_="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0900-\u1FFF\u200E\u2C00-\uD801\uD804-\uD839\uD83C-\uDBFF\uF900-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF";goog.i18n.bidi.rtlChars_="\u0591-\u06EF\u06FA-\u08FF\u200F\uD802-\uD803\uD83A-\uD83B\uFB1D-\uFDFF\uFE70-\uFEFC";goog.i18n.bidi.htmlSkipReg_=/<[^>]*>|&[^;]+;/g;goog.i18n.bidi.stripHtmlIfNeeded_=function(o,t){return t?o.replace(goog.i18n.bidi.htmlSkipReg_,""):o};goog.i18n.bidi.rtlCharReg_=new RegExp("["+goog.i18n.bidi.rtlChars_+"]");goog.i18n.bidi.ltrCharReg_=new RegExp("["+goog.i18n.bidi.ltrChars_+"]");goog.i18n.bidi.hasAnyRtl=function(o,t){return goog.i18n.bidi.rtlCharReg_.test(goog.i18n.bidi.stripHtmlIfNeeded_(o,t))};goog.i18n.bidi.hasRtlChar=goog.i18n.bidi.hasAnyRtl;goog.i18n.bidi.hasAnyLtr=function(o,t){return goog.i18n.bidi.ltrCharReg_.test(goog.i18n.bidi.stripHtmlIfNeeded_(o,t))};goog.i18n.bidi.ltrRe_=new RegExp("^["+goog.i18n.bidi.ltrChars_+"]");goog.i18n.bidi.rtlRe_=new RegExp("^["+goog.i18n.bidi.rtlChars_+"]");goog.i18n.bidi.isRtlChar=function(o){return goog.i18n.bidi.rtlRe_.test(o)};goog.i18n.bidi.isLtrChar=function(o){return goog.i18n.bidi.ltrRe_.test(o)};goog.i18n.bidi.isNeutralChar=function(o){return!goog.i18n.bidi.isLtrChar(o)&&!goog.i18n.bidi.isRtlChar(o)};goog.i18n.bidi.ltrDirCheckRe_=new RegExp("^[^"+goog.i18n.bidi.rtlChars_+"]*["+goog.i18n.bidi.ltrChars_+"]");goog.i18n.bidi.rtlDirCheckRe_=new RegExp("^[^"+goog.i18n.bidi.ltrChars_+"]*["+goog.i18n.bidi.rtlChars_+"]");goog.i18n.bidi.startsWithRtl=function(o,t){return goog.i18n.bidi.rtlDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(o,t))};goog.i18n.bidi.isRtlText=goog.i18n.bidi.startsWithRtl;goog.i18n.bidi.startsWithLtr=function(o,t){return goog.i18n.bidi.ltrDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(o,t))};goog.i18n.bidi.isLtrText=goog.i18n.bidi.startsWithLtr;goog.i18n.bidi.isRequiredLtrRe_=/^http:\/\/.*/;goog.i18n.bidi.isNeutralText=function(o,t){return o=goog.i18n.bidi.stripHtmlIfNeeded_(o,t),goog.i18n.bidi.isRequiredLtrRe_.test(o)||!goog.i18n.bidi.hasAnyLtr(o)&&!goog.i18n.bidi.hasAnyRtl(o)};goog.i18n.bidi.ltrExitDirCheckRe_=new RegExp("["+goog.i18n.bidi.ltrChars_+"][^"+goog.i18n.bidi.rtlChars_+"]*$");goog.i18n.bidi.rtlExitDirCheckRe_=new RegExp("["+goog.i18n.bidi.rtlChars_+"][^"+goog.i18n.bidi.ltrChars_+"]*$");goog.i18n.bidi.endsWithLtr=function(o,t){return goog.i18n.bidi.ltrExitDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(o,t))};goog.i18n.bidi.isLtrExitText=goog.i18n.bidi.endsWithLtr;goog.i18n.bidi.endsWithRtl=function(o,t){return goog.i18n.bidi.rtlExitDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(o,t))};goog.i18n.bidi.isRtlExitText=goog.i18n.bidi.endsWithRtl;goog.i18n.bidi.rtlLocalesRe_=/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;goog.i18n.bidi.isRtlLanguage=function(o){return goog.i18n.bidi.rtlLocalesRe_.test(o)};goog.i18n.bidi.bracketGuardTextRe_=/(\(.*?\)+)|(\[.*?\]+)|(\{.*?\}+)|(<.*?>+)/g;goog.i18n.bidi.guardBracketInText=function(o,t){return t=(t===void 0?goog.i18n.bidi.hasAnyRtl(o):t)?goog.i18n.bidi.Format.RLM:goog.i18n.bidi.Format.LRM,o.replace(goog.i18n.bidi.bracketGuardTextRe_,t+"$&"+t)};goog.i18n.bidi.enforceRtlInHtml=function(o){return o.charAt(0)=="<"?o.replace(/<\w+/,"$& dir=rtl"):`
|
|
12
12
|
<span dir=rtl>`+o+"</span>"};goog.i18n.bidi.enforceRtlInText=function(o){return goog.i18n.bidi.Format.RLE+o+goog.i18n.bidi.Format.PDF};goog.i18n.bidi.enforceLtrInHtml=function(o){return o.charAt(0)=="<"?o.replace(/<\w+/,"$& dir=ltr"):`
|
|
13
13
|
<span dir=ltr>`+o+"</span>"};goog.i18n.bidi.enforceLtrInText=function(o){return goog.i18n.bidi.Format.LRE+o+goog.i18n.bidi.Format.PDF};goog.i18n.bidi.dimensionsRe_=/:\s*([.\d][.\w]*)\s+([.\d][.\w]*)\s+([.\d][.\w]*)\s+([.\d][.\w]*)/g;goog.i18n.bidi.leftRe_=/left/gi;goog.i18n.bidi.rightRe_=/right/gi;goog.i18n.bidi.tempRe_=/%%%%/g;goog.i18n.bidi.mirrorCSS=function(o){return o.replace(goog.i18n.bidi.dimensionsRe_,":$1 $4 $3 $2").replace(goog.i18n.bidi.leftRe_,"%%%%").replace(goog.i18n.bidi.rightRe_,goog.i18n.bidi.LEFT).replace(goog.i18n.bidi.tempRe_,goog.i18n.bidi.RIGHT)};goog.i18n.bidi.doubleQuoteSubstituteRe_=/([\u0591-\u05f2])"/g;goog.i18n.bidi.singleQuoteSubstituteRe_=/([\u0591-\u05f2])'/g;goog.i18n.bidi.normalizeHebrewQuote=function(o){return o.replace(goog.i18n.bidi.doubleQuoteSubstituteRe_,"$1\u05F4").replace(goog.i18n.bidi.singleQuoteSubstituteRe_,"$1\u05F3")};goog.i18n.bidi.wordSeparatorRe_=/\s+/;goog.i18n.bidi.hasNumeralsRe_=/[\d\u06f0-\u06f9]/;goog.i18n.bidi.rtlDetectionThreshold_=.4;goog.i18n.bidi.estimateDirection=function(o,t){var r=0,i=0,n=!1;for(o=goog.i18n.bidi.stripHtmlIfNeeded_(o,t).split(goog.i18n.bidi.wordSeparatorRe_),t=0;t<o.length;t++){var s=o[t];goog.i18n.bidi.startsWithRtl(s)?(r++,i++):goog.i18n.bidi.isRequiredLtrRe_.test(s)?n=!0:goog.i18n.bidi.hasAnyLtr(s)?i++:goog.i18n.bidi.hasNumeralsRe_.test(s)&&(n=!0)}return i==0?n?goog.i18n.bidi.Dir.LTR:goog.i18n.bidi.Dir.NEUTRAL:r/i>goog.i18n.bidi.rtlDetectionThreshold_?goog.i18n.bidi.Dir.RTL:goog.i18n.bidi.Dir.LTR};goog.i18n.bidi.detectRtlDirectionality=function(o,t){return goog.i18n.bidi.estimateDirection(o,t)==goog.i18n.bidi.Dir.RTL};goog.i18n.bidi.setElementDirAndAlign=function(o,t){o&&(t=goog.i18n.bidi.toDir(t))&&(o.style.textAlign=t==goog.i18n.bidi.Dir.RTL?goog.i18n.bidi.RIGHT:goog.i18n.bidi.LEFT,o.dir=t==goog.i18n.bidi.Dir.RTL?"rtl":"ltr")};goog.i18n.bidi.setElementDirByTextDirectionality=function(o,t){switch(goog.i18n.bidi.estimateDirection(t)){case goog.i18n.bidi.Dir.LTR:o.dir="ltr";break;case goog.i18n.bidi.Dir.RTL:o.dir="rtl";break;default:o.removeAttribute("dir")}};goog.i18n.bidi.DirectionalString=function(){};goog.html.TrustedResourceUrl=function(){this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_="",this.trustedURL_=null,this.TRUSTED_RESOURCE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_};goog.html.TrustedResourceUrl.prototype.implementsGoogStringTypedString=!0;goog.html.TrustedResourceUrl.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_.toString()};goog.html.TrustedResourceUrl.prototype.implementsGoogI18nBidiDirectionalString=!0;goog.html.TrustedResourceUrl.prototype.getDirection=function(){return goog.i18n.bidi.Dir.LTR};goog.html.TrustedResourceUrl.prototype.cloneWithParams=function(o,t){var r=goog.html.TrustedResourceUrl.unwrap(this);r=goog.html.TrustedResourceUrl.URL_PARAM_PARSER_.exec(r);var i=r[3]||"";return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(r[1]+goog.html.TrustedResourceUrl.stringifyParams_("?",r[2]||"",o)+goog.html.TrustedResourceUrl.stringifyParams_("#",i,t))};goog.DEBUG&&(goog.html.TrustedResourceUrl.prototype.toString=function(){return"TrustedResourceUrl{"+this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_+"}"});goog.html.TrustedResourceUrl.unwrap=function(o){return goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(o).toString()};goog.html.TrustedResourceUrl.unwrapTrustedScriptURL=function(o){return o instanceof goog.html.TrustedResourceUrl&&o.constructor===goog.html.TrustedResourceUrl&&o.TRUSTED_RESOURCE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?o.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_:(goog.asserts.fail("expected object of type TrustedResourceUrl, got '"+o+"' of type "+goog.typeOf(o)),"type_error:TrustedResourceUrl")};goog.html.TrustedResourceUrl.unwrapTrustedURL=function(o){return o.trustedURL_?o.trustedURL_:goog.html.TrustedResourceUrl.unwrap(o)};goog.html.TrustedResourceUrl.format=function(o,t){var r=goog.string.Const.unwrap(o);if(!goog.html.TrustedResourceUrl.BASE_URL_.test(r))throw Error("Invalid TrustedResourceUrl format: "+r);return o=r.replace(goog.html.TrustedResourceUrl.FORMAT_MARKER_,function(i,n){if(!Object.prototype.hasOwnProperty.call(t,n))throw Error('Found marker, "'+n+'", in format string, "'+r+'", but no valid label mapping found in args: '+JSON.stringify(t));return i=t[n],i instanceof goog.string.Const?goog.string.Const.unwrap(i):encodeURIComponent(String(i))}),goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(o)};goog.html.TrustedResourceUrl.FORMAT_MARKER_=/%{(\w+)}/g;goog.html.TrustedResourceUrl.BASE_URL_=/^((https:)?\/\/[0-9a-z.:[\]-]+\/|\/[^/\\]|[^:/\\%]+\/|[^:/\\%]*[?#]|about:blank#)/i;goog.html.TrustedResourceUrl.URL_PARAM_PARSER_=/^([^?#]*)(\?[^#]*)?(#[\s\S]*)?/;goog.html.TrustedResourceUrl.formatWithParams=function(o,t,r,i){return goog.html.TrustedResourceUrl.format(o,t).cloneWithParams(r,i)};goog.html.TrustedResourceUrl.fromConstant=function(o){return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(goog.string.Const.unwrap(o))};goog.html.TrustedResourceUrl.fromConstants=function(o){for(var t="",r=0;r<o.length;r++)t+=goog.string.Const.unwrap(o[r]);return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(t)};goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={};goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse=function(o){var t=new goog.html.TrustedResourceUrl;return t.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createScriptURL(o):o,goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY&&(t.trustedURL_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createURL(o)),t};goog.html.TrustedResourceUrl.stringifyParams_=function(o,t,r){if(r==null)return t;if(goog.isString(r))return r?o+encodeURIComponent(r):"";for(var i in r){var n=r[i];n=goog.isArray(n)?n:[n];for(var s=0;s<n.length;s++){var l=n[s];l!=null&&(t||(t=o),t+=(t.length>o.length?"&":"")+encodeURIComponent(i)+"="+encodeURIComponent(String(l)))}}return t};goog.html.SafeUrl=function(){this.privateDoNotAccessOrElseSafeUrlWrappedValue_="",this.SAFE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_};goog.html.SafeUrl.INNOCUOUS_STRING="about:invalid#zClosurez";goog.html.SafeUrl.prototype.implementsGoogStringTypedString=!0;goog.html.SafeUrl.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeUrlWrappedValue_.toString()};goog.html.SafeUrl.prototype.implementsGoogI18nBidiDirectionalString=!0;goog.html.SafeUrl.prototype.getDirection=function(){return goog.i18n.bidi.Dir.LTR};goog.DEBUG&&(goog.html.SafeUrl.prototype.toString=function(){return"SafeUrl{"+this.privateDoNotAccessOrElseSafeUrlWrappedValue_+"}"});goog.html.SafeUrl.unwrap=function(o){return goog.html.SafeUrl.unwrapTrustedURL(o).toString()};goog.html.SafeUrl.unwrapTrustedURL=function(o){return o instanceof goog.html.SafeUrl&&o.constructor===goog.html.SafeUrl&&o.SAFE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?o.privateDoNotAccessOrElseSafeUrlWrappedValue_:(goog.asserts.fail("expected object of type SafeUrl, got '"+o+"' of type "+goog.typeOf(o)),"type_error:SafeUrl")};goog.html.SafeUrl.fromConstant=function(o){return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(goog.string.Const.unwrap(o))};goog.html.SAFE_MIME_TYPE_PATTERN_=/^(?:audio\/(?:3gpp2|3gpp|aac|L16|midi|mp3|mp4|mpeg|oga|ogg|opus|x-m4a|x-wav|wav|webm)|image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp|x-icon)|text\/csv|video\/(?:mpeg|mp4|ogg|webm|quicktime))(?:;\w+=(?:\w+|"[\w;=]+"))*$/i;goog.html.SafeUrl.isSafeMimeType=function(o){return goog.html.SAFE_MIME_TYPE_PATTERN_.test(o)};goog.html.SafeUrl.fromBlob=function(o){return o=goog.html.SAFE_MIME_TYPE_PATTERN_.test(o.type)?goog.fs.url.createObjectUrl(o):goog.html.SafeUrl.INNOCUOUS_STRING,goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(o)};goog.html.DATA_URL_PATTERN_=/^data:([^,]*);base64,[a-z0-9+\/]+=*$/i;goog.html.SafeUrl.fromDataUrl=function(o){o=o.replace(/(%0A|%0D)/g,"");var t=o.match(goog.html.DATA_URL_PATTERN_);return t=t&&goog.html.SAFE_MIME_TYPE_PATTERN_.test(t[1]),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(t?o:goog.html.SafeUrl.INNOCUOUS_STRING)};goog.html.SafeUrl.fromTelUrl=function(o){return goog.string.internal.caseInsensitiveStartsWith(o,"tel:")||(o=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(o)};goog.html.SIP_URL_PATTERN_=/^sip[s]?:[+a-z0-9_.!$%&'*\/=^`{|}~-]+@([a-z0-9-]+\.)+[a-z0-9]{2,63}$/i;goog.html.SafeUrl.fromSipUrl=function(o){return goog.html.SIP_URL_PATTERN_.test(decodeURIComponent(o))||(o=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(o)};goog.html.SafeUrl.fromFacebookMessengerUrl=function(o){return goog.string.internal.caseInsensitiveStartsWith(o,"fb-messenger://share")||(o=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(o)};goog.html.SafeUrl.fromWhatsAppUrl=function(o){return goog.string.internal.caseInsensitiveStartsWith(o,"whatsapp://send")||(o=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(o)};goog.html.SafeUrl.fromSmsUrl=function(o){return goog.string.internal.caseInsensitiveStartsWith(o,"sms:")&&goog.html.SafeUrl.isSmsUrlBodyValid_(o)||(o=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(o)};goog.html.SafeUrl.isSmsUrlBodyValid_=function(o){var t=o.indexOf("#");if(0<t&&(o=o.substring(0,t)),t=o.match(/[?&]body=/gi),!t)return!0;if(1<t.length)return!1;if(o=o.match(/[?&]body=([^&]*)/)[1],!o)return!0;try{decodeURIComponent(o)}catch{return!1}return/^(?:[a-z0-9\-_.~]|%[0-9a-f]{2})+$/i.test(o)};goog.html.SafeUrl.fromSshUrl=function(o){return goog.string.internal.caseInsensitiveStartsWith(o,"ssh://")||(o=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(o)};goog.html.SafeUrl.sanitizeChromeExtensionUrl=function(o,t){return goog.html.SafeUrl.sanitizeExtensionUrl_(/^chrome-extension:\/\/([^\/]+)\//,o,t)};goog.html.SafeUrl.sanitizeFirefoxExtensionUrl=function(o,t){return goog.html.SafeUrl.sanitizeExtensionUrl_(/^moz-extension:\/\/([^\/]+)\//,o,t)};goog.html.SafeUrl.sanitizeEdgeExtensionUrl=function(o,t){return goog.html.SafeUrl.sanitizeExtensionUrl_(/^ms-browser-extension:\/\/([^\/]+)\//,o,t)};goog.html.SafeUrl.sanitizeExtensionUrl_=function(o,t,r){return(o=o.exec(t))?(o=o[1],(r instanceof goog.string.Const?[goog.string.Const.unwrap(r)]:r.map(function(i){return goog.string.Const.unwrap(i)})).indexOf(o)==-1&&(t=goog.html.SafeUrl.INNOCUOUS_STRING)):t=goog.html.SafeUrl.INNOCUOUS_STRING,goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(t)};goog.html.SafeUrl.fromTrustedResourceUrl=function(o){return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(goog.html.TrustedResourceUrl.unwrap(o))};goog.html.SAFE_URL_PATTERN_=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;goog.html.SafeUrl.SAFE_URL_PATTERN=goog.html.SAFE_URL_PATTERN_;goog.html.SafeUrl.sanitize=function(o){return o instanceof goog.html.SafeUrl?o:(o=typeof o=="object"&&o.implementsGoogStringTypedString?o.getTypedStringValue():String(o),goog.html.SAFE_URL_PATTERN_.test(o)||(o=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(o))};goog.html.SafeUrl.sanitizeAssertUnchanged=function(o,t){return o instanceof goog.html.SafeUrl?o:(o=typeof o=="object"&&o.implementsGoogStringTypedString?o.getTypedStringValue():String(o),t&&/^data:/i.test(o)&&(t=goog.html.SafeUrl.fromDataUrl(o),t.getTypedStringValue()==o)?t:(goog.asserts.assert(goog.html.SAFE_URL_PATTERN_.test(o),"%s does not match the safe URL pattern",o)||(o=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(o)))};goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={};goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse=function(o){var t=new goog.html.SafeUrl;return t.privateDoNotAccessOrElseSafeUrlWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createURL(o):o,t};goog.html.SafeUrl.ABOUT_BLANK=goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse("about:blank");goog.html.SafeStyle=function(){this.privateDoNotAccessOrElseSafeStyleWrappedValue_="",this.SAFE_STYLE_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_};goog.html.SafeStyle.prototype.implementsGoogStringTypedString=!0;goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={};goog.html.SafeStyle.fromConstant=function(o){return o=goog.string.Const.unwrap(o),o.length===0?goog.html.SafeStyle.EMPTY:(goog.asserts.assert(goog.string.internal.endsWith(o,";"),"Last character of style string is not ';': "+o),goog.asserts.assert(goog.string.internal.contains(o,":"),`Style string must contain at least one ':', to specify a "name: value" pair: `+o),goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(o))};goog.html.SafeStyle.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeStyleWrappedValue_};goog.DEBUG&&(goog.html.SafeStyle.prototype.toString=function(){return"SafeStyle{"+this.privateDoNotAccessOrElseSafeStyleWrappedValue_+"}"});goog.html.SafeStyle.unwrap=function(o){return o instanceof goog.html.SafeStyle&&o.constructor===goog.html.SafeStyle&&o.SAFE_STYLE_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?o.privateDoNotAccessOrElseSafeStyleWrappedValue_:(goog.asserts.fail("expected object of type SafeStyle, got '"+o+"' of type "+goog.typeOf(o)),"type_error:SafeStyle")};goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse=function(o){return new goog.html.SafeStyle().initSecurityPrivateDoNotAccessOrElse_(o)};goog.html.SafeStyle.prototype.initSecurityPrivateDoNotAccessOrElse_=function(o){return this.privateDoNotAccessOrElseSafeStyleWrappedValue_=o,this};goog.html.SafeStyle.EMPTY=goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse("");goog.html.SafeStyle.INNOCUOUS_STRING="zClosurez";goog.html.SafeStyle.create=function(o){var t="",r;for(r in o){if(!/^[-_a-zA-Z0-9]+$/.test(r))throw Error("Name allows only [-_a-zA-Z0-9], got: "+r);var i=o[r];i!=null&&(i=goog.isArray(i)?goog.array.map(i,goog.html.SafeStyle.sanitizePropertyValue_).join(" "):goog.html.SafeStyle.sanitizePropertyValue_(i),t+=r+":"+i+";")}return t?goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(t):goog.html.SafeStyle.EMPTY};goog.html.SafeStyle.sanitizePropertyValue_=function(o){if(o instanceof goog.html.SafeUrl)return'url("'+goog.html.SafeUrl.unwrap(o).replace(/</g,"%3c").replace(/[\\"]/g,"\\$&")+'")';if(o=o instanceof goog.string.Const?goog.string.Const.unwrap(o):goog.html.SafeStyle.sanitizePropertyValueString_(String(o)),/[{;}]/.test(o))throw new goog.asserts.AssertionError("Value does not allow [{;}], got: %s.",[o]);return o};goog.html.SafeStyle.sanitizePropertyValueString_=function(o){var t=o.replace(goog.html.SafeStyle.FUNCTIONS_RE_,"$1").replace(goog.html.SafeStyle.FUNCTIONS_RE_,"$1").replace(goog.html.SafeStyle.URL_RE_,"url");if(goog.html.SafeStyle.VALUE_RE_.test(t)){if(goog.html.SafeStyle.COMMENT_RE_.test(o))return goog.asserts.fail("String value disallows comments, got: "+o),goog.html.SafeStyle.INNOCUOUS_STRING;if(!goog.html.SafeStyle.hasBalancedQuotes_(o))return goog.asserts.fail("String value requires balanced quotes, got: "+o),goog.html.SafeStyle.INNOCUOUS_STRING;if(!goog.html.SafeStyle.hasBalancedSquareBrackets_(o))return goog.asserts.fail("String value requires balanced square brackets and one identifier per pair of brackets, got: "+o),goog.html.SafeStyle.INNOCUOUS_STRING}else return goog.asserts.fail("String value allows only "+goog.html.SafeStyle.VALUE_ALLOWED_CHARS_+" and simple functions, got: "+o),goog.html.SafeStyle.INNOCUOUS_STRING;return goog.html.SafeStyle.sanitizeUrl_(o)};goog.html.SafeStyle.hasBalancedQuotes_=function(o){for(var t=!0,r=!0,i=0;i<o.length;i++){var n=o.charAt(i);n=="'"&&r?t=!t:n=='"'&&t&&(r=!r)}return t&&r};goog.html.SafeStyle.hasBalancedSquareBrackets_=function(o){for(var t=!0,r=/^[-_a-zA-Z0-9]$/,i=0;i<o.length;i++){var n=o.charAt(i);if(n=="]"){if(t)return!1;t=!0}else if(n=="["){if(!t)return!1;t=!1}else if(!t&&!r.test(n))return!1}return t};goog.html.SafeStyle.VALUE_ALLOWED_CHARS_=`[-,."'%_!# a-zA-Z0-9\\[\\]]`;goog.html.SafeStyle.VALUE_RE_=new RegExp("^"+goog.html.SafeStyle.VALUE_ALLOWED_CHARS_+"+$");goog.html.SafeStyle.URL_RE_=/\b(url\([ \t\n]*)('[ -&(-\[\]-~]*'|"[ !#-\[\]-~]*"|[!#-&*-\[\]-~]*)([ \t\n]*\))/g;goog.html.SafeStyle.FUNCTIONS_RE_=/\b(hsl|hsla|rgb|rgba|matrix|calc|minmax|fit-content|repeat|(rotate|scale|translate)(X|Y|Z|3d)?)\([-+*/0-9a-z.%\[\], ]+\)/g;goog.html.SafeStyle.COMMENT_RE_=/\/\*/;goog.html.SafeStyle.sanitizeUrl_=function(o){return o.replace(goog.html.SafeStyle.URL_RE_,function(t,r,i,n){var s="";return i=i.replace(/^(['"])(.*)\1$/,function(l,g,p){return s=g,p}),t=goog.html.SafeUrl.sanitize(i).getTypedStringValue(),r+s+t+s+n})};goog.html.SafeStyle.concat=function(o){var t="",r=function(i){goog.isArray(i)?goog.array.forEach(i,r):t+=goog.html.SafeStyle.unwrap(i)};return goog.array.forEach(arguments,r),t?goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(t):goog.html.SafeStyle.EMPTY};goog.html.SafeScript=function(){this.privateDoNotAccessOrElseSafeScriptWrappedValue_="",this.SAFE_SCRIPT_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_};goog.html.SafeScript.prototype.implementsGoogStringTypedString=!0;goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={};goog.html.SafeScript.fromConstant=function(o){return o=goog.string.Const.unwrap(o),o.length===0?goog.html.SafeScript.EMPTY:goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(o)};goog.html.SafeScript.fromConstantAndArgs=function(o,t){for(var r=[],i=1;i<arguments.length;i++)r.push(goog.html.SafeScript.stringify_(arguments[i]));return goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse("("+goog.string.Const.unwrap(o)+")("+r.join(", ")+");")};goog.html.SafeScript.fromJson=function(o){return goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(goog.html.SafeScript.stringify_(o))};goog.html.SafeScript.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeScriptWrappedValue_.toString()};goog.DEBUG&&(goog.html.SafeScript.prototype.toString=function(){return"SafeScript{"+this.privateDoNotAccessOrElseSafeScriptWrappedValue_+"}"});goog.html.SafeScript.unwrap=function(o){return goog.html.SafeScript.unwrapTrustedScript(o).toString()};goog.html.SafeScript.unwrapTrustedScript=function(o){return o instanceof goog.html.SafeScript&&o.constructor===goog.html.SafeScript&&o.SAFE_SCRIPT_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?o.privateDoNotAccessOrElseSafeScriptWrappedValue_:(goog.asserts.fail("expected object of type SafeScript, got '"+o+"' of type "+goog.typeOf(o)),"type_error:SafeScript")};goog.html.SafeScript.stringify_=function(o){return JSON.stringify(o).replace(/</g,"\\x3c")};goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse=function(o){return new goog.html.SafeScript().initSecurityPrivateDoNotAccessOrElse_(o)};goog.html.SafeScript.prototype.initSecurityPrivateDoNotAccessOrElse_=function(o){return this.privateDoNotAccessOrElseSafeScriptWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createScript(o):o,this};goog.html.SafeScript.EMPTY=goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse("");goog.object={};goog.object.is=function(o,t){return o===t?o!==0||1/o===1/t:o!==o&&t!==t};goog.object.forEach=function(o,t,r){for(var i in o)t.call(r,o[i],i,o)};goog.object.filter=function(o,t,r){var i={},n;for(n in o)t.call(r,o[n],n,o)&&(i[n]=o[n]);return i};goog.object.map=function(o,t,r){var i={},n;for(n in o)i[n]=t.call(r,o[n],n,o);return i};goog.object.some=function(o,t,r){for(var i in o)if(t.call(r,o[i],i,o))return!0;return!1};goog.object.every=function(o,t,r){for(var i in o)if(!t.call(r,o[i],i,o))return!1;return!0};goog.object.getCount=function(o){var t=0,r;for(r in o)t++;return t};goog.object.getAnyKey=function(o){for(var t in o)return t};goog.object.getAnyValue=function(o){for(var t in o)return o[t]};goog.object.contains=function(o,t){return goog.object.containsValue(o,t)};goog.object.getValues=function(o){var t=[],r=0,i;for(i in o)t[r++]=o[i];return t};goog.object.getKeys=function(o){var t=[],r=0,i;for(i in o)t[r++]=i;return t};goog.object.getValueByKeys=function(o,t){var r=goog.isArrayLike(t),i=r?t:arguments;for(r=r?0:1;r<i.length;r++){if(o==null)return;o=o[i[r]]}return o};goog.object.containsKey=function(o,t){return o!==null&&t in o};goog.object.containsValue=function(o,t){for(var r in o)if(o[r]==t)return!0;return!1};goog.object.findKey=function(o,t,r){for(var i in o)if(t.call(r,o[i],i,o))return i};goog.object.findValue=function(o,t,r){return(t=goog.object.findKey(o,t,r))&&o[t]};goog.object.isEmpty=function(o){for(var t in o)return!1;return!0};goog.object.clear=function(o){for(var t in o)delete o[t]};goog.object.remove=function(o,t){var r;return(r=t in o)&&delete o[t],r};goog.object.add=function(o,t,r){if(o!==null&&t in o)throw Error('The object already contains the key "'+t+'"');goog.object.set(o,t,r)};goog.object.get=function(o,t,r){return o!==null&&t in o?o[t]:r};goog.object.set=function(o,t,r){o[t]=r};goog.object.setIfUndefined=function(o,t,r){return t in o?o[t]:o[t]=r};goog.object.setWithReturnValueIfNotSet=function(o,t,r){return t in o?o[t]:(r=r(),o[t]=r)};goog.object.equals=function(o,t){for(var r in o)if(!(r in t)||o[r]!==t[r])return!1;for(var i in t)if(!(i in o))return!1;return!0};goog.object.clone=function(o){var t={},r;for(r in o)t[r]=o[r];return t};goog.object.unsafeClone=function(o){var t=goog.typeOf(o);if(t=="object"||t=="array"){if(goog.isFunction(o.clone))return o.clone();t=t=="array"?[]:{};for(var r in o)t[r]=goog.object.unsafeClone(o[r]);return t}return o};goog.object.transpose=function(o){var t={},r;for(r in o)t[o[r]]=r;return t};goog.object.PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");goog.object.extend=function(o,t){for(var r,i,n=1;n<arguments.length;n++){i=arguments[n];for(r in i)o[r]=i[r];for(var s=0;s<goog.object.PROTOTYPE_FIELDS_.length;s++)r=goog.object.PROTOTYPE_FIELDS_[s],Object.prototype.hasOwnProperty.call(i,r)&&(o[r]=i[r])}};goog.object.create=function(o){var t=arguments.length;if(t==1&&goog.isArray(arguments[0]))return goog.object.create.apply(null,arguments[0]);if(t%2)throw Error("Uneven number of arguments");for(var r={},i=0;i<t;i+=2)r[arguments[i]]=arguments[i+1];return r};goog.object.createSet=function(o){var t=arguments.length;if(t==1&&goog.isArray(arguments[0]))return goog.object.createSet.apply(null,arguments[0]);for(var r={},i=0;i<t;i++)r[arguments[i]]=!0;return r};goog.object.createImmutableView=function(o){var t=o;return Object.isFrozen&&!Object.isFrozen(o)&&(t=Object.create(o),Object.freeze(t)),t};goog.object.isImmutableView=function(o){return!!Object.isFrozen&&Object.isFrozen(o)};goog.object.getAllPropertyNames=function(o,t,r){if(!o)return[];if(!Object.getOwnPropertyNames||!Object.getPrototypeOf)return goog.object.getKeys(o);for(var i={};o&&(o!==Object.prototype||t)&&(o!==Function.prototype||r);){for(var n=Object.getOwnPropertyNames(o),s=0;s<n.length;s++)i[n[s]]=!0;o=Object.getPrototypeOf(o)}return goog.object.getKeys(i)};goog.object.getSuperClass=function(o){return(o=Object.getPrototypeOf(o.prototype))&&o.constructor};goog.html.SafeStyleSheet=function(){this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_="",this.SAFE_STYLE_SHEET_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_};goog.html.SafeStyleSheet.prototype.implementsGoogStringTypedString=!0;goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={};goog.html.SafeStyleSheet.createRule=function(o,t){if(goog.string.internal.contains(o,"<"))throw Error("Selector does not allow '<', got: "+o);var r=o.replace(/('|")((?!\1)[^\r\n\f\\]|\\[\s\S])*\1/g,"");if(!/^[-_a-zA-Z0-9#.:* ,>+~[\]()=^$|]+$/.test(r))throw Error("Selector allows only [-_a-zA-Z0-9#.:* ,>+~[\\]()=^$|] and strings, got: "+o);if(!goog.html.SafeStyleSheet.hasBalancedBrackets_(r))throw Error("() and [] in selector must be balanced, got: "+o);return t instanceof goog.html.SafeStyle||(t=goog.html.SafeStyle.create(t)),o=o+"{"+goog.html.SafeStyle.unwrap(t).replace(/</g,"\\3C ")+"}",goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(o)};goog.html.SafeStyleSheet.hasBalancedBrackets_=function(o){for(var t={"(":")","[":"]"},r=[],i=0;i<o.length;i++){var n=o[i];if(t[n])r.push(t[n]);else if(goog.object.contains(t,n)&&r.pop()!=n)return!1}return r.length==0};goog.html.SafeStyleSheet.concat=function(o){var t="",r=function(i){goog.isArray(i)?goog.array.forEach(i,r):t+=goog.html.SafeStyleSheet.unwrap(i)};return goog.array.forEach(arguments,r),goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(t)};goog.html.SafeStyleSheet.fromConstant=function(o){return o=goog.string.Const.unwrap(o),o.length===0?goog.html.SafeStyleSheet.EMPTY:(goog.asserts.assert(!goog.string.internal.contains(o,"<"),"Forbidden '<' character in style sheet string: "+o),goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(o))};goog.html.SafeStyleSheet.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_};goog.DEBUG&&(goog.html.SafeStyleSheet.prototype.toString=function(){return"SafeStyleSheet{"+this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_+"}"});goog.html.SafeStyleSheet.unwrap=function(o){return o instanceof goog.html.SafeStyleSheet&&o.constructor===goog.html.SafeStyleSheet&&o.SAFE_STYLE_SHEET_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?o.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_:(goog.asserts.fail("expected object of type SafeStyleSheet, got '"+o+"' of type "+goog.typeOf(o)),"type_error:SafeStyleSheet")};goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse=function(o){return new goog.html.SafeStyleSheet().initSecurityPrivateDoNotAccessOrElse_(o)};goog.html.SafeStyleSheet.prototype.initSecurityPrivateDoNotAccessOrElse_=function(o){return this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_=o,this};goog.html.SafeStyleSheet.EMPTY=goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse("");goog.dom.tags={};goog.dom.tags.VOID_TAGS_={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};goog.dom.tags.isVoidTag=function(o){return goog.dom.tags.VOID_TAGS_[o]===!0};goog.dom.HtmlElement=function(){};goog.dom.TagName=function(o){this.tagName_=o};goog.dom.TagName.prototype.toString=function(){return this.tagName_};goog.dom.TagName.A=new goog.dom.TagName("A");goog.dom.TagName.ABBR=new goog.dom.TagName("ABBR");goog.dom.TagName.ACRONYM=new goog.dom.TagName("ACRONYM");goog.dom.TagName.ADDRESS=new goog.dom.TagName("ADDRESS");goog.dom.TagName.APPLET=new goog.dom.TagName("APPLET");goog.dom.TagName.AREA=new goog.dom.TagName("AREA");goog.dom.TagName.ARTICLE=new goog.dom.TagName("ARTICLE");goog.dom.TagName.ASIDE=new goog.dom.TagName("ASIDE");goog.dom.TagName.AUDIO=new goog.dom.TagName("AUDIO");goog.dom.TagName.B=new goog.dom.TagName("B");goog.dom.TagName.BASE=new goog.dom.TagName("BASE");goog.dom.TagName.BASEFONT=new goog.dom.TagName("BASEFONT");goog.dom.TagName.BDI=new goog.dom.TagName("BDI");goog.dom.TagName.BDO=new goog.dom.TagName("BDO");goog.dom.TagName.BIG=new goog.dom.TagName("BIG");goog.dom.TagName.BLOCKQUOTE=new goog.dom.TagName("BLOCKQUOTE");goog.dom.TagName.BODY=new goog.dom.TagName("BODY");goog.dom.TagName.BR=new goog.dom.TagName("BR");goog.dom.TagName.BUTTON=new goog.dom.TagName("BUTTON");goog.dom.TagName.CANVAS=new goog.dom.TagName("CANVAS");goog.dom.TagName.CAPTION=new goog.dom.TagName("CAPTION");goog.dom.TagName.CENTER=new goog.dom.TagName("CENTER");goog.dom.TagName.CITE=new goog.dom.TagName("CITE");goog.dom.TagName.CODE=new goog.dom.TagName("CODE");goog.dom.TagName.COL=new goog.dom.TagName("COL");goog.dom.TagName.COLGROUP=new goog.dom.TagName("COLGROUP");goog.dom.TagName.COMMAND=new goog.dom.TagName("COMMAND");goog.dom.TagName.DATA=new goog.dom.TagName("DATA");goog.dom.TagName.DATALIST=new goog.dom.TagName("DATALIST");goog.dom.TagName.DD=new goog.dom.TagName("DD");goog.dom.TagName.DEL=new goog.dom.TagName("DEL");goog.dom.TagName.DETAILS=new goog.dom.TagName("DETAILS");goog.dom.TagName.DFN=new goog.dom.TagName("DFN");goog.dom.TagName.DIALOG=new goog.dom.TagName("DIALOG");goog.dom.TagName.DIR=new goog.dom.TagName("DIR");goog.dom.TagName.DIV=new goog.dom.TagName("DIV");goog.dom.TagName.DL=new goog.dom.TagName("DL");goog.dom.TagName.DT=new goog.dom.TagName("DT");goog.dom.TagName.EM=new goog.dom.TagName("EM");goog.dom.TagName.EMBED=new goog.dom.TagName("EMBED");goog.dom.TagName.FIELDSET=new goog.dom.TagName("FIELDSET");goog.dom.TagName.FIGCAPTION=new goog.dom.TagName("FIGCAPTION");goog.dom.TagName.FIGURE=new goog.dom.TagName("FIGURE");goog.dom.TagName.FONT=new goog.dom.TagName("FONT");goog.dom.TagName.FOOTER=new goog.dom.TagName("FOOTER");goog.dom.TagName.FORM=new goog.dom.TagName("FORM");goog.dom.TagName.FRAME=new goog.dom.TagName("FRAME");goog.dom.TagName.FRAMESET=new goog.dom.TagName("FRAMESET");goog.dom.TagName.H1=new goog.dom.TagName("H1");goog.dom.TagName.H2=new goog.dom.TagName("H2");goog.dom.TagName.H3=new goog.dom.TagName("H3");goog.dom.TagName.H4=new goog.dom.TagName("H4");goog.dom.TagName.H5=new goog.dom.TagName("H5");goog.dom.TagName.H6=new goog.dom.TagName("H6");goog.dom.TagName.HEAD=new goog.dom.TagName("HEAD");goog.dom.TagName.HEADER=new goog.dom.TagName("HEADER");goog.dom.TagName.HGROUP=new goog.dom.TagName("HGROUP");goog.dom.TagName.HR=new goog.dom.TagName("HR");goog.dom.TagName.HTML=new goog.dom.TagName("HTML");goog.dom.TagName.I=new goog.dom.TagName("I");goog.dom.TagName.IFRAME=new goog.dom.TagName("IFRAME");goog.dom.TagName.IMG=new goog.dom.TagName("IMG");goog.dom.TagName.INPUT=new goog.dom.TagName("INPUT");goog.dom.TagName.INS=new goog.dom.TagName("INS");goog.dom.TagName.ISINDEX=new goog.dom.TagName("ISINDEX");goog.dom.TagName.KBD=new goog.dom.TagName("KBD");goog.dom.TagName.KEYGEN=new goog.dom.TagName("KEYGEN");goog.dom.TagName.LABEL=new goog.dom.TagName("LABEL");goog.dom.TagName.LEGEND=new goog.dom.TagName("LEGEND");goog.dom.TagName.LI=new goog.dom.TagName("LI");goog.dom.TagName.LINK=new goog.dom.TagName("LINK");goog.dom.TagName.MAIN=new goog.dom.TagName("MAIN");goog.dom.TagName.MAP=new goog.dom.TagName("MAP");goog.dom.TagName.MARK=new goog.dom.TagName("MARK");goog.dom.TagName.MATH=new goog.dom.TagName("MATH");goog.dom.TagName.MENU=new goog.dom.TagName("MENU");goog.dom.TagName.MENUITEM=new goog.dom.TagName("MENUITEM");goog.dom.TagName.META=new goog.dom.TagName("META");goog.dom.TagName.METER=new goog.dom.TagName("METER");goog.dom.TagName.NAV=new goog.dom.TagName("NAV");goog.dom.TagName.NOFRAMES=new goog.dom.TagName("NOFRAMES");goog.dom.TagName.NOSCRIPT=new goog.dom.TagName("NOSCRIPT");goog.dom.TagName.OBJECT=new goog.dom.TagName("OBJECT");goog.dom.TagName.OL=new goog.dom.TagName("OL");goog.dom.TagName.OPTGROUP=new goog.dom.TagName("OPTGROUP");goog.dom.TagName.OPTION=new goog.dom.TagName("OPTION");goog.dom.TagName.OUTPUT=new goog.dom.TagName("OUTPUT");goog.dom.TagName.P=new goog.dom.TagName("P");goog.dom.TagName.PARAM=new goog.dom.TagName("PARAM");goog.dom.TagName.PICTURE=new goog.dom.TagName("PICTURE");goog.dom.TagName.PRE=new goog.dom.TagName("PRE");goog.dom.TagName.PROGRESS=new goog.dom.TagName("PROGRESS");goog.dom.TagName.Q=new goog.dom.TagName("Q");goog.dom.TagName.RP=new goog.dom.TagName("RP");goog.dom.TagName.RT=new goog.dom.TagName("RT");goog.dom.TagName.RTC=new goog.dom.TagName("RTC");goog.dom.TagName.RUBY=new goog.dom.TagName("RUBY");goog.dom.TagName.S=new goog.dom.TagName("S");goog.dom.TagName.SAMP=new goog.dom.TagName("SAMP");goog.dom.TagName.SCRIPT=new goog.dom.TagName("SCRIPT");goog.dom.TagName.SECTION=new goog.dom.TagName("SECTION");goog.dom.TagName.SELECT=new goog.dom.TagName("SELECT");goog.dom.TagName.SMALL=new goog.dom.TagName("SMALL");goog.dom.TagName.SOURCE=new goog.dom.TagName("SOURCE");goog.dom.TagName.SPAN=new goog.dom.TagName("SPAN");goog.dom.TagName.STRIKE=new goog.dom.TagName("STRIKE");goog.dom.TagName.STRONG=new goog.dom.TagName("STRONG");goog.dom.TagName.STYLE=new goog.dom.TagName("STYLE");goog.dom.TagName.SUB=new goog.dom.TagName("SUB");goog.dom.TagName.SUMMARY=new goog.dom.TagName("SUMMARY");goog.dom.TagName.SUP=new goog.dom.TagName("SUP");goog.dom.TagName.SVG=new goog.dom.TagName("SVG");goog.dom.TagName.TABLE=new goog.dom.TagName("TABLE");goog.dom.TagName.TBODY=new goog.dom.TagName("TBODY");goog.dom.TagName.TD=new goog.dom.TagName("TD");goog.dom.TagName.TEMPLATE=new goog.dom.TagName("TEMPLATE");goog.dom.TagName.TEXTAREA=new goog.dom.TagName("TEXTAREA");goog.dom.TagName.TFOOT=new goog.dom.TagName("TFOOT");goog.dom.TagName.TH=new goog.dom.TagName("TH");goog.dom.TagName.THEAD=new goog.dom.TagName("THEAD");goog.dom.TagName.TIME=new goog.dom.TagName("TIME");goog.dom.TagName.TITLE=new goog.dom.TagName("TITLE");goog.dom.TagName.TR=new goog.dom.TagName("TR");goog.dom.TagName.TRACK=new goog.dom.TagName("TRACK");goog.dom.TagName.TT=new goog.dom.TagName("TT");goog.dom.TagName.U=new goog.dom.TagName("U");goog.dom.TagName.UL=new goog.dom.TagName("UL");goog.dom.TagName.VAR=new goog.dom.TagName("VAR");goog.dom.TagName.VIDEO=new goog.dom.TagName("VIDEO");goog.dom.TagName.WBR=new goog.dom.TagName("WBR");goog.labs={};goog.labs.userAgent={};goog.labs.userAgent.util={};goog.labs.userAgent.util.getNativeUserAgentString_=function(){var o=goog.labs.userAgent.util.getNavigator_();return o&&(o=o.userAgent)?o:""};goog.labs.userAgent.util.getNavigator_=function(){return goog.global.navigator};goog.labs.userAgent.util.userAgent_=goog.labs.userAgent.util.getNativeUserAgentString_();goog.labs.userAgent.util.setUserAgent=function(o){goog.labs.userAgent.util.userAgent_=o||goog.labs.userAgent.util.getNativeUserAgentString_()};goog.labs.userAgent.util.getUserAgent=function(){return goog.labs.userAgent.util.userAgent_};goog.labs.userAgent.util.matchUserAgent=function(o){var t=goog.labs.userAgent.util.getUserAgent();return goog.string.internal.contains(t,o)};goog.labs.userAgent.util.matchUserAgentIgnoreCase=function(o){var t=goog.labs.userAgent.util.getUserAgent();return goog.string.internal.caseInsensitiveContains(t,o)};goog.labs.userAgent.util.extractVersionTuples=function(o){for(var t=/(\w[\w ]+)\/([^\s]+)\s*(?:\((.*?)\))?/g,r=[],i;i=t.exec(o);)r.push([i[1],i[2],i[3]||void 0]);return r};goog.labs.userAgent.browser={};goog.labs.userAgent.browser.matchOpera_=function(){return goog.labs.userAgent.util.matchUserAgent("Opera")};goog.labs.userAgent.browser.matchIE_=function(){return goog.labs.userAgent.util.matchUserAgent("Trident")||goog.labs.userAgent.util.matchUserAgent("MSIE")};goog.labs.userAgent.browser.matchEdgeHtml_=function(){return goog.labs.userAgent.util.matchUserAgent("Edge")};goog.labs.userAgent.browser.matchEdgeChromium_=function(){return goog.labs.userAgent.util.matchUserAgent("Edg/")};goog.labs.userAgent.browser.matchOperaChromium_=function(){return goog.labs.userAgent.util.matchUserAgent("OPR")};goog.labs.userAgent.browser.matchFirefox_=function(){return goog.labs.userAgent.util.matchUserAgent("Firefox")||goog.labs.userAgent.util.matchUserAgent("FxiOS")};goog.labs.userAgent.browser.matchSafari_=function(){return goog.labs.userAgent.util.matchUserAgent("Safari")&&!(goog.labs.userAgent.browser.matchChrome_()||goog.labs.userAgent.browser.matchCoast_()||goog.labs.userAgent.browser.matchOpera_()||goog.labs.userAgent.browser.matchEdgeHtml_()||goog.labs.userAgent.browser.matchEdgeChromium_()||goog.labs.userAgent.browser.matchOperaChromium_()||goog.labs.userAgent.browser.matchFirefox_()||goog.labs.userAgent.browser.isSilk()||goog.labs.userAgent.util.matchUserAgent("Android"))};goog.labs.userAgent.browser.matchCoast_=function(){return goog.labs.userAgent.util.matchUserAgent("Coast")};goog.labs.userAgent.browser.matchIosWebview_=function(){return(goog.labs.userAgent.util.matchUserAgent("iPad")||goog.labs.userAgent.util.matchUserAgent("iPhone"))&&!goog.labs.userAgent.browser.matchSafari_()&&!goog.labs.userAgent.browser.matchChrome_()&&!goog.labs.userAgent.browser.matchCoast_()&&!goog.labs.userAgent.browser.matchFirefox_()&&goog.labs.userAgent.util.matchUserAgent("AppleWebKit")};goog.labs.userAgent.browser.matchChrome_=function(){return(goog.labs.userAgent.util.matchUserAgent("Chrome")||goog.labs.userAgent.util.matchUserAgent("CriOS"))&&!goog.labs.userAgent.browser.matchEdgeHtml_()};goog.labs.userAgent.browser.matchAndroidBrowser_=function(){return goog.labs.userAgent.util.matchUserAgent("Android")&&!(goog.labs.userAgent.browser.isChrome()||goog.labs.userAgent.browser.isFirefox()||goog.labs.userAgent.browser.isOpera()||goog.labs.userAgent.browser.isSilk())};goog.labs.userAgent.browser.isOpera=goog.labs.userAgent.browser.matchOpera_;goog.labs.userAgent.browser.isIE=goog.labs.userAgent.browser.matchIE_;goog.labs.userAgent.browser.isEdge=goog.labs.userAgent.browser.matchEdgeHtml_;goog.labs.userAgent.browser.isEdgeChromium=goog.labs.userAgent.browser.matchEdgeChromium_;goog.labs.userAgent.browser.isOperaChromium=goog.labs.userAgent.browser.matchOperaChromium_;goog.labs.userAgent.browser.isFirefox=goog.labs.userAgent.browser.matchFirefox_;goog.labs.userAgent.browser.isSafari=goog.labs.userAgent.browser.matchSafari_;goog.labs.userAgent.browser.isCoast=goog.labs.userAgent.browser.matchCoast_;goog.labs.userAgent.browser.isIosWebview=goog.labs.userAgent.browser.matchIosWebview_;goog.labs.userAgent.browser.isChrome=goog.labs.userAgent.browser.matchChrome_;goog.labs.userAgent.browser.isAndroidBrowser=goog.labs.userAgent.browser.matchAndroidBrowser_;goog.labs.userAgent.browser.isSilk=function(){return goog.labs.userAgent.util.matchUserAgent("Silk")};goog.labs.userAgent.browser.getVersion=function(){function o(n){return n=goog.array.find(n,i),r[n]||""}var t=goog.labs.userAgent.util.getUserAgent();if(goog.labs.userAgent.browser.isIE())return goog.labs.userAgent.browser.getIEVersion_(t);t=goog.labs.userAgent.util.extractVersionTuples(t);var r={};goog.array.forEach(t,function(n){r[n[0]]=n[1]});var i=goog.partial(goog.object.containsKey,r);return goog.labs.userAgent.browser.isOpera()?o(["Version","Opera"]):goog.labs.userAgent.browser.isEdge()?o(["Edge"]):goog.labs.userAgent.browser.isEdgeChromium()?o(["Edg"]):goog.labs.userAgent.browser.isChrome()?o(["Chrome","CriOS"]):(t=t[2])&&t[1]||""};goog.labs.userAgent.browser.isVersionOrHigher=function(o){return 0<=goog.string.internal.compareVersions(goog.labs.userAgent.browser.getVersion(),o)};goog.labs.userAgent.browser.getIEVersion_=function(o){var t=/rv: *([\d\.]*)/.exec(o);if(t&&t[1])return t[1];t="";var r=/MSIE +([\d\.]+)/.exec(o);if(r&&r[1])if(o=/Trident\/(\d.\d)/.exec(o),r[1]=="7.0")if(o&&o[1])switch(o[1]){case"4.0":t="8.0";break;case"5.0":t="9.0";break;case"6.0":t="10.0";break;case"7.0":t="11.0"}else t="7.0";else t=r[1];return t};goog.html.SafeHtml=function(){this.privateDoNotAccessOrElseSafeHtmlWrappedValue_="",this.SAFE_HTML_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_,this.dir_=null};goog.html.SafeHtml.prototype.implementsGoogI18nBidiDirectionalString=!0;goog.html.SafeHtml.prototype.getDirection=function(){return this.dir_};goog.html.SafeHtml.prototype.implementsGoogStringTypedString=!0;goog.html.SafeHtml.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeHtmlWrappedValue_.toString()};goog.DEBUG&&(goog.html.SafeHtml.prototype.toString=function(){return"SafeHtml{"+this.privateDoNotAccessOrElseSafeHtmlWrappedValue_+"}"});goog.html.SafeHtml.unwrap=function(o){return goog.html.SafeHtml.unwrapTrustedHTML(o).toString()};goog.html.SafeHtml.unwrapTrustedHTML=function(o){return o instanceof goog.html.SafeHtml&&o.constructor===goog.html.SafeHtml&&o.SAFE_HTML_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?o.privateDoNotAccessOrElseSafeHtmlWrappedValue_:(goog.asserts.fail("expected object of type SafeHtml, got '"+o+"' of type "+goog.typeOf(o)),"type_error:SafeHtml")};goog.html.SafeHtml.htmlEscape=function(o){if(o instanceof goog.html.SafeHtml)return o;var t=typeof o=="object",r=null;return t&&o.implementsGoogI18nBidiDirectionalString&&(r=o.getDirection()),o=t&&o.implementsGoogStringTypedString?o.getTypedStringValue():String(o),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.htmlEscape(o),r)};goog.html.SafeHtml.htmlEscapePreservingNewlines=function(o){return o instanceof goog.html.SafeHtml?o:(o=goog.html.SafeHtml.htmlEscape(o),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.newLineToBr(goog.html.SafeHtml.unwrap(o)),o.getDirection()))};goog.html.SafeHtml.htmlEscapePreservingNewlinesAndSpaces=function(o){return o instanceof goog.html.SafeHtml?o:(o=goog.html.SafeHtml.htmlEscape(o),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.whitespaceEscape(goog.html.SafeHtml.unwrap(o)),o.getDirection()))};goog.html.SafeHtml.from=goog.html.SafeHtml.htmlEscape;goog.html.SafeHtml.VALID_NAMES_IN_TAG_=/^[a-zA-Z0-9-]+$/;goog.html.SafeHtml.URL_ATTRIBUTES_={action:!0,cite:!0,data:!0,formaction:!0,href:!0,manifest:!0,poster:!0,src:!0};goog.html.SafeHtml.NOT_ALLOWED_TAG_NAMES_={APPLET:!0,BASE:!0,EMBED:!0,IFRAME:!0,LINK:!0,MATH:!0,META:!0,OBJECT:!0,SCRIPT:!0,STYLE:!0,SVG:!0,TEMPLATE:!0};goog.html.SafeHtml.create=function(o,t,r){return goog.html.SafeHtml.verifyTagName(String(o)),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse(String(o),t,r)};goog.html.SafeHtml.verifyTagName=function(o){if(!goog.html.SafeHtml.VALID_NAMES_IN_TAG_.test(o))throw Error("Invalid tag name <"+o+">.");if(o.toUpperCase()in goog.html.SafeHtml.NOT_ALLOWED_TAG_NAMES_)throw Error("Tag name <"+o+"> is not allowed for SafeHtml.")};goog.html.SafeHtml.createIframe=function(o,t,r,i){o&&goog.html.TrustedResourceUrl.unwrap(o);var n={};return n.src=o||null,n.srcdoc=t&&goog.html.SafeHtml.unwrap(t),o=goog.html.SafeHtml.combineAttributes(n,{sandbox:""},r),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("iframe",o,i)};goog.html.SafeHtml.createSandboxIframe=function(o,t,r,i){if(!goog.html.SafeHtml.canUseSandboxIframe())throw Error("The browser does not support sandboxed iframes.");var n={};return n.src=o?goog.html.SafeUrl.unwrap(goog.html.SafeUrl.sanitize(o)):null,n.srcdoc=t||null,n.sandbox="",o=goog.html.SafeHtml.combineAttributes(n,{},r),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("iframe",o,i)};goog.html.SafeHtml.canUseSandboxIframe=function(){return goog.global.HTMLIFrameElement&&"sandbox"in goog.global.HTMLIFrameElement.prototype};goog.html.SafeHtml.createScriptSrc=function(o,t){return goog.html.TrustedResourceUrl.unwrap(o),o=goog.html.SafeHtml.combineAttributes({src:o},{},t),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("script",o)};goog.html.SafeHtml.createScript=function(o,t){for(var r in t){var i=r.toLowerCase();if(i=="language"||i=="src"||i=="text"||i=="type")throw Error('Cannot set "'+i+'" attribute')}for(r="",o=goog.array.concat(o),i=0;i<o.length;i++)r+=goog.html.SafeScript.unwrap(o[i]);return o=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(r,goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("script",t,o)};goog.html.SafeHtml.createStyle=function(o,t){t=goog.html.SafeHtml.combineAttributes({type:"text/css"},{},t);var r="";o=goog.array.concat(o);for(var i=0;i<o.length;i++)r+=goog.html.SafeStyleSheet.unwrap(o[i]);return o=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(r,goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("style",t,o)};goog.html.SafeHtml.createMetaRefresh=function(o,t){return o=goog.html.SafeUrl.unwrap(goog.html.SafeUrl.sanitize(o)),(goog.labs.userAgent.browser.isIE()||goog.labs.userAgent.browser.isEdge())&&goog.string.internal.contains(o,";")&&(o="'"+o.replace(/'/g,"%27")+"'"),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("meta",{"http-equiv":"refresh",content:(t||0)+"; url="+o})};goog.html.SafeHtml.getAttrNameAndValue_=function(o,t,r){if(r instanceof goog.string.Const)r=goog.string.Const.unwrap(r);else if(t.toLowerCase()=="style")r=goog.html.SafeHtml.getStyleValue_(r);else{if(/^on/i.test(t))throw Error('Attribute "'+t+'" requires goog.string.Const value, "'+r+'" given.');if(t.toLowerCase()in goog.html.SafeHtml.URL_ATTRIBUTES_)if(r instanceof goog.html.TrustedResourceUrl)r=goog.html.TrustedResourceUrl.unwrap(r);else if(r instanceof goog.html.SafeUrl)r=goog.html.SafeUrl.unwrap(r);else if(goog.isString(r))r=goog.html.SafeUrl.sanitize(r).getTypedStringValue();else throw Error('Attribute "'+t+'" on tag "'+o+'" requires goog.html.SafeUrl, goog.string.Const, or string, value "'+r+'" given.')}return r.implementsGoogStringTypedString&&(r=r.getTypedStringValue()),goog.asserts.assert(goog.isString(r)||goog.isNumber(r),"String or number value expected, got "+typeof r+" with value: "+r),t+'="'+goog.string.internal.htmlEscape(String(r))+'"'};goog.html.SafeHtml.getStyleValue_=function(o){if(!goog.isObject(o))throw Error('The "style" attribute requires goog.html.SafeStyle or map of style properties, '+typeof o+" given: "+o);return o instanceof goog.html.SafeStyle||(o=goog.html.SafeStyle.create(o)),goog.html.SafeStyle.unwrap(o)};goog.html.SafeHtml.createWithDir=function(o,t,r,i){return t=goog.html.SafeHtml.create(t,r,i),t.dir_=o,t};goog.html.SafeHtml.join=function(o,t){o=goog.html.SafeHtml.htmlEscape(o);var r=o.getDirection(),i=[],n=function(s){goog.isArray(s)?goog.array.forEach(s,n):(s=goog.html.SafeHtml.htmlEscape(s),i.push(goog.html.SafeHtml.unwrap(s)),s=s.getDirection(),r==goog.i18n.bidi.Dir.NEUTRAL?r=s:s!=goog.i18n.bidi.Dir.NEUTRAL&&r!=s&&(r=null))};return goog.array.forEach(t,n),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(i.join(goog.html.SafeHtml.unwrap(o)),r)};goog.html.SafeHtml.concat=function(o){return goog.html.SafeHtml.join(goog.html.SafeHtml.EMPTY,Array.prototype.slice.call(arguments))};goog.html.SafeHtml.concatWithDir=function(o,t){var r=goog.html.SafeHtml.concat(goog.array.slice(arguments,1));return r.dir_=o,r};goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={};goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse=function(o,t){return new goog.html.SafeHtml().initSecurityPrivateDoNotAccessOrElse_(o,t)};goog.html.SafeHtml.prototype.initSecurityPrivateDoNotAccessOrElse_=function(o,t){return this.privateDoNotAccessOrElseSafeHtmlWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createHTML(o):o,this.dir_=t,this};goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse=function(o,t,r){var i=null,n="<"+o+goog.html.SafeHtml.stringifyAttributes(o,t);return goog.isDefAndNotNull(r)?goog.isArray(r)||(r=[r]):r=[],goog.dom.tags.isVoidTag(o.toLowerCase())?(goog.asserts.assert(!r.length,"Void tag <"+o+"> does not allow content."),n+=">"):(i=goog.html.SafeHtml.concat(r),n+=">"+goog.html.SafeHtml.unwrap(i)+"</"+o+">",i=i.getDirection()),(o=t&&t.dir)&&(i=/^(ltr|rtl|auto)$/i.test(o)?goog.i18n.bidi.Dir.NEUTRAL:null),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(n,i)};goog.html.SafeHtml.stringifyAttributes=function(o,t){var r="";if(t)for(var i in t){if(!goog.html.SafeHtml.VALID_NAMES_IN_TAG_.test(i))throw Error('Invalid attribute name "'+i+'".');var n=t[i];goog.isDefAndNotNull(n)&&(r+=" "+goog.html.SafeHtml.getAttrNameAndValue_(o,i,n))}return r};goog.html.SafeHtml.combineAttributes=function(o,t,r){var i={},n;for(n in o)goog.asserts.assert(n.toLowerCase()==n,"Must be lower case"),i[n]=o[n];for(n in t)goog.asserts.assert(n.toLowerCase()==n,"Must be lower case"),i[n]=t[n];for(n in r){var s=n.toLowerCase();if(s in o)throw Error('Cannot override "'+s+'" attribute, got "'+n+'" with value "'+r[n]+'"');s in t&&delete i[s],i[n]=r[n]}return i};goog.html.SafeHtml.DOCTYPE_HTML=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("<!DOCTYPE html>",goog.i18n.bidi.Dir.NEUTRAL);goog.html.SafeHtml.EMPTY=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("",goog.i18n.bidi.Dir.NEUTRAL);goog.html.SafeHtml.BR=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("<br>",goog.i18n.bidi.Dir.NEUTRAL);goog.html.uncheckedconversions={};goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract=function(o,t,r){return goog.asserts.assertString(goog.string.Const.unwrap(o),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(o)),"must provide non-empty justification"),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(t,r||null)};goog.html.uncheckedconversions.safeScriptFromStringKnownToSatisfyTypeContract=function(o,t){return goog.asserts.assertString(goog.string.Const.unwrap(o),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(o)),"must provide non-empty justification"),goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(t)};goog.html.uncheckedconversions.safeStyleFromStringKnownToSatisfyTypeContract=function(o,t){return goog.asserts.assertString(goog.string.Const.unwrap(o),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(o)),"must provide non-empty justification"),goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(t)};goog.html.uncheckedconversions.safeStyleSheetFromStringKnownToSatisfyTypeContract=function(o,t){return goog.asserts.assertString(goog.string.Const.unwrap(o),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(o)),"must provide non-empty justification"),goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(t)};goog.html.uncheckedconversions.safeUrlFromStringKnownToSatisfyTypeContract=function(o,t){return goog.asserts.assertString(goog.string.Const.unwrap(o),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(o)),"must provide non-empty justification"),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(t)};goog.html.uncheckedconversions.trustedResourceUrlFromStringKnownToSatisfyTypeContract=function(o,t){return goog.asserts.assertString(goog.string.Const.unwrap(o),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(o)),"must provide non-empty justification"),goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(t)};goog.dom.asserts={};goog.dom.asserts.assertIsLocation=function(o){if(goog.asserts.ENABLE_ASSERTS){var t=goog.dom.asserts.getWindow_(o);t&&(!o||!(o instanceof t.Location)&&o instanceof t.Element)&&goog.asserts.fail("Argument is not a Location (or a non-Element mock); got: %s",goog.dom.asserts.debugStringForType_(o))}return o};goog.dom.asserts.assertIsElementType_=function(o,t){if(goog.asserts.ENABLE_ASSERTS){var r=goog.dom.asserts.getWindow_(o);r&&typeof r[t]<"u"&&(o&&(o instanceof r[t]||!(o instanceof r.Location||o instanceof r.Element))||goog.asserts.fail("Argument is not a %s (or a non-Element, non-Location mock); got: %s",t,goog.dom.asserts.debugStringForType_(o)))}return o};goog.dom.asserts.assertIsHTMLAnchorElement=function(o){return goog.dom.asserts.assertIsElementType_(o,"HTMLAnchorElement")};goog.dom.asserts.assertIsHTMLButtonElement=function(o){return goog.dom.asserts.assertIsElementType_(o,"HTMLButtonElement")};goog.dom.asserts.assertIsHTMLLinkElement=function(o){return goog.dom.asserts.assertIsElementType_(o,"HTMLLinkElement")};goog.dom.asserts.assertIsHTMLImageElement=function(o){return goog.dom.asserts.assertIsElementType_(o,"HTMLImageElement")};goog.dom.asserts.assertIsHTMLAudioElement=function(o){return goog.dom.asserts.assertIsElementType_(o,"HTMLAudioElement")};goog.dom.asserts.assertIsHTMLVideoElement=function(o){return goog.dom.asserts.assertIsElementType_(o,"HTMLVideoElement")};goog.dom.asserts.assertIsHTMLInputElement=function(o){return goog.dom.asserts.assertIsElementType_(o,"HTMLInputElement")};goog.dom.asserts.assertIsHTMLTextAreaElement=function(o){return goog.dom.asserts.assertIsElementType_(o,"HTMLTextAreaElement")};goog.dom.asserts.assertIsHTMLCanvasElement=function(o){return goog.dom.asserts.assertIsElementType_(o,"HTMLCanvasElement")};goog.dom.asserts.assertIsHTMLEmbedElement=function(o){return goog.dom.asserts.assertIsElementType_(o,"HTMLEmbedElement")};goog.dom.asserts.assertIsHTMLFormElement=function(o){return goog.dom.asserts.assertIsElementType_(o,"HTMLFormElement")};goog.dom.asserts.assertIsHTMLFrameElement=function(o){return goog.dom.asserts.assertIsElementType_(o,"HTMLFrameElement")};goog.dom.asserts.assertIsHTMLIFrameElement=function(o){return goog.dom.asserts.assertIsElementType_(o,"HTMLIFrameElement")};goog.dom.asserts.assertIsHTMLObjectElement=function(o){return goog.dom.asserts.assertIsElementType_(o,"HTMLObjectElement")};goog.dom.asserts.assertIsHTMLScriptElement=function(o){return goog.dom.asserts.assertIsElementType_(o,"HTMLScriptElement")};goog.dom.asserts.debugStringForType_=function(o){if(goog.isObject(o))try{return o.constructor.displayName||o.constructor.name||Object.prototype.toString.call(o)}catch{return"<object could not be stringified>"}else return o===void 0?"undefined":o===null?"null":typeof o};goog.dom.asserts.getWindow_=function(o){try{var t=o&&o.ownerDocument,r=t&&(t.defaultView||t.parentWindow);if(r=r||goog.global,r.Element&&r.Location)return r}catch{}return null};goog.functions={};goog.functions.constant=function(o){return function(){return o}};goog.functions.FALSE=function(){return!1};goog.functions.TRUE=function(){return!0};goog.functions.NULL=function(){return null};goog.functions.identity=function(o,t){return o};goog.functions.error=function(o){return function(){throw Error(o)}};goog.functions.fail=function(o){return function(){throw o}};goog.functions.lock=function(o,t){return t=t||0,function(){return o.apply(this,Array.prototype.slice.call(arguments,0,t))}};goog.functions.nth=function(o){return function(){return arguments[o]}};goog.functions.partialRight=function(o,t){var r=Array.prototype.slice.call(arguments,1);return function(){var i=Array.prototype.slice.call(arguments);return i.push.apply(i,r),o.apply(this,i)}};goog.functions.withReturnValue=function(o,t){return goog.functions.sequence(o,goog.functions.constant(t))};goog.functions.equalTo=function(o,t){return function(r){return t?o==r:o===r}};goog.functions.compose=function(o,t){var r=arguments,i=r.length;return function(){var n;i&&(n=r[i-1].apply(this,arguments));for(var s=i-2;0<=s;s--)n=r[s].call(this,n);return n}};goog.functions.sequence=function(o){var t=arguments,r=t.length;return function(){for(var i,n=0;n<r;n++)i=t[n].apply(this,arguments);return i}};goog.functions.and=function(o){var t=arguments,r=t.length;return function(){for(var i=0;i<r;i++)if(!t[i].apply(this,arguments))return!1;return!0}};goog.functions.or=function(o){var t=arguments,r=t.length;return function(){for(var i=0;i<r;i++)if(t[i].apply(this,arguments))return!0;return!1}};goog.functions.not=function(o){return function(){return!o.apply(this,arguments)}};goog.functions.create=function(o,t){var r=function(){};return r.prototype=o.prototype,r=new r,o.apply(r,Array.prototype.slice.call(arguments,1)),r};goog.functions.CACHE_RETURN_VALUE=!0;goog.functions.cacheReturnValue=function(o){var t=!1,r;return function(){return goog.functions.CACHE_RETURN_VALUE?(t||(r=o(),t=!0),r):o()}};goog.functions.once=function(o){var t=o;return function(){if(t){var r=t;t=null,r()}}};goog.functions.debounce=function(o,t,r){var i=0;return function(n){goog.global.clearTimeout(i);var s=arguments;i=goog.global.setTimeout(function(){o.apply(r,s)},t)}};goog.functions.throttle=function(o,t,r){var i=0,n=!1,s=[],l=function(){i=0,n&&(n=!1,g())},g=function(){i=goog.global.setTimeout(l,t),o.apply(r,s)};return function(p){s=arguments,i?n=!0:g()}};goog.functions.rateLimit=function(o,t,r){var i=0,n=function(){i=0};return function(s){i||(i=goog.global.setTimeout(n,t),o.apply(r,arguments))}};goog.dom.safe={};goog.dom.safe.InsertAdjacentHtmlPosition={AFTERBEGIN:"afterbegin",AFTEREND:"afterend",BEFOREBEGIN:"beforebegin",BEFOREEND:"beforeend"};goog.dom.safe.insertAdjacentHtml=function(o,t,r){o.insertAdjacentHTML(t,goog.html.SafeHtml.unwrapTrustedHTML(r))};goog.dom.safe.SET_INNER_HTML_DISALLOWED_TAGS_={MATH:!0,SCRIPT:!0,STYLE:!0,SVG:!0,TEMPLATE:!0};goog.dom.safe.isInnerHtmlCleanupRecursive_=goog.functions.cacheReturnValue(function(){if(goog.DEBUG&&typeof document>"u")return!1;var o=document.createElement("div"),t=document.createElement("div");return t.appendChild(document.createElement("div")),o.appendChild(t),goog.DEBUG&&!o.firstChild?!1:(t=o.firstChild.firstChild,o.innerHTML=goog.html.SafeHtml.unwrapTrustedHTML(goog.html.SafeHtml.EMPTY),!t.parentElement)});goog.dom.safe.unsafeSetInnerHtmlDoNotUseOrElse=function(o,t){if(goog.dom.safe.isInnerHtmlCleanupRecursive_())for(;o.lastChild;)o.removeChild(o.lastChild);o.innerHTML=goog.html.SafeHtml.unwrapTrustedHTML(t)};goog.dom.safe.setInnerHtml=function(o,t){if(goog.asserts.ENABLE_ASSERTS){var r=o.tagName.toUpperCase();if(goog.dom.safe.SET_INNER_HTML_DISALLOWED_TAGS_[r])throw Error("goog.dom.safe.setInnerHtml cannot be used to set content of "+o.tagName+".")}goog.dom.safe.unsafeSetInnerHtmlDoNotUseOrElse(o,t)};goog.dom.safe.setOuterHtml=function(o,t){o.outerHTML=goog.html.SafeHtml.unwrapTrustedHTML(t)};goog.dom.safe.setFormElementAction=function(o,t){t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),goog.dom.asserts.assertIsHTMLFormElement(o).action=goog.html.SafeUrl.unwrapTrustedURL(t)};goog.dom.safe.setButtonFormAction=function(o,t){t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),goog.dom.asserts.assertIsHTMLButtonElement(o).formAction=goog.html.SafeUrl.unwrapTrustedURL(t)};goog.dom.safe.setInputFormAction=function(o,t){t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),goog.dom.asserts.assertIsHTMLInputElement(o).formAction=goog.html.SafeUrl.unwrapTrustedURL(t)};goog.dom.safe.setStyle=function(o,t){o.style.cssText=goog.html.SafeStyle.unwrap(t)};goog.dom.safe.documentWrite=function(o,t){o.write(goog.html.SafeHtml.unwrapTrustedHTML(t))};goog.dom.safe.setAnchorHref=function(o,t){goog.dom.asserts.assertIsHTMLAnchorElement(o),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),o.href=goog.html.SafeUrl.unwrapTrustedURL(t)};goog.dom.safe.setImageSrc=function(o,t){if(goog.dom.asserts.assertIsHTMLImageElement(o),!(t instanceof goog.html.SafeUrl)){var r=/^data:image\//i.test(t);t=goog.html.SafeUrl.sanitizeAssertUnchanged(t,r)}o.src=goog.html.SafeUrl.unwrapTrustedURL(t)};goog.dom.safe.setAudioSrc=function(o,t){if(goog.dom.asserts.assertIsHTMLAudioElement(o),!(t instanceof goog.html.SafeUrl)){var r=/^data:audio\//i.test(t);t=goog.html.SafeUrl.sanitizeAssertUnchanged(t,r)}o.src=goog.html.SafeUrl.unwrapTrustedURL(t)};goog.dom.safe.setVideoSrc=function(o,t){if(goog.dom.asserts.assertIsHTMLVideoElement(o),!(t instanceof goog.html.SafeUrl)){var r=/^data:video\//i.test(t);t=goog.html.SafeUrl.sanitizeAssertUnchanged(t,r)}o.src=goog.html.SafeUrl.unwrapTrustedURL(t)};goog.dom.safe.setEmbedSrc=function(o,t){goog.dom.asserts.assertIsHTMLEmbedElement(o),o.src=goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(t)};goog.dom.safe.setFrameSrc=function(o,t){goog.dom.asserts.assertIsHTMLFrameElement(o),o.src=goog.html.TrustedResourceUrl.unwrapTrustedURL(t)};goog.dom.safe.setIframeSrc=function(o,t){goog.dom.asserts.assertIsHTMLIFrameElement(o),o.src=goog.html.TrustedResourceUrl.unwrapTrustedURL(t)};goog.dom.safe.setIframeSrcdoc=function(o,t){goog.dom.asserts.assertIsHTMLIFrameElement(o),o.srcdoc=goog.html.SafeHtml.unwrapTrustedHTML(t)};goog.dom.safe.setLinkHrefAndRel=function(o,t,r){goog.dom.asserts.assertIsHTMLLinkElement(o),o.rel=r,goog.string.internal.caseInsensitiveContains(r,"stylesheet")?(goog.asserts.assert(t instanceof goog.html.TrustedResourceUrl,'URL must be TrustedResourceUrl because "rel" contains "stylesheet"'),o.href=goog.html.TrustedResourceUrl.unwrapTrustedURL(t)):o.href=t instanceof goog.html.TrustedResourceUrl?goog.html.TrustedResourceUrl.unwrapTrustedURL(t):t instanceof goog.html.SafeUrl?goog.html.SafeUrl.unwrapTrustedURL(t):goog.html.SafeUrl.unwrapTrustedURL(goog.html.SafeUrl.sanitizeAssertUnchanged(t))};goog.dom.safe.setObjectData=function(o,t){goog.dom.asserts.assertIsHTMLObjectElement(o),o.data=goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(t)};goog.dom.safe.setScriptSrc=function(o,t){goog.dom.asserts.assertIsHTMLScriptElement(o),o.src=goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(t),(t=goog.getScriptNonce())&&o.setAttribute("nonce",t)};goog.dom.safe.setScriptContent=function(o,t){goog.dom.asserts.assertIsHTMLScriptElement(o),o.text=goog.html.SafeScript.unwrapTrustedScript(t),(t=goog.getScriptNonce())&&o.setAttribute("nonce",t)};goog.dom.safe.setLocationHref=function(o,t){goog.dom.asserts.assertIsLocation(o),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),o.href=goog.html.SafeUrl.unwrapTrustedURL(t)};goog.dom.safe.assignLocation=function(o,t){goog.dom.asserts.assertIsLocation(o),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),o.assign(goog.html.SafeUrl.unwrapTrustedURL(t))};goog.dom.safe.replaceLocation=function(o,t){goog.dom.asserts.assertIsLocation(o),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),o.replace(goog.html.SafeUrl.unwrapTrustedURL(t))};goog.dom.safe.openInWindow=function(o,t,r,i,n){return o=o instanceof goog.html.SafeUrl?o:goog.html.SafeUrl.sanitizeAssertUnchanged(o),(t||goog.global).open(goog.html.SafeUrl.unwrapTrustedURL(o),r?goog.string.Const.unwrap(r):"",i,n)};goog.dom.safe.parseFromStringHtml=function(o,t){return goog.dom.safe.parseFromString(o,t,"text/html")};goog.dom.safe.parseFromString=function(o,t,r){return o.parseFromString(goog.html.SafeHtml.unwrapTrustedHTML(t),r)};goog.dom.safe.createImageFromBlob=function(o){if(!/^image\/.*/g.test(o.type))throw Error("goog.dom.safe.createImageFromBlob only accepts MIME type image/.*.");var t=goog.global.URL.createObjectURL(o);return o=new goog.global.Image,o.onload=function(){goog.global.URL.revokeObjectURL(t)},goog.dom.safe.setImageSrc(o,goog.html.uncheckedconversions.safeUrlFromStringKnownToSatisfyTypeContract(goog.string.Const.from("Image blob URL."),t)),o};goog.string.DETECT_DOUBLE_ESCAPING=!1;goog.string.FORCE_NON_DOM_HTML_UNESCAPING=!1;goog.string.Unicode={NBSP:"\xA0"};goog.string.startsWith=goog.string.internal.startsWith;goog.string.endsWith=goog.string.internal.endsWith;goog.string.caseInsensitiveStartsWith=goog.string.internal.caseInsensitiveStartsWith;goog.string.caseInsensitiveEndsWith=goog.string.internal.caseInsensitiveEndsWith;goog.string.caseInsensitiveEquals=goog.string.internal.caseInsensitiveEquals;goog.string.subs=function(o,t){for(var r=o.split("%s"),i="",n=Array.prototype.slice.call(arguments,1);n.length&&1<r.length;)i+=r.shift()+n.shift();return i+r.join("%s")};goog.string.collapseWhitespace=function(o){return o.replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")};goog.string.isEmptyOrWhitespace=goog.string.internal.isEmptyOrWhitespace;goog.string.isEmptyString=function(o){return o.length==0};goog.string.isEmpty=goog.string.isEmptyOrWhitespace;goog.string.isEmptyOrWhitespaceSafe=function(o){return goog.string.isEmptyOrWhitespace(goog.string.makeSafe(o))};goog.string.isEmptySafe=goog.string.isEmptyOrWhitespaceSafe;goog.string.isBreakingWhitespace=function(o){return!/[^\t\n\r ]/.test(o)};goog.string.isAlpha=function(o){return!/[^a-zA-Z]/.test(o)};goog.string.isNumeric=function(o){return!/[^0-9]/.test(o)};goog.string.isAlphaNumeric=function(o){return!/[^a-zA-Z0-9]/.test(o)};goog.string.isSpace=function(o){return o==" "};goog.string.isUnicodeChar=function(o){return o.length==1&&" "<=o&&"~">=o||"\x80"<=o&&"\uFFFD">=o};goog.string.stripNewlines=function(o){return o.replace(/(\r\n|\r|\n)+/g," ")};goog.string.canonicalizeNewlines=function(o){return o.replace(/(\r\n|\r|\n)/g,`
|
|
14
|
-
`)};goog.string.normalizeWhitespace=function(o){return o.replace(/\xa0|\s/g," ")};goog.string.normalizeSpaces=function(o){return o.replace(/\xa0|[ \t]+/g," ")};goog.string.collapseBreakingSpaces=function(o){return o.replace(/[\t\r\n ]+/g," ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g,"")};goog.string.trim=goog.string.internal.trim;goog.string.trimLeft=function(o){return o.replace(/^[\s\xa0]+/,"")};goog.string.trimRight=function(o){return o.replace(/[\s\xa0]+$/,"")};goog.string.caseInsensitiveCompare=goog.string.internal.caseInsensitiveCompare;goog.string.numberAwareCompare_=function(o,t,r){if(o==t)return 0;if(!o)return-1;if(!t)return 1;for(var i=o.toLowerCase().match(r),n=t.toLowerCase().match(r),s=Math.min(i.length,n.length),l=0;l<s;l++){r=i[l];var g=n[l];if(r!=g)return o=parseInt(r,10),!isNaN(o)&&(t=parseInt(g,10),!isNaN(t)&&o-t)?o-t:r<g?-1:1}return i.length!=n.length?i.length-n.length:o<t?-1:1};goog.string.intAwareCompare=function(o,t){return goog.string.numberAwareCompare_(o,t,/\d+|\D+/g)};goog.string.floatAwareCompare=function(o,t){return goog.string.numberAwareCompare_(o,t,/\d+|\.\d+|\D+/g)};goog.string.numerateCompare=goog.string.floatAwareCompare;goog.string.urlEncode=function(o){return encodeURIComponent(String(o))};goog.string.urlDecode=function(o){return decodeURIComponent(o.replace(/\+/g," "))};goog.string.newLineToBr=goog.string.internal.newLineToBr;goog.string.htmlEscape=function(o,t){return o=goog.string.internal.htmlEscape(o,t),goog.string.DETECT_DOUBLE_ESCAPING&&(o=o.replace(goog.string.E_RE_,"e")),o};goog.string.E_RE_=/e/g;goog.string.unescapeEntities=function(o){return goog.string.contains(o,"&")?!goog.string.FORCE_NON_DOM_HTML_UNESCAPING&&"document"in goog.global?goog.string.unescapeEntitiesUsingDom_(o):goog.string.unescapePureXmlEntities_(o):o};goog.string.unescapeEntitiesWithDocument=function(o,t){return goog.string.contains(o,"&")?goog.string.unescapeEntitiesUsingDom_(o,t):o};goog.string.unescapeEntitiesUsingDom_=function(o,t){var r={"&":"&","<":"<",">":">",""":'"'},i=t?t.createElement("div"):goog.global.document.createElement("div");return o.replace(goog.string.HTML_ENTITY_PATTERN_,function(n,s){var l=r[n];return l||(s.charAt(0)=="#"&&(s=Number("0"+s.substr(1)),isNaN(s)||(l=String.fromCharCode(s))),l||(goog.dom.safe.setInnerHtml(i,goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract(goog.string.Const.from("Single HTML entity."),n+" ")),l=i.firstChild.nodeValue.slice(0,-1)),r[n]=l)})};goog.string.unescapePureXmlEntities_=function(o){return o.replace(/&([^;]+);/g,function(t,r){switch(r){case"amp":return"&";case"lt":return"<";case"gt":return">";case"quot":return'"';default:return r.charAt(0)!="#"||(r=Number("0"+r.substr(1)),isNaN(r))?t:String.fromCharCode(r)}})};goog.string.HTML_ENTITY_PATTERN_=/&([^;\s<&]+);?/g;goog.string.whitespaceEscape=function(o,t){return goog.string.newLineToBr(o.replace(/ /g,"  "),t)};goog.string.preserveSpaces=function(o){return o.replace(/(^|[\n ]) /g,"$1"+goog.string.Unicode.NBSP)};goog.string.stripQuotes=function(o,t){for(var r=t.length,i=0;i<r;i++){var n=r==1?t:t.charAt(i);if(o.charAt(0)==n&&o.charAt(o.length-1)==n)return o.substring(1,o.length-1)}return o};goog.string.truncate=function(o,t,r){return r&&(o=goog.string.unescapeEntities(o)),o.length>t&&(o=o.substring(0,t-3)+"..."),r&&(o=goog.string.htmlEscape(o)),o};goog.string.truncateMiddle=function(o,t,r,i){if(r&&(o=goog.string.unescapeEntities(o)),i&&o.length>t){i>t&&(i=t);var n=o.length-i;o=o.substring(0,t-i)+"..."+o.substring(n)}else o.length>t&&(i=Math.floor(t/2),n=o.length-i,o=o.substring(0,i+t%2)+"..."+o.substring(n));return r&&(o=goog.string.htmlEscape(o)),o};goog.string.specialEscapeChars_={"\0":"\\0","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\x0B",'"':'\\"',"\\":"\\\\","<":"\\u003C"};goog.string.jsEscapeCache_={"'":"\\'"};goog.string.quote=function(o){o=String(o);for(var t=['"'],r=0;r<o.length;r++){var i=o.charAt(r),n=i.charCodeAt(0);t[r+1]=goog.string.specialEscapeChars_[i]||(31<n&&127>n?i:goog.string.escapeChar(i))}return t.push('"'),t.join("")};goog.string.escapeString=function(o){for(var t=[],r=0;r<o.length;r++)t[r]=goog.string.escapeChar(o.charAt(r));return t.join("")};goog.string.escapeChar=function(o){if(o in goog.string.jsEscapeCache_)return goog.string.jsEscapeCache_[o];if(o in goog.string.specialEscapeChars_)return goog.string.jsEscapeCache_[o]=goog.string.specialEscapeChars_[o];var t=o.charCodeAt(0);if(31<t&&127>t)var r=o;else 256>t?(r="\\x",(16>t||256<t)&&(r+="0")):(r="\\u",4096>t&&(r+="0")),r+=t.toString(16).toUpperCase();return goog.string.jsEscapeCache_[o]=r};goog.string.contains=goog.string.internal.contains;goog.string.caseInsensitiveContains=goog.string.internal.caseInsensitiveContains;goog.string.countOf=function(o,t){return o&&t?o.split(t).length-1:0};goog.string.removeAt=function(o,t,r){var i=o;return 0<=t&&t<o.length&&0<r&&(i=o.substr(0,t)+o.substr(t+r,o.length-t-r)),i};goog.string.remove=function(o,t){return o.replace(t,"")};goog.string.removeAll=function(o,t){return t=new RegExp(goog.string.regExpEscape(t),"g"),o.replace(t,"")};goog.string.replaceAll=function(o,t,r){return t=new RegExp(goog.string.regExpEscape(t),"g"),o.replace(t,r.replace(/\$/g,"$$$$"))};goog.string.regExpEscape=function(o){return String(o).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")};goog.string.repeat=String.prototype.repeat?function(o,t){return o.repeat(t)}:function(o,t){return Array(t+1).join(o)};goog.string.padNumber=function(o,t,r){return o=goog.isDef(r)?o.toFixed(r):String(o),r=o.indexOf("."),r==-1&&(r=o.length),goog.string.repeat("0",Math.max(0,t-r))+o};goog.string.makeSafe=function(o){return o==null?"":String(o)};goog.string.buildString=function(o){return Array.prototype.join.call(arguments,"")};goog.string.getRandomString=function(){return Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^goog.now()).toString(36)};goog.string.compareVersions=goog.string.internal.compareVersions;goog.string.hashCode=function(o){for(var t=0,r=0;r<o.length;++r)t=31*t+o.charCodeAt(r)>>>0;return t};goog.string.uniqueStringCounter_=2147483648*Math.random()|0;goog.string.createUniqueString=function(){return"goog_"+goog.string.uniqueStringCounter_++};goog.string.toNumber=function(o){var t=Number(o);return t==0&&goog.string.isEmptyOrWhitespace(o)?NaN:t};goog.string.isLowerCamelCase=function(o){return/^[a-z]+([A-Z][a-z]*)*$/.test(o)};goog.string.isUpperCamelCase=function(o){return/^([A-Z][a-z]*)+$/.test(o)};goog.string.toCamelCase=function(o){return String(o).replace(/\-([a-z])/g,function(t,r){return r.toUpperCase()})};goog.string.toSelectorCase=function(o){return String(o).replace(/([A-Z])/g,"-$1").toLowerCase()};goog.string.toTitleCase=function(o,t){return t=goog.isString(t)?goog.string.regExpEscape(t):"\\s",o.replace(new RegExp("(^"+(t?"|["+t+"]+":"")+")([a-z])","g"),function(r,i,n){return i+n.toUpperCase()})};goog.string.capitalize=function(o){return String(o.charAt(0)).toUpperCase()+String(o.substr(1)).toLowerCase()};goog.string.parseInt=function(o){return isFinite(o)&&(o=String(o)),goog.isString(o)?/^\s*-?0x/i.test(o)?parseInt(o,16):parseInt(o,10):NaN};goog.string.splitLimit=function(o,t,r){o=o.split(t);for(var i=[];0<r&&o.length;)i.push(o.shift()),r--;return o.length&&i.push(o.join(t)),i};goog.string.lastComponent=function(o,t){if(t)typeof t=="string"&&(t=[t]);else return o;for(var r=-1,i=0;i<t.length;i++)if(t[i]!=""){var n=o.lastIndexOf(t[i]);n>r&&(r=n)}return r==-1?o:o.slice(r+1)};goog.string.editDistance=function(o,t){var r=[],i=[];if(o==t)return 0;if(!o.length||!t.length)return Math.max(o.length,t.length);for(var n=0;n<t.length+1;n++)r[n]=n;for(n=0;n<o.length;n++){i[0]=n+1;for(var s=0;s<t.length;s++)i[s+1]=Math.min(i[s]+1,r[s+1]+1,r[s]+Number(o[n]!=t[s]));for(s=0;s<r.length;s++)r[s]=i[s]}return i[t.length]};goog.labs.userAgent.platform={};goog.labs.userAgent.platform.isAndroid=function(){return goog.labs.userAgent.util.matchUserAgent("Android")};goog.labs.userAgent.platform.isIpod=function(){return goog.labs.userAgent.util.matchUserAgent("iPod")};goog.labs.userAgent.platform.isIphone=function(){return goog.labs.userAgent.util.matchUserAgent("iPhone")&&!goog.labs.userAgent.util.matchUserAgent("iPod")&&!goog.labs.userAgent.util.matchUserAgent("iPad")};goog.labs.userAgent.platform.isIpad=function(){return goog.labs.userAgent.util.matchUserAgent("iPad")};goog.labs.userAgent.platform.isIos=function(){return goog.labs.userAgent.platform.isIphone()||goog.labs.userAgent.platform.isIpad()||goog.labs.userAgent.platform.isIpod()};goog.labs.userAgent.platform.isMacintosh=function(){return goog.labs.userAgent.util.matchUserAgent("Macintosh")};goog.labs.userAgent.platform.isLinux=function(){return goog.labs.userAgent.util.matchUserAgent("Linux")};goog.labs.userAgent.platform.isWindows=function(){return goog.labs.userAgent.util.matchUserAgent("Windows")};goog.labs.userAgent.platform.isChromeOS=function(){return goog.labs.userAgent.util.matchUserAgent("CrOS")};goog.labs.userAgent.platform.isChromecast=function(){return goog.labs.userAgent.util.matchUserAgent("CrKey")};goog.labs.userAgent.platform.isKaiOS=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("KaiOS")};goog.labs.userAgent.platform.isGo2Phone=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("GAFP")};goog.labs.userAgent.platform.getVersion=function(){var o=goog.labs.userAgent.util.getUserAgent(),t="";return goog.labs.userAgent.platform.isWindows()?(t=/Windows (?:NT|Phone) ([0-9.]+)/,t=(o=t.exec(o))?o[1]:"0.0"):goog.labs.userAgent.platform.isIos()?(t=/(?:iPhone|iPod|iPad|CPU)\s+OS\s+(\S+)/,t=(o=t.exec(o))&&o[1].replace(/_/g,".")):goog.labs.userAgent.platform.isMacintosh()?(t=/Mac OS X ([0-9_.]+)/,t=(o=t.exec(o))?o[1].replace(/_/g,"."):"10"):goog.labs.userAgent.platform.isKaiOS()?(t=/(?:KaiOS)\/(\S+)/i,t=(o=t.exec(o))&&o[1]):goog.labs.userAgent.platform.isAndroid()?(t=/Android\s+([^\);]+)(\)|;)/,t=(o=t.exec(o))&&o[1]):goog.labs.userAgent.platform.isChromeOS()&&(t=/(?:CrOS\s+(?:i686|x86_64)\s+([0-9.]+))/,t=(o=t.exec(o))&&o[1]),t||""};goog.labs.userAgent.platform.isVersionOrHigher=function(o){return 0<=goog.string.compareVersions(goog.labs.userAgent.platform.getVersion(),o)};goog.reflect={};goog.reflect.object=function(o,t){return t};goog.reflect.objectProperty=function(o,t){return o};goog.reflect.sinkValue=function(o){return goog.reflect.sinkValue[" "](o),o};goog.reflect.sinkValue[" "]=goog.nullFunction;goog.reflect.canAccessProperty=function(o,t){try{return goog.reflect.sinkValue(o[t]),!0}catch{}return!1};goog.reflect.cache=function(o,t,r,i){return i=i?i(t):t,Object.prototype.hasOwnProperty.call(o,i)?o[i]:o[i]=r(t)};goog.labs.userAgent.engine={};goog.labs.userAgent.engine.isPresto=function(){return goog.labs.userAgent.util.matchUserAgent("Presto")};goog.labs.userAgent.engine.isTrident=function(){return goog.labs.userAgent.util.matchUserAgent("Trident")||goog.labs.userAgent.util.matchUserAgent("MSIE")};goog.labs.userAgent.engine.isEdge=function(){return goog.labs.userAgent.util.matchUserAgent("Edge")};goog.labs.userAgent.engine.isWebKit=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("WebKit")&&!goog.labs.userAgent.engine.isEdge()};goog.labs.userAgent.engine.isGecko=function(){return goog.labs.userAgent.util.matchUserAgent("Gecko")&&!goog.labs.userAgent.engine.isWebKit()&&!goog.labs.userAgent.engine.isTrident()&&!goog.labs.userAgent.engine.isEdge()};goog.labs.userAgent.engine.getVersion=function(){var o=goog.labs.userAgent.util.getUserAgent();if(o){o=goog.labs.userAgent.util.extractVersionTuples(o);var t=goog.labs.userAgent.engine.getEngineTuple_(o);if(t)return t[0]=="Gecko"?goog.labs.userAgent.engine.getVersionForKey_(o,"Firefox"):t[1];o=o[0];var r;if(o&&(r=o[2])&&(r=/Trident\/([^\s;]+)/.exec(r)))return r[1]}return""};goog.labs.userAgent.engine.getEngineTuple_=function(o){if(!goog.labs.userAgent.engine.isEdge())return o[1];for(var t=0;t<o.length;t++){var r=o[t];if(r[0]=="Edge")return r}};goog.labs.userAgent.engine.isVersionOrHigher=function(o){return 0<=goog.string.compareVersions(goog.labs.userAgent.engine.getVersion(),o)};goog.labs.userAgent.engine.getVersionForKey_=function(o,t){return(o=goog.array.find(o,function(r){return t==r[0]}))&&o[1]||""};goog.userAgent={};goog.userAgent.ASSUME_IE=!1;goog.userAgent.ASSUME_EDGE=!1;goog.userAgent.ASSUME_GECKO=!1;goog.userAgent.ASSUME_WEBKIT=!1;goog.userAgent.ASSUME_MOBILE_WEBKIT=!1;goog.userAgent.ASSUME_OPERA=!1;goog.userAgent.ASSUME_ANY_VERSION=!1;goog.userAgent.BROWSER_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_EDGE||goog.userAgent.ASSUME_GECKO||goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_OPERA;goog.userAgent.getUserAgentString=function(){return goog.labs.userAgent.util.getUserAgent()};goog.userAgent.getNavigatorTyped=function(){return goog.global.navigator||null};goog.userAgent.getNavigator=function(){return goog.userAgent.getNavigatorTyped()};goog.userAgent.OPERA=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_OPERA:goog.labs.userAgent.browser.isOpera();goog.userAgent.IE=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_IE:goog.labs.userAgent.browser.isIE();goog.userAgent.EDGE=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_EDGE:goog.labs.userAgent.engine.isEdge();goog.userAgent.EDGE_OR_IE=goog.userAgent.EDGE||goog.userAgent.IE;goog.userAgent.GECKO=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_GECKO:goog.labs.userAgent.engine.isGecko();goog.userAgent.WEBKIT=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_MOBILE_WEBKIT:goog.labs.userAgent.engine.isWebKit();goog.userAgent.isMobile_=function(){return goog.userAgent.WEBKIT&&goog.labs.userAgent.util.matchUserAgent("Mobile")};goog.userAgent.MOBILE=goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.isMobile_();goog.userAgent.SAFARI=goog.userAgent.WEBKIT;goog.userAgent.determinePlatform_=function(){var o=goog.userAgent.getNavigatorTyped();return o&&o.platform||""};goog.userAgent.PLATFORM=goog.userAgent.determinePlatform_();goog.userAgent.ASSUME_MAC=!1;goog.userAgent.ASSUME_WINDOWS=!1;goog.userAgent.ASSUME_LINUX=!1;goog.userAgent.ASSUME_X11=!1;goog.userAgent.ASSUME_ANDROID=!1;goog.userAgent.ASSUME_IPHONE=!1;goog.userAgent.ASSUME_IPAD=!1;goog.userAgent.ASSUME_IPOD=!1;goog.userAgent.ASSUME_KAIOS=!1;goog.userAgent.ASSUME_GO2PHONE=!1;goog.userAgent.PLATFORM_KNOWN_=goog.userAgent.ASSUME_MAC||goog.userAgent.ASSUME_WINDOWS||goog.userAgent.ASSUME_LINUX||goog.userAgent.ASSUME_X11||goog.userAgent.ASSUME_ANDROID||goog.userAgent.ASSUME_IPHONE||goog.userAgent.ASSUME_IPAD||goog.userAgent.ASSUME_IPOD;goog.userAgent.MAC=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_MAC:goog.labs.userAgent.platform.isMacintosh();goog.userAgent.WINDOWS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_WINDOWS:goog.labs.userAgent.platform.isWindows();goog.userAgent.isLegacyLinux_=function(){return goog.labs.userAgent.platform.isLinux()||goog.labs.userAgent.platform.isChromeOS()};goog.userAgent.LINUX=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_LINUX:goog.userAgent.isLegacyLinux_();goog.userAgent.isX11_=function(){var o=goog.userAgent.getNavigatorTyped();return!!o&&goog.string.contains(o.appVersion||"","X11")};goog.userAgent.X11=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_X11:goog.userAgent.isX11_();goog.userAgent.ANDROID=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_ANDROID:goog.labs.userAgent.platform.isAndroid();goog.userAgent.IPHONE=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE:goog.labs.userAgent.platform.isIphone();goog.userAgent.IPAD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPAD:goog.labs.userAgent.platform.isIpad();goog.userAgent.IPOD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPOD:goog.labs.userAgent.platform.isIpod();goog.userAgent.IOS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE||goog.userAgent.ASSUME_IPAD||goog.userAgent.ASSUME_IPOD:goog.labs.userAgent.platform.isIos();goog.userAgent.KAIOS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_KAIOS:goog.labs.userAgent.platform.isKaiOS();goog.userAgent.GO2PHONE=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_GO2PHONE:goog.labs.userAgent.platform.isGo2Phone();goog.userAgent.determineVersion_=function(){var o="",t=goog.userAgent.getVersionRegexResult_();return t&&(o=t?t[1]:""),goog.userAgent.IE&&(t=goog.userAgent.getDocumentMode_(),t!=null&&t>parseFloat(o))?String(t):o};goog.userAgent.getVersionRegexResult_=function(){var o=goog.userAgent.getUserAgentString();if(goog.userAgent.GECKO)return/rv:([^\);]+)(\)|;)/.exec(o);if(goog.userAgent.EDGE)return/Edge\/([\d\.]+)/.exec(o);if(goog.userAgent.IE)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(o);if(goog.userAgent.WEBKIT)return/WebKit\/(\S+)/.exec(o);if(goog.userAgent.OPERA)return/(?:Version)[ \/]?(\S+)/.exec(o)};goog.userAgent.getDocumentMode_=function(){var o=goog.global.document;return o?o.documentMode:void 0};goog.userAgent.VERSION=goog.userAgent.determineVersion_();goog.userAgent.compare=function(o,t){return goog.string.compareVersions(o,t)};goog.userAgent.isVersionOrHigherCache_={};goog.userAgent.isVersionOrHigher=function(o){return goog.userAgent.ASSUME_ANY_VERSION||goog.reflect.cache(goog.userAgent.isVersionOrHigherCache_,o,function(){return 0<=goog.string.compareVersions(goog.userAgent.VERSION,o)})};goog.userAgent.isVersion=goog.userAgent.isVersionOrHigher;goog.userAgent.isDocumentModeOrHigher=function(o){return Number(goog.userAgent.DOCUMENT_MODE)>=o};goog.userAgent.isDocumentMode=goog.userAgent.isDocumentModeOrHigher;goog.userAgent.DOCUMENT_MODE=function(){if(goog.global.document&&goog.userAgent.IE)return goog.userAgent.getDocumentMode_()}();goog.userAgent.product={};goog.userAgent.product.ASSUME_FIREFOX=!1;goog.userAgent.product.ASSUME_IPHONE=!1;goog.userAgent.product.ASSUME_IPAD=!1;goog.userAgent.product.ASSUME_ANDROID=!1;goog.userAgent.product.ASSUME_CHROME=!1;goog.userAgent.product.ASSUME_SAFARI=!1;goog.userAgent.product.PRODUCT_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_EDGE||goog.userAgent.ASSUME_OPERA||goog.userAgent.product.ASSUME_FIREFOX||goog.userAgent.product.ASSUME_IPHONE||goog.userAgent.product.ASSUME_IPAD||goog.userAgent.product.ASSUME_ANDROID||goog.userAgent.product.ASSUME_CHROME||goog.userAgent.product.ASSUME_SAFARI;goog.userAgent.product.OPERA=goog.userAgent.OPERA;goog.userAgent.product.IE=goog.userAgent.IE;goog.userAgent.product.EDGE=goog.userAgent.EDGE;goog.userAgent.product.FIREFOX=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_FIREFOX:goog.labs.userAgent.browser.isFirefox();goog.userAgent.product.isIphoneOrIpod_=function(){return goog.labs.userAgent.platform.isIphone()||goog.labs.userAgent.platform.isIpod()};goog.userAgent.product.IPHONE=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPHONE:goog.userAgent.product.isIphoneOrIpod_();goog.userAgent.product.IPAD=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPAD:goog.labs.userAgent.platform.isIpad();goog.userAgent.product.ANDROID=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_ANDROID:goog.labs.userAgent.browser.isAndroidBrowser();goog.userAgent.product.CHROME=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_CHROME:goog.labs.userAgent.browser.isChrome();goog.userAgent.product.isSafariDesktop_=function(){return goog.labs.userAgent.browser.isSafari()&&!goog.labs.userAgent.platform.isIos()};goog.userAgent.product.SAFARI=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_SAFARI:goog.userAgent.product.isSafariDesktop_();goog.crypt.base64={};goog.crypt.base64.DEFAULT_ALPHABET_COMMON_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";goog.crypt.base64.ENCODED_VALS=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_+"+/=";goog.crypt.base64.ENCODED_VALS_WEBSAFE=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_+"-_.";goog.crypt.base64.Alphabet={DEFAULT:0,NO_PADDING:1,WEBSAFE:2,WEBSAFE_DOT_PADDING:3,WEBSAFE_NO_PADDING:4};goog.crypt.base64.paddingChars_="=.";goog.crypt.base64.isPadding_=function(o){return goog.string.contains(goog.crypt.base64.paddingChars_,o)};goog.crypt.base64.byteToCharMaps_={};goog.crypt.base64.charToByteMap_=null;goog.crypt.base64.ASSUME_NATIVE_SUPPORT_=goog.userAgent.GECKO||goog.userAgent.WEBKIT&&!goog.userAgent.product.SAFARI||goog.userAgent.OPERA;goog.crypt.base64.HAS_NATIVE_ENCODE_=goog.crypt.base64.ASSUME_NATIVE_SUPPORT_||typeof goog.global.btoa=="function";goog.crypt.base64.HAS_NATIVE_DECODE_=goog.crypt.base64.ASSUME_NATIVE_SUPPORT_||!goog.userAgent.product.SAFARI&&!goog.userAgent.IE&&typeof goog.global.atob=="function";goog.crypt.base64.encodeByteArray=function(o,t){goog.asserts.assert(goog.isArrayLike(o),"encodeByteArray takes an array as a parameter"),t===void 0&&(t=goog.crypt.base64.Alphabet.DEFAULT),goog.crypt.base64.init_(),t=goog.crypt.base64.byteToCharMaps_[t];for(var r=[],i=0;i<o.length;i+=3){var n=o[i],s=i+1<o.length,l=s?o[i+1]:0,g=i+2<o.length,p=g?o[i+2]:0,h=n>>2;n=(n&3)<<4|l>>4,l=(l&15)<<2|p>>6,p&=63,g||(p=64,s||(l=64)),r.push(t[h],t[n],t[l]||"",t[p]||"")}return r.join("")};goog.crypt.base64.encodeString=function(o,t){return goog.crypt.base64.HAS_NATIVE_ENCODE_&&!t?goog.global.btoa(o):goog.crypt.base64.encodeByteArray(goog.crypt.stringToByteArray(o),t)};goog.crypt.base64.decodeString=function(o,t){if(goog.crypt.base64.HAS_NATIVE_DECODE_&&!t)return goog.global.atob(o);var r="";return goog.crypt.base64.decodeStringInternal_(o,function(i){r+=String.fromCharCode(i)}),r};goog.crypt.base64.decodeStringToByteArray=function(o,t){var r=[];return goog.crypt.base64.decodeStringInternal_(o,function(i){r.push(i)}),r};goog.crypt.base64.decodeStringToUint8Array=function(o){goog.asserts.assert(!goog.userAgent.IE||goog.userAgent.isVersionOrHigher("10"),"Browser does not support typed arrays");var t=o.length,r=3*t/4;r%3?r=Math.floor(r):goog.crypt.base64.isPadding_(o[t-1])&&(r=goog.crypt.base64.isPadding_(o[t-2])?r-2:r-1);var i=new Uint8Array(r),n=0;return goog.crypt.base64.decodeStringInternal_(o,function(s){i[n++]=s}),i.subarray(0,n)};goog.crypt.base64.decodeStringInternal_=function(o,t){function r(p){for(;i<o.length;){var h=o.charAt(i++),E=goog.crypt.base64.charToByteMap_[h];if(E!=null)return E;if(!goog.string.isEmptyOrWhitespace(h))throw Error("Unknown base64 encoding at char: "+h)}return p}goog.crypt.base64.init_();for(var i=0;;){var n=r(-1),s=r(0),l=r(64),g=r(64);if(g===64&&n===-1)break;t(n<<2|s>>4),l!=64&&(t(s<<4&240|l>>2),g!=64&&t(l<<6&192|g))}};goog.crypt.base64.init_=function(){if(!goog.crypt.base64.charToByteMap_){goog.crypt.base64.charToByteMap_={};for(var o=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_.split(""),t=["+/=","+/","-_=","-_.","-_"],r=0;5>r;r++){var i=o.concat(t[r].split(""));goog.crypt.base64.byteToCharMaps_[r]=i;for(var n=0;n<i.length;n++){var s=i[n],l=goog.crypt.base64.charToByteMap_[s];l===void 0?goog.crypt.base64.charToByteMap_[s]=n:goog.asserts.assert(l===n)}}}};jspb.utils={};jspb.utils.split64Low=0;jspb.utils.split64High=0;jspb.utils.splitUint64=function(o){var t=o>>>0;o=Math.floor((o-t)/jspb.BinaryConstants.TWO_TO_32)>>>0,jspb.utils.split64Low=t,jspb.utils.split64High=o};jspb.utils.splitInt64=function(o){var t=0>o;o=Math.abs(o);var r=o>>>0;o=Math.floor((o-r)/jspb.BinaryConstants.TWO_TO_32),o>>>=0,t&&(o=~o>>>0,r=(~r>>>0)+1,4294967295<r&&(r=0,o++,4294967295<o&&(o=0))),jspb.utils.split64Low=r,jspb.utils.split64High=o};jspb.utils.splitZigzag64=function(o){var t=0>o;o=2*Math.abs(o),jspb.utils.splitUint64(o),o=jspb.utils.split64Low;var r=jspb.utils.split64High;t&&(o==0?r==0?r=o=4294967295:(r--,o=4294967295):o--),jspb.utils.split64Low=o,jspb.utils.split64High=r};jspb.utils.splitFloat32=function(o){var t=0>o?1:0;if(o=t?-o:o,o===0)0<1/o?(jspb.utils.split64High=0,jspb.utils.split64Low=0):(jspb.utils.split64High=0,jspb.utils.split64Low=2147483648);else if(isNaN(o))jspb.utils.split64High=0,jspb.utils.split64Low=2147483647;else if(o>jspb.BinaryConstants.FLOAT32_MAX)jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|2139095040)>>>0;else if(o<jspb.BinaryConstants.FLOAT32_MIN)o=Math.round(o/Math.pow(2,-149)),jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|o)>>>0;else{var r=Math.floor(Math.log(o)/Math.LN2);o*=Math.pow(2,-r),o=Math.round(o*jspb.BinaryConstants.TWO_TO_23)&8388607,jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|r+127<<23|o)>>>0}};jspb.utils.splitFloat64=function(o){var t=0>o?1:0;if(o=t?-o:o,o===0)jspb.utils.split64High=0<1/o?0:2147483648,jspb.utils.split64Low=0;else if(isNaN(o))jspb.utils.split64High=2147483647,jspb.utils.split64Low=4294967295;else if(o>jspb.BinaryConstants.FLOAT64_MAX)jspb.utils.split64High=(t<<31|2146435072)>>>0,jspb.utils.split64Low=0;else if(o<jspb.BinaryConstants.FLOAT64_MIN){var r=o/Math.pow(2,-1074);o=r/jspb.BinaryConstants.TWO_TO_32,jspb.utils.split64High=(t<<31|o)>>>0,jspb.utils.split64Low=r>>>0}else{r=o;var i=0;if(2<=r)for(;2<=r&&1023>i;)i++,r/=2;else for(;1>r&&-1022<i;)r*=2,i--;r=o*Math.pow(2,-i),o=r*jspb.BinaryConstants.TWO_TO_20&1048575,r=r*jspb.BinaryConstants.TWO_TO_52>>>0,jspb.utils.split64High=(t<<31|i+1023<<20|o)>>>0,jspb.utils.split64Low=r}};jspb.utils.splitHash64=function(o){var t=o.charCodeAt(0),r=o.charCodeAt(1),i=o.charCodeAt(2),n=o.charCodeAt(3),s=o.charCodeAt(4),l=o.charCodeAt(5),g=o.charCodeAt(6);o=o.charCodeAt(7),jspb.utils.split64Low=t+(r<<8)+(i<<16)+(n<<24)>>>0,jspb.utils.split64High=s+(l<<8)+(g<<16)+(o<<24)>>>0};jspb.utils.joinUint64=function(o,t){return t*jspb.BinaryConstants.TWO_TO_32+(o>>>0)};jspb.utils.joinInt64=function(o,t){var r=t&2147483648;return r&&(o=~o+1>>>0,t=~t>>>0,o==0&&(t=t+1>>>0)),o=jspb.utils.joinUint64(o,t),r?-o:o};jspb.utils.toZigzag64=function(o,t,r){var i=t>>31;return r(o<<1^i,(t<<1|o>>>31)^i)};jspb.utils.joinZigzag64=function(o,t){return jspb.utils.fromZigzag64(o,t,jspb.utils.joinInt64)};jspb.utils.fromZigzag64=function(o,t,r){var i=-(o&1);return r((o>>>1|t<<31)^i,t>>>1^i)};jspb.utils.joinFloat32=function(o,t){t=2*(o>>31)+1;var r=o>>>23&255;return o&=8388607,r==255?o?NaN:1/0*t:r==0?t*Math.pow(2,-149)*o:t*Math.pow(2,r-150)*(o+Math.pow(2,23))};jspb.utils.joinFloat64=function(o,t){var r=2*(t>>31)+1,i=t>>>20&2047;return o=jspb.BinaryConstants.TWO_TO_32*(t&1048575)+o,i==2047?o?NaN:1/0*r:i==0?r*Math.pow(2,-1074)*o:r*Math.pow(2,i-1075)*(o+jspb.BinaryConstants.TWO_TO_52)};jspb.utils.joinHash64=function(o,t){return String.fromCharCode(o>>>0&255,o>>>8&255,o>>>16&255,o>>>24&255,t>>>0&255,t>>>8&255,t>>>16&255,t>>>24&255)};jspb.utils.DIGITS="0123456789abcdef".split("");jspb.utils.ZERO_CHAR_CODE_=48;jspb.utils.A_CHAR_CODE_=97;jspb.utils.joinUnsignedDecimalString=function(o,t){function r(n,s){return n=n?String(n):"",s?"0000000".slice(n.length)+n:n}if(2097151>=t)return""+(jspb.BinaryConstants.TWO_TO_32*t+o);var i=(o>>>24|t<<8)>>>0&16777215;return t=t>>16&65535,o=(o&16777215)+6777216*i+6710656*t,i+=8147497*t,t*=2,1e7<=o&&(i+=Math.floor(o/1e7),o%=1e7),1e7<=i&&(t+=Math.floor(i/1e7),i%=1e7),r(t,0)+r(i,t)+r(o,1)};jspb.utils.joinSignedDecimalString=function(o,t){var r=t&2147483648;return r&&(o=~o+1>>>0,t=~t+(o==0?1:0)>>>0),o=jspb.utils.joinUnsignedDecimalString(o,t),r?"-"+o:o};jspb.utils.hash64ToDecimalString=function(o,t){jspb.utils.splitHash64(o),o=jspb.utils.split64Low;var r=jspb.utils.split64High;return t?jspb.utils.joinSignedDecimalString(o,r):jspb.utils.joinUnsignedDecimalString(o,r)};jspb.utils.hash64ArrayToDecimalStrings=function(o,t){for(var r=Array(o.length),i=0;i<o.length;i++)r[i]=jspb.utils.hash64ToDecimalString(o[i],t);return r};jspb.utils.decimalStringToHash64=function(o){function t(l,g){for(var p=0;8>p&&(l!==1||0<g);p++)g=l*n[p]+g,n[p]=g&255,g>>>=8}function r(){for(var l=0;8>l;l++)n[l]=~n[l]&255}goog.asserts.assert(0<o.length);var i=!1;o[0]==="-"&&(i=!0,o=o.slice(1));for(var n=[0,0,0,0,0,0,0,0],s=0;s<o.length;s++)t(10,o.charCodeAt(s)-jspb.utils.ZERO_CHAR_CODE_);return i&&(r(),t(1,1)),goog.crypt.byteArrayToString(n)};jspb.utils.splitDecimalString=function(o){jspb.utils.splitHash64(jspb.utils.decimalStringToHash64(o))};jspb.utils.toHexDigit_=function(o){return String.fromCharCode(10>o?jspb.utils.ZERO_CHAR_CODE_+o:jspb.utils.A_CHAR_CODE_-10+o)};jspb.utils.fromHexCharCode_=function(o){return o>=jspb.utils.A_CHAR_CODE_?o-jspb.utils.A_CHAR_CODE_+10:o-jspb.utils.ZERO_CHAR_CODE_};jspb.utils.hash64ToHexString=function(o){var t=Array(18);t[0]="0",t[1]="x";for(var r=0;8>r;r++){var i=o.charCodeAt(7-r);t[2*r+2]=jspb.utils.toHexDigit_(i>>4),t[2*r+3]=jspb.utils.toHexDigit_(i&15)}return t.join("")};jspb.utils.hexStringToHash64=function(o){o=o.toLowerCase(),goog.asserts.assert(o.length==18),goog.asserts.assert(o[0]=="0"),goog.asserts.assert(o[1]=="x");for(var t="",r=0;8>r;r++){var i=jspb.utils.fromHexCharCode_(o.charCodeAt(2*r+2)),n=jspb.utils.fromHexCharCode_(o.charCodeAt(2*r+3));t=String.fromCharCode(16*i+n)+t}return t};jspb.utils.hash64ToNumber=function(o,t){jspb.utils.splitHash64(o),o=jspb.utils.split64Low;var r=jspb.utils.split64High;return t?jspb.utils.joinInt64(o,r):jspb.utils.joinUint64(o,r)};jspb.utils.numberToHash64=function(o){return jspb.utils.splitInt64(o),jspb.utils.joinHash64(jspb.utils.split64Low,jspb.utils.split64High)};jspb.utils.countVarints=function(o,t,r){for(var i=0,n=t;n<r;n++)i+=o[n]>>7;return r-t-i};jspb.utils.countVarintFields=function(o,t,r,i){var n=0;if(i=8*i+jspb.BinaryConstants.WireType.VARINT,128>i)for(;t<r&&o[t++]==i;)for(n++;;){var s=o[t++];if((s&128)==0)break}else for(;t<r;){for(s=i;128<s;){if(o[t]!=(s&127|128))return n;t++,s>>=7}if(o[t++]!=s)break;for(n++;s=o[t++],(s&128)!=0;);}return n};jspb.utils.countFixedFields_=function(o,t,r,i,n){var s=0;if(128>i)for(;t<r&&o[t++]==i;)s++,t+=n;else for(;t<r;){for(var l=i;128<l;){if(o[t++]!=(l&127|128))return s;l>>=7}if(o[t++]!=l)break;s++,t+=n}return s};jspb.utils.countFixed32Fields=function(o,t,r,i){return jspb.utils.countFixedFields_(o,t,r,8*i+jspb.BinaryConstants.WireType.FIXED32,4)};jspb.utils.countFixed64Fields=function(o,t,r,i){return jspb.utils.countFixedFields_(o,t,r,8*i+jspb.BinaryConstants.WireType.FIXED64,8)};jspb.utils.countDelimitedFields=function(o,t,r,i){var n=0;for(i=8*i+jspb.BinaryConstants.WireType.DELIMITED;t<r;){for(var s=i;128<s;){if(o[t++]!=(s&127|128))return n;s>>=7}if(o[t++]!=s)break;n++;for(var l=0,g=1;s=o[t++],l+=(s&127)*g,g*=128,(s&128)!=0;);t+=l}return n};jspb.utils.debugBytesToTextFormat=function(o){var t='"';if(o){o=jspb.utils.byteSourceToUint8Array(o);for(var r=0;r<o.length;r++)t+="\\x",16>o[r]&&(t+="0"),t+=o[r].toString(16)}return t+'"'};jspb.utils.debugScalarToTextFormat=function(o){return typeof o=="string"?goog.string.quote(o):o.toString()};jspb.utils.stringToByteArray=function(o){for(var t=new Uint8Array(o.length),r=0;r<o.length;r++){var i=o.charCodeAt(r);if(255<i)throw Error("Conversion error: string contains codepoint outside of byte range");t[r]=i}return t};jspb.utils.byteSourceToUint8Array=function(o){return o.constructor===Uint8Array?o:o.constructor===ArrayBuffer||typeof Buffer<"u"&&o.constructor===Buffer||o.constructor===Array?new Uint8Array(o):o.constructor===String?goog.crypt.base64.decodeStringToUint8Array(o):(goog.asserts.fail("Type not convertible to Uint8Array."),new Uint8Array(0))};jspb.BinaryDecoder=function(o,t,r){this.bytes_=null,this.cursor_=this.end_=this.start_=0,this.error_=!1,o&&this.setBlock(o,t,r)};jspb.BinaryDecoder.instanceCache_=[];jspb.BinaryDecoder.alloc=function(o,t,r){if(jspb.BinaryDecoder.instanceCache_.length){var i=jspb.BinaryDecoder.instanceCache_.pop();return o&&i.setBlock(o,t,r),i}return new jspb.BinaryDecoder(o,t,r)};jspb.BinaryDecoder.prototype.free=function(){this.clear(),100>jspb.BinaryDecoder.instanceCache_.length&&jspb.BinaryDecoder.instanceCache_.push(this)};jspb.BinaryDecoder.prototype.clone=function(){return jspb.BinaryDecoder.alloc(this.bytes_,this.start_,this.end_-this.start_)};jspb.BinaryDecoder.prototype.clear=function(){this.bytes_=null,this.cursor_=this.end_=this.start_=0,this.error_=!1};jspb.BinaryDecoder.prototype.getBuffer=function(){return this.bytes_};jspb.BinaryDecoder.prototype.setBlock=function(o,t,r){this.bytes_=jspb.utils.byteSourceToUint8Array(o),this.start_=t!==void 0?t:0,this.end_=r!==void 0?this.start_+r:this.bytes_.length,this.cursor_=this.start_};jspb.BinaryDecoder.prototype.getEnd=function(){return this.end_};jspb.BinaryDecoder.prototype.setEnd=function(o){this.end_=o};jspb.BinaryDecoder.prototype.reset=function(){this.cursor_=this.start_};jspb.BinaryDecoder.prototype.getCursor=function(){return this.cursor_};jspb.BinaryDecoder.prototype.setCursor=function(o){this.cursor_=o};jspb.BinaryDecoder.prototype.advance=function(o){this.cursor_+=o,goog.asserts.assert(this.cursor_<=this.end_)};jspb.BinaryDecoder.prototype.atEnd=function(){return this.cursor_==this.end_};jspb.BinaryDecoder.prototype.pastEnd=function(){return this.cursor_>this.end_};jspb.BinaryDecoder.prototype.getError=function(){return this.error_||0>this.cursor_||this.cursor_>this.end_};jspb.BinaryDecoder.prototype.readSplitVarint64=function(o){for(var t=128,r=0,i=0,n=0;4>n&&128<=t;n++)t=this.bytes_[this.cursor_++],r|=(t&127)<<7*n;if(128<=t&&(t=this.bytes_[this.cursor_++],r|=(t&127)<<28,i|=(t&127)>>4),128<=t)for(n=0;5>n&&128<=t;n++)t=this.bytes_[this.cursor_++],i|=(t&127)<<7*n+3;if(128>t)return o(r>>>0,i>>>0);goog.asserts.fail("Failed to read varint, encoding is invalid."),this.error_=!0};jspb.BinaryDecoder.prototype.readSplitZigzagVarint64=function(o){return this.readSplitVarint64(function(t,r){return jspb.utils.fromZigzag64(t,r,o)})};jspb.BinaryDecoder.prototype.readSplitFixed64=function(o){var t=this.bytes_,r=this.cursor_;this.cursor_+=8;for(var i=0,n=0,s=r+7;s>=r;s--)i=i<<8|t[s],n=n<<8|t[s+4];return o(i,n)};jspb.BinaryDecoder.prototype.skipVarint=function(){for(;this.bytes_[this.cursor_]&128;)this.cursor_++;this.cursor_++};jspb.BinaryDecoder.prototype.unskipVarint=function(o){for(;128<o;)this.cursor_--,o>>>=7;this.cursor_--};jspb.BinaryDecoder.prototype.readUnsignedVarint32=function(){var o=this.bytes_,t=o[this.cursor_+0],r=t&127;return 128>t?(this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),r):(t=o[this.cursor_+1],r|=(t&127)<<7,128>t?(this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),r):(t=o[this.cursor_+2],r|=(t&127)<<14,128>t?(this.cursor_+=3,goog.asserts.assert(this.cursor_<=this.end_),r):(t=o[this.cursor_+3],r|=(t&127)<<21,128>t?(this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),r):(t=o[this.cursor_+4],r|=(t&15)<<28,128>t?(this.cursor_+=5,goog.asserts.assert(this.cursor_<=this.end_),r>>>0):(this.cursor_+=5,128<=o[this.cursor_++]&&128<=o[this.cursor_++]&&128<=o[this.cursor_++]&&128<=o[this.cursor_++]&&128<=o[this.cursor_++]&&goog.asserts.assert(!1),goog.asserts.assert(this.cursor_<=this.end_),r)))))};jspb.BinaryDecoder.prototype.readSignedVarint32=jspb.BinaryDecoder.prototype.readUnsignedVarint32;jspb.BinaryDecoder.prototype.readUnsignedVarint32String=function(){return this.readUnsignedVarint32().toString()};jspb.BinaryDecoder.prototype.readSignedVarint32String=function(){return this.readSignedVarint32().toString()};jspb.BinaryDecoder.prototype.readZigzagVarint32=function(){var o=this.readUnsignedVarint32();return o>>>1^-(o&1)};jspb.BinaryDecoder.prototype.readUnsignedVarint64=function(){return this.readSplitVarint64(jspb.utils.joinUint64)};jspb.BinaryDecoder.prototype.readUnsignedVarint64String=function(){return this.readSplitVarint64(jspb.utils.joinUnsignedDecimalString)};jspb.BinaryDecoder.prototype.readSignedVarint64=function(){return this.readSplitVarint64(jspb.utils.joinInt64)};jspb.BinaryDecoder.prototype.readSignedVarint64String=function(){return this.readSplitVarint64(jspb.utils.joinSignedDecimalString)};jspb.BinaryDecoder.prototype.readZigzagVarint64=function(){return this.readSplitVarint64(jspb.utils.joinZigzag64)};jspb.BinaryDecoder.prototype.readZigzagVarintHash64=function(){return this.readSplitZigzagVarint64(jspb.utils.joinHash64)};jspb.BinaryDecoder.prototype.readZigzagVarint64String=function(){return this.readSplitZigzagVarint64(jspb.utils.joinSignedDecimalString)};jspb.BinaryDecoder.prototype.readUint8=function(){var o=this.bytes_[this.cursor_+0];return this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),o};jspb.BinaryDecoder.prototype.readUint16=function(){var o=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1];return this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),o<<0|t<<8};jspb.BinaryDecoder.prototype.readUint32=function(){var o=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1],r=this.bytes_[this.cursor_+2],i=this.bytes_[this.cursor_+3];return this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),(o<<0|t<<8|r<<16|i<<24)>>>0};jspb.BinaryDecoder.prototype.readUint64=function(){var o=this.readUint32(),t=this.readUint32();return jspb.utils.joinUint64(o,t)};jspb.BinaryDecoder.prototype.readUint64String=function(){var o=this.readUint32(),t=this.readUint32();return jspb.utils.joinUnsignedDecimalString(o,t)};jspb.BinaryDecoder.prototype.readInt8=function(){var o=this.bytes_[this.cursor_+0];return this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),o<<24>>24};jspb.BinaryDecoder.prototype.readInt16=function(){var o=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1];return this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),(o<<0|t<<8)<<16>>16};jspb.BinaryDecoder.prototype.readInt32=function(){var o=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1],r=this.bytes_[this.cursor_+2],i=this.bytes_[this.cursor_+3];return this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),o<<0|t<<8|r<<16|i<<24};jspb.BinaryDecoder.prototype.readInt64=function(){var o=this.readUint32(),t=this.readUint32();return jspb.utils.joinInt64(o,t)};jspb.BinaryDecoder.prototype.readInt64String=function(){var o=this.readUint32(),t=this.readUint32();return jspb.utils.joinSignedDecimalString(o,t)};jspb.BinaryDecoder.prototype.readFloat=function(){var o=this.readUint32();return jspb.utils.joinFloat32(o,0)};jspb.BinaryDecoder.prototype.readDouble=function(){var o=this.readUint32(),t=this.readUint32();return jspb.utils.joinFloat64(o,t)};jspb.BinaryDecoder.prototype.readBool=function(){return!!this.bytes_[this.cursor_++]};jspb.BinaryDecoder.prototype.readEnum=function(){return this.readSignedVarint32()};jspb.BinaryDecoder.prototype.readString=function(o){var t=this.bytes_,r=this.cursor_;o=r+o;for(var i=[],n="";r<o;){var s=t[r++];if(128>s)i.push(s);else{if(192>s)continue;if(224>s){var l=t[r++];i.push((s&31)<<6|l&63)}else if(240>s){l=t[r++];var g=t[r++];i.push((s&15)<<12|(l&63)<<6|g&63)}else if(248>s){l=t[r++],g=t[r++];var p=t[r++];s=(s&7)<<18|(l&63)<<12|(g&63)<<6|p&63,s-=65536,i.push((s>>10&1023)+55296,(s&1023)+56320)}}8192<=i.length&&(n+=String.fromCharCode.apply(null,i),i.length=0)}return n+=goog.crypt.byteArrayToString(i),this.cursor_=r,n};jspb.BinaryDecoder.prototype.readStringWithLength=function(){var o=this.readUnsignedVarint32();return this.readString(o)};jspb.BinaryDecoder.prototype.readBytes=function(o){if(0>o||this.cursor_+o>this.bytes_.length)return this.error_=!0,goog.asserts.fail("Invalid byte length!"),new Uint8Array(0);var t=this.bytes_.subarray(this.cursor_,this.cursor_+o);return this.cursor_+=o,goog.asserts.assert(this.cursor_<=this.end_),t};jspb.BinaryDecoder.prototype.readVarintHash64=function(){return this.readSplitVarint64(jspb.utils.joinHash64)};jspb.BinaryDecoder.prototype.readFixedHash64=function(){var o=this.bytes_,t=this.cursor_,r=o[t+0],i=o[t+1],n=o[t+2],s=o[t+3],l=o[t+4],g=o[t+5],p=o[t+6];return o=o[t+7],this.cursor_+=8,String.fromCharCode(r,i,n,s,l,g,p,o)};jspb.BinaryReader=function(o,t,r){this.decoder_=jspb.BinaryDecoder.alloc(o,t,r),this.fieldCursor_=this.decoder_.getCursor(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID,this.error_=!1,this.readCallbacks_=null};jspb.BinaryReader.instanceCache_=[];jspb.BinaryReader.alloc=function(o,t,r){if(jspb.BinaryReader.instanceCache_.length){var i=jspb.BinaryReader.instanceCache_.pop();return o&&i.decoder_.setBlock(o,t,r),i}return new jspb.BinaryReader(o,t,r)};jspb.BinaryReader.prototype.alloc=jspb.BinaryReader.alloc;jspb.BinaryReader.prototype.free=function(){this.decoder_.clear(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID,this.error_=!1,this.readCallbacks_=null,100>jspb.BinaryReader.instanceCache_.length&&jspb.BinaryReader.instanceCache_.push(this)};jspb.BinaryReader.prototype.getFieldCursor=function(){return this.fieldCursor_};jspb.BinaryReader.prototype.getCursor=function(){return this.decoder_.getCursor()};jspb.BinaryReader.prototype.getBuffer=function(){return this.decoder_.getBuffer()};jspb.BinaryReader.prototype.getFieldNumber=function(){return this.nextField_};jspb.BinaryReader.prototype.getWireType=function(){return this.nextWireType_};jspb.BinaryReader.prototype.isDelimited=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED};jspb.BinaryReader.prototype.isEndGroup=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP};jspb.BinaryReader.prototype.getError=function(){return this.error_||this.decoder_.getError()};jspb.BinaryReader.prototype.setBlock=function(o,t,r){this.decoder_.setBlock(o,t,r),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID};jspb.BinaryReader.prototype.reset=function(){this.decoder_.reset(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID};jspb.BinaryReader.prototype.advance=function(o){this.decoder_.advance(o)};jspb.BinaryReader.prototype.nextField=function(){if(this.decoder_.atEnd())return!1;if(this.getError())return goog.asserts.fail("Decoder hit an error"),!1;this.fieldCursor_=this.decoder_.getCursor();var o=this.decoder_.readUnsignedVarint32(),t=o>>>3;return o&=7,o!=jspb.BinaryConstants.WireType.VARINT&&o!=jspb.BinaryConstants.WireType.FIXED32&&o!=jspb.BinaryConstants.WireType.FIXED64&&o!=jspb.BinaryConstants.WireType.DELIMITED&&o!=jspb.BinaryConstants.WireType.START_GROUP&&o!=jspb.BinaryConstants.WireType.END_GROUP?(goog.asserts.fail("Invalid wire type: %s (at position %s)",o,this.fieldCursor_),this.error_=!0,!1):(this.nextField_=t,this.nextWireType_=o,!0)};jspb.BinaryReader.prototype.unskipHeader=function(){this.decoder_.unskipVarint(this.nextField_<<3|this.nextWireType_)};jspb.BinaryReader.prototype.skipMatchingFields=function(){var o=this.nextField_;for(this.unskipHeader();this.nextField()&&this.getFieldNumber()==o;)this.skipField();this.decoder_.atEnd()||this.unskipHeader()};jspb.BinaryReader.prototype.skipVarintField=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.VARINT?(goog.asserts.fail("Invalid wire type for skipVarintField"),this.skipField()):this.decoder_.skipVarint()};jspb.BinaryReader.prototype.skipDelimitedField=function(){if(this.nextWireType_!=jspb.BinaryConstants.WireType.DELIMITED)goog.asserts.fail("Invalid wire type for skipDelimitedField"),this.skipField();else{var o=this.decoder_.readUnsignedVarint32();this.decoder_.advance(o)}};jspb.BinaryReader.prototype.skipFixed32Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED32?(goog.asserts.fail("Invalid wire type for skipFixed32Field"),this.skipField()):this.decoder_.advance(4)};jspb.BinaryReader.prototype.skipFixed64Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED64?(goog.asserts.fail("Invalid wire type for skipFixed64Field"),this.skipField()):this.decoder_.advance(8)};jspb.BinaryReader.prototype.skipGroup=function(){var o=this.nextField_;do{if(!this.nextField()){goog.asserts.fail("Unmatched start-group tag: stream EOF"),this.error_=!0;break}if(this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP){this.nextField_!=o&&(goog.asserts.fail("Unmatched end-group tag"),this.error_=!0);break}this.skipField()}while(1)};jspb.BinaryReader.prototype.skipField=function(){switch(this.nextWireType_){case jspb.BinaryConstants.WireType.VARINT:this.skipVarintField();break;case jspb.BinaryConstants.WireType.FIXED64:this.skipFixed64Field();break;case jspb.BinaryConstants.WireType.DELIMITED:this.skipDelimitedField();break;case jspb.BinaryConstants.WireType.FIXED32:this.skipFixed32Field();break;case jspb.BinaryConstants.WireType.START_GROUP:this.skipGroup();break;default:goog.asserts.fail("Invalid wire encoding for field.")}};jspb.BinaryReader.prototype.registerReadCallback=function(o,t){this.readCallbacks_===null&&(this.readCallbacks_={}),goog.asserts.assert(!this.readCallbacks_[o]),this.readCallbacks_[o]=t};jspb.BinaryReader.prototype.runReadCallback=function(o){return goog.asserts.assert(this.readCallbacks_!==null),o=this.readCallbacks_[o],goog.asserts.assert(o),o(this)};jspb.BinaryReader.prototype.readAny=function(o){this.nextWireType_=jspb.BinaryConstants.FieldTypeToWireType(o);var t=jspb.BinaryConstants.FieldType;switch(o){case t.DOUBLE:return this.readDouble();case t.FLOAT:return this.readFloat();case t.INT64:return this.readInt64();case t.UINT64:return this.readUint64();case t.INT32:return this.readInt32();case t.FIXED64:return this.readFixed64();case t.FIXED32:return this.readFixed32();case t.BOOL:return this.readBool();case t.STRING:return this.readString();case t.GROUP:goog.asserts.fail("Group field type not supported in readAny()");case t.MESSAGE:goog.asserts.fail("Message field type not supported in readAny()");case t.BYTES:return this.readBytes();case t.UINT32:return this.readUint32();case t.ENUM:return this.readEnum();case t.SFIXED32:return this.readSfixed32();case t.SFIXED64:return this.readSfixed64();case t.SINT32:return this.readSint32();case t.SINT64:return this.readSint64();case t.FHASH64:return this.readFixedHash64();case t.VHASH64:return this.readVarintHash64();default:goog.asserts.fail("Invalid field type in readAny()")}return 0};jspb.BinaryReader.prototype.readMessage=function(o,t){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var r=this.decoder_.getEnd(),i=this.decoder_.readUnsignedVarint32();i=this.decoder_.getCursor()+i,this.decoder_.setEnd(i),t(o,this),this.decoder_.setCursor(i),this.decoder_.setEnd(r)};jspb.BinaryReader.prototype.readGroup=function(o,t,r){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.START_GROUP),goog.asserts.assert(this.nextField_==o),r(t,this),this.error_||this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP||(goog.asserts.fail("Group submessage did not end with an END_GROUP tag"),this.error_=!0)};jspb.BinaryReader.prototype.getFieldDecoder=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var o=this.decoder_.readUnsignedVarint32(),t=this.decoder_.getCursor(),r=t+o;return o=jspb.BinaryDecoder.alloc(this.decoder_.getBuffer(),t,o),this.decoder_.setCursor(r),o};jspb.BinaryReader.prototype.readInt32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint32()};jspb.BinaryReader.prototype.readInt32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint32String()};jspb.BinaryReader.prototype.readInt64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64()};jspb.BinaryReader.prototype.readInt64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64String()};jspb.BinaryReader.prototype.readUint32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint32()};jspb.BinaryReader.prototype.readUint32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint32String()};jspb.BinaryReader.prototype.readUint64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint64()};jspb.BinaryReader.prototype.readUint64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint64String()};jspb.BinaryReader.prototype.readSint32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint32()};jspb.BinaryReader.prototype.readSint64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint64()};jspb.BinaryReader.prototype.readSint64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint64String()};jspb.BinaryReader.prototype.readFixed32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readUint32()};jspb.BinaryReader.prototype.readFixed64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readUint64()};jspb.BinaryReader.prototype.readFixed64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readUint64String()};jspb.BinaryReader.prototype.readSfixed32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readInt32()};jspb.BinaryReader.prototype.readSfixed32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readInt32().toString()};jspb.BinaryReader.prototype.readSfixed64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readInt64()};jspb.BinaryReader.prototype.readSfixed64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readInt64String()};jspb.BinaryReader.prototype.readFloat=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readFloat()};jspb.BinaryReader.prototype.readDouble=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readDouble()};jspb.BinaryReader.prototype.readBool=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),!!this.decoder_.readUnsignedVarint32()};jspb.BinaryReader.prototype.readEnum=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64()};jspb.BinaryReader.prototype.readString=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var o=this.decoder_.readUnsignedVarint32();return this.decoder_.readString(o)};jspb.BinaryReader.prototype.readBytes=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var o=this.decoder_.readUnsignedVarint32();return this.decoder_.readBytes(o)};jspb.BinaryReader.prototype.readVarintHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readVarintHash64()};jspb.BinaryReader.prototype.readSintHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarintHash64()};jspb.BinaryReader.prototype.readSplitVarint64=function(o){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSplitVarint64(o)};jspb.BinaryReader.prototype.readSplitZigzagVarint64=function(o){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSplitVarint64(function(t,r){return jspb.utils.fromZigzag64(t,r,o)})};jspb.BinaryReader.prototype.readFixedHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readFixedHash64()};jspb.BinaryReader.prototype.readSplitFixed64=function(o){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readSplitFixed64(o)};jspb.BinaryReader.prototype.readPackedField_=function(o){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var t=this.decoder_.readUnsignedVarint32();t=this.decoder_.getCursor()+t;for(var r=[];this.decoder_.getCursor()<t;)r.push(o.call(this.decoder_));return r};jspb.BinaryReader.prototype.readPackedInt32=function(){return this.readPackedField_(this.decoder_.readSignedVarint32)};jspb.BinaryReader.prototype.readPackedInt32String=function(){return this.readPackedField_(this.decoder_.readSignedVarint32String)};jspb.BinaryReader.prototype.readPackedInt64=function(){return this.readPackedField_(this.decoder_.readSignedVarint64)};jspb.BinaryReader.prototype.readPackedInt64String=function(){return this.readPackedField_(this.decoder_.readSignedVarint64String)};jspb.BinaryReader.prototype.readPackedUint32=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint32)};jspb.BinaryReader.prototype.readPackedUint32String=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint32String)};jspb.BinaryReader.prototype.readPackedUint64=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint64)};jspb.BinaryReader.prototype.readPackedUint64String=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint64String)};jspb.BinaryReader.prototype.readPackedSint32=function(){return this.readPackedField_(this.decoder_.readZigzagVarint32)};jspb.BinaryReader.prototype.readPackedSint64=function(){return this.readPackedField_(this.decoder_.readZigzagVarint64)};jspb.BinaryReader.prototype.readPackedSint64String=function(){return this.readPackedField_(this.decoder_.readZigzagVarint64String)};jspb.BinaryReader.prototype.readPackedFixed32=function(){return this.readPackedField_(this.decoder_.readUint32)};jspb.BinaryReader.prototype.readPackedFixed64=function(){return this.readPackedField_(this.decoder_.readUint64)};jspb.BinaryReader.prototype.readPackedFixed64String=function(){return this.readPackedField_(this.decoder_.readUint64String)};jspb.BinaryReader.prototype.readPackedSfixed32=function(){return this.readPackedField_(this.decoder_.readInt32)};jspb.BinaryReader.prototype.readPackedSfixed64=function(){return this.readPackedField_(this.decoder_.readInt64)};jspb.BinaryReader.prototype.readPackedSfixed64String=function(){return this.readPackedField_(this.decoder_.readInt64String)};jspb.BinaryReader.prototype.readPackedFloat=function(){return this.readPackedField_(this.decoder_.readFloat)};jspb.BinaryReader.prototype.readPackedDouble=function(){return this.readPackedField_(this.decoder_.readDouble)};jspb.BinaryReader.prototype.readPackedBool=function(){return this.readPackedField_(this.decoder_.readBool)};jspb.BinaryReader.prototype.readPackedEnum=function(){return this.readPackedField_(this.decoder_.readEnum)};jspb.BinaryReader.prototype.readPackedVarintHash64=function(){return this.readPackedField_(this.decoder_.readVarintHash64)};jspb.BinaryReader.prototype.readPackedFixedHash64=function(){return this.readPackedField_(this.decoder_.readFixedHash64)};jspb.Map=function(o,t){this.arr_=o,this.valueCtor_=t,this.map_={},this.arrClean=!0,0<this.arr_.length&&this.loadFromArray_()};jspb.Map.prototype.loadFromArray_=function(){for(var o=0;o<this.arr_.length;o++){var t=this.arr_[o],r=t[0];this.map_[r.toString()]=new jspb.Map.Entry_(r,t[1])}this.arrClean=!0};jspb.Map.prototype.toArray=function(){if(this.arrClean){if(this.valueCtor_){var o=this.map_,t;for(t in o)if(Object.prototype.hasOwnProperty.call(o,t)){var r=o[t].valueWrapper;r&&r.toArray()}}}else{for(this.arr_.length=0,o=this.stringKeys_(),o.sort(),t=0;t<o.length;t++){var i=this.map_[o[t]];(r=i.valueWrapper)&&r.toArray(),this.arr_.push([i.key,i.value])}this.arrClean=!0}return this.arr_};jspb.Map.prototype.toObject=function(o,t){for(var r=this.toArray(),i=[],n=0;n<r.length;n++){var s=this.map_[r[n][0].toString()];this.wrapEntry_(s);var l=s.valueWrapper;l?(goog.asserts.assert(t),i.push([s.key,t(o,l)])):i.push([s.key,s.value])}return i};jspb.Map.fromObject=function(o,t,r){t=new jspb.Map([],t);for(var i=0;i<o.length;i++){var n=o[i][0],s=r(o[i][1]);t.set(n,s)}return t};jspb.Map.ArrayIteratorIterable_=function(o){this.idx_=0,this.arr_=o};jspb.Map.ArrayIteratorIterable_.prototype.next=function(){return this.idx_<this.arr_.length?{done:!1,value:this.arr_[this.idx_++]}:{done:!0,value:void 0}};typeof Symbol<"u"&&(jspb.Map.ArrayIteratorIterable_.prototype[Symbol.iterator]=function(){return this});jspb.Map.prototype.getLength=function(){return this.stringKeys_().length};jspb.Map.prototype.clear=function(){this.map_={},this.arrClean=!1};jspb.Map.prototype.del=function(o){o=o.toString();var t=this.map_.hasOwnProperty(o);return delete this.map_[o],this.arrClean=!1,t};jspb.Map.prototype.getEntryList=function(){var o=[],t=this.stringKeys_();t.sort();for(var r=0;r<t.length;r++){var i=this.map_[t[r]];o.push([i.key,i.value])}return o};jspb.Map.prototype.entries=function(){var o=[],t=this.stringKeys_();t.sort();for(var r=0;r<t.length;r++){var i=this.map_[t[r]];o.push([i.key,this.wrapEntry_(i)])}return new jspb.Map.ArrayIteratorIterable_(o)};jspb.Map.prototype.keys=function(){var o=[],t=this.stringKeys_();t.sort();for(var r=0;r<t.length;r++)o.push(this.map_[t[r]].key);return new jspb.Map.ArrayIteratorIterable_(o)};jspb.Map.prototype.values=function(){var o=[],t=this.stringKeys_();t.sort();for(var r=0;r<t.length;r++)o.push(this.wrapEntry_(this.map_[t[r]]));return new jspb.Map.ArrayIteratorIterable_(o)};jspb.Map.prototype.forEach=function(o,t){var r=this.stringKeys_();r.sort();for(var i=0;i<r.length;i++){var n=this.map_[r[i]];o.call(t,this.wrapEntry_(n),n.key,this)}};jspb.Map.prototype.set=function(o,t){var r=new jspb.Map.Entry_(o);return this.valueCtor_?(r.valueWrapper=t,r.value=t.toArray()):r.value=t,this.map_[o.toString()]=r,this.arrClean=!1,this};jspb.Map.prototype.wrapEntry_=function(o){return this.valueCtor_?(o.valueWrapper||(o.valueWrapper=new this.valueCtor_(o.value)),o.valueWrapper):o.value};jspb.Map.prototype.get=function(o){if(o=this.map_[o.toString()])return this.wrapEntry_(o)};jspb.Map.prototype.has=function(o){return o.toString()in this.map_};jspb.Map.prototype.serializeBinary=function(o,t,r,i,n){var s=this.stringKeys_();s.sort();for(var l=0;l<s.length;l++){var g=this.map_[s[l]];t.beginSubMessage(o),r.call(t,1,g.key),this.valueCtor_?i.call(t,2,this.wrapEntry_(g),n):i.call(t,2,g.value),t.endSubMessage()}};jspb.Map.deserializeBinary=function(o,t,r,i,n,s,l){for(;t.nextField()&&!t.isEndGroup();){var g=t.getFieldNumber();g==1?s=r.call(t):g==2&&(o.valueCtor_?(goog.asserts.assert(n),l||(l=new o.valueCtor_),i.call(t,l,n)):l=i.call(t))}goog.asserts.assert(s!=null),goog.asserts.assert(l!=null),o.set(s,l)};jspb.Map.prototype.stringKeys_=function(){var o=this.map_,t=[],r;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&t.push(r);return t};jspb.Map.Entry_=function(o,t){this.key=o,this.value=t,this.valueWrapper=void 0};jspb.ExtensionFieldInfo=function(o,t,r,i,n){this.fieldIndex=o,this.fieldName=t,this.ctor=r,this.toObjectFn=i,this.isRepeated=n};jspb.ExtensionFieldBinaryInfo=function(o,t,r,i,n,s){this.fieldInfo=o,this.binaryReaderFn=t,this.binaryWriterFn=r,this.binaryMessageSerializeFn=i,this.binaryMessageDeserializeFn=n,this.isPacked=s};jspb.ExtensionFieldInfo.prototype.isMessageType=function(){return!!this.ctor};jspb.Message=function(){};jspb.Message.GENERATE_TO_OBJECT=!0;jspb.Message.GENERATE_FROM_OBJECT=!goog.DISALLOW_TEST_ONLY_CODE;jspb.Message.GENERATE_TO_STRING=!0;jspb.Message.ASSUME_LOCAL_ARRAYS=!1;jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS=!0;jspb.Message.SUPPORTS_UINT8ARRAY_=typeof Uint8Array=="function";jspb.Message.prototype.getJsPbMessageId=function(){return this.messageId_};jspb.Message.getIndex_=function(o,t){return t+o.arrayIndexOffset_};jspb.Message.hiddenES6Property_=function(){};jspb.Message.getFieldNumber_=function(o,t){return t-o.arrayIndexOffset_};jspb.Message.initialize=function(o,t,r,i,n,s){if(o.wrappers_=null,t||(t=r?[r]:[]),o.messageId_=r?String(r):void 0,o.arrayIndexOffset_=r===0?-1:0,o.array=t,jspb.Message.initPivotAndExtensionObject_(o,i),o.convertedPrimitiveFields_={},jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS||(o.repeatedFields=n),n)for(t=0;t<n.length;t++)r=n[t],r<o.pivot_?(r=jspb.Message.getIndex_(o,r),o.array[r]=o.array[r]||jspb.Message.EMPTY_LIST_SENTINEL_):(jspb.Message.maybeInitEmptyExtensionObject_(o),o.extensionObject_[r]=o.extensionObject_[r]||jspb.Message.EMPTY_LIST_SENTINEL_);if(s&&s.length)for(t=0;t<s.length;t++)jspb.Message.computeOneofCase(o,s[t])};jspb.Message.EMPTY_LIST_SENTINEL_=goog.DEBUG&&Object.freeze?Object.freeze([]):[];jspb.Message.isArray_=function(o){return jspb.Message.ASSUME_LOCAL_ARRAYS?o instanceof Array:Array.isArray(o)};jspb.Message.isExtensionObject_=function(o){return o!==null&&typeof o=="object"&&!jspb.Message.isArray_(o)&&!(jspb.Message.SUPPORTS_UINT8ARRAY_&&o instanceof Uint8Array)};jspb.Message.initPivotAndExtensionObject_=function(o,t){var r=o.array.length,i=-1;if(r&&(i=r-1,r=o.array[i],jspb.Message.isExtensionObject_(r))){o.pivot_=jspb.Message.getFieldNumber_(o,i),o.extensionObject_=r;return}-1<t?(o.pivot_=Math.max(t,jspb.Message.getFieldNumber_(o,i+1)),o.extensionObject_=null):o.pivot_=Number.MAX_VALUE};jspb.Message.maybeInitEmptyExtensionObject_=function(o){var t=jspb.Message.getIndex_(o,o.pivot_);o.array[t]||(o.extensionObject_=o.array[t]={})};jspb.Message.toObjectList=function(o,t,r){for(var i=[],n=0;n<o.length;n++)i[n]=t.call(o[n],r,o[n]);return i};jspb.Message.toObjectExtension=function(o,t,r,i,n){for(var s in r){var l=r[s],g=i.call(o,l);if(g!=null){for(var p in l.fieldName)if(l.fieldName.hasOwnProperty(p))break;t[p]=l.toObjectFn?l.isRepeated?jspb.Message.toObjectList(g,l.toObjectFn,n):l.toObjectFn(n,g):g}}};jspb.Message.serializeBinaryExtensions=function(o,t,r,i){for(var n in r){var s=r[n],l=s.fieldInfo;if(!s.binaryWriterFn)throw Error("Message extension present that was generated without binary serialization support");var g=i.call(o,l);if(g!=null)if(l.isMessageType())if(s.binaryMessageSerializeFn)s.binaryWriterFn.call(t,l.fieldIndex,g,s.binaryMessageSerializeFn);else throw Error("Message extension present holding submessage without binary support enabled, and message is being serialized to binary format");else s.binaryWriterFn.call(t,l.fieldIndex,g)}};jspb.Message.readBinaryExtension=function(o,t,r,i,n){var s=r[t.getFieldNumber()];if(s){if(r=s.fieldInfo,!s.binaryReaderFn)throw Error("Deserializing extension whose generated code does not support binary format");if(r.isMessageType()){var l=new r.ctor;s.binaryReaderFn.call(t,l,s.binaryMessageDeserializeFn)}else l=s.binaryReaderFn.call(t);r.isRepeated&&!s.isPacked?(t=i.call(o,r))?t.push(l):n.call(o,r,[l]):n.call(o,r,l)}else t.skipField()};jspb.Message.getField=function(o,t){if(t<o.pivot_){t=jspb.Message.getIndex_(o,t);var r=o.array[t];return r===jspb.Message.EMPTY_LIST_SENTINEL_?o.array[t]=[]:r}if(o.extensionObject_)return r=o.extensionObject_[t],r===jspb.Message.EMPTY_LIST_SENTINEL_?o.extensionObject_[t]=[]:r};jspb.Message.getRepeatedField=function(o,t){return jspb.Message.getField(o,t)};jspb.Message.getOptionalFloatingPointField=function(o,t){return o=jspb.Message.getField(o,t),o==null?o:+o};jspb.Message.getBooleanField=function(o,t){return o=jspb.Message.getField(o,t),o==null?o:!!o};jspb.Message.getRepeatedFloatingPointField=function(o,t){var r=jspb.Message.getRepeatedField(o,t);if(o.convertedPrimitiveFields_||(o.convertedPrimitiveFields_={}),!o.convertedPrimitiveFields_[t]){for(var i=0;i<r.length;i++)r[i]=+r[i];o.convertedPrimitiveFields_[t]=!0}return r};jspb.Message.getRepeatedBooleanField=function(o,t){var r=jspb.Message.getRepeatedField(o,t);if(o.convertedPrimitiveFields_||(o.convertedPrimitiveFields_={}),!o.convertedPrimitiveFields_[t]){for(var i=0;i<r.length;i++)r[i]=!!r[i];o.convertedPrimitiveFields_[t]=!0}return r};jspb.Message.bytesAsB64=function(o){return o==null||typeof o=="string"?o:jspb.Message.SUPPORTS_UINT8ARRAY_&&o instanceof Uint8Array?goog.crypt.base64.encodeByteArray(o):(goog.asserts.fail("Cannot coerce to b64 string: "+goog.typeOf(o)),null)};jspb.Message.bytesAsU8=function(o){return o==null||o instanceof Uint8Array?o:typeof o=="string"?goog.crypt.base64.decodeStringToUint8Array(o):(goog.asserts.fail("Cannot coerce to Uint8Array: "+goog.typeOf(o)),null)};jspb.Message.bytesListAsB64=function(o){return jspb.Message.assertConsistentTypes_(o),o.length&&typeof o[0]!="string"?goog.array.map(o,jspb.Message.bytesAsB64):o};jspb.Message.bytesListAsU8=function(o){return jspb.Message.assertConsistentTypes_(o),!o.length||o[0]instanceof Uint8Array?o:goog.array.map(o,jspb.Message.bytesAsU8)};jspb.Message.assertConsistentTypes_=function(o){if(goog.DEBUG&&o&&1<o.length){var t=goog.typeOf(o[0]);goog.array.forEach(o,function(r){goog.typeOf(r)!=t&&goog.asserts.fail("Inconsistent type in JSPB repeated field array. Got "+goog.typeOf(r)+" expected "+t)})}};jspb.Message.getFieldWithDefault=function(o,t,r){return o=jspb.Message.getField(o,t),o??r};jspb.Message.getBooleanFieldWithDefault=function(o,t,r){return o=jspb.Message.getBooleanField(o,t),o??r};jspb.Message.getFloatingPointFieldWithDefault=function(o,t,r){return o=jspb.Message.getOptionalFloatingPointField(o,t),o??r};jspb.Message.getFieldProto3=jspb.Message.getFieldWithDefault;jspb.Message.getMapField=function(o,t,r,i){if(o.wrappers_||(o.wrappers_={}),t in o.wrappers_)return o.wrappers_[t];var n=jspb.Message.getField(o,t);if(!n){if(r)return;n=[],jspb.Message.setField(o,t,n)}return o.wrappers_[t]=new jspb.Map(n,i)};jspb.Message.setField=function(o,t,r){return goog.asserts.assertInstanceof(o,jspb.Message),t<o.pivot_?o.array[jspb.Message.getIndex_(o,t)]=r:(jspb.Message.maybeInitEmptyExtensionObject_(o),o.extensionObject_[t]=r),o};jspb.Message.setProto3IntField=function(o,t,r){return jspb.Message.setFieldIgnoringDefault_(o,t,r,0)};jspb.Message.setProto3FloatField=function(o,t,r){return jspb.Message.setFieldIgnoringDefault_(o,t,r,0)};jspb.Message.setProto3BooleanField=function(o,t,r){return jspb.Message.setFieldIgnoringDefault_(o,t,r,!1)};jspb.Message.setProto3StringField=function(o,t,r){return jspb.Message.setFieldIgnoringDefault_(o,t,r,"")};jspb.Message.setProto3BytesField=function(o,t,r){return jspb.Message.setFieldIgnoringDefault_(o,t,r,"")};jspb.Message.setProto3EnumField=function(o,t,r){return jspb.Message.setFieldIgnoringDefault_(o,t,r,0)};jspb.Message.setProto3StringIntField=function(o,t,r){return jspb.Message.setFieldIgnoringDefault_(o,t,r,"0")};jspb.Message.setFieldIgnoringDefault_=function(o,t,r,i){return goog.asserts.assertInstanceof(o,jspb.Message),r!==i?jspb.Message.setField(o,t,r):t<o.pivot_?o.array[jspb.Message.getIndex_(o,t)]=null:(jspb.Message.maybeInitEmptyExtensionObject_(o),delete o.extensionObject_[t]),o};jspb.Message.addToRepeatedField=function(o,t,r,i){return goog.asserts.assertInstanceof(o,jspb.Message),t=jspb.Message.getRepeatedField(o,t),i!=null?t.splice(i,0,r):t.push(r),o};jspb.Message.setOneofField=function(o,t,r,i){return goog.asserts.assertInstanceof(o,jspb.Message),(r=jspb.Message.computeOneofCase(o,r))&&r!==t&&i!==void 0&&(o.wrappers_&&r in o.wrappers_&&(o.wrappers_[r]=void 0),jspb.Message.setField(o,r,void 0)),jspb.Message.setField(o,t,i)};jspb.Message.computeOneofCase=function(o,t){for(var r,i,n=0;n<t.length;n++){var s=t[n],l=jspb.Message.getField(o,s);l!=null&&(r=s,i=l,jspb.Message.setField(o,s,void 0))}return r?(jspb.Message.setField(o,r,i),r):0};jspb.Message.getWrapperField=function(o,t,r,i){if(o.wrappers_||(o.wrappers_={}),!o.wrappers_[r]){var n=jspb.Message.getField(o,r);(i||n)&&(o.wrappers_[r]=new t(n))}return o.wrappers_[r]};jspb.Message.getRepeatedWrapperField=function(o,t,r){return jspb.Message.wrapRepeatedField_(o,t,r),t=o.wrappers_[r],t==jspb.Message.EMPTY_LIST_SENTINEL_&&(t=o.wrappers_[r]=[]),t};jspb.Message.wrapRepeatedField_=function(o,t,r){if(o.wrappers_||(o.wrappers_={}),!o.wrappers_[r]){for(var i=jspb.Message.getRepeatedField(o,r),n=[],s=0;s<i.length;s++)n[s]=new t(i[s]);o.wrappers_[r]=n}};jspb.Message.setWrapperField=function(o,t,r){goog.asserts.assertInstanceof(o,jspb.Message),o.wrappers_||(o.wrappers_={});var i=r&&r.toArray();return o.wrappers_[t]=r,jspb.Message.setField(o,t,i)};jspb.Message.setOneofWrapperField=function(o,t,r,i){goog.asserts.assertInstanceof(o,jspb.Message),o.wrappers_||(o.wrappers_={});var n=i&&i.toArray();return o.wrappers_[t]=i,jspb.Message.setOneofField(o,t,r,n)};jspb.Message.setRepeatedWrapperField=function(o,t,r){goog.asserts.assertInstanceof(o,jspb.Message),o.wrappers_||(o.wrappers_={}),r=r||[];for(var i=[],n=0;n<r.length;n++)i[n]=r[n].toArray();return o.wrappers_[t]=r,jspb.Message.setField(o,t,i)};jspb.Message.addToRepeatedWrapperField=function(o,t,r,i,n){jspb.Message.wrapRepeatedField_(o,i,t);var s=o.wrappers_[t];return s||(s=o.wrappers_[t]=[]),r=r||new i,o=jspb.Message.getRepeatedField(o,t),n!=null?(s.splice(n,0,r),o.splice(n,0,r.toArray())):(s.push(r),o.push(r.toArray())),r};jspb.Message.toMap=function(o,t,r,i){for(var n={},s=0;s<o.length;s++)n[t.call(o[s])]=r?r.call(o[s],i,o[s]):o[s];return n};jspb.Message.prototype.syncMapFields_=function(){if(this.wrappers_)for(var o in this.wrappers_){var t=this.wrappers_[o];if(Array.isArray(t))for(var r=0;r<t.length;r++)t[r]&&t[r].toArray();else t&&t.toArray()}};jspb.Message.prototype.toArray=function(){return this.syncMapFields_(),this.array};jspb.Message.GENERATE_TO_STRING&&(jspb.Message.prototype.toString=function(){return this.syncMapFields_(),this.array.toString()});jspb.Message.prototype.getExtension=function(o){if(this.extensionObject_){this.wrappers_||(this.wrappers_={});var t=o.fieldIndex;if(o.isRepeated){if(o.isMessageType())return this.wrappers_[t]||(this.wrappers_[t]=goog.array.map(this.extensionObject_[t]||[],function(r){return new o.ctor(r)})),this.wrappers_[t]}else if(o.isMessageType())return!this.wrappers_[t]&&this.extensionObject_[t]&&(this.wrappers_[t]=new o.ctor(this.extensionObject_[t])),this.wrappers_[t];return this.extensionObject_[t]}};jspb.Message.prototype.setExtension=function(o,t){this.wrappers_||(this.wrappers_={}),jspb.Message.maybeInitEmptyExtensionObject_(this);var r=o.fieldIndex;return o.isRepeated?(t=t||[],o.isMessageType()?(this.wrappers_[r]=t,this.extensionObject_[r]=goog.array.map(t,function(i){return i.toArray()})):this.extensionObject_[r]=t):o.isMessageType()?(this.wrappers_[r]=t,this.extensionObject_[r]=t&&t.toArray()):this.extensionObject_[r]=t,this};jspb.Message.difference=function(o,t){if(!(o instanceof t.constructor))throw Error("Messages have different types.");var r=o.toArray();t=t.toArray();var i=[],n=0,s=r.length>t.length?r.length:t.length;for(o.getJsPbMessageId()&&(i[0]=o.getJsPbMessageId(),n=1);n<s;n++)jspb.Message.compareFields(r[n],t[n])||(i[n]=t[n]);return new o.constructor(i)};jspb.Message.equals=function(o,t){return o==t||!(!o||!t)&&o instanceof t.constructor&&jspb.Message.compareFields(o.toArray(),t.toArray())};jspb.Message.compareExtensions=function(o,t){o=o||{},t=t||{};var r={},i;for(i in o)r[i]=0;for(i in t)r[i]=0;for(i in r)if(!jspb.Message.compareFields(o[i],t[i]))return!1;return!0};jspb.Message.compareFields=function(o,t){if(o==t)return!0;if(!goog.isObject(o)||!goog.isObject(t))return typeof o=="number"&&isNaN(o)||typeof t=="number"&&isNaN(t)?String(o)==String(t):!1;if(o.constructor!=t.constructor)return!1;if(jspb.Message.SUPPORTS_UINT8ARRAY_&&o.constructor===Uint8Array){if(o.length!=t.length)return!1;for(var r=0;r<o.length;r++)if(o[r]!=t[r])return!1;return!0}if(o.constructor===Array){var i=void 0,n=void 0,s=Math.max(o.length,t.length);for(r=0;r<s;r++){var l=o[r],g=t[r];if(l&&l.constructor==Object&&(goog.asserts.assert(i===void 0),goog.asserts.assert(r===o.length-1),i=l,l=void 0),g&&g.constructor==Object&&(goog.asserts.assert(n===void 0),goog.asserts.assert(r===t.length-1),n=g,g=void 0),!jspb.Message.compareFields(l,g))return!1}return i||n?(i=i||{},n=n||{},jspb.Message.compareExtensions(i,n)):!0}if(o.constructor===Object)return jspb.Message.compareExtensions(o,t);throw Error("Invalid type in JSPB array")};jspb.Message.prototype.cloneMessage=function(){return jspb.Message.cloneMessage(this)};jspb.Message.prototype.clone=function(){return jspb.Message.cloneMessage(this)};jspb.Message.clone=function(o){return jspb.Message.cloneMessage(o)};jspb.Message.cloneMessage=function(o){return new o.constructor(jspb.Message.clone_(o.toArray()))};jspb.Message.copyInto=function(o,t){goog.asserts.assertInstanceof(o,jspb.Message),goog.asserts.assertInstanceof(t,jspb.Message),goog.asserts.assert(o.constructor==t.constructor,"Copy source and target message should have the same type."),o=jspb.Message.clone(o);for(var r=t.toArray(),i=o.toArray(),n=r.length=0;n<i.length;n++)r[n]=i[n];t.wrappers_=o.wrappers_,t.extensionObject_=o.extensionObject_};jspb.Message.clone_=function(o){if(Array.isArray(o)){for(var t=Array(o.length),r=0;r<o.length;r++){var i=o[r];i!=null&&(t[r]=typeof i=="object"?jspb.Message.clone_(goog.asserts.assert(i)):i)}return t}if(jspb.Message.SUPPORTS_UINT8ARRAY_&&o instanceof Uint8Array)return new Uint8Array(o);t={};for(r in o)i=o[r],i!=null&&(t[r]=typeof i=="object"?jspb.Message.clone_(goog.asserts.assert(i)):i);return t};jspb.Message.registerMessageType=function(o,t){t.messageId=o};jspb.Message.messageSetExtensions={};jspb.Message.messageSetExtensionsBinary={};jspb.arith={};jspb.arith.UInt64=function(o,t){this.lo=o,this.hi=t};jspb.arith.UInt64.prototype.cmp=function(o){return this.hi<o.hi||this.hi==o.hi&&this.lo<o.lo?-1:this.hi==o.hi&&this.lo==o.lo?0:1};jspb.arith.UInt64.prototype.rightShift=function(){return new jspb.arith.UInt64((this.lo>>>1|(this.hi&1)<<31)>>>0,this.hi>>>1>>>0)};jspb.arith.UInt64.prototype.leftShift=function(){return new jspb.arith.UInt64(this.lo<<1>>>0,(this.hi<<1|this.lo>>>31)>>>0)};jspb.arith.UInt64.prototype.msb=function(){return!!(this.hi&2147483648)};jspb.arith.UInt64.prototype.lsb=function(){return!!(this.lo&1)};jspb.arith.UInt64.prototype.zero=function(){return this.lo==0&&this.hi==0};jspb.arith.UInt64.prototype.add=function(o){return new jspb.arith.UInt64((this.lo+o.lo&4294967295)>>>0>>>0,((this.hi+o.hi&4294967295)>>>0)+(4294967296<=this.lo+o.lo?1:0)>>>0)};jspb.arith.UInt64.prototype.sub=function(o){return new jspb.arith.UInt64((this.lo-o.lo&4294967295)>>>0>>>0,((this.hi-o.hi&4294967295)>>>0)-(0>this.lo-o.lo?1:0)>>>0)};jspb.arith.UInt64.mul32x32=function(o,t){var r=o&65535;o>>>=16;var i=t&65535,n=t>>>16;for(t=r*i+65536*(r*n&65535)+65536*(o*i&65535),r=o*n+(r*n>>>16)+(o*i>>>16);4294967296<=t;)t-=4294967296,r+=1;return new jspb.arith.UInt64(t>>>0,r>>>0)};jspb.arith.UInt64.prototype.mul=function(o){var t=jspb.arith.UInt64.mul32x32(this.lo,o);return o=jspb.arith.UInt64.mul32x32(this.hi,o),o.hi=o.lo,o.lo=0,t.add(o)};jspb.arith.UInt64.prototype.div=function(o){if(o==0)return[];var t=new jspb.arith.UInt64(0,0),r=new jspb.arith.UInt64(this.lo,this.hi);o=new jspb.arith.UInt64(o,0);for(var i=new jspb.arith.UInt64(1,0);!o.msb();)o=o.leftShift(),i=i.leftShift();for(;!i.zero();)0>=o.cmp(r)&&(t=t.add(i),r=r.sub(o)),o=o.rightShift(),i=i.rightShift();return[t,r]};jspb.arith.UInt64.prototype.toString=function(){for(var o="",t=this;!t.zero();){t=t.div(10);var r=t[0];o=t[1].lo+o,t=r}return o==""&&(o="0"),o};jspb.arith.UInt64.fromString=function(o){for(var t=new jspb.arith.UInt64(0,0),r=new jspb.arith.UInt64(0,0),i=0;i<o.length;i++){if("0">o[i]||"9"<o[i])return null;var n=parseInt(o[i],10);r.lo=n,t=t.mul(10).add(r)}return t};jspb.arith.UInt64.prototype.clone=function(){return new jspb.arith.UInt64(this.lo,this.hi)};jspb.arith.Int64=function(o,t){this.lo=o,this.hi=t};jspb.arith.Int64.prototype.add=function(o){return new jspb.arith.Int64((this.lo+o.lo&4294967295)>>>0>>>0,((this.hi+o.hi&4294967295)>>>0)+(4294967296<=this.lo+o.lo?1:0)>>>0)};jspb.arith.Int64.prototype.sub=function(o){return new jspb.arith.Int64((this.lo-o.lo&4294967295)>>>0>>>0,((this.hi-o.hi&4294967295)>>>0)-(0>this.lo-o.lo?1:0)>>>0)};jspb.arith.Int64.prototype.clone=function(){return new jspb.arith.Int64(this.lo,this.hi)};jspb.arith.Int64.prototype.toString=function(){var o=(this.hi&2147483648)!=0,t=new jspb.arith.UInt64(this.lo,this.hi);return o&&(t=new jspb.arith.UInt64(0,0).sub(t)),(o?"-":"")+t.toString()};jspb.arith.Int64.fromString=function(o){var t=0<o.length&&o[0]=="-";return t&&(o=o.substring(1)),o=jspb.arith.UInt64.fromString(o),o===null?null:(t&&(o=new jspb.arith.UInt64(0,0).sub(o)),new jspb.arith.Int64(o.lo,o.hi))};jspb.BinaryEncoder=function(){this.buffer_=[]};jspb.BinaryEncoder.prototype.length=function(){return this.buffer_.length};jspb.BinaryEncoder.prototype.end=function(){var o=this.buffer_;return this.buffer_=[],o};jspb.BinaryEncoder.prototype.writeSplitVarint64=function(o,t){for(goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(t==Math.floor(t)),goog.asserts.assert(0<=o&&o<jspb.BinaryConstants.TWO_TO_32),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32);0<t||127<o;)this.buffer_.push(o&127|128),o=(o>>>7|t<<25)>>>0,t>>>=7;this.buffer_.push(o)};jspb.BinaryEncoder.prototype.writeSplitFixed64=function(o,t){goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(t==Math.floor(t)),goog.asserts.assert(0<=o&&o<jspb.BinaryConstants.TWO_TO_32),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUint32(o),this.writeUint32(t)};jspb.BinaryEncoder.prototype.writeUnsignedVarint32=function(o){for(goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(0<=o&&o<jspb.BinaryConstants.TWO_TO_32);127<o;)this.buffer_.push(o&127|128),o>>>=7;this.buffer_.push(o)};jspb.BinaryEncoder.prototype.writeSignedVarint32=function(o){if(goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(o>=-jspb.BinaryConstants.TWO_TO_31&&o<jspb.BinaryConstants.TWO_TO_31),0<=o)this.writeUnsignedVarint32(o);else{for(var t=0;9>t;t++)this.buffer_.push(o&127|128),o>>=7;this.buffer_.push(1)}};jspb.BinaryEncoder.prototype.writeUnsignedVarint64=function(o){goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(0<=o&&o<jspb.BinaryConstants.TWO_TO_64),jspb.utils.splitInt64(o),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)};jspb.BinaryEncoder.prototype.writeSignedVarint64=function(o){goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(o>=-jspb.BinaryConstants.TWO_TO_63&&o<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitInt64(o),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)};jspb.BinaryEncoder.prototype.writeZigzagVarint32=function(o){goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(o>=-jspb.BinaryConstants.TWO_TO_31&&o<jspb.BinaryConstants.TWO_TO_31),this.writeUnsignedVarint32((o<<1^o>>31)>>>0)};jspb.BinaryEncoder.prototype.writeZigzagVarint64=function(o){goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(o>=-jspb.BinaryConstants.TWO_TO_63&&o<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitZigzag64(o),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)};jspb.BinaryEncoder.prototype.writeZigzagVarint64String=function(o){this.writeZigzagVarintHash64(jspb.utils.decimalStringToHash64(o))};jspb.BinaryEncoder.prototype.writeZigzagVarintHash64=function(o){var t=this;jspb.utils.splitHash64(o),jspb.utils.toZigzag64(jspb.utils.split64Low,jspb.utils.split64High,function(r,i){t.writeSplitVarint64(r>>>0,i>>>0)})};jspb.BinaryEncoder.prototype.writeUint8=function(o){goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(0<=o&&256>o),this.buffer_.push(o>>>0&255)};jspb.BinaryEncoder.prototype.writeUint16=function(o){goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(0<=o&&65536>o),this.buffer_.push(o>>>0&255),this.buffer_.push(o>>>8&255)};jspb.BinaryEncoder.prototype.writeUint32=function(o){goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(0<=o&&o<jspb.BinaryConstants.TWO_TO_32),this.buffer_.push(o>>>0&255),this.buffer_.push(o>>>8&255),this.buffer_.push(o>>>16&255),this.buffer_.push(o>>>24&255)};jspb.BinaryEncoder.prototype.writeUint64=function(o){goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(0<=o&&o<jspb.BinaryConstants.TWO_TO_64),jspb.utils.splitUint64(o),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)};jspb.BinaryEncoder.prototype.writeInt8=function(o){goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(-128<=o&&128>o),this.buffer_.push(o>>>0&255)};jspb.BinaryEncoder.prototype.writeInt16=function(o){goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(-32768<=o&&32768>o),this.buffer_.push(o>>>0&255),this.buffer_.push(o>>>8&255)};jspb.BinaryEncoder.prototype.writeInt32=function(o){goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(o>=-jspb.BinaryConstants.TWO_TO_31&&o<jspb.BinaryConstants.TWO_TO_31),this.buffer_.push(o>>>0&255),this.buffer_.push(o>>>8&255),this.buffer_.push(o>>>16&255),this.buffer_.push(o>>>24&255)};jspb.BinaryEncoder.prototype.writeInt64=function(o){goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(o>=-jspb.BinaryConstants.TWO_TO_63&&o<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitInt64(o),this.writeSplitFixed64(jspb.utils.split64Low,jspb.utils.split64High)};jspb.BinaryEncoder.prototype.writeInt64String=function(o){goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(+o>=-jspb.BinaryConstants.TWO_TO_63&&+o<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitHash64(jspb.utils.decimalStringToHash64(o)),this.writeSplitFixed64(jspb.utils.split64Low,jspb.utils.split64High)};jspb.BinaryEncoder.prototype.writeFloat=function(o){goog.asserts.assert(o===1/0||o===-1/0||isNaN(o)||o>=-jspb.BinaryConstants.FLOAT32_MAX&&o<=jspb.BinaryConstants.FLOAT32_MAX),jspb.utils.splitFloat32(o),this.writeUint32(jspb.utils.split64Low)};jspb.BinaryEncoder.prototype.writeDouble=function(o){goog.asserts.assert(o===1/0||o===-1/0||isNaN(o)||o>=-jspb.BinaryConstants.FLOAT64_MAX&&o<=jspb.BinaryConstants.FLOAT64_MAX),jspb.utils.splitFloat64(o),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)};jspb.BinaryEncoder.prototype.writeBool=function(o){goog.asserts.assert(typeof o=="boolean"||typeof o=="number"),this.buffer_.push(o?1:0)};jspb.BinaryEncoder.prototype.writeEnum=function(o){goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(o>=-jspb.BinaryConstants.TWO_TO_31&&o<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32(o)};jspb.BinaryEncoder.prototype.writeBytes=function(o){this.buffer_.push.apply(this.buffer_,o)};jspb.BinaryEncoder.prototype.writeVarintHash64=function(o){jspb.utils.splitHash64(o),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)};jspb.BinaryEncoder.prototype.writeFixedHash64=function(o){jspb.utils.splitHash64(o),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)};jspb.BinaryEncoder.prototype.writeString=function(o){for(var t=this.buffer_.length,r=0;r<o.length;r++){var i=o.charCodeAt(r);if(128>i)this.buffer_.push(i);else if(2048>i)this.buffer_.push(i>>6|192),this.buffer_.push(i&63|128);else if(65536>i)if(55296<=i&&56319>=i&&r+1<o.length){var n=o.charCodeAt(r+1);56320<=n&&57343>=n&&(i=1024*(i-55296)+n-56320+65536,this.buffer_.push(i>>18|240),this.buffer_.push(i>>12&63|128),this.buffer_.push(i>>6&63|128),this.buffer_.push(i&63|128),r++)}else this.buffer_.push(i>>12|224),this.buffer_.push(i>>6&63|128),this.buffer_.push(i&63|128)}return this.buffer_.length-t};jspb.BinaryWriter=function(){this.blocks_=[],this.totalLength_=0,this.encoder_=new jspb.BinaryEncoder,this.bookmarks_=[]};jspb.BinaryWriter.prototype.appendUint8Array_=function(o){var t=this.encoder_.end();this.blocks_.push(t),this.blocks_.push(o),this.totalLength_+=t.length+o.length};jspb.BinaryWriter.prototype.beginDelimited_=function(o){return this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.DELIMITED),o=this.encoder_.end(),this.blocks_.push(o),this.totalLength_+=o.length,o.push(this.totalLength_),o};jspb.BinaryWriter.prototype.endDelimited_=function(o){var t=o.pop();for(t=this.totalLength_+this.encoder_.length()-t,goog.asserts.assert(0<=t);127<t;)o.push(t&127|128),t>>>=7,this.totalLength_++;o.push(t),this.totalLength_++};jspb.BinaryWriter.prototype.writeSerializedMessage=function(o,t,r){this.appendUint8Array_(o.subarray(t,r))};jspb.BinaryWriter.prototype.maybeWriteSerializedMessage=function(o,t,r){o!=null&&t!=null&&r!=null&&this.writeSerializedMessage(o,t,r)};jspb.BinaryWriter.prototype.reset=function(){this.blocks_=[],this.encoder_.end(),this.totalLength_=0,this.bookmarks_=[]};jspb.BinaryWriter.prototype.getResultBuffer=function(){goog.asserts.assert(this.bookmarks_.length==0);for(var o=new Uint8Array(this.totalLength_+this.encoder_.length()),t=this.blocks_,r=t.length,i=0,n=0;n<r;n++){var s=t[n];o.set(s,i),i+=s.length}return t=this.encoder_.end(),o.set(t,i),i+=t.length,goog.asserts.assert(i==o.length),this.blocks_=[o],o};jspb.BinaryWriter.prototype.getResultBase64String=function(o){return goog.crypt.base64.encodeByteArray(this.getResultBuffer(),o)};jspb.BinaryWriter.prototype.beginSubMessage=function(o){this.bookmarks_.push(this.beginDelimited_(o))};jspb.BinaryWriter.prototype.endSubMessage=function(){goog.asserts.assert(0<=this.bookmarks_.length),this.endDelimited_(this.bookmarks_.pop())};jspb.BinaryWriter.prototype.writeFieldHeader_=function(o,t){goog.asserts.assert(1<=o&&o==Math.floor(o)),this.encoder_.writeUnsignedVarint32(8*o+t)};jspb.BinaryWriter.prototype.writeAny=function(o,t,r){var i=jspb.BinaryConstants.FieldType;switch(o){case i.DOUBLE:this.writeDouble(t,r);break;case i.FLOAT:this.writeFloat(t,r);break;case i.INT64:this.writeInt64(t,r);break;case i.UINT64:this.writeUint64(t,r);break;case i.INT32:this.writeInt32(t,r);break;case i.FIXED64:this.writeFixed64(t,r);break;case i.FIXED32:this.writeFixed32(t,r);break;case i.BOOL:this.writeBool(t,r);break;case i.STRING:this.writeString(t,r);break;case i.GROUP:goog.asserts.fail("Group field type not supported in writeAny()");break;case i.MESSAGE:goog.asserts.fail("Message field type not supported in writeAny()");break;case i.BYTES:this.writeBytes(t,r);break;case i.UINT32:this.writeUint32(t,r);break;case i.ENUM:this.writeEnum(t,r);break;case i.SFIXED32:this.writeSfixed32(t,r);break;case i.SFIXED64:this.writeSfixed64(t,r);break;case i.SINT32:this.writeSint32(t,r);break;case i.SINT64:this.writeSint64(t,r);break;case i.FHASH64:this.writeFixedHash64(t,r);break;case i.VHASH64:this.writeVarintHash64(t,r);break;default:goog.asserts.fail("Invalid field type in writeAny()")}};jspb.BinaryWriter.prototype.writeUnsignedVarint32_=function(o,t){t!=null&&(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeUnsignedVarint32(t))};jspb.BinaryWriter.prototype.writeSignedVarint32_=function(o,t){t!=null&&(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(t))};jspb.BinaryWriter.prototype.writeUnsignedVarint64_=function(o,t){t!=null&&(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeUnsignedVarint64(t))};jspb.BinaryWriter.prototype.writeSignedVarint64_=function(o,t){t!=null&&(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint64(t))};jspb.BinaryWriter.prototype.writeZigzagVarint32_=function(o,t){t!=null&&(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint32(t))};jspb.BinaryWriter.prototype.writeZigzagVarint64_=function(o,t){t!=null&&(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint64(t))};jspb.BinaryWriter.prototype.writeZigzagVarint64String_=function(o,t){t!=null&&(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint64String(t))};jspb.BinaryWriter.prototype.writeZigzagVarintHash64_=function(o,t){t!=null&&(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarintHash64(t))};jspb.BinaryWriter.prototype.writeInt32=function(o,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32_(o,t))};jspb.BinaryWriter.prototype.writeInt32String=function(o,t){t!=null&&(t=parseInt(t,10),goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32_(o,t))};jspb.BinaryWriter.prototype.writeInt64=function(o,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeSignedVarint64_(o,t))};jspb.BinaryWriter.prototype.writeInt64String=function(o,t){t!=null&&(t=jspb.arith.Int64.fromString(t),this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t.lo,t.hi))};jspb.BinaryWriter.prototype.writeUint32=function(o,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUnsignedVarint32_(o,t))};jspb.BinaryWriter.prototype.writeUint32String=function(o,t){t!=null&&(t=parseInt(t,10),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUnsignedVarint32_(o,t))};jspb.BinaryWriter.prototype.writeUint64=function(o,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_64),this.writeUnsignedVarint64_(o,t))};jspb.BinaryWriter.prototype.writeUint64String=function(o,t){t!=null&&(t=jspb.arith.UInt64.fromString(t),this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t.lo,t.hi))};jspb.BinaryWriter.prototype.writeSint32=function(o,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeZigzagVarint32_(o,t))};jspb.BinaryWriter.prototype.writeSint64=function(o,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeZigzagVarint64_(o,t))};jspb.BinaryWriter.prototype.writeSintHash64=function(o,t){t!=null&&this.writeZigzagVarintHash64_(o,t)};jspb.BinaryWriter.prototype.writeSint64String=function(o,t){t!=null&&this.writeZigzagVarint64String_(o,t)};jspb.BinaryWriter.prototype.writeFixed32=function(o,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeUint32(t))};jspb.BinaryWriter.prototype.writeFixed64=function(o,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_64),this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeUint64(t))};jspb.BinaryWriter.prototype.writeFixed64String=function(o,t){t!=null&&(t=jspb.arith.UInt64.fromString(t),this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t.lo,t.hi))};jspb.BinaryWriter.prototype.writeSfixed32=function(o,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeInt32(t))};jspb.BinaryWriter.prototype.writeSfixed64=function(o,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeInt64(t))};jspb.BinaryWriter.prototype.writeSfixed64String=function(o,t){t!=null&&(t=jspb.arith.Int64.fromString(t),this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t.lo,t.hi))};jspb.BinaryWriter.prototype.writeFloat=function(o,t){t!=null&&(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeFloat(t))};jspb.BinaryWriter.prototype.writeDouble=function(o,t){t!=null&&(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeDouble(t))};jspb.BinaryWriter.prototype.writeBool=function(o,t){t!=null&&(goog.asserts.assert(typeof t=="boolean"||typeof t=="number"),this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeBool(t))};jspb.BinaryWriter.prototype.writeEnum=function(o,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(t))};jspb.BinaryWriter.prototype.writeString=function(o,t){t!=null&&(o=this.beginDelimited_(o),this.encoder_.writeString(t),this.endDelimited_(o))};jspb.BinaryWriter.prototype.writeBytes=function(o,t){t!=null&&(t=jspb.utils.byteSourceToUint8Array(t),this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(t.length),this.appendUint8Array_(t))};jspb.BinaryWriter.prototype.writeMessage=function(o,t,r){t!=null&&(o=this.beginDelimited_(o),r(t,this),this.endDelimited_(o))};jspb.BinaryWriter.prototype.writeMessageSet=function(o,t,r){t!=null&&(this.writeFieldHeader_(1,jspb.BinaryConstants.WireType.START_GROUP),this.writeFieldHeader_(2,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(o),o=this.beginDelimited_(3),r(t,this),this.endDelimited_(o),this.writeFieldHeader_(1,jspb.BinaryConstants.WireType.END_GROUP))};jspb.BinaryWriter.prototype.writeGroup=function(o,t,r){t!=null&&(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.START_GROUP),r(t,this),this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.END_GROUP))};jspb.BinaryWriter.prototype.writeFixedHash64=function(o,t){t!=null&&(goog.asserts.assert(t.length==8),this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeFixedHash64(t))};jspb.BinaryWriter.prototype.writeVarintHash64=function(o,t){t!=null&&(goog.asserts.assert(t.length==8),this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeVarintHash64(t))};jspb.BinaryWriter.prototype.writeSplitFixed64=function(o,t,r){this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t,r)};jspb.BinaryWriter.prototype.writeSplitVarint64=function(o,t,r){this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t,r)};jspb.BinaryWriter.prototype.writeSplitZigzagVarint64=function(o,t,r){this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.VARINT);var i=this.encoder_;jspb.utils.toZigzag64(t,r,function(n,s){i.writeSplitVarint64(n>>>0,s>>>0)})};jspb.BinaryWriter.prototype.writeRepeatedInt32=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeSignedVarint32_(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedInt32String=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeInt32String(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedInt64=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeSignedVarint64_(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedSplitFixed64=function(o,t,r,i){if(t!=null)for(var n=0;n<t.length;n++)this.writeSplitFixed64(o,r(t[n]),i(t[n]))};jspb.BinaryWriter.prototype.writeRepeatedSplitVarint64=function(o,t,r,i){if(t!=null)for(var n=0;n<t.length;n++)this.writeSplitVarint64(o,r(t[n]),i(t[n]))};jspb.BinaryWriter.prototype.writeRepeatedSplitZigzagVarint64=function(o,t,r,i){if(t!=null)for(var n=0;n<t.length;n++)this.writeSplitZigzagVarint64(o,r(t[n]),i(t[n]))};jspb.BinaryWriter.prototype.writeRepeatedInt64String=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeInt64String(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedUint32=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeUnsignedVarint32_(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedUint32String=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeUint32String(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedUint64=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeUnsignedVarint64_(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedUint64String=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeUint64String(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedSint32=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeZigzagVarint32_(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedSint64=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeZigzagVarint64_(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedSint64String=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeZigzagVarint64String_(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedSintHash64=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeZigzagVarintHash64_(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedFixed32=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeFixed32(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedFixed64=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeFixed64(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedFixed64String=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeFixed64String(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedSfixed32=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeSfixed32(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedSfixed64=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeSfixed64(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedSfixed64String=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeSfixed64String(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedFloat=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeFloat(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedDouble=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeDouble(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedBool=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeBool(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedEnum=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeEnum(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedString=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeString(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedBytes=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeBytes(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedMessage=function(o,t,r){if(t!=null)for(var i=0;i<t.length;i++){var n=this.beginDelimited_(o);r(t[i],this),this.endDelimited_(n)}};jspb.BinaryWriter.prototype.writeRepeatedGroup=function(o,t,r){if(t!=null)for(var i=0;i<t.length;i++)this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.START_GROUP),r(t[i],this),this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.END_GROUP)};jspb.BinaryWriter.prototype.writeRepeatedFixedHash64=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeFixedHash64(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedVarintHash64=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeVarintHash64(o,t[r])};jspb.BinaryWriter.prototype.writePackedInt32=function(o,t){if(t!=null&&t.length){o=this.beginDelimited_(o);for(var r=0;r<t.length;r++)this.encoder_.writeSignedVarint32(t[r]);this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedInt32String=function(o,t){if(t!=null&&t.length){o=this.beginDelimited_(o);for(var r=0;r<t.length;r++)this.encoder_.writeSignedVarint32(parseInt(t[r],10));this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedInt64=function(o,t){if(t!=null&&t.length){o=this.beginDelimited_(o);for(var r=0;r<t.length;r++)this.encoder_.writeSignedVarint64(t[r]);this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedSplitFixed64=function(o,t,r,i){if(t!=null){o=this.beginDelimited_(o);for(var n=0;n<t.length;n++)this.encoder_.writeSplitFixed64(r(t[n]),i(t[n]));this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedSplitVarint64=function(o,t,r,i){if(t!=null){o=this.beginDelimited_(o);for(var n=0;n<t.length;n++)this.encoder_.writeSplitVarint64(r(t[n]),i(t[n]));this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedSplitZigzagVarint64=function(o,t,r,i){if(t!=null){o=this.beginDelimited_(o);for(var n=this.encoder_,s=0;s<t.length;s++)jspb.utils.toZigzag64(r(t[s]),i(t[s]),function(l,g){n.writeSplitVarint64(l>>>0,g>>>0)});this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedInt64String=function(o,t){if(t!=null&&t.length){o=this.beginDelimited_(o);for(var r=0;r<t.length;r++){var i=jspb.arith.Int64.fromString(t[r]);this.encoder_.writeSplitVarint64(i.lo,i.hi)}this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedUint32=function(o,t){if(t!=null&&t.length){o=this.beginDelimited_(o);for(var r=0;r<t.length;r++)this.encoder_.writeUnsignedVarint32(t[r]);this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedUint32String=function(o,t){if(t!=null&&t.length){o=this.beginDelimited_(o);for(var r=0;r<t.length;r++)this.encoder_.writeUnsignedVarint32(parseInt(t[r],10));this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedUint64=function(o,t){if(t!=null&&t.length){o=this.beginDelimited_(o);for(var r=0;r<t.length;r++)this.encoder_.writeUnsignedVarint64(t[r]);this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedUint64String=function(o,t){if(t!=null&&t.length){o=this.beginDelimited_(o);for(var r=0;r<t.length;r++){var i=jspb.arith.UInt64.fromString(t[r]);this.encoder_.writeSplitVarint64(i.lo,i.hi)}this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedSint32=function(o,t){if(t!=null&&t.length){o=this.beginDelimited_(o);for(var r=0;r<t.length;r++)this.encoder_.writeZigzagVarint32(t[r]);this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedSint64=function(o,t){if(t!=null&&t.length){o=this.beginDelimited_(o);for(var r=0;r<t.length;r++)this.encoder_.writeZigzagVarint64(t[r]);this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedSint64String=function(o,t){if(t!=null&&t.length){o=this.beginDelimited_(o);for(var r=0;r<t.length;r++)this.encoder_.writeZigzagVarintHash64(jspb.utils.decimalStringToHash64(t[r]));this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedSintHash64=function(o,t){if(t!=null&&t.length){o=this.beginDelimited_(o);for(var r=0;r<t.length;r++)this.encoder_.writeZigzagVarintHash64(t[r]);this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedFixed32=function(o,t){if(t!=null&&t.length)for(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),o=0;o<t.length;o++)this.encoder_.writeUint32(t[o])};jspb.BinaryWriter.prototype.writePackedFixed64=function(o,t){if(t!=null&&t.length)for(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),o=0;o<t.length;o++)this.encoder_.writeUint64(t[o])};jspb.BinaryWriter.prototype.writePackedFixed64String=function(o,t){if(t!=null&&t.length)for(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),o=0;o<t.length;o++){var r=jspb.arith.UInt64.fromString(t[o]);this.encoder_.writeSplitFixed64(r.lo,r.hi)}};jspb.BinaryWriter.prototype.writePackedSfixed32=function(o,t){if(t!=null&&t.length)for(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),o=0;o<t.length;o++)this.encoder_.writeInt32(t[o])};jspb.BinaryWriter.prototype.writePackedSfixed64=function(o,t){if(t!=null&&t.length)for(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),o=0;o<t.length;o++)this.encoder_.writeInt64(t[o])};jspb.BinaryWriter.prototype.writePackedSfixed64String=function(o,t){if(t!=null&&t.length)for(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),o=0;o<t.length;o++)this.encoder_.writeInt64String(t[o])};jspb.BinaryWriter.prototype.writePackedFloat=function(o,t){if(t!=null&&t.length)for(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),o=0;o<t.length;o++)this.encoder_.writeFloat(t[o])};jspb.BinaryWriter.prototype.writePackedDouble=function(o,t){if(t!=null&&t.length)for(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),o=0;o<t.length;o++)this.encoder_.writeDouble(t[o])};jspb.BinaryWriter.prototype.writePackedBool=function(o,t){if(t!=null&&t.length)for(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(t.length),o=0;o<t.length;o++)this.encoder_.writeBool(t[o])};jspb.BinaryWriter.prototype.writePackedEnum=function(o,t){if(t!=null&&t.length){o=this.beginDelimited_(o);for(var r=0;r<t.length;r++)this.encoder_.writeEnum(t[r]);this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedFixedHash64=function(o,t){if(t!=null&&t.length)for(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),o=0;o<t.length;o++)this.encoder_.writeFixedHash64(t[o])};jspb.BinaryWriter.prototype.writePackedVarintHash64=function(o,t){if(t!=null&&t.length){o=this.beginDelimited_(o);for(var r=0;r<t.length;r++)this.encoder_.writeVarintHash64(t[r]);this.endDelimited_(o)}};jspb.Export={};exports.Map=jspb.Map;exports.Message=jspb.Message;exports.BinaryReader=jspb.BinaryReader;exports.BinaryWriter=jspb.BinaryWriter;exports.ExtensionFieldInfo=jspb.ExtensionFieldInfo;exports.ExtensionFieldBinaryInfo=jspb.ExtensionFieldBinaryInfo;exports.exportSymbol=goog.exportSymbol;exports.inherits=goog.inherits;exports.object={extend:goog.object.extend};exports.typeOf=goog.typeOf});var rr=ht(or=>{var ue=er(),Et=ue,tr=function(){return this||window||tr||self||Function("return this")()}.call(null);Et.exportSymbol("proto.CommonModels.JsonMessage",null,tr);proto.CommonModels.JsonMessage=function(o){ue.Message.initialize(this,o,0,-1,null,null)};Et.inherits(proto.CommonModels.JsonMessage,ue.Message);Et.DEBUG&&!COMPILED&&(proto.CommonModels.JsonMessage.displayName="proto.CommonModels.JsonMessage");ue.Message.GENERATE_TO_OBJECT&&(proto.CommonModels.JsonMessage.prototype.toObject=function(o){return proto.CommonModels.JsonMessage.toObject(o,this)},proto.CommonModels.JsonMessage.toObject=function(o,t){var r,i={value:ue.Message.getFieldWithDefault(t,1,"")};return o&&(i.$jspbMessageInstance=t),i});proto.CommonModels.JsonMessage.deserializeBinary=function(o){var t=new ue.BinaryReader(o),r=new proto.CommonModels.JsonMessage;return proto.CommonModels.JsonMessage.deserializeBinaryFromReader(r,t)};proto.CommonModels.JsonMessage.deserializeBinaryFromReader=function(o,t){for(;t.nextField()&&!t.isEndGroup();){var r=t.getFieldNumber();switch(r){case 1:var i=t.readString();o.setValue(i);break;default:t.skipField();break}}return o};proto.CommonModels.JsonMessage.prototype.serializeBinary=function(){var o=new ue.BinaryWriter;return proto.CommonModels.JsonMessage.serializeBinaryToWriter(this,o),o.getResultBuffer()};proto.CommonModels.JsonMessage.serializeBinaryToWriter=function(o,t){var r=void 0;r=o.getValue(),r.length>0&&t.writeString(1,r)};proto.CommonModels.JsonMessage.prototype.getValue=function(){return ue.Message.getFieldWithDefault(this,1,"")};proto.CommonModels.JsonMessage.prototype.setValue=function(o){return ue.Message.setProto3StringField(this,1,o)};Et.object.extend(or,proto.CommonModels)});var mo=ht((co,ho)=>{(function(o,t){typeof define=="function"&&define.amd?define([],t):typeof co<"u"?t():(t(),o.FileSaver={})})(co,function(){"use strict";function o(g,p){return typeof p>"u"?p={autoBom:!1}:typeof p!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),p={autoBom:!p}),p.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(g.type)?new Blob(["\uFEFF",g],{type:g.type}):g}function t(g,p,h){var E=new XMLHttpRequest;E.open("GET",g),E.responseType="blob",E.onload=function(){l(E.response,p,h)},E.onerror=function(){console.error("could not download file")},E.send()}function r(g){var p=new XMLHttpRequest;p.open("HEAD",g,!1);try{p.send()}catch{}return 200<=p.status&&299>=p.status}function i(g){try{g.dispatchEvent(new MouseEvent("click"))}catch{var p=document.createEvent("MouseEvents");p.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),g.dispatchEvent(p)}}var n=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:void 0,s=n.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=n.saveAs||(typeof window!="object"||window!==n?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(g,p,h){var E=n.URL||n.webkitURL,m=document.createElement("a");p=p||g.name||"download",m.download=p,m.rel="noopener",typeof g=="string"?(m.href=g,m.origin===location.origin?i(m):r(m.href)?t(g,p,h):i(m,m.target="_blank")):(m.href=E.createObjectURL(g),setTimeout(function(){E.revokeObjectURL(m.href)},4e4),setTimeout(function(){i(m)},0))}:"msSaveOrOpenBlob"in navigator?function(g,p,h){if(p=p||g.name||"download",typeof g!="string")navigator.msSaveOrOpenBlob(o(g,h),p);else if(r(g))t(g,p,h);else{var E=document.createElement("a");E.href=g,E.target="_blank",setTimeout(function(){i(E)})}}:function(g,p,h,E){if(E=E||open("","_blank"),E&&(E.document.title=E.document.body.innerText="downloading..."),typeof g=="string")return t(g,p,h);var m=g.type==="application/octet-stream",S=/constructor/i.test(n.HTMLElement)||n.safari,T=/CriOS\/[\d]+/.test(navigator.userAgent);if((T||m&&S||s)&&typeof FileReader<"u"){var I=new FileReader;I.onloadend=function(){var v=I.result;v=T?v:v.replace(/^data:[^;]*;/,"data:attachment/file;"),E?E.location.href=v:location=v,E=null},I.readAsDataURL(g)}else{var y=n.URL||n.webkitURL,u=y.createObjectURL(g);E?E.location=u:location.href=u,E=null,setTimeout(function(){y.revokeObjectURL(u)},4e4)}});n.saveAs=l.saveAs=l,typeof ho<"u"&&(ho.exports=l)})});var Cr=ht((To,Io)=>{(function(o,t){typeof To=="object"&&typeof Io<"u"?Io.exports=t():typeof define=="function"&&define.amd?define(t):o.Croppr=t()})(To,function(){"use strict";(function(){for(var I=0,y=["ms","moz","webkit","o"],u=0;u<y.length&&!window.requestAnimationFrame;++u)window.requestAnimationFrame=window[y[u]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[y[u]+"CancelAnimationFrame"]||window[y[u]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(v,w){var D=new Date().getTime(),_=Math.max(0,16-(D-I)),C=window.setTimeout(function(){v(D+_)},_);return I=D+_,C}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(v){clearTimeout(v)})})(),function(){if(typeof window.CustomEvent=="function")return!1;function I(y,u){u=u||{bubbles:!1,cancelable:!1,detail:void 0};var v=document.createEvent("CustomEvent");return v.initCustomEvent(y,u.bubbles,u.cancelable,u.detail),v}I.prototype=window.Event.prototype,window.CustomEvent=I}(),function(I){try{return new CustomEvent("test"),!1}catch{}function y(u,v){v=v||{bubbles:!1,cancelable:!1};var w=document.createEvent("MouseEvent");return w.initMouseEvent(u,v.bubbles,v.cancelable,I,0,0,0,0,0,!1,!1,!1,!1,0,null),w}y.prototype=Event.prototype,I.MouseEvent=y}(window);var o=function(I,y){if(!(I instanceof y))throw new TypeError("Cannot call a class as a function")},t=function(){function I(y,u){for(var v=0;v<u.length;v++){var w=u[v];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(y,w.key,w)}}return function(y,u,v){return u&&I(y.prototype,u),v&&I(y,v),y}}(),r=function I(y,u,v){y===null&&(y=Function.prototype);var w=Object.getOwnPropertyDescriptor(y,u);if(w===void 0){var D=Object.getPrototypeOf(y);return D===null?void 0:I(D,u,v)}else{if("value"in w)return w.value;var _=w.get;return _===void 0?void 0:_.call(v)}},i=function(I,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);I.prototype=Object.create(y&&y.prototype,{constructor:{value:I,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(I,y):I.__proto__=y)},n=function(I,y){if(!I)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:I},s=function(){function I(y,u){var v=[],w=!0,D=!1,_=void 0;try{for(var C=y[Symbol.iterator](),M;!(w=(M=C.next()).done)&&(v.push(M.value),!(u&&v.length===u));w=!0);}catch(R){D=!0,_=R}finally{try{!w&&C.return&&C.return()}finally{if(D)throw _}}return v}return function(y,u){if(Array.isArray(y))return y;if(Symbol.iterator in Object(y))return I(y,u);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function I(y,u,v,w){o(this,I);var D=this;this.position=y,this.constraints=u,this.cursor=v,this.eventBus=w,this.el=document.createElement("div"),this.el.className="croppr-handle",this.el.style.cursor=v,this.el.addEventListener("mousedown",_);function _(R){R.stopPropagation(),document.addEventListener("mouseup",C),document.addEventListener("mousemove",M),D.eventBus.dispatchEvent(new CustomEvent("handlestart",{detail:{handle:D}}))}function C(R){R.stopPropagation(),document.removeEventListener("mouseup",C),document.removeEventListener("mousemove",M),D.eventBus.dispatchEvent(new CustomEvent("handleend",{detail:{handle:D}}))}function M(R){R.stopPropagation(),D.eventBus.dispatchEvent(new CustomEvent("handlemove",{detail:{mouseX:R.clientX,mouseY:R.clientY}}))}},g=function(){function I(y,u,v,w){o(this,I),this.x1=y,this.y1=u,this.x2=v,this.y2=w}return t(I,[{key:"set",value:function(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,D=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;return this.x1=u??this.x1,this.y1=v??this.y1,this.x2=w??this.x2,this.y2=D??this.y2,this}},{key:"width",value:function(){return Math.abs(this.x2-this.x1)}},{key:"height",value:function(){return Math.abs(this.y2-this.y1)}},{key:"resize",value:function(u,v){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[0,0],D=this.x1+this.width()*w[0],_=this.y1+this.height()*w[1];return this.x1=D-u*w[0],this.y1=_-v*w[1],this.x2=this.x1+u,this.y2=this.y1+v,this}},{key:"scale",value:function(u){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0],w=this.width()*u,D=this.height()*u;return this.resize(w,D,v),this}},{key:"move",value:function(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,w=this.width(),D=this.height();return u=u===null?this.x1:u,v=v===null?this.y1:v,this.x1=u,this.y1=v,this.x2=u+w,this.y2=v+D,this}},{key:"getRelativePoint",value:function(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[0,0],v=this.width()*u[0],w=this.height()*u[1];return[v,w]}},{key:"getAbsolutePoint",value:function(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[0,0],v=this.x1+this.width()*u[0],w=this.y1+this.height()*u[1];return[v,w]}},{key:"constrainToRatio",value:function(u){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0],w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"height";if(u!==null){var D=this.width(),_=this.height();switch(w){case"height":this.resize(this.width(),this.width()*u,v);break;case"width":this.resize(this.height()*1/u,this.height(),v);break;default:this.resize(this.width(),this.width()*u,v)}return this}}},{key:"constrainToBoundary",value:function(u,v){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[0,0],D=this.getAbsolutePoint(w),_=s(D,2),C=_[0],M=_[1],R=C,B=M,U=u-C,F=v-M,G=-2*w[0]+1,L=-2*w[1]+1,N=null,Y=null;switch(G){case-1:N=R;break;case 0:N=Math.min(R,U)*2;break;case 1:N=U;break}switch(L){case-1:Y=B;break;case 0:Y=Math.min(B,F)*2;break;case 1:Y=F;break}if(this.width()>N){var K=N/this.width();this.scale(K,w)}if(this.height()>Y){var X=Y/this.height();this.scale(X,w)}return this}},{key:"constrainToSize",value:function(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,D=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,_=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[0,0],C=arguments.length>5&&arguments[5]!==void 0?arguments[5]:null;if(C&&(C>1?(u=v*1/C,D=D*C):C<1&&(v=u*C,w=D*1/C)),u&&this.width()>u){var M=u,R=C===null?this.height():v;this.resize(M,R,_)}if(v&&this.height()>v){var B=C===null?this.width():u,U=v;this.resize(B,U,_)}if(w&&this.width()<w){var F=w,G=C===null?this.height():D;this.resize(F,G,_)}if(D&&this.height()<D){var L=C===null?this.width():w,N=D;this.resize(L,N,_)}return this}}]),I}();function p(I){I.addEventListener("touchstart",h),I.addEventListener("touchend",h),I.addEventListener("touchmove",h)}function h(I){I.preventDefault();var y=I.changedTouches[0],u={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup"};y.target.dispatchEvent(new MouseEvent(u[I.type],{bubbles:!0,cancelable:!0,view:window,clientX:y.clientX,clientY:y.clientY,screenX:y.screenX,screenY:y.screenY}))}var E=[{position:[0,0],constraints:[1,0,0,1],cursor:"nw-resize"},{position:[.5,0],constraints:[1,0,0,0],cursor:"n-resize"},{position:[1,0],constraints:[1,1,0,0],cursor:"ne-resize"},{position:[1,.5],constraints:[0,1,0,0],cursor:"e-resize"},{position:[1,1],constraints:[0,1,1,0],cursor:"se-resize"},{position:[.5,1],constraints:[0,0,1,0],cursor:"s-resize"},{position:[0,1],constraints:[0,0,1,1],cursor:"sw-resize"},{position:[0,.5],constraints:[0,0,0,1],cursor:"w-resize"}],m=function(){function I(y,u){var v=this,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(o(this,I),this.options=I.parseOptions(u||{}),!y.nodeName&&(y=document.querySelector(y),y==null))throw"Unable to find element.";if(!y.getAttribute("src"))throw"Image src not provided.";this._initialized=!1,this._restore={parent:y.parentNode,element:y},w||(y.width===0||y.height===0?y.onload=function(){v.initialize(y)}:this.initialize(y))}return t(I,[{key:"initialize",value:function(u){this.createDOM(u),this.options.convertToPixels(this.cropperEl),this.attachHandlerEvents(),this.attachRegionEvents(),this.attachOverlayEvents(),this.box=this.initializeBox(this.options),this.redraw(),this._initialized=!0,this.options.onInitialize!==null&&this.options.onInitialize(this)}},{key:"createDOM",value:function(u){this.containerEl=document.createElement("div"),this.containerEl.className="croppr-container",this.eventBus=this.containerEl,p(this.containerEl),this.cropperEl=document.createElement("div"),this.cropperEl.className="croppr",this.imageEl=document.createElement("img"),this.imageEl.setAttribute("src",u.getAttribute("src")),this.imageEl.setAttribute("alt",u.getAttribute("alt")),this.imageEl.className="croppr-image",this.imageClippedEl=this.imageEl.cloneNode(),this.imageClippedEl.className="croppr-imageClipped",this.regionEl=document.createElement("div"),this.regionEl.className="croppr-region",this.overlayEl=document.createElement("div"),this.overlayEl.className="croppr-overlay";var v=document.createElement("div");v.className="croppr-handleContainer",this.handles=[];for(var w=0;w<E.length;w++){var D=new l(E[w].position,E[w].constraints,E[w].cursor,this.eventBus);this.handles.push(D),v.appendChild(D.el)}this.cropperEl.appendChild(this.imageEl),this.cropperEl.appendChild(this.imageClippedEl),this.cropperEl.appendChild(this.regionEl),this.cropperEl.appendChild(this.overlayEl),this.cropperEl.appendChild(v),this.containerEl.appendChild(this.cropperEl),u.parentElement.replaceChild(this.containerEl,u)}},{key:"setImage",value:function(u){var v=this;return this.imageEl.onload=function(){v.box=v.initializeBox(v.options),v.redraw()},this.imageEl.src=u,this.imageClippedEl.src=u,this}},{key:"destroy",value:function(){this._restore.parent.replaceChild(this._restore.element,this.containerEl)}},{key:"initializeBox",value:function(u){var v=u.startSize.width,w=u.startSize.height,D=new g(0,0,v,w);D.constrainToRatio(u.aspectRatio,[.5,.5]);var _=u.minSize,C=u.maxSize;D.constrainToSize(C.width,C.height,_.width,_.height,[.5,.5],u.aspectRatio);var M=this.cropperEl.offsetWidth,R=this.cropperEl.offsetHeight;D.constrainToBoundary(M,R,[.5,.5]);var B=this.cropperEl.offsetWidth/2-D.width()/2,U=this.cropperEl.offsetHeight/2-D.height()/2;return D.move(B,U),D}},{key:"redraw",value:function(){var u=this,v=Math.round(this.box.width()),w=Math.round(this.box.height()),D=Math.round(this.box.x1),_=Math.round(this.box.y1),C=Math.round(this.box.x2),M=Math.round(this.box.y2);window.requestAnimationFrame(function(){u.regionEl.style.transform="translate("+D+"px, "+_+"px)",u.regionEl.style.width=v+"px",u.regionEl.style.height=w+"px",u.imageClippedEl.style.clip="rect("+_+"px, "+C+"px, "+M+"px, "+D+"px)";for(var R=u.box.getAbsolutePoint([.5,.5]),B=R[0]-u.cropperEl.offsetWidth/2>>31,U=R[1]-u.cropperEl.offsetHeight/2>>31,F=(B^U)+U+U+4,G=-2*F+8,L=0;L<u.handles.length;L++){var N=u.handles[L],Y=N.el.offsetWidth,K=N.el.offsetHeight,X=D+v*N.position[0]-Y/2,pe=_+w*N.position[1]-K/2;N.el.style.transform="translate("+Math.round(X)+"px, "+Math.round(pe)+"px)",N.el.style.zIndex=G==L?5:4}})}},{key:"attachHandlerEvents",value:function(){var u=this.eventBus;u.addEventListener("handlestart",this.onHandleMoveStart.bind(this)),u.addEventListener("handlemove",this.onHandleMoveMoving.bind(this)),u.addEventListener("handleend",this.onHandleMoveEnd.bind(this))}},{key:"attachRegionEvents",value:function(){var u=this.eventBus,v=this;this.regionEl.addEventListener("mousedown",w),u.addEventListener("regionstart",this.onRegionMoveStart.bind(this)),u.addEventListener("regionmove",this.onRegionMoveMoving.bind(this)),u.addEventListener("regionend",this.onRegionMoveEnd.bind(this));function w(C){C.stopPropagation(),document.addEventListener("mouseup",_),document.addEventListener("mousemove",D),u.dispatchEvent(new CustomEvent("regionstart",{detail:{mouseX:C.clientX,mouseY:C.clientY}}))}function D(C){C.stopPropagation(),u.dispatchEvent(new CustomEvent("regionmove",{detail:{mouseX:C.clientX,mouseY:C.clientY}}))}function _(C){C.stopPropagation(),document.removeEventListener("mouseup",_),document.removeEventListener("mousemove",D),u.dispatchEvent(new CustomEvent("regionend",{detail:{mouseX:C.clientX,mouseY:C.clientY}}))}}},{key:"attachOverlayEvents",value:function(){var u=4,v=this,w=null;this.overlayEl.addEventListener("mousedown",D);function D(M){M.stopPropagation(),document.addEventListener("mouseup",C),document.addEventListener("mousemove",_);var R=v.cropperEl.getBoundingClientRect(),B=M.clientX-R.left,U=M.clientY-R.top;w=v.box,v.box=new g(B,U,B+1,U+1),v.eventBus.dispatchEvent(new CustomEvent("handlestart",{detail:{handle:v.handles[u]}}))}function _(M){M.stopPropagation(),v.eventBus.dispatchEvent(new CustomEvent("handlemove",{detail:{mouseX:M.clientX,mouseY:M.clientY}}))}function C(M){if(M.stopPropagation(),document.removeEventListener("mouseup",C),document.removeEventListener("mousemove",_),v.box.width()===1&&v.box.height()===1){v.box=w;return}v.eventBus.dispatchEvent(new CustomEvent("handleend",{detail:{mouseX:M.clientX,mouseY:M.clientY}}))}}},{key:"onHandleMoveStart",value:function(u){var v=u.detail.handle,w=[1-v.position[0],1-v.position[1]],D=this.box.getAbsolutePoint(w),_=s(D,2),C=_[0],M=_[1];this.activeHandle={handle:v,originPoint:w,originX:C,originY:M},this.options.onCropStart!==null&&this.options.onCropStart(this.getValue())}},{key:"onHandleMoveMoving",value:function(u){var v=u.detail,w=v.mouseX,D=v.mouseY,_=this.cropperEl.getBoundingClientRect();w=w-_.left,D=D-_.top,w<0?w=0:w>_.width&&(w=_.width),D<0?D=0:D>_.height&&(D=_.height);var C=this.activeHandle.originPoint.slice(),M=this.activeHandle.originX,R=this.activeHandle.originY,B=this.activeHandle.handle,U=B.constraints[0]===1,F=B.constraints[1]===1,G=B.constraints[2]===1,L=B.constraints[3]===1,N=(L||F)&&(U||G),Y=L||F?M:this.box.x1,K=L||F?M:this.box.x2,X=U||G?R:this.box.y1,pe=U||G?R:this.box.y2;Y=L?w:Y,K=F?w:K,X=U?D:X,pe=G?D:pe;var et=!1,Oe=!1;if((L||F)&&(et=L?w>M:w<M),(U||G)&&(Oe=U?D>R:D<R),et){var te=Y;Y=K,K=te,C[0]=1-C[0]}if(Oe){var qr=X;X=pe,pe=qr,C[1]=1-C[1]}var ye=new g(Y,X,K,pe);if(this.options.aspectRatio){var Zt=this.options.aspectRatio,eo=!1;N?eo=D>ye.y1+Zt*ye.width()||D<ye.y2-Zt*ye.width():(U||G)&&(eo=!0);var Qr=eo?"width":"height";ye.constrainToRatio(Zt,C,Qr)}var Wo=this.options.minSize,zo=this.options.maxSize;ye.constrainToSize(zo.width,zo.height,Wo.width,Wo.height,C,this.options.aspectRatio);var Xr=this.cropperEl.offsetWidth,Zr=this.cropperEl.offsetHeight;ye.constrainToBoundary(Xr,Zr,C),this.box=ye,this.redraw(),this.options.onCropMove!==null&&this.options.onCropMove(this.getValue())}},{key:"onHandleMoveEnd",value:function(u){this.options.onCropEnd!==null&&this.options.onCropEnd(this.getValue())}},{key:"onRegionMoveStart",value:function(u){var v=u.detail,w=v.mouseX,D=v.mouseY,_=this.cropperEl.getBoundingClientRect();w=w-_.left,D=D-_.top,this.currentMove={offsetX:w-this.box.x1,offsetY:D-this.box.y1},this.options.onCropStart!==null&&this.options.onCropStart(this.getValue())}},{key:"onRegionMoveMoving",value:function(u){var v=u.detail,w=v.mouseX,D=v.mouseY,_=this.currentMove,C=_.offsetX,M=_.offsetY,R=this.cropperEl.getBoundingClientRect();w=w-R.left,D=D-R.top,this.box.move(w-C,D-M),this.box.x1<0&&this.box.move(0,null),this.box.x2>R.width&&this.box.move(R.width-this.box.width(),null),this.box.y1<0&&this.box.move(null,0),this.box.y2>R.height&&this.box.move(null,R.height-this.box.height()),this.redraw(),this.options.onCropMove!==null&&this.options.onCropMove(this.getValue())}},{key:"onRegionMoveEnd",value:function(u){this.options.onCropEnd!==null&&this.options.onCropEnd(this.getValue())}},{key:"getValue",value:function(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;if(u===null&&(u=this.options.returnMode),u=="real"){var v=this.imageEl.naturalWidth,w=this.imageEl.naturalHeight,D=this.imageEl.getBoundingClientRect(),_=D.width,C=D.height,M=v/_,R=w/C;return{x:Math.round(this.box.x1*M),y:Math.round(this.box.y1*R),width:Math.round(this.box.width()*M),height:Math.round(this.box.height()*R)}}else if(u=="ratio"){var B=this.imageEl.getBoundingClientRect(),U=B.width,F=B.height;return{x:S(this.box.x1/U,3),y:S(this.box.y1/F,3),width:S(this.box.width()/U,3),height:S(this.box.height()/F,3)}}else if(u=="raw")return{x:Math.round(this.box.x1),y:Math.round(this.box.y1),width:Math.round(this.box.width()),height:Math.round(this.box.height())}}}],[{key:"parseOptions",value:function(u){var v={aspectRatio:null,maxSize:{width:null,height:null},minSize:{width:null,height:null},startSize:{width:100,height:100,unit:"%"},returnMode:"real",onInitialize:null,onCropStart:null,onCropMove:null,onCropEnd:null},w=null;u.aspectRatio!==void 0&&(typeof u.aspectRatio=="number"?w=u.aspectRatio:u.aspectRatio instanceof Array&&(w=u.aspectRatio[1]/u.aspectRatio[0]));var D=null;u.maxSize!==void 0&&u.maxSize!==null&&(D={width:u.maxSize[0]||null,height:u.maxSize[1]||null,unit:u.maxSize[2]||"px"});var _=null;u.minSize!==void 0&&u.minSize!==null&&(_={width:u.minSize[0]||null,height:u.minSize[1]||null,unit:u.minSize[2]||"px"});var C=null;u.startSize!==void 0&&u.startSize!==null&&(C={width:u.startSize[0]||null,height:u.startSize[1]||null,unit:u.startSize[2]||"%"});var M=null;typeof u.onInitialize=="function"&&(M=u.onInitialize);var R=null;typeof u.onCropStart=="function"&&(R=u.onCropStart);var B=null;typeof u.onCropEnd=="function"&&(B=u.onCropEnd);var U=null;typeof u.onUpdate=="function"&&(console.warn("Croppr.js: `onUpdate` is deprecated and will be removed in the next major release. Please use `onCropMove` or `onCropEnd` instead."),U=u.onUpdate),typeof u.onCropMove=="function"&&(U=u.onCropMove);var F=null;if(u.returnMode!==void 0){var G=u.returnMode.toLowerCase();if(["real","ratio","raw"].indexOf(G)===-1)throw"Invalid return mode.";F=G}var L=function(K){for(var X=K.offsetWidth,pe=K.offsetHeight,et=["maxSize","minSize","startSize"],Oe=0;Oe<et.length;Oe++){var te=et[Oe];this[te]!==null&&(this[te].unit=="%"&&(this[te].width!==null&&(this[te].width=this[te].width/100*X),this[te].height!==null&&(this[te].height=this[te].height/100*pe)),delete this[te].unit)}},N=function(K,X){return K!==null?K:X};return{aspectRatio:N(w,v.aspectRatio),maxSize:N(D,v.maxSize),minSize:N(_,v.minSize),startSize:N(C,v.startSize),returnMode:N(F,v.returnMode),onInitialize:N(M,v.onInitialize),onCropStart:N(R,v.onCropStart),onCropMove:N(U,v.onCropMove),onCropEnd:N(B,v.onCropEnd),convertToPixels:L}}}]),I}();function S(I,y){return Number(Math.round(I+"e"+y)+"e-"+y)}var T=function(I){i(y,I);function y(u,v){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return o(this,y),n(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,u,v,w))}return t(y,[{key:"getValue",value:function(v){return r(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"getValue",this).call(this,v)}},{key:"setImage",value:function(v){return r(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"setImage",this).call(this,v)}},{key:"destroy",value:function(){return r(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"destroy",this).call(this)}},{key:"moveTo",value:function(v,w){return this.box.move(v,w),this.redraw(),this.options.onCropEnd!==null&&this.options.onCropEnd(this.getValue()),this}},{key:"resizeTo",value:function(v,w){var D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[.5,.5];return this.box.resize(v,w,D),this.redraw(),this.options.onCropEnd!==null&&this.options.onCropEnd(this.getValue()),this}},{key:"scaleBy",value:function(v){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[.5,.5];return this.box.scale(v,w),this.redraw(),this.options.onCropEnd!==null&&this.options.onCropEnd(this.getValue()),this}},{key:"reset",value:function(){return this.box=this.initializeBox(this.options),this.redraw(),this.options.onCropEnd!==null&&this.options.onCropEnd(this.getValue()),this}}]),y}(m);return T})});var ot=(n=>(n[n.Invalid=0]="Invalid",n[n.Valid=1]="Valid",n[n.ExpireSoon=2]="ExpireSoon",n[n.Expired=3]="Expired",n))(ot||{});var Ee=(h=>(h[h.GridView=0]="GridView",h[h.Dashboard=1]="Dashboard",h[h.MenuNode=2]="MenuNode",h[h.Report=3]="Report",h[h.Diagram=4]="Diagram",h[h.CDM=5]="CDM",h[h.Slideshow=6]="Slideshow",h[h.GanttChart=7]="GanttChart",h[h.Scheduler=8]="Scheduler",h))(Ee||{});function P(o,t=!0){let r=t?"success":"error",i=t?2e3:4e3;DevExpress.ui.notify({message:o,type:r,onShowing:n=>{let s=n.element.find(".dx-toast-message");s.html((s.html()||"").replace("\\n","<br />"))}},r,i)}var ft=o=>o?Array.isArray(o)?o[0].StackTrace!==void 0||o[0].Error!==void 0:o.Error!==void 0:!1;var Te=(r=>(r[r.Completed=1]="Completed",r[r.Errored=2]="Errored",r))(Te||{});var ro={};ie(ro,{createButtons:()=>Qo,createDialog:()=>J,createItem:()=>hi});var to={};ie(to,{CSS_CLASSES:()=>oe});var oe={dxDataGrid:"iszolea-dx-datagrid",dxButton:"iszolea-dx-button",dxPopup:"iszolea-dx-popup"};var di="popup-content",gi="popup-footer",pi="buttons",oo="ok-btn",qo="cancel-btn";function ui(o,t){return{$content:$("<div />").addClass(di).addClass(t).appendTo(o),$footer:$("<div />").addClass(gi).appendTo(o)}}var yt=[];function ci(o,t,r=!1){let i=t.onShowing;t.onShown=l=>{i&&i(l);let g=s.content().find("input[type=text]"),p=g.eq(0);p.focus();let h={keydown:E=>{yt[yt.length-1]===s&&(E.keyCode===13&&$(E.currentTarget).trigger("change"),n(E))}};r?g.on(h):p.on(h)};function n(l){l.keyCode===13&&s.content().find(`.${oe.dxButton}.${oo}`).click(),l.keyCode===27&&s.content().find(`.${oe.dxButton}.${qo}`).click()}let s=o.dxPopup(t).dxPopup("instance");return{show:()=>{s.show(),$(document).on({keydown:n}),yt.push(s)},hide:()=>{$(document).off({keydown:n}),s.hide(),yt.pop()},remove:()=>o.remove()}}function Qo(o,t){let r=$("<table />").addClass(pi),i=$("<tr>").appendTo(r);return o&&$("<td />").attr("width",t?"50%":"100%").append($("<div />").addClass(oe.dxButton).addClass(oo).dxButton(o)).appendTo(i),t&&$("<td />").attr("width","50%").append($("<div />").addClass(oe.dxButton).addClass(qo).dxButton(t)).appendTo(i),r}function hi(o,t){return $("<div />").addClass("item").append($("<div />").addClass("form-label").text(o),$("<div />").addClass("value").append(t))}function J(o,t,r,i,n){let s=$("<div>").appendTo("body"),l=null,g=null,p=n?n.useKeyPressBehavior:!1;function h(){g.hide(),g.remove()}let E={contentTemplate:S=>{let{$content:T,$footer:I}=ui(S);T.append(t),r?(l=Qo({text:r.text,icon:r.icon,disabled:r.disabled,type:"success",onClick:y=>r.onClick(h)},i?{text:i.text,icon:i.icon,disabled:i.disabled,onClick:y=>i.onClick(h)}:void 0),I.append(l)):I.remove()},wrapperAttr:{class:"iszolea-dx-popup"}},m={};return $.extend(!0,m,o,E),g=ci(s,m,p),g.show(),{okBtn:l?l.find(`.${oo}`).dxButton("instance"):null,close:()=>h()}}var mi="iszolea-error-dx-popup",fi="iszolea-error-dx-popup__content",yi="iszolea-error-dx-popup__error-message",vi="iszolea-error-dx-popup__error-details",Xo="Show details",Si="Hide details";function io(o,t){let r,i=Array.isArray(t)?t:[t],n=$("<div />").addClass(fi);i.forEach((g,p)=>{let h=$("<p />").addClass(yi).text(g.Error),E=$("<p />").addClass(vi).text(g.StackTrace);n.append(h,E).hide(),p<i.length-1&&n.append($("<hr />"))});let s=J({title:o,height:"auto",animation:{show:{direction:"bottom",type:"slideIn"},hide:{direction:"bottom",type:"slideOut"}},position:{my:"bottom",at:"bottom",offset:{y:-50}},shading:!1,dragEnabled:!1,onInitialized:g=>{r=g.component,g.element.addClass(mi)}},n,{text:Xo,onClick:()=>{let g=!r.option("fullScreen");l(g),s.okBtn.option("text",g?Si:Xo)}},{text:"Close",onClick:g=>g()}),l=g=>{n.toggle(g),r.option("fullScreen",g),r.repaint()}}var rt=(i=>(i[i.UnexpectedException=0]="UnexpectedException",i[i.SqlException=1]="SqlException",i[i.IszoleaConfigurationException=2]="IszoleaConfigurationException",i))(rt||{});var vt=o=>{switch(o){case 1:return"We attempted to execute the data query however it appears there is an error in the data source.";case 2:return"Something wrong with iszolea configuration. Check ClientId/ClientSecret fields in the appsettings.json file.";default:return""}};var no="Unexpected error occurred. Please contact to developers.",bi=[504],St=()=>no;function Ie(o,t=!1){return t&&P(o.Message),JSON.stringify(o.Data)}function ne(o,t,r){let i=o.Message,n={message:i},s,l=Ei(i);if(l!==null?s=(r?r(l):"")||no:s=i||no,t){let g=o.Data;if(ft(g)){let p=Array.isArray(g)&&g.length,h=!Array.isArray(g)&&(g.StackTrace||g.Error);if(p||h)return io(s,g),n}P(s,!1)}return n}function Ei(o){return!isNaN(o)&&rt[+o]?+o:null}function Zo(o){let t=o.request.response?JSON.parse(o.request.response):{};return t.RequestState===1?(Ie(t),!0):(ne(t,!0),!1)}function x(o,t="GET",r=null,i,n){let s=$.Deferred(),l=(n==null?void 0:n.notifyError)===void 0||n.notifyError,g={headers:{Accept:"application/json"}},p=$.extend({type:t,url:o,data:r},n,g);return $.ajax(p).done(h=>{let E=h;if(E.RequestState===1){Ie(E,i),s.resolve(E.Data);return}let{message:m}=ne(E,l,(n==null?void 0:n.getUserFriendlyErrorMessage)||vt);s.reject(m)}).fail((h,E)=>{!bi.includes(h.status)&&l&&P(St(),!1),s.reject(E)}),s}function bt(o){return o().catch(t=>{let r=t.metadata["grpc-error"],i=t.metadata["grpc-stacktrace"];if(r||i){let n=atob(i);io(r,{Error:r,StackTrace:n})}else P(t.message,!1)})}var ir=mt(rr());function so(o,t,r,i){if(!o||typeof o!="object"||!o.RequestState||o.RequestState===1)return o;try{let n=ne(o,t,i).message;return $.Deferred().reject(n)}catch(n){return $.Deferred().reject(n)}}function ce(o){let t=DevExpress.data.AspNet.createStore(O(A({},o),{onBeforeSend:(r,i)=>{(r==="update"||r==="insert")&&(i.headers={Accept:"application/json"}),o.onBeforeSend&&o.onBeforeSend(r,i);let n=(o==null?void 0:o.notifyError)===void 0||o.notifyError;i.dataFilter=s=>{let l=JSON.parse(s);if(l.RequestState===1)return Ie(l,o.notifySuccess);let g=ne(l,n,o==null?void 0:o.getUserFriendlyErrorMessage).message;return l.Message=g,JSON.stringify(l)},i.error=s=>{let l=JSON.parse(s.responseText||"{}");l.RequestState||ne(l,n,o==null?void 0:o.getUserFriendlyErrorMessage)}}}));return t._errorHandler=r=>{r&&!r.message&&(r.message=St())},Object.defineProperty(t,"loadUrl",{value:o.loadUrl,writable:!1}),Object.defineProperty(t,"loadParams",{value:o.loadParams,writable:!1}),t}function Tt(o){let t=(o==null?void 0:o.notifyError)===void 0||o.notifyError,r=!!(o==null?void 0:o.notifySuccess),i=DevExpress.data.AspNet.createStore(O(A({},o),{onBeforeSend:(n,s)=>{(n==="update"||n==="insert"||n==="delete")&&(s.headers={Accept:"application/json"}),s.dataFilter=l=>{let g=JSON.parse(l);return g.RequestState===1?Ie(g,o.notifySuccess):(g.Message=ne(g,t,o==null?void 0:o.getUserFriendlyErrorMessage).message,JSON.stringify(g))},s.error=l=>{let g=JSON.parse(l.responseText||"{}");g.RequestState||ne(g,t,o==null?void 0:o.getUserFriendlyErrorMessage)},o.onBeforeSend&&o.onBeforeSend(n,s)}}));return i._errorHandler=n=>{n&&!n.message&&(n.message=St())},new DevExpress.data.CustomStore({key:i.key(),load:n=>i.load(n),byKey:(n,s)=>i.byKey(n,s),update:o.updateUrl?(n,s)=>i.update(n,s).then(l=>so(l,t,r,o==null?void 0:o.getUserFriendlyErrorMessage)):void 0,insert:o.insertUrl?n=>i.insert(n).then(s=>so(s,t,r,o==null?void 0:o.getUserFriendlyErrorMessage)):void 0,remove:o.deleteUrl?n=>i.remove(n).then(s=>so(s,t,r,o==null?void 0:o.getUserFriendlyErrorMessage)):void 0})}function nr(o,t){return new DevExpress.data.CustomStore({key:o,load:async r=>{let i=new ir.JsonMessage;i.setValue(JSON.stringify(r));let n=await bt(()=>t(i));return n?JSON.parse(n.getValue()):[]}})}var ao={};ie(ao,{default:()=>se});var we={};async function se(o){if(we[o])return await we[o];we[o]=x(o),we[o].catch(r=>{throw we[o]=null,r});let t=await we[o];return we[o]=null,t}var sr={sendRequest:x,handleError:ne,handleSuccess:Ie,handleUpload:Zo,createDxDataSource:ce,isErrorInfo:ft,loadWithMultipleProtection:ao,grpc:{sendRequest:bt,createDxDataSource:nr}};var H=o=>{throw new Error(`The required ${o?`${o} `:""} isn't created`)};var lo={};ie(lo,{WindowResizeListener:()=>he,bootstrapLayoutBreakpoints:()=>Z,enableAsyncSummaryLoader:()=>Ii,getUrlByMenuItemData:()=>ve});function It(o,t,r){let i={request:null,data:null,rendered:!1},n=0,s=o.option("onOptionChanged"),l=o.option("onContentReady"),g=()=>++n,p=(S,T={})=>{let I=[];for(let y in S){if(!S.hasOwnProperty(y))continue;let u=S[y];u!=null&&(typeof u=="object"?I.push(`${encodeURIComponent(y)}=${encodeURIComponent(JSON.stringify(u))}`):I.push(`${encodeURIComponent(y)}=${encodeURIComponent(u)}`))}for(let y in T){if(!T.hasOwnProperty(y))continue;let u=T[y];u!=null&&(Array.isArray(u)?u.forEach(v=>{I.push(`${encodeURIComponent(y)}[]=${encodeURIComponent(v)}`)}):I.push(`${encodeURIComponent(y)}=${encodeURIComponent(u)}`))}return I.join("&")},h=(S="Loading...")=>{$(".dx-datagrid-summary-item",o.element()).html(S)},E=(S,T)=>{var B,U,F,G;let I=(T==null?void 0:T.totalCount)||0,y=(T==null?void 0:T.summary)||[I],u=S.getDataSource(),v=S.getController("data"),w=S.getController("columns"),D=S.getController("tablePosition"),_=v==null?void 0:v._dataSource,C=w==null?void 0:w._dataSource,M=(B=D.getView("pagerView"))==null?void 0:B.getPager(),R=(G=(F=(U=v==null?void 0:v._footerItems)==null?void 0:U.find(L=>L.rowType==="totalFooter"))==null?void 0:F.summaryCells)==null?void 0:G.filter(L=>L.length);if(u&&(u._totalCount=I),_&&(_._totalCount=I,_._currentTotalCount=I,_._totalCountCorrection=0,_._hasLastPage=!0),C&&(C._totalAggregates=y),R==null?void 0:R.length)for(let L=0;L<R.length;L++){let N=R[L];typeof y[L]<"u"&&(N[0].value=y[L])}M&&(M._props.totalCount=v.totalCount(),M._props.pageCount=v.pageCount()),S.repaint()},m=(S,T)=>{let I=S.getDataSource()||S.option("dataSource");if(!I)return;let y=I._store||I.store;y.on("loading",u=>{let v=typeof T=="string",w=O(A({},u),{requireTotalCount:!0,isSummaryQuery:!0});u.requireTotalCount=!1,u.totalSummary=null,u.isSummaryQuery=!1;let D=v?T:y.loadUrl||r;h();let _=g();setTimeout(()=>{i.request=x(`${D}?${p(w,y.loadParams)}`,"GET",null,!1,{notifyError:!1}).done(C=>{_===n&&(i.data=C,i.rendered=!1,o.repaint())}).fail(()=>{_===n&&h("-")})},0)})};o.option("onOptionChanged",S=>{s&&s(S),S.name==="dataSource"&&S.value&&m(S.component,t)}),o.option("onContentReady",S=>{var T;l&&l(S),((T=i.request)==null?void 0:T.state())==="pending"?h():i.data&&!i.rendered&&(i.rendered=!0,E(o,i.data))}),m(o,t)}var Z={xs:{name:"xs",minWidth:0,maxWidth:575},sm:{name:"sm",minWidth:576,maxWidth:767},md:{name:"md",minWidth:768,maxWidth:991},lg:{name:"lg",minWidth:992,maxWidth:1199},xl:{name:"xl",minWidth:1200,maxWidth:1/0}},Ti=Object.getOwnPropertyNames(Z).map(o=>Z[o]),he=class{constructor(t,r,i=100,n=Ti){this.onWindowResizeListener=this.onWindowResize.bind(this);this.onResize=t,this.onLayoutBreakpointChanged=r,this.resizeDelay=i,this.layoutBreakpoints=n,this.currentLayoutBreakpoint=this.getLayoutBreakpointByWindowWidth(window.innerWidth),this.attachEvents()}destroy(){this.detachEvents()}attachEvents(){window.addEventListener("resize",this.onWindowResizeListener)}detachEvents(){window.removeEventListener("resize",this.onWindowResizeListener)}getLayoutBreakpointByWindowWidth(t){return this.layoutBreakpoints.find(r=>r.minWidth<=t&&(!r.maxWidth||r.maxWidth>=t))}onWindowResize(t){clearTimeout(this.lastWindowResizeTimeoutId),this.lastWindowResizeTimeoutId=window.setTimeout(()=>this.onWindowResizeInternal(t),this.resizeDelay)}onWindowResizeInternal(t){let r=this.getLayoutBreakpointByWindowWidth(window.innerWidth);if(this.currentLayoutBreakpoint!==r){let i=this.currentLayoutBreakpoint;this.currentLayoutBreakpoint=r,this.emitBreakpointChanged({previousBreakpoint:i,currentBreakpoint:this.currentLayoutBreakpoint,originalEvent:t})}this.emitResizeEvent(t)}emitResizeEvent(t){var r;try{(r=this.onResize)==null||r.call(this,t)}catch(i){console.error(i)}}emitBreakpointChanged(t){var r;try{(r=this.onLayoutBreakpointChanged)==null||r.call(this,t)}catch(i){console.error(i)}}};function ve(o){let{Area:t,Controller:r,Action:i,IsClickable:n}=o;if(n&&r)return encodeURI(t?`/${t}/${r}/${i}`:`/${r}/${i}`)}function Ii(o,t=null){It(o,t||!0)}var k={isLegacyRender:!1};var go=class{constructor(t){this.onLayoutBreakpointChangedListener=this.onLayoutBreakpointChanged.bind(this);this.container=t.container,this.userAvatar=t.userAvatar,this.userName=t.userName,this.items=t.items,this.collapseBreakpoint=t.collapseBreakpoint||Z.md,this.getDisplayedUserInfo=t.getDisplayedUserInfo||go.defaultGetDisplayedUserInfo,this.onItemClick=t.onItemClick,this.windowResizeListener=new he(void 0,this.onLayoutBreakpointChangedListener)}get root(){return this._root}render(){if(this._root&&this.container.removeChild(this._root),this.renderMainElements(),this.renderUserInfo(),this.renderItems(),!this.root)return H("root");this.container.appendChild(this.root)}addItems(t){this.items=this.items.concat(t),this.render()}insertItems(t,r){this.items.splice(r,0,...t),this.render()}updateItems(t){this.items=t,this.render()}get menuItems(){return this.items}getBadge(t){let r=this.items.find(i=>{var n;return((n=i.Text)==null?void 0:n.toLowerCase())===t});return(r==null?void 0:r.Badge)||null}setBadge(t,r){let i=this.items.find(n=>{var s;return((s=n.Text)==null?void 0:s.toLowerCase())===t});i&&(i.Badge=r),this.render()}get isMobileView(){return this.windowResizeListener.currentLayoutBreakpoint.maxWidth<this.collapseBreakpoint.maxWidth}renderMainElements(){this._root=document.createElement("div"),this._root.classList.add("user-menu"),this.mobileContentContainer=document.createElement("div"),this.mobileContentContainer.classList.add(`d-${this.collapseBreakpoint.name}-none`),this.desktopRootDropdown=document.createElement("div"),this.desktopRootDropdown.classList.add("dropdown","d-none",`d-${this.collapseBreakpoint.name}-block`),this.desktopContentTrigger=document.createElement("button"),this.desktopContentTrigger.classList.add("header__icon-button","btn","btn-outline-light"),this.desktopContentTrigger.setAttribute("type","button"),this.desktopContentTrigger.setAttribute("data-toggle","dropdown");let t;if(k.isLegacyRender?this.userAvatar?(t=document.createElement("img"),t.classList.add("header__icon-button-icon","header__icon-button-avatar"),t.src=this.userAvatar):(t=document.createElement("i"),t.classList.add("header__icon-button-icon","fas","fa-user")):(t=document.createElement("i"),t.classList.add("header__icon-button-icon","isoz-icon-user")),this.desktopContentContainer=document.createElement("div"),this.desktopContentContainer.classList.add("dropdown-menu","dropdown-menu-right"),this.desktopContentTrigger.appendChild(t),this.items.some(r=>!!r.Badge)){let r=document.createElement("span");r.classList.add("user-menu__badge"),this.desktopContentTrigger.appendChild(r)}this.desktopRootDropdown.appendChild(this.desktopContentTrigger),this.desktopRootDropdown.appendChild(this.desktopContentContainer),this.itemsContainer=document.createElement("ul"),this.itemsContainer.classList.add("user-menu__items"),k.isLegacyRender?(this.userInfoContainer=document.createElement("h6"),this.userInfoContainer.classList.add("user-info","h6")):(this.userInfoContainer=document.createElement("a"),this.userInfoContainer.classList.add("user-info","dropdown-item")),this.userInfoDivider=document.createElement("div"),this.userInfoDivider.classList.add("dropdown-divider","d-none",`d-${this.collapseBreakpoint.name}-block`),this.isMobileView?(this.mobileContentContainer.appendChild(this.userInfoContainer),this.mobileContentContainer.appendChild(this.userInfoDivider),this.mobileContentContainer.appendChild(this.itemsContainer)):(this.desktopContentContainer.appendChild(this.userInfoContainer),this.desktopContentContainer.appendChild(this.userInfoDivider),this.desktopContentContainer.appendChild(this.itemsContainer)),this._root.appendChild(this.mobileContentContainer),this._root.appendChild(this.desktopRootDropdown)}renderUserInfo(){if(!this.userInfoContainer)return H("userInfoContainer");if(k.isLegacyRender){let t=document.createElement("span");t.classList.add("user-info__content"),t.innerText=this.getDisplayedUserInfo(this.userName),this.userInfoContainer.appendChild(t)}else this.userInfoContainer.innerText=this.getDisplayedUserInfo(this.userName)}renderItems(){if(!this.itemsContainer)return H("itemsContainer");this.clearItemsContainer(),this.items.forEach(t=>{let r=this.createItemElement(t,this.isMobileView);this.itemsContainer.appendChild(r)})}createItemElement(t,r){let i=this.createItemElementBase(t),n=document.createElement("a");if(n.classList.add(r?"nav-link":"dropdown-item"),n.href=t.Url||"javascript:void(0)",n.text=t.Text,t.OpenInNewPage&&(n.target="_blank"),this.attachEventsToItem(n,t),i.appendChild(n),t.Badge){let s=document.createElement("span");s.classList.add("isoz-badge"),s.classList.add("isoz-badge--circle"),s.classList.add(`isoz-badge--${t.Badge.Type||"information"}`),s.innerHTML=t.Badge.Text,n.appendChild(s)}return i}createItemElementBase(t){let r=document.createElement("li");return r.classList.add("nav-item"),r}attachEventsToItem(t,r){t.addEventListener("click",i=>this.onMenuItemClick({item:r,originalEvent:i}))}switchView(t){t?(this.applyMobileViewForUserInfo(),this.applyMobileViewForItems()):(this.applyDesktopViewForUserInfo(),this.applyDesktopViewForItems())}applyMobileViewForUserInfo(){this.mobileContentContainer.insertBefore(this.userInfoContainer,null),this.mobileContentContainer.insertBefore(this.userInfoDivider,null)}applyDesktopViewForUserInfo(){this.desktopContentContainer.insertBefore(this.userInfoContainer,null),this.desktopContentContainer.insertBefore(this.userInfoDivider,null)}applyMobileViewForItems(){var t;this.mobileContentContainer.insertBefore(this.itemsContainer,null);for(let r of this.itemsContainer.children)(t=r.firstElementChild)==null||t.classList.replace("dropdown-item","nav-link")}applyDesktopViewForItems(){var t;this.desktopContentContainer.insertBefore(this.itemsContainer,null);for(let r of this.itemsContainer.children)(t=r.firstElementChild)==null||t.classList.replace("nav-link","dropdown-item")}clearItemsContainer(){for(;this.itemsContainer.firstChild;)this.itemsContainer.firstChild.remove()}emitItemClick(t){var r,i,n;try{(r=this.onItemClick)==null||r.call(this,t),(n=(i=t.item).OnClick)==null||n.call(i,t)}catch(s){console.error(s)}}onLayoutBreakpointChanged(t){this.switchView(this.isMobileView)}async onMenuItemClick(t){this.emitItemClick(t),t.cancel&&t.originalEvent.preventDefault()}},De=go;De.defaultGetDisplayedUserInfo=t=>`Welcome ${t}`;var wt=class{constructor(t){this.container=t.container,this.items=t.items,this.onItemClick=t.onItemClick}updateItems(t){this.items=t}emitItemClick(t){var r;try{(r=this.onItemClick)==null||r.call(this,t)}catch(i){console.error(i)}}};var Ue=class extends wt{constructor(t){super(t);this.onWindowResizeEventHandler=this.onWindowResize.bind(this);this.onToggleDropdownButtonClickHandler=this.onToggleDropdownButtonClick.bind(this);this.onToggleDropdownButtonMouseEnterHandler=this.onToggleDropdownButtonMouseEnter.bind(this);this.itemActionMode=t.itemAction||"hover",this.collapsingMode=t.collapsingMode??3,this.collapseBreakpoint=t.collapseBreakpoint||Z.md,this.collapseIconName=t.collapseIcon||"fa-ellipsis-v",this.windowResizeListener=new he(this.collapsingMode===3?this.onWindowResizeEventHandler:void 0,void 0,Ue.adaptivityCollapsingDelay)}render(){if(!this.root){if(this.renderRoot(),this.renderItems(),!this.root)return H("root");this.container.appendChild(this.root)}}updateItems(t){if(super.updateItems(t),!this.root)return new Error("The BootstrapCollapsingMenu isn't rendered");for(;this.root.firstChild;)this.root.firstChild.remove();this.renderItems()}applyAdaptivityCollapsing(){if(!(this.collapsingMode!==3||!this.root||!this.items.length||!this.collapseRoot||!this.collapseDropdown))if(this.isNeedCollapse()){this.collapseRoot.classList.remove("d-none");do{let t=this.root.children[this.root.children.length-2];if(!t)break;this.moveRootItemsToCollapseDropdown(t)}while(this.isNeedCollapse())}else{for(;this.collapseDropdown.children.length;)if(this.moveRootItemsToRoot(this.collapseDropdown.firstElementChild),this.isNeedCollapse()){let t=this.root.children[this.root.children.length-2];t&&this.moveRootItemsToCollapseDropdown(t);break}this.collapseDropdown.children.length||this.collapseRoot.classList.add("d-none")}}updateActiveItemsState(){this.forEachMenuItemRecursive(this.items,t=>{let r=t.active;t.active=po(t.originalModel),t.active!==r&&this.applyStatesToItemElement(t.menuItemEl.firstElementChild,t)})}closeOpenedDropdown(t){this.itemActionMode==="hover"&&(this.root.classList.remove(Ue.HOVER_MODE_CSS_CLASS),$(t).one("mouseleave",()=>{this.root.classList.add(Ue.HOVER_MODE_CSS_CLASS)}))}forEachMenuItemRecursive(t,r){t.forEach(i=>{r(i),this.isNestedItemsOwnerItem(i)&&this.forEachMenuItemRecursive(i.items,r)})}renderRoot(){this.root=document.createElement("ul"),this.root.classList.add("navbar-nav","mr-auto"),this.itemActionMode==="hover"&&this.root.classList.add(Ue.HOVER_MODE_CSS_CLASS)}renderItems(){this.renderRootItems(),this.items.length&&this.collapsingMode!==0&&(this.root||H("root"),this.root.style.visibility="hidden",this.renderCollapseElements(),setTimeout(()=>{this.applyAdaptivityCollapsing(),this.root.style.visibility=""},10)),this.changeDefaultDropdownBehaviorForNestedDropdown()}changeDefaultDropdownBehaviorForNestedDropdown(){$(this.root.querySelectorAll(".dropdown")).on("hide.bs.dropdown",t=>!(t.target!==this.currentOpeningSubMenu&&t.target.contains(this.currentOpeningSubMenu))),$(this.root.querySelectorAll(".dropdown-submenu")).on("show.bs.dropdown",t=>{this.currentOpeningSubMenu=void 0})}renderCollapseElements(){if(!this.root)return H("root");this.collapseRoot=document.createElement("li"),this.collapseRoot.classList.add("nav-item","dropdown","collapsing-menu__collapse-root"),this.collapseButton=document.createElement("button"),this.collapseButton.classList.add("header__icon-button","btn","btn-outline-light"),this.collapseButton.setAttribute("type","button"),this.collapseButton.setAttribute("data-toggle","dropdown");let t=document.createElement("i");t.classList.add("header__icon-button-icon","fas",this.collapseIconName),this.collapseDropdown=document.createElement("ul"),this.collapseDropdown.classList.add("dropdown-menu","dropdown-menu-right"),this.collapseButton.appendChild(t),this.collapseRoot.appendChild(this.collapseButton),this.collapseRoot.appendChild(this.collapseDropdown),this.root.appendChild(this.collapseRoot)}renderRootItems(){if(!this.root)return H("root");this.items.forEach(t=>{let r;this.isNestedItemsOwnerItem(t)?r=this.createRootItemWithNestedItems(t):r=this.createRootItemElement(t),this.root.appendChild(r)})}createRootItemWithNestedItems(t){let r=this.createRootItemElement(t);r.classList.add("dropdown");let i=r.querySelector(".nav-link");i instanceof HTMLElement&&this.setItemContentAsDropdownToggler(i);let n=this.createDropdownMenu(t);return r.appendChild(n),r}createRootItemElement(t){let r=document.createElement("li");r.classList.add("nav-item"),t.title&&r.setAttribute("title",t.title);let i=document.createElement("a");i.classList.add("nav-link"),i.href=t.url||"javascript:void(0)",i.text=t.text;let n=this.createItemIconElement(t);return n&&i.insertBefore(n,i.firstChild),this.applyStatesToItemElement(i,t),this.attachEventsToItem(i,t),r.appendChild(i),t.menuItemEl=r,r}createNestedSubMenuItemElement(t){let r=this.createNestedItem(t);r.classList.add("dropdown","dropdown-submenu");let i=r.querySelector(".dropdown-item");i instanceof HTMLElement&&this.setItemContentAsDropdownToggler(i);let n=this.createDropdownMenu(t);return r.appendChild(n),r}createNestedItem(t){let r=document.createElement("li");t.title&&r.setAttribute("title",t.title);let i=document.createElement("a");i.classList.add("dropdown-item"),i.href=t.url||"javascript:void(0)",i.text=t.text;let n=this.createItemIconElement(t);return n&&i.insertBefore(n,i.firstChild),this.applyStatesToItemElement(i,t),this.attachEventsToItem(i,t),r.appendChild(i),t.menuItemEl=r,r}createDropdownMenu(t){let r=document.createElement("ul");return r.classList.add("dropdown-menu"),t.items.forEach(i=>{let n;this.isNestedItemsOwnerItem(i)?n=this.createNestedSubMenuItemElement(i):n=this.createNestedItem(i),r.appendChild(n)}),r}createItemIconElement(t){if(!t.icon)return null;let r=document.createElement("i");return r.style.backgroundImage=`url(${t.icon})`,r}setItemContentAsDropdownToggler(t){t.classList.add("dropdown-toggle"),t.setAttribute("data-toggle","dropdown"),t.addEventListener("click",this.onToggleDropdownButtonClickHandler),t.addEventListener("mouseenter",this.onToggleDropdownButtonMouseEnterHandler)}applyStatesToItemElement(t,r){r.active?t.classList.add("active"):t.classList.remove("active"),r.hidden?t.classList.add("d-none"):t.classList.remove("d-none"),r.disabled?t.classList.add("disabled"):t.classList.remove("disabled")}attachEventsToItem(t,r){t.addEventListener("click",i=>this.emitItemClick({item:r,originalEvent:i}))}isNestedItemsOwnerItem(t){return t.items&&t.items.length&&t.items.some(r=>!r.hidden)}moveRootItemsToCollapseDropdown(t){if(t instanceof Element)this.applyCollapsingViewForRootItem(t),this.collapseDropdown.insertBefore(t,this.collapseDropdown.firstElementChild);else{let r=document.createDocumentFragment();for(let i of t)r.insertBefore(i,r.firstElementChild),this.applyCollapsingViewForRootItem(i);this.collapseDropdown.appendChild(r)}}moveRootItemsToRoot(t){if(t instanceof Element)this.applyExpandedViewForRootItem(t),this.root.insertBefore(t,this.root.children[this.root.children.length-1]||null);else{let r=document.createDocumentFragment();for(let i of t)r.insertBefore(i,r.firstElementChild),this.applyExpandedViewForRootItem(i);this.root.appendChild(r)}}applyCollapsingViewForRootItem(t){t.classList.add("dropdown-submenu");for(let r of t.children)r.classList.replace("nav-link","dropdown-item")}applyExpandedViewForRootItem(t){t.classList.remove("dropdown-submenu");for(let r of t.children)r.classList.replace("dropdown-item","nav-link")}isNeedCollapse(){if(this.windowResizeListener.currentLayoutBreakpoint.minWidth<this.collapseBreakpoint.minWidth)return!1;this.root.style.maxWidth="none";let t=this.root.getBoundingClientRect();this.root.classList.add("collapsing-menu_normal-white-space");let r=this.root.getBoundingClientRect();return this.root.classList.remove("collapsing-menu_normal-white-space"),this.root.style.maxWidth="",t.width>r.width}isDropdownRectsIntersect(t,r,i=2){return t.left<r.right-i&&r.left+i<t.right&&t.top<r.bottom-i&&r.top+i<t.bottom}applyShadowsForOverlapingDropdownIfNeeded(t){t.style.left="",t.classList.remove("dropdown-menu-left-shadowed");let r=t.getBoundingClientRect();r.right>window.innerWidth&&(t.style.left=`-${r.width}px`),r=t.getBoundingClientRect();let i=document.querySelectorAll(".dropdown-menu");for(let n of i)if(n!==t&&this.isDropdownRectsIntersect(n.getBoundingClientRect(),r)){t.classList.add("dropdown-menu-left-shadowed");break}}onWindowResize(t){this.applyAdaptivityCollapsing()}onToggleDropdownButtonClick(t){t.target instanceof HTMLElement&&t.target.parentElement&&(this.currentOpeningSubMenu=t.target.parentElement)}onToggleDropdownButtonMouseEnter(t){this.windowResizeListener.currentLayoutBreakpoint.maxWidth>=this.collapseBreakpoint.maxWidth&&t.target instanceof HTMLElement&&t.target.nextElementSibling instanceof HTMLElement&&t.target.nextElementSibling.classList.contains("dropdown-menu")&&this.applyShadowsForOverlapingDropdownIfNeeded(t.target.nextElementSibling)}},Pe=Ue;Pe.HOVER_MODE_CSS_CLASS="navbar-nav_hover-action",Pe.adaptivityCollapsingDelay=50;var ar=(o,t)=>{var r;for(let i of o){if(i.Name===t)return i;if((r=i.Items)==null?void 0:r.length){let n=ar(i.Items,t);if(n)return n}}},lr=o=>{let t=o.Items;if(!t||!t.length){let i=ve(o);return i?[i]:[]}let r=[];for(let i of t)r=r.concat(lr(i));return r},po=o=>{let t=window.location.pathname+window.location.search,r=lr(o);for(let i of r)if(new RegExp(`^.*${i.replace("?","\\?")}$`).test(t))return!0;return!1},Ne=class{constructor(t,r,i,n,s){this.onMenuItemClickHandler=this.onMenuItemClick.bind(this);this.container=t,this.isGlobalMenu=i,this.items=r,this.onNavigationMenuItemClick=s,this.menu=new Pe({container:this.container,items:this.mapNavigationMenuItemModelToMenuItems(r),collapseBreakpoint:n,onItemClick:this.onMenuItemClickHandler})}updateData(t,r){this.items=t,this.isGlobalMenu=r,this.menu.updateItems(this.mapNavigationMenuItemModelToMenuItems(this.items))}render(){this.menu.render()}applyAdaptivityCollapsing(){this.menu.applyAdaptivityCollapsing()}updateActiveItemsState(){this.menu.updateActiveItemsState()}async onMenuItemClick(t){let r=this.mapMenuItemClickEventArgsToNavigationMenuItemClickEventArgs(t);if(r&&(this.emitNavigationMenuItemClick(r),r.cancel)){t.originalEvent.preventDefault();let i=t.originalEvent.target;this.menu.closeOpenedDropdown(i)}}emitNavigationMenuItemClick(t){var r,i,n;try{(r=this.onNavigationMenuItemClick)==null||r.call(this,t),(n=(i=t.item).OnClick)==null||n.call(i,t)}catch(s){console.error(s)}}mapNavigationMenuItemModelToMenuItems(t){return t.map(r=>({text:r.Name,icon:r.Icon,items:r.Items?this.mapNavigationMenuItemModelToMenuItems(r.Items):void 0,url:ve(r),hidden:r.Visible===!1,active:po(r),disabled:r.Disabled,title:r.Description,originalModel:r}))}mapMenuItemClickEventArgsToNavigationMenuItemClickEventArgs(t){let r=ar(this.items,t.item.text);return r?{originalEvent:t.originalEvent,cancel:!1,item:O(A({},r),{isGlobal:this.isGlobalMenu})}:null}};var _e="iszolea-ui|logo-settings";var uo=class{constructor(t,r){this.$container=t,this.dataSource=r}initWidget(){return this._initWidget(this.dataSource)}updateData(){return window.sessionStorage.removeItem(_e),this.$imageElement.remove(),this.$titleContainer.remove(),this._initWidget(this.dataSource)}_initWidget(t){let r=window.sessionStorage.getItem(_e);return r?(this._createLogo(JSON.parse(r)),$.Deferred()):this._createLogo(t)}_createLogo(t){if(typeof t=="object"){let r=t;return this._createLogoMarkup(r),$.Deferred()}return x(this.dataSource,"post").done(r=>{let i={};i.applicationName=r.ApplicationName,i.businessName=r.BusinessName,i.logoImage=r.LogoImage,i.landingPageLogo=r.LandingPageLogo,i.description=r.Description,window.sessionStorage.setItem(_e,JSON.stringify(i)),this._createLogoMarkup(i)})}_createLogoMarkup(t){this.$imageElement=$("<img />").attr("src",t.logoImage).on("error",r=>this.$imageElement.css("display","none")).appendTo(this.$container),this.$titleContainer=$("<span />").addClass("title-container").appendTo(this.$container),this.$titleContainer.append($("<div />").addClass("business-name").text(t.businessName)),this.$titleContainer.append($("<div />").addClass("app-name").text(t.applicationName.toUpperCase()))}};var Le=class{constructor(t){this.onLayoutBreakpointChangedListener=this.onLayoutBreakpointChanged.bind(this);this.desktopContainer=t.desktopContainer,this.mobileContainer=t.mobileContainer,this.collapseBreakpoint=t.collapseBreakpoint||Z.md,this.onSwitch=t.onSwitch,this._value=t.startValue!==void 0?t.startValue:!0,this.windowResizeListener=new he(void 0,this.onLayoutBreakpointChangedListener)}get value(){return this._value}get container(){return this.isMobileView?this.mobileContainer:this.desktopContainer}get isMobileView(){return this.windowResizeListener.currentLayoutBreakpoint.maxWidth<this.collapseBreakpoint.maxWidth}setVisible(t){var r;(r=this.menuSwitcher)==null||r.option("visible",t)}render(){this.renderSwitch()}destroy(){var r;let t=this.menuSwitcher.element();(r=this.menuSwitcher)==null||r.dispose(),t==null||t.remove()}setValue(t){this.menuSwitcher.option("value",t)}handleValueChanged(t){this.onValueChanged=t}renderSwitch(){this.menuSwitcher=$("<div>").dxSwitch({switchedOffText:"Personal",switchedOnText:"Global",value:this.value,width:"100px",onValueChanged:({value:t})=>{this._value=t,this.onSwitch&&this.onSwitch(this.value),this.onValueChanged&&this.onValueChanged(t)}}).dxSwitch("instance"),this.container.appendChild(this.menuSwitcher.element()[0])}switchView(){this.destroy(),this.render()}onLayoutBreakpointChanged(t){this.switchView()}};var Dt=class{constructor(t){this.$container=t.$container,this.getMenuDataSource=t.getMenuDataSource,this.getIsGlobalMenuShown=t.getIsGlobalMenuShown,this.onDimensionsChanged=t.onDimensionsChanged,this.onMenuItemOpened=t.onMenuItemOpened,this.onMenuItemClick=t.onMenuItemClick}setVisible(t){var r;(r=this.searchDropDown)==null||r.option("visible",t),this.onDimensionsChanged&&this.onDimensionsChanged()}setSearchText(t){var r;(r=this.searchDropDown)==null||r.option("value",t)}reloadMenuItems(){var t;(t=this.searchResultsTreeList)==null||t.option("dataSource",this.getDataSourceForSearch(this.getMenuDataSource()))}render(){let t=document.createElement("form");t.classList.add("form-inline");let r=$("<div />").dxDropDownBox({placeholder:"Search",visible:!1,showDropDownButton:!1,applyValueMode:"instantly",acceptCustomValue:!0,openOnFieldClick:!1,mode:"search",elementAttr:{type:"search","aria-label":"Search"},contentTemplate:(i,n)=>{n.addClass("header-search-results-tree-list");let s=$("<div>").dxTreeList({dataSource:this.getDataSourceForSearch(this.getMenuDataSource()),hoverStateEnabled:!0,focusedRowEnabled:!0,editing:{allowAdding:!1,allowUpdating:!1,allowDeleting:!1},noDataText:"No results found",dataStructure:"tree",keyExpr:"Id",itemsExpr:"Items",filterMode:"fullBranch",showColumnHeaders:!1,columns:[{dataField:"Name",dataType:"string"}],onCellClick:({data:l})=>{this.navigateToMenuItem(l)},onKeyDown:l=>{let g=l.event,p=this.searchResultsTreeList.option("focusedRowKey");if(p!=null)switch(g.key){case"Enter":let h=this.searchResultsTreeList.getNodeByKey(p).data;this.navigateToMenuItem(h);break;case"ArrowRight":case" ":this.searchResultsTreeList.expandRow(p);break;case"ArrowLeft":this.searchResultsTreeList.collapseRow(p);break;case"Escape":setTimeout(()=>this.searchDropDown.focus());break}}});return this.searchResultsTreeList=s.dxTreeList("instance"),s},dropDownOptions:{position:{of:".search-dropdown",my:"top",at:"bottom",offset:{x:149,y:4}},width:518,animation:{show:{duration:0},hide:{duration:0}},hideOnOutsideClick:!1,onShown:i=>{this.searchDropDown.focus()}},onFocusIn:i=>{i.component.element().addClass("focused"),this.onDimensionsChanged&&this.onDimensionsChanged(),this.checkSearchResutPopupVisibility(i.component.element().find("input.dx-texteditor-input").val())},onFocusOut:i=>{i.component.element().find("input.dx-texteditor-input").val()||(i.component.element().removeClass("focused"),this.onDimensionsChanged&&this.onDimensionsChanged())},onKeyUp:i=>{setTimeout(()=>{let n=i.event,s=i.component.element().find("input.dx-texteditor-input").val();this.checkSearchResutPopupVisibility(s),this.searchResultsTreeList.searchByText(s),["Tab","Enter","ArrowDown","ArrowUp"].some(g=>g===n.key)&&this.searchResultsTreeList.focus(this.searchResultsTreeList.getCellElement(0,"Name"))})},onKeyDown:i=>{i.event.key==="Escape"&&this.closeSearchDropDown()},onValueChanged:i=>{this.checkSearchResutPopupVisibility(i.value)}}).addClass(["form-control","mr-sm-2","search-dropdown"]);this.searchDropDown=r.dxDropDownBox("instance"),t.appendChild(r[0]),this.$container.append(t)}navigateToMenuItem(t){var i;let r=ve(t);if(r){this.closeSearchDropDown();let n={item:t,originalEvent:null,cancel:!1};if((i=this.onMenuItemClick)==null||i.call(this,n),n.cancel)return;this.onMenuItemOpened&&this.onMenuItemOpened({menuItem:t}),window.location.href=r}}closeSearchDropDown(){var t,r,i;this.searchResultsTreeList.option("focusedRowKey",void 0),(t=this.searchDropDown)==null||t.option("value",""),(r=this.searchDropDown)==null||r.focus(),(i=this.searchDropDown)==null||i.blur()}checkSearchResutPopupVisibility(t){var r,i;t?(r=this.searchDropDown)==null||r.open():(i=this.searchDropDown)==null||i.close()}getDataSourceForSearch(t){if(!t)return;let r=i=>{let n=(s,l)=>{l.Items&&l.Items.length&&(l.Items=l.Items.reduce(n,[]));let g=l.Visible===void 0||l.Visible===null||l.Visible===!0,p=l.Disabled===!0;return g&&!p&&s.push(O(A({},l),{isGlobal:i})),s};return n};if(t.personalItems&&t.personalItems.length){let i={Name:"Global Menu",Id:-1,isGlobal:!0,Type:2,Items:t.gloabalItems.reduce(r(!0),[])},n={Name:"Personal Menu",Id:-2,isGlobal:!1,Type:2,Items:t.personalItems.reduce(r(!1),[])};return this.getIsGlobalMenuShown()?[i,n]:[n,i]}else return t.gloabalItems.reduce(r(!0),[])}};var fo={};ie(fo,{EventEmitter:()=>z,createGridExportFunction:()=>_t,getGeneralUserFriendlyErrorMessage:()=>vt,imageToBase64:()=>gr,isJsonString:()=>ae});var z=class{constructor(){this.eventListeners=[]}on(t,r){return this.eventListeners[t]||(this.eventListeners[t]=[]),this.eventListeners[t].push(r),r}once(t,r){this.on(t,i=>{r(i),this.off(t,r)})}emit(t,r=null){let i=this.eventListeners[t];if(i)for(let n of i)n&&n.call(this,r)}off(t,r){let i=this.eventListeners[t];if(i){let n=[];for(let s of i)s!==r&&n.push(s);this.eventListeners[t]=n}}addHandler(t,r,i){let n=()=>{r(i(),()=>this.off(t,n))};this.on(t,n)}};var dr=mt(mo());function _t(o){return t=>{let r=new window.ExcelJS.Workbook,i=r.addWorksheet(o);DevExpress.excelExporter.exportDataGrid({worksheet:i,component:t.component,customizeCell:n=>{let s=n.excelCell;s.font={name:"Arial",size:12},s.alignment={horizontal:"left"}}}).then(function(){r.xlsx.writeBuffer().then(function(n){(0,dr.default)(new Blob([n],{type:"application/octet-stream"}),`${o}.xlsx`)})}),t.cancel=!0}}var gr=o=>new Promise((t,r)=>{let i=new FileReader;i.readAsDataURL(o),i.onload=()=>{t(i.result)},i.onerror=r});var ae=o=>{if(!o)return!1;try{JSON.parse(o)}catch{return!1}return!0};var wi="iszolea-ui|header-data-cache",pr="iszolea-ui|show-global-menu",yo=o=>`${wi}${o?`|${o}`:""}`,it=class extends z{constructor(t){super();this.onNaviagtionMenuItemClickHandler=this.onNavigationMenuItemClick.bind(this);this.onNavigationMenuItemOpenedHandler=this.onNavigationMenuItemOpened.bind(this);this.onUserMenuItemClickHandler=this.onUserMenuItemClick.bind(this);this.elements={};var r,i,n,s,l;this.$el=t.$el,this.menuSettings=t.menuSettings,this.logoSettings=t.logoSettings,this.theme=t.theme||"iszolea",this.displaySearch=t.displaySearch,this.collapseBreakpoint=((r=t.menuSettings)==null?void 0:r.collapseBreakpoint)||Z.md,this.$partialViewPlaceHolder=(i=t.menuSettings)==null?void 0:i.partialViewPlaceHolder,this.updateUrlAfterPartialLoading=(n=t.menuSettings)==null?void 0:n.updateUrlAfterPartialLoading,this.onPartialViewLoaded=(s=t.menuSettings)==null?void 0:s.onPartialViewLoaded,this.beforePartialViewLoading=(l=t.menuSettings)==null?void 0:l.beforePartialViewLoading,this.loadPanel=this.createLoadPanel(),t.immediateRender===!1&&console.warn("The 'immediateRender === false' option isn't supported at the moment."),DevExpress.ui.dxOverlay.baseZIndex(1700),this.render(),this.init().then(()=>{var g;return(g=t==null?void 0:t.onInit)==null?void 0:g.call(t)}),this.subscribeOnHistoryPopState()}async updateData(){!this.menuSettings||(this.clearAppMenuModelCache(),this.data=await this.loadData(),!!this.elements.root&&this.rerenderMenus())}render(){this.renderRoot(),this.renderBrand(),this.renderContentToggler(),this.renderContent(),this.renderLoadBar(),this.updateContentAndTogglerVisible()}subscribeOnHistoryPopState(){this.$partialViewPlaceHolder&&$(window).bind("popstate",t=>{let i=t.originalEvent.state;i&&i.isLoadedByAjax?(this.loadPageViaAjaxCore(i.url),this.updateMenuSwitcherState(i.isMenuSwitcherGlobal),this.navigationMenu.updateActiveItemsState()):location.reload()})}createLoadPanel(){return $("<div />").dxLoadPanel({shadingColor:"rgba(0,0,0,0.4)",visible:!1,showIndicator:!0,showPane:!0,shading:!0,hideOnOutsideClick:!1}).appendTo(this.$el).dxLoadPanel("instance")}renderRoot(){this.elements.root=this.$el[0],this.elements.root.classList.add("header",this.theme,"navbar","navbar-dark",`navbar-expand-${this.collapseBreakpoint.name}`)}renderBrand(){if(this.logo||!this.logoSettings)return;if(!this.elements.root)return H("root");let t=document.createElement("a");t.classList.add("header__brand","navbar-brand"),t.href="/",this.elements.root.appendChild(t),this.elements.logoContainer=t,this.logo=new uo($(this.elements.logoContainer),this.logoSettings),this.logo.initWidget()}renderSearch(){if(!!this.displaySearch){if(!this.elements.contentContainer)return H("contentContainer");this.search=new Dt({$container:$(this.elements.contentContainer),getMenuDataSource:()=>this.getSearchDataSource(this.data),getIsGlobalMenuShown:()=>this.getIsGlobalMenuShown(),onDimensionsChanged:()=>{var t;return(t=this.navigationMenu)==null?void 0:t.applyAdaptivityCollapsing()},onMenuItemClick:this.onNaviagtionMenuItemClickHandler,onMenuItemOpened:this.onNavigationMenuItemOpenedHandler}),this.search.render()}}getIsGlobalMenuShown(){var t;return this.isShowGlobalMenu()||!((t=this.data)==null?void 0:t.AddGlobalPersonalSwitcher)}onNavigationMenuItemOpened(t){this.updateMenuSwitcherState(t.menuItem.isGlobal)}updateMenuSwitcherState(t){!this.menuSwitcher||this.menuSwitcher.value!==t&&this.menuSwitcher.setValue(t)}renderContentToggler(){if(!this.elements.root)return H("root");this.elements.toggleButton=document.createElement("button"),this.elements.toggleButton.classList.add("navbar-toggler"),this.elements.toggleButton.setAttribute("type","button"),this.elements.toggleButton.setAttribute("data-toggle","collapse"),this.elements.toggleButton.setAttribute("data-target",".header__content"),this.elements.toggleButton.onclick=()=>{var r;(r=this.search)==null||r.setSearchText("")};let t=document.createElement("span");t.classList.add("navbar-toggler-icon"),this.elements.toggleButtonContainer=document.createElement("div"),this.elements.toggleButtonContainer.classList.add("header__toggle-button-container"),this.elements.toggleButton.appendChild(t),this.elements.toggleButtonContainer.appendChild(this.elements.toggleButton),this.elements.root.appendChild(this.elements.toggleButtonContainer)}renderContent(){if(!this.elements.root)return H("root");this.elements.contentContainer=document.createElement("div"),this.elements.contentContainer.classList.add("collapse","navbar-collapse","header__content"),this.elements.root.appendChild(this.elements.contentContainer),this.renderSearch(),this.renderNavigationMenu([]),this.renderMenuSwitcher(),this.renderUserMenu([])}renderNavigationMenu(t){if(!this.elements.contentContainer)return H("contentContainer");let r=this.getIsGlobalMenuShown();this.navigationMenu?this.navigationMenu.updateData(t,r):(this.navigationMenu=new Ne(this.elements.contentContainer,t,r,this.collapseBreakpoint,this.onNaviagtionMenuItemClickHandler),this.navigationMenu.render())}onUserMenuItemClick(t){var i,n;if($(this.elements.contentContainer).removeClass("show"),(n=(i=this.menuSettings).onUserMenuClick)==null||n.call(i,t),t.cancel||this.isKeyPressed(t.originalEvent))return;let r=t.item.Url;t.item.AlwaysReloadPage?window.location.href=r:t.cancel=this.tryDoPartialPageLoading(r)}onNavigationMenuItemClick(t){var i,n;if(t.item.Items.length||$(".show",this.elements.contentContainer).removeClass("show"),(n=(i=this.menuSettings).onNavigationMenuItemClick)==null||n.call(i,t),t.cancel||this.isKeyPressed(t.originalEvent))return;this.updateMenuSwitcherState(t.item.isGlobal);let r=ve(t.item);t.cancel=this.tryDoPartialPageLoading(r)}isKeyPressed(t){return t&&(t.altKey||t.ctrlKey||t.shiftKey)}tryDoPartialPageLoading(t){var r;if(this.$partialViewPlaceHolder&&t&&this.checkIsLocalUrl(t)){if(this.updateUrlAfterPartialLoading){let i={isLoadedByAjax:!0,isMenuSwitcherGlobal:!!((r=this.menuSwitcher)==null?void 0:r.value),url:t};window.history.pushState(i,null,t)}return this.loadPageViaAjaxCore(t),this.navigationMenu.updateActiveItemsState(),!0}return!1}checkIsLocalUrl(t){return!it.GLOBAL_URL_REGEX.test(t)}checkIsPartialPageContent(t){return t&&!it.DOCTYPE_MARKER_REGEX.test(t)}loadPageViaAjaxCore(t){var n;window.isIsozServerException=!1,this.loadPanel.show();let r=new URL(window.location.origin+t);r.searchParams.append("isozPartialLoading","true");let i=r.toString();(n=this.beforePartialViewLoading)==null||n.call(this),$.ajax(i,{dataType:"html"}).always((s,l)=>{var g;l!=="success"||!this.checkIsPartialPageContent(s)?window.location.href=t:(this.$partialViewPlaceHolder.html(s),(g=this.onPartialViewLoaded)==null||g.call(this),this.loadPanel.hide())})}renderUserMenu(t){var r;if(!!((r=this.menuSettings)==null?void 0:r.userName)){if(!this.elements.contentContainer)return H("contentContainer");if(this.userMenu)this.userMenu.updateItems(t);else{let i=document.createElement("div");i.classList.add("dropdown-divider"),this.elements.contentContainer.appendChild(i),this.userMenu=new De({container:this.elements.contentContainer,userName:this.menuSettings.userName,userAvatar:this.menuSettings.userAvatar,items:t,collapseBreakpoint:this.collapseBreakpoint,onItemClick:this.onUserMenuItemClickHandler,getDisplayedUserInfo:this.menuSettings.getDisplayedUserInfo}),this.userMenu.render()}}}renderMenuSwitcher(){var t,r,i,n;if((t=this.data)==null?void 0:t.AddGlobalPersonalSwitcher){if(this.menuSwitcher)return}else{this.menuSwitcher&&(this.menuSwitcher.destroy(),(r=this.elements.menuSwitcherDesktopContainer)==null||r.remove(),(i=this.elements.menuSwitcherMobileContainer)==null||i.remove(),this.menuSwitcher=void 0,this.elements.menuSwitcherDesktopContainer=void 0,this.elements.menuSwitcherMobileContainer=void 0);return}if(!this.elements.contentContainer)return H("contentContainer");if(!this.elements.toggleButtonContainer)return H("toggleButtonContainer");this.elements.menuSwitcherDesktopContainer=document.createElement("div"),this.elements.menuSwitcherDesktopContainer.classList.add("menu-switcher"),this.elements.menuSwitcherMobileContainer=document.createElement("div"),this.elements.menuSwitcherMobileContainer.classList.add("menu-switcher"),this.menuSwitcher=new Le({desktopContainer:this.elements.menuSwitcherDesktopContainer,mobileContainer:this.elements.menuSwitcherMobileContainer,collapseBreakpoint:this.collapseBreakpoint,startValue:this.isShowGlobalMenu(),onSwitch:s=>{var g,p;window.localStorage.setItem(pr,JSON.stringify(s));let l=this.getNavigationItems(this.data);(g=this.search)==null||g.setSearchText(""),(p=this.search)==null||p.reloadMenuItems(),this.renderNavigationMenu(l||[]),this.updateContentAndTogglerVisible()}}),this.menuSwitcher.render(),this.emit(it.MENU_SWITCHER_INITIALIZED_EVENT),this.elements.contentContainer.insertBefore(this.elements.menuSwitcherDesktopContainer,(n=this.userMenu)==null?void 0:n.root),this.elements.toggleButtonContainer.insertBefore(this.elements.menuSwitcherMobileContainer,this.elements.toggleButton)}renderLoadBar(){this.$loadBar=$("<div />").addClass("load-bar").hide().appendTo(this.$el);let t=$("<div />").addClass("load").appendTo(this.$loadBar);$("<div />").addClass("bar").appendTo(t);function r(i){$(i).animate({left:$(".load").width()},2e3,()=>{$(i).css("left",`${-$(i).width()}px`),r(i)})}r(".bar")}rerenderMenus(){let t=this.getNavigationItems(this.data),r=this.getUserItems(this.data);t&&this.renderNavigationMenu(t),r&&this.renderUserMenu(r),this.renderMenuSwitcher(),this.updateContentAndTogglerVisible()}updateContentAndTogglerVisible(){var n,s;if(!this.elements.contentContainer&&!this.elements.toggleButton)return;let t=this.getNavigationItems(this.data),r=this.getUserItems(this.data),i=t&&t.length>0||((n=this.menuSettings)==null?void 0:n.userName)||r&&r.length>0;this.elements.toggleButton.classList.toggle("d-none",!i),this.elements.contentContainer.classList.toggle("d-none",!i),(s=this.search)==null||s.setVisible(!!i)}async init(){!this.menuSettings||(this.data=await this.loadData(),!!this.elements.root&&this.rerenderMenus())}async loadData(){var r,i,n,s,l;if(!this.menuSettings)throw new Error("The header doesn't have menu settings");if(typeof this.menuSettings.data!="string")return this.menuSettings.data;let t=this.getCachedAppMenuModel();if(t)return t;try{return(r=this.search)==null||r.setVisible(!1),(i=this.$loadBar)==null||i.show(),t=await x(this.menuSettings.data),this.cacheAppMenuModel(t),(n=this.search)==null||n.reloadMenuItems(),t}finally{(s=this.search)==null||s.setVisible(!0),(l=this.$loadBar)==null||l.hide()}}getNavigationItems(t){return t?this.isShowGlobalMenu()||!t.AddGlobalPersonalSwitcher?t.NavigationItems:t.PersonalNavigationItems:void 0}getSearchDataSource(t){if(!!t)return{gloabalItems:t.NavigationItems,personalItems:t.AddGlobalPersonalSwitcher?t.PersonalNavigationItems:void 0}}getUserItems(t){if(!!t)return t.UserItems}getCachedAppMenuModel(){if(!this.menuSettings)return null;let t=window.sessionStorage.getItem(yo(this.menuSettings.userName));return t===null?t:JSON.parse(t)}cacheAppMenuModel(t){return this.menuSettings?(window.sessionStorage.setItem(yo(this.menuSettings.userName),JSON.stringify(t)),!0):!1}clearAppMenuModelCache(){return this.menuSettings?(window.sessionStorage.removeItem(yo(this.menuSettings.userName)),!0):!1}isShowGlobalMenu(){let t=window.localStorage.getItem(pr),r=t===null?t:JSON.parse(t);return r===null||r}},Ce=it;Ce.MENU_SWITCHER_INITIALIZED_EVENT="menu-switcher-initialized-event",Ce.GLOBAL_URL_REGEX=new RegExp("^(?:[a-z]+:)?//","i"),Ce.DOCTYPE_MARKER_REGEX=new RegExp("!DOCTYPE html>","i");var Di=["default","string","number","date","boolean","object","datetime"],Be=Di;var Fe=(i=>(i[i.None=0]="None",i[i.AddNewRows=1]="AddNewRows",i[i.ReplaceAllRows=2]="ReplaceAllRows",i))(Fe||{});var je=(g=>(g.Default="default",g.String="string",g.Number="number",g.Date="date",g.Boolean="boolean",g.Object="object",g.Datetime="datetime",g))(je||{});var Se=[];function _i(o,t){return Math.floor(Math.random()*(t-o+1))+o}function Ct(o,t,r=5,i=2){let n=t.sort((s,l)=>.5-Math.random());o.addClass("iszolea-background-image-viewer").css({transition:`background-image ${i}s ease-in-out 0s`}),n.forEach((s,l)=>{let g=new Image;g.addEventListener("load",()=>{Se.push(s),Se.length===1&&xi(o,r)}),window.setTimeout(()=>{g.src=s},l*100)})}function Ci(o){if(Se.length===1)return 0;if(Se.length===2)return o===0?1:0;let t=_i(0,Se.length-1);return t===o?t===Se.length-1?0:t+1:t}function xi(o,t){let r=0;ur(o,r),window.setInterval(()=>{Se.length!==1&&(r=Ci(r),ur(o,r))},t*1e3)}function ur(o,t){o.css("background-image",`url("${Se[t]}")`)}var vo=(i=>(i[i.Success=0]="Success",i[i.Warning=1]="Warning",i[i.Error=2]="Error",i))(vo||{}),Ai={year:"local"},Ve=class{constructor(t){this.indicatorClassByStatus=new Map([[0,"footer__indicator_type_success"],[1,"footer__indicator_type_warning"],[2,"footer__indicator_type_error"]]);let r=A(A({},t),Ai);this.$root=r.$root,this.name=r.name!==!1?r.name:void 0,this.licence=r.licence!==!1?r.licence:void 0,this.year=Ve.getCurrentYear(r.year),this.version=t.version||void 0,this.showName=r.name!==!1,this.showLicence=r.licence!==!1,this.showYear=r.year!==!1,this.showConnectedTo=!!r.serverName&&!!r.database,this.indicatorsOptions=t.indicators||[],this.indicatorsByName=new Map,this.connectedTo=this.showConnectedTo?`${r.serverName} - ${r.database}`:void 0}static getCurrentYear(t){return t==="local"||t===!1?new Date().getFullYear():t}init(){this.$root.addClass("footer"),this.renderIndicators(),this.renderCopyright(),this.showYear&&this.renderYear(),this.showName&&this.renderName(),this.showConnectedTo&&this.renderConnectedTo(),this.showLicence&&this.renderLicence()}setIndicatorValue(t,r){let i=this.indicatorsByName.get(t);i&&this.setIndicatorValueCore(i,r)}renderIndicators(){var t;(t=this.indicatorsOptions)==null||t.forEach(r=>{r.text&&$("<span>").addClass("footer__indicator-text").html(`${r.text}:`).appendTo(this.$root);let i=$("<span>").addClass("footer__indicator").appendTo(this.$root);this.setIndicatorValueCore(i,r.value),this.indicatorsByName.set(r.name,i),r.getValue&&r.getValueIntervalMs&&setInterval(async()=>{let n=await r.getValue();this.setIndicatorValueCore(i,n)},r.getValueIntervalMs)})}setIndicatorValueCore(t,r){t.attr("title",r.title),t.removeClass([...this.indicatorClassByStatus.values()]),t.addClass(this.indicatorClassByStatus.get(r.status))}renderCopyright(){$("<span>").addClass("footer__copyright").html("©").appendTo(this.$root)}renderName(){this.name&&$("<span>").addClass("footer__item").addClass("footer__app-name").text(this.name+(this.version?`: ${this.version}`:"")).appendTo(this.$root)}renderConnectedTo(){this.name&&$("<span>").addClass("footer__item").addClass("footer__connected-to").text(`Connected to: ${this.connectedTo}.`).appendTo(this.$root)}renderYear(){$("<span>").addClass("footer__item").addClass("footer__current-year").text(this.year).appendTo(this.$root)}renderLicence(){this.licence&&$("<span>").addClass("footer__item").addClass("footer__licence-info").append($("<span>").addClass("footer__licence-owner").text(`${this.getLicenceOwnerDisplayText(this.licence)}. `)).append($("<span>").addClass("footer__licence-date").text(this.getLicenceExpirationDateDisplayText(this.licence))).appendTo(this.$root)}getLicenceOwnerDisplayText(t){return`Licenced to: ${t.Owner}`}getLicenceExpirationDateDisplayText(t){return`Licence Expiry: ${(typeof t.ExpirationDate=="string"?new Date(t.ExpirationDate):t.ExpirationDate).toLocaleDateString()}`}};var xt=null,cr=[];window.addEventListener("resize",()=>{xt&&window.clearTimeout(xt),xt=window.setTimeout(()=>{cr.forEach(o=>o()),xt=null},100)});function At(o){cr.push(o)}var nt={main:".main",header:".main .header",content:".content-area",panel:".panel",footer:"footer"},So=null,Rt=null,Mt=null;function hr(o){$(nt.content).height(Rt),o.option("height",Mt)}function Ri(o,t=!1,r=!1){let i=$(nt.main),n=$(nt.header),s=$(nt.content),l=$(nt.footer),g=s.outerHeight()-s.height();Rt=i.height()-n.height()-l.outerHeight()-g,So=$(window).height();let p=s.children(),h=0;if(!t){let E=o.element();p.each((m,S)=>{let T=$(S);T.is(E)||T.has(E[0]).length||(h+=T.is(":visible")&&T.css("position")!=="absolute"?T.outerHeight(!0):0)})}Mt=Rt-h,r&&(Mt+=o.element().outerHeight()),hr(o)}function Mi(o){let t=$(window).height(),r=t-So;Rt+=r,Mt+=r,So=t,hr(o)}function le(o,t=!1,r=!1){Ri(o,t,r),At(()=>Mi(o))}var Oi="isoz-icon-disabled",q={lg:"iszolea-lg",md:"iszolea-md",sm:"iszolea-sm"},Q=class{static setElementMiddleSize(t){t.addClass(q.md)}static setElementSmallSize(t){t.addClass(q.sm)}static setWidgetMiddleSize(t){Q.setWidgetSize(t,q.md)}static setWidgetSmallSize(t){Q.setWidgetSize(t,q.sm)}static setToolbarWidgetSmallSize(t){t&&Q.setToolbarWidgetSize(t,q.sm)}static setToolbarWidgetMediumSize(t){t&&Q.setToolbarWidgetSize(t,q.md)}static getIconClass(t,r,i=16){let n=`isoz isoz-icon-${t}-${i}`;return r?`${n} ${Oi}`:n}static setWidgetSize(t,r){t&&t.option("elementAttr",{class:r})}static setToolbarWidgetSize(t,r){t.options||(t.options={}),t.options.elementAttr||(t.options.elementAttr={}),t.options.elementAttr.class?t.options.elementAttr.class+=` ${r}`:t.options.elementAttr.class=r}};var Ui={title:"isoz-title"},st=class{static getToolbarTitleTemplateItem(t,r){return{location:"before",template:()=>{let i=$(`<span class="${Ui.title}">${t}</span>`);return r&&i.append($("<i />").addClass("fas").addClass("fa-info-circle").addClass("report-details-link").attr("title","Report details")),i}}}};var mr={title:"isoz-title",header:"isoz-toolbar-header",dropDownButton:"dx-dropdownmenu-button"};function fr(o,t={title:"",description:"",options:{}}){let{title:r="",description:i="",options:n={}}=t,{items:s=[],elementAttr:l={}}=n;s.forEach(p=>{let h={class:q.md};if(p.options){let{editorOptions:E}=p.options;E||(E={}),E.elementAttr=h,p.options.elementAttr=h,p.options.editorOtions=E}});let g=p=>{p.element.find(`.${mr.dropDownButton}`).addClass(q.md),(n==null?void 0:n.onContentReady)&&n.onContentReady(p)};return $(`${o}`).dxToolbar(O(A({},n),{items:[st.getToolbarTitleTemplateItem(r,i),...s],onContentReady:g,elementAttr:O(A({},l),{class:mr.header})})).dxToolbar("instance")}var Pi={panel:".panel-body"};function yr(o){let t=o.element(),r=o.element().parents(Pi.panel).eq(0),i=r.position().top,n=r.height(),s=r.outerHeight()-r.height(),l=t.position().top,g=n-(l-i)+s/2;o.option("height",g)}function bo(o){yr(o),At(()=>yr(o))}function vr(o,t,r=!1){let i=Eo(o,t);return t.height||(r?bo(i):le(i)),i}function Eo(o,t){let r=o.dxDataGrid(t).dxDataGrid("instance");return r.element().addClass(oe.dxDataGrid),r}function Sr(o,t,r=!1){let i=(typeof o=="string"?$(o):o).dxTreeList(t).dxTreeList("instance");return i.element().addClass(oe.dxDataGrid),t.height||(r?bo(i):le(i)),i}var br=o=>o.slice(2).toLowerCase(),Ni=o=>{let t=br(o);return{searchPanel:`.dx-${t}-search-panel`,toolbarEditButton:`.dx-${t}-toolbar-button.dx-edit-button`,toolbarExportButton:`.dx-${t}-export-button .dx-button`,selectCheckBox:".dx-select-checkbox"}};function Er(o){let t=k.isLegacyRender?Li(o):Ir(o);return(o.summaryColumn||o.showSummaryInColumn)&&(t.summary={totalItems:[{column:o.summaryColumn||o.showSummaryInColumn,showInColumn:o.showSummaryInColumn||o.summaryColumn,summaryType:"count"}]}),t.export={enabled:!!o.exportFileName,allowExportSelectedData:!0},k.isLegacyRender||(t.groupPanel={visible:!0}),t}function Tr(o){let t=Ir(o);return t.selection={mode:"none"},t}function Ir(o){return{allowColumnResizing:!0,cacheEnabled:!0,columnAutoWidth:!0,filterRow:{visible:!0,applyFilter:"onClick"},headerFilter:{visible:!0},hoverStateEnabled:!0,paging:{pageSize:80},pager:{visible:!1},remoteOperations:!0,scrolling:{mode:"virtual",rowRenderingMode:"virtual"},searchPanel:{visible:!0,width:240,placeholder:"Search..."},showRowLines:!0,showBorders:!0,selection:{mode:"multiple"},wordWrapEnabled:!0}}function Li(o){return{allowColumnResizing:!0,remoteOperations:!0,columnAutoWidth:!0,showBorders:!0,filterRow:{visible:!0,applyFilter:"onClick"},selection:{mode:"multiple"},paging:{pageSize:50},searchPanel:{visible:!0},headerFilter:{visible:!0},scrolling:{mode:"virtual"}}}function Bi(o,t){let r=(i,n)=>i.find(s=>s.name===n);if(o==null?void 0:o.items){let{items:i}=o;if(t){let g=r(i,t);g&&(g.options.type="default")}let n=r(i,"saveButton");n&&(n.showText="always",n.options.text="Save");let s=r(i,"revertButton");s&&(s.showText="always",s.options.text="Discard");let l=r(i,"refresh");l&&(l.showText="always",l.options.text="Refresh",l.options.hint="Reload Data")}}function Fi(o){var s,l,g;let t=o.option("summary.totalItems"),r=(s=t==null?void 0:t.filter(p=>p.summaryType==="count")[0])==null?void 0:s.column,i=r&&o.getVisibleColumns().findIndex(p=>p.dataField===r);if(!i){let p=o.option("selection");i=p&&p.mode!=="none"?o.getVisibleColumns().findIndex(E=>!!E.dataField):0}let n=(l=o.getVisibleColumns()[i])==null?void 0:l.dataField;n&&r!==n&&o.option("summary",{totalItems:[{column:(g=o.getVisibleColumns()[i])==null?void 0:g.dataField,summaryType:"count"}]})}function Ot(o,t){let r=Ni(o),i=!1;return{onCellPrepared:n=>{var s,l;k.isLegacyRender||n.rowType==="header"&&n.cellElement.css("text-align","center"),((s=t.options)==null?void 0:s.onCellPrepared)&&((l=t.options)==null||l.onCellPrepared(n))},onContentReady:n=>{var l;let s=n.component;s.beginUpdate(),t.disableSummaryColumnDetection||Fi(s),i||(i=!0,setTimeout(()=>{let g=s.getScrollable();g&&g.scrollTo({top:0})}));for(let g=0;g<s.columnCount();g++){let p=s.columnOption(g,"dataType");(t.setDefaultColumnWidth||t.setDefaultColumnWidth===void 0)&&(s.columnOption(g,"width")||(p==="boolean"&&(s.columnOption(g,"width","45px"),s.columnOption(g,"editorOptions",{dropDownOptions:{width:80}})),p==="datetime"&&s.columnOption(g,"width","135px"),p==="date"&&s.columnOption(g,"width","140px"))),(p==="datetime"||p==="date")&&s.columnOption(g,"alignment","right"),p==="date"&&s.columnOption(g,"format","dd MMM yyyy"),p==="datetime"&&s.columnOption(g,"format","HH:mm, dd MMM yyyy")}((l=t.options)==null?void 0:l.onContentReady)&&t.options.onContentReady(n),s.endUpdate()},onToolbarPreparing:n=>{var S;let{toolbarOptions:s={}}=n,l=n.component,{items:g=[]}=s;g.forEach(T=>{T.name==="applyFilterButton"&&T.options&&(T.options.visible=!1)}),k.isLegacyRender?t.title&&n.toolbarOptions.items.unshift({location:"before",template(){let T=$("<h2 />").addClass("grid-header").text(t.title);return t.headerDescription&&T.append($("<i />").addClass("fas").addClass("fa-info-circle").addClass("report-details-link").attr("title","Click to see further details")),T}}):(t.title&&g.unshift(st.getToolbarTitleTemplateItem(t.title,t.headerDescription)),g.filter(T=>{if(T.widget==="dxButton"){let I=t.buttonsSize==="sm"?16:24;switch(T.name){case"addRowButton":T.options.icon=Q.getIconClass("plus",!1,I);break;case"saveButton":T.options.icon=Q.getIconClass("save",!1,I);break;case"revertButton":T.options.icon=Q.getIconClass("close",!1,I);break;default:T.options.icon=void 0;break}T.options.elementAttr||(T.options.elementAttr={}),T.options.elementAttr.class=t.buttonsSize==="sm"?q.sm:q.md,T.showText="always"}}),Bi(s,t.toolbarAccentButtonName),t.toolbarItems&&g.push(...t.toolbarItems),s.elementAttr={class:"isoz-toolbar-header"});let p=n.toolbarOptions.items.findIndex(T=>T.name==="saveButton"),h=n.toolbarOptions.items.findIndex(T=>T.name==="searchPanel"),E=-1;p>-1?E=p:h>-1?E=h:E=n.toolbarOptions.items.length,n.toolbarOptions.items.splice(E,0,{location:"after",widget:"dxButton",name:"refresh",options:{icon:"refresh",height:k.isLegacyRender?30:void 0,elementAttr:{class:`dx-datagrid-toolbar-button ${t.buttonsSize==="sm"?q.sm:q.md}`},stylingMode:k.isLegacyRender?"text":"contained",onClick:()=>l==null?void 0:l.refresh(),onContentReady:k.isLegacyRender?T=>{T.element.find(".dx-button-content").css({paddingTop:6,paddingBottom:6})}:void 0}}),((S=t.options)==null?void 0:S.onToolbarPreparing)&&t.options.onToolbarPreparing(n);let m=n.toolbarOptions.items.findIndex(T=>T.name==="exportButton");h=n.toolbarOptions.items.findIndex(T=>T.name==="searchPanel"),k.isLegacyRender||(t.buttonsSize==="sm"?(Q.setToolbarWidgetSmallSize(n.toolbarOptions.items[m]),Q.setToolbarWidgetSmallSize(n.toolbarOptions.items[h])):(Q.setToolbarWidgetMediumSize(n.toolbarOptions.items[m]),Q.setToolbarWidgetMediumSize(n.toolbarOptions.items[h])))},onEditorPreparing:n=>{var s;switch(k.isLegacyRender||(n.editorOptions=O(A({},n.editorOptions),{elementAttr:{class:q.md}}),n.editorName==="dxSelectBox"&&(n.editorOptions.dropDownOptions=O(A({},n.editorOptions.dropDownOptions),{onShowing:l=>{let g=br(o);l.component._$popupContent.addClass(`isoz-${g}-selectbox-popup`)}})),n.editorName==="dxCheckBox"&&Q.setElementSmallSize(n.editorElement)),n.parentType){case"filterRow":let l=p=>{n.element&&n.element.find(".dx-apply-button").trigger("dxclick")};n.editorOptions.onEnterKey=l,n.editorOptions.onFocusOut=l;break;case"searchPanel":let g=p=>{n.component.searchByText(p.component.option("value"))};n.editorOptions.onValueChanged=()=>{},n.editorOptions.onEnterKey=g,n.editorOptions.onFocusOut=g;break}((s=t.options)==null?void 0:s.onEditorPreparing)&&t.options.onEditorPreparing(n)},onContextMenuPreparing:n=>{var s,l,g;if(!k.isLegacyRender&&n.target==="content"&&!!t.exportFileName&&(n.items||(n.items=[]),n.items.push({text:"Export all data",onItemClick:()=>{n.component.exportToExcel(!1)},icon:"xlsxfile"}),((s=t.options.selection)==null?void 0:s.mode)!=="none")){let p=n.component.getSelectedRowKeys();n.items.push({text:"Export selected rows",onItemClick:()=>n.component.exportToExcel(!0),icon:"exportselected",disabled:!p||!p.length})}((l=t.options)==null?void 0:l.onContextMenuPreparing)&&((g=t.options)==null||g.onContextMenuPreparing(n))},onExporting:n=>{let s=t.options;(s==null?void 0:s.onExporting)?s.onExporting(n):t.exportFileName&&_t(t.exportFileName)(n)}}}function wr(o){!o.toolbar||!o.toolbar.items||!!o.toolbar.items.find(t=>t==="applyFilterButton"||t.name==="applyFilterButton")||o.toolbar.items.push({name:"applyFilterButton",visible:!1})}function V(o,t,r){let i=Er(t),n=$.extend(!0,{},i,t.options),s=Ot("dxDataGrid",$.extend(!0,{},t,{options:n}));wr(n),n=$.extend(!0,{},n,s);let l=t.isFullScreen||t.isFullScreen===void 0?vr(o,n,t.inPanelGrid):Eo(o,n);return t.asyncSummaryLoad&&It(l,t.asyncSummaryLoad,r),l}function Dr(o,t,r={},i,n){return V($(`#${o}`),{options:t,exportFileName:r.exportFileName,inPanelGrid:r.inPanelGrid,showSummaryInColumn:r.showSummaryInColumn,summaryColumn:r.summaryColumn,headerDescription:n,title:i})}function _r(o,t={}){let r=Tr(t),i=$.extend({},r,t.options),n=Ot("dxTreeList",$.extend(!0,{},t,{options:i}));return i=$.extend(!0,{},i,n),Sr(o,i,t.inPanelGrid)}var ke=class extends z{constructor(t={}){super();this.ON_UPLOADED="ON_UPLOADED";this.ON_DELETED="ON_DELETED";this.ON_REORDERED="ON_REORDERED";this.settings=t}initMarkup(){return $(`
|
|
14
|
+
`)};goog.string.normalizeWhitespace=function(o){return o.replace(/\xa0|\s/g," ")};goog.string.normalizeSpaces=function(o){return o.replace(/\xa0|[ \t]+/g," ")};goog.string.collapseBreakingSpaces=function(o){return o.replace(/[\t\r\n ]+/g," ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g,"")};goog.string.trim=goog.string.internal.trim;goog.string.trimLeft=function(o){return o.replace(/^[\s\xa0]+/,"")};goog.string.trimRight=function(o){return o.replace(/[\s\xa0]+$/,"")};goog.string.caseInsensitiveCompare=goog.string.internal.caseInsensitiveCompare;goog.string.numberAwareCompare_=function(o,t,r){if(o==t)return 0;if(!o)return-1;if(!t)return 1;for(var i=o.toLowerCase().match(r),n=t.toLowerCase().match(r),s=Math.min(i.length,n.length),l=0;l<s;l++){r=i[l];var g=n[l];if(r!=g)return o=parseInt(r,10),!isNaN(o)&&(t=parseInt(g,10),!isNaN(t)&&o-t)?o-t:r<g?-1:1}return i.length!=n.length?i.length-n.length:o<t?-1:1};goog.string.intAwareCompare=function(o,t){return goog.string.numberAwareCompare_(o,t,/\d+|\D+/g)};goog.string.floatAwareCompare=function(o,t){return goog.string.numberAwareCompare_(o,t,/\d+|\.\d+|\D+/g)};goog.string.numerateCompare=goog.string.floatAwareCompare;goog.string.urlEncode=function(o){return encodeURIComponent(String(o))};goog.string.urlDecode=function(o){return decodeURIComponent(o.replace(/\+/g," "))};goog.string.newLineToBr=goog.string.internal.newLineToBr;goog.string.htmlEscape=function(o,t){return o=goog.string.internal.htmlEscape(o,t),goog.string.DETECT_DOUBLE_ESCAPING&&(o=o.replace(goog.string.E_RE_,"e")),o};goog.string.E_RE_=/e/g;goog.string.unescapeEntities=function(o){return goog.string.contains(o,"&")?!goog.string.FORCE_NON_DOM_HTML_UNESCAPING&&"document"in goog.global?goog.string.unescapeEntitiesUsingDom_(o):goog.string.unescapePureXmlEntities_(o):o};goog.string.unescapeEntitiesWithDocument=function(o,t){return goog.string.contains(o,"&")?goog.string.unescapeEntitiesUsingDom_(o,t):o};goog.string.unescapeEntitiesUsingDom_=function(o,t){var r={"&":"&","<":"<",">":">",""":'"'},i=t?t.createElement("div"):goog.global.document.createElement("div");return o.replace(goog.string.HTML_ENTITY_PATTERN_,function(n,s){var l=r[n];return l||(s.charAt(0)=="#"&&(s=Number("0"+s.substr(1)),isNaN(s)||(l=String.fromCharCode(s))),l||(goog.dom.safe.setInnerHtml(i,goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract(goog.string.Const.from("Single HTML entity."),n+" ")),l=i.firstChild.nodeValue.slice(0,-1)),r[n]=l)})};goog.string.unescapePureXmlEntities_=function(o){return o.replace(/&([^;]+);/g,function(t,r){switch(r){case"amp":return"&";case"lt":return"<";case"gt":return">";case"quot":return'"';default:return r.charAt(0)!="#"||(r=Number("0"+r.substr(1)),isNaN(r))?t:String.fromCharCode(r)}})};goog.string.HTML_ENTITY_PATTERN_=/&([^;\s<&]+);?/g;goog.string.whitespaceEscape=function(o,t){return goog.string.newLineToBr(o.replace(/ /g,"  "),t)};goog.string.preserveSpaces=function(o){return o.replace(/(^|[\n ]) /g,"$1"+goog.string.Unicode.NBSP)};goog.string.stripQuotes=function(o,t){for(var r=t.length,i=0;i<r;i++){var n=r==1?t:t.charAt(i);if(o.charAt(0)==n&&o.charAt(o.length-1)==n)return o.substring(1,o.length-1)}return o};goog.string.truncate=function(o,t,r){return r&&(o=goog.string.unescapeEntities(o)),o.length>t&&(o=o.substring(0,t-3)+"..."),r&&(o=goog.string.htmlEscape(o)),o};goog.string.truncateMiddle=function(o,t,r,i){if(r&&(o=goog.string.unescapeEntities(o)),i&&o.length>t){i>t&&(i=t);var n=o.length-i;o=o.substring(0,t-i)+"..."+o.substring(n)}else o.length>t&&(i=Math.floor(t/2),n=o.length-i,o=o.substring(0,i+t%2)+"..."+o.substring(n));return r&&(o=goog.string.htmlEscape(o)),o};goog.string.specialEscapeChars_={"\0":"\\0","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\x0B",'"':'\\"',"\\":"\\\\","<":"\\u003C"};goog.string.jsEscapeCache_={"'":"\\'"};goog.string.quote=function(o){o=String(o);for(var t=['"'],r=0;r<o.length;r++){var i=o.charAt(r),n=i.charCodeAt(0);t[r+1]=goog.string.specialEscapeChars_[i]||(31<n&&127>n?i:goog.string.escapeChar(i))}return t.push('"'),t.join("")};goog.string.escapeString=function(o){for(var t=[],r=0;r<o.length;r++)t[r]=goog.string.escapeChar(o.charAt(r));return t.join("")};goog.string.escapeChar=function(o){if(o in goog.string.jsEscapeCache_)return goog.string.jsEscapeCache_[o];if(o in goog.string.specialEscapeChars_)return goog.string.jsEscapeCache_[o]=goog.string.specialEscapeChars_[o];var t=o.charCodeAt(0);if(31<t&&127>t)var r=o;else 256>t?(r="\\x",(16>t||256<t)&&(r+="0")):(r="\\u",4096>t&&(r+="0")),r+=t.toString(16).toUpperCase();return goog.string.jsEscapeCache_[o]=r};goog.string.contains=goog.string.internal.contains;goog.string.caseInsensitiveContains=goog.string.internal.caseInsensitiveContains;goog.string.countOf=function(o,t){return o&&t?o.split(t).length-1:0};goog.string.removeAt=function(o,t,r){var i=o;return 0<=t&&t<o.length&&0<r&&(i=o.substr(0,t)+o.substr(t+r,o.length-t-r)),i};goog.string.remove=function(o,t){return o.replace(t,"")};goog.string.removeAll=function(o,t){return t=new RegExp(goog.string.regExpEscape(t),"g"),o.replace(t,"")};goog.string.replaceAll=function(o,t,r){return t=new RegExp(goog.string.regExpEscape(t),"g"),o.replace(t,r.replace(/\$/g,"$$$$"))};goog.string.regExpEscape=function(o){return String(o).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")};goog.string.repeat=String.prototype.repeat?function(o,t){return o.repeat(t)}:function(o,t){return Array(t+1).join(o)};goog.string.padNumber=function(o,t,r){return o=goog.isDef(r)?o.toFixed(r):String(o),r=o.indexOf("."),r==-1&&(r=o.length),goog.string.repeat("0",Math.max(0,t-r))+o};goog.string.makeSafe=function(o){return o==null?"":String(o)};goog.string.buildString=function(o){return Array.prototype.join.call(arguments,"")};goog.string.getRandomString=function(){return Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^goog.now()).toString(36)};goog.string.compareVersions=goog.string.internal.compareVersions;goog.string.hashCode=function(o){for(var t=0,r=0;r<o.length;++r)t=31*t+o.charCodeAt(r)>>>0;return t};goog.string.uniqueStringCounter_=2147483648*Math.random()|0;goog.string.createUniqueString=function(){return"goog_"+goog.string.uniqueStringCounter_++};goog.string.toNumber=function(o){var t=Number(o);return t==0&&goog.string.isEmptyOrWhitespace(o)?NaN:t};goog.string.isLowerCamelCase=function(o){return/^[a-z]+([A-Z][a-z]*)*$/.test(o)};goog.string.isUpperCamelCase=function(o){return/^([A-Z][a-z]*)+$/.test(o)};goog.string.toCamelCase=function(o){return String(o).replace(/\-([a-z])/g,function(t,r){return r.toUpperCase()})};goog.string.toSelectorCase=function(o){return String(o).replace(/([A-Z])/g,"-$1").toLowerCase()};goog.string.toTitleCase=function(o,t){return t=goog.isString(t)?goog.string.regExpEscape(t):"\\s",o.replace(new RegExp("(^"+(t?"|["+t+"]+":"")+")([a-z])","g"),function(r,i,n){return i+n.toUpperCase()})};goog.string.capitalize=function(o){return String(o.charAt(0)).toUpperCase()+String(o.substr(1)).toLowerCase()};goog.string.parseInt=function(o){return isFinite(o)&&(o=String(o)),goog.isString(o)?/^\s*-?0x/i.test(o)?parseInt(o,16):parseInt(o,10):NaN};goog.string.splitLimit=function(o,t,r){o=o.split(t);for(var i=[];0<r&&o.length;)i.push(o.shift()),r--;return o.length&&i.push(o.join(t)),i};goog.string.lastComponent=function(o,t){if(t)typeof t=="string"&&(t=[t]);else return o;for(var r=-1,i=0;i<t.length;i++)if(t[i]!=""){var n=o.lastIndexOf(t[i]);n>r&&(r=n)}return r==-1?o:o.slice(r+1)};goog.string.editDistance=function(o,t){var r=[],i=[];if(o==t)return 0;if(!o.length||!t.length)return Math.max(o.length,t.length);for(var n=0;n<t.length+1;n++)r[n]=n;for(n=0;n<o.length;n++){i[0]=n+1;for(var s=0;s<t.length;s++)i[s+1]=Math.min(i[s]+1,r[s+1]+1,r[s]+Number(o[n]!=t[s]));for(s=0;s<r.length;s++)r[s]=i[s]}return i[t.length]};goog.labs.userAgent.platform={};goog.labs.userAgent.platform.isAndroid=function(){return goog.labs.userAgent.util.matchUserAgent("Android")};goog.labs.userAgent.platform.isIpod=function(){return goog.labs.userAgent.util.matchUserAgent("iPod")};goog.labs.userAgent.platform.isIphone=function(){return goog.labs.userAgent.util.matchUserAgent("iPhone")&&!goog.labs.userAgent.util.matchUserAgent("iPod")&&!goog.labs.userAgent.util.matchUserAgent("iPad")};goog.labs.userAgent.platform.isIpad=function(){return goog.labs.userAgent.util.matchUserAgent("iPad")};goog.labs.userAgent.platform.isIos=function(){return goog.labs.userAgent.platform.isIphone()||goog.labs.userAgent.platform.isIpad()||goog.labs.userAgent.platform.isIpod()};goog.labs.userAgent.platform.isMacintosh=function(){return goog.labs.userAgent.util.matchUserAgent("Macintosh")};goog.labs.userAgent.platform.isLinux=function(){return goog.labs.userAgent.util.matchUserAgent("Linux")};goog.labs.userAgent.platform.isWindows=function(){return goog.labs.userAgent.util.matchUserAgent("Windows")};goog.labs.userAgent.platform.isChromeOS=function(){return goog.labs.userAgent.util.matchUserAgent("CrOS")};goog.labs.userAgent.platform.isChromecast=function(){return goog.labs.userAgent.util.matchUserAgent("CrKey")};goog.labs.userAgent.platform.isKaiOS=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("KaiOS")};goog.labs.userAgent.platform.isGo2Phone=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("GAFP")};goog.labs.userAgent.platform.getVersion=function(){var o=goog.labs.userAgent.util.getUserAgent(),t="";return goog.labs.userAgent.platform.isWindows()?(t=/Windows (?:NT|Phone) ([0-9.]+)/,t=(o=t.exec(o))?o[1]:"0.0"):goog.labs.userAgent.platform.isIos()?(t=/(?:iPhone|iPod|iPad|CPU)\s+OS\s+(\S+)/,t=(o=t.exec(o))&&o[1].replace(/_/g,".")):goog.labs.userAgent.platform.isMacintosh()?(t=/Mac OS X ([0-9_.]+)/,t=(o=t.exec(o))?o[1].replace(/_/g,"."):"10"):goog.labs.userAgent.platform.isKaiOS()?(t=/(?:KaiOS)\/(\S+)/i,t=(o=t.exec(o))&&o[1]):goog.labs.userAgent.platform.isAndroid()?(t=/Android\s+([^\);]+)(\)|;)/,t=(o=t.exec(o))&&o[1]):goog.labs.userAgent.platform.isChromeOS()&&(t=/(?:CrOS\s+(?:i686|x86_64)\s+([0-9.]+))/,t=(o=t.exec(o))&&o[1]),t||""};goog.labs.userAgent.platform.isVersionOrHigher=function(o){return 0<=goog.string.compareVersions(goog.labs.userAgent.platform.getVersion(),o)};goog.reflect={};goog.reflect.object=function(o,t){return t};goog.reflect.objectProperty=function(o,t){return o};goog.reflect.sinkValue=function(o){return goog.reflect.sinkValue[" "](o),o};goog.reflect.sinkValue[" "]=goog.nullFunction;goog.reflect.canAccessProperty=function(o,t){try{return goog.reflect.sinkValue(o[t]),!0}catch{}return!1};goog.reflect.cache=function(o,t,r,i){return i=i?i(t):t,Object.prototype.hasOwnProperty.call(o,i)?o[i]:o[i]=r(t)};goog.labs.userAgent.engine={};goog.labs.userAgent.engine.isPresto=function(){return goog.labs.userAgent.util.matchUserAgent("Presto")};goog.labs.userAgent.engine.isTrident=function(){return goog.labs.userAgent.util.matchUserAgent("Trident")||goog.labs.userAgent.util.matchUserAgent("MSIE")};goog.labs.userAgent.engine.isEdge=function(){return goog.labs.userAgent.util.matchUserAgent("Edge")};goog.labs.userAgent.engine.isWebKit=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("WebKit")&&!goog.labs.userAgent.engine.isEdge()};goog.labs.userAgent.engine.isGecko=function(){return goog.labs.userAgent.util.matchUserAgent("Gecko")&&!goog.labs.userAgent.engine.isWebKit()&&!goog.labs.userAgent.engine.isTrident()&&!goog.labs.userAgent.engine.isEdge()};goog.labs.userAgent.engine.getVersion=function(){var o=goog.labs.userAgent.util.getUserAgent();if(o){o=goog.labs.userAgent.util.extractVersionTuples(o);var t=goog.labs.userAgent.engine.getEngineTuple_(o);if(t)return t[0]=="Gecko"?goog.labs.userAgent.engine.getVersionForKey_(o,"Firefox"):t[1];o=o[0];var r;if(o&&(r=o[2])&&(r=/Trident\/([^\s;]+)/.exec(r)))return r[1]}return""};goog.labs.userAgent.engine.getEngineTuple_=function(o){if(!goog.labs.userAgent.engine.isEdge())return o[1];for(var t=0;t<o.length;t++){var r=o[t];if(r[0]=="Edge")return r}};goog.labs.userAgent.engine.isVersionOrHigher=function(o){return 0<=goog.string.compareVersions(goog.labs.userAgent.engine.getVersion(),o)};goog.labs.userAgent.engine.getVersionForKey_=function(o,t){return(o=goog.array.find(o,function(r){return t==r[0]}))&&o[1]||""};goog.userAgent={};goog.userAgent.ASSUME_IE=!1;goog.userAgent.ASSUME_EDGE=!1;goog.userAgent.ASSUME_GECKO=!1;goog.userAgent.ASSUME_WEBKIT=!1;goog.userAgent.ASSUME_MOBILE_WEBKIT=!1;goog.userAgent.ASSUME_OPERA=!1;goog.userAgent.ASSUME_ANY_VERSION=!1;goog.userAgent.BROWSER_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_EDGE||goog.userAgent.ASSUME_GECKO||goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_OPERA;goog.userAgent.getUserAgentString=function(){return goog.labs.userAgent.util.getUserAgent()};goog.userAgent.getNavigatorTyped=function(){return goog.global.navigator||null};goog.userAgent.getNavigator=function(){return goog.userAgent.getNavigatorTyped()};goog.userAgent.OPERA=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_OPERA:goog.labs.userAgent.browser.isOpera();goog.userAgent.IE=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_IE:goog.labs.userAgent.browser.isIE();goog.userAgent.EDGE=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_EDGE:goog.labs.userAgent.engine.isEdge();goog.userAgent.EDGE_OR_IE=goog.userAgent.EDGE||goog.userAgent.IE;goog.userAgent.GECKO=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_GECKO:goog.labs.userAgent.engine.isGecko();goog.userAgent.WEBKIT=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_MOBILE_WEBKIT:goog.labs.userAgent.engine.isWebKit();goog.userAgent.isMobile_=function(){return goog.userAgent.WEBKIT&&goog.labs.userAgent.util.matchUserAgent("Mobile")};goog.userAgent.MOBILE=goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.isMobile_();goog.userAgent.SAFARI=goog.userAgent.WEBKIT;goog.userAgent.determinePlatform_=function(){var o=goog.userAgent.getNavigatorTyped();return o&&o.platform||""};goog.userAgent.PLATFORM=goog.userAgent.determinePlatform_();goog.userAgent.ASSUME_MAC=!1;goog.userAgent.ASSUME_WINDOWS=!1;goog.userAgent.ASSUME_LINUX=!1;goog.userAgent.ASSUME_X11=!1;goog.userAgent.ASSUME_ANDROID=!1;goog.userAgent.ASSUME_IPHONE=!1;goog.userAgent.ASSUME_IPAD=!1;goog.userAgent.ASSUME_IPOD=!1;goog.userAgent.ASSUME_KAIOS=!1;goog.userAgent.ASSUME_GO2PHONE=!1;goog.userAgent.PLATFORM_KNOWN_=goog.userAgent.ASSUME_MAC||goog.userAgent.ASSUME_WINDOWS||goog.userAgent.ASSUME_LINUX||goog.userAgent.ASSUME_X11||goog.userAgent.ASSUME_ANDROID||goog.userAgent.ASSUME_IPHONE||goog.userAgent.ASSUME_IPAD||goog.userAgent.ASSUME_IPOD;goog.userAgent.MAC=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_MAC:goog.labs.userAgent.platform.isMacintosh();goog.userAgent.WINDOWS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_WINDOWS:goog.labs.userAgent.platform.isWindows();goog.userAgent.isLegacyLinux_=function(){return goog.labs.userAgent.platform.isLinux()||goog.labs.userAgent.platform.isChromeOS()};goog.userAgent.LINUX=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_LINUX:goog.userAgent.isLegacyLinux_();goog.userAgent.isX11_=function(){var o=goog.userAgent.getNavigatorTyped();return!!o&&goog.string.contains(o.appVersion||"","X11")};goog.userAgent.X11=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_X11:goog.userAgent.isX11_();goog.userAgent.ANDROID=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_ANDROID:goog.labs.userAgent.platform.isAndroid();goog.userAgent.IPHONE=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE:goog.labs.userAgent.platform.isIphone();goog.userAgent.IPAD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPAD:goog.labs.userAgent.platform.isIpad();goog.userAgent.IPOD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPOD:goog.labs.userAgent.platform.isIpod();goog.userAgent.IOS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE||goog.userAgent.ASSUME_IPAD||goog.userAgent.ASSUME_IPOD:goog.labs.userAgent.platform.isIos();goog.userAgent.KAIOS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_KAIOS:goog.labs.userAgent.platform.isKaiOS();goog.userAgent.GO2PHONE=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_GO2PHONE:goog.labs.userAgent.platform.isGo2Phone();goog.userAgent.determineVersion_=function(){var o="",t=goog.userAgent.getVersionRegexResult_();return t&&(o=t?t[1]:""),goog.userAgent.IE&&(t=goog.userAgent.getDocumentMode_(),t!=null&&t>parseFloat(o))?String(t):o};goog.userAgent.getVersionRegexResult_=function(){var o=goog.userAgent.getUserAgentString();if(goog.userAgent.GECKO)return/rv:([^\);]+)(\)|;)/.exec(o);if(goog.userAgent.EDGE)return/Edge\/([\d\.]+)/.exec(o);if(goog.userAgent.IE)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(o);if(goog.userAgent.WEBKIT)return/WebKit\/(\S+)/.exec(o);if(goog.userAgent.OPERA)return/(?:Version)[ \/]?(\S+)/.exec(o)};goog.userAgent.getDocumentMode_=function(){var o=goog.global.document;return o?o.documentMode:void 0};goog.userAgent.VERSION=goog.userAgent.determineVersion_();goog.userAgent.compare=function(o,t){return goog.string.compareVersions(o,t)};goog.userAgent.isVersionOrHigherCache_={};goog.userAgent.isVersionOrHigher=function(o){return goog.userAgent.ASSUME_ANY_VERSION||goog.reflect.cache(goog.userAgent.isVersionOrHigherCache_,o,function(){return 0<=goog.string.compareVersions(goog.userAgent.VERSION,o)})};goog.userAgent.isVersion=goog.userAgent.isVersionOrHigher;goog.userAgent.isDocumentModeOrHigher=function(o){return Number(goog.userAgent.DOCUMENT_MODE)>=o};goog.userAgent.isDocumentMode=goog.userAgent.isDocumentModeOrHigher;goog.userAgent.DOCUMENT_MODE=function(){if(goog.global.document&&goog.userAgent.IE)return goog.userAgent.getDocumentMode_()}();goog.userAgent.product={};goog.userAgent.product.ASSUME_FIREFOX=!1;goog.userAgent.product.ASSUME_IPHONE=!1;goog.userAgent.product.ASSUME_IPAD=!1;goog.userAgent.product.ASSUME_ANDROID=!1;goog.userAgent.product.ASSUME_CHROME=!1;goog.userAgent.product.ASSUME_SAFARI=!1;goog.userAgent.product.PRODUCT_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_EDGE||goog.userAgent.ASSUME_OPERA||goog.userAgent.product.ASSUME_FIREFOX||goog.userAgent.product.ASSUME_IPHONE||goog.userAgent.product.ASSUME_IPAD||goog.userAgent.product.ASSUME_ANDROID||goog.userAgent.product.ASSUME_CHROME||goog.userAgent.product.ASSUME_SAFARI;goog.userAgent.product.OPERA=goog.userAgent.OPERA;goog.userAgent.product.IE=goog.userAgent.IE;goog.userAgent.product.EDGE=goog.userAgent.EDGE;goog.userAgent.product.FIREFOX=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_FIREFOX:goog.labs.userAgent.browser.isFirefox();goog.userAgent.product.isIphoneOrIpod_=function(){return goog.labs.userAgent.platform.isIphone()||goog.labs.userAgent.platform.isIpod()};goog.userAgent.product.IPHONE=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPHONE:goog.userAgent.product.isIphoneOrIpod_();goog.userAgent.product.IPAD=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPAD:goog.labs.userAgent.platform.isIpad();goog.userAgent.product.ANDROID=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_ANDROID:goog.labs.userAgent.browser.isAndroidBrowser();goog.userAgent.product.CHROME=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_CHROME:goog.labs.userAgent.browser.isChrome();goog.userAgent.product.isSafariDesktop_=function(){return goog.labs.userAgent.browser.isSafari()&&!goog.labs.userAgent.platform.isIos()};goog.userAgent.product.SAFARI=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_SAFARI:goog.userAgent.product.isSafariDesktop_();goog.crypt.base64={};goog.crypt.base64.DEFAULT_ALPHABET_COMMON_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";goog.crypt.base64.ENCODED_VALS=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_+"+/=";goog.crypt.base64.ENCODED_VALS_WEBSAFE=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_+"-_.";goog.crypt.base64.Alphabet={DEFAULT:0,NO_PADDING:1,WEBSAFE:2,WEBSAFE_DOT_PADDING:3,WEBSAFE_NO_PADDING:4};goog.crypt.base64.paddingChars_="=.";goog.crypt.base64.isPadding_=function(o){return goog.string.contains(goog.crypt.base64.paddingChars_,o)};goog.crypt.base64.byteToCharMaps_={};goog.crypt.base64.charToByteMap_=null;goog.crypt.base64.ASSUME_NATIVE_SUPPORT_=goog.userAgent.GECKO||goog.userAgent.WEBKIT&&!goog.userAgent.product.SAFARI||goog.userAgent.OPERA;goog.crypt.base64.HAS_NATIVE_ENCODE_=goog.crypt.base64.ASSUME_NATIVE_SUPPORT_||typeof goog.global.btoa=="function";goog.crypt.base64.HAS_NATIVE_DECODE_=goog.crypt.base64.ASSUME_NATIVE_SUPPORT_||!goog.userAgent.product.SAFARI&&!goog.userAgent.IE&&typeof goog.global.atob=="function";goog.crypt.base64.encodeByteArray=function(o,t){goog.asserts.assert(goog.isArrayLike(o),"encodeByteArray takes an array as a parameter"),t===void 0&&(t=goog.crypt.base64.Alphabet.DEFAULT),goog.crypt.base64.init_(),t=goog.crypt.base64.byteToCharMaps_[t];for(var r=[],i=0;i<o.length;i+=3){var n=o[i],s=i+1<o.length,l=s?o[i+1]:0,g=i+2<o.length,p=g?o[i+2]:0,h=n>>2;n=(n&3)<<4|l>>4,l=(l&15)<<2|p>>6,p&=63,g||(p=64,s||(l=64)),r.push(t[h],t[n],t[l]||"",t[p]||"")}return r.join("")};goog.crypt.base64.encodeString=function(o,t){return goog.crypt.base64.HAS_NATIVE_ENCODE_&&!t?goog.global.btoa(o):goog.crypt.base64.encodeByteArray(goog.crypt.stringToByteArray(o),t)};goog.crypt.base64.decodeString=function(o,t){if(goog.crypt.base64.HAS_NATIVE_DECODE_&&!t)return goog.global.atob(o);var r="";return goog.crypt.base64.decodeStringInternal_(o,function(i){r+=String.fromCharCode(i)}),r};goog.crypt.base64.decodeStringToByteArray=function(o,t){var r=[];return goog.crypt.base64.decodeStringInternal_(o,function(i){r.push(i)}),r};goog.crypt.base64.decodeStringToUint8Array=function(o){goog.asserts.assert(!goog.userAgent.IE||goog.userAgent.isVersionOrHigher("10"),"Browser does not support typed arrays");var t=o.length,r=3*t/4;r%3?r=Math.floor(r):goog.crypt.base64.isPadding_(o[t-1])&&(r=goog.crypt.base64.isPadding_(o[t-2])?r-2:r-1);var i=new Uint8Array(r),n=0;return goog.crypt.base64.decodeStringInternal_(o,function(s){i[n++]=s}),i.subarray(0,n)};goog.crypt.base64.decodeStringInternal_=function(o,t){function r(p){for(;i<o.length;){var h=o.charAt(i++),S=goog.crypt.base64.charToByteMap_[h];if(S!=null)return S;if(!goog.string.isEmptyOrWhitespace(h))throw Error("Unknown base64 encoding at char: "+h)}return p}goog.crypt.base64.init_();for(var i=0;;){var n=r(-1),s=r(0),l=r(64),g=r(64);if(g===64&&n===-1)break;t(n<<2|s>>4),l!=64&&(t(s<<4&240|l>>2),g!=64&&t(l<<6&192|g))}};goog.crypt.base64.init_=function(){if(!goog.crypt.base64.charToByteMap_){goog.crypt.base64.charToByteMap_={};for(var o=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_.split(""),t=["+/=","+/","-_=","-_.","-_"],r=0;5>r;r++){var i=o.concat(t[r].split(""));goog.crypt.base64.byteToCharMaps_[r]=i;for(var n=0;n<i.length;n++){var s=i[n],l=goog.crypt.base64.charToByteMap_[s];l===void 0?goog.crypt.base64.charToByteMap_[s]=n:goog.asserts.assert(l===n)}}}};jspb.utils={};jspb.utils.split64Low=0;jspb.utils.split64High=0;jspb.utils.splitUint64=function(o){var t=o>>>0;o=Math.floor((o-t)/jspb.BinaryConstants.TWO_TO_32)>>>0,jspb.utils.split64Low=t,jspb.utils.split64High=o};jspb.utils.splitInt64=function(o){var t=0>o;o=Math.abs(o);var r=o>>>0;o=Math.floor((o-r)/jspb.BinaryConstants.TWO_TO_32),o>>>=0,t&&(o=~o>>>0,r=(~r>>>0)+1,4294967295<r&&(r=0,o++,4294967295<o&&(o=0))),jspb.utils.split64Low=r,jspb.utils.split64High=o};jspb.utils.splitZigzag64=function(o){var t=0>o;o=2*Math.abs(o),jspb.utils.splitUint64(o),o=jspb.utils.split64Low;var r=jspb.utils.split64High;t&&(o==0?r==0?r=o=4294967295:(r--,o=4294967295):o--),jspb.utils.split64Low=o,jspb.utils.split64High=r};jspb.utils.splitFloat32=function(o){var t=0>o?1:0;if(o=t?-o:o,o===0)0<1/o?(jspb.utils.split64High=0,jspb.utils.split64Low=0):(jspb.utils.split64High=0,jspb.utils.split64Low=2147483648);else if(isNaN(o))jspb.utils.split64High=0,jspb.utils.split64Low=2147483647;else if(o>jspb.BinaryConstants.FLOAT32_MAX)jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|2139095040)>>>0;else if(o<jspb.BinaryConstants.FLOAT32_MIN)o=Math.round(o/Math.pow(2,-149)),jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|o)>>>0;else{var r=Math.floor(Math.log(o)/Math.LN2);o*=Math.pow(2,-r),o=Math.round(o*jspb.BinaryConstants.TWO_TO_23)&8388607,jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|r+127<<23|o)>>>0}};jspb.utils.splitFloat64=function(o){var t=0>o?1:0;if(o=t?-o:o,o===0)jspb.utils.split64High=0<1/o?0:2147483648,jspb.utils.split64Low=0;else if(isNaN(o))jspb.utils.split64High=2147483647,jspb.utils.split64Low=4294967295;else if(o>jspb.BinaryConstants.FLOAT64_MAX)jspb.utils.split64High=(t<<31|2146435072)>>>0,jspb.utils.split64Low=0;else if(o<jspb.BinaryConstants.FLOAT64_MIN){var r=o/Math.pow(2,-1074);o=r/jspb.BinaryConstants.TWO_TO_32,jspb.utils.split64High=(t<<31|o)>>>0,jspb.utils.split64Low=r>>>0}else{r=o;var i=0;if(2<=r)for(;2<=r&&1023>i;)i++,r/=2;else for(;1>r&&-1022<i;)r*=2,i--;r=o*Math.pow(2,-i),o=r*jspb.BinaryConstants.TWO_TO_20&1048575,r=r*jspb.BinaryConstants.TWO_TO_52>>>0,jspb.utils.split64High=(t<<31|i+1023<<20|o)>>>0,jspb.utils.split64Low=r}};jspb.utils.splitHash64=function(o){var t=o.charCodeAt(0),r=o.charCodeAt(1),i=o.charCodeAt(2),n=o.charCodeAt(3),s=o.charCodeAt(4),l=o.charCodeAt(5),g=o.charCodeAt(6);o=o.charCodeAt(7),jspb.utils.split64Low=t+(r<<8)+(i<<16)+(n<<24)>>>0,jspb.utils.split64High=s+(l<<8)+(g<<16)+(o<<24)>>>0};jspb.utils.joinUint64=function(o,t){return t*jspb.BinaryConstants.TWO_TO_32+(o>>>0)};jspb.utils.joinInt64=function(o,t){var r=t&2147483648;return r&&(o=~o+1>>>0,t=~t>>>0,o==0&&(t=t+1>>>0)),o=jspb.utils.joinUint64(o,t),r?-o:o};jspb.utils.toZigzag64=function(o,t,r){var i=t>>31;return r(o<<1^i,(t<<1|o>>>31)^i)};jspb.utils.joinZigzag64=function(o,t){return jspb.utils.fromZigzag64(o,t,jspb.utils.joinInt64)};jspb.utils.fromZigzag64=function(o,t,r){var i=-(o&1);return r((o>>>1|t<<31)^i,t>>>1^i)};jspb.utils.joinFloat32=function(o,t){t=2*(o>>31)+1;var r=o>>>23&255;return o&=8388607,r==255?o?NaN:1/0*t:r==0?t*Math.pow(2,-149)*o:t*Math.pow(2,r-150)*(o+Math.pow(2,23))};jspb.utils.joinFloat64=function(o,t){var r=2*(t>>31)+1,i=t>>>20&2047;return o=jspb.BinaryConstants.TWO_TO_32*(t&1048575)+o,i==2047?o?NaN:1/0*r:i==0?r*Math.pow(2,-1074)*o:r*Math.pow(2,i-1075)*(o+jspb.BinaryConstants.TWO_TO_52)};jspb.utils.joinHash64=function(o,t){return String.fromCharCode(o>>>0&255,o>>>8&255,o>>>16&255,o>>>24&255,t>>>0&255,t>>>8&255,t>>>16&255,t>>>24&255)};jspb.utils.DIGITS="0123456789abcdef".split("");jspb.utils.ZERO_CHAR_CODE_=48;jspb.utils.A_CHAR_CODE_=97;jspb.utils.joinUnsignedDecimalString=function(o,t){function r(n,s){return n=n?String(n):"",s?"0000000".slice(n.length)+n:n}if(2097151>=t)return""+(jspb.BinaryConstants.TWO_TO_32*t+o);var i=(o>>>24|t<<8)>>>0&16777215;return t=t>>16&65535,o=(o&16777215)+6777216*i+6710656*t,i+=8147497*t,t*=2,1e7<=o&&(i+=Math.floor(o/1e7),o%=1e7),1e7<=i&&(t+=Math.floor(i/1e7),i%=1e7),r(t,0)+r(i,t)+r(o,1)};jspb.utils.joinSignedDecimalString=function(o,t){var r=t&2147483648;return r&&(o=~o+1>>>0,t=~t+(o==0?1:0)>>>0),o=jspb.utils.joinUnsignedDecimalString(o,t),r?"-"+o:o};jspb.utils.hash64ToDecimalString=function(o,t){jspb.utils.splitHash64(o),o=jspb.utils.split64Low;var r=jspb.utils.split64High;return t?jspb.utils.joinSignedDecimalString(o,r):jspb.utils.joinUnsignedDecimalString(o,r)};jspb.utils.hash64ArrayToDecimalStrings=function(o,t){for(var r=Array(o.length),i=0;i<o.length;i++)r[i]=jspb.utils.hash64ToDecimalString(o[i],t);return r};jspb.utils.decimalStringToHash64=function(o){function t(l,g){for(var p=0;8>p&&(l!==1||0<g);p++)g=l*n[p]+g,n[p]=g&255,g>>>=8}function r(){for(var l=0;8>l;l++)n[l]=~n[l]&255}goog.asserts.assert(0<o.length);var i=!1;o[0]==="-"&&(i=!0,o=o.slice(1));for(var n=[0,0,0,0,0,0,0,0],s=0;s<o.length;s++)t(10,o.charCodeAt(s)-jspb.utils.ZERO_CHAR_CODE_);return i&&(r(),t(1,1)),goog.crypt.byteArrayToString(n)};jspb.utils.splitDecimalString=function(o){jspb.utils.splitHash64(jspb.utils.decimalStringToHash64(o))};jspb.utils.toHexDigit_=function(o){return String.fromCharCode(10>o?jspb.utils.ZERO_CHAR_CODE_+o:jspb.utils.A_CHAR_CODE_-10+o)};jspb.utils.fromHexCharCode_=function(o){return o>=jspb.utils.A_CHAR_CODE_?o-jspb.utils.A_CHAR_CODE_+10:o-jspb.utils.ZERO_CHAR_CODE_};jspb.utils.hash64ToHexString=function(o){var t=Array(18);t[0]="0",t[1]="x";for(var r=0;8>r;r++){var i=o.charCodeAt(7-r);t[2*r+2]=jspb.utils.toHexDigit_(i>>4),t[2*r+3]=jspb.utils.toHexDigit_(i&15)}return t.join("")};jspb.utils.hexStringToHash64=function(o){o=o.toLowerCase(),goog.asserts.assert(o.length==18),goog.asserts.assert(o[0]=="0"),goog.asserts.assert(o[1]=="x");for(var t="",r=0;8>r;r++){var i=jspb.utils.fromHexCharCode_(o.charCodeAt(2*r+2)),n=jspb.utils.fromHexCharCode_(o.charCodeAt(2*r+3));t=String.fromCharCode(16*i+n)+t}return t};jspb.utils.hash64ToNumber=function(o,t){jspb.utils.splitHash64(o),o=jspb.utils.split64Low;var r=jspb.utils.split64High;return t?jspb.utils.joinInt64(o,r):jspb.utils.joinUint64(o,r)};jspb.utils.numberToHash64=function(o){return jspb.utils.splitInt64(o),jspb.utils.joinHash64(jspb.utils.split64Low,jspb.utils.split64High)};jspb.utils.countVarints=function(o,t,r){for(var i=0,n=t;n<r;n++)i+=o[n]>>7;return r-t-i};jspb.utils.countVarintFields=function(o,t,r,i){var n=0;if(i=8*i+jspb.BinaryConstants.WireType.VARINT,128>i)for(;t<r&&o[t++]==i;)for(n++;;){var s=o[t++];if((s&128)==0)break}else for(;t<r;){for(s=i;128<s;){if(o[t]!=(s&127|128))return n;t++,s>>=7}if(o[t++]!=s)break;for(n++;s=o[t++],(s&128)!=0;);}return n};jspb.utils.countFixedFields_=function(o,t,r,i,n){var s=0;if(128>i)for(;t<r&&o[t++]==i;)s++,t+=n;else for(;t<r;){for(var l=i;128<l;){if(o[t++]!=(l&127|128))return s;l>>=7}if(o[t++]!=l)break;s++,t+=n}return s};jspb.utils.countFixed32Fields=function(o,t,r,i){return jspb.utils.countFixedFields_(o,t,r,8*i+jspb.BinaryConstants.WireType.FIXED32,4)};jspb.utils.countFixed64Fields=function(o,t,r,i){return jspb.utils.countFixedFields_(o,t,r,8*i+jspb.BinaryConstants.WireType.FIXED64,8)};jspb.utils.countDelimitedFields=function(o,t,r,i){var n=0;for(i=8*i+jspb.BinaryConstants.WireType.DELIMITED;t<r;){for(var s=i;128<s;){if(o[t++]!=(s&127|128))return n;s>>=7}if(o[t++]!=s)break;n++;for(var l=0,g=1;s=o[t++],l+=(s&127)*g,g*=128,(s&128)!=0;);t+=l}return n};jspb.utils.debugBytesToTextFormat=function(o){var t='"';if(o){o=jspb.utils.byteSourceToUint8Array(o);for(var r=0;r<o.length;r++)t+="\\x",16>o[r]&&(t+="0"),t+=o[r].toString(16)}return t+'"'};jspb.utils.debugScalarToTextFormat=function(o){return typeof o=="string"?goog.string.quote(o):o.toString()};jspb.utils.stringToByteArray=function(o){for(var t=new Uint8Array(o.length),r=0;r<o.length;r++){var i=o.charCodeAt(r);if(255<i)throw Error("Conversion error: string contains codepoint outside of byte range");t[r]=i}return t};jspb.utils.byteSourceToUint8Array=function(o){return o.constructor===Uint8Array?o:o.constructor===ArrayBuffer||typeof Buffer<"u"&&o.constructor===Buffer||o.constructor===Array?new Uint8Array(o):o.constructor===String?goog.crypt.base64.decodeStringToUint8Array(o):(goog.asserts.fail("Type not convertible to Uint8Array."),new Uint8Array(0))};jspb.BinaryDecoder=function(o,t,r){this.bytes_=null,this.cursor_=this.end_=this.start_=0,this.error_=!1,o&&this.setBlock(o,t,r)};jspb.BinaryDecoder.instanceCache_=[];jspb.BinaryDecoder.alloc=function(o,t,r){if(jspb.BinaryDecoder.instanceCache_.length){var i=jspb.BinaryDecoder.instanceCache_.pop();return o&&i.setBlock(o,t,r),i}return new jspb.BinaryDecoder(o,t,r)};jspb.BinaryDecoder.prototype.free=function(){this.clear(),100>jspb.BinaryDecoder.instanceCache_.length&&jspb.BinaryDecoder.instanceCache_.push(this)};jspb.BinaryDecoder.prototype.clone=function(){return jspb.BinaryDecoder.alloc(this.bytes_,this.start_,this.end_-this.start_)};jspb.BinaryDecoder.prototype.clear=function(){this.bytes_=null,this.cursor_=this.end_=this.start_=0,this.error_=!1};jspb.BinaryDecoder.prototype.getBuffer=function(){return this.bytes_};jspb.BinaryDecoder.prototype.setBlock=function(o,t,r){this.bytes_=jspb.utils.byteSourceToUint8Array(o),this.start_=t!==void 0?t:0,this.end_=r!==void 0?this.start_+r:this.bytes_.length,this.cursor_=this.start_};jspb.BinaryDecoder.prototype.getEnd=function(){return this.end_};jspb.BinaryDecoder.prototype.setEnd=function(o){this.end_=o};jspb.BinaryDecoder.prototype.reset=function(){this.cursor_=this.start_};jspb.BinaryDecoder.prototype.getCursor=function(){return this.cursor_};jspb.BinaryDecoder.prototype.setCursor=function(o){this.cursor_=o};jspb.BinaryDecoder.prototype.advance=function(o){this.cursor_+=o,goog.asserts.assert(this.cursor_<=this.end_)};jspb.BinaryDecoder.prototype.atEnd=function(){return this.cursor_==this.end_};jspb.BinaryDecoder.prototype.pastEnd=function(){return this.cursor_>this.end_};jspb.BinaryDecoder.prototype.getError=function(){return this.error_||0>this.cursor_||this.cursor_>this.end_};jspb.BinaryDecoder.prototype.readSplitVarint64=function(o){for(var t=128,r=0,i=0,n=0;4>n&&128<=t;n++)t=this.bytes_[this.cursor_++],r|=(t&127)<<7*n;if(128<=t&&(t=this.bytes_[this.cursor_++],r|=(t&127)<<28,i|=(t&127)>>4),128<=t)for(n=0;5>n&&128<=t;n++)t=this.bytes_[this.cursor_++],i|=(t&127)<<7*n+3;if(128>t)return o(r>>>0,i>>>0);goog.asserts.fail("Failed to read varint, encoding is invalid."),this.error_=!0};jspb.BinaryDecoder.prototype.readSplitZigzagVarint64=function(o){return this.readSplitVarint64(function(t,r){return jspb.utils.fromZigzag64(t,r,o)})};jspb.BinaryDecoder.prototype.readSplitFixed64=function(o){var t=this.bytes_,r=this.cursor_;this.cursor_+=8;for(var i=0,n=0,s=r+7;s>=r;s--)i=i<<8|t[s],n=n<<8|t[s+4];return o(i,n)};jspb.BinaryDecoder.prototype.skipVarint=function(){for(;this.bytes_[this.cursor_]&128;)this.cursor_++;this.cursor_++};jspb.BinaryDecoder.prototype.unskipVarint=function(o){for(;128<o;)this.cursor_--,o>>>=7;this.cursor_--};jspb.BinaryDecoder.prototype.readUnsignedVarint32=function(){var o=this.bytes_,t=o[this.cursor_+0],r=t&127;return 128>t?(this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),r):(t=o[this.cursor_+1],r|=(t&127)<<7,128>t?(this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),r):(t=o[this.cursor_+2],r|=(t&127)<<14,128>t?(this.cursor_+=3,goog.asserts.assert(this.cursor_<=this.end_),r):(t=o[this.cursor_+3],r|=(t&127)<<21,128>t?(this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),r):(t=o[this.cursor_+4],r|=(t&15)<<28,128>t?(this.cursor_+=5,goog.asserts.assert(this.cursor_<=this.end_),r>>>0):(this.cursor_+=5,128<=o[this.cursor_++]&&128<=o[this.cursor_++]&&128<=o[this.cursor_++]&&128<=o[this.cursor_++]&&128<=o[this.cursor_++]&&goog.asserts.assert(!1),goog.asserts.assert(this.cursor_<=this.end_),r)))))};jspb.BinaryDecoder.prototype.readSignedVarint32=jspb.BinaryDecoder.prototype.readUnsignedVarint32;jspb.BinaryDecoder.prototype.readUnsignedVarint32String=function(){return this.readUnsignedVarint32().toString()};jspb.BinaryDecoder.prototype.readSignedVarint32String=function(){return this.readSignedVarint32().toString()};jspb.BinaryDecoder.prototype.readZigzagVarint32=function(){var o=this.readUnsignedVarint32();return o>>>1^-(o&1)};jspb.BinaryDecoder.prototype.readUnsignedVarint64=function(){return this.readSplitVarint64(jspb.utils.joinUint64)};jspb.BinaryDecoder.prototype.readUnsignedVarint64String=function(){return this.readSplitVarint64(jspb.utils.joinUnsignedDecimalString)};jspb.BinaryDecoder.prototype.readSignedVarint64=function(){return this.readSplitVarint64(jspb.utils.joinInt64)};jspb.BinaryDecoder.prototype.readSignedVarint64String=function(){return this.readSplitVarint64(jspb.utils.joinSignedDecimalString)};jspb.BinaryDecoder.prototype.readZigzagVarint64=function(){return this.readSplitVarint64(jspb.utils.joinZigzag64)};jspb.BinaryDecoder.prototype.readZigzagVarintHash64=function(){return this.readSplitZigzagVarint64(jspb.utils.joinHash64)};jspb.BinaryDecoder.prototype.readZigzagVarint64String=function(){return this.readSplitZigzagVarint64(jspb.utils.joinSignedDecimalString)};jspb.BinaryDecoder.prototype.readUint8=function(){var o=this.bytes_[this.cursor_+0];return this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),o};jspb.BinaryDecoder.prototype.readUint16=function(){var o=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1];return this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),o<<0|t<<8};jspb.BinaryDecoder.prototype.readUint32=function(){var o=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1],r=this.bytes_[this.cursor_+2],i=this.bytes_[this.cursor_+3];return this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),(o<<0|t<<8|r<<16|i<<24)>>>0};jspb.BinaryDecoder.prototype.readUint64=function(){var o=this.readUint32(),t=this.readUint32();return jspb.utils.joinUint64(o,t)};jspb.BinaryDecoder.prototype.readUint64String=function(){var o=this.readUint32(),t=this.readUint32();return jspb.utils.joinUnsignedDecimalString(o,t)};jspb.BinaryDecoder.prototype.readInt8=function(){var o=this.bytes_[this.cursor_+0];return this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),o<<24>>24};jspb.BinaryDecoder.prototype.readInt16=function(){var o=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1];return this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),(o<<0|t<<8)<<16>>16};jspb.BinaryDecoder.prototype.readInt32=function(){var o=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1],r=this.bytes_[this.cursor_+2],i=this.bytes_[this.cursor_+3];return this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),o<<0|t<<8|r<<16|i<<24};jspb.BinaryDecoder.prototype.readInt64=function(){var o=this.readUint32(),t=this.readUint32();return jspb.utils.joinInt64(o,t)};jspb.BinaryDecoder.prototype.readInt64String=function(){var o=this.readUint32(),t=this.readUint32();return jspb.utils.joinSignedDecimalString(o,t)};jspb.BinaryDecoder.prototype.readFloat=function(){var o=this.readUint32();return jspb.utils.joinFloat32(o,0)};jspb.BinaryDecoder.prototype.readDouble=function(){var o=this.readUint32(),t=this.readUint32();return jspb.utils.joinFloat64(o,t)};jspb.BinaryDecoder.prototype.readBool=function(){return!!this.bytes_[this.cursor_++]};jspb.BinaryDecoder.prototype.readEnum=function(){return this.readSignedVarint32()};jspb.BinaryDecoder.prototype.readString=function(o){var t=this.bytes_,r=this.cursor_;o=r+o;for(var i=[],n="";r<o;){var s=t[r++];if(128>s)i.push(s);else{if(192>s)continue;if(224>s){var l=t[r++];i.push((s&31)<<6|l&63)}else if(240>s){l=t[r++];var g=t[r++];i.push((s&15)<<12|(l&63)<<6|g&63)}else if(248>s){l=t[r++],g=t[r++];var p=t[r++];s=(s&7)<<18|(l&63)<<12|(g&63)<<6|p&63,s-=65536,i.push((s>>10&1023)+55296,(s&1023)+56320)}}8192<=i.length&&(n+=String.fromCharCode.apply(null,i),i.length=0)}return n+=goog.crypt.byteArrayToString(i),this.cursor_=r,n};jspb.BinaryDecoder.prototype.readStringWithLength=function(){var o=this.readUnsignedVarint32();return this.readString(o)};jspb.BinaryDecoder.prototype.readBytes=function(o){if(0>o||this.cursor_+o>this.bytes_.length)return this.error_=!0,goog.asserts.fail("Invalid byte length!"),new Uint8Array(0);var t=this.bytes_.subarray(this.cursor_,this.cursor_+o);return this.cursor_+=o,goog.asserts.assert(this.cursor_<=this.end_),t};jspb.BinaryDecoder.prototype.readVarintHash64=function(){return this.readSplitVarint64(jspb.utils.joinHash64)};jspb.BinaryDecoder.prototype.readFixedHash64=function(){var o=this.bytes_,t=this.cursor_,r=o[t+0],i=o[t+1],n=o[t+2],s=o[t+3],l=o[t+4],g=o[t+5],p=o[t+6];return o=o[t+7],this.cursor_+=8,String.fromCharCode(r,i,n,s,l,g,p,o)};jspb.BinaryReader=function(o,t,r){this.decoder_=jspb.BinaryDecoder.alloc(o,t,r),this.fieldCursor_=this.decoder_.getCursor(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID,this.error_=!1,this.readCallbacks_=null};jspb.BinaryReader.instanceCache_=[];jspb.BinaryReader.alloc=function(o,t,r){if(jspb.BinaryReader.instanceCache_.length){var i=jspb.BinaryReader.instanceCache_.pop();return o&&i.decoder_.setBlock(o,t,r),i}return new jspb.BinaryReader(o,t,r)};jspb.BinaryReader.prototype.alloc=jspb.BinaryReader.alloc;jspb.BinaryReader.prototype.free=function(){this.decoder_.clear(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID,this.error_=!1,this.readCallbacks_=null,100>jspb.BinaryReader.instanceCache_.length&&jspb.BinaryReader.instanceCache_.push(this)};jspb.BinaryReader.prototype.getFieldCursor=function(){return this.fieldCursor_};jspb.BinaryReader.prototype.getCursor=function(){return this.decoder_.getCursor()};jspb.BinaryReader.prototype.getBuffer=function(){return this.decoder_.getBuffer()};jspb.BinaryReader.prototype.getFieldNumber=function(){return this.nextField_};jspb.BinaryReader.prototype.getWireType=function(){return this.nextWireType_};jspb.BinaryReader.prototype.isDelimited=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED};jspb.BinaryReader.prototype.isEndGroup=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP};jspb.BinaryReader.prototype.getError=function(){return this.error_||this.decoder_.getError()};jspb.BinaryReader.prototype.setBlock=function(o,t,r){this.decoder_.setBlock(o,t,r),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID};jspb.BinaryReader.prototype.reset=function(){this.decoder_.reset(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID};jspb.BinaryReader.prototype.advance=function(o){this.decoder_.advance(o)};jspb.BinaryReader.prototype.nextField=function(){if(this.decoder_.atEnd())return!1;if(this.getError())return goog.asserts.fail("Decoder hit an error"),!1;this.fieldCursor_=this.decoder_.getCursor();var o=this.decoder_.readUnsignedVarint32(),t=o>>>3;return o&=7,o!=jspb.BinaryConstants.WireType.VARINT&&o!=jspb.BinaryConstants.WireType.FIXED32&&o!=jspb.BinaryConstants.WireType.FIXED64&&o!=jspb.BinaryConstants.WireType.DELIMITED&&o!=jspb.BinaryConstants.WireType.START_GROUP&&o!=jspb.BinaryConstants.WireType.END_GROUP?(goog.asserts.fail("Invalid wire type: %s (at position %s)",o,this.fieldCursor_),this.error_=!0,!1):(this.nextField_=t,this.nextWireType_=o,!0)};jspb.BinaryReader.prototype.unskipHeader=function(){this.decoder_.unskipVarint(this.nextField_<<3|this.nextWireType_)};jspb.BinaryReader.prototype.skipMatchingFields=function(){var o=this.nextField_;for(this.unskipHeader();this.nextField()&&this.getFieldNumber()==o;)this.skipField();this.decoder_.atEnd()||this.unskipHeader()};jspb.BinaryReader.prototype.skipVarintField=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.VARINT?(goog.asserts.fail("Invalid wire type for skipVarintField"),this.skipField()):this.decoder_.skipVarint()};jspb.BinaryReader.prototype.skipDelimitedField=function(){if(this.nextWireType_!=jspb.BinaryConstants.WireType.DELIMITED)goog.asserts.fail("Invalid wire type for skipDelimitedField"),this.skipField();else{var o=this.decoder_.readUnsignedVarint32();this.decoder_.advance(o)}};jspb.BinaryReader.prototype.skipFixed32Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED32?(goog.asserts.fail("Invalid wire type for skipFixed32Field"),this.skipField()):this.decoder_.advance(4)};jspb.BinaryReader.prototype.skipFixed64Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED64?(goog.asserts.fail("Invalid wire type for skipFixed64Field"),this.skipField()):this.decoder_.advance(8)};jspb.BinaryReader.prototype.skipGroup=function(){var o=this.nextField_;do{if(!this.nextField()){goog.asserts.fail("Unmatched start-group tag: stream EOF"),this.error_=!0;break}if(this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP){this.nextField_!=o&&(goog.asserts.fail("Unmatched end-group tag"),this.error_=!0);break}this.skipField()}while(1)};jspb.BinaryReader.prototype.skipField=function(){switch(this.nextWireType_){case jspb.BinaryConstants.WireType.VARINT:this.skipVarintField();break;case jspb.BinaryConstants.WireType.FIXED64:this.skipFixed64Field();break;case jspb.BinaryConstants.WireType.DELIMITED:this.skipDelimitedField();break;case jspb.BinaryConstants.WireType.FIXED32:this.skipFixed32Field();break;case jspb.BinaryConstants.WireType.START_GROUP:this.skipGroup();break;default:goog.asserts.fail("Invalid wire encoding for field.")}};jspb.BinaryReader.prototype.registerReadCallback=function(o,t){this.readCallbacks_===null&&(this.readCallbacks_={}),goog.asserts.assert(!this.readCallbacks_[o]),this.readCallbacks_[o]=t};jspb.BinaryReader.prototype.runReadCallback=function(o){return goog.asserts.assert(this.readCallbacks_!==null),o=this.readCallbacks_[o],goog.asserts.assert(o),o(this)};jspb.BinaryReader.prototype.readAny=function(o){this.nextWireType_=jspb.BinaryConstants.FieldTypeToWireType(o);var t=jspb.BinaryConstants.FieldType;switch(o){case t.DOUBLE:return this.readDouble();case t.FLOAT:return this.readFloat();case t.INT64:return this.readInt64();case t.UINT64:return this.readUint64();case t.INT32:return this.readInt32();case t.FIXED64:return this.readFixed64();case t.FIXED32:return this.readFixed32();case t.BOOL:return this.readBool();case t.STRING:return this.readString();case t.GROUP:goog.asserts.fail("Group field type not supported in readAny()");case t.MESSAGE:goog.asserts.fail("Message field type not supported in readAny()");case t.BYTES:return this.readBytes();case t.UINT32:return this.readUint32();case t.ENUM:return this.readEnum();case t.SFIXED32:return this.readSfixed32();case t.SFIXED64:return this.readSfixed64();case t.SINT32:return this.readSint32();case t.SINT64:return this.readSint64();case t.FHASH64:return this.readFixedHash64();case t.VHASH64:return this.readVarintHash64();default:goog.asserts.fail("Invalid field type in readAny()")}return 0};jspb.BinaryReader.prototype.readMessage=function(o,t){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var r=this.decoder_.getEnd(),i=this.decoder_.readUnsignedVarint32();i=this.decoder_.getCursor()+i,this.decoder_.setEnd(i),t(o,this),this.decoder_.setCursor(i),this.decoder_.setEnd(r)};jspb.BinaryReader.prototype.readGroup=function(o,t,r){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.START_GROUP),goog.asserts.assert(this.nextField_==o),r(t,this),this.error_||this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP||(goog.asserts.fail("Group submessage did not end with an END_GROUP tag"),this.error_=!0)};jspb.BinaryReader.prototype.getFieldDecoder=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var o=this.decoder_.readUnsignedVarint32(),t=this.decoder_.getCursor(),r=t+o;return o=jspb.BinaryDecoder.alloc(this.decoder_.getBuffer(),t,o),this.decoder_.setCursor(r),o};jspb.BinaryReader.prototype.readInt32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint32()};jspb.BinaryReader.prototype.readInt32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint32String()};jspb.BinaryReader.prototype.readInt64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64()};jspb.BinaryReader.prototype.readInt64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64String()};jspb.BinaryReader.prototype.readUint32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint32()};jspb.BinaryReader.prototype.readUint32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint32String()};jspb.BinaryReader.prototype.readUint64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint64()};jspb.BinaryReader.prototype.readUint64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint64String()};jspb.BinaryReader.prototype.readSint32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint32()};jspb.BinaryReader.prototype.readSint64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint64()};jspb.BinaryReader.prototype.readSint64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint64String()};jspb.BinaryReader.prototype.readFixed32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readUint32()};jspb.BinaryReader.prototype.readFixed64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readUint64()};jspb.BinaryReader.prototype.readFixed64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readUint64String()};jspb.BinaryReader.prototype.readSfixed32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readInt32()};jspb.BinaryReader.prototype.readSfixed32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readInt32().toString()};jspb.BinaryReader.prototype.readSfixed64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readInt64()};jspb.BinaryReader.prototype.readSfixed64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readInt64String()};jspb.BinaryReader.prototype.readFloat=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readFloat()};jspb.BinaryReader.prototype.readDouble=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readDouble()};jspb.BinaryReader.prototype.readBool=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),!!this.decoder_.readUnsignedVarint32()};jspb.BinaryReader.prototype.readEnum=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64()};jspb.BinaryReader.prototype.readString=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var o=this.decoder_.readUnsignedVarint32();return this.decoder_.readString(o)};jspb.BinaryReader.prototype.readBytes=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var o=this.decoder_.readUnsignedVarint32();return this.decoder_.readBytes(o)};jspb.BinaryReader.prototype.readVarintHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readVarintHash64()};jspb.BinaryReader.prototype.readSintHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarintHash64()};jspb.BinaryReader.prototype.readSplitVarint64=function(o){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSplitVarint64(o)};jspb.BinaryReader.prototype.readSplitZigzagVarint64=function(o){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSplitVarint64(function(t,r){return jspb.utils.fromZigzag64(t,r,o)})};jspb.BinaryReader.prototype.readFixedHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readFixedHash64()};jspb.BinaryReader.prototype.readSplitFixed64=function(o){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readSplitFixed64(o)};jspb.BinaryReader.prototype.readPackedField_=function(o){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var t=this.decoder_.readUnsignedVarint32();t=this.decoder_.getCursor()+t;for(var r=[];this.decoder_.getCursor()<t;)r.push(o.call(this.decoder_));return r};jspb.BinaryReader.prototype.readPackedInt32=function(){return this.readPackedField_(this.decoder_.readSignedVarint32)};jspb.BinaryReader.prototype.readPackedInt32String=function(){return this.readPackedField_(this.decoder_.readSignedVarint32String)};jspb.BinaryReader.prototype.readPackedInt64=function(){return this.readPackedField_(this.decoder_.readSignedVarint64)};jspb.BinaryReader.prototype.readPackedInt64String=function(){return this.readPackedField_(this.decoder_.readSignedVarint64String)};jspb.BinaryReader.prototype.readPackedUint32=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint32)};jspb.BinaryReader.prototype.readPackedUint32String=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint32String)};jspb.BinaryReader.prototype.readPackedUint64=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint64)};jspb.BinaryReader.prototype.readPackedUint64String=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint64String)};jspb.BinaryReader.prototype.readPackedSint32=function(){return this.readPackedField_(this.decoder_.readZigzagVarint32)};jspb.BinaryReader.prototype.readPackedSint64=function(){return this.readPackedField_(this.decoder_.readZigzagVarint64)};jspb.BinaryReader.prototype.readPackedSint64String=function(){return this.readPackedField_(this.decoder_.readZigzagVarint64String)};jspb.BinaryReader.prototype.readPackedFixed32=function(){return this.readPackedField_(this.decoder_.readUint32)};jspb.BinaryReader.prototype.readPackedFixed64=function(){return this.readPackedField_(this.decoder_.readUint64)};jspb.BinaryReader.prototype.readPackedFixed64String=function(){return this.readPackedField_(this.decoder_.readUint64String)};jspb.BinaryReader.prototype.readPackedSfixed32=function(){return this.readPackedField_(this.decoder_.readInt32)};jspb.BinaryReader.prototype.readPackedSfixed64=function(){return this.readPackedField_(this.decoder_.readInt64)};jspb.BinaryReader.prototype.readPackedSfixed64String=function(){return this.readPackedField_(this.decoder_.readInt64String)};jspb.BinaryReader.prototype.readPackedFloat=function(){return this.readPackedField_(this.decoder_.readFloat)};jspb.BinaryReader.prototype.readPackedDouble=function(){return this.readPackedField_(this.decoder_.readDouble)};jspb.BinaryReader.prototype.readPackedBool=function(){return this.readPackedField_(this.decoder_.readBool)};jspb.BinaryReader.prototype.readPackedEnum=function(){return this.readPackedField_(this.decoder_.readEnum)};jspb.BinaryReader.prototype.readPackedVarintHash64=function(){return this.readPackedField_(this.decoder_.readVarintHash64)};jspb.BinaryReader.prototype.readPackedFixedHash64=function(){return this.readPackedField_(this.decoder_.readFixedHash64)};jspb.Map=function(o,t){this.arr_=o,this.valueCtor_=t,this.map_={},this.arrClean=!0,0<this.arr_.length&&this.loadFromArray_()};jspb.Map.prototype.loadFromArray_=function(){for(var o=0;o<this.arr_.length;o++){var t=this.arr_[o],r=t[0];this.map_[r.toString()]=new jspb.Map.Entry_(r,t[1])}this.arrClean=!0};jspb.Map.prototype.toArray=function(){if(this.arrClean){if(this.valueCtor_){var o=this.map_,t;for(t in o)if(Object.prototype.hasOwnProperty.call(o,t)){var r=o[t].valueWrapper;r&&r.toArray()}}}else{for(this.arr_.length=0,o=this.stringKeys_(),o.sort(),t=0;t<o.length;t++){var i=this.map_[o[t]];(r=i.valueWrapper)&&r.toArray(),this.arr_.push([i.key,i.value])}this.arrClean=!0}return this.arr_};jspb.Map.prototype.toObject=function(o,t){for(var r=this.toArray(),i=[],n=0;n<r.length;n++){var s=this.map_[r[n][0].toString()];this.wrapEntry_(s);var l=s.valueWrapper;l?(goog.asserts.assert(t),i.push([s.key,t(o,l)])):i.push([s.key,s.value])}return i};jspb.Map.fromObject=function(o,t,r){t=new jspb.Map([],t);for(var i=0;i<o.length;i++){var n=o[i][0],s=r(o[i][1]);t.set(n,s)}return t};jspb.Map.ArrayIteratorIterable_=function(o){this.idx_=0,this.arr_=o};jspb.Map.ArrayIteratorIterable_.prototype.next=function(){return this.idx_<this.arr_.length?{done:!1,value:this.arr_[this.idx_++]}:{done:!0,value:void 0}};typeof Symbol<"u"&&(jspb.Map.ArrayIteratorIterable_.prototype[Symbol.iterator]=function(){return this});jspb.Map.prototype.getLength=function(){return this.stringKeys_().length};jspb.Map.prototype.clear=function(){this.map_={},this.arrClean=!1};jspb.Map.prototype.del=function(o){o=o.toString();var t=this.map_.hasOwnProperty(o);return delete this.map_[o],this.arrClean=!1,t};jspb.Map.prototype.getEntryList=function(){var o=[],t=this.stringKeys_();t.sort();for(var r=0;r<t.length;r++){var i=this.map_[t[r]];o.push([i.key,i.value])}return o};jspb.Map.prototype.entries=function(){var o=[],t=this.stringKeys_();t.sort();for(var r=0;r<t.length;r++){var i=this.map_[t[r]];o.push([i.key,this.wrapEntry_(i)])}return new jspb.Map.ArrayIteratorIterable_(o)};jspb.Map.prototype.keys=function(){var o=[],t=this.stringKeys_();t.sort();for(var r=0;r<t.length;r++)o.push(this.map_[t[r]].key);return new jspb.Map.ArrayIteratorIterable_(o)};jspb.Map.prototype.values=function(){var o=[],t=this.stringKeys_();t.sort();for(var r=0;r<t.length;r++)o.push(this.wrapEntry_(this.map_[t[r]]));return new jspb.Map.ArrayIteratorIterable_(o)};jspb.Map.prototype.forEach=function(o,t){var r=this.stringKeys_();r.sort();for(var i=0;i<r.length;i++){var n=this.map_[r[i]];o.call(t,this.wrapEntry_(n),n.key,this)}};jspb.Map.prototype.set=function(o,t){var r=new jspb.Map.Entry_(o);return this.valueCtor_?(r.valueWrapper=t,r.value=t.toArray()):r.value=t,this.map_[o.toString()]=r,this.arrClean=!1,this};jspb.Map.prototype.wrapEntry_=function(o){return this.valueCtor_?(o.valueWrapper||(o.valueWrapper=new this.valueCtor_(o.value)),o.valueWrapper):o.value};jspb.Map.prototype.get=function(o){if(o=this.map_[o.toString()])return this.wrapEntry_(o)};jspb.Map.prototype.has=function(o){return o.toString()in this.map_};jspb.Map.prototype.serializeBinary=function(o,t,r,i,n){var s=this.stringKeys_();s.sort();for(var l=0;l<s.length;l++){var g=this.map_[s[l]];t.beginSubMessage(o),r.call(t,1,g.key),this.valueCtor_?i.call(t,2,this.wrapEntry_(g),n):i.call(t,2,g.value),t.endSubMessage()}};jspb.Map.deserializeBinary=function(o,t,r,i,n,s,l){for(;t.nextField()&&!t.isEndGroup();){var g=t.getFieldNumber();g==1?s=r.call(t):g==2&&(o.valueCtor_?(goog.asserts.assert(n),l||(l=new o.valueCtor_),i.call(t,l,n)):l=i.call(t))}goog.asserts.assert(s!=null),goog.asserts.assert(l!=null),o.set(s,l)};jspb.Map.prototype.stringKeys_=function(){var o=this.map_,t=[],r;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&t.push(r);return t};jspb.Map.Entry_=function(o,t){this.key=o,this.value=t,this.valueWrapper=void 0};jspb.ExtensionFieldInfo=function(o,t,r,i,n){this.fieldIndex=o,this.fieldName=t,this.ctor=r,this.toObjectFn=i,this.isRepeated=n};jspb.ExtensionFieldBinaryInfo=function(o,t,r,i,n,s){this.fieldInfo=o,this.binaryReaderFn=t,this.binaryWriterFn=r,this.binaryMessageSerializeFn=i,this.binaryMessageDeserializeFn=n,this.isPacked=s};jspb.ExtensionFieldInfo.prototype.isMessageType=function(){return!!this.ctor};jspb.Message=function(){};jspb.Message.GENERATE_TO_OBJECT=!0;jspb.Message.GENERATE_FROM_OBJECT=!goog.DISALLOW_TEST_ONLY_CODE;jspb.Message.GENERATE_TO_STRING=!0;jspb.Message.ASSUME_LOCAL_ARRAYS=!1;jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS=!0;jspb.Message.SUPPORTS_UINT8ARRAY_=typeof Uint8Array=="function";jspb.Message.prototype.getJsPbMessageId=function(){return this.messageId_};jspb.Message.getIndex_=function(o,t){return t+o.arrayIndexOffset_};jspb.Message.hiddenES6Property_=function(){};jspb.Message.getFieldNumber_=function(o,t){return t-o.arrayIndexOffset_};jspb.Message.initialize=function(o,t,r,i,n,s){if(o.wrappers_=null,t||(t=r?[r]:[]),o.messageId_=r?String(r):void 0,o.arrayIndexOffset_=r===0?-1:0,o.array=t,jspb.Message.initPivotAndExtensionObject_(o,i),o.convertedPrimitiveFields_={},jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS||(o.repeatedFields=n),n)for(t=0;t<n.length;t++)r=n[t],r<o.pivot_?(r=jspb.Message.getIndex_(o,r),o.array[r]=o.array[r]||jspb.Message.EMPTY_LIST_SENTINEL_):(jspb.Message.maybeInitEmptyExtensionObject_(o),o.extensionObject_[r]=o.extensionObject_[r]||jspb.Message.EMPTY_LIST_SENTINEL_);if(s&&s.length)for(t=0;t<s.length;t++)jspb.Message.computeOneofCase(o,s[t])};jspb.Message.EMPTY_LIST_SENTINEL_=goog.DEBUG&&Object.freeze?Object.freeze([]):[];jspb.Message.isArray_=function(o){return jspb.Message.ASSUME_LOCAL_ARRAYS?o instanceof Array:Array.isArray(o)};jspb.Message.isExtensionObject_=function(o){return o!==null&&typeof o=="object"&&!jspb.Message.isArray_(o)&&!(jspb.Message.SUPPORTS_UINT8ARRAY_&&o instanceof Uint8Array)};jspb.Message.initPivotAndExtensionObject_=function(o,t){var r=o.array.length,i=-1;if(r&&(i=r-1,r=o.array[i],jspb.Message.isExtensionObject_(r))){o.pivot_=jspb.Message.getFieldNumber_(o,i),o.extensionObject_=r;return}-1<t?(o.pivot_=Math.max(t,jspb.Message.getFieldNumber_(o,i+1)),o.extensionObject_=null):o.pivot_=Number.MAX_VALUE};jspb.Message.maybeInitEmptyExtensionObject_=function(o){var t=jspb.Message.getIndex_(o,o.pivot_);o.array[t]||(o.extensionObject_=o.array[t]={})};jspb.Message.toObjectList=function(o,t,r){for(var i=[],n=0;n<o.length;n++)i[n]=t.call(o[n],r,o[n]);return i};jspb.Message.toObjectExtension=function(o,t,r,i,n){for(var s in r){var l=r[s],g=i.call(o,l);if(g!=null){for(var p in l.fieldName)if(l.fieldName.hasOwnProperty(p))break;t[p]=l.toObjectFn?l.isRepeated?jspb.Message.toObjectList(g,l.toObjectFn,n):l.toObjectFn(n,g):g}}};jspb.Message.serializeBinaryExtensions=function(o,t,r,i){for(var n in r){var s=r[n],l=s.fieldInfo;if(!s.binaryWriterFn)throw Error("Message extension present that was generated without binary serialization support");var g=i.call(o,l);if(g!=null)if(l.isMessageType())if(s.binaryMessageSerializeFn)s.binaryWriterFn.call(t,l.fieldIndex,g,s.binaryMessageSerializeFn);else throw Error("Message extension present holding submessage without binary support enabled, and message is being serialized to binary format");else s.binaryWriterFn.call(t,l.fieldIndex,g)}};jspb.Message.readBinaryExtension=function(o,t,r,i,n){var s=r[t.getFieldNumber()];if(s){if(r=s.fieldInfo,!s.binaryReaderFn)throw Error("Deserializing extension whose generated code does not support binary format");if(r.isMessageType()){var l=new r.ctor;s.binaryReaderFn.call(t,l,s.binaryMessageDeserializeFn)}else l=s.binaryReaderFn.call(t);r.isRepeated&&!s.isPacked?(t=i.call(o,r))?t.push(l):n.call(o,r,[l]):n.call(o,r,l)}else t.skipField()};jspb.Message.getField=function(o,t){if(t<o.pivot_){t=jspb.Message.getIndex_(o,t);var r=o.array[t];return r===jspb.Message.EMPTY_LIST_SENTINEL_?o.array[t]=[]:r}if(o.extensionObject_)return r=o.extensionObject_[t],r===jspb.Message.EMPTY_LIST_SENTINEL_?o.extensionObject_[t]=[]:r};jspb.Message.getRepeatedField=function(o,t){return jspb.Message.getField(o,t)};jspb.Message.getOptionalFloatingPointField=function(o,t){return o=jspb.Message.getField(o,t),o==null?o:+o};jspb.Message.getBooleanField=function(o,t){return o=jspb.Message.getField(o,t),o==null?o:!!o};jspb.Message.getRepeatedFloatingPointField=function(o,t){var r=jspb.Message.getRepeatedField(o,t);if(o.convertedPrimitiveFields_||(o.convertedPrimitiveFields_={}),!o.convertedPrimitiveFields_[t]){for(var i=0;i<r.length;i++)r[i]=+r[i];o.convertedPrimitiveFields_[t]=!0}return r};jspb.Message.getRepeatedBooleanField=function(o,t){var r=jspb.Message.getRepeatedField(o,t);if(o.convertedPrimitiveFields_||(o.convertedPrimitiveFields_={}),!o.convertedPrimitiveFields_[t]){for(var i=0;i<r.length;i++)r[i]=!!r[i];o.convertedPrimitiveFields_[t]=!0}return r};jspb.Message.bytesAsB64=function(o){return o==null||typeof o=="string"?o:jspb.Message.SUPPORTS_UINT8ARRAY_&&o instanceof Uint8Array?goog.crypt.base64.encodeByteArray(o):(goog.asserts.fail("Cannot coerce to b64 string: "+goog.typeOf(o)),null)};jspb.Message.bytesAsU8=function(o){return o==null||o instanceof Uint8Array?o:typeof o=="string"?goog.crypt.base64.decodeStringToUint8Array(o):(goog.asserts.fail("Cannot coerce to Uint8Array: "+goog.typeOf(o)),null)};jspb.Message.bytesListAsB64=function(o){return jspb.Message.assertConsistentTypes_(o),o.length&&typeof o[0]!="string"?goog.array.map(o,jspb.Message.bytesAsB64):o};jspb.Message.bytesListAsU8=function(o){return jspb.Message.assertConsistentTypes_(o),!o.length||o[0]instanceof Uint8Array?o:goog.array.map(o,jspb.Message.bytesAsU8)};jspb.Message.assertConsistentTypes_=function(o){if(goog.DEBUG&&o&&1<o.length){var t=goog.typeOf(o[0]);goog.array.forEach(o,function(r){goog.typeOf(r)!=t&&goog.asserts.fail("Inconsistent type in JSPB repeated field array. Got "+goog.typeOf(r)+" expected "+t)})}};jspb.Message.getFieldWithDefault=function(o,t,r){return o=jspb.Message.getField(o,t),o??r};jspb.Message.getBooleanFieldWithDefault=function(o,t,r){return o=jspb.Message.getBooleanField(o,t),o??r};jspb.Message.getFloatingPointFieldWithDefault=function(o,t,r){return o=jspb.Message.getOptionalFloatingPointField(o,t),o??r};jspb.Message.getFieldProto3=jspb.Message.getFieldWithDefault;jspb.Message.getMapField=function(o,t,r,i){if(o.wrappers_||(o.wrappers_={}),t in o.wrappers_)return o.wrappers_[t];var n=jspb.Message.getField(o,t);if(!n){if(r)return;n=[],jspb.Message.setField(o,t,n)}return o.wrappers_[t]=new jspb.Map(n,i)};jspb.Message.setField=function(o,t,r){return goog.asserts.assertInstanceof(o,jspb.Message),t<o.pivot_?o.array[jspb.Message.getIndex_(o,t)]=r:(jspb.Message.maybeInitEmptyExtensionObject_(o),o.extensionObject_[t]=r),o};jspb.Message.setProto3IntField=function(o,t,r){return jspb.Message.setFieldIgnoringDefault_(o,t,r,0)};jspb.Message.setProto3FloatField=function(o,t,r){return jspb.Message.setFieldIgnoringDefault_(o,t,r,0)};jspb.Message.setProto3BooleanField=function(o,t,r){return jspb.Message.setFieldIgnoringDefault_(o,t,r,!1)};jspb.Message.setProto3StringField=function(o,t,r){return jspb.Message.setFieldIgnoringDefault_(o,t,r,"")};jspb.Message.setProto3BytesField=function(o,t,r){return jspb.Message.setFieldIgnoringDefault_(o,t,r,"")};jspb.Message.setProto3EnumField=function(o,t,r){return jspb.Message.setFieldIgnoringDefault_(o,t,r,0)};jspb.Message.setProto3StringIntField=function(o,t,r){return jspb.Message.setFieldIgnoringDefault_(o,t,r,"0")};jspb.Message.setFieldIgnoringDefault_=function(o,t,r,i){return goog.asserts.assertInstanceof(o,jspb.Message),r!==i?jspb.Message.setField(o,t,r):t<o.pivot_?o.array[jspb.Message.getIndex_(o,t)]=null:(jspb.Message.maybeInitEmptyExtensionObject_(o),delete o.extensionObject_[t]),o};jspb.Message.addToRepeatedField=function(o,t,r,i){return goog.asserts.assertInstanceof(o,jspb.Message),t=jspb.Message.getRepeatedField(o,t),i!=null?t.splice(i,0,r):t.push(r),o};jspb.Message.setOneofField=function(o,t,r,i){return goog.asserts.assertInstanceof(o,jspb.Message),(r=jspb.Message.computeOneofCase(o,r))&&r!==t&&i!==void 0&&(o.wrappers_&&r in o.wrappers_&&(o.wrappers_[r]=void 0),jspb.Message.setField(o,r,void 0)),jspb.Message.setField(o,t,i)};jspb.Message.computeOneofCase=function(o,t){for(var r,i,n=0;n<t.length;n++){var s=t[n],l=jspb.Message.getField(o,s);l!=null&&(r=s,i=l,jspb.Message.setField(o,s,void 0))}return r?(jspb.Message.setField(o,r,i),r):0};jspb.Message.getWrapperField=function(o,t,r,i){if(o.wrappers_||(o.wrappers_={}),!o.wrappers_[r]){var n=jspb.Message.getField(o,r);(i||n)&&(o.wrappers_[r]=new t(n))}return o.wrappers_[r]};jspb.Message.getRepeatedWrapperField=function(o,t,r){return jspb.Message.wrapRepeatedField_(o,t,r),t=o.wrappers_[r],t==jspb.Message.EMPTY_LIST_SENTINEL_&&(t=o.wrappers_[r]=[]),t};jspb.Message.wrapRepeatedField_=function(o,t,r){if(o.wrappers_||(o.wrappers_={}),!o.wrappers_[r]){for(var i=jspb.Message.getRepeatedField(o,r),n=[],s=0;s<i.length;s++)n[s]=new t(i[s]);o.wrappers_[r]=n}};jspb.Message.setWrapperField=function(o,t,r){goog.asserts.assertInstanceof(o,jspb.Message),o.wrappers_||(o.wrappers_={});var i=r&&r.toArray();return o.wrappers_[t]=r,jspb.Message.setField(o,t,i)};jspb.Message.setOneofWrapperField=function(o,t,r,i){goog.asserts.assertInstanceof(o,jspb.Message),o.wrappers_||(o.wrappers_={});var n=i&&i.toArray();return o.wrappers_[t]=i,jspb.Message.setOneofField(o,t,r,n)};jspb.Message.setRepeatedWrapperField=function(o,t,r){goog.asserts.assertInstanceof(o,jspb.Message),o.wrappers_||(o.wrappers_={}),r=r||[];for(var i=[],n=0;n<r.length;n++)i[n]=r[n].toArray();return o.wrappers_[t]=r,jspb.Message.setField(o,t,i)};jspb.Message.addToRepeatedWrapperField=function(o,t,r,i,n){jspb.Message.wrapRepeatedField_(o,i,t);var s=o.wrappers_[t];return s||(s=o.wrappers_[t]=[]),r=r||new i,o=jspb.Message.getRepeatedField(o,t),n!=null?(s.splice(n,0,r),o.splice(n,0,r.toArray())):(s.push(r),o.push(r.toArray())),r};jspb.Message.toMap=function(o,t,r,i){for(var n={},s=0;s<o.length;s++)n[t.call(o[s])]=r?r.call(o[s],i,o[s]):o[s];return n};jspb.Message.prototype.syncMapFields_=function(){if(this.wrappers_)for(var o in this.wrappers_){var t=this.wrappers_[o];if(Array.isArray(t))for(var r=0;r<t.length;r++)t[r]&&t[r].toArray();else t&&t.toArray()}};jspb.Message.prototype.toArray=function(){return this.syncMapFields_(),this.array};jspb.Message.GENERATE_TO_STRING&&(jspb.Message.prototype.toString=function(){return this.syncMapFields_(),this.array.toString()});jspb.Message.prototype.getExtension=function(o){if(this.extensionObject_){this.wrappers_||(this.wrappers_={});var t=o.fieldIndex;if(o.isRepeated){if(o.isMessageType())return this.wrappers_[t]||(this.wrappers_[t]=goog.array.map(this.extensionObject_[t]||[],function(r){return new o.ctor(r)})),this.wrappers_[t]}else if(o.isMessageType())return!this.wrappers_[t]&&this.extensionObject_[t]&&(this.wrappers_[t]=new o.ctor(this.extensionObject_[t])),this.wrappers_[t];return this.extensionObject_[t]}};jspb.Message.prototype.setExtension=function(o,t){this.wrappers_||(this.wrappers_={}),jspb.Message.maybeInitEmptyExtensionObject_(this);var r=o.fieldIndex;return o.isRepeated?(t=t||[],o.isMessageType()?(this.wrappers_[r]=t,this.extensionObject_[r]=goog.array.map(t,function(i){return i.toArray()})):this.extensionObject_[r]=t):o.isMessageType()?(this.wrappers_[r]=t,this.extensionObject_[r]=t&&t.toArray()):this.extensionObject_[r]=t,this};jspb.Message.difference=function(o,t){if(!(o instanceof t.constructor))throw Error("Messages have different types.");var r=o.toArray();t=t.toArray();var i=[],n=0,s=r.length>t.length?r.length:t.length;for(o.getJsPbMessageId()&&(i[0]=o.getJsPbMessageId(),n=1);n<s;n++)jspb.Message.compareFields(r[n],t[n])||(i[n]=t[n]);return new o.constructor(i)};jspb.Message.equals=function(o,t){return o==t||!(!o||!t)&&o instanceof t.constructor&&jspb.Message.compareFields(o.toArray(),t.toArray())};jspb.Message.compareExtensions=function(o,t){o=o||{},t=t||{};var r={},i;for(i in o)r[i]=0;for(i in t)r[i]=0;for(i in r)if(!jspb.Message.compareFields(o[i],t[i]))return!1;return!0};jspb.Message.compareFields=function(o,t){if(o==t)return!0;if(!goog.isObject(o)||!goog.isObject(t))return typeof o=="number"&&isNaN(o)||typeof t=="number"&&isNaN(t)?String(o)==String(t):!1;if(o.constructor!=t.constructor)return!1;if(jspb.Message.SUPPORTS_UINT8ARRAY_&&o.constructor===Uint8Array){if(o.length!=t.length)return!1;for(var r=0;r<o.length;r++)if(o[r]!=t[r])return!1;return!0}if(o.constructor===Array){var i=void 0,n=void 0,s=Math.max(o.length,t.length);for(r=0;r<s;r++){var l=o[r],g=t[r];if(l&&l.constructor==Object&&(goog.asserts.assert(i===void 0),goog.asserts.assert(r===o.length-1),i=l,l=void 0),g&&g.constructor==Object&&(goog.asserts.assert(n===void 0),goog.asserts.assert(r===t.length-1),n=g,g=void 0),!jspb.Message.compareFields(l,g))return!1}return i||n?(i=i||{},n=n||{},jspb.Message.compareExtensions(i,n)):!0}if(o.constructor===Object)return jspb.Message.compareExtensions(o,t);throw Error("Invalid type in JSPB array")};jspb.Message.prototype.cloneMessage=function(){return jspb.Message.cloneMessage(this)};jspb.Message.prototype.clone=function(){return jspb.Message.cloneMessage(this)};jspb.Message.clone=function(o){return jspb.Message.cloneMessage(o)};jspb.Message.cloneMessage=function(o){return new o.constructor(jspb.Message.clone_(o.toArray()))};jspb.Message.copyInto=function(o,t){goog.asserts.assertInstanceof(o,jspb.Message),goog.asserts.assertInstanceof(t,jspb.Message),goog.asserts.assert(o.constructor==t.constructor,"Copy source and target message should have the same type."),o=jspb.Message.clone(o);for(var r=t.toArray(),i=o.toArray(),n=r.length=0;n<i.length;n++)r[n]=i[n];t.wrappers_=o.wrappers_,t.extensionObject_=o.extensionObject_};jspb.Message.clone_=function(o){if(Array.isArray(o)){for(var t=Array(o.length),r=0;r<o.length;r++){var i=o[r];i!=null&&(t[r]=typeof i=="object"?jspb.Message.clone_(goog.asserts.assert(i)):i)}return t}if(jspb.Message.SUPPORTS_UINT8ARRAY_&&o instanceof Uint8Array)return new Uint8Array(o);t={};for(r in o)i=o[r],i!=null&&(t[r]=typeof i=="object"?jspb.Message.clone_(goog.asserts.assert(i)):i);return t};jspb.Message.registerMessageType=function(o,t){t.messageId=o};jspb.Message.messageSetExtensions={};jspb.Message.messageSetExtensionsBinary={};jspb.arith={};jspb.arith.UInt64=function(o,t){this.lo=o,this.hi=t};jspb.arith.UInt64.prototype.cmp=function(o){return this.hi<o.hi||this.hi==o.hi&&this.lo<o.lo?-1:this.hi==o.hi&&this.lo==o.lo?0:1};jspb.arith.UInt64.prototype.rightShift=function(){return new jspb.arith.UInt64((this.lo>>>1|(this.hi&1)<<31)>>>0,this.hi>>>1>>>0)};jspb.arith.UInt64.prototype.leftShift=function(){return new jspb.arith.UInt64(this.lo<<1>>>0,(this.hi<<1|this.lo>>>31)>>>0)};jspb.arith.UInt64.prototype.msb=function(){return!!(this.hi&2147483648)};jspb.arith.UInt64.prototype.lsb=function(){return!!(this.lo&1)};jspb.arith.UInt64.prototype.zero=function(){return this.lo==0&&this.hi==0};jspb.arith.UInt64.prototype.add=function(o){return new jspb.arith.UInt64((this.lo+o.lo&4294967295)>>>0>>>0,((this.hi+o.hi&4294967295)>>>0)+(4294967296<=this.lo+o.lo?1:0)>>>0)};jspb.arith.UInt64.prototype.sub=function(o){return new jspb.arith.UInt64((this.lo-o.lo&4294967295)>>>0>>>0,((this.hi-o.hi&4294967295)>>>0)-(0>this.lo-o.lo?1:0)>>>0)};jspb.arith.UInt64.mul32x32=function(o,t){var r=o&65535;o>>>=16;var i=t&65535,n=t>>>16;for(t=r*i+65536*(r*n&65535)+65536*(o*i&65535),r=o*n+(r*n>>>16)+(o*i>>>16);4294967296<=t;)t-=4294967296,r+=1;return new jspb.arith.UInt64(t>>>0,r>>>0)};jspb.arith.UInt64.prototype.mul=function(o){var t=jspb.arith.UInt64.mul32x32(this.lo,o);return o=jspb.arith.UInt64.mul32x32(this.hi,o),o.hi=o.lo,o.lo=0,t.add(o)};jspb.arith.UInt64.prototype.div=function(o){if(o==0)return[];var t=new jspb.arith.UInt64(0,0),r=new jspb.arith.UInt64(this.lo,this.hi);o=new jspb.arith.UInt64(o,0);for(var i=new jspb.arith.UInt64(1,0);!o.msb();)o=o.leftShift(),i=i.leftShift();for(;!i.zero();)0>=o.cmp(r)&&(t=t.add(i),r=r.sub(o)),o=o.rightShift(),i=i.rightShift();return[t,r]};jspb.arith.UInt64.prototype.toString=function(){for(var o="",t=this;!t.zero();){t=t.div(10);var r=t[0];o=t[1].lo+o,t=r}return o==""&&(o="0"),o};jspb.arith.UInt64.fromString=function(o){for(var t=new jspb.arith.UInt64(0,0),r=new jspb.arith.UInt64(0,0),i=0;i<o.length;i++){if("0">o[i]||"9"<o[i])return null;var n=parseInt(o[i],10);r.lo=n,t=t.mul(10).add(r)}return t};jspb.arith.UInt64.prototype.clone=function(){return new jspb.arith.UInt64(this.lo,this.hi)};jspb.arith.Int64=function(o,t){this.lo=o,this.hi=t};jspb.arith.Int64.prototype.add=function(o){return new jspb.arith.Int64((this.lo+o.lo&4294967295)>>>0>>>0,((this.hi+o.hi&4294967295)>>>0)+(4294967296<=this.lo+o.lo?1:0)>>>0)};jspb.arith.Int64.prototype.sub=function(o){return new jspb.arith.Int64((this.lo-o.lo&4294967295)>>>0>>>0,((this.hi-o.hi&4294967295)>>>0)-(0>this.lo-o.lo?1:0)>>>0)};jspb.arith.Int64.prototype.clone=function(){return new jspb.arith.Int64(this.lo,this.hi)};jspb.arith.Int64.prototype.toString=function(){var o=(this.hi&2147483648)!=0,t=new jspb.arith.UInt64(this.lo,this.hi);return o&&(t=new jspb.arith.UInt64(0,0).sub(t)),(o?"-":"")+t.toString()};jspb.arith.Int64.fromString=function(o){var t=0<o.length&&o[0]=="-";return t&&(o=o.substring(1)),o=jspb.arith.UInt64.fromString(o),o===null?null:(t&&(o=new jspb.arith.UInt64(0,0).sub(o)),new jspb.arith.Int64(o.lo,o.hi))};jspb.BinaryEncoder=function(){this.buffer_=[]};jspb.BinaryEncoder.prototype.length=function(){return this.buffer_.length};jspb.BinaryEncoder.prototype.end=function(){var o=this.buffer_;return this.buffer_=[],o};jspb.BinaryEncoder.prototype.writeSplitVarint64=function(o,t){for(goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(t==Math.floor(t)),goog.asserts.assert(0<=o&&o<jspb.BinaryConstants.TWO_TO_32),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32);0<t||127<o;)this.buffer_.push(o&127|128),o=(o>>>7|t<<25)>>>0,t>>>=7;this.buffer_.push(o)};jspb.BinaryEncoder.prototype.writeSplitFixed64=function(o,t){goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(t==Math.floor(t)),goog.asserts.assert(0<=o&&o<jspb.BinaryConstants.TWO_TO_32),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUint32(o),this.writeUint32(t)};jspb.BinaryEncoder.prototype.writeUnsignedVarint32=function(o){for(goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(0<=o&&o<jspb.BinaryConstants.TWO_TO_32);127<o;)this.buffer_.push(o&127|128),o>>>=7;this.buffer_.push(o)};jspb.BinaryEncoder.prototype.writeSignedVarint32=function(o){if(goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(o>=-jspb.BinaryConstants.TWO_TO_31&&o<jspb.BinaryConstants.TWO_TO_31),0<=o)this.writeUnsignedVarint32(o);else{for(var t=0;9>t;t++)this.buffer_.push(o&127|128),o>>=7;this.buffer_.push(1)}};jspb.BinaryEncoder.prototype.writeUnsignedVarint64=function(o){goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(0<=o&&o<jspb.BinaryConstants.TWO_TO_64),jspb.utils.splitInt64(o),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)};jspb.BinaryEncoder.prototype.writeSignedVarint64=function(o){goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(o>=-jspb.BinaryConstants.TWO_TO_63&&o<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitInt64(o),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)};jspb.BinaryEncoder.prototype.writeZigzagVarint32=function(o){goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(o>=-jspb.BinaryConstants.TWO_TO_31&&o<jspb.BinaryConstants.TWO_TO_31),this.writeUnsignedVarint32((o<<1^o>>31)>>>0)};jspb.BinaryEncoder.prototype.writeZigzagVarint64=function(o){goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(o>=-jspb.BinaryConstants.TWO_TO_63&&o<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitZigzag64(o),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)};jspb.BinaryEncoder.prototype.writeZigzagVarint64String=function(o){this.writeZigzagVarintHash64(jspb.utils.decimalStringToHash64(o))};jspb.BinaryEncoder.prototype.writeZigzagVarintHash64=function(o){var t=this;jspb.utils.splitHash64(o),jspb.utils.toZigzag64(jspb.utils.split64Low,jspb.utils.split64High,function(r,i){t.writeSplitVarint64(r>>>0,i>>>0)})};jspb.BinaryEncoder.prototype.writeUint8=function(o){goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(0<=o&&256>o),this.buffer_.push(o>>>0&255)};jspb.BinaryEncoder.prototype.writeUint16=function(o){goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(0<=o&&65536>o),this.buffer_.push(o>>>0&255),this.buffer_.push(o>>>8&255)};jspb.BinaryEncoder.prototype.writeUint32=function(o){goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(0<=o&&o<jspb.BinaryConstants.TWO_TO_32),this.buffer_.push(o>>>0&255),this.buffer_.push(o>>>8&255),this.buffer_.push(o>>>16&255),this.buffer_.push(o>>>24&255)};jspb.BinaryEncoder.prototype.writeUint64=function(o){goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(0<=o&&o<jspb.BinaryConstants.TWO_TO_64),jspb.utils.splitUint64(o),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)};jspb.BinaryEncoder.prototype.writeInt8=function(o){goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(-128<=o&&128>o),this.buffer_.push(o>>>0&255)};jspb.BinaryEncoder.prototype.writeInt16=function(o){goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(-32768<=o&&32768>o),this.buffer_.push(o>>>0&255),this.buffer_.push(o>>>8&255)};jspb.BinaryEncoder.prototype.writeInt32=function(o){goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(o>=-jspb.BinaryConstants.TWO_TO_31&&o<jspb.BinaryConstants.TWO_TO_31),this.buffer_.push(o>>>0&255),this.buffer_.push(o>>>8&255),this.buffer_.push(o>>>16&255),this.buffer_.push(o>>>24&255)};jspb.BinaryEncoder.prototype.writeInt64=function(o){goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(o>=-jspb.BinaryConstants.TWO_TO_63&&o<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitInt64(o),this.writeSplitFixed64(jspb.utils.split64Low,jspb.utils.split64High)};jspb.BinaryEncoder.prototype.writeInt64String=function(o){goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(+o>=-jspb.BinaryConstants.TWO_TO_63&&+o<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitHash64(jspb.utils.decimalStringToHash64(o)),this.writeSplitFixed64(jspb.utils.split64Low,jspb.utils.split64High)};jspb.BinaryEncoder.prototype.writeFloat=function(o){goog.asserts.assert(o===1/0||o===-1/0||isNaN(o)||o>=-jspb.BinaryConstants.FLOAT32_MAX&&o<=jspb.BinaryConstants.FLOAT32_MAX),jspb.utils.splitFloat32(o),this.writeUint32(jspb.utils.split64Low)};jspb.BinaryEncoder.prototype.writeDouble=function(o){goog.asserts.assert(o===1/0||o===-1/0||isNaN(o)||o>=-jspb.BinaryConstants.FLOAT64_MAX&&o<=jspb.BinaryConstants.FLOAT64_MAX),jspb.utils.splitFloat64(o),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)};jspb.BinaryEncoder.prototype.writeBool=function(o){goog.asserts.assert(typeof o=="boolean"||typeof o=="number"),this.buffer_.push(o?1:0)};jspb.BinaryEncoder.prototype.writeEnum=function(o){goog.asserts.assert(o==Math.floor(o)),goog.asserts.assert(o>=-jspb.BinaryConstants.TWO_TO_31&&o<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32(o)};jspb.BinaryEncoder.prototype.writeBytes=function(o){this.buffer_.push.apply(this.buffer_,o)};jspb.BinaryEncoder.prototype.writeVarintHash64=function(o){jspb.utils.splitHash64(o),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)};jspb.BinaryEncoder.prototype.writeFixedHash64=function(o){jspb.utils.splitHash64(o),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)};jspb.BinaryEncoder.prototype.writeString=function(o){for(var t=this.buffer_.length,r=0;r<o.length;r++){var i=o.charCodeAt(r);if(128>i)this.buffer_.push(i);else if(2048>i)this.buffer_.push(i>>6|192),this.buffer_.push(i&63|128);else if(65536>i)if(55296<=i&&56319>=i&&r+1<o.length){var n=o.charCodeAt(r+1);56320<=n&&57343>=n&&(i=1024*(i-55296)+n-56320+65536,this.buffer_.push(i>>18|240),this.buffer_.push(i>>12&63|128),this.buffer_.push(i>>6&63|128),this.buffer_.push(i&63|128),r++)}else this.buffer_.push(i>>12|224),this.buffer_.push(i>>6&63|128),this.buffer_.push(i&63|128)}return this.buffer_.length-t};jspb.BinaryWriter=function(){this.blocks_=[],this.totalLength_=0,this.encoder_=new jspb.BinaryEncoder,this.bookmarks_=[]};jspb.BinaryWriter.prototype.appendUint8Array_=function(o){var t=this.encoder_.end();this.blocks_.push(t),this.blocks_.push(o),this.totalLength_+=t.length+o.length};jspb.BinaryWriter.prototype.beginDelimited_=function(o){return this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.DELIMITED),o=this.encoder_.end(),this.blocks_.push(o),this.totalLength_+=o.length,o.push(this.totalLength_),o};jspb.BinaryWriter.prototype.endDelimited_=function(o){var t=o.pop();for(t=this.totalLength_+this.encoder_.length()-t,goog.asserts.assert(0<=t);127<t;)o.push(t&127|128),t>>>=7,this.totalLength_++;o.push(t),this.totalLength_++};jspb.BinaryWriter.prototype.writeSerializedMessage=function(o,t,r){this.appendUint8Array_(o.subarray(t,r))};jspb.BinaryWriter.prototype.maybeWriteSerializedMessage=function(o,t,r){o!=null&&t!=null&&r!=null&&this.writeSerializedMessage(o,t,r)};jspb.BinaryWriter.prototype.reset=function(){this.blocks_=[],this.encoder_.end(),this.totalLength_=0,this.bookmarks_=[]};jspb.BinaryWriter.prototype.getResultBuffer=function(){goog.asserts.assert(this.bookmarks_.length==0);for(var o=new Uint8Array(this.totalLength_+this.encoder_.length()),t=this.blocks_,r=t.length,i=0,n=0;n<r;n++){var s=t[n];o.set(s,i),i+=s.length}return t=this.encoder_.end(),o.set(t,i),i+=t.length,goog.asserts.assert(i==o.length),this.blocks_=[o],o};jspb.BinaryWriter.prototype.getResultBase64String=function(o){return goog.crypt.base64.encodeByteArray(this.getResultBuffer(),o)};jspb.BinaryWriter.prototype.beginSubMessage=function(o){this.bookmarks_.push(this.beginDelimited_(o))};jspb.BinaryWriter.prototype.endSubMessage=function(){goog.asserts.assert(0<=this.bookmarks_.length),this.endDelimited_(this.bookmarks_.pop())};jspb.BinaryWriter.prototype.writeFieldHeader_=function(o,t){goog.asserts.assert(1<=o&&o==Math.floor(o)),this.encoder_.writeUnsignedVarint32(8*o+t)};jspb.BinaryWriter.prototype.writeAny=function(o,t,r){var i=jspb.BinaryConstants.FieldType;switch(o){case i.DOUBLE:this.writeDouble(t,r);break;case i.FLOAT:this.writeFloat(t,r);break;case i.INT64:this.writeInt64(t,r);break;case i.UINT64:this.writeUint64(t,r);break;case i.INT32:this.writeInt32(t,r);break;case i.FIXED64:this.writeFixed64(t,r);break;case i.FIXED32:this.writeFixed32(t,r);break;case i.BOOL:this.writeBool(t,r);break;case i.STRING:this.writeString(t,r);break;case i.GROUP:goog.asserts.fail("Group field type not supported in writeAny()");break;case i.MESSAGE:goog.asserts.fail("Message field type not supported in writeAny()");break;case i.BYTES:this.writeBytes(t,r);break;case i.UINT32:this.writeUint32(t,r);break;case i.ENUM:this.writeEnum(t,r);break;case i.SFIXED32:this.writeSfixed32(t,r);break;case i.SFIXED64:this.writeSfixed64(t,r);break;case i.SINT32:this.writeSint32(t,r);break;case i.SINT64:this.writeSint64(t,r);break;case i.FHASH64:this.writeFixedHash64(t,r);break;case i.VHASH64:this.writeVarintHash64(t,r);break;default:goog.asserts.fail("Invalid field type in writeAny()")}};jspb.BinaryWriter.prototype.writeUnsignedVarint32_=function(o,t){t!=null&&(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeUnsignedVarint32(t))};jspb.BinaryWriter.prototype.writeSignedVarint32_=function(o,t){t!=null&&(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(t))};jspb.BinaryWriter.prototype.writeUnsignedVarint64_=function(o,t){t!=null&&(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeUnsignedVarint64(t))};jspb.BinaryWriter.prototype.writeSignedVarint64_=function(o,t){t!=null&&(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint64(t))};jspb.BinaryWriter.prototype.writeZigzagVarint32_=function(o,t){t!=null&&(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint32(t))};jspb.BinaryWriter.prototype.writeZigzagVarint64_=function(o,t){t!=null&&(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint64(t))};jspb.BinaryWriter.prototype.writeZigzagVarint64String_=function(o,t){t!=null&&(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint64String(t))};jspb.BinaryWriter.prototype.writeZigzagVarintHash64_=function(o,t){t!=null&&(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarintHash64(t))};jspb.BinaryWriter.prototype.writeInt32=function(o,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32_(o,t))};jspb.BinaryWriter.prototype.writeInt32String=function(o,t){t!=null&&(t=parseInt(t,10),goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32_(o,t))};jspb.BinaryWriter.prototype.writeInt64=function(o,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeSignedVarint64_(o,t))};jspb.BinaryWriter.prototype.writeInt64String=function(o,t){t!=null&&(t=jspb.arith.Int64.fromString(t),this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t.lo,t.hi))};jspb.BinaryWriter.prototype.writeUint32=function(o,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUnsignedVarint32_(o,t))};jspb.BinaryWriter.prototype.writeUint32String=function(o,t){t!=null&&(t=parseInt(t,10),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUnsignedVarint32_(o,t))};jspb.BinaryWriter.prototype.writeUint64=function(o,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_64),this.writeUnsignedVarint64_(o,t))};jspb.BinaryWriter.prototype.writeUint64String=function(o,t){t!=null&&(t=jspb.arith.UInt64.fromString(t),this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t.lo,t.hi))};jspb.BinaryWriter.prototype.writeSint32=function(o,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeZigzagVarint32_(o,t))};jspb.BinaryWriter.prototype.writeSint64=function(o,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeZigzagVarint64_(o,t))};jspb.BinaryWriter.prototype.writeSintHash64=function(o,t){t!=null&&this.writeZigzagVarintHash64_(o,t)};jspb.BinaryWriter.prototype.writeSint64String=function(o,t){t!=null&&this.writeZigzagVarint64String_(o,t)};jspb.BinaryWriter.prototype.writeFixed32=function(o,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeUint32(t))};jspb.BinaryWriter.prototype.writeFixed64=function(o,t){t!=null&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_64),this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeUint64(t))};jspb.BinaryWriter.prototype.writeFixed64String=function(o,t){t!=null&&(t=jspb.arith.UInt64.fromString(t),this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t.lo,t.hi))};jspb.BinaryWriter.prototype.writeSfixed32=function(o,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeInt32(t))};jspb.BinaryWriter.prototype.writeSfixed64=function(o,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeInt64(t))};jspb.BinaryWriter.prototype.writeSfixed64String=function(o,t){t!=null&&(t=jspb.arith.Int64.fromString(t),this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t.lo,t.hi))};jspb.BinaryWriter.prototype.writeFloat=function(o,t){t!=null&&(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeFloat(t))};jspb.BinaryWriter.prototype.writeDouble=function(o,t){t!=null&&(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeDouble(t))};jspb.BinaryWriter.prototype.writeBool=function(o,t){t!=null&&(goog.asserts.assert(typeof t=="boolean"||typeof t=="number"),this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeBool(t))};jspb.BinaryWriter.prototype.writeEnum=function(o,t){t!=null&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(t))};jspb.BinaryWriter.prototype.writeString=function(o,t){t!=null&&(o=this.beginDelimited_(o),this.encoder_.writeString(t),this.endDelimited_(o))};jspb.BinaryWriter.prototype.writeBytes=function(o,t){t!=null&&(t=jspb.utils.byteSourceToUint8Array(t),this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(t.length),this.appendUint8Array_(t))};jspb.BinaryWriter.prototype.writeMessage=function(o,t,r){t!=null&&(o=this.beginDelimited_(o),r(t,this),this.endDelimited_(o))};jspb.BinaryWriter.prototype.writeMessageSet=function(o,t,r){t!=null&&(this.writeFieldHeader_(1,jspb.BinaryConstants.WireType.START_GROUP),this.writeFieldHeader_(2,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(o),o=this.beginDelimited_(3),r(t,this),this.endDelimited_(o),this.writeFieldHeader_(1,jspb.BinaryConstants.WireType.END_GROUP))};jspb.BinaryWriter.prototype.writeGroup=function(o,t,r){t!=null&&(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.START_GROUP),r(t,this),this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.END_GROUP))};jspb.BinaryWriter.prototype.writeFixedHash64=function(o,t){t!=null&&(goog.asserts.assert(t.length==8),this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeFixedHash64(t))};jspb.BinaryWriter.prototype.writeVarintHash64=function(o,t){t!=null&&(goog.asserts.assert(t.length==8),this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeVarintHash64(t))};jspb.BinaryWriter.prototype.writeSplitFixed64=function(o,t,r){this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t,r)};jspb.BinaryWriter.prototype.writeSplitVarint64=function(o,t,r){this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t,r)};jspb.BinaryWriter.prototype.writeSplitZigzagVarint64=function(o,t,r){this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.VARINT);var i=this.encoder_;jspb.utils.toZigzag64(t,r,function(n,s){i.writeSplitVarint64(n>>>0,s>>>0)})};jspb.BinaryWriter.prototype.writeRepeatedInt32=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeSignedVarint32_(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedInt32String=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeInt32String(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedInt64=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeSignedVarint64_(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedSplitFixed64=function(o,t,r,i){if(t!=null)for(var n=0;n<t.length;n++)this.writeSplitFixed64(o,r(t[n]),i(t[n]))};jspb.BinaryWriter.prototype.writeRepeatedSplitVarint64=function(o,t,r,i){if(t!=null)for(var n=0;n<t.length;n++)this.writeSplitVarint64(o,r(t[n]),i(t[n]))};jspb.BinaryWriter.prototype.writeRepeatedSplitZigzagVarint64=function(o,t,r,i){if(t!=null)for(var n=0;n<t.length;n++)this.writeSplitZigzagVarint64(o,r(t[n]),i(t[n]))};jspb.BinaryWriter.prototype.writeRepeatedInt64String=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeInt64String(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedUint32=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeUnsignedVarint32_(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedUint32String=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeUint32String(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedUint64=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeUnsignedVarint64_(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedUint64String=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeUint64String(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedSint32=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeZigzagVarint32_(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedSint64=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeZigzagVarint64_(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedSint64String=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeZigzagVarint64String_(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedSintHash64=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeZigzagVarintHash64_(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedFixed32=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeFixed32(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedFixed64=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeFixed64(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedFixed64String=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeFixed64String(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedSfixed32=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeSfixed32(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedSfixed64=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeSfixed64(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedSfixed64String=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeSfixed64String(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedFloat=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeFloat(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedDouble=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeDouble(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedBool=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeBool(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedEnum=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeEnum(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedString=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeString(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedBytes=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeBytes(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedMessage=function(o,t,r){if(t!=null)for(var i=0;i<t.length;i++){var n=this.beginDelimited_(o);r(t[i],this),this.endDelimited_(n)}};jspb.BinaryWriter.prototype.writeRepeatedGroup=function(o,t,r){if(t!=null)for(var i=0;i<t.length;i++)this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.START_GROUP),r(t[i],this),this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.END_GROUP)};jspb.BinaryWriter.prototype.writeRepeatedFixedHash64=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeFixedHash64(o,t[r])};jspb.BinaryWriter.prototype.writeRepeatedVarintHash64=function(o,t){if(t!=null)for(var r=0;r<t.length;r++)this.writeVarintHash64(o,t[r])};jspb.BinaryWriter.prototype.writePackedInt32=function(o,t){if(t!=null&&t.length){o=this.beginDelimited_(o);for(var r=0;r<t.length;r++)this.encoder_.writeSignedVarint32(t[r]);this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedInt32String=function(o,t){if(t!=null&&t.length){o=this.beginDelimited_(o);for(var r=0;r<t.length;r++)this.encoder_.writeSignedVarint32(parseInt(t[r],10));this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedInt64=function(o,t){if(t!=null&&t.length){o=this.beginDelimited_(o);for(var r=0;r<t.length;r++)this.encoder_.writeSignedVarint64(t[r]);this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedSplitFixed64=function(o,t,r,i){if(t!=null){o=this.beginDelimited_(o);for(var n=0;n<t.length;n++)this.encoder_.writeSplitFixed64(r(t[n]),i(t[n]));this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedSplitVarint64=function(o,t,r,i){if(t!=null){o=this.beginDelimited_(o);for(var n=0;n<t.length;n++)this.encoder_.writeSplitVarint64(r(t[n]),i(t[n]));this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedSplitZigzagVarint64=function(o,t,r,i){if(t!=null){o=this.beginDelimited_(o);for(var n=this.encoder_,s=0;s<t.length;s++)jspb.utils.toZigzag64(r(t[s]),i(t[s]),function(l,g){n.writeSplitVarint64(l>>>0,g>>>0)});this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedInt64String=function(o,t){if(t!=null&&t.length){o=this.beginDelimited_(o);for(var r=0;r<t.length;r++){var i=jspb.arith.Int64.fromString(t[r]);this.encoder_.writeSplitVarint64(i.lo,i.hi)}this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedUint32=function(o,t){if(t!=null&&t.length){o=this.beginDelimited_(o);for(var r=0;r<t.length;r++)this.encoder_.writeUnsignedVarint32(t[r]);this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedUint32String=function(o,t){if(t!=null&&t.length){o=this.beginDelimited_(o);for(var r=0;r<t.length;r++)this.encoder_.writeUnsignedVarint32(parseInt(t[r],10));this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedUint64=function(o,t){if(t!=null&&t.length){o=this.beginDelimited_(o);for(var r=0;r<t.length;r++)this.encoder_.writeUnsignedVarint64(t[r]);this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedUint64String=function(o,t){if(t!=null&&t.length){o=this.beginDelimited_(o);for(var r=0;r<t.length;r++){var i=jspb.arith.UInt64.fromString(t[r]);this.encoder_.writeSplitVarint64(i.lo,i.hi)}this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedSint32=function(o,t){if(t!=null&&t.length){o=this.beginDelimited_(o);for(var r=0;r<t.length;r++)this.encoder_.writeZigzagVarint32(t[r]);this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedSint64=function(o,t){if(t!=null&&t.length){o=this.beginDelimited_(o);for(var r=0;r<t.length;r++)this.encoder_.writeZigzagVarint64(t[r]);this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedSint64String=function(o,t){if(t!=null&&t.length){o=this.beginDelimited_(o);for(var r=0;r<t.length;r++)this.encoder_.writeZigzagVarintHash64(jspb.utils.decimalStringToHash64(t[r]));this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedSintHash64=function(o,t){if(t!=null&&t.length){o=this.beginDelimited_(o);for(var r=0;r<t.length;r++)this.encoder_.writeZigzagVarintHash64(t[r]);this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedFixed32=function(o,t){if(t!=null&&t.length)for(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),o=0;o<t.length;o++)this.encoder_.writeUint32(t[o])};jspb.BinaryWriter.prototype.writePackedFixed64=function(o,t){if(t!=null&&t.length)for(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),o=0;o<t.length;o++)this.encoder_.writeUint64(t[o])};jspb.BinaryWriter.prototype.writePackedFixed64String=function(o,t){if(t!=null&&t.length)for(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),o=0;o<t.length;o++){var r=jspb.arith.UInt64.fromString(t[o]);this.encoder_.writeSplitFixed64(r.lo,r.hi)}};jspb.BinaryWriter.prototype.writePackedSfixed32=function(o,t){if(t!=null&&t.length)for(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),o=0;o<t.length;o++)this.encoder_.writeInt32(t[o])};jspb.BinaryWriter.prototype.writePackedSfixed64=function(o,t){if(t!=null&&t.length)for(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),o=0;o<t.length;o++)this.encoder_.writeInt64(t[o])};jspb.BinaryWriter.prototype.writePackedSfixed64String=function(o,t){if(t!=null&&t.length)for(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),o=0;o<t.length;o++)this.encoder_.writeInt64String(t[o])};jspb.BinaryWriter.prototype.writePackedFloat=function(o,t){if(t!=null&&t.length)for(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),o=0;o<t.length;o++)this.encoder_.writeFloat(t[o])};jspb.BinaryWriter.prototype.writePackedDouble=function(o,t){if(t!=null&&t.length)for(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),o=0;o<t.length;o++)this.encoder_.writeDouble(t[o])};jspb.BinaryWriter.prototype.writePackedBool=function(o,t){if(t!=null&&t.length)for(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(t.length),o=0;o<t.length;o++)this.encoder_.writeBool(t[o])};jspb.BinaryWriter.prototype.writePackedEnum=function(o,t){if(t!=null&&t.length){o=this.beginDelimited_(o);for(var r=0;r<t.length;r++)this.encoder_.writeEnum(t[r]);this.endDelimited_(o)}};jspb.BinaryWriter.prototype.writePackedFixedHash64=function(o,t){if(t!=null&&t.length)for(this.writeFieldHeader_(o,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),o=0;o<t.length;o++)this.encoder_.writeFixedHash64(t[o])};jspb.BinaryWriter.prototype.writePackedVarintHash64=function(o,t){if(t!=null&&t.length){o=this.beginDelimited_(o);for(var r=0;r<t.length;r++)this.encoder_.writeVarintHash64(t[r]);this.endDelimited_(o)}};jspb.Export={};exports.Map=jspb.Map;exports.Message=jspb.Message;exports.BinaryReader=jspb.BinaryReader;exports.BinaryWriter=jspb.BinaryWriter;exports.ExtensionFieldInfo=jspb.ExtensionFieldInfo;exports.ExtensionFieldBinaryInfo=jspb.ExtensionFieldBinaryInfo;exports.exportSymbol=goog.exportSymbol;exports.inherits=goog.inherits;exports.object={extend:goog.object.extend};exports.typeOf=goog.typeOf});var nr=mt(ir=>{var ue=or(),Tt=ue,rr=function(){return this||window||rr||self||Function("return this")()}.call(null);Tt.exportSymbol("proto.CommonModels.JsonMessage",null,rr);proto.CommonModels.JsonMessage=function(o){ue.Message.initialize(this,o,0,-1,null,null)};Tt.inherits(proto.CommonModels.JsonMessage,ue.Message);Tt.DEBUG&&!COMPILED&&(proto.CommonModels.JsonMessage.displayName="proto.CommonModels.JsonMessage");ue.Message.GENERATE_TO_OBJECT&&(proto.CommonModels.JsonMessage.prototype.toObject=function(o){return proto.CommonModels.JsonMessage.toObject(o,this)},proto.CommonModels.JsonMessage.toObject=function(o,t){var r,i={value:ue.Message.getFieldWithDefault(t,1,"")};return o&&(i.$jspbMessageInstance=t),i});proto.CommonModels.JsonMessage.deserializeBinary=function(o){var t=new ue.BinaryReader(o),r=new proto.CommonModels.JsonMessage;return proto.CommonModels.JsonMessage.deserializeBinaryFromReader(r,t)};proto.CommonModels.JsonMessage.deserializeBinaryFromReader=function(o,t){for(;t.nextField()&&!t.isEndGroup();){var r=t.getFieldNumber();switch(r){case 1:var i=t.readString();o.setValue(i);break;default:t.skipField();break}}return o};proto.CommonModels.JsonMessage.prototype.serializeBinary=function(){var o=new ue.BinaryWriter;return proto.CommonModels.JsonMessage.serializeBinaryToWriter(this,o),o.getResultBuffer()};proto.CommonModels.JsonMessage.serializeBinaryToWriter=function(o,t){var r=void 0;r=o.getValue(),r.length>0&&t.writeString(1,r)};proto.CommonModels.JsonMessage.prototype.getValue=function(){return ue.Message.getFieldWithDefault(this,1,"")};proto.CommonModels.JsonMessage.prototype.setValue=function(o){return ue.Message.setProto3StringField(this,1,o)};Tt.object.extend(ir,proto.CommonModels)});var yo=mt((mo,fo)=>{(function(o,t){typeof define=="function"&&define.amd?define([],t):typeof mo<"u"?t():(t(),o.FileSaver={})})(mo,function(){"use strict";function o(g,p){return typeof p>"u"?p={autoBom:!1}:typeof p!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),p={autoBom:!p}),p.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(g.type)?new Blob(["\uFEFF",g],{type:g.type}):g}function t(g,p,h){var S=new XMLHttpRequest;S.open("GET",g),S.responseType="blob",S.onload=function(){l(S.response,p,h)},S.onerror=function(){console.error("could not download file")},S.send()}function r(g){var p=new XMLHttpRequest;p.open("HEAD",g,!1);try{p.send()}catch{}return 200<=p.status&&299>=p.status}function i(g){try{g.dispatchEvent(new MouseEvent("click"))}catch{var p=document.createEvent("MouseEvents");p.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),g.dispatchEvent(p)}}var n=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:void 0,s=n.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=n.saveAs||(typeof window!="object"||window!==n?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(g,p,h){var S=n.URL||n.webkitURL,E=document.createElement("a");p=p||g.name||"download",E.download=p,E.rel="noopener",typeof g=="string"?(E.href=g,E.origin===location.origin?i(E):r(E.href)?t(g,p,h):i(E,E.target="_blank")):(E.href=S.createObjectURL(g),setTimeout(function(){S.revokeObjectURL(E.href)},4e4),setTimeout(function(){i(E)},0))}:"msSaveOrOpenBlob"in navigator?function(g,p,h){if(p=p||g.name||"download",typeof g!="string")navigator.msSaveOrOpenBlob(o(g,h),p);else if(r(g))t(g,p,h);else{var S=document.createElement("a");S.href=g,S.target="_blank",setTimeout(function(){i(S)})}}:function(g,p,h,S){if(S=S||open("","_blank"),S&&(S.document.title=S.document.body.innerText="downloading..."),typeof g=="string")return t(g,p,h);var E=g.type==="application/octet-stream",y=/constructor/i.test(n.HTMLElement)||n.safari,T=/CriOS\/[\d]+/.test(navigator.userAgent);if((T||E&&y||s)&&typeof FileReader<"u"){var I=new FileReader;I.onloadend=function(){var v=I.result;v=T?v:v.replace(/^data:[^;]*;/,"data:attachment/file;"),S?S.location.href=v:location=v,S=null},I.readAsDataURL(g)}else{var m=n.URL||n.webkitURL,u=m.createObjectURL(g);S?S.location=u:location.href=u,S=null,setTimeout(function(){m.revokeObjectURL(u)},4e4)}});n.saveAs=l.saveAs=l,typeof fo<"u"&&(fo.exports=l)})});var Ar=mt((wo,Do)=>{(function(o,t){typeof wo=="object"&&typeof Do<"u"?Do.exports=t():typeof define=="function"&&define.amd?define(t):o.Croppr=t()})(wo,function(){"use strict";(function(){for(var I=0,m=["ms","moz","webkit","o"],u=0;u<m.length&&!window.requestAnimationFrame;++u)window.requestAnimationFrame=window[m[u]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[m[u]+"CancelAnimationFrame"]||window[m[u]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(v,w){var D=new Date().getTime(),C=Math.max(0,16-(D-I)),_=window.setTimeout(function(){v(D+C)},C);return I=D+C,_}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(v){clearTimeout(v)})})(),function(){if(typeof window.CustomEvent=="function")return!1;function I(m,u){u=u||{bubbles:!1,cancelable:!1,detail:void 0};var v=document.createEvent("CustomEvent");return v.initCustomEvent(m,u.bubbles,u.cancelable,u.detail),v}I.prototype=window.Event.prototype,window.CustomEvent=I}(),function(I){try{return new CustomEvent("test"),!1}catch{}function m(u,v){v=v||{bubbles:!1,cancelable:!1};var w=document.createEvent("MouseEvent");return w.initMouseEvent(u,v.bubbles,v.cancelable,I,0,0,0,0,0,!1,!1,!1,!1,0,null),w}m.prototype=Event.prototype,I.MouseEvent=m}(window);var o=function(I,m){if(!(I instanceof m))throw new TypeError("Cannot call a class as a function")},t=function(){function I(m,u){for(var v=0;v<u.length;v++){var w=u[v];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(m,w.key,w)}}return function(m,u,v){return u&&I(m.prototype,u),v&&I(m,v),m}}(),r=function I(m,u,v){m===null&&(m=Function.prototype);var w=Object.getOwnPropertyDescriptor(m,u);if(w===void 0){var D=Object.getPrototypeOf(m);return D===null?void 0:I(D,u,v)}else{if("value"in w)return w.value;var C=w.get;return C===void 0?void 0:C.call(v)}},i=function(I,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);I.prototype=Object.create(m&&m.prototype,{constructor:{value:I,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(I,m):I.__proto__=m)},n=function(I,m){if(!I)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:I},s=function(){function I(m,u){var v=[],w=!0,D=!1,C=void 0;try{for(var _=m[Symbol.iterator](),M;!(w=(M=_.next()).done)&&(v.push(M.value),!(u&&v.length===u));w=!0);}catch(R){D=!0,C=R}finally{try{!w&&_.return&&_.return()}finally{if(D)throw C}}return v}return function(m,u){if(Array.isArray(m))return m;if(Symbol.iterator in Object(m))return I(m,u);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function I(m,u,v,w){o(this,I);var D=this;this.position=m,this.constraints=u,this.cursor=v,this.eventBus=w,this.el=document.createElement("div"),this.el.className="croppr-handle",this.el.style.cursor=v,this.el.addEventListener("mousedown",C);function C(R){R.stopPropagation(),document.addEventListener("mouseup",_),document.addEventListener("mousemove",M),D.eventBus.dispatchEvent(new CustomEvent("handlestart",{detail:{handle:D}}))}function _(R){R.stopPropagation(),document.removeEventListener("mouseup",_),document.removeEventListener("mousemove",M),D.eventBus.dispatchEvent(new CustomEvent("handleend",{detail:{handle:D}}))}function M(R){R.stopPropagation(),D.eventBus.dispatchEvent(new CustomEvent("handlemove",{detail:{mouseX:R.clientX,mouseY:R.clientY}}))}},g=function(){function I(m,u,v,w){o(this,I),this.x1=m,this.y1=u,this.x2=v,this.y2=w}return t(I,[{key:"set",value:function(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,D=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;return this.x1=u??this.x1,this.y1=v??this.y1,this.x2=w??this.x2,this.y2=D??this.y2,this}},{key:"width",value:function(){return Math.abs(this.x2-this.x1)}},{key:"height",value:function(){return Math.abs(this.y2-this.y1)}},{key:"resize",value:function(u,v){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[0,0],D=this.x1+this.width()*w[0],C=this.y1+this.height()*w[1];return this.x1=D-u*w[0],this.y1=C-v*w[1],this.x2=this.x1+u,this.y2=this.y1+v,this}},{key:"scale",value:function(u){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0],w=this.width()*u,D=this.height()*u;return this.resize(w,D,v),this}},{key:"move",value:function(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,w=this.width(),D=this.height();return u=u===null?this.x1:u,v=v===null?this.y1:v,this.x1=u,this.y1=v,this.x2=u+w,this.y2=v+D,this}},{key:"getRelativePoint",value:function(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[0,0],v=this.width()*u[0],w=this.height()*u[1];return[v,w]}},{key:"getAbsolutePoint",value:function(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[0,0],v=this.x1+this.width()*u[0],w=this.y1+this.height()*u[1];return[v,w]}},{key:"constrainToRatio",value:function(u){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0],w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"height";if(u!==null){var D=this.width(),C=this.height();switch(w){case"height":this.resize(this.width(),this.width()*u,v);break;case"width":this.resize(this.height()*1/u,this.height(),v);break;default:this.resize(this.width(),this.width()*u,v)}return this}}},{key:"constrainToBoundary",value:function(u,v){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[0,0],D=this.getAbsolutePoint(w),C=s(D,2),_=C[0],M=C[1],R=_,B=M,U=u-_,F=v-M,G=-2*w[0]+1,L=-2*w[1]+1,N=null,K=null;switch(G){case-1:N=R;break;case 0:N=Math.min(R,U)*2;break;case 1:N=U;break}switch(L){case-1:K=B;break;case 0:K=Math.min(B,F)*2;break;case 1:K=F;break}if(this.width()>N){var Y=N/this.width();this.scale(Y,w)}if(this.height()>K){var X=K/this.height();this.scale(X,w)}return this}},{key:"constrainToSize",value:function(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,D=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[0,0],_=arguments.length>5&&arguments[5]!==void 0?arguments[5]:null;if(_&&(_>1?(u=v*1/_,D=D*_):_<1&&(v=u*_,w=D*1/_)),u&&this.width()>u){var M=u,R=_===null?this.height():v;this.resize(M,R,C)}if(v&&this.height()>v){var B=_===null?this.width():u,U=v;this.resize(B,U,C)}if(w&&this.width()<w){var F=w,G=_===null?this.height():D;this.resize(F,G,C)}if(D&&this.height()<D){var L=_===null?this.width():w,N=D;this.resize(L,N,C)}return this}}]),I}();function p(I){I.addEventListener("touchstart",h),I.addEventListener("touchend",h),I.addEventListener("touchmove",h)}function h(I){I.preventDefault();var m=I.changedTouches[0],u={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup"};m.target.dispatchEvent(new MouseEvent(u[I.type],{bubbles:!0,cancelable:!0,view:window,clientX:m.clientX,clientY:m.clientY,screenX:m.screenX,screenY:m.screenY}))}var S=[{position:[0,0],constraints:[1,0,0,1],cursor:"nw-resize"},{position:[.5,0],constraints:[1,0,0,0],cursor:"n-resize"},{position:[1,0],constraints:[1,1,0,0],cursor:"ne-resize"},{position:[1,.5],constraints:[0,1,0,0],cursor:"e-resize"},{position:[1,1],constraints:[0,1,1,0],cursor:"se-resize"},{position:[.5,1],constraints:[0,0,1,0],cursor:"s-resize"},{position:[0,1],constraints:[0,0,1,1],cursor:"sw-resize"},{position:[0,.5],constraints:[0,0,0,1],cursor:"w-resize"}],E=function(){function I(m,u){var v=this,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(o(this,I),this.options=I.parseOptions(u||{}),!m.nodeName&&(m=document.querySelector(m),m==null))throw"Unable to find element.";if(!m.getAttribute("src"))throw"Image src not provided.";this._initialized=!1,this._restore={parent:m.parentNode,element:m},w||(m.width===0||m.height===0?m.onload=function(){v.initialize(m)}:this.initialize(m))}return t(I,[{key:"initialize",value:function(u){this.createDOM(u),this.options.convertToPixels(this.cropperEl),this.attachHandlerEvents(),this.attachRegionEvents(),this.attachOverlayEvents(),this.box=this.initializeBox(this.options),this.redraw(),this._initialized=!0,this.options.onInitialize!==null&&this.options.onInitialize(this)}},{key:"createDOM",value:function(u){this.containerEl=document.createElement("div"),this.containerEl.className="croppr-container",this.eventBus=this.containerEl,p(this.containerEl),this.cropperEl=document.createElement("div"),this.cropperEl.className="croppr",this.imageEl=document.createElement("img"),this.imageEl.setAttribute("src",u.getAttribute("src")),this.imageEl.setAttribute("alt",u.getAttribute("alt")),this.imageEl.className="croppr-image",this.imageClippedEl=this.imageEl.cloneNode(),this.imageClippedEl.className="croppr-imageClipped",this.regionEl=document.createElement("div"),this.regionEl.className="croppr-region",this.overlayEl=document.createElement("div"),this.overlayEl.className="croppr-overlay";var v=document.createElement("div");v.className="croppr-handleContainer",this.handles=[];for(var w=0;w<S.length;w++){var D=new l(S[w].position,S[w].constraints,S[w].cursor,this.eventBus);this.handles.push(D),v.appendChild(D.el)}this.cropperEl.appendChild(this.imageEl),this.cropperEl.appendChild(this.imageClippedEl),this.cropperEl.appendChild(this.regionEl),this.cropperEl.appendChild(this.overlayEl),this.cropperEl.appendChild(v),this.containerEl.appendChild(this.cropperEl),u.parentElement.replaceChild(this.containerEl,u)}},{key:"setImage",value:function(u){var v=this;return this.imageEl.onload=function(){v.box=v.initializeBox(v.options),v.redraw()},this.imageEl.src=u,this.imageClippedEl.src=u,this}},{key:"destroy",value:function(){this._restore.parent.replaceChild(this._restore.element,this.containerEl)}},{key:"initializeBox",value:function(u){var v=u.startSize.width,w=u.startSize.height,D=new g(0,0,v,w);D.constrainToRatio(u.aspectRatio,[.5,.5]);var C=u.minSize,_=u.maxSize;D.constrainToSize(_.width,_.height,C.width,C.height,[.5,.5],u.aspectRatio);var M=this.cropperEl.offsetWidth,R=this.cropperEl.offsetHeight;D.constrainToBoundary(M,R,[.5,.5]);var B=this.cropperEl.offsetWidth/2-D.width()/2,U=this.cropperEl.offsetHeight/2-D.height()/2;return D.move(B,U),D}},{key:"redraw",value:function(){var u=this,v=Math.round(this.box.width()),w=Math.round(this.box.height()),D=Math.round(this.box.x1),C=Math.round(this.box.y1),_=Math.round(this.box.x2),M=Math.round(this.box.y2);window.requestAnimationFrame(function(){u.regionEl.style.transform="translate("+D+"px, "+C+"px)",u.regionEl.style.width=v+"px",u.regionEl.style.height=w+"px",u.imageClippedEl.style.clip="rect("+C+"px, "+_+"px, "+M+"px, "+D+"px)";for(var R=u.box.getAbsolutePoint([.5,.5]),B=R[0]-u.cropperEl.offsetWidth/2>>31,U=R[1]-u.cropperEl.offsetHeight/2>>31,F=(B^U)+U+U+4,G=-2*F+8,L=0;L<u.handles.length;L++){var N=u.handles[L],K=N.el.offsetWidth,Y=N.el.offsetHeight,X=D+v*N.position[0]-K/2,pe=C+w*N.position[1]-Y/2;N.el.style.transform="translate("+Math.round(X)+"px, "+Math.round(pe)+"px)",N.el.style.zIndex=G==L?5:4}})}},{key:"attachHandlerEvents",value:function(){var u=this.eventBus;u.addEventListener("handlestart",this.onHandleMoveStart.bind(this)),u.addEventListener("handlemove",this.onHandleMoveMoving.bind(this)),u.addEventListener("handleend",this.onHandleMoveEnd.bind(this))}},{key:"attachRegionEvents",value:function(){var u=this.eventBus,v=this;this.regionEl.addEventListener("mousedown",w),u.addEventListener("regionstart",this.onRegionMoveStart.bind(this)),u.addEventListener("regionmove",this.onRegionMoveMoving.bind(this)),u.addEventListener("regionend",this.onRegionMoveEnd.bind(this));function w(_){_.stopPropagation(),document.addEventListener("mouseup",C),document.addEventListener("mousemove",D),u.dispatchEvent(new CustomEvent("regionstart",{detail:{mouseX:_.clientX,mouseY:_.clientY}}))}function D(_){_.stopPropagation(),u.dispatchEvent(new CustomEvent("regionmove",{detail:{mouseX:_.clientX,mouseY:_.clientY}}))}function C(_){_.stopPropagation(),document.removeEventListener("mouseup",C),document.removeEventListener("mousemove",D),u.dispatchEvent(new CustomEvent("regionend",{detail:{mouseX:_.clientX,mouseY:_.clientY}}))}}},{key:"attachOverlayEvents",value:function(){var u=4,v=this,w=null;this.overlayEl.addEventListener("mousedown",D);function D(M){M.stopPropagation(),document.addEventListener("mouseup",_),document.addEventListener("mousemove",C);var R=v.cropperEl.getBoundingClientRect(),B=M.clientX-R.left,U=M.clientY-R.top;w=v.box,v.box=new g(B,U,B+1,U+1),v.eventBus.dispatchEvent(new CustomEvent("handlestart",{detail:{handle:v.handles[u]}}))}function C(M){M.stopPropagation(),v.eventBus.dispatchEvent(new CustomEvent("handlemove",{detail:{mouseX:M.clientX,mouseY:M.clientY}}))}function _(M){if(M.stopPropagation(),document.removeEventListener("mouseup",_),document.removeEventListener("mousemove",C),v.box.width()===1&&v.box.height()===1){v.box=w;return}v.eventBus.dispatchEvent(new CustomEvent("handleend",{detail:{mouseX:M.clientX,mouseY:M.clientY}}))}}},{key:"onHandleMoveStart",value:function(u){var v=u.detail.handle,w=[1-v.position[0],1-v.position[1]],D=this.box.getAbsolutePoint(w),C=s(D,2),_=C[0],M=C[1];this.activeHandle={handle:v,originPoint:w,originX:_,originY:M},this.options.onCropStart!==null&&this.options.onCropStart(this.getValue())}},{key:"onHandleMoveMoving",value:function(u){var v=u.detail,w=v.mouseX,D=v.mouseY,C=this.cropperEl.getBoundingClientRect();w=w-C.left,D=D-C.top,w<0?w=0:w>C.width&&(w=C.width),D<0?D=0:D>C.height&&(D=C.height);var _=this.activeHandle.originPoint.slice(),M=this.activeHandle.originX,R=this.activeHandle.originY,B=this.activeHandle.handle,U=B.constraints[0]===1,F=B.constraints[1]===1,G=B.constraints[2]===1,L=B.constraints[3]===1,N=(L||F)&&(U||G),K=L||F?M:this.box.x1,Y=L||F?M:this.box.x2,X=U||G?R:this.box.y1,pe=U||G?R:this.box.y2;K=L?w:K,Y=F?w:Y,X=U?D:X,pe=G?D:pe;var et=!1,Oe=!1;if((L||F)&&(et=L?w>M:w<M),(U||G)&&(Oe=U?D>R:D<R),et){var te=K;K=Y,Y=te,_[0]=1-_[0]}if(Oe){var Xr=X;X=pe,pe=Xr,_[1]=1-_[1]}var ye=new g(K,X,Y,pe);if(this.options.aspectRatio){var eo=this.options.aspectRatio,to=!1;N?to=D>ye.y1+eo*ye.width()||D<ye.y2-eo*ye.width():(U||G)&&(to=!0);var Zr=to?"width":"height";ye.constrainToRatio(eo,_,Zr)}var Ko=this.options.minSize,Yo=this.options.maxSize;ye.constrainToSize(Yo.width,Yo.height,Ko.width,Ko.height,_,this.options.aspectRatio);var ei=this.cropperEl.offsetWidth,ti=this.cropperEl.offsetHeight;ye.constrainToBoundary(ei,ti,_),this.box=ye,this.redraw(),this.options.onCropMove!==null&&this.options.onCropMove(this.getValue())}},{key:"onHandleMoveEnd",value:function(u){this.options.onCropEnd!==null&&this.options.onCropEnd(this.getValue())}},{key:"onRegionMoveStart",value:function(u){var v=u.detail,w=v.mouseX,D=v.mouseY,C=this.cropperEl.getBoundingClientRect();w=w-C.left,D=D-C.top,this.currentMove={offsetX:w-this.box.x1,offsetY:D-this.box.y1},this.options.onCropStart!==null&&this.options.onCropStart(this.getValue())}},{key:"onRegionMoveMoving",value:function(u){var v=u.detail,w=v.mouseX,D=v.mouseY,C=this.currentMove,_=C.offsetX,M=C.offsetY,R=this.cropperEl.getBoundingClientRect();w=w-R.left,D=D-R.top,this.box.move(w-_,D-M),this.box.x1<0&&this.box.move(0,null),this.box.x2>R.width&&this.box.move(R.width-this.box.width(),null),this.box.y1<0&&this.box.move(null,0),this.box.y2>R.height&&this.box.move(null,R.height-this.box.height()),this.redraw(),this.options.onCropMove!==null&&this.options.onCropMove(this.getValue())}},{key:"onRegionMoveEnd",value:function(u){this.options.onCropEnd!==null&&this.options.onCropEnd(this.getValue())}},{key:"getValue",value:function(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;if(u===null&&(u=this.options.returnMode),u=="real"){var v=this.imageEl.naturalWidth,w=this.imageEl.naturalHeight,D=this.imageEl.getBoundingClientRect(),C=D.width,_=D.height,M=v/C,R=w/_;return{x:Math.round(this.box.x1*M),y:Math.round(this.box.y1*R),width:Math.round(this.box.width()*M),height:Math.round(this.box.height()*R)}}else if(u=="ratio"){var B=this.imageEl.getBoundingClientRect(),U=B.width,F=B.height;return{x:y(this.box.x1/U,3),y:y(this.box.y1/F,3),width:y(this.box.width()/U,3),height:y(this.box.height()/F,3)}}else if(u=="raw")return{x:Math.round(this.box.x1),y:Math.round(this.box.y1),width:Math.round(this.box.width()),height:Math.round(this.box.height())}}}],[{key:"parseOptions",value:function(u){var v={aspectRatio:null,maxSize:{width:null,height:null},minSize:{width:null,height:null},startSize:{width:100,height:100,unit:"%"},returnMode:"real",onInitialize:null,onCropStart:null,onCropMove:null,onCropEnd:null},w=null;u.aspectRatio!==void 0&&(typeof u.aspectRatio=="number"?w=u.aspectRatio:u.aspectRatio instanceof Array&&(w=u.aspectRatio[1]/u.aspectRatio[0]));var D=null;u.maxSize!==void 0&&u.maxSize!==null&&(D={width:u.maxSize[0]||null,height:u.maxSize[1]||null,unit:u.maxSize[2]||"px"});var C=null;u.minSize!==void 0&&u.minSize!==null&&(C={width:u.minSize[0]||null,height:u.minSize[1]||null,unit:u.minSize[2]||"px"});var _=null;u.startSize!==void 0&&u.startSize!==null&&(_={width:u.startSize[0]||null,height:u.startSize[1]||null,unit:u.startSize[2]||"%"});var M=null;typeof u.onInitialize=="function"&&(M=u.onInitialize);var R=null;typeof u.onCropStart=="function"&&(R=u.onCropStart);var B=null;typeof u.onCropEnd=="function"&&(B=u.onCropEnd);var U=null;typeof u.onUpdate=="function"&&(console.warn("Croppr.js: `onUpdate` is deprecated and will be removed in the next major release. Please use `onCropMove` or `onCropEnd` instead."),U=u.onUpdate),typeof u.onCropMove=="function"&&(U=u.onCropMove);var F=null;if(u.returnMode!==void 0){var G=u.returnMode.toLowerCase();if(["real","ratio","raw"].indexOf(G)===-1)throw"Invalid return mode.";F=G}var L=function(Y){for(var X=Y.offsetWidth,pe=Y.offsetHeight,et=["maxSize","minSize","startSize"],Oe=0;Oe<et.length;Oe++){var te=et[Oe];this[te]!==null&&(this[te].unit=="%"&&(this[te].width!==null&&(this[te].width=this[te].width/100*X),this[te].height!==null&&(this[te].height=this[te].height/100*pe)),delete this[te].unit)}},N=function(Y,X){return Y!==null?Y:X};return{aspectRatio:N(w,v.aspectRatio),maxSize:N(D,v.maxSize),minSize:N(C,v.minSize),startSize:N(_,v.startSize),returnMode:N(F,v.returnMode),onInitialize:N(M,v.onInitialize),onCropStart:N(R,v.onCropStart),onCropMove:N(U,v.onCropMove),onCropEnd:N(B,v.onCropEnd),convertToPixels:L}}}]),I}();function y(I,m){return Number(Math.round(I+"e"+m)+"e-"+m)}var T=function(I){i(m,I);function m(u,v){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return o(this,m),n(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,u,v,w))}return t(m,[{key:"getValue",value:function(v){return r(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"getValue",this).call(this,v)}},{key:"setImage",value:function(v){return r(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"setImage",this).call(this,v)}},{key:"destroy",value:function(){return r(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"destroy",this).call(this)}},{key:"moveTo",value:function(v,w){return this.box.move(v,w),this.redraw(),this.options.onCropEnd!==null&&this.options.onCropEnd(this.getValue()),this}},{key:"resizeTo",value:function(v,w){var D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[.5,.5];return this.box.resize(v,w,D),this.redraw(),this.options.onCropEnd!==null&&this.options.onCropEnd(this.getValue()),this}},{key:"scaleBy",value:function(v){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[.5,.5];return this.box.scale(v,w),this.redraw(),this.options.onCropEnd!==null&&this.options.onCropEnd(this.getValue()),this}},{key:"reset",value:function(){return this.box=this.initializeBox(this.options),this.redraw(),this.options.onCropEnd!==null&&this.options.onCropEnd(this.getValue()),this}}]),m}(E);return T})});var ot=(n=>(n[n.Invalid=0]="Invalid",n[n.Valid=1]="Valid",n[n.ExpireSoon=2]="ExpireSoon",n[n.Expired=3]="Expired",n))(ot||{});var Ee=(h=>(h[h.GridView=0]="GridView",h[h.Dashboard=1]="Dashboard",h[h.MenuNode=2]="MenuNode",h[h.Report=3]="Report",h[h.Diagram=4]="Diagram",h[h.CDM=5]="CDM",h[h.Slideshow=6]="Slideshow",h[h.GanttChart=7]="GanttChart",h[h.Scheduler=8]="Scheduler",h))(Ee||{});function P(o,t=!0){let r=t?"success":"error",i=t?2e3:4e3;DevExpress.ui.notify({message:o,type:r,onShowing:n=>{let s=n.element.find(".dx-toast-message");s.html((s.html()||"").replace("\\n","<br />"))}},r,i)}var yt=o=>o?Array.isArray(o)?o[0].StackTrace!==void 0||o[0].Error!==void 0:o.Error!==void 0:!1;var Te=(r=>(r[r.Completed=1]="Completed",r[r.Errored=2]="Errored",r))(Te||{});var no={};ie(no,{createButtons:()=>Zo,createDialog:()=>J,createItem:()=>mi});var ro={};ie(ro,{CSS_CLASSES:()=>oe});var oe={dxDataGrid:"iszolea-dx-datagrid",dxButton:"iszolea-dx-button",dxPopup:"iszolea-dx-popup"};var gi="popup-content",pi="popup-footer",ui="buttons",io="ok-btn",Xo="cancel-btn";function ci(o,t){return{$content:$("<div />").addClass(gi).addClass(t).appendTo(o),$footer:$("<div />").addClass(pi).appendTo(o)}}var vt=[];function hi(o,t,r=!1){let i=t.onShowing;t.onShown=l=>{i&&i(l);let g=s.content().find("input[type=text]"),p=g.eq(0);p.focus();let h={keydown:S=>{vt[vt.length-1]===s&&(S.keyCode===13&&$(S.currentTarget).trigger("change"),n(S))}};r?g.on(h):p.on(h)};function n(l){l.keyCode===13&&s.content().find(`.${oe.dxButton}.${io}`).click(),l.keyCode===27&&s.content().find(`.${oe.dxButton}.${Xo}`).click()}let s=o.dxPopup(t).dxPopup("instance");return{show:()=>{s.show(),$(document).on({keydown:n}),vt.push(s)},hide:()=>{$(document).off({keydown:n}),s.hide(),vt.pop()},remove:()=>o.remove()}}function Zo(o,t){let r=$("<table />").addClass(ui),i=$("<tr>").appendTo(r);return o&&$("<td />").attr("width",t?"50%":"100%").append($("<div />").addClass(oe.dxButton).addClass(io).dxButton(o)).appendTo(i),t&&$("<td />").attr("width","50%").append($("<div />").addClass(oe.dxButton).addClass(Xo).dxButton(t)).appendTo(i),r}function mi(o,t){return $("<div />").addClass("item").append($("<div />").addClass("form-label").text(o),$("<div />").addClass("value").append(t))}function J(o,t,r,i,n){let s=$("<div>").appendTo("body"),l=null,g=null,p=n?n.useKeyPressBehavior:!1;function h(){g.hide(),g.remove()}let S={contentTemplate:y=>{let{$content:T,$footer:I}=ci(y);T.append(t),r?(l=Zo({text:r.text,icon:r.icon,disabled:r.disabled,type:"success",onClick:m=>r.onClick(h)},i?{text:i.text,icon:i.icon,disabled:i.disabled,onClick:m=>i.onClick(h)}:void 0),I.append(l)):I.remove()},wrapperAttr:{class:"iszolea-dx-popup"}},E={};return $.extend(!0,E,o,S),g=hi(s,E,p),g.show(),{okBtn:l?l.find(`.${io}`).dxButton("instance"):null,close:()=>h()}}var fi="iszolea-error-dx-popup",yi="iszolea-error-dx-popup__content",vi="iszolea-error-dx-popup__error-message",Si="iszolea-error-dx-popup__error-details",er="Show details",bi="Hide details";function so(o,t){let r,i=Array.isArray(t)?t:[t],n=$("<div />").addClass(yi);i.forEach((g,p)=>{let h=$("<p />").addClass(vi).text(g.Error),S=$("<p />").addClass(Si).text(g.StackTrace);n.append(h,S).hide(),p<i.length-1&&n.append($("<hr />"))});let s=J({title:o,height:"auto",animation:{show:{direction:"bottom",type:"slideIn"},hide:{direction:"bottom",type:"slideOut"}},position:{my:"bottom",at:"bottom",offset:{y:-50}},shading:!1,dragEnabled:!1,onInitialized:g=>{r=g.component,g.element.addClass(fi)}},n,{text:er,onClick:()=>{let g=!r.option("fullScreen");l(g),s.okBtn.option("text",g?bi:er)}},{text:"Close",onClick:g=>g()}),l=g=>{n.toggle(g),r.option("fullScreen",g),r.repaint()}}var rt=(i=>(i[i.UnexpectedException=0]="UnexpectedException",i[i.SqlException=1]="SqlException",i[i.IszoleaConfigurationException=2]="IszoleaConfigurationException",i))(rt||{});var St=o=>{switch(o){case 1:return"We attempted to execute the data query however it appears there is an error in the data source.";case 2:return"Something wrong with iszolea configuration. Check ClientId/ClientSecret fields in the appsettings.json file.";default:return""}};var ao="Unexpected error occurred. Please contact to developers.",Ei=[504],bt=()=>ao;function Ie(o,t=!1){return t&&P(o.Message),JSON.stringify(o.Data)}function ne(o,t,r){let i=o.Message,n={message:i},s,l=Ti(i);if(l!==null?s=(r?r(l):"")||ao:s=i||ao,t){let g=o.Data;if(yt(g)){let p=Array.isArray(g)&&g.length,h=!Array.isArray(g)&&(g.StackTrace||g.Error);if(p||h)return so(s,g),n}P(s,!1)}return n}function Ti(o){return!isNaN(o)&&rt[+o]?+o:null}function tr(o){let t=o.request.response?JSON.parse(o.request.response):{};return t.RequestState===1?(Ie(t),!0):(ne(t,!0),!1)}function x(o,t="GET",r=null,i,n){let s=$.Deferred(),l=(n==null?void 0:n.notifyError)===void 0||n.notifyError,g={headers:{Accept:"application/json"}},p=$.extend({type:t,url:o,data:r},n,g);return $.ajax(p).done(h=>{let S=h;if(S.RequestState===1){Ie(S,i),s.resolve(S.Data);return}let{message:E}=ne(S,l,(n==null?void 0:n.getUserFriendlyErrorMessage)||St);s.reject(E)}).fail((h,S)=>{!Ei.includes(h.status)&&l&&P(bt(),!1),s.reject(S)}),s}function Et(o){return o().catch(t=>{let r=t.metadata["grpc-error"],i=t.metadata["grpc-stacktrace"];if(r||i){let n=atob(i);so(r,{Error:r,StackTrace:n})}else P(t.message,!1)})}var sr=ft(nr());function lo(o,t,r,i){if(!o||typeof o!="object"||!o.RequestState||o.RequestState===1)return o;try{let n=ne(o,t,i).message;return $.Deferred().reject(n)}catch(n){return $.Deferred().reject(n)}}function ce(o){let t=DevExpress.data.AspNet.createStore(O(A({},o),{onBeforeSend:(r,i)=>{(r==="update"||r==="insert")&&(i.headers={Accept:"application/json"}),o.onBeforeSend&&o.onBeforeSend(r,i);let n=(o==null?void 0:o.notifyError)===void 0||o.notifyError;i.dataFilter=s=>{let l=JSON.parse(s);if(l.RequestState===1)return Ie(l,o.notifySuccess);let g=ne(l,n,o==null?void 0:o.getUserFriendlyErrorMessage).message;return l.Message=g,JSON.stringify(l)},i.error=s=>{let l=JSON.parse(s.responseText||"{}");l.RequestState||ne(l,n,o==null?void 0:o.getUserFriendlyErrorMessage)}}}));return t._errorHandler=r=>{r&&!r.message&&(r.message=bt())},Object.defineProperty(t,"loadUrl",{value:o.loadUrl,writable:!1}),Object.defineProperty(t,"loadParams",{value:o.loadParams,writable:!1}),t}function It(o){let t=(o==null?void 0:o.notifyError)===void 0||o.notifyError,r=!!(o==null?void 0:o.notifySuccess),i=DevExpress.data.AspNet.createStore(O(A({},o),{onBeforeSend:(n,s)=>{(n==="update"||n==="insert"||n==="delete")&&(s.headers={Accept:"application/json"}),s.dataFilter=l=>{let g=JSON.parse(l);return g.RequestState===1?Ie(g,o.notifySuccess):(g.Message=ne(g,t,o==null?void 0:o.getUserFriendlyErrorMessage).message,JSON.stringify(g))},s.error=l=>{let g=JSON.parse(l.responseText||"{}");g.RequestState||ne(g,t,o==null?void 0:o.getUserFriendlyErrorMessage)},o.onBeforeSend&&o.onBeforeSend(n,s)}}));return i._errorHandler=n=>{n&&!n.message&&(n.message=bt())},new DevExpress.data.CustomStore({key:i.key(),load:n=>i.load(n),byKey:(n,s)=>i.byKey(n,s),update:o.updateUrl?(n,s)=>i.update(n,s).then(l=>lo(l,t,r,o==null?void 0:o.getUserFriendlyErrorMessage)):void 0,insert:o.insertUrl?n=>i.insert(n).then(s=>lo(s,t,r,o==null?void 0:o.getUserFriendlyErrorMessage)):void 0,remove:o.deleteUrl?n=>i.remove(n).then(s=>lo(s,t,r,o==null?void 0:o.getUserFriendlyErrorMessage)):void 0})}function ar(o,t){return new DevExpress.data.CustomStore({key:o,load:async r=>{let i=new sr.JsonMessage;i.setValue(JSON.stringify(r));let n=await Et(()=>t(i));return n?JSON.parse(n.getValue()):[]}})}var go={};ie(go,{default:()=>se});var we={};async function se(o){if(we[o])return await we[o];we[o]=x(o),we[o].catch(r=>{throw we[o]=null,r});let t=await we[o];return we[o]=null,t}var lr={sendRequest:x,handleError:ne,handleSuccess:Ie,handleUpload:tr,createDxDataSource:ce,isErrorInfo:yt,loadWithMultipleProtection:go,grpc:{sendRequest:Et,createDxDataSource:ar}};var H=o=>{throw new Error(`The required ${o?`${o} `:""} isn't created`)};var po={};ie(po,{WindowResizeListener:()=>he,bootstrapLayoutBreakpoints:()=>Z,enableAsyncSummaryLoader:()=>wi,getUrlByMenuItemData:()=>ve});function wt(o,t,r){let i={request:null,data:null,rendered:!1},n=0,s=o.option("onOptionChanged"),l=o.option("onContentReady"),g=()=>++n,p=(y,T={})=>{let I=[];for(let m in y){if(!y.hasOwnProperty(m))continue;let u=y[m];u!=null&&(typeof u=="object"?I.push(`${encodeURIComponent(m)}=${encodeURIComponent(JSON.stringify(u))}`):I.push(`${encodeURIComponent(m)}=${encodeURIComponent(u)}`))}for(let m in T){if(!T.hasOwnProperty(m))continue;let u=T[m];u!=null&&(Array.isArray(u)?u.forEach(v=>{I.push(`${encodeURIComponent(m)}[]=${encodeURIComponent(v)}`)}):I.push(`${encodeURIComponent(m)}=${encodeURIComponent(u)}`))}return I.join("&")},h=(y="Loading...")=>{$(".dx-datagrid-summary-item",o.element()).html(y)},S=(y,T)=>{var B,U,F,G;let I=(T==null?void 0:T.totalCount)||0,m=(T==null?void 0:T.summary)||[I],u=y.getDataSource(),v=y.getController("data"),w=y.getController("columns"),D=y.getController("tablePosition"),C=v==null?void 0:v._dataSource,_=w==null?void 0:w._dataSource,M=(B=D.getView("pagerView"))==null?void 0:B.getPager(),R=(G=(F=(U=v==null?void 0:v._footerItems)==null?void 0:U.find(L=>L.rowType==="totalFooter"))==null?void 0:F.summaryCells)==null?void 0:G.filter(L=>L.length);if(u&&(u._totalCount=I),C&&(C._totalCount=I,C._currentTotalCount=I,C._totalCountCorrection=0,C._hasLastPage=!0),_&&(_._totalAggregates=m),R==null?void 0:R.length)for(let L=0;L<R.length;L++){let N=R[L];typeof m[L]<"u"&&(N[0].value=m[L])}M&&(M._props.totalCount=v.totalCount(),M._props.pageCount=v.pageCount()),y.repaint()},E=(y,T)=>{let I=y.getDataSource()||y.option("dataSource");if(!I)return;let m=I._store||I.store;m.on("loading",u=>{let v=typeof T=="string",w=O(A({},u),{requireTotalCount:!0,isSummaryQuery:!0});u.requireTotalCount=!1,u.totalSummary=null,u.isSummaryQuery=!1;let D=v?T:m.loadUrl||r;h();let C=g();setTimeout(()=>{i.request=x(`${D}?${p(w,m.loadParams)}`,"GET",null,!1,{notifyError:!1}).done(_=>{C===n&&(i.data=_,i.rendered=!1,o.repaint())}).fail(()=>{C===n&&h("-")})},0)})};o.option("onOptionChanged",y=>{s&&s(y),y.name==="dataSource"&&y.value&&E(y.component,t)}),o.option("onContentReady",y=>{var T;l&&l(y),((T=i.request)==null?void 0:T.state())==="pending"?h():i.data&&!i.rendered&&(i.rendered=!0,S(o,i.data))}),E(o,t)}var Z={xs:{name:"xs",minWidth:0,maxWidth:575},sm:{name:"sm",minWidth:576,maxWidth:767},md:{name:"md",minWidth:768,maxWidth:991},lg:{name:"lg",minWidth:992,maxWidth:1199},xl:{name:"xl",minWidth:1200,maxWidth:1/0}},Ii=Object.getOwnPropertyNames(Z).map(o=>Z[o]),he=class{constructor(t,r,i=100,n=Ii){this.onWindowResizeListener=this.onWindowResize.bind(this);this.onResize=t,this.onLayoutBreakpointChanged=r,this.resizeDelay=i,this.layoutBreakpoints=n,this.currentLayoutBreakpoint=this.getLayoutBreakpointByWindowWidth(window.innerWidth),this.attachEvents()}destroy(){this.detachEvents()}attachEvents(){window.addEventListener("resize",this.onWindowResizeListener)}detachEvents(){window.removeEventListener("resize",this.onWindowResizeListener)}getLayoutBreakpointByWindowWidth(t){return this.layoutBreakpoints.find(r=>r.minWidth<=t&&(!r.maxWidth||r.maxWidth>=t))}onWindowResize(t){clearTimeout(this.lastWindowResizeTimeoutId),this.lastWindowResizeTimeoutId=window.setTimeout(()=>this.onWindowResizeInternal(t),this.resizeDelay)}onWindowResizeInternal(t){let r=this.getLayoutBreakpointByWindowWidth(window.innerWidth);if(this.currentLayoutBreakpoint!==r){let i=this.currentLayoutBreakpoint;this.currentLayoutBreakpoint=r,this.emitBreakpointChanged({previousBreakpoint:i,currentBreakpoint:this.currentLayoutBreakpoint,originalEvent:t})}this.emitResizeEvent(t)}emitResizeEvent(t){var r;try{(r=this.onResize)==null||r.call(this,t)}catch(i){console.error(i)}}emitBreakpointChanged(t){var r;try{(r=this.onLayoutBreakpointChanged)==null||r.call(this,t)}catch(i){console.error(i)}}};function ve(o){let{Area:t,Controller:r,Action:i,IsClickable:n}=o;if(n&&r)return encodeURI(t?`/${t}/${r}/${i}`:`/${r}/${i}`)}function wi(o,t=null){wt(o,t||!0)}var k={isLegacyRender:!1};var uo=class{constructor(t){this.onLayoutBreakpointChangedListener=this.onLayoutBreakpointChanged.bind(this);this.container=t.container,this.userAvatar=t.userAvatar,this.userName=t.userName,this.items=t.items,this.collapseBreakpoint=t.collapseBreakpoint||Z.md,this.getDisplayedUserInfo=t.getDisplayedUserInfo||uo.defaultGetDisplayedUserInfo,this.onItemClick=t.onItemClick,this.windowResizeListener=new he(void 0,this.onLayoutBreakpointChangedListener)}get root(){return this._root}render(){if(this._root&&this.container.removeChild(this._root),this.renderMainElements(),this.renderUserInfo(),this.renderItems(),!this.root)return H("root");this.container.appendChild(this.root)}addItems(t){this.items=this.items.concat(t),this.render()}insertItems(t,r){this.items.splice(r,0,...t),this.render()}updateItems(t){this.items=t,this.render()}get menuItems(){return this.items}getBadge(t){let r=this.items.find(i=>{var n;return((n=i.Text)==null?void 0:n.toLowerCase())===t});return(r==null?void 0:r.Badge)||null}setBadge(t,r){let i=this.items.find(n=>{var s;return((s=n.Text)==null?void 0:s.toLowerCase())===t});i&&(i.Badge=r),this.render()}get isMobileView(){return this.windowResizeListener.currentLayoutBreakpoint.maxWidth<this.collapseBreakpoint.maxWidth}renderMainElements(){this._root=document.createElement("div"),this._root.classList.add("user-menu"),this.mobileContentContainer=document.createElement("div"),this.mobileContentContainer.classList.add(`d-${this.collapseBreakpoint.name}-none`),this.desktopRootDropdown=document.createElement("div"),this.desktopRootDropdown.classList.add("dropdown","d-none",`d-${this.collapseBreakpoint.name}-block`),this.desktopContentTrigger=document.createElement("button"),this.desktopContentTrigger.classList.add("header__icon-button","btn","btn-outline-light"),this.desktopContentTrigger.setAttribute("type","button"),this.desktopContentTrigger.setAttribute("data-toggle","dropdown");let t;if(k.isLegacyRender?this.userAvatar?(t=document.createElement("img"),t.classList.add("header__icon-button-icon","header__icon-button-avatar"),t.src=this.userAvatar):(t=document.createElement("i"),t.classList.add("header__icon-button-icon","fas","fa-user")):(t=document.createElement("i"),t.classList.add("header__icon-button-icon","isoz-icon-user")),this.desktopContentContainer=document.createElement("div"),this.desktopContentContainer.classList.add("dropdown-menu","dropdown-menu-right"),this.desktopContentTrigger.appendChild(t),this.items.some(r=>!!r.Badge)){let r=document.createElement("span");r.classList.add("user-menu__badge"),this.desktopContentTrigger.appendChild(r)}this.desktopRootDropdown.appendChild(this.desktopContentTrigger),this.desktopRootDropdown.appendChild(this.desktopContentContainer),this.itemsContainer=document.createElement("ul"),this.itemsContainer.classList.add("user-menu__items"),k.isLegacyRender?(this.userInfoContainer=document.createElement("h6"),this.userInfoContainer.classList.add("user-info","h6")):(this.userInfoContainer=document.createElement("a"),this.userInfoContainer.classList.add("user-info","dropdown-item")),this.userInfoDivider=document.createElement("div"),this.userInfoDivider.classList.add("dropdown-divider","d-none",`d-${this.collapseBreakpoint.name}-block`),this.isMobileView?(this.mobileContentContainer.appendChild(this.userInfoContainer),this.mobileContentContainer.appendChild(this.userInfoDivider),this.mobileContentContainer.appendChild(this.itemsContainer)):(this.desktopContentContainer.appendChild(this.userInfoContainer),this.desktopContentContainer.appendChild(this.userInfoDivider),this.desktopContentContainer.appendChild(this.itemsContainer)),this._root.appendChild(this.mobileContentContainer),this._root.appendChild(this.desktopRootDropdown)}renderUserInfo(){if(!this.userInfoContainer)return H("userInfoContainer");if(k.isLegacyRender){let t=document.createElement("span");t.classList.add("user-info__content"),t.innerText=this.getDisplayedUserInfo(this.userName),this.userInfoContainer.appendChild(t)}else this.userInfoContainer.innerText=this.getDisplayedUserInfo(this.userName)}renderItems(){if(!this.itemsContainer)return H("itemsContainer");this.clearItemsContainer(),this.items.forEach(t=>{let r=this.createItemElement(t,this.isMobileView);this.itemsContainer.appendChild(r)})}createItemElement(t,r){let i=this.createItemElementBase(t),n=document.createElement("a");if(n.classList.add(r?"nav-link":"dropdown-item"),n.href=t.Url||"javascript:void(0)",n.text=t.Text,t.OpenInNewPage&&(n.target="_blank"),this.attachEventsToItem(n,t),i.appendChild(n),t.Badge){let s=document.createElement("span");s.classList.add("isoz-badge"),s.classList.add("isoz-badge--circle"),s.classList.add(`isoz-badge--${t.Badge.Type||"information"}`),s.innerHTML=t.Badge.Text,n.appendChild(s)}return i}createItemElementBase(t){let r=document.createElement("li");return r.classList.add("nav-item"),r}attachEventsToItem(t,r){t.addEventListener("click",i=>this.onMenuItemClick({item:r,originalEvent:i}))}switchView(t){t?(this.applyMobileViewForUserInfo(),this.applyMobileViewForItems()):(this.applyDesktopViewForUserInfo(),this.applyDesktopViewForItems())}applyMobileViewForUserInfo(){this.mobileContentContainer.insertBefore(this.userInfoContainer,null),this.mobileContentContainer.insertBefore(this.userInfoDivider,null)}applyDesktopViewForUserInfo(){this.desktopContentContainer.insertBefore(this.userInfoContainer,null),this.desktopContentContainer.insertBefore(this.userInfoDivider,null)}applyMobileViewForItems(){var t;this.mobileContentContainer.insertBefore(this.itemsContainer,null);for(let r of this.itemsContainer.children)(t=r.firstElementChild)==null||t.classList.replace("dropdown-item","nav-link")}applyDesktopViewForItems(){var t;this.desktopContentContainer.insertBefore(this.itemsContainer,null);for(let r of this.itemsContainer.children)(t=r.firstElementChild)==null||t.classList.replace("nav-link","dropdown-item")}clearItemsContainer(){for(;this.itemsContainer.firstChild;)this.itemsContainer.firstChild.remove()}emitItemClick(t){var r,i,n;try{(r=this.onItemClick)==null||r.call(this,t),(n=(i=t.item).OnClick)==null||n.call(i,t)}catch(s){console.error(s)}}onLayoutBreakpointChanged(t){this.switchView(this.isMobileView)}async onMenuItemClick(t){this.emitItemClick(t),t.cancel&&t.originalEvent.preventDefault()}},De=uo;De.defaultGetDisplayedUserInfo=t=>`Welcome ${t}`;var Dt=class{constructor(t){this.container=t.container,this.items=t.items,this.onItemClick=t.onItemClick}updateItems(t){this.items=t}emitItemClick(t){var r;try{(r=this.onItemClick)==null||r.call(this,t)}catch(i){console.error(i)}}};var Ue=class extends Dt{constructor(t){super(t);this.onWindowResizeEventHandler=this.onWindowResize.bind(this);this.onToggleDropdownButtonClickHandler=this.onToggleDropdownButtonClick.bind(this);this.onToggleDropdownButtonMouseEnterHandler=this.onToggleDropdownButtonMouseEnter.bind(this);this.itemActionMode=t.itemAction||"hover",this.collapsingMode=t.collapsingMode??3,this.collapseBreakpoint=t.collapseBreakpoint||Z.md,this.collapseIconName=t.collapseIcon||"fa-ellipsis-v",this.windowResizeListener=new he(this.collapsingMode===3?this.onWindowResizeEventHandler:void 0,void 0,Ue.adaptivityCollapsingDelay)}render(){if(!this.root){if(this.renderRoot(),this.renderItems(),!this.root)return H("root");this.container.appendChild(this.root)}}updateItems(t){if(super.updateItems(t),!this.root)return new Error("The BootstrapCollapsingMenu isn't rendered");for(;this.root.firstChild;)this.root.firstChild.remove();this.renderItems()}applyAdaptivityCollapsing(){if(!(this.collapsingMode!==3||!this.root||!this.items.length||!this.collapseRoot||!this.collapseDropdown))if(this.isNeedCollapse()){this.collapseRoot.classList.remove("d-none");do{let t=this.root.children[this.root.children.length-2];if(!t)break;this.moveRootItemsToCollapseDropdown(t)}while(this.isNeedCollapse())}else{for(;this.collapseDropdown.children.length;)if(this.moveRootItemsToRoot(this.collapseDropdown.firstElementChild),this.isNeedCollapse()){let t=this.root.children[this.root.children.length-2];t&&this.moveRootItemsToCollapseDropdown(t);break}this.collapseDropdown.children.length||this.collapseRoot.classList.add("d-none")}}updateActiveItemsState(){this.forEachMenuItemRecursive(this.items,t=>{let r=t.active;t.active=co(t.originalModel),t.active!==r&&this.applyStatesToItemElement(t.menuItemEl.firstElementChild,t)})}closeOpenedDropdown(t){this.itemActionMode==="hover"&&(this.root.classList.remove(Ue.HOVER_MODE_CSS_CLASS),$(t).one("mouseleave",()=>{this.root.classList.add(Ue.HOVER_MODE_CSS_CLASS)}))}forEachMenuItemRecursive(t,r){t.forEach(i=>{r(i),this.isNestedItemsOwnerItem(i)&&this.forEachMenuItemRecursive(i.items,r)})}renderRoot(){this.root=document.createElement("ul"),this.root.classList.add("navbar-nav","mr-auto"),this.itemActionMode==="hover"&&this.root.classList.add(Ue.HOVER_MODE_CSS_CLASS)}renderItems(){this.renderRootItems(),this.items.length&&this.collapsingMode!==0&&(this.root||H("root"),this.root.style.visibility="hidden",this.renderCollapseElements(),setTimeout(()=>{this.applyAdaptivityCollapsing(),this.root.style.visibility=""},10)),this.changeDefaultDropdownBehaviorForNestedDropdown()}changeDefaultDropdownBehaviorForNestedDropdown(){$(this.root.querySelectorAll(".dropdown")).on("hide.bs.dropdown",t=>!(t.target!==this.currentOpeningSubMenu&&t.target.contains(this.currentOpeningSubMenu))),$(this.root.querySelectorAll(".dropdown-submenu")).on("show.bs.dropdown",t=>{this.currentOpeningSubMenu=void 0})}renderCollapseElements(){if(!this.root)return H("root");this.collapseRoot=document.createElement("li"),this.collapseRoot.classList.add("nav-item","dropdown","collapsing-menu__collapse-root"),this.collapseButton=document.createElement("button"),this.collapseButton.classList.add("header__icon-button","btn","btn-outline-light"),this.collapseButton.setAttribute("type","button"),this.collapseButton.setAttribute("data-toggle","dropdown");let t=document.createElement("i");t.classList.add("header__icon-button-icon","fas",this.collapseIconName),this.collapseDropdown=document.createElement("ul"),this.collapseDropdown.classList.add("dropdown-menu","dropdown-menu-right"),this.collapseButton.appendChild(t),this.collapseRoot.appendChild(this.collapseButton),this.collapseRoot.appendChild(this.collapseDropdown),this.root.appendChild(this.collapseRoot)}renderRootItems(){if(!this.root)return H("root");this.items.forEach(t=>{let r;this.isNestedItemsOwnerItem(t)?r=this.createRootItemWithNestedItems(t):r=this.createRootItemElement(t),this.root.appendChild(r)})}createRootItemWithNestedItems(t){let r=this.createRootItemElement(t);r.classList.add("dropdown");let i=r.querySelector(".nav-link");i instanceof HTMLElement&&this.setItemContentAsDropdownToggler(i);let n=this.createDropdownMenu(t);return r.appendChild(n),r}createRootItemElement(t){let r=document.createElement("li");r.classList.add("nav-item"),t.title&&r.setAttribute("title",t.title);let i=document.createElement("a");i.classList.add("nav-link"),i.href=t.url||"javascript:void(0)",i.text=t.text;let n=this.createItemIconElement(t);return n&&i.insertBefore(n,i.firstChild),this.applyStatesToItemElement(i,t),this.attachEventsToItem(i,t),r.appendChild(i),t.menuItemEl=r,r}createNestedSubMenuItemElement(t){let r=this.createNestedItem(t);r.classList.add("dropdown","dropdown-submenu");let i=r.querySelector(".dropdown-item");i instanceof HTMLElement&&this.setItemContentAsDropdownToggler(i);let n=this.createDropdownMenu(t);return r.appendChild(n),r}createNestedItem(t){let r=document.createElement("li");t.title&&r.setAttribute("title",t.title);let i=document.createElement("a");i.classList.add("dropdown-item"),i.href=t.url||"javascript:void(0)",i.text=t.text;let n=this.createItemIconElement(t);return n&&i.insertBefore(n,i.firstChild),this.applyStatesToItemElement(i,t),this.attachEventsToItem(i,t),r.appendChild(i),t.menuItemEl=r,r}createDropdownMenu(t){let r=document.createElement("ul");return r.classList.add("dropdown-menu"),t.items.forEach(i=>{let n;this.isNestedItemsOwnerItem(i)?n=this.createNestedSubMenuItemElement(i):n=this.createNestedItem(i),r.appendChild(n)}),r}createItemIconElement(t){if(!t.icon)return null;let r=document.createElement("i");return r.style.backgroundImage=`url(${t.icon})`,r}setItemContentAsDropdownToggler(t){t.classList.add("dropdown-toggle"),t.setAttribute("data-toggle","dropdown"),t.addEventListener("click",this.onToggleDropdownButtonClickHandler),t.addEventListener("mouseenter",this.onToggleDropdownButtonMouseEnterHandler)}applyStatesToItemElement(t,r){r.active?t.classList.add("active"):t.classList.remove("active"),r.hidden?t.classList.add("d-none"):t.classList.remove("d-none"),r.disabled?t.classList.add("disabled"):t.classList.remove("disabled")}attachEventsToItem(t,r){t.addEventListener("click",i=>this.emitItemClick({item:r,originalEvent:i}))}isNestedItemsOwnerItem(t){return t.items&&t.items.length&&t.items.some(r=>!r.hidden)}moveRootItemsToCollapseDropdown(t){if(t instanceof Element)this.applyCollapsingViewForRootItem(t),this.collapseDropdown.insertBefore(t,this.collapseDropdown.firstElementChild);else{let r=document.createDocumentFragment();for(let i of t)r.insertBefore(i,r.firstElementChild),this.applyCollapsingViewForRootItem(i);this.collapseDropdown.appendChild(r)}}moveRootItemsToRoot(t){if(t instanceof Element)this.applyExpandedViewForRootItem(t),this.root.insertBefore(t,this.root.children[this.root.children.length-1]||null);else{let r=document.createDocumentFragment();for(let i of t)r.insertBefore(i,r.firstElementChild),this.applyExpandedViewForRootItem(i);this.root.appendChild(r)}}applyCollapsingViewForRootItem(t){t.classList.add("dropdown-submenu");for(let r of t.children)r.classList.replace("nav-link","dropdown-item")}applyExpandedViewForRootItem(t){t.classList.remove("dropdown-submenu");for(let r of t.children)r.classList.replace("dropdown-item","nav-link")}isNeedCollapse(){if(this.windowResizeListener.currentLayoutBreakpoint.minWidth<this.collapseBreakpoint.minWidth)return!1;this.root.style.maxWidth="none";let t=this.root.getBoundingClientRect();this.root.classList.add("collapsing-menu_normal-white-space");let r=this.root.getBoundingClientRect();return this.root.classList.remove("collapsing-menu_normal-white-space"),this.root.style.maxWidth="",t.width>r.width}isDropdownRectsIntersect(t,r,i=2){return t.left<r.right-i&&r.left+i<t.right&&t.top<r.bottom-i&&r.top+i<t.bottom}applyShadowsForOverlapingDropdownIfNeeded(t){t.style.left="",t.classList.remove("dropdown-menu-left-shadowed");let r=t.getBoundingClientRect();r.right>window.innerWidth&&(t.style.left=`-${r.width}px`),r=t.getBoundingClientRect();let i=document.querySelectorAll(".dropdown-menu");for(let n of i)if(n!==t&&this.isDropdownRectsIntersect(n.getBoundingClientRect(),r)){t.classList.add("dropdown-menu-left-shadowed");break}}onWindowResize(t){this.applyAdaptivityCollapsing()}onToggleDropdownButtonClick(t){t.target instanceof HTMLElement&&t.target.parentElement&&(this.currentOpeningSubMenu=t.target.parentElement)}onToggleDropdownButtonMouseEnter(t){this.windowResizeListener.currentLayoutBreakpoint.maxWidth>=this.collapseBreakpoint.maxWidth&&t.target instanceof HTMLElement&&t.target.nextElementSibling instanceof HTMLElement&&t.target.nextElementSibling.classList.contains("dropdown-menu")&&this.applyShadowsForOverlapingDropdownIfNeeded(t.target.nextElementSibling)}},Pe=Ue;Pe.HOVER_MODE_CSS_CLASS="navbar-nav_hover-action",Pe.adaptivityCollapsingDelay=50;var dr=(o,t)=>{var r;for(let i of o){if(i.Name===t)return i;if((r=i.Items)==null?void 0:r.length){let n=dr(i.Items,t);if(n)return n}}},gr=o=>{let t=o.Items;if(!t||!t.length){let i=ve(o);return i?[i]:[]}let r=[];for(let i of t)r=r.concat(gr(i));return r},co=o=>{let t=window.location.pathname+window.location.search,r=gr(o);for(let i of r)if(new RegExp(`^.*${i.replace("?","\\?")}$`).test(t))return!0;return!1},Ne=class{constructor(t,r,i,n,s){this.onMenuItemClickHandler=this.onMenuItemClick.bind(this);this.container=t,this.isGlobalMenu=i,this.items=r,this.onNavigationMenuItemClick=s,this.menu=new Pe({container:this.container,items:this.mapNavigationMenuItemModelToMenuItems(r),collapseBreakpoint:n,onItemClick:this.onMenuItemClickHandler})}updateData(t,r){this.items=t,this.isGlobalMenu=r,this.menu.updateItems(this.mapNavigationMenuItemModelToMenuItems(this.items))}render(){this.menu.render()}applyAdaptivityCollapsing(){this.menu.applyAdaptivityCollapsing()}updateActiveItemsState(){this.menu.updateActiveItemsState()}async onMenuItemClick(t){let r=this.mapMenuItemClickEventArgsToNavigationMenuItemClickEventArgs(t);if(r&&(this.emitNavigationMenuItemClick(r),r.cancel)){t.originalEvent.preventDefault();let i=t.originalEvent.target;this.menu.closeOpenedDropdown(i)}}emitNavigationMenuItemClick(t){var r,i,n;try{(r=this.onNavigationMenuItemClick)==null||r.call(this,t),(n=(i=t.item).OnClick)==null||n.call(i,t)}catch(s){console.error(s)}}mapNavigationMenuItemModelToMenuItems(t){return t.map(r=>({text:r.Name,icon:r.Icon,items:r.Items?this.mapNavigationMenuItemModelToMenuItems(r.Items):void 0,url:ve(r),hidden:r.Visible===!1,active:co(r),disabled:r.Disabled,title:r.Description,originalModel:r}))}mapMenuItemClickEventArgsToNavigationMenuItemClickEventArgs(t){let r=dr(this.items,t.item.text);return r?{originalEvent:t.originalEvent,cancel:!1,item:O(A({},r),{isGlobal:this.isGlobalMenu})}:null}};var Ce="iszolea-ui|logo-settings";var ho=class{constructor(t,r){this.$container=t,this.dataSource=r}initWidget(){return this._initWidget(this.dataSource)}updateData(){return window.sessionStorage.removeItem(Ce),this.$imageElement.remove(),this.$titleContainer.remove(),this._initWidget(this.dataSource)}_initWidget(t){let r=window.sessionStorage.getItem(Ce);return r?(this._createLogo(JSON.parse(r)),$.Deferred()):this._createLogo(t)}_createLogo(t){if(typeof t=="object"){let r=t;return this._createLogoMarkup(r),$.Deferred()}return x(this.dataSource,"post").done(r=>{let i={};i.applicationName=r.ApplicationName,i.businessName=r.BusinessName,i.logoImage=r.LogoImage,i.landingPageLogo=r.LandingPageLogo,i.description=r.Description,window.sessionStorage.setItem(Ce,JSON.stringify(i)),this._createLogoMarkup(i)})}_createLogoMarkup(t){this.$imageElement=$("<img />").attr("src",t.logoImage).on("error",r=>this.$imageElement.css("display","none")).appendTo(this.$container),this.$titleContainer=$("<span />").addClass("title-container").appendTo(this.$container),this.$titleContainer.append($("<div />").addClass("business-name").text(t.businessName)),this.$titleContainer.append($("<div />").addClass("app-name").text(t.applicationName.toUpperCase()))}};var Le=class{constructor(t){this.onLayoutBreakpointChangedListener=this.onLayoutBreakpointChanged.bind(this);this.desktopContainer=t.desktopContainer,this.mobileContainer=t.mobileContainer,this.collapseBreakpoint=t.collapseBreakpoint||Z.md,this.onSwitch=t.onSwitch,this._value=t.startValue!==void 0?t.startValue:!0,this.windowResizeListener=new he(void 0,this.onLayoutBreakpointChangedListener)}get value(){return this._value}get container(){return this.isMobileView?this.mobileContainer:this.desktopContainer}get isMobileView(){return this.windowResizeListener.currentLayoutBreakpoint.maxWidth<this.collapseBreakpoint.maxWidth}setVisible(t){var r;(r=this.menuSwitcher)==null||r.option("visible",t)}render(){this.renderSwitch()}destroy(){var r;let t=this.menuSwitcher.element();(r=this.menuSwitcher)==null||r.dispose(),t==null||t.remove()}setValue(t){this.menuSwitcher.option("value",t)}handleValueChanged(t){this.onValueChanged=t}renderSwitch(){this.menuSwitcher=$("<div>").dxSwitch({switchedOffText:"Personal",switchedOnText:"Global",value:this.value,width:"100px",onValueChanged:({value:t})=>{this._value=t,this.onSwitch&&this.onSwitch(this.value),this.onValueChanged&&this.onValueChanged(t)}}).dxSwitch("instance"),this.container.appendChild(this.menuSwitcher.element()[0])}switchView(){this.destroy(),this.render()}onLayoutBreakpointChanged(t){this.switchView()}};var Ct=class{constructor(t){this.$container=t.$container,this.getMenuDataSource=t.getMenuDataSource,this.getIsGlobalMenuShown=t.getIsGlobalMenuShown,this.onDimensionsChanged=t.onDimensionsChanged,this.onMenuItemOpened=t.onMenuItemOpened,this.onMenuItemClick=t.onMenuItemClick}setVisible(t){var r;(r=this.searchDropDown)==null||r.option("visible",t),this.onDimensionsChanged&&this.onDimensionsChanged()}setSearchText(t){var r;(r=this.searchDropDown)==null||r.option("value",t)}reloadMenuItems(){var t;(t=this.searchResultsTreeList)==null||t.option("dataSource",this.getDataSourceForSearch(this.getMenuDataSource()))}render(){let t=document.createElement("form");t.classList.add("form-inline");let r=$("<div />").dxDropDownBox({placeholder:"Search",visible:!1,showDropDownButton:!1,applyValueMode:"instantly",acceptCustomValue:!0,openOnFieldClick:!1,mode:"search",elementAttr:{type:"search","aria-label":"Search"},contentTemplate:(i,n)=>{n.addClass("header-search-results-tree-list");let s=$("<div>").dxTreeList({dataSource:this.getDataSourceForSearch(this.getMenuDataSource()),hoverStateEnabled:!0,focusedRowEnabled:!0,editing:{allowAdding:!1,allowUpdating:!1,allowDeleting:!1},noDataText:"No results found",dataStructure:"tree",keyExpr:"Id",itemsExpr:"Items",filterMode:"fullBranch",showColumnHeaders:!1,columns:[{dataField:"Name",dataType:"string"}],onCellClick:({data:l})=>{this.navigateToMenuItem(l)},onKeyDown:l=>{let g=l.event,p=this.searchResultsTreeList.option("focusedRowKey");if(p!=null)switch(g.key){case"Enter":let h=this.searchResultsTreeList.getNodeByKey(p).data;this.navigateToMenuItem(h);break;case"ArrowRight":case" ":this.searchResultsTreeList.expandRow(p);break;case"ArrowLeft":this.searchResultsTreeList.collapseRow(p);break;case"Escape":setTimeout(()=>this.searchDropDown.focus());break}}});return this.searchResultsTreeList=s.dxTreeList("instance"),s},dropDownOptions:{position:{of:".search-dropdown",my:"top",at:"bottom",offset:{x:149,y:4}},width:518,animation:{show:{duration:0},hide:{duration:0}},hideOnOutsideClick:!1,onShown:i=>{this.searchDropDown.focus()}},onFocusIn:i=>{i.component.element().addClass("focused"),this.onDimensionsChanged&&this.onDimensionsChanged(),this.checkSearchResutPopupVisibility(i.component.element().find("input.dx-texteditor-input").val())},onFocusOut:i=>{i.component.element().find("input.dx-texteditor-input").val()||(i.component.element().removeClass("focused"),this.onDimensionsChanged&&this.onDimensionsChanged())},onKeyUp:i=>{setTimeout(()=>{let n=i.event,s=i.component.element().find("input.dx-texteditor-input").val();this.checkSearchResutPopupVisibility(s),this.searchResultsTreeList.searchByText(s),["Tab","Enter","ArrowDown","ArrowUp"].some(g=>g===n.key)&&this.searchResultsTreeList.focus(this.searchResultsTreeList.getCellElement(0,"Name"))})},onKeyDown:i=>{i.event.key==="Escape"&&this.closeSearchDropDown()},onValueChanged:i=>{this.checkSearchResutPopupVisibility(i.value)}}).addClass(["form-control","mr-sm-2","search-dropdown"]);this.searchDropDown=r.dxDropDownBox("instance"),t.appendChild(r[0]),this.$container.append(t)}navigateToMenuItem(t){var i;let r=ve(t);if(r){this.closeSearchDropDown();let n={item:t,originalEvent:null,cancel:!1};if((i=this.onMenuItemClick)==null||i.call(this,n),n.cancel)return;this.onMenuItemOpened&&this.onMenuItemOpened({menuItem:t}),window.location.href=r}}closeSearchDropDown(){var t,r,i;this.searchResultsTreeList.option("focusedRowKey",void 0),(t=this.searchDropDown)==null||t.option("value",""),(r=this.searchDropDown)==null||r.focus(),(i=this.searchDropDown)==null||i.blur()}checkSearchResutPopupVisibility(t){var r,i;t?(r=this.searchDropDown)==null||r.open():(i=this.searchDropDown)==null||i.close()}getDataSourceForSearch(t){if(!t)return;let r=i=>{let n=(s,l)=>{l.Items&&l.Items.length&&(l.Items=l.Items.reduce(n,[]));let g=l.Visible===void 0||l.Visible===null||l.Visible===!0,p=l.Disabled===!0;return g&&!p&&s.push(O(A({},l),{isGlobal:i})),s};return n};if(t.personalItems&&t.personalItems.length){let i={Name:"Global Menu",Id:-1,isGlobal:!0,Type:2,Items:t.gloabalItems.reduce(r(!0),[])},n={Name:"Personal Menu",Id:-2,isGlobal:!1,Type:2,Items:t.personalItems.reduce(r(!1),[])};return this.getIsGlobalMenuShown()?[i,n]:[n,i]}else return t.gloabalItems.reduce(r(!0),[])}};var vo={};ie(vo,{EventEmitter:()=>z,createGridExportFunction:()=>_t,getGeneralUserFriendlyErrorMessage:()=>St,imageToBase64:()=>ur,isJsonString:()=>ae});var z=class{constructor(){this.eventListeners=[]}on(t,r){return this.eventListeners[t]||(this.eventListeners[t]=[]),this.eventListeners[t].push(r),r}once(t,r){this.on(t,i=>{r(i),this.off(t,r)})}emit(t,r=null){let i=this.eventListeners[t];if(i)for(let n of i)n&&n.call(this,r)}off(t,r){let i=this.eventListeners[t];if(i){let n=[];for(let s of i)s!==r&&n.push(s);this.eventListeners[t]=n}}addHandler(t,r,i){let n=()=>{r(i(),()=>this.off(t,n))};this.on(t,n)}};var pr=ft(yo());function _t(o){return t=>{let r=new window.ExcelJS.Workbook,i=r.addWorksheet(o);DevExpress.excelExporter.exportDataGrid({worksheet:i,component:t.component,customizeCell:n=>{let s=n.excelCell;s.font={name:"Arial",size:12},s.alignment={horizontal:"left"}}}).then(function(){r.xlsx.writeBuffer().then(function(n){(0,pr.default)(new Blob([n],{type:"application/octet-stream"}),`${o}.xlsx`)})}),t.cancel=!0}}var ur=o=>new Promise((t,r)=>{let i=new FileReader;i.readAsDataURL(o),i.onload=()=>{t(i.result)},i.onerror=r});var ae=o=>{if(!o)return!1;try{JSON.parse(o)}catch{return!1}return!0};var Di="iszolea-ui|header-data-cache",cr="iszolea-ui|show-global-menu",So=o=>`${Di}${o?`|${o}`:""}`,it=class extends z{constructor(t){super();this.onNaviagtionMenuItemClickHandler=this.onNavigationMenuItemClick.bind(this);this.onNavigationMenuItemOpenedHandler=this.onNavigationMenuItemOpened.bind(this);this.onUserMenuItemClickHandler=this.onUserMenuItemClick.bind(this);this.elements={};var r,i,n,s,l;this.$el=t.$el,this.menuSettings=t.menuSettings,this.logoSettings=t.logoSettings,this.theme=t.theme||"iszolea",this.displaySearch=t.displaySearch,this.collapseBreakpoint=((r=t.menuSettings)==null?void 0:r.collapseBreakpoint)||Z.md,this.$partialViewPlaceHolder=(i=t.menuSettings)==null?void 0:i.partialViewPlaceHolder,this.updateUrlAfterPartialLoading=(n=t.menuSettings)==null?void 0:n.updateUrlAfterPartialLoading,this.onPartialViewLoaded=(s=t.menuSettings)==null?void 0:s.onPartialViewLoaded,this.beforePartialViewLoading=(l=t.menuSettings)==null?void 0:l.beforePartialViewLoading,this.loadPanel=this.createLoadPanel(),t.immediateRender===!1&&console.warn("The 'immediateRender === false' option isn't supported at the moment."),DevExpress.ui.dxOverlay.baseZIndex(1700),this.render(),this.init().then(()=>{var g;return(g=t==null?void 0:t.onInit)==null?void 0:g.call(t)}),this.subscribeOnHistoryPopState()}async updateData(){!this.menuSettings||(this.clearAppMenuModelCache(),this.data=await this.loadData(),!!this.elements.root&&this.rerenderMenus())}render(){this.renderRoot(),this.renderBrand(),this.renderContentToggler(),this.renderContent(),this.renderLoadBar(),this.updateContentAndTogglerVisible()}subscribeOnHistoryPopState(){this.$partialViewPlaceHolder&&$(window).bind("popstate",t=>{let i=t.originalEvent.state;i&&i.isLoadedByAjax?(this.loadPageViaAjaxCore(i.url),this.updateMenuSwitcherState(i.isMenuSwitcherGlobal),this.navigationMenu.updateActiveItemsState()):location.reload()})}createLoadPanel(){return $("<div />").dxLoadPanel({shadingColor:"rgba(0,0,0,0.4)",visible:!1,showIndicator:!0,showPane:!0,shading:!0,hideOnOutsideClick:!1}).appendTo(this.$el).dxLoadPanel("instance")}renderRoot(){this.elements.root=this.$el[0],this.elements.root.classList.add("header",this.theme,"navbar","navbar-dark",`navbar-expand-${this.collapseBreakpoint.name}`)}renderBrand(){if(this.logo||!this.logoSettings)return;if(!this.elements.root)return H("root");let t=document.createElement("a");t.classList.add("header__brand","navbar-brand"),t.href="/",this.elements.root.appendChild(t),this.elements.logoContainer=t,this.logo=new ho($(this.elements.logoContainer),this.logoSettings),this.logo.initWidget()}renderSearch(){if(!!this.displaySearch){if(!this.elements.contentContainer)return H("contentContainer");this.search=new Ct({$container:$(this.elements.contentContainer),getMenuDataSource:()=>this.getSearchDataSource(this.data),getIsGlobalMenuShown:()=>this.getIsGlobalMenuShown(),onDimensionsChanged:()=>{var t;return(t=this.navigationMenu)==null?void 0:t.applyAdaptivityCollapsing()},onMenuItemClick:this.onNaviagtionMenuItemClickHandler,onMenuItemOpened:this.onNavigationMenuItemOpenedHandler}),this.search.render()}}getIsGlobalMenuShown(){var t;return this.isShowGlobalMenu()||!((t=this.data)==null?void 0:t.AddGlobalPersonalSwitcher)}onNavigationMenuItemOpened(t){this.updateMenuSwitcherState(t.menuItem.isGlobal)}updateMenuSwitcherState(t){!this.menuSwitcher||this.menuSwitcher.value!==t&&this.menuSwitcher.setValue(t)}renderContentToggler(){if(!this.elements.root)return H("root");this.elements.toggleButton=document.createElement("button"),this.elements.toggleButton.classList.add("navbar-toggler"),this.elements.toggleButton.setAttribute("type","button"),this.elements.toggleButton.setAttribute("data-toggle","collapse"),this.elements.toggleButton.setAttribute("data-target",".header__content"),this.elements.toggleButton.onclick=()=>{var r;(r=this.search)==null||r.setSearchText("")};let t=document.createElement("span");t.classList.add("navbar-toggler-icon"),this.elements.toggleButtonContainer=document.createElement("div"),this.elements.toggleButtonContainer.classList.add("header__toggle-button-container"),this.elements.toggleButton.appendChild(t),this.elements.toggleButtonContainer.appendChild(this.elements.toggleButton),this.elements.root.appendChild(this.elements.toggleButtonContainer)}renderContent(){if(!this.elements.root)return H("root");this.elements.contentContainer=document.createElement("div"),this.elements.contentContainer.classList.add("collapse","navbar-collapse","header__content"),this.elements.root.appendChild(this.elements.contentContainer),this.renderSearch(),this.renderNavigationMenu([]),this.renderMenuSwitcher(),this.renderUserMenu([])}renderNavigationMenu(t){if(!this.elements.contentContainer)return H("contentContainer");let r=this.getIsGlobalMenuShown();this.navigationMenu?this.navigationMenu.updateData(t,r):(this.navigationMenu=new Ne(this.elements.contentContainer,t,r,this.collapseBreakpoint,this.onNaviagtionMenuItemClickHandler),this.navigationMenu.render())}onUserMenuItemClick(t){var i,n;if($(this.elements.contentContainer).removeClass("show"),(n=(i=this.menuSettings).onUserMenuClick)==null||n.call(i,t),t.cancel||this.isKeyPressed(t.originalEvent))return;let r=t.item.Url;t.item.AlwaysReloadPage?window.location.href=r:t.cancel=this.tryDoPartialPageLoading(r)}onNavigationMenuItemClick(t){var i,n;if(t.item.Items.length||$(".show",this.elements.contentContainer).removeClass("show"),(n=(i=this.menuSettings).onNavigationMenuItemClick)==null||n.call(i,t),t.cancel||this.isKeyPressed(t.originalEvent))return;this.updateMenuSwitcherState(t.item.isGlobal);let r=ve(t.item);t.cancel=this.tryDoPartialPageLoading(r)}isKeyPressed(t){return t&&(t.altKey||t.ctrlKey||t.shiftKey)}tryDoPartialPageLoading(t){var r;if(this.$partialViewPlaceHolder&&t&&this.checkIsLocalUrl(t)){if(this.updateUrlAfterPartialLoading){let i={isLoadedByAjax:!0,isMenuSwitcherGlobal:!!((r=this.menuSwitcher)==null?void 0:r.value),url:t};window.history.pushState(i,null,t)}return this.loadPageViaAjaxCore(t),this.navigationMenu.updateActiveItemsState(),!0}return!1}checkIsLocalUrl(t){return!it.GLOBAL_URL_REGEX.test(t)}checkIsPartialPageContent(t){return t&&!it.DOCTYPE_MARKER_REGEX.test(t)}loadPageViaAjaxCore(t){var n;window.isIsozServerException=!1,this.loadPanel.show();let r=new URL(window.location.origin+t);r.searchParams.append("isozPartialLoading","true");let i=r.toString();(n=this.beforePartialViewLoading)==null||n.call(this),$.ajax(i,{dataType:"html"}).always((s,l)=>{var g;l!=="success"||!this.checkIsPartialPageContent(s)?window.location.href=t:(this.$partialViewPlaceHolder.html(s),(g=this.onPartialViewLoaded)==null||g.call(this),this.loadPanel.hide())})}renderUserMenu(t){var r;if(!!((r=this.menuSettings)==null?void 0:r.userName)){if(!this.elements.contentContainer)return H("contentContainer");if(this.userMenu)this.userMenu.updateItems(t);else{let i=document.createElement("div");i.classList.add("dropdown-divider"),this.elements.contentContainer.appendChild(i),this.userMenu=new De({container:this.elements.contentContainer,userName:this.menuSettings.userName,userAvatar:this.menuSettings.userAvatar,items:t,collapseBreakpoint:this.collapseBreakpoint,onItemClick:this.onUserMenuItemClickHandler,getDisplayedUserInfo:this.menuSettings.getDisplayedUserInfo}),this.userMenu.render()}}}renderMenuSwitcher(){var t,r,i,n;if((t=this.data)==null?void 0:t.AddGlobalPersonalSwitcher){if(this.menuSwitcher)return}else{this.menuSwitcher&&(this.menuSwitcher.destroy(),(r=this.elements.menuSwitcherDesktopContainer)==null||r.remove(),(i=this.elements.menuSwitcherMobileContainer)==null||i.remove(),this.menuSwitcher=void 0,this.elements.menuSwitcherDesktopContainer=void 0,this.elements.menuSwitcherMobileContainer=void 0);return}if(!this.elements.contentContainer)return H("contentContainer");if(!this.elements.toggleButtonContainer)return H("toggleButtonContainer");this.elements.menuSwitcherDesktopContainer=document.createElement("div"),this.elements.menuSwitcherDesktopContainer.classList.add("menu-switcher"),this.elements.menuSwitcherMobileContainer=document.createElement("div"),this.elements.menuSwitcherMobileContainer.classList.add("menu-switcher"),this.menuSwitcher=new Le({desktopContainer:this.elements.menuSwitcherDesktopContainer,mobileContainer:this.elements.menuSwitcherMobileContainer,collapseBreakpoint:this.collapseBreakpoint,startValue:this.isShowGlobalMenu(),onSwitch:s=>{var g,p;window.localStorage.setItem(cr,JSON.stringify(s));let l=this.getNavigationItems(this.data);(g=this.search)==null||g.setSearchText(""),(p=this.search)==null||p.reloadMenuItems(),this.renderNavigationMenu(l||[]),this.updateContentAndTogglerVisible()}}),this.menuSwitcher.render(),this.emit(it.MENU_SWITCHER_INITIALIZED_EVENT),this.elements.contentContainer.insertBefore(this.elements.menuSwitcherDesktopContainer,(n=this.userMenu)==null?void 0:n.root),this.elements.toggleButtonContainer.insertBefore(this.elements.menuSwitcherMobileContainer,this.elements.toggleButton)}renderLoadBar(){this.$loadBar=$("<div />").addClass("load-bar").hide().appendTo(this.$el);let t=$("<div />").addClass("load").appendTo(this.$loadBar);$("<div />").addClass("bar").appendTo(t);function r(i){$(i).animate({left:$(".load").width()},2e3,()=>{$(i).css("left",`${-$(i).width()}px`),r(i)})}r(".bar")}rerenderMenus(){let t=this.getNavigationItems(this.data),r=this.getUserItems(this.data);t&&this.renderNavigationMenu(t),r&&this.renderUserMenu(r),this.renderMenuSwitcher(),this.updateContentAndTogglerVisible()}updateContentAndTogglerVisible(){var n,s;if(!this.elements.contentContainer&&!this.elements.toggleButton)return;let t=this.getNavigationItems(this.data),r=this.getUserItems(this.data),i=t&&t.length>0||((n=this.menuSettings)==null?void 0:n.userName)||r&&r.length>0;this.elements.toggleButton.classList.toggle("d-none",!i),this.elements.contentContainer.classList.toggle("d-none",!i),(s=this.search)==null||s.setVisible(!!i)}async init(){!this.menuSettings||(this.data=await this.loadData(),!!this.elements.root&&this.rerenderMenus())}async loadData(){var r,i,n,s,l;if(!this.menuSettings)throw new Error("The header doesn't have menu settings");if(typeof this.menuSettings.data!="string")return this.menuSettings.data;let t=this.getCachedAppMenuModel();if(t)return t;try{return(r=this.search)==null||r.setVisible(!1),(i=this.$loadBar)==null||i.show(),t=await x(this.menuSettings.data),this.cacheAppMenuModel(t),(n=this.search)==null||n.reloadMenuItems(),t}finally{(s=this.search)==null||s.setVisible(!0),(l=this.$loadBar)==null||l.hide()}}getNavigationItems(t){return t?this.isShowGlobalMenu()||!t.AddGlobalPersonalSwitcher?t.NavigationItems:t.PersonalNavigationItems:void 0}getSearchDataSource(t){if(!!t)return{gloabalItems:t.NavigationItems,personalItems:t.AddGlobalPersonalSwitcher?t.PersonalNavigationItems:void 0}}getUserItems(t){if(!!t)return t.UserItems}getCachedAppMenuModel(){if(!this.menuSettings)return null;let t=window.sessionStorage.getItem(So(this.menuSettings.userName));return t===null?t:JSON.parse(t)}cacheAppMenuModel(t){return this.menuSettings?(window.sessionStorage.setItem(So(this.menuSettings.userName),JSON.stringify(t)),!0):!1}clearAppMenuModelCache(){return this.menuSettings?(window.sessionStorage.removeItem(So(this.menuSettings.userName)),!0):!1}isShowGlobalMenu(){let t=window.localStorage.getItem(cr),r=t===null?t:JSON.parse(t);return r===null||r}},_e=it;_e.MENU_SWITCHER_INITIALIZED_EVENT="menu-switcher-initialized-event",_e.GLOBAL_URL_REGEX=new RegExp("^(?:[a-z]+:)?//","i"),_e.DOCTYPE_MARKER_REGEX=new RegExp("!DOCTYPE html>","i");var Ci=["default","string","number","date","boolean","object","datetime"],Be=Ci;var Fe=(i=>(i[i.None=0]="None",i[i.AddNewRows=1]="AddNewRows",i[i.ReplaceAllRows=2]="ReplaceAllRows",i))(Fe||{});var je=(g=>(g.Default="default",g.String="string",g.Number="number",g.Date="date",g.Boolean="boolean",g.Object="object",g.Datetime="datetime",g))(je||{});var Se=[];function _i(o,t){return Math.floor(Math.random()*(t-o+1))+o}function xt(o,t,r=5,i=2){let n=t.sort((s,l)=>.5-Math.random());o.addClass("iszolea-background-image-viewer").css({transition:`background-image ${i}s ease-in-out 0s`}),n.forEach((s,l)=>{let g=new Image;g.addEventListener("load",()=>{Se.push(s),Se.length===1&&Ai(o,r)}),window.setTimeout(()=>{g.src=s},l*100)})}function xi(o){if(Se.length===1)return 0;if(Se.length===2)return o===0?1:0;let t=_i(0,Se.length-1);return t===o?t===Se.length-1?0:t+1:t}function Ai(o,t){let r=0;hr(o,r),window.setInterval(()=>{Se.length!==1&&(r=xi(r),hr(o,r))},t*1e3)}function hr(o,t){o.css("background-image",`url("${Se[t]}")`)}var bo=(i=>(i[i.Success=0]="Success",i[i.Warning=1]="Warning",i[i.Error=2]="Error",i))(bo||{}),Ri={year:"local"},Ve=class{constructor(t){this.indicatorClassByStatus=new Map([[0,"footer__indicator_type_success"],[1,"footer__indicator_type_warning"],[2,"footer__indicator_type_error"]]);let r=A(A({},t),Ri);this.$root=r.$root,this.name=r.name!==!1?r.name:void 0,this.licence=r.licence!==!1?r.licence:void 0,this.year=Ve.getCurrentYear(r.year),this.version=t.version||void 0,this.showName=r.name!==!1,this.showLicence=r.licence!==!1,this.showYear=r.year!==!1,this.showConnectedTo=!!r.serverName&&!!r.database,this.indicatorsOptions=t.indicators||[],this.indicatorsByName=new Map,this.connectedTo=this.showConnectedTo?`${r.serverName} - ${r.database}`:void 0}static getCurrentYear(t){return t==="local"||t===!1?new Date().getFullYear():t}init(){this.$root.addClass("footer"),this.renderIndicators(),this.renderCopyright(),this.showYear&&this.renderYear(),this.showName&&this.renderName(),this.showConnectedTo&&this.renderConnectedTo(),this.showLicence&&this.renderLicence()}setIndicatorValue(t,r){let i=this.indicatorsByName.get(t);i&&this.setIndicatorValueCore(i,r)}renderIndicators(){var t;(t=this.indicatorsOptions)==null||t.forEach(r=>{r.text&&$("<span>").addClass("footer__indicator-text").html(`${r.text}:`).appendTo(this.$root);let i=$("<span>").addClass("footer__indicator").appendTo(this.$root);this.setIndicatorValueCore(i,r.value),this.indicatorsByName.set(r.name,i),r.getValue&&r.getValueIntervalMs&&setInterval(async()=>{let n=await r.getValue();this.setIndicatorValueCore(i,n)},r.getValueIntervalMs)})}setIndicatorValueCore(t,r){t.attr("title",r.title),t.removeClass([...this.indicatorClassByStatus.values()]),t.addClass(this.indicatorClassByStatus.get(r.status))}renderCopyright(){$("<span>").addClass("footer__copyright").html("©").appendTo(this.$root)}renderName(){this.name&&$("<span>").addClass("footer__item").addClass("footer__app-name").text(this.name+(this.version?`: ${this.version}`:"")).appendTo(this.$root)}renderConnectedTo(){this.name&&$("<span>").addClass("footer__item").addClass("footer__connected-to").text(`Connected to: ${this.connectedTo}.`).appendTo(this.$root)}renderYear(){$("<span>").addClass("footer__item").addClass("footer__current-year").text(this.year).appendTo(this.$root)}renderLicence(){this.licence&&$("<span>").addClass("footer__item").addClass("footer__licence-info").append($("<span>").addClass("footer__licence-owner").text(`${this.getLicenceOwnerDisplayText(this.licence)}. `)).append($("<span>").addClass("footer__licence-date").text(this.getLicenceExpirationDateDisplayText(this.licence))).appendTo(this.$root)}getLicenceOwnerDisplayText(t){return`Licenced to: ${t.Owner}`}getLicenceExpirationDateDisplayText(t){return`Licence Expiry: ${(typeof t.ExpirationDate=="string"?new Date(t.ExpirationDate):t.ExpirationDate).toLocaleDateString()}`}};var At=null,mr=[];window.addEventListener("resize",()=>{At&&window.clearTimeout(At),At=window.setTimeout(()=>{mr.forEach(o=>o()),At=null},100)});function Rt(o){mr.push(o)}var nt={main:".main",header:".main .header",content:".content-area",panel:".panel",footer:"footer"},Eo=null,Mt=null,Ot=null;function fr(o){$(nt.content).height(Mt),o.option("height",Ot)}function Mi(o,t=!1,r=!1){let i=$(nt.main),n=$(nt.header),s=$(nt.content),l=$(nt.footer),g=s.outerHeight()-s.height();Mt=i.height()-n.height()-l.outerHeight()-g,Eo=$(window).height();let p=s.children(),h=0;if(!t){let S=o.element();p.each((E,y)=>{let T=$(y);T.is(S)||T.has(S[0]).length||(h+=T.is(":visible")&&T.css("position")!=="absolute"?T.outerHeight(!0):0)})}Ot=Mt-h,r&&(Ot+=o.element().outerHeight()),fr(o)}function Oi(o){let t=$(window).height(),r=t-Eo;Mt+=r,Ot+=r,Eo=t,fr(o)}function le(o,t=!1,r=!1){Mi(o,t,r),Rt(()=>Oi(o))}var Ui="isoz-icon-disabled",q={lg:"iszolea-lg",md:"iszolea-md",sm:"iszolea-sm"},Q=class{static setElementMiddleSize(t){t.addClass(q.md)}static setElementSmallSize(t){t.addClass(q.sm)}static setWidgetMiddleSize(t){Q.setWidgetSize(t,q.md)}static setWidgetSmallSize(t){Q.setWidgetSize(t,q.sm)}static setToolbarWidgetSmallSize(t){t&&Q.setToolbarWidgetSize(t,q.sm)}static setToolbarWidgetMediumSize(t){t&&Q.setToolbarWidgetSize(t,q.md)}static getIconClass(t,r,i=16){let n=`isoz isoz-icon-${t}-${i}`;return r?`${n} ${Ui}`:n}static setWidgetSize(t,r){t&&t.option("elementAttr",{class:r})}static setToolbarWidgetSize(t,r){t.options||(t.options={}),t.options.elementAttr||(t.options.elementAttr={}),t.options.elementAttr.class?t.options.elementAttr.class+=` ${r}`:t.options.elementAttr.class=r}};var Pi={title:"isoz-title"},st=class{static getToolbarTitleTemplateItem(t,r){return{location:"before",template:()=>{let i=$(`<span class="${Pi.title}">${t}</span>`);return r&&i.append($("<i />").addClass("fas").addClass("fa-info-circle").addClass("report-details-link").attr("title","Report details")),i}}}};var yr={title:"isoz-title",header:"isoz-toolbar-header",dropDownButton:"dx-dropdownmenu-button"};function vr(o,t={title:"",description:"",options:{}}){let{title:r="",description:i="",options:n={}}=t,{items:s=[],elementAttr:l={}}=n;s.forEach(p=>{let h={class:q.md};if(p.options){let{editorOptions:S}=p.options;S||(S={}),S.elementAttr=h,p.options.elementAttr=h,p.options.editorOtions=S}});let g=p=>{p.element.find(`.${yr.dropDownButton}`).addClass(q.md),(n==null?void 0:n.onContentReady)&&n.onContentReady(p)};return $(`${o}`).dxToolbar(O(A({},n),{items:[st.getToolbarTitleTemplateItem(r,i),...s],onContentReady:g,elementAttr:O(A({},l),{class:yr.header})})).dxToolbar("instance")}var Ni={panel:".panel-body"};function Sr(o){let t=o.element(),r=o.element().parents(Ni.panel).eq(0),i=r.position().top,n=r.height(),s=r.outerHeight()-r.height(),l=t.position().top,g=n-(l-i)+s/2;o.option("height",g)}function To(o){Sr(o),Rt(()=>Sr(o))}function br(o,t,r=!1){let i=Io(o,t);return t.height||(r?To(i):le(i)),i}function Io(o,t){let r=o.dxDataGrid(t).dxDataGrid("instance");return r.element().addClass(oe.dxDataGrid),r}function Er(o,t,r=!1){let i=(typeof o=="string"?$(o):o).dxTreeList(t).dxTreeList("instance");return i.element().addClass(oe.dxDataGrid),t.height||(r?To(i):le(i)),i}var Tr=o=>o.slice(2).toLowerCase(),Li=o=>{let t=Tr(o);return{searchPanel:`.dx-${t}-search-panel`,toolbarEditButton:`.dx-${t}-toolbar-button.dx-edit-button`,toolbarExportButton:`.dx-${t}-export-button .dx-button`,selectCheckBox:".dx-select-checkbox"}};function Ir(o){let t=k.isLegacyRender?Bi(o):Dr(o);return(o.summaryColumn||o.showSummaryInColumn)&&(t.summary={totalItems:[{column:o.summaryColumn||o.showSummaryInColumn,showInColumn:o.showSummaryInColumn||o.summaryColumn,summaryType:"count"}]}),t.export={enabled:!!o.exportFileName,allowExportSelectedData:!0},k.isLegacyRender||(t.groupPanel={visible:!0}),t}function wr(o){let t=Dr(o);return t.selection={mode:"none"},t}function Dr(o){return{allowColumnResizing:!0,cacheEnabled:!0,columnAutoWidth:!0,filterRow:{visible:!0,applyFilter:"onClick"},headerFilter:{visible:!0},hoverStateEnabled:!0,paging:{pageSize:80},pager:{visible:!1},remoteOperations:!0,scrolling:{mode:"virtual",rowRenderingMode:"virtual"},searchPanel:{visible:!0,width:240,placeholder:"Search..."},showRowLines:!0,showBorders:!0,selection:{mode:"multiple"},wordWrapEnabled:!0}}function Bi(o){return{allowColumnResizing:!0,remoteOperations:!0,columnAutoWidth:!0,showBorders:!0,filterRow:{visible:!0,applyFilter:"onClick"},selection:{mode:"multiple"},paging:{pageSize:50},searchPanel:{visible:!0},headerFilter:{visible:!0},scrolling:{mode:"virtual"}}}function Fi(o,t){let r=(i,n)=>i.find(s=>s.name===n);if(o==null?void 0:o.items){let{items:i}=o;if(t){let g=r(i,t);g&&(g.options.type="default")}let n=r(i,"saveButton");n&&(n.showText="always",n.options.text="Save");let s=r(i,"revertButton");s&&(s.showText="always",s.options.text="Discard");let l=r(i,"refresh");l&&(l.showText="always",l.options.text="Refresh",l.options.hint="Reload Data")}}function ji(o){var s,l,g;let t=o.option("summary.totalItems"),r=(s=t==null?void 0:t.filter(p=>p.summaryType==="count")[0])==null?void 0:s.column,i=r&&o.getVisibleColumns().findIndex(p=>p.dataField===r);if(!i){let p=o.option("selection");i=p&&p.mode!=="none"?o.getVisibleColumns().findIndex(S=>!!S.dataField):0}let n=(l=o.getVisibleColumns()[i])==null?void 0:l.dataField;n&&r!==n&&o.option("summary",{totalItems:[{column:(g=o.getVisibleColumns()[i])==null?void 0:g.dataField,summaryType:"count"}]})}function Ut(o,t){let r=Li(o),i=!1;return{onCellPrepared:n=>{var s,l;k.isLegacyRender||n.rowType==="header"&&n.cellElement.css("text-align","center"),((s=t.options)==null?void 0:s.onCellPrepared)&&((l=t.options)==null||l.onCellPrepared(n))},onContentReady:n=>{var l;let s=n.component;s.beginUpdate(),t.disableSummaryColumnDetection||ji(s),i||(i=!0,setTimeout(()=>{let g=s.getScrollable();g&&g.scrollTo({top:0})}));for(let g=0;g<s.columnCount();g++){let p=s.columnOption(g,"dataType");(t.setDefaultColumnWidth||t.setDefaultColumnWidth===void 0)&&(s.columnOption(g,"width")||(p==="boolean"&&(s.columnOption(g,"width","45px"),s.columnOption(g,"editorOptions",{dropDownOptions:{width:80}})),p==="datetime"&&s.columnOption(g,"width","135px"),p==="date"&&s.columnOption(g,"width","140px"))),(p==="datetime"||p==="date")&&s.columnOption(g,"alignment","right"),p==="date"&&s.columnOption(g,"format","dd MMM yyyy"),p==="datetime"&&s.columnOption(g,"format","HH:mm, dd MMM yyyy")}((l=t.options)==null?void 0:l.onContentReady)&&t.options.onContentReady(n),s.endUpdate()},onToolbarPreparing:n=>{var y;let{toolbarOptions:s={}}=n,l=n.component,{items:g=[]}=s;g.forEach(T=>{T.name==="applyFilterButton"&&T.options&&(T.options.visible=!1)}),k.isLegacyRender?t.title&&n.toolbarOptions.items.unshift({location:"before",template(){let T=$("<h2 />").addClass("grid-header").text(t.title);return t.headerDescription&&T.append($("<i />").addClass("fas").addClass("fa-info-circle").addClass("report-details-link").attr("title","Click to see further details")),T}}):(t.title&&g.unshift(st.getToolbarTitleTemplateItem(t.title,t.headerDescription)),g.filter(T=>{if(T.widget==="dxButton"){let I=t.buttonsSize==="sm"?16:24;switch(T.name){case"addRowButton":T.options.icon=Q.getIconClass("plus",!1,I);break;case"saveButton":T.options.icon=Q.getIconClass("save",!1,I);break;case"revertButton":T.options.icon=Q.getIconClass("close",!1,I);break;default:T.options.icon=void 0;break}T.options.elementAttr||(T.options.elementAttr={}),T.options.elementAttr.class=t.buttonsSize==="sm"?q.sm:q.md,T.showText="always"}}),Fi(s,t.toolbarAccentButtonName),t.toolbarItems&&g.push(...t.toolbarItems),s.elementAttr={class:"isoz-toolbar-header"});let p=n.toolbarOptions.items.findIndex(T=>T.name==="saveButton"),h=n.toolbarOptions.items.findIndex(T=>T.name==="searchPanel"),S=-1;p>-1?S=p:h>-1?S=h:S=n.toolbarOptions.items.length,n.toolbarOptions.items.splice(S,0,{location:"after",widget:"dxButton",name:"refresh",options:{icon:"refresh",height:k.isLegacyRender?30:void 0,elementAttr:{class:`dx-datagrid-toolbar-button ${t.buttonsSize==="sm"?q.sm:q.md}`},stylingMode:k.isLegacyRender?"text":"contained",onClick:()=>l==null?void 0:l.refresh(),onContentReady:k.isLegacyRender?T=>{T.element.find(".dx-button-content").css({paddingTop:6,paddingBottom:6})}:void 0}}),((y=t.options)==null?void 0:y.onToolbarPreparing)&&t.options.onToolbarPreparing(n);let E=n.toolbarOptions.items.findIndex(T=>T.name==="exportButton");h=n.toolbarOptions.items.findIndex(T=>T.name==="searchPanel"),k.isLegacyRender||(t.buttonsSize==="sm"?(Q.setToolbarWidgetSmallSize(n.toolbarOptions.items[E]),Q.setToolbarWidgetSmallSize(n.toolbarOptions.items[h])):(Q.setToolbarWidgetMediumSize(n.toolbarOptions.items[E]),Q.setToolbarWidgetMediumSize(n.toolbarOptions.items[h])))},onEditorPreparing:n=>{var s;switch(k.isLegacyRender||(n.editorOptions=O(A({},n.editorOptions),{elementAttr:{class:q.md}}),n.editorName==="dxSelectBox"&&(n.editorOptions.dropDownOptions=O(A({},n.editorOptions.dropDownOptions),{onShowing:l=>{let g=Tr(o);l.component._$popupContent.addClass(`isoz-${g}-selectbox-popup`)}})),n.editorName==="dxCheckBox"&&Q.setElementSmallSize(n.editorElement)),n.parentType){case"filterRow":let l=p=>{n.element&&n.element.find(".dx-apply-button").trigger("dxclick")};n.editorOptions.onEnterKey=l,n.editorOptions.onFocusOut=l;break;case"searchPanel":let g=p=>{n.component.searchByText(p.component.option("value"))};n.editorOptions.onValueChanged=()=>{},n.editorOptions.onEnterKey=g,n.editorOptions.onFocusOut=g;break}((s=t.options)==null?void 0:s.onEditorPreparing)&&t.options.onEditorPreparing(n)},onContextMenuPreparing:n=>{var s,l,g;if(!k.isLegacyRender&&n.target==="content"&&!!t.exportFileName&&(n.items||(n.items=[]),n.items.push({text:"Export all data",onItemClick:()=>{n.component.exportToExcel(!1)},icon:"xlsxfile"}),((s=t.options.selection)==null?void 0:s.mode)!=="none")){let p=n.component.getSelectedRowKeys();n.items.push({text:"Export selected rows",onItemClick:()=>n.component.exportToExcel(!0),icon:"exportselected",disabled:!p||!p.length})}((l=t.options)==null?void 0:l.onContextMenuPreparing)&&((g=t.options)==null||g.onContextMenuPreparing(n))},onExporting:n=>{let s=t.options;(s==null?void 0:s.onExporting)?s.onExporting(n):t.exportFileName&&_t(t.exportFileName)(n)}}}function Cr(o){!o.toolbar||!o.toolbar.items||!!o.toolbar.items.find(t=>t==="applyFilterButton"||t.name==="applyFilterButton")||o.toolbar.items.push({name:"applyFilterButton",visible:!1})}function V(o,t,r){let i=Ir(t),n=$.extend(!0,{},i,t.options),s=Ut("dxDataGrid",$.extend(!0,{},t,{options:n}));Cr(n),n=$.extend(!0,{},n,s);let l=t.isFullScreen||t.isFullScreen===void 0?br(o,n,t.inPanelGrid):Io(o,n);return t.asyncSummaryLoad&&wt(l,t.asyncSummaryLoad,r),l}function _r(o,t,r={},i,n){return V($(`#${o}`),{options:t,exportFileName:r.exportFileName,inPanelGrid:r.inPanelGrid,showSummaryInColumn:r.showSummaryInColumn,summaryColumn:r.summaryColumn,headerDescription:n,title:i})}function xr(o,t={}){let r=wr(t),i=$.extend({},r,t.options),n=Ut("dxTreeList",$.extend(!0,{},t,{options:i}));return i=$.extend(!0,{},i,n),Er(o,i,t.inPanelGrid)}var ke=class extends z{constructor(t={}){super();this.ON_UPLOADED="ON_UPLOADED";this.ON_DELETED="ON_DELETED";this.ON_REORDERED="ON_REORDERED";this.settings=t}initMarkup(){return $(`
|
|
15
15
|
<div class="image-manager">
|
|
16
16
|
<div class="image-manager__images">
|
|
17
17
|
<div class="image-manager__items"></div>
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
</div>`);return this.allowPreviewExt.some(g=>r.Id.endsWith(g))&&l.append(i),l.append(n),t||l.append(s),l}}).dxList("instance")}open(t=[],r=!1){this.$content=this.initMarkup(),this.list=this.initList(r),this.uploader=this.initUploader(r),this.dialog=J({title:"Document Manager",height:this.settings.height,width:this.settings.width},this.$content,{text:"Close",onClick:i=>i()},void 0),this.documents=t}close(){var t;(t=this.dialog)==null||t.close()}set documents(t){this.items=t,this.list.option("dataSource",this.items)}get documents(){return this.items}onUploaded(t){this.on(this.ON_UPLOADED,t)}onDeleted(t){this.on(this.ON_DELETED,t)}onOpen(t){this.on(this.ON_OPEN,t)}onDownload(t){this.on(this.ON_DOWNLOAD,t)}};var $e=class extends z{constructor(t={}){super();this.settings=t}initMarkup(){return $(`
|
|
39
39
|
<div class="image-gallery">
|
|
40
40
|
</div>
|
|
41
|
-
`)}initGallery(){return $(this.$content).dxGallery({dataSource:[]}).dxGallery("instance")}open(t=[]){this.$content=this.initMarkup(),this.gallery=this.initGallery(),this.dialog=J({title:"Image Gallery",height:this.settings.height,width:this.settings.width},this.$content,{text:"Close",onClick:r=>r()},void 0),this.images=t}close(){var t;(t=this.dialog)==null||t.close()}set images(t){this.items=t,this.gallery.option("dataSource",this.items.map(r=>({imageAlt:r.Name,imageSrc:r.Url})))}get images(){return this.items}};var Do={};ie(Do,{show:()=>wo});var xr=mt(Cr());function ji(o,t){o.attr("src",t)}function Vi(o){let t=$("<div>").addClass("image-crop-popup__dropzone"),r=$("<div>").addClass("image-crop-popup__crop-container").appendTo(t),i=$("<img />").prependTo(r);ji(i,o);let n=new xr.default(i[0],{startSize:[90,90,"%"]});return{$content:t,cropper:n}}function ki(o,t,r){J({title:"Edit image",showTitle:!0,dragEnabled:!1,resizeEnabled:!1,showCloseButton:!0,hideOnOutsideClick:!1,maxWidth:1024,onInitialized:i=>{i.component&&i.component.option("fullScreen",window.innerWidth<=1024)}},o,{text:"Update",onClick:i=>{let n=t.getValue(),s=$("<canvas>").attr("height",n.height).attr("width",n.width),l=s[0].getContext("2d"),g=o.find("img.croppr-image")[0];l.drawImage(g,n.x,n.y,n.width,n.height,0,0,n.width,n.height);let p=s[0].toDataURL("image/jpeg",.9);r(p),i()}},{text:"Cancel",onClick:i=>i()})}function wo(o,t){let r=Vi(o);ki(r.$content,r.cropper,t)}var Ar=o=>new Promise((t,r)=>{try{let i=new FileReader;i.onload=()=>{let n=i.result;t(typeof n=="string"?n:null)},i.readAsDataURL(o)}catch(i){r(i)}});var _o=10,Co=class{constructor(t,r,i,n){this.accountSettingsData=i,this.currentUserInfo=n,this._$rootElement=t,this.formAction=r}render(){this.renderUploader(this.$rootElement),this.renderAccountSettingsForm(this.$rootElement)}get $rootElement(){if(!this._$rootElement)throw new Error("The root element is undefined");return this._$rootElement}renderUploader(t){this.avatarUploader=$("<div>").addClass("avatar-popup__uploader").dxFileUploader({multiple:!1,uploadMode:"useForm",accept:"image/*",visible:!1,maxFileSize:_o*1e6,onValueChanged:r=>{if(!r.component||!r.value)return;let i=r.value[0],n=r.component.option("maxFileSize")||_o;if(!i||i.size>n){DevExpress.ui.notify(`File size should be less than ${_o} MB. Please select another file`,"error",5e3);return}Ar(i).then(s=>{wo(s,l=>{var g,p;(g=this.accountSettingsForm)==null||g.updateData("Avatar",l),(p=this.accountSettingsForm)==null||p.repaint()})}).catch(s=>DevExpress.ui.notify(s,"error",3e3))}}).appendTo(t).dxFileUploader("instance")}renderAccountSettingsForm(t){var r;this.accountSettingsForm||(this.accountSettingsForm=$("<form />").attr("action",this.formAction).attr("method","post").addClass("account-settings__form").addClass("form-content").appendTo(t).dxForm(this.getFormOptions()).dxForm("instance"),((r=this.accountSettingsData)==null?void 0:r.HasChanges)&&!this.accountSettingsData.ErrorMessage&&setTimeout(()=>Rr.widgets.notify("Changes have been saved",!0),500))}getFormOptions(){return{formData:this.accountSettingsData,minColWidth:200,labelLocation:"top",alignItemLabels:!0,showValidationSummary:!0,items:[{itemType:"group",colCount:16,items:[{colSpan:6,caption:"Profile Picture",itemType:"group",items:[{itemType:"simple",label:{visible:!1},dataField:"Avatar",template:t=>{var s;let r=$("<div>").addClass("account-settings__avatar-view-container"),i=$("<div>").addClass("account-settings__avatar");$("<div>").add(r).add($("<div>").addClass("account-settings__avatar-button").dxButton({width:200,type:"default",icon:"photo",text:"Upload new image",onInitialized:l=>this.avatarUploader&&this.avatarUploader.option("dialogTrigger",l.element)})).appendTo(i);let n=t.editorOptions.value||((s=this.currentUserInfo)==null?void 0:s.UserAvatar);return n?($("<img>").addClass("account-settings__avatar-view").attr("src",n).appendTo(r),t.editorOptions.value&&$("<input>").addClass("account-settings__avatar-input").attr("type","text").attr("name","Avatar").appendTo(i).val(t.editorOptions.value)):$("<i>").addClass(["account-settings__avatar-view-default","fas","fa-user"]).appendTo(r),i}}]},{itemType:"empty",colSpan:1},{colSpan:9,caption:"Account Details",itemType:"group",items:[{itemType:"simple",dataField:"ErrorMessage",label:{visible:!1},template:t=>{let r=t&&t.editorOptions&&t.editorOptions.value;return r&&$("<div />").text(r).addClass("error-message")}},{itemType:"simple",dataField:"UserName",label:{text:"Username"},validationRules:[{type:"required",message:"Username is required"}]},{itemType:"group",colCount:2,items:[{itemType:"simple",dataField:"FirstName",label:{text:"First Name"},validationRules:[{type:"required",message:"First Name is required"}]},{itemType:"simple",dataField:"LastName",label:{text:"Last Name"},validationRules:[{type:"required",message:"Last Name is required"}]}]},{itemType:"simple",dataField:"PhoneNumber",label:{text:"Phone Number"}},{itemType:"simple",dataField:"Email",label:{text:"Email"},validationRules:[{type:"required",message:"Email is required"},{type:"email",message:"Please use a valid email address"}]},{itemType:"simple",cssClass:"account-settings__password-area",template:()=>$("<div />").css("font-weight","bold").text("Change Password")},{itemType:"simple",dataField:"OldPassword",label:{text:"Current password"},editorOptions:{mode:"password"},validationRules:[{type:"custom",reevaluate:!0,validationCallback:t=>{var r,i;return((i=(r=this.accountSettingsForm)==null?void 0:r.getEditor("NewPassword"))==null?void 0:i.option("value"))?!!t:!0},message:"Old password is required"}]},{itemType:"simple",dataField:"NewPassword",label:{text:"New password"},editorOptions:{mode:"password",inputAttr:{autocomplete:"new-password"}}},{itemType:"simple",dataField:"NewPasswordRepeat",label:{text:"Confirm new password"},editorOptions:{mode:"password"},validationRules:[{type:"custom",reevaluate:!0,validationCallback:t=>{var r,i;return(((i=(r=this.accountSettingsForm)==null?void 0:r.getEditor("NewPassword"))==null?void 0:i.option("value"))||"")===t.value},message:"Password mismatch"}]},{itemType:"button",horizontalAlignment:"right",cssClass:"account-settings__submit-btn",buttonOptions:{text:"Save Changes",type:"success",useSubmitBehavior:!0,width:200}}]}]}]}}};var xo={};ie(xo,{createConfirm:()=>Gi});function Gi(o){let t=$.Deferred(),i=$("<div/>").appendTo(window.document.body).dxPopup({showTitle:!1,height:140,width:370,contentTemplate:n=>{n.addClass("iszolea-dx-confirm"),$("<b/>").addClass("message").text(o).appendTo(n);let s=$("<div/>").addClass("buttons").appendTo(n);$("<div/>").dxButton({text:"Delete",type:"danger",onClick:()=>{i.hide(),t.resolve(!0)}}).appendTo(s),$("<div/>").dxButton({text:"Cancel",onClick:()=>{i.hide(),t.resolve(!1)}}).appendTo(s)},onHidden:()=>{i.dispose(),i.element().remove()}}).dxPopup("instance");return i.show(),t}var Ao={};ie(Ao,{createLanding:()=>$i});function $i(o,t,r,i={enabled:!1}){Hi(t).then(n=>{Wi(o,n,r,i)})}function Hi(o){let t=$.Deferred();if(typeof o=="string"){let r=window.sessionStorage.getItem(_e);r?t.resolve(JSON.parse(r)):x(o,"post").done(i=>{let n={applicationName:i.ApplicationName,businessName:i.BusinessName,landingPageLogo:i.LandingPageLogo,logoImage:i.LogoImage,description:i.Description};window.sessionStorage.setItem(_e,JSON.stringify(n)),t.resolve(n)})}else t.resolve(o);return t}function Wi(o,t,r,i){let n=$("<div />").addClass("iszolea-landing-page").appendTo(o),s=$("<div />").addClass("landing-container").appendTo(n);i.enabled?n.addClass("photo-gallery-mode"):(n.addClass("default-mode"),s=n);let l=$("<img />").attr("src",t.landingPageLogo).addClass("logo-large").on("error",g=>l.css("display","none")).appendTo(s);$("<div />").addClass("logo-container").appendTo(s).append(l,$("<span />").addClass("business-name").text(t.businessName).appendTo(s)),$("<h2 />").text(`Welcome to ${t.description}`).appendTo(s),r&&$("<div />").addClass("sign-in-button").append($("<div />").dxButton({text:"Sign In",width:k.isLegacyRender?void 0:"200px",type:"default",onClick:()=>{window.sessionStorage.clear(),window.location.href=`/Home/Login?returnUrl=${encodeURIComponent(window.location.href.toString())}`}})).appendTo(s),i.enabled&&Ct(i.$container||n,i.imageUrls||[],i.imgChangeIntervalSec||8,i.transitionTimeSec||2)}var Ro={};ie(Ro,{createAccessDeniedToReport:()=>zi});function zi(o,t,r){let i=$("<div>").addClass("access-denied-to-report-page").appendTo(o);if($("<h2>").addClass("error-text").text("Access denied to the report").appendTo(i),t&&t.length){let n=t.map(s=>$("<span>").addClass("role").text(s));$("<p>").text("Required roles for report: ").append(n).appendTo(i)}if(r&&r.length){let n=r.map(s=>$("<span>").addClass("role").text(s));$("<p>").text("Required roles for db connection: ").append(n).appendTo(i)}}var $o={};ie($o,{ControlConfigurator:()=>lt,ControlDisplay:()=>ut,DisplayManager:()=>ct,default:()=>Ae});function ee(o,t){let r=$("<p/>").html(t).text(),i=$("<div>",{class:"report-details-popover"}).html(r).appendTo(document.body);return $(i).dxPopover({target:o,showEvent:"dxclick",position:"bottom",width:500}).dxPopover("instance")}function Yi(o,t,r={},i,n,s=!1){let l=!1,g={export:{enabled:!!r.exportFileName,allowExportSelectedData:!0},remoteOperations:!0,columnAutoWidth:!0,showBorders:!0,selection:{mode:"multiple"},keyboardNavigation:{enabled:!1},paging:{pageSize:50},searchPanel:{visible:!0},filterRow:{visible:!0},headerFilter:{visible:!0},scrolling:{mode:"virtual"},onContentReady:m=>{if(Ji(m.component),!l){if(l=!0,!s)for(let S=0;S<m.component.columnCount();S++){let T=m.component.columnOption(S,"dataType");m.component.columnOption(S,"width")||(T==="boolean"&&m.component.columnOption(S,"width","100px"),T==="datetime"&&m.component.columnOption(S,"width","150px"))}setTimeout(()=>{let S=m.component.getScrollable();S&&S.scrollTo({top:0})})}},onToolbarPreparing:m=>{i&&m.toolbarOptions.items.unshift({location:"before",template(){let S=$("<h2 />").addClass("grid-header").text(i);return n&&S.append($("<i />").addClass("fas").addClass("fa-info-circle").addClass("report-details-link").attr("title","Click to see further details")),S}})}},p=t.onContentReady?m=>{g.onContentReady(m),t.onContentReady(m)}:g.onContentReady;Ki(t,r);let h=$.extend({},g,t,{onContentReady:p}),E=o.dxDataGrid(h).dxDataGrid("instance");return E.element().addClass(oe.dxDataGrid),E}function Ki(o,t){var i,n,s;if((n=(i=o==null?void 0:o.summary)==null?void 0:i.totalItems)==null?void 0:n.some(l=>l.summaryType==="count"))return;let r=t==null?void 0:t.summaryColumn;!r&&((s=o==null?void 0:o.columns)==null?void 0:s.length)&&(r=typeof o.columns[0]=="string"?o.columns[0]:o.columns[0].dataField),r&&(o.summary||(o.summary={}),o.summary.totalItems||(o.summary.totalItems=[]),o.summary.totalItems.push({column:r,summaryType:"count"}))}function Ji(o){var s,l,g;let t=o.option("summary.totalItems"),r=(s=t==null?void 0:t.filter(p=>p.summaryType==="count")[0])==null?void 0:s.column,i=r&&o.getVisibleColumns().findIndex(p=>p.dataField===r);if(!i){let p=o.option("selection");i=p&&p.mode!=="none"?o.getVisibleColumns().findIndex(E=>!!E.dataField):0}let n=(l=o.getVisibleColumns()[i])==null?void 0:l.dataField;n&&r!==n&&o.option("summary",{totalItems:[{column:(g=o.getVisibleColumns()[i])==null?void 0:g.dataField,summaryType:"count"}]})}function He(o,t,r={},i,n,s=!1,l=!1){let g=Yi(o,t,r,i,n,s);return l||le(g),g}function de(o,t){return $("<span>").attr("title",t).text(o)}function at(o,t){let r=$.Deferred();return x(o,"POST",JSON.stringify(t),!1,{contentType:"application/json"}).done(r.resolve).fail(i=>{r.reject(i)}),r.promise()}var Ut=class{constructor(t,r){this.$container=t,this.data=Array.isArray(r)?r:[]}render(){let t={dataSource:this.data,editing:{mode:"row",allowAdding:!0,allowDeleting:!0,allowUpdating:!0,useIcons:!0},headerFilter:{visible:!1},grouping:{contextMenuEnabled:!1},groupPanel:{visible:!1},searchPanel:{visible:!1},filterRow:{visible:!1},remoteOperations:!1,selection:{mode:"none"},columns:[{dataField:"value",allowEditing:!0},{dataField:"title",allowEditing:!0},{dataField:"image",allowEditing:!0,cellTemplate:(i,n)=>{$("<div>").css({"text-align":"center"}).append($("<img>",{src:n.data.image})).appendTo(i)},editCellTemplate:(i,n)=>{let s=n.value||"",l=$('<div style="position: relative; display: flex; align-items: center; justify-content: center;" />'),g=$(`<img src="${s}" />`),p=$('<a class="dx-link dx-icon-upload" style="position: absolute; right: 8px; text-decoration: none; font-size: 18px;" />'),h=$('<input type="file" style="display:none;" />');return p.on("click",()=>{h.click()}),h.on("change",E=>{if(E.target.files.length){let m=new FileReader;m.onloadend=()=>{g.attr("src",m.result),n.setValue(m.result)};let S=E.target.files[0];S?m.readAsDataURL(S):g.attr("src","")}}),g.appendTo(l),p.appendTo(l),h.appendTo(l),l}},{type:"buttons",width:100,buttons:["edit",{hint:"Delete",icon:"trash",onClick:i=>{let n=this.grid.option("dataSource");n.splice(i.row.rowIndex,1),this.grid.option("dataSource",n)}}]}]},r=$("<div />").appendTo(this.$container);this.grid=V(r,{options:t,isFullScreen:!1})}getData(){return this.grid.option("dataSource")}getBaseType(){return"string"}};var Pt=class{constructor(t,r){this.$container=t,this.data=A({items:[],multiselect:!1},r)}render(){let t={dataSource:this.data.items,height:400,keyExpr:"key",editing:{mode:"row",allowAdding:!0,allowDeleting:!0,allowUpdating:!0,useIcons:!0},headerFilter:{visible:!1},grouping:{contextMenuEnabled:!1},groupPanel:{visible:!1},searchPanel:{visible:!1},filterRow:{visible:!1},remoteOperations:!1,selection:{mode:"none"},columns:[{dataField:"key",visible:!1},{dataField:"value",allowEditing:!0},{type:"buttons",width:100,buttons:["edit",{hint:"Delete",icon:"trash",onClick:i=>{let n=this.grid.option("dataSource");n.splice(i.row.rowIndex,1),this.grid.option("dataSource",n)}}]}],toolbar:{items:[{location:"before",widget:"dxCheckBox",options:{text:"Multiselect",value:this.data.multiselect,onValueChanged:i=>{this.data.multiselect=i.value}}},{location:"after",name:"addRowButton"}]},onInitNewRow:i=>{let s=(this.grid.option("dataSource")||[]).map(g=>g.key),l=Math.max(0,...s);i.data.key=l+1}},r=$("<div />").appendTo(this.$container);this.grid=V(r,{options:t,isFullScreen:!1})}getData(){return{items:this.grid.option("dataSource"),multiselect:this.data.multiselect}}getBaseType(){return"string"}};var Nt=class{constructor(t,r,i){this.$container=t,this.data={multiple:(r==null?void 0:r.multiple)||!1,metaDataFields:(r==null?void 0:r.metaDataFields)||[]},this.initData=i}render(){this.form=$("<div />").dxForm({formData:this.data,width:"100%",labelLocation:"top",items:[{dataField:"multiple",editorType:"dxCheckBox",visible:!1},{dataField:"metaDataFields",editorType:"dxTagBox",editorOptions:{items:this.initData.fields}}]}).appendTo(this.$container).dxForm("instance")}getData(){return this.form.option("formData")}getBaseType(){return"string"}};var Lt=class{constructor(t,r,i){this.$container=t,this.data=r,this.initData=i}render(){this.form=$("<div />").dxForm({formData:this.data,width:"100%",labelLocation:"top",items:[{dataField:"actionType",validationRules:[{type:"required"}]},{dataField:"fields",validationRules:[{type:"required"},{type:"custom",validationCallback:t=>t.value.length>0,message:"Required"}],editorType:"dxTagBox",editorOptions:{dataSource:this.initData.fields,searchEnabled:!0}}]}).appendTo(this.$container).dxForm("instance")}getData(){if(!this.form.validate().isValid)return;let r=this.form.getEditor("actionType").option("value"),i=this.form.getEditor("fields").option("value");return{actionType:r,fields:i}}getBaseType(){return"string"}};var Bt=class{constructor(t,r){this.$container=t,this.data={url:typeof(r==null?void 0:r.url)>"u"?"":r.url,text:typeof(r==null?void 0:r.text)>"u"?"":r.text,openNewTab:typeof(r==null?void 0:r.openNewTab)>"u"?!0:r.openNewTab,useStaticLink:r?typeof r.useStaticLink>"u"?!0:r.useStaticLink:!1}}render(){this.form=$("<div />").dxForm({formData:this.data,width:"100%",labelLocation:"top",items:[{dataField:"useStaticLink",editorType:"dxCheckBox",editorOptions:{onValueChanged:t=>{this.form.itemOption("url","visible",t.value)}}},{visible:this.data.useStaticLink,dataField:"url",validationRules:[{type:"required"}]},{dataField:"text",label:{text:"Text (optional)"}},{dataField:"openNewTab",label:{text:"Open in a new tab"},editorType:"dxCheckBox"}]}).appendTo(this.$container).dxForm("instance")}getData(){var l;if(!this.form.validate().isValid)return;let r=(l=this.form.getEditor("url"))==null?void 0:l.option("value"),i=this.form.getEditor("text").option("value"),n=this.form.getEditor("openNewTab").option("value"),s=this.form.getEditor("useStaticLink").option("value");return{url:r,text:i,openNewTab:n,useStaticLink:s}}getBaseType(){return"string"}};var Ft=class{constructor(t,r,i,n){this.$container=t,this.data=A({multiselect:!1,grouping:!1,table:"",key:"",fields:[]},r),this.initData=i,this.baseType=n,this.allowedTypes=!n||n==="string"?["string","number"]:["number"],this.loadPanel=$("<div />").dxLoadPanel({visible:!1,message:"Loading...",container:this.$container,position:{of:this.$container},shading:!0,showPane:!0}).dxLoadPanel("instance")}async loadTables(){let t=await x(`${this.initData.getContextTablesUrl}?contextName=${this.initData.context}&sort=[{'selector':'FullTableName','desc':false}]`);return(t==null?void 0:t.data)||[]}async loadFields(t){let r=await x(`${this.initData.getTableFieldsUrl}?contextName=${this.initData.context}&table=${t}`);return(r==null?void 0:r.data)||[]}updateTablesDS(t){this.form.getEditor("table").option("dataSource",t)}updateKeyDS(t){let r=t.filter(n=>this.allowedTypes.includes(n.Type)).map(n=>n.Name);this.form.getEditor("key").option("dataSource",r)}updateFieldsDS(t){let r=t.map(n=>n.Name);this.form.getEditor("fields").option("dataSource",r)}updateCheckboxes(){let t=this.form.getEditor("multiselect"),r=this.form.getEditor("grouping");r.option("disabled",!!t.option("value")),t.option("disabled",this.baseType==="number"||!!r.option("value"))}render(){this.form=$("<div />").dxForm({labelLocation:"top",width:"100%",formData:this.data,onContentReady:()=>window.setTimeout(()=>this.updateCheckboxes()),items:[{dataField:"table",editorType:"dxSelectBox",isRequired:!0,editorOptions:{width:"100%",deferRendering:!1,dataSource:[],displayExpr:"FullTableName",valueExpr:"FullTableName",searchEnabled:!0,itemTemplate:t=>{let r=$("<div />");return $("<span />").text(t.FullTableName).appendTo(r),t.EntityType===2?$("<span />").text("View").addClass("source-badge view-badge").appendTo(r):t.EntityType===1&&$("<span />").text("Table").addClass("source-badge table-badge").appendTo(r),r},onValueChanged:async t=>{let r=t.component&&t.component.option("selectedItem"),i=this.form.getEditor("key"),n=this.form.getEditor("fields");try{this.loadPanel.show();let s=await this.loadFields(r.FullTableName);this.updateKeyDS(s),this.updateFieldsDS(s),i.option("value",null),i.option("disabled",!1),n.option("value",null),n.option("disabled",!1)}finally{this.loadPanel.hide()}}}},{dataField:"key",editorType:"dxSelectBox",isRequired:!0,editorOptions:{width:"100%",deferRendering:!1,dataSource:[]}},{dataField:"fields",editorType:"dxTagBox",isRequired:!0,editorOptions:{width:"100%",deferRendering:!1,dataSource:[]}},{itemType:"group",colCount:2,items:[{dataField:"multiselect",editorType:"dxCheckBox",editorOptions:{disabled:this.baseType==="number",onValueChanged:()=>this.updateCheckboxes()},label:{location:"left"}},{dataField:"grouping",editorType:"dxCheckBox",editorOptions:{onValueChanged:()=>this.updateCheckboxes()},label:{location:"left"}}]}]}).dxForm("instance"),this.$container.append(this.form.element()).append(this.loadPanel.element()),this.loadPanel.show(),Promise.all([this.loadTables(),this.data.table?this.loadFields(this.data.table):Promise.resolve([])]).then(t=>{let r=t[0],i=t[1];this.updateTablesDS(r),this.updateKeyDS(i),this.updateFieldsDS(i)}).finally(()=>this.loadPanel.hide())}getData(){if(!!this.form.validate().isValid)return this.form.option("formData")}getBaseType(){return this.baseType||"string"}};var xe={[1]:{name:"CreatedAt",type:"date",displayType:JSON.stringify({type:10006,data:{}})},[2]:{name:"CreatedBy",type:"string",displayType:JSON.stringify({type:10001,data:{}})},[3]:{name:"LastUpdateAt",type:"date",displayType:JSON.stringify({type:10006,data:{}})},[4]:{name:"LastUpdateBy",type:"string",displayType:JSON.stringify({type:10001,data:{}})}},qi={string:JSON.stringify({type:10001,data:{}}),number:JSON.stringify({type:10002,data:{}}),decimal:JSON.stringify({type:10003,data:{}}),boolean:JSON.stringify({type:10004,data:{}}),datetime:JSON.stringify({type:10005,data:{}}),date:JSON.stringify({type:10006,data:{}})},Qi={[1]:"string",[2]:"string",[8]:"string",[3]:"string",[4]:"string",[5]:"decimal",[6]:"string",[7]:"string",[10001]:"string",[10002]:"number",[10003]:"decimal",[10004]:"boolean",[10005]:"datetime",[10006]:"date"},Xi={string:[10001,10002,10003,10004,10005,10006,1,3,4,6,7,2,8],number:[10001,10002,10003,10004,10005,10006,5,8],decimal:[10001,10002,10003,10004,10005,10006,5],boolean:[10001,10002,10003,10004,10005,10006],datetime:[10001,10002,10003,10004,10005,10006],date:[10001,10002,10003,10004,10005,10006]};var lt=class{constructor(t,r,i){this.baseTypeTitle="Base Type";this.customTypeTitle="Custom Type";this.displayTypes=[{key:10001,value:"String",type:this.baseTypeTitle},{key:10002,value:"Number",type:this.baseTypeTitle},{key:10003,value:"Decimal",type:this.baseTypeTitle},{key:10004,value:"Boolean",type:this.baseTypeTitle},{key:10005,value:"Datetime",type:this.baseTypeTitle},{key:10006,value:"Date",type:this.baseTypeTitle},{key:1,value:"Icons",type:this.customTypeTitle},{key:2,value:"PredefinedValues",type:this.customTypeTitle},{key:8,value:"ReferencedValue",type:this.customTypeTitle},{key:3,value:"RabbitAction",type:this.customTypeTitle},{key:4,value:"Hyperlink",type:this.customTypeTitle},{key:5,value:"DollarValue",type:this.customTypeTitle},{key:7,value:"Image",type:this.customTypeTitle},{key:6,value:"Document",type:this.customTypeTitle}];this.editors={[1]:Ut,[2]:Pt,[8]:Ft,[3]:Lt,[4]:Bt,[7]:Nt};this.editorsInitData={};this.fields=[];this.systemFieldPredefinedData=null;this.$container=t.$container,this.isStandalonePage=t.isStandalonePage,this.groupFieldsUrl=t.groupFieldsUrl,this.loadDataUrl=t.loadDataUrl,this.updateDataUrl=t.updateDataUrl,this.batchUpdateDataUrl=t.batchUpdateDataUrl,this.addDataUrl=t.addDataUrl,this.deleteDataUrl=t.deleteDataUrl,this.updateGlobalSearchUrl=t.updateGlobalSearchUrl,this.updateInlineEditingUrl=t.updateInlineEditingUrl,this.pageTitle=t.pageTitle,this.isDataReadonly=!!t.isDataReadonly,this.disableGlobalSearch=t.disableGlobalSearch,this.enableInlineEditing=t.enableInlineEditing,this.getReportSourceDetailsUrl=t.getReportSourceDetailsUrl,this.getContextTablesUrl=t.getContextTablesUrl,this.getTableFieldsUrl=t.getTableFieldsUrl,this.onGlobalSearchSettingsChanged=r,this.onEnableInlineEditingChanged=i}getSqlEntityTypeName(t){switch(t){case 1:return"Table";case 3:return"Stored Procedure";case 2:return"View";case 0:default:return""}}render(){this.$container.addClass("aps-grid"),Promise.all([this.getAvailableFields(),this.getReportSourceDetails()]).then(t=>{this.fields=t[0],this.reportSourceDetails=t[1],this.editorsInitData[3]=()=>({fields:this.fields}),this.editorsInitData[7]=()=>({fields:this.fields}),this.editorsInitData[8]=()=>({getContextTablesUrl:this.getContextTablesUrl,getTableFieldsUrl:this.getTableFieldsUrl,context:this.reportSourceDetails.ConnectionName}),this.createMainGrid()})}async getAvailableFields(){return x(this.groupFieldsUrl)}async getReportSourceDetails(){return x(this.getReportSourceDetailsUrl)}getDisplayTypeEditor(t,r,i,n){let s=this.editors[r],l=this.editorsInitData[r];return s?new s(t,n,l?l():null,i):null}metaDataColumnTemplate(t,r){return t.css("background-color","#eee"),r.value?$('<i class="fas fa-check" style="font-size: 18px; color: #0366d6;"></i>'):$('<i class="fas fa-minus" style="font-size: 18px; color: #333;"></i>')}createMainGrid(){let t,r={dataSource:this.createMainGridDataSource(),columnChooser:{enabled:!0,allowSearch:!0,mode:"select"},errorRowEnabled:!0,height:"100%",editing:{mode:"batch",allowUpdating:!0,allowAdding:!this.isDataReadonly,allowDeleting:!this.isDataReadonly,refreshMode:"repaint",useIcons:!0},repaintChangesOnly:!0,remoteOperations:{summary:!0,paging:!0,grouping:!1,sorting:!1,filtering:!1},grouping:{allowCollapsing:!1},groupPanel:{visible:!1},selection:{mode:"multiple"},allowColumnReordering:!1,columnHidingEnabled:!1,hoverStateEnabled:!0,columnAutoWidth:!1,rowAlternationEnabled:!0,columnMinWidth:80,columns:this.prepareMainGridColumns([{dataField:"Name",caption:"Field",fixed:!0,fixedPosition:"left",sortOrder:"asc",sortIndex:1,width:180,validationRules:[{type:"required"}],cellTemplate:(n,s)=>{let l=$(`<div style="display: flex; align-items: center;">${(s==null?void 0:s.value)||""}</div>`);s.data.IsSystemColumn&&l.prepend('<i class="icon dx-icon-info" style="margin-right: 4px; color: #aaa;" title="System field"></i>'),n.append(l)}},{dataField:"IsSystemColumn",allowEditing:!1,dataType:"boolean",sortOrder:"asc",sortIndex:0,visible:!1},{dataField:"Type",allowEditing:!1,width:120,lookup:{dataSource:["string","number","decimal","boolean","datetime","date"]}},{dataField:"DisplayType",allowEditing:!0,validationRules:[{type:"required"}],width:160,calculateCellValue:n=>n.DisplayType===null?n.Type?qi[n.Type]:null:n.DisplayType,customizeText:n=>{if(!n.value)return null;let s=ae(n.value)?JSON.parse(n.value):{},l=this.displayTypes.find(g=>g.key===(s==null?void 0:s.type));return(l==null?void 0:l.value)||""},editCellTemplate:(n,s)=>{let l=ae(s.value)?JSON.parse(s.value):null,g=l?l.type:null,p=l?l.data:null,h=null,E=$("<div />").dxDropDownBox({dropDownOptions:{width:650,height:515,minHeight:515,maxHeight:515},dataSource:this.displayTypes,valueExpr:"key",displayExpr:"value",value:g,disabled:!!s.row.data.IsSystemColumn,onValueChanged:m=>{s.setValue(m.value)},contentTemplate:()=>{let m=$('<div class="display-type-editor" />'),S=$('<div style="text-align: center; color: #bbb; display: flex; align-items: center;" />').text("There are no additional settings for the selected Display Type"),T=$('<div style="margin: 8px 0; display: flex; flex-direction: row" />').appendTo(m),I=$('<div style="flex-shrink: 0;" />').appendTo(T),y=$('<div style="display: flex; justify-content: center; flex-grow: 1; margin-left: 8px;">').append(S).appendTo(T),u=$('<div style="text-align: right;" />').appendTo(m),v=$('<div style="margin-right: 8px;" />').appendTo(u),w=$('<div style="margin-right: 8px;" />').appendTo(u),D=g?this.getDisplayTypeEditor(y,g,s.data.Type,p):null;return D&&(y.html(""),D.render()),h=I.dxList({dataSource:new DevExpress.data.DataSource({store:{type:"array",data:this.displayTypes.map(_=>O(A({},_),{disabled:!s.row.isNewRow&&!Xi[s.data.Type].includes(_.key)})),key:"key"},group:"type"}),width:200,height:400,grouped:!0,selectionMode:"single",selectedItemKeys:[g],keyExpr:"key",displayExpr:"value",showScrollbar:"always",onSelectionChanged:_=>{let C=_.addedItems[0].key;D=this.getDisplayTypeEditor(y,C,s.data.Type,p),y.html(""),D?D==null||D.render():y.append(S),v.dxButton("instance").option("disabled",!1)}}).dxList("instance"),v.dxButton({text:"Save",type:"success",disabled:!D,onClick:()=>{let _=D==null?void 0:D.getData(),C=h.option("selectedItemKeys")[0],M={type:C,data:_||{}};if(E.option("value",C),s.row.isNewRow){let R=(D==null?void 0:D.getBaseType())?D.getBaseType():Qi[C];t.cellValue(s.rowIndex,"Type",R)}s.setValue(JSON.stringify(M)),s.component.closeEditCell(),E.close()}}).appendTo(u),w.dxButton({text:"Cancel",onClick:()=>{s.component.closeEditCell(),E.close()}}).appendTo(u),m},onOpened:()=>{let m=$(".display-type-editor .dx-list-item-selected");h.scrollToItem(m)}}).dxDropDownBox("instance");n.append(E.element()),s.row.data.IsSystemColumn||E.open()}},{dataField:"IsKeyColumn",caption:"Is Key",allowEditing:!0,width:100},{caption:"SQL Meta Data (Read-only)",columns:[{dataField:"IsIdentity",allowEditing:!1,width:80,minWidth:80,allowHeaderFiltering:!1,allowFiltering:!1,cellTemplate:this.metaDataColumnTemplate},{dataField:"IsNullable",allowEditing:!1,width:80,minWidth:80,allowHeaderFiltering:!1,allowFiltering:!1,cellTemplate:this.metaDataColumnTemplate},{dataField:"IsComputed",allowEditing:!1,width:80,minWidth:80,allowHeaderFiltering:!1,allowFiltering:!1,cellTemplate:this.metaDataColumnTemplate},{dataField:"HasDefaultValue",allowEditing:!1,width:80,minWidth:80,allowHeaderFiltering:!1,allowFiltering:!1,cellTemplate:this.metaDataColumnTemplate}]},{dataField:"Label",allowEditing:!0,width:180},{dataField:"GroupField",caption:"Group",allowEditing:!0,width:200,editCellTemplate:(n,s)=>$("<div />").dxSelectBox({value:s.value,dataSource:[...new Set(t.getDataSource().items().filter(l=>l.GroupField).map(l=>l.GroupField).sort())],acceptCustomValue:!0,showClearButton:!0,onValueChanged:l=>{s.setValue(l.value)}})},{dataField:"DataOwner",allowEditing:!0,width:80,headerCellTemplate:de("DO","Data Owner")},{dataField:"XLSScheduleLabel",allowEditing:!0,width:80,headerCellTemplate:de("XLS","XLS Schedule Label")},{dataField:"IsDefaultViewField",caption:"Display in default view",allowEditing:!0,width:100},{dataField:"IsExported",caption:"Export to excel",allowEditing:!0,width:100},{dataField:"Order",allowEditing:!0,editorOptions:{format:"#"},validationRules:[{type:"range",min:0,message:"Order can't be negative"}],width:80},{dataField:"Width",dataType:"number",headerCellTemplate:de("Width","Width (in pixels)"),allowEditing:!0,editorOptions:{format:"#"},validationRules:[{type:"range",min:1,message:"Width can't be less then 1px"}],width:80},{dataField:"HidingOrder",dataType:"number",headerCellTemplate:de("Hide","Hiding Order"),allowEditing:!0,editorOptions:{format:"#"},validationRules:[{type:"range",min:1,message:"Hiding order can't be less then 1"}],width:70},{dataField:"ToolTip",allowEditing:!0,minWidth:180}]),onSaving:n=>{n.cancel=!0,n.component.beginCustomLoading("Saving..."),n.changes.length&&(n.promise=at(this.batchUpdateDataUrl,n.changes).done(()=>{n.component.refresh(!0).done(()=>{n.component.cancelEditData()})}).always(()=>{n.component.endCustomLoading()}))},onRowUpdated:n=>{n.component.endCustomLoading(),n.component.repaint()},onToolbarPreparing:n=>{let s=n.toolbarOptions.items,l=s.filter(T=>T.name==="columnChooserButton")[0],g=s.indexOf(l),p={location:"after",template:()=>{let T=$("<div />").css({border:"1px #e0e0e0 solid",padding:"3px 6px",borderRadius:"4px",background:"white"});return $("<span />").css({margin:"0 5px 0 0",width:"100px"}).dxSwitch({value:this.enableInlineEditing,switchedOnText:"Inline Edit",switchedOffText:"Batch Edit",onValueChanged:({value:I})=>{this.enableInlineEditing=!I,x(this.updateInlineEditingUrl,"post",{updateInlineEditing:!!I}).then(()=>{this.onEnableInlineEditingChanged(I),P(`${I?"Inline":"Batch"} editing enabled`,!0)})}}).appendTo(T),T}},h={location:"after",template:()=>{let T=$("<div />").css({border:"1px #e0e0e0 solid",padding:"3px 6px",borderRadius:"4px",background:"white"});$("<span />").css({margin:"0 5px 0 0",width:"54px"}).dxSwitch({value:!this.disableGlobalSearch,onValueChanged:({value:y})=>{this.disableGlobalSearch=!y,x(this.updateGlobalSearchUrl,"post",{allowGlobalSearch:!!y}).then(()=>{this.onGlobalSearchSettingsChanged(y),P(`Global search ${y?"enabled":"disabled"}`,!0)})}}).appendTo(T),$("<span />").text("Allow global search").appendTo(T);let I=$("<a />").css({textDecoration:"underline",color:"blue"}).text("(?)").appendTo(T);return $("<div />").text(`For large datasets, particularly those with string values, it\u2019s advisable
|
|
42
|
-
to disable the global search function and allow filtering by column only.`).dxPopover({target:I,showEvent:"mouseenter",hideEvent:"mouseleave",position:"top",width:500}).appendTo(T),T}};s.splice(g,1);let
|
|
41
|
+
`)}initGallery(){return $(this.$content).dxGallery({dataSource:[]}).dxGallery("instance")}open(t=[]){this.$content=this.initMarkup(),this.gallery=this.initGallery(),this.dialog=J({title:"Image Gallery",height:this.settings.height,width:this.settings.width},this.$content,{text:"Close",onClick:r=>r()},void 0),this.images=t}close(){var t;(t=this.dialog)==null||t.close()}set images(t){this.items=t,this.gallery.option("dataSource",this.items.map(r=>({imageAlt:r.Name,imageSrc:r.Url})))}get images(){return this.items}};var _o={};ie(_o,{show:()=>Co});var Rr=ft(Ar());function Vi(o,t){o.attr("src",t)}function ki(o){let t=$("<div>").addClass("image-crop-popup__dropzone"),r=$("<div>").addClass("image-crop-popup__crop-container").appendTo(t),i=$("<img />").prependTo(r);Vi(i,o);let n=new Rr.default(i[0],{startSize:[90,90,"%"]});return{$content:t,cropper:n}}function Gi(o,t,r){J({title:"Edit image",showTitle:!0,dragEnabled:!1,resizeEnabled:!1,showCloseButton:!0,hideOnOutsideClick:!1,maxWidth:1024,onInitialized:i=>{i.component&&i.component.option("fullScreen",window.innerWidth<=1024)}},o,{text:"Update",onClick:i=>{let n=t.getValue(),s=$("<canvas>").attr("height",n.height).attr("width",n.width),l=s[0].getContext("2d"),g=o.find("img.croppr-image")[0];l.drawImage(g,n.x,n.y,n.width,n.height,0,0,n.width,n.height);let p=s[0].toDataURL("image/jpeg",.9);r(p),i()}},{text:"Cancel",onClick:i=>i()})}function Co(o,t){let r=ki(o);Gi(r.$content,r.cropper,t)}var Mr=o=>new Promise((t,r)=>{try{let i=new FileReader;i.onload=()=>{let n=i.result;t(typeof n=="string"?n:null)},i.readAsDataURL(o)}catch(i){r(i)}});var xo=10,Ao=class{constructor(t,r,i,n){this.accountSettingsData=i,this.currentUserInfo=n,this._$rootElement=t,this.formAction=r}render(){this.renderUploader(this.$rootElement),this.renderAccountSettingsForm(this.$rootElement)}get $rootElement(){if(!this._$rootElement)throw new Error("The root element is undefined");return this._$rootElement}renderUploader(t){this.avatarUploader=$("<div>").addClass("avatar-popup__uploader").dxFileUploader({multiple:!1,uploadMode:"useForm",accept:"image/*",visible:!1,maxFileSize:xo*1e6,onValueChanged:r=>{if(!r.component||!r.value)return;let i=r.value[0],n=r.component.option("maxFileSize")||xo;if(!i||i.size>n){DevExpress.ui.notify(`File size should be less than ${xo} MB. Please select another file`,"error",5e3);return}Mr(i).then(s=>{Co(s,l=>{var g,p;(g=this.accountSettingsForm)==null||g.updateData("Avatar",l),(p=this.accountSettingsForm)==null||p.repaint()})}).catch(s=>DevExpress.ui.notify(s,"error",3e3))}}).appendTo(t).dxFileUploader("instance")}renderAccountSettingsForm(t){var r;this.accountSettingsForm||(this.accountSettingsForm=$("<form />").attr("action",this.formAction).attr("method","post").addClass("account-settings__form").addClass("form-content").appendTo(t).dxForm(this.getFormOptions()).dxForm("instance"),((r=this.accountSettingsData)==null?void 0:r.HasChanges)&&!this.accountSettingsData.ErrorMessage&&setTimeout(()=>Or.widgets.notify("Changes have been saved",!0),500))}getFormOptions(){return{formData:this.accountSettingsData,minColWidth:200,labelLocation:"top",alignItemLabels:!0,showValidationSummary:!0,items:[{itemType:"group",colCount:16,items:[{colSpan:6,caption:"Profile Picture",itemType:"group",items:[{itemType:"simple",label:{visible:!1},dataField:"Avatar",template:t=>{var s;let r=$("<div>").addClass("account-settings__avatar-view-container"),i=$("<div>").addClass("account-settings__avatar");$("<div>").add(r).add($("<div>").addClass("account-settings__avatar-button").dxButton({width:200,type:"default",icon:"photo",text:"Upload new image",onInitialized:l=>this.avatarUploader&&this.avatarUploader.option("dialogTrigger",l.element)})).appendTo(i);let n=t.editorOptions.value||((s=this.currentUserInfo)==null?void 0:s.UserAvatar);return n?($("<img>").addClass("account-settings__avatar-view").attr("src",n).appendTo(r),t.editorOptions.value&&$("<input>").addClass("account-settings__avatar-input").attr("type","text").attr("name","Avatar").appendTo(i).val(t.editorOptions.value)):$("<i>").addClass(["account-settings__avatar-view-default","fas","fa-user"]).appendTo(r),i}}]},{itemType:"empty",colSpan:1},{colSpan:9,caption:"Account Details",itemType:"group",items:[{itemType:"simple",dataField:"ErrorMessage",label:{visible:!1},template:t=>{let r=t&&t.editorOptions&&t.editorOptions.value;return r&&$("<div />").text(r).addClass("error-message")}},{itemType:"simple",dataField:"UserName",label:{text:"Username"},validationRules:[{type:"required",message:"Username is required"}]},{itemType:"group",colCount:2,items:[{itemType:"simple",dataField:"FirstName",label:{text:"First Name"},validationRules:[{type:"required",message:"First Name is required"}]},{itemType:"simple",dataField:"LastName",label:{text:"Last Name"},validationRules:[{type:"required",message:"Last Name is required"}]}]},{itemType:"simple",dataField:"PhoneNumber",label:{text:"Phone Number"}},{itemType:"simple",dataField:"Email",label:{text:"Email"},validationRules:[{type:"required",message:"Email is required"},{type:"email",message:"Please use a valid email address"}]},{itemType:"simple",cssClass:"account-settings__password-area",template:()=>$("<div />").css("font-weight","bold").text("Change Password")},{itemType:"simple",dataField:"OldPassword",label:{text:"Current password"},editorOptions:{mode:"password"},validationRules:[{type:"custom",reevaluate:!0,validationCallback:t=>{var r,i;return((i=(r=this.accountSettingsForm)==null?void 0:r.getEditor("NewPassword"))==null?void 0:i.option("value"))?!!t:!0},message:"Old password is required"}]},{itemType:"simple",dataField:"NewPassword",label:{text:"New password"},editorOptions:{mode:"password",inputAttr:{autocomplete:"new-password"}}},{itemType:"simple",dataField:"NewPasswordRepeat",label:{text:"Confirm new password"},editorOptions:{mode:"password"},validationRules:[{type:"custom",reevaluate:!0,validationCallback:t=>{var r,i;return(((i=(r=this.accountSettingsForm)==null?void 0:r.getEditor("NewPassword"))==null?void 0:i.option("value"))||"")===t.value},message:"Password mismatch"}]},{itemType:"button",horizontalAlignment:"right",cssClass:"account-settings__submit-btn",buttonOptions:{text:"Save Changes",type:"success",useSubmitBehavior:!0,width:200}}]}]}]}}};var Ro={};ie(Ro,{createConfirm:()=>$i});function $i(o){let t=$.Deferred(),i=$("<div/>").appendTo(window.document.body).dxPopup({showTitle:!1,height:140,width:370,contentTemplate:n=>{n.addClass("iszolea-dx-confirm"),$("<b/>").addClass("message").text(o).appendTo(n);let s=$("<div/>").addClass("buttons").appendTo(n);$("<div/>").dxButton({text:"Delete",type:"danger",onClick:()=>{i.hide(),t.resolve(!0)}}).appendTo(s),$("<div/>").dxButton({text:"Cancel",onClick:()=>{i.hide(),t.resolve(!1)}}).appendTo(s)},onHidden:()=>{i.dispose(),i.element().remove()}}).dxPopup("instance");return i.show(),t}var Mo={};ie(Mo,{createLanding:()=>Hi});function Hi(o,t,r,i={enabled:!1}){Wi(t).then(n=>{zi(o,n,r,i)})}function Wi(o){let t=$.Deferred();if(typeof o=="string"){let r=window.sessionStorage.getItem(Ce);r?t.resolve(JSON.parse(r)):x(o,"post").done(i=>{let n={applicationName:i.ApplicationName,businessName:i.BusinessName,landingPageLogo:i.LandingPageLogo,logoImage:i.LogoImage,description:i.Description};window.sessionStorage.setItem(Ce,JSON.stringify(n)),t.resolve(n)})}else t.resolve(o);return t}function zi(o,t,r,i){let n=$("<div />").addClass("iszolea-landing-page").appendTo(o),s=$("<div />").addClass("landing-container").appendTo(n);i.enabled?n.addClass("photo-gallery-mode"):(n.addClass("default-mode"),s=n);let l=$("<img />").attr("src",t.landingPageLogo).addClass("logo-large").on("error",g=>l.css("display","none")).appendTo(s);$("<div />").addClass("logo-container").appendTo(s).append(l,$("<span />").addClass("business-name").text(t.businessName).appendTo(s)),$("<h2 />").text(`Welcome to ${t.description}`).appendTo(s),r&&$("<div />").addClass("sign-in-button").append($("<div />").dxButton({text:"Sign In",width:k.isLegacyRender?void 0:"200px",type:"default",onClick:()=>{window.sessionStorage.clear(),window.location.href=`/Home/Login?returnUrl=${encodeURIComponent(window.location.href.toString())}`}})).appendTo(s),i.enabled&&xt(i.$container||n,i.imageUrls||[],i.imgChangeIntervalSec||8,i.transitionTimeSec||2)}var Oo={};ie(Oo,{createAccessDeniedToReport:()=>Ki});function Ki(o,t,r){let i=$("<div>").addClass("access-denied-to-report-page").appendTo(o);if($("<h2>").addClass("error-text").text("Access denied to the report").appendTo(i),t&&t.length){let n=t.map(s=>$("<span>").addClass("role").text(s));$("<p>").text("Required roles for report: ").append(n).appendTo(i)}if(r&&r.length){let n=r.map(s=>$("<span>").addClass("role").text(s));$("<p>").text("Required roles for db connection: ").append(n).appendTo(i)}}var Wo={};ie(Wo,{ControlConfigurator:()=>lt,ControlDisplay:()=>ut,DisplayManager:()=>ct,default:()=>Ae});function ee(o,t){let r=$("<p/>").html(t).text(),i=$("<div>",{class:"report-details-popover"}).html(r).appendTo(document.body);return $(i).dxPopover({target:o,showEvent:"dxclick",position:"bottom",width:500}).dxPopover("instance")}function Yi(o,t,r={},i,n,s=!1){let l=!1,g={export:{enabled:!!r.exportFileName,allowExportSelectedData:!0},remoteOperations:!0,columnAutoWidth:!0,showBorders:!0,selection:{mode:"multiple"},keyboardNavigation:{enabled:!1},paging:{pageSize:50},searchPanel:{visible:!0},filterRow:{visible:!0},headerFilter:{visible:!0},scrolling:{mode:"virtual"},onContentReady:E=>{if(qi(E.component),!l){if(l=!0,!s)for(let y=0;y<E.component.columnCount();y++){let T=E.component.columnOption(y,"dataType");E.component.columnOption(y,"width")||(T==="boolean"&&E.component.columnOption(y,"width","100px"),T==="datetime"&&E.component.columnOption(y,"width","150px"))}setTimeout(()=>{let y=E.component.getScrollable();y&&y.scrollTo({top:0})})}},onToolbarPreparing:E=>{i&&E.toolbarOptions.items.unshift({location:"before",template(){let y=$("<h2 />").addClass("grid-header").text(i);return n&&y.append($("<i />").addClass("fas").addClass("fa-info-circle").addClass("report-details-link").attr("title","Click to see further details")),y}})}},p=t.onContentReady?E=>{g.onContentReady(E),t.onContentReady(E)}:g.onContentReady;Ji(t,r);let h=$.extend({},g,t,{onContentReady:p}),S=o.dxDataGrid(h).dxDataGrid("instance");return S.element().addClass(oe.dxDataGrid),S}function Ji(o,t){var i,n,s;if((n=(i=o==null?void 0:o.summary)==null?void 0:i.totalItems)==null?void 0:n.some(l=>l.summaryType==="count"))return;let r=t==null?void 0:t.summaryColumn;!r&&((s=o==null?void 0:o.columns)==null?void 0:s.length)&&(r=typeof o.columns[0]=="string"?o.columns[0]:o.columns[0].dataField),r&&(o.summary||(o.summary={}),o.summary.totalItems||(o.summary.totalItems=[]),o.summary.totalItems.push({column:r,summaryType:"count"}))}function qi(o){var s,l,g;let t=o.option("summary.totalItems"),r=(s=t==null?void 0:t.filter(p=>p.summaryType==="count")[0])==null?void 0:s.column,i=r&&o.getVisibleColumns().findIndex(p=>p.dataField===r);if(!i){let p=o.option("selection");i=p&&p.mode!=="none"?o.getVisibleColumns().findIndex(S=>!!S.dataField):0}let n=(l=o.getVisibleColumns()[i])==null?void 0:l.dataField;n&&r!==n&&o.option("summary",{totalItems:[{column:(g=o.getVisibleColumns()[i])==null?void 0:g.dataField,summaryType:"count"}]})}function He(o,t,r={},i,n,s=!1,l=!1){let g=Yi(o,t,r,i,n,s);return l||le(g),g}function de(o,t){return $("<span>").attr("title",t).text(o)}function at(o,t){let r=$.Deferred();return x(o,"POST",JSON.stringify(t),!1,{contentType:"application/json"}).done(r.resolve).fail(i=>{r.reject(i)}),r.promise()}var Pt=class{constructor(t,r){this.$container=t,this.data=Array.isArray(r)?r:[]}render(){let t={dataSource:this.data,editing:{mode:"row",allowAdding:!0,allowDeleting:!0,allowUpdating:!0,useIcons:!0},headerFilter:{visible:!1},grouping:{contextMenuEnabled:!1},groupPanel:{visible:!1},searchPanel:{visible:!1},filterRow:{visible:!1},remoteOperations:!1,selection:{mode:"none"},columns:[{dataField:"value",allowEditing:!0},{dataField:"title",allowEditing:!0},{dataField:"image",allowEditing:!0,cellTemplate:(i,n)=>{$("<div>").css({"text-align":"center"}).append($("<img>",{src:n.data.image})).appendTo(i)},editCellTemplate:(i,n)=>{let s=n.value||"",l=$('<div style="position: relative; display: flex; align-items: center; justify-content: center;" />'),g=$(`<img src="${s}" />`),p=$('<a class="dx-link dx-icon-upload" style="position: absolute; right: 8px; text-decoration: none; font-size: 18px;" />'),h=$('<input type="file" style="display:none;" />');return p.on("click",()=>{h.click()}),h.on("change",S=>{if(S.target.files.length){let E=new FileReader;E.onloadend=()=>{g.attr("src",E.result),n.setValue(E.result)};let y=S.target.files[0];y?E.readAsDataURL(y):g.attr("src","")}}),g.appendTo(l),p.appendTo(l),h.appendTo(l),l}},{type:"buttons",width:100,buttons:["edit",{hint:"Delete",icon:"trash",onClick:i=>{let n=this.grid.option("dataSource");n.splice(i.row.rowIndex,1),this.grid.option("dataSource",n)}}]}]},r=$("<div />").appendTo(this.$container);this.grid=V(r,{options:t,isFullScreen:!1})}getData(){return this.grid.option("dataSource")}getBaseType(){return"string"}};var Nt=class{constructor(t,r){this.$container=t,this.data=A({items:[],multiselect:!1},r)}render(){let t={dataSource:this.data.items,height:400,keyExpr:"key",editing:{mode:"row",allowAdding:!0,allowDeleting:!0,allowUpdating:!0,useIcons:!0},headerFilter:{visible:!1},grouping:{contextMenuEnabled:!1},groupPanel:{visible:!1},searchPanel:{visible:!1},filterRow:{visible:!1},remoteOperations:!1,selection:{mode:"none"},columns:[{dataField:"key",visible:!1},{dataField:"value",allowEditing:!0},{type:"buttons",width:100,buttons:["edit",{hint:"Delete",icon:"trash",onClick:i=>{let n=this.grid.option("dataSource");n.splice(i.row.rowIndex,1),this.grid.option("dataSource",n)}}]}],toolbar:{items:[{location:"before",widget:"dxCheckBox",options:{text:"Multiselect",value:this.data.multiselect,onValueChanged:i=>{this.data.multiselect=i.value}}},{location:"after",name:"addRowButton"}]},onInitNewRow:i=>{let s=(this.grid.option("dataSource")||[]).map(g=>g.key),l=Math.max(0,...s);i.data.key=l+1}},r=$("<div />").appendTo(this.$container);this.grid=V(r,{options:t,isFullScreen:!1})}getData(){return{items:this.grid.option("dataSource"),multiselect:this.data.multiselect}}getBaseType(){return"string"}};var Lt=class{constructor(t,r,i){this.$container=t,this.data={multiple:(r==null?void 0:r.multiple)||!1,metaDataFields:(r==null?void 0:r.metaDataFields)||[]},this.initData=i}render(){this.form=$("<div />").dxForm({formData:this.data,width:"100%",labelLocation:"top",items:[{dataField:"multiple",editorType:"dxCheckBox",visible:!1},{dataField:"metaDataFields",editorType:"dxTagBox",editorOptions:{items:this.initData.fields}}]}).appendTo(this.$container).dxForm("instance")}getData(){return this.form.option("formData")}getBaseType(){return"string"}};var Bt=class{constructor(t,r,i){this.$container=t,this.data=r,this.initData=i}render(){this.form=$("<div />").dxForm({formData:this.data,width:"100%",labelLocation:"top",items:[{dataField:"actionType",validationRules:[{type:"required"}]},{dataField:"fields",validationRules:[{type:"required"},{type:"custom",validationCallback:t=>t.value.length>0,message:"Required"}],editorType:"dxTagBox",editorOptions:{dataSource:this.initData.fields,searchEnabled:!0}}]}).appendTo(this.$container).dxForm("instance")}getData(){if(!this.form.validate().isValid)return;let r=this.form.getEditor("actionType").option("value"),i=this.form.getEditor("fields").option("value");return{actionType:r,fields:i}}getBaseType(){return"string"}};var Ft=class{constructor(t,r){this.$container=t,this.data={url:typeof(r==null?void 0:r.url)>"u"?"":r.url,text:typeof(r==null?void 0:r.text)>"u"?"":r.text,openNewTab:typeof(r==null?void 0:r.openNewTab)>"u"?!0:r.openNewTab,useStaticLink:r?typeof r.useStaticLink>"u"?!0:r.useStaticLink:!1}}render(){this.form=$("<div />").dxForm({formData:this.data,width:"100%",labelLocation:"top",items:[{dataField:"useStaticLink",editorType:"dxCheckBox",editorOptions:{onValueChanged:t=>{this.form.itemOption("url","visible",t.value)}}},{visible:this.data.useStaticLink,dataField:"url",validationRules:[{type:"required"}]},{dataField:"text",label:{text:"Text (optional)"}},{dataField:"openNewTab",label:{text:"Open in a new tab"},editorType:"dxCheckBox"}]}).appendTo(this.$container).dxForm("instance")}getData(){var l;if(!this.form.validate().isValid)return;let r=(l=this.form.getEditor("url"))==null?void 0:l.option("value"),i=this.form.getEditor("text").option("value"),n=this.form.getEditor("openNewTab").option("value"),s=this.form.getEditor("useStaticLink").option("value");return{url:r,text:i,openNewTab:n,useStaticLink:s}}getBaseType(){return"string"}};var jt=class{constructor(t,r,i,n){this.$container=t,this.data=A({multiselect:!1,grouping:!1,table:"",key:"",fields:[]},r),this.initData=i,this.baseType=n,this.allowedTypes=!n||n==="string"?["string","number"]:["number"],this.loadPanel=$("<div />").dxLoadPanel({visible:!1,message:"Loading...",container:this.$container,position:{of:this.$container},shading:!0,showPane:!0}).dxLoadPanel("instance")}async loadTables(){let t=await x(`${this.initData.getContextTablesUrl}?contextName=${this.initData.context}&sort=[{'selector':'FullTableName','desc':false}]`);return(t==null?void 0:t.data)||[]}async loadFields(t){let r=await x(`${this.initData.getTableFieldsUrl}?contextName=${this.initData.context}&table=${t}`);return(r==null?void 0:r.data)||[]}updateTablesDS(t){this.form.getEditor("table").option("dataSource",t)}updateKeyDS(t){let r=t.filter(n=>this.allowedTypes.includes(n.Type)).map(n=>n.Name);this.form.getEditor("key").option("dataSource",r)}updateFieldsDS(t){let r=t.map(n=>n.Name);this.form.getEditor("fields").option("dataSource",r)}updateCheckboxes(){let t=this.form.getEditor("multiselect"),r=this.form.getEditor("grouping");r.option("disabled",!!t.option("value")),t.option("disabled",this.baseType==="number"||!!r.option("value"))}render(){this.form=$("<div />").dxForm({labelLocation:"top",width:"100%",formData:this.data,onContentReady:()=>window.setTimeout(()=>this.updateCheckboxes()),items:[{dataField:"table",editorType:"dxSelectBox",isRequired:!0,editorOptions:{width:"100%",deferRendering:!1,dataSource:[],displayExpr:"FullTableName",valueExpr:"FullTableName",searchEnabled:!0,itemTemplate:t=>{let r=$("<div />");return $("<span />").text(t.FullTableName).appendTo(r),t.EntityType===2?$("<span />").text("View").addClass("source-badge view-badge").appendTo(r):t.EntityType===1&&$("<span />").text("Table").addClass("source-badge table-badge").appendTo(r),r},onValueChanged:async t=>{let r=t.component&&t.component.option("selectedItem"),i=this.form.getEditor("key"),n=this.form.getEditor("fields");try{this.loadPanel.show();let s=await this.loadFields(r.FullTableName);this.updateKeyDS(s),this.updateFieldsDS(s),i.option("value",null),i.option("disabled",!1),n.option("value",null),n.option("disabled",!1)}finally{this.loadPanel.hide()}}}},{dataField:"key",editorType:"dxSelectBox",isRequired:!0,editorOptions:{width:"100%",deferRendering:!1,dataSource:[]}},{dataField:"fields",editorType:"dxTagBox",isRequired:!0,editorOptions:{width:"100%",deferRendering:!1,dataSource:[]}},{itemType:"group",colCount:2,items:[{dataField:"multiselect",editorType:"dxCheckBox",editorOptions:{disabled:this.baseType==="number",onValueChanged:()=>this.updateCheckboxes()},label:{location:"left"}},{dataField:"grouping",editorType:"dxCheckBox",editorOptions:{onValueChanged:()=>this.updateCheckboxes()},label:{location:"left"}}]}]}).dxForm("instance"),this.$container.append(this.form.element()).append(this.loadPanel.element()),this.loadPanel.show(),Promise.all([this.loadTables(),this.data.table?this.loadFields(this.data.table):Promise.resolve([])]).then(t=>{let r=t[0],i=t[1];this.updateTablesDS(r),this.updateKeyDS(i),this.updateFieldsDS(i)}).finally(()=>this.loadPanel.hide())}getData(){if(!!this.form.validate().isValid)return this.form.option("formData")}getBaseType(){return this.baseType||"string"}};var xe={[1]:{name:"CreatedAt",type:"date",displayType:JSON.stringify({type:10006,data:{}})},[2]:{name:"CreatedBy",type:"string",displayType:JSON.stringify({type:10001,data:{}})},[3]:{name:"LastUpdateAt",type:"date",displayType:JSON.stringify({type:10006,data:{}})},[4]:{name:"LastUpdateBy",type:"string",displayType:JSON.stringify({type:10001,data:{}})}},Qi={string:JSON.stringify({type:10001,data:{}}),number:JSON.stringify({type:10002,data:{}}),decimal:JSON.stringify({type:10003,data:{}}),boolean:JSON.stringify({type:10004,data:{}}),datetime:JSON.stringify({type:10005,data:{}}),date:JSON.stringify({type:10006,data:{}})},Xi={[1]:"string",[2]:"string",[8]:"string",[3]:"string",[4]:"string",[5]:"decimal",[6]:"string",[7]:"string",[10001]:"string",[10002]:"number",[10003]:"decimal",[10004]:"boolean",[10005]:"datetime",[10006]:"date"},Zi={string:[10001,10002,10003,10004,10005,10006,1,3,4,6,7,2,8],number:[10001,10002,10003,10004,10005,10006,5,8],decimal:[10001,10002,10003,10004,10005,10006,5],boolean:[10001,10002,10003,10004,10005,10006],datetime:[10001,10002,10003,10004,10005,10006],date:[10001,10002,10003,10004,10005,10006]};var lt=class{constructor(t,r,i){this.baseTypeTitle="Base Type";this.customTypeTitle="Custom Type";this.displayTypes=[{key:10001,value:"String",type:this.baseTypeTitle},{key:10002,value:"Number",type:this.baseTypeTitle},{key:10003,value:"Decimal",type:this.baseTypeTitle},{key:10004,value:"Boolean",type:this.baseTypeTitle},{key:10005,value:"Datetime",type:this.baseTypeTitle},{key:10006,value:"Date",type:this.baseTypeTitle},{key:1,value:"Icons",type:this.customTypeTitle},{key:2,value:"PredefinedValues",type:this.customTypeTitle},{key:8,value:"ReferencedValue",type:this.customTypeTitle},{key:3,value:"RabbitAction",type:this.customTypeTitle},{key:4,value:"Hyperlink",type:this.customTypeTitle},{key:5,value:"DollarValue",type:this.customTypeTitle},{key:7,value:"Image",type:this.customTypeTitle},{key:6,value:"Document",type:this.customTypeTitle}];this.editors={[1]:Pt,[2]:Nt,[8]:jt,[3]:Bt,[4]:Ft,[7]:Lt};this.editorsInitData={};this.fields=[];this.systemFieldPredefinedData=null;this.$container=t.$container,this.isStandalonePage=t.isStandalonePage,this.groupFieldsUrl=t.groupFieldsUrl,this.loadDataUrl=t.loadDataUrl,this.updateDataUrl=t.updateDataUrl,this.batchUpdateDataUrl=t.batchUpdateDataUrl,this.addDataUrl=t.addDataUrl,this.deleteDataUrl=t.deleteDataUrl,this.updateGlobalSearchUrl=t.updateGlobalSearchUrl,this.updateInlineEditingUrl=t.updateInlineEditingUrl,this.pageTitle=t.pageTitle,this.isDataReadonly=!!t.isDataReadonly,this.disableGlobalSearch=t.disableGlobalSearch,this.enableInlineEditing=t.enableInlineEditing,this.getReportSourceDetailsUrl=t.getReportSourceDetailsUrl,this.getContextTablesUrl=t.getContextTablesUrl,this.getTableFieldsUrl=t.getTableFieldsUrl,this.onGlobalSearchSettingsChanged=r,this.onEnableInlineEditingChanged=i}getSqlEntityTypeName(t){switch(t){case 1:return"Table";case 3:return"Stored Procedure";case 2:return"View";case 0:default:return""}}render(){this.$container.addClass("aps-grid"),Promise.all([this.getAvailableFields(),this.getReportSourceDetails()]).then(t=>{this.fields=t[0],this.reportSourceDetails=t[1],this.editorsInitData[3]=()=>({fields:this.fields}),this.editorsInitData[7]=()=>({fields:this.fields}),this.editorsInitData[8]=()=>({getContextTablesUrl:this.getContextTablesUrl,getTableFieldsUrl:this.getTableFieldsUrl,context:this.reportSourceDetails.ConnectionName}),this.createMainGrid()})}async getAvailableFields(){return x(this.groupFieldsUrl)}async getReportSourceDetails(){return x(this.getReportSourceDetailsUrl)}getDisplayTypeEditor(t,r,i,n){let s=this.editors[r],l=this.editorsInitData[r];return s?new s(t,n,l?l():null,i):null}metaDataColumnTemplate(t,r){return t.css("background-color","#eee"),r.value?$('<i class="fas fa-check" style="font-size: 18px; color: #0366d6;"></i>'):$('<i class="fas fa-minus" style="font-size: 18px; color: #333;"></i>')}createMainGrid(){let t,r={dataSource:this.createMainGridDataSource(),columnChooser:{enabled:!0,allowSearch:!0,mode:"select"},errorRowEnabled:!0,height:"100%",editing:{mode:"batch",allowUpdating:!0,allowAdding:!this.isDataReadonly,allowDeleting:!this.isDataReadonly,refreshMode:"repaint",useIcons:!0},repaintChangesOnly:!0,remoteOperations:{summary:!0,paging:!0,grouping:!1,sorting:!1,filtering:!1},grouping:{allowCollapsing:!1},groupPanel:{visible:!1},selection:{mode:"multiple"},allowColumnReordering:!1,columnHidingEnabled:!1,hoverStateEnabled:!0,columnAutoWidth:!1,rowAlternationEnabled:!0,columnMinWidth:80,columns:this.prepareMainGridColumns([{dataField:"Name",caption:"Field",fixed:!0,fixedPosition:"left",sortOrder:"asc",sortIndex:1,width:180,validationRules:[{type:"required"}],cellTemplate:(n,s)=>{let l=$(`<div style="display: flex; align-items: center;">${(s==null?void 0:s.value)||""}</div>`);s.data.IsSystemColumn&&l.prepend('<i class="icon dx-icon-info" style="margin-right: 4px; color: #aaa;" title="System field"></i>'),n.append(l)}},{dataField:"IsSystemColumn",allowEditing:!1,dataType:"boolean",sortOrder:"asc",sortIndex:0,visible:!1},{dataField:"Type",allowEditing:!1,width:120,lookup:{dataSource:["string","number","decimal","boolean","datetime","date"]}},{dataField:"DisplayType",allowEditing:!0,validationRules:[{type:"required"}],width:160,calculateCellValue:n=>n.DisplayType===null?n.Type?Qi[n.Type]:null:n.DisplayType,customizeText:n=>{if(!n.value)return null;let s=ae(n.value)?JSON.parse(n.value):{},l=this.displayTypes.find(g=>g.key===(s==null?void 0:s.type));return(l==null?void 0:l.value)||""},editCellTemplate:(n,s)=>{let l=ae(s.value)?JSON.parse(s.value):null,g=l?l.type:null,p=l?l.data:null,h=null,S=$("<div />").dxDropDownBox({dropDownOptions:{width:650,height:515,minHeight:515,maxHeight:515},dataSource:this.displayTypes,valueExpr:"key",displayExpr:"value",value:g,disabled:!!s.row.data.IsSystemColumn,onValueChanged:E=>{s.setValue(E.value)},contentTemplate:()=>{let E=$('<div class="display-type-editor" />'),y=$('<div style="text-align: center; color: #bbb; display: flex; align-items: center;" />').text("There are no additional settings for the selected Display Type"),T=$('<div style="margin: 8px 0; display: flex; flex-direction: row" />').appendTo(E),I=$('<div style="flex-shrink: 0;" />').appendTo(T),m=$('<div style="display: flex; justify-content: center; flex-grow: 1; margin-left: 8px;">').append(y).appendTo(T),u=$('<div style="text-align: right;" />').appendTo(E),v=$('<div style="margin-right: 8px;" />').appendTo(u),w=$('<div style="margin-right: 8px;" />').appendTo(u),D=g?this.getDisplayTypeEditor(m,g,s.data.Type,p):null;return D&&(m.html(""),D.render()),h=I.dxList({dataSource:new DevExpress.data.DataSource({store:{type:"array",data:this.displayTypes.map(C=>O(A({},C),{disabled:!s.row.isNewRow&&!Zi[s.data.Type].includes(C.key)})),key:"key"},group:"type"}),width:200,height:400,grouped:!0,selectionMode:"single",selectedItemKeys:[g],keyExpr:"key",displayExpr:"value",showScrollbar:"always",onSelectionChanged:C=>{let _=C.addedItems[0].key;D=this.getDisplayTypeEditor(m,_,s.data.Type,p),m.html(""),D?D==null||D.render():m.append(y),v.dxButton("instance").option("disabled",!1)}}).dxList("instance"),v.dxButton({text:"Save",type:"success",disabled:!D,onClick:()=>{let C=D==null?void 0:D.getData(),_=h.option("selectedItemKeys")[0],M={type:_,data:C||{}};if(S.option("value",_),s.row.isNewRow){let R=(D==null?void 0:D.getBaseType())?D.getBaseType():Xi[_];t.cellValue(s.rowIndex,"Type",R)}s.setValue(JSON.stringify(M)),s.component.closeEditCell(),S.close()}}).appendTo(u),w.dxButton({text:"Cancel",onClick:()=>{s.component.closeEditCell(),S.close()}}).appendTo(u),E},onOpened:()=>{let E=$(".display-type-editor .dx-list-item-selected");h.scrollToItem(E)}}).dxDropDownBox("instance");n.append(S.element()),s.row.data.IsSystemColumn||S.open()}},{dataField:"IsKeyColumn",caption:"Is Key",allowEditing:!0,width:100},{caption:"SQL Meta Data (Read-only)",columns:[{dataField:"IsIdentity",allowEditing:!1,width:80,minWidth:80,allowHeaderFiltering:!1,allowFiltering:!1,cellTemplate:this.metaDataColumnTemplate},{dataField:"IsNullable",allowEditing:!1,width:80,minWidth:80,allowHeaderFiltering:!1,allowFiltering:!1,cellTemplate:this.metaDataColumnTemplate},{dataField:"IsComputed",allowEditing:!1,width:80,minWidth:80,allowHeaderFiltering:!1,allowFiltering:!1,cellTemplate:this.metaDataColumnTemplate},{dataField:"HasDefaultValue",allowEditing:!1,width:80,minWidth:80,allowHeaderFiltering:!1,allowFiltering:!1,cellTemplate:this.metaDataColumnTemplate}]},{dataField:"Label",allowEditing:!0,width:180},{dataField:"GroupField",caption:"Group",allowEditing:!0,width:200,editCellTemplate:(n,s)=>$("<div />").dxSelectBox({value:s.value,dataSource:[...new Set(t.getDataSource().items().filter(l=>l.GroupField).map(l=>l.GroupField).sort())],acceptCustomValue:!0,showClearButton:!0,onValueChanged:l=>{s.setValue(l.value)}})},{dataField:"DataOwner",allowEditing:!0,width:80,headerCellTemplate:de("DO","Data Owner")},{dataField:"XLSScheduleLabel",allowEditing:!0,width:80,headerCellTemplate:de("XLS","XLS Schedule Label")},{dataField:"IsDefaultViewField",caption:"Display in default view",allowEditing:!0,width:100},{dataField:"IsExported",caption:"Export to excel",allowEditing:!0,width:100},{dataField:"Order",allowEditing:!0,editorOptions:{format:"#"},validationRules:[{type:"range",min:0,message:"Order can't be negative"}],width:80},{dataField:"Width",dataType:"number",headerCellTemplate:de("Width","Width (in pixels)"),allowEditing:!0,editorOptions:{format:"#"},validationRules:[{type:"range",min:1,message:"Width can't be less then 1px"}],width:80},{dataField:"HidingOrder",dataType:"number",headerCellTemplate:de("Hide","Hiding Order"),allowEditing:!0,editorOptions:{format:"#"},validationRules:[{type:"range",min:1,message:"Hiding order can't be less then 1"}],width:70},{dataField:"ToolTip",allowEditing:!0,minWidth:180}]),onSaving:n=>{n.cancel=!0,n.component.beginCustomLoading("Saving..."),n.changes.length&&(n.promise=at(this.batchUpdateDataUrl,n.changes).done(()=>{n.component.refresh(!0).done(()=>{n.component.cancelEditData()})}).always(()=>{n.component.endCustomLoading()}))},onRowUpdated:n=>{n.component.endCustomLoading(),n.component.repaint()},onToolbarPreparing:n=>{let s=n.toolbarOptions.items,l=s.filter(T=>T.name==="columnChooserButton")[0],g=s.indexOf(l),p={location:"after",template:()=>{let T=$("<div />").css({border:"1px #e0e0e0 solid",padding:"3px 6px",borderRadius:"4px",background:"white"});return $("<span />").css({margin:"0 5px 0 0",width:"100px"}).dxSwitch({value:this.enableInlineEditing,switchedOnText:"Inline Edit",switchedOffText:"Batch Edit",onValueChanged:({value:I})=>{this.enableInlineEditing=!I,x(this.updateInlineEditingUrl,"post",{updateInlineEditing:!!I}).then(()=>{this.onEnableInlineEditingChanged(I),P(`${I?"Inline":"Batch"} editing enabled`,!0)})}}).appendTo(T),T}},h={location:"after",template:()=>{let T=$("<div />").css({border:"1px #e0e0e0 solid",padding:"3px 6px",borderRadius:"4px",background:"white"});$("<span />").css({margin:"0 5px 0 0",width:"54px"}).dxSwitch({value:!this.disableGlobalSearch,onValueChanged:({value:m})=>{this.disableGlobalSearch=!m,x(this.updateGlobalSearchUrl,"post",{allowGlobalSearch:!!m}).then(()=>{this.onGlobalSearchSettingsChanged(m),P(`Global search ${m?"enabled":"disabled"}`,!0)})}}).appendTo(T),$("<span />").text("Allow global search").appendTo(T);let I=$("<a />").css({textDecoration:"underline",color:"blue"}).text("(?)").appendTo(T);return $("<div />").text(`For large datasets, particularly those with string values, it\u2019s advisable
|
|
42
|
+
to disable the global search function and allow filtering by column only.`).dxPopover({target:I,showEvent:"mouseenter",hideEvent:"mouseleave",position:"top",width:500}).appendTo(T),T}};s.splice(g,1);let S=s.filter(T=>T.name==="exportButton")[0],E=s.indexOf(S);s.splice(E,1),this.isDataReadonly||s.push(p),s.push(h),s.push(l);let y=s.find(T=>T.name==="addRowButton");if(y){let T=null;y.widget="dxDropDownButton";let I=y.options;I.height=32,I.text="Add Field",I.hint="Add Field",I.splitButton=!0,I.keyExpr="key",I.displayExpr="text",I.dropDownOptions={width:210,onShowing:async()=>{let u=t.getDataSource()._items;T.option("items",[{key:1,text:"Add CreatedAt field",disabled:u.some(v=>v.Name===xe[1].name)},{key:2,text:"Add CreatedBy field",disabled:u.some(v=>v.Name===xe[2].name)},{key:3,text:"Add LastUpdateAt field",disabled:u.some(v=>v.Name===xe[3].name)},{key:4,text:"Add LastUpdateBy field",disabled:u.some(v=>v.Name===xe[4].name)}])}},I.onButtonClick=()=>t.addRow(),I.onItemClick=async m=>{this.systemFieldPredefinedData={Name:xe[m.itemData.key].name,Type:xe[m.itemData.key].type,DisplayType:xe[m.itemData.key].displayType,IsSystemColumn:!0},t.addRow()},I.onInitialized=m=>{T=m.component}}if(this.reportSourceDetails){let T=$(`
|
|
43
43
|
<div class="cdm-sorce-details">
|
|
44
44
|
<div class="cdm-sorce-details__row">
|
|
45
45
|
<div class="cdm-sorce-details__title">DB Connection:</div>
|
|
@@ -52,21 +52,21 @@ to disable the global search function and allow filtering by column only.`).dxPo
|
|
|
52
52
|
${this.isDataReadonly?'<i title="The source data is read only, editing is not available" class="fa-solid fa-circle-info"></i>':""}
|
|
53
53
|
</div>
|
|
54
54
|
</div>
|
|
55
|
-
`);s.push({location:"before",template:()=>T})}},onEditorPreparing:n=>{n.parentType==="dataRow"&&n.dataField==="Name"&&(n.editorOptions.disabled=!n.row.isNewRow||!!n.row.data.IsSystemColumn)},onInitNewRow:n=>{n.data=A({IsKeyColumn:!1,IsDefaultViewField:!0,IsExported:!0,IsSystemColumn:!1,IsIdentity:!1,IsComputed:!1,IsNullable:!0,HasDefaultValue:!1},this.systemFieldPredefinedData||{}),this.systemFieldPredefinedData=null},onRowRemoved:n=>{this.fields=this.fields.filter(s=>s!==n.data.Name)},onRowInserted:n=>{this.fields.push(n.data.Name)}},i={summaryColumn:"Name"};return this.isStandalonePage?t=He(this.$container,r,i,this.pageTitle,"",!0):t=V(this.$container,{options:r,summaryColumn:i.summaryColumn,title:this.pageTitle,isFullScreen:!1}),t}prepareMainGridColumns(t){return t.forEach(r=>{(r.allowHiding===void 0||r.allowHiding===null)&&(r.allowHiding=!1),(r.showInColumnChooser===void 0||r.showInColumnChooser===null)&&(r.showInColumnChooser=!1)}),t}createMainGridDataSource(){return{store:Tt({loadUrl:this.loadDataUrl,key:"Name",notifyError:!1})}}};DevExpress.ui.dxDataGrid.registerModule("columnChooserSorting",{extenders:{controllers:{columns(o){return class extends o{getChooserColumns(r){return(super.getChooserColumns(r)||[]).slice().sort((n,s)=>{let l=(n==null?void 0:n.caption)||"",g=(s==null?void 0:s.caption)||"";return l.localeCompare(g)})}}}}}});var Ur=mt(mo());var Zi=(o,t)=>{if(o===null||t===null||o.length!==t.length)return!1;for(let r=0;r<o.length;r++)if(o[r]!==t[r])return!1;return!0},We=o=>{let t=null,r=null;return function(...i){return Zi(t,i)||(r=o(...i)),t=i,r}};var me=class{constructor(t){this._currentViewId=me.defaultControlDisplayView.id;this.views=me.defaultViews;this.getViewByIdInternal=t=>this.views&&this.views.find(r=>r.id===t);this.getViewById=We(this.getViewByIdInternal);this.loadDataUrl=t.loadDataUrl,this.insertDataUrl=t.insertDataUrl,this.updateDataUrl=t.updateDataUrl,this.deleteDataUrl=t.deleteDataUrl}get currentView(){return this.getViewById(this._currentViewId)}get currentViewId(){return this._currentViewId}set currentViewId(t){this._currentViewId=t}async getViews(){return this.views===me.defaultViews&&await this.loadViews(),this.views}updateCurrentView(t){return this.updateView(this.currentView.id,t)}async createNewView(t,r,i){let n=this.mapViewModelToDto({id:-1,name:t,gridState:r,isGlobal:i});return n=await x(this.insertDataUrl,"POST",n),await this.loadViews(),this.mapViewDtoToModel(n)}async updateView(t,r){if(t===me.defaultControlDisplayView.id)return!1;let i=this.getViewById(t);if(!i)return!1;let n=A(A({},i),r),s=this.mapViewModelToDto(n);return s=await x(this.updateDataUrl,"PUT",s),await this.loadViews(),!0}async deleteView(t){return t===me.defaultControlDisplayView.id||!this.getViewById(t)?!1:(await x(this.deleteDataUrl,"DELETE",{viewId:t}),await this.loadViews(),!0)}async loadViews(){let t=await se(this.loadDataUrl);return this.views=t.map(r=>this.mapViewDtoToModel(r)),this.views.unshift(me.defaultControlDisplayView),this.resetCachedResultOfGetViewByIdFunction(),this.views}mapViewModelToDto(t){return{Id:t.id,Name:t.name,GridState:JSON.stringify(t.gridState),IsGlobal:t.isGlobal}}mapViewDtoToModel(t){return{id:t.Id,name:t.Name,gridState:JSON.parse(t.GridState),isGlobal:t.IsGlobal}}resetCachedResultOfGetViewByIdFunction(){this.getViewById=We(this.getViewByIdInternal)}},W=me;W.defaultControlDisplayView={id:0,name:"Default",gridState:null,isGlobal:!1},W.defaultViews=[me.defaultControlDisplayView];var Mo=class{constructor(t){var r;this.options=t,this.currentSavedGridState=t.initialState,this.imagePreviewSizeMap=((r=t.initialState)==null?void 0:r.imagePreviewSizeMap)??{},this.options.owner.option("stateStoring",{enabled:!0,type:"custom",customLoad:()=>Promise.resolve(this.currentSavedGridState)})}prepareUnsavedGridState(t){if(t.columns){let r=t.columns.filter(n=>n.visible),i=r[r.length-1];i.width=void 0}return t.imagePreviewSizeMap=this.imagePreviewSizeMap,t}get hasChanges(){return this.currentSavedGridState!==null&&JSON.stringify(this.currentUnsavedGridState)!==JSON.stringify(this.currentSavedGridState)}get currentUnsavedGridState(){return this.prepareUnsavedGridState(this.options.owner.state())}async apply(t,r=!0){return new Promise((i,n)=>{this.imagePreviewSizeMap=(t==null?void 0:t.imagePreviewSizeMap)||{};let s=r?void 0:this.options.owner.filter();this.options.owner.beginUpdate(),this.options.owner.clearFilter("filterValue"),this.options.owner.state(t);let l=this.options.owner.getVisibleColumns().filter(p=>!p.type);l[0]&&l[0].dataField&&this.options.owner.option("summary",{totalItems:[{column:l[0].dataField,summaryType:"count"}]}),s&&this.options.owner.filter(s),this.options.owner.endUpdate();let g=()=>{this.save(),i(),this.options.owner.off("contentReady",g)};this.options.owner.on("contentReady",g)})}save(){this.currentSavedGridState=this.currentUnsavedGridState}reset(){this.options.owner.state(this.currentSavedGridState)}setFieldPreviewSize(t,r){this.imagePreviewSizeMap[t]=r}getFieldPreviewSize(t){return this.imagePreviewSizeMap[t]}};var Oo=class{constructor(t){this.onGridToolbarPreparing=t=>{let r=t.toolbarOptions&&t.toolbarOptions.items;!r||(this.removeDefaultColumnChooserButton(r),r.splice(1,0,this.viewsToolbarItem))};this.options=O(A({},t),{gridStateManager:t.gridStateManager?t.gridStateManager:new Mo({owner:t.owner,initialState:null}),gridViewsManager:t.gridViewsManager?t.gridViewsManager:new W(t.gridViewsManagerOptions),autoIntegration:t.autoIntegration!==void 0&&t.autoIntegration!==null?t.autoIntegration:!0}),this.options.autoIntegration&&this.integrateToGrid(this.options.owner)}async tryApplyView(t){let r=await this.confirmChangesLoss();return r&&await this.applyView(t),r}async applyView(t){this.beginViewApplyingLoading(),this.options.gridViewsManager.currentViewId=t,await this.options.gridStateManager.apply(this.options.gridViewsManager.currentView.gridState,!1),this.endViewApplyingLoading(),this.syncUIWithCurrentView(),this.options.onViewApplied&&this.options.onViewApplied(t)}integrateToGrid(t){let r=t.option("onToolbarPreparing");t.option("onToolbarPreparing",i=>{r&&r(i),this.onGridToolbarPreparing(i)})}removeDefaultColumnChooserButton(t){t.splice(t.findIndex(r=>r.name==="columnChooserButton"),1)}get viewsToolbarItem(){return this._viewsToolbarItem||(this._viewsToolbarItem=this.createViewsToolbarItem()),this._viewsToolbarItem}get isDefaultView(){return this.options.gridViewsManager.currentViewId===W.defaultControlDisplayView.id}get hasChanges(){let t=this.options.gridViewsManager.currentView;return this.currentViewTitle?this.currentViewTitle.option("value")!==t.name||this.options.gridStateManager.hasChanges:!1}createViewsToolbarItem(){let t=!0;return{widget:"dxDropDownBox",location:"after",text:"Views",visible:this.options.visible,cssClass:"aps-views__toolbar-item",options:{elementAttr:{class:"iszolea-md"},items:[W.defaultControlDisplayView],value:W.defaultControlDisplayView.id,valueExpr:"id",displayExpr:"name",width:200,dropDownOptions:{width:550},onInitialized:r=>{this.viewsDropdownBox=r.component,this.loadViewDropdownBoxData()},onValueChanged:async r=>{if(r.value===this.options.gridViewsManager.currentViewId||!t){t=!0;return}await this.tryApplyView(r.value)||(t=!1,this.syncUIWithCurrentView(!0))},contentTemplate:r=>{if(!r.component)return;this.viewsDataGrid=this.createViewsDataGrid(r.component),this.currentViewTitle=this.createCurrentViewTitle(r.component),this.saveViewButton=this.createSaveViewButton(),this.saveViewAsButton=this.createSaveViewAsButton(),this.columnChooserButton=this.createColumnChooserButton();let i=$("<div />").addClass("aps-views__header").append(this.currentViewTitle.element()).append(this.saveViewButton.element()).append(this.saveViewAsButton.element()).append(this.columnChooserButton.element());return $("<div />").height("100%").append(i).append(this.viewsDataGrid.element())}}}}createViewsDataGrid(t){return $("<div />").dxDataGrid({dataSource:t.getDataSource(),remoteOperations:!1,editing:{allowAdding:!1,allowUpdating:!0,allowDeleting:!0,mode:"cell",useIcons:!0,texts:{confirmDeleteMessage:"Are you sure you want to delete this view?"}},wordWrapEnabled:!0,loadPanel:{shading:!0},columns:[{dataField:"name",allowEditing:!1},{dataField:"isGlobal",caption:"Is Global",dataType:"boolean",width:70},{type:"buttons",buttons:[{name:"delete",visible:r=>r.row&&r.row.key!==W.defaultControlDisplayView.id}]}],keyboardNavigation:{editOnKeyPress:!1,enabled:!1},showColumnHeaders:!0,hoverStateEnabled:!0,focusedRowEnabled:!1,showBorders:!1,showColumnLines:!1,selection:{mode:"single"},height:"calc(100% - 51px)",scrolling:{mode:"standard"},paging:{enabled:!1},noDataText:"No views",onSelectionChanged:r=>{t.option("value",r.selectedRowKeys&&r.selectedRowKeys.length?r.selectedRowKeys[0]:0)},onEditorPreparing:r=>{if(r.dataField==="isGlobal"){r.editorOptions.disabled=!this.options.canCreateGlobalViews,r.editorOptions.visible=r.row.data.id!==W.defaultControlDisplayView.id;let i=r.editorOptions.onValueChanged;r.editorOptions.onValueChanged=async n=>{r.component.beginCustomLoading("Updating"),await this.options.gridViewsManager.updateView(r.row.data.id,{isGlobal:n.value}),r.component.endCustomLoading(),i(n)}}},onCellPrepared:r=>{if(r.column.type!=="buttons"||!r.data)return;!r.data.isGlobal||r.data.isGlobal&&this.options.canCreateGlobalViews||Array.from(r.cellElement.children()).forEach(n=>{$(n).css({color:"#ddd !important",cursor:"default"}).off("click")})},onRowRemoving:r=>{!r.key||this.deleteView(r.key)}}).dxDataGrid("instance")}createCurrentViewTitle(t){return $("<div />").addClass("aps-views__current-view iszolea-md").dxTextBox({value:t.option("text")||t.option("placeholder"),readOnly:this.isDefaultView}).dxTextBox("instance")}createSaveViewButton(){return $("<button />").addClass("aps-views__save-view iszolea-md").dxButton({text:"Save",type:"normal",disabled:this.isDefaultView,onClick:this.save.bind(this),icon:"save",width:87}).dxButton("instance")}createSaveViewAsButton(){return $("<button />").addClass("aps-views__save-view-as iszolea-md").dxButton({text:"Save As",type:"normal",onClick:this.createSaveAsDialog.bind(this),icon:"save",width:118}).dxButton("instance")}createColumnChooserButton(){return $("<button />").addClass("aps-views__column-chooser iszolea-md").dxButton({onClick:this.openColumnChooser.bind(this),icon:"column-chooser"}).dxButton("instance")}createSaveAsDialog(){let t=$("<div />"),r=$('<div style="margin-bottom:8px;" />').dxTextBox({placeholder:"View Name",showClearButton:!0}).dxValidator({validationRules:[{type:"required"}]}),i=r.dxTextBox("instance"),n=r.dxValidator("instance");i.element().appendTo(t);let s=$('<div style="margin-bottom:16px;" />').dxCheckBox({text:"Global view",disabled:!this.options.canCreateGlobalViews}).dxCheckBox("instance");return s.element().appendTo(t),J({title:"Create New View",height:"auto",width:"100%",maxWidth:"300px"},t,{text:"Ok",onClick:async l=>{!n.validate().isValid||(await this.saveAs(i.option("value"),s.option("value")),l())}},{text:"Cancel",onClick:l=>l()})}openColumnChooser(){this.options.owner.showColumnChooser()}async loadViewDropdownBoxData(){if(!this.viewsDropdownBox)return;let t=await this.options.gridViewsManager.getViews(),r=new DevExpress.data.ArrayStore({key:"id",data:t});this.viewsDropdownBox.option("dataSource",r),this.viewsDropdownBox.option("value",this.options.gridViewsManager.currentViewId),this.viewsDataGrid&&this.viewsDataGrid.option("dataSource",r)}async save(){!this.hasChanges||(this.options.gridStateManager.save(),await this.options.gridViewsManager.updateCurrentView({name:this.currentViewTitle.option("value"),gridState:this.options.gridStateManager.currentSavedGridState}),P("Saved",!0),await this.loadViewDropdownBoxData())}async saveAs(t,r){if(!this.options.gridStateManager)return;this.options.gridStateManager.save();let i=await this.options.gridViewsManager.createNewView(t,this.options.gridStateManager.currentSavedGridState,r);await this.loadViewDropdownBoxData(),await this.applyView(i.id),P("View is created",!0)}async deleteView(t){await this.options.gridViewsManager.deleteView(t),this.options.onViewDeleted&&this.options.onViewDeleted(t),await this.loadViewDropdownBoxData(),this.options.gridViewsManager.currentViewId!==W.defaultControlDisplayView.id&&await this.applyView(W.defaultControlDisplayView.id)}beginViewApplyingLoading(){this.currentViewTitle&&this.currentViewTitle.option("readOnly",!0),this.saveViewButton&&this.saveViewButton.option("disabled",!0),this.saveViewAsButton&&this.saveViewAsButton.option("disabled",!0),this.viewsDataGrid&&this.viewsDataGrid.beginCustomLoading("Applying...")}endViewApplyingLoading(){this.currentViewTitle&&this.currentViewTitle.option("readOnly",!1),this.saveViewButton&&this.saveViewButton.option("disabled",!1),this.saveViewAsButton&&this.saveViewAsButton.option("disabled",!1),this.viewsDataGrid&&this.viewsDataGrid.endCustomLoading()}syncUIWithCurrentView(t=!1){!t&&this.currentViewTitle&&(this.currentViewTitle.option("value",this.options.gridViewsManager.currentView.name),this.currentViewTitle.option("readOnly",this.isDefaultView)),this.viewsDropdownBox.option("value",this.options.gridViewsManager.currentViewId),setTimeout(()=>{this.viewsDataGrid&&(this.options.gridViewsManager.currentViewId===W.defaultControlDisplayView.id?this.viewsDataGrid.selectRowsByIndexes([0]):this.viewsDataGrid.selectRows([this.options.gridViewsManager.currentViewId],!1))},0);let r=this.options.gridViewsManager.currentView.isGlobal&&!this.options.canCreateGlobalViews;this.saveViewButton&&this.saveViewButton.option("disabled",this.isDefaultView||r)}async confirmChangesLoss(){return this.hasChanges?DevExpress.ui.dialog.confirm("You have unsaved changes that will be lost if you close this popup. Do you want to close the popup and not save changes?","Unsaved changes"):!0}};var dt=class{constructor(t){this.getFilterByIdInternal=t=>this.filters&&this.filters.find(r=>r.id===t);this.getFilterById=We(this.getFilterByIdInternal);this.loadDataUrl=t.loadDataUrl,this.insertDataUrl=t.insertDataUrl,this.updateDataUrl=t.updateDataUrl,this.deleteDataUrl=t.deleteDataUrl}get currentFilter(){return this.getFilterById(this._currentFilterId)}get currentFilterId(){return this._currentFilterId}set currentFilterId(t){this._currentFilterId=t}async getFilters(){return this.filters||await this.loadFilters(),this.filters}updateCurrentFilter(t){return!!this.currentFilter&&this.updateFilter(this.currentFilter.id,t)}async createNewFilter(t,r,i,n){let s=this.mapFilterModelToDto({id:-1,name:t,isDefault:i,isGlobal:n,filterState:r});return s=await x(this.insertDataUrl,"POST",s),await this.loadFilters(),this.mapFilterDtoToModel(s)}async updateFilter(t,r){let i=this.getFilterById(t);if(!i)return!1;let n=A(A({},i),r),s=this.mapFilterModelToDto(n);return s=await x(this.updateDataUrl,"PUT",s),await this.loadFilters(),!0}async deleteFilter(t){return this.getFilterById(t)?(await x(this.deleteDataUrl,"DELETE",{filterId:t}),await this.loadFilters(),!0):!1}async loadFilters(){let t=await se(this.loadDataUrl);return this.filters=t.map(r=>this.mapFilterDtoToModel(r)),this.resetCachedResultOfGetFilterByIdFunction(),this.filters}mapFilterModelToDto(t){return{Id:t.id,Name:t.name,IsDefault:t.isDefault,IsGlobal:t.isGlobal,FilterState:JSON.stringify(t.filterState)}}mapFilterDtoToModel(t){return{id:t.Id,name:t.Name,isDefault:t.IsDefault||!1,isGlobal:t.IsGlobal||!1,filterState:JSON.parse(t.FilterState)}}resetCachedResultOfGetFilterByIdFunction(){this.getFilterById=We(this.getFilterByIdInternal)}};var Uo=class{constructor(t){this.isInFilterApplying=!1;this.onGridToolbarPreparing=t=>{let r=t.toolbarOptions&&t.toolbarOptions.items;!r||r.splice(1,0,this.filtersToolbarItem)};this.options=O(A({},t),{gridFiltersManager:t.gridFiltersManager?t.gridFiltersManager:new dt(t.gridFiltersManagerOptions),autoIntegration:t.autoIntegration!==void 0&&t.autoIntegration!==null?t.autoIntegration:!0}),this.options.autoIntegration&&this.integrateToGrid(this.options.owner),this.filterExpressionCalculator=$("<div />").dxFilterBuilder({fields:this.getFlatColumnsList(this.options.owner.option("columns"))}).dxFilterBuilder("instance")}async tryApplyFilter(t){let r=await this.confirmChangesLoss();return r&&await this.applyFilter(t),r}async applyFilter(t,r=!1){this.isInFilterApplying=!0,this.options.gridFiltersManager.currentFilterId=t,this.updateFilterPopupContent(this.options.gridFiltersManager.currentFilter),this.filtersDropdownBox.option("value",this.options.gridFiltersManager.currentFilterId);let i=this.options.owner.getDataSource();if(this.options.gridFiltersManager.currentFilter){this.filterExpressionCalculator.option("value",this.options.gridFiltersManager.currentFilter.filterState);let n=this.filterExpressionCalculator.getFilterExpression();if(i.isLoading()){let s=()=>{i.off("loadingChanged",s),setTimeout(()=>{i=this.options.owner.getDataSource(),i.filter(n)})};i.on("loadingChanged",s)}else i.filter(n)}else i.filter(null);r||await i.load(),this.options.onFilterApplied&&this.options.onFilterApplied(t),this.isInFilterApplying=!1}integrateToGrid(t){let r=t.option("onToolbarPreparing");t.option("onToolbarPreparing",i=>{r&&r(i),this.onGridToolbarPreparing(i)})}get filtersToolbarItem(){return this._filtersToolbarItem||(this._filtersToolbarItem=this.createFiltersToolbarItem()),this._filtersToolbarItem}get filterPopup(){return this._filterPopup||(this._filterPopup=this.createFilterPopup()),this._filterPopup}get hasChanges(){let t=this.options.gridFiltersManager.currentFilter,r=this.filterNameTextBox&&this.filterNameTextBox.option("value"),i=t&&t.name,n=this.filterBuilder&&this.filterBuilder.option("value"),s=t&&t.filterState,l=this.filterIsGlobalCheckbox&&this.filterIsGlobalCheckbox.option("value"),g=t&&t.isGlobal;return r!==i||n!==s||l!==g}createFiltersToolbarItem(){let t=!0;return{widget:"dxDropDownBox",location:"after",text:"Data Sets",visible:this.options.visible,cssClass:"aps-filters__toolbar-item",options:{elementAttr:{class:"iszolea-md"},value:this.options.gridFiltersManager.currentFilterId,valueExpr:"id",displayExpr:"name",showClearButton:!0,placeholder:"None",width:200,dropDownOptions:{width:500},onInitialized:async r=>{this.filtersDropdownBox=r.component;let[,i]=await Promise.all([this.loadFilterDropdownBoxData(),this.options.apsControlDisplayUserSettingsManager.getUserSettings()]);i.defaultFilterId&&r.component.option("value",i.defaultFilterId)},onValueChanged:async r=>{if(this.isInFilterApplying)return;if(!t){t=!0;return}let i=r.value;await this.tryApplyFilter(i)||(t=!1,i=r.previousValue,r.component.option("value",i)),this.filtersDataGrid&&this.filtersDataGrid.selectRows(i,!1),this.currentFilterTitle&&this.currentFilterTitle.option("value",r.component.option("text")||r.component.option("placeholder"))},onOpened:r=>{!r.component||this.filtersDataGrid&&this.filtersDataGrid.selectRows(r.component.option("value"),!1)},contentTemplate:r=>{if(!r.component)return;this.filtersDataGrid=this.createFiltersDataGrid(r.component),this.currentFilterTitle=this.createCurrentFilterTitle(r.component),this.newFilterButton=this.createNewFilterButton();let i=$("<div />").addClass("aps-filters__header").append(this.currentFilterTitle.element()).append(this.newFilterButton.element());return $("<div />").css("height","100%").append(i).append(this.filtersDataGrid.element())}}}}createFiltersDataGrid(t){return $("<div />").dxDataGrid({dataSource:t.getDataSource(),remoteOperations:!1,editing:{allowAdding:!1,allowUpdating:!0,allowDeleting:!0,mode:"cell",useIcons:!0,texts:{confirmDeleteMessage:"Are you sure you want to delete this data set?"}},wordWrapEnabled:!0,columns:[{dataField:"name",allowEditing:!1},{dataField:"isDefault",caption:"Is Default",dataType:"boolean",width:80},{dataField:"isGlobal",caption:"Is Global",dataType:"boolean",width:70},{type:"buttons",buttons:[{icon:"edit",hint:"Edit",onClick:async r=>{if(!r.row||!r.row.key)return;await this.tryApplyFilter(r.row.key)&&!this.filterPopup.option("visible")&&this.openEditFilterPopup(this.options.gridFiltersManager.currentFilter)}},"delete"]}],keyboardNavigation:{editOnKeyPress:!1,enabled:!1},showColumnHeaders:!0,hoverStateEnabled:!0,focusedRowEnabled:!1,showBorders:!1,showColumnLines:!1,selection:{mode:"single"},height:"calc(100% - 51px)",scrolling:{mode:"standard"},paging:{enabled:!1},noDataText:"No data sets",onSelectionChanged:r=>{t.option("value",r.selectedRowKeys?r.selectedRowKeys[0]:null)},onEditorPreparing:r=>{if(r.dataField==="isGlobal"){r.editorOptions.disabled=!this.options.canCreateGlobalFilters;let i=r.editorOptions.onValueChanged;r.editorOptions.onValueChanged=async n=>{r.component.beginCustomLoading("Updating"),await this.options.gridFiltersManager.updateFilter(r.row.data.id,{isGlobal:n.value}),r.component.endCustomLoading(),i(n)}}},onCellPrepared:r=>{r.column.type!=="buttons"||!r.data||r.column.type==="buttons"&&(!r.data.isGlobal||r.data.isGlobal&&this.options.canCreateGlobalFilters||Array.from(r.cellElement.children()).forEach(n=>{$(n).css({color:"#ddd !important",cursor:"default"}).off("click")}))},onRowUpdating:r=>{if(!r.key||r.newData.isDefault===void 0)return;let i=r.component.getDataSource().items().find(n=>n.isDefault);i&&(i.isDefault=!1),this.options.apsControlDisplayUserSettingsManager.updateUserSettings({defaultFilterId:r.newData.isDefault?r.key:void 0})},onRowRemoving:r=>{!r.key||this.deleteFilter(r.key)}}).dxDataGrid("instance")}createCurrentFilterTitle(t){return $("<div />").addClass("aps-filters__current-filter").dxTextBox({value:t.option("text")||t.option("placeholder"),readOnly:!0}).dxTextBox("instance")}createNewFilterButton(){return $("<button />").addClass("aps-filters__add-new-filter iszolea-md").dxButton({text:"New Data Set",type:"normal",onClick:()=>{this.openNewFilterPopup()},icon:"plus"}).dxButton("instance")}createFilterPopup(){let t=$("<div />").appendTo("body"),r=!1;return t.dxPopup({container:this.options.owner.element(),shading:!1,resizeEnabled:!0,width:650,height:500,onShowing:i=>{this.filtersDropdownBox&&this.filtersDropdownBox.close()},onHiding:async i=>{if(!this.hasChanges||r){r=!1;return}i.cancel=!0,r=await this.confirmChangesLoss(),r&&(i.component.hide(),this.filtersDropdownBox&&this.filtersDropdownBox.open())}}).dxPopup("instance")}createFilterNameTextBox(){return $("<div />").dxTextBox({placeholder:"Enter Data Set Name..."}).dxTextBox("instance")}createFilterIsGlobalCheckbox(){return $("<div />").dxCheckBox({text:"Global data set"}).dxCheckBox("instance")}getFlatColumnsList(t,...r){let i=[];for(let n of t)if(n.columns&&n.columns.length>0){let s=this.getFlatColumnsList(n.columns);i=i.concat(s)}else{let s=$.extend({},n);if(s.dataType==="date"||s.dataType==="datetime"){let l=s.dataType==="datetime",g="dd MMM yy",h=l?"hh:mm, dd MMM yy":g,E=m=>{let S=m.split(", "),T=DevExpress.localization.parseDate(S[1],g)||null;if(T){let I=S[0].split(":");return T.setHours(parseInt(I[0])),T.setMinutes(parseInt(I[1])),T}else return null};s.format=h,s.editorTemplate=m=>$("<div />").dxDateBox({displayFormat:h,type:l?"datetime":"date",width:150,onValueChanged:({value:S})=>{m.setValue(DevExpress.localization.formatDate(S,h))},value:(l?E(m.value):DevExpress.localization.parseDate(m.value,h))||null}),s.filterOperations=["=","<>","<",">","<=",">=","isblank","isnotblank"],s.calculateFilterExpression=function(m){let S=[t,...r];return S[0]&&(l?S[0]=E(S[0]):S[0]=DevExpress.localization.parseDate(m,h)||null),this.defaultCalculateFilterExpression(...S)}}i.push(s)}return i.sort((n,s)=>{let l=(n.caption||"").toLowerCase(),g=(s.caption||"").toLowerCase();return l<g?-1:l>g?1:0})}createFilterBuilder(){return $("<div />").dxFilterBuilder({fields:this.getFlatColumnsList(this.options.owner.option("columns"))}).dxFilterBuilder("instance")}createFilterPopupContent(t){let r=$("<div />").height("100%"),i=$('<div class="aps-filters__name-container" />').height("36px");this.filterNameTextBox=this.createFilterNameTextBox(),this.filterBuilder=this.createFilterBuilder(),this.filterIsGlobalCheckbox=this.createFilterIsGlobalCheckbox(),this.filterNameTextBox.option("value",t&&t.name),this.filterNameTextBox.element().appendTo(i),this.filterIsGlobalCheckbox.option("value",t&&t.isGlobal),this.filterIsGlobalCheckbox.element().appendTo(i),this.filterIsGlobalCheckbox.option("disabled",!this.options.canCreateGlobalFilters),i.appendTo(r),this.filterBuilder.option("value",t&&t.filterState);let n=$("<div />").height("calc(100% - 36px)").appendTo(r);return this.filterBuilder.element().appendTo(n),n.dxScrollView({scrollByContent:!0}),r}createFilterPopupToolbarItems(t){return t?[this.createUpdateFilterPopupToolbarItem(),this.createSaveFilterAsNewPopupToolbarItem(),this.createResetFilterPopupToolbarItem(),this.createDeleteFilterPopupToolbarItem()]:[this.createSaveFilterPopupToolbarItem()]}createSaveFilterPopupToolbarItem(){return{toolbar:"bottom",widget:"dxButton",location:"before",options:{text:"Apply and Save",onClick:this.createNewFilter.bind(this),icon:"save"}}}createUpdateFilterPopupToolbarItem(){return{toolbar:"bottom",widget:"dxButton",location:"before",options:{text:"Apply and Update",onClick:()=>{!this.options.gridFiltersManager.currentFilter||this.updateFilter(this.options.gridFiltersManager.currentFilter)},icon:"save"}}}createSaveFilterAsNewPopupToolbarItem(){return{toolbar:"bottom",widget:"dxButton",location:"before",options:{text:"Save As New",onClick:this.createNewFilter.bind(this),icon:"save"}}}createResetFilterPopupToolbarItem(){return{toolbar:"bottom",widget:"dxButton",location:"before",options:{text:"Reset",onClick:async()=>{!this.hasChanges||!this.filterBuilder||!this.options.gridFiltersManager.currentFilter||!await DevExpress.ui.dialog.confirm("Are you sure you want to reset unsaved changes?","Reset the data set")||this.resetChanges()},icon:"undo"}}}createDeleteFilterPopupToolbarItem(){return{toolbar:"bottom",widget:"dxButton",location:"before",options:{text:"Delete Data Set",onClick:async()=>{!this.options.gridFiltersManager.currentFilter||!await DevExpress.ui.dialog.confirm(`Are you sure you want to delete the "${this.options.gridFiltersManager.currentFilter.name}" data set?`,"Delete the data set")||(await this.deleteFilter(this.options.gridFiltersManager.currentFilterId),this.filterPopup.hide())},icon:"trash"}}}async openNewFilterPopup(){!await this.tryApplyFilter(void 0)||(this.updateFilterPopupContent(),this.filterPopup.show())}openEditFilterPopup(t){this.updateFilterPopupContent(t),this.filterPopup.show()}updateFilterPopupContent(t){let r=this.filterPopup.option("animation");this.filterPopup.option("animation",void 0),this.filterPopup.option("title",t?`Edit the "${t.name}" data set`:"Create a new data set"),this.filterPopup.option("contentTemplate",()=>this.createFilterPopupContent(t)),this.filterPopup.option("toolbarItems",this.createFilterPopupToolbarItems(t)),this.filterPopup.repaint(),this.filterPopup.option("animation",r)}async createNewFilter(){if(!this.filterNameTextBox||!this.filterBuilder||!this.filterIsGlobalCheckbox)return;let t=this.filterNameTextBox.option("value"),r=this.filterBuilder.option("value"),i=!1,n=this.filterIsGlobalCheckbox.option("value");if(!t)return;let s=await this.options.gridFiltersManager.createNewFilter(t,r,i,n);await this.loadFilterDropdownBoxData(),await this.applyFilter(s.id),P("Created",!0)}async updateFilter(t){if(!this.filterNameTextBox||!this.filterBuilder||!this.filterIsGlobalCheckbox)return;let r=this.filterNameTextBox.option("value"),i=this.filterBuilder.option("value"),n=this.filterIsGlobalCheckbox.option("value");!r||!await this.options.gridFiltersManager.updateFilter(t.id,{name:r,filterState:i,isGlobal:n})||(P("Updated",!0),await this.applyFilter(this.options.gridFiltersManager.currentFilter.id),await this.loadFilterDropdownBoxData())}async deleteFilter(t){await this.options.gridFiltersManager.deleteFilter(t),this.options.onFilterDeleted&&this.options.onFilterDeleted(t),await this.applyFilter(void 0),await this.loadFilterDropdownBoxData()}resetChanges(){this.filterNameTextBox.option("value",this.options.gridFiltersManager.currentFilter.name),this.filterBuilder.option("value",this.options.gridFiltersManager.currentFilter.filterState),this.filterIsGlobalCheckbox.option("value",this.options.gridFiltersManager.currentFilter.isGlobal)}async loadFilterDropdownBoxData(){if(!this.filtersDropdownBox)return;let[t,r]=await Promise.all([this.options.apsControlDisplayUserSettingsManager.getUserSettings(),this.options.gridFiltersManager.getFilters()]);if(t.defaultFilterId){let n=r.find(s=>s.id===t.defaultFilterId);n&&(n.isDefault=!0)}let i=new DevExpress.data.ArrayStore({key:"id",data:r});this.filtersDropdownBox.option("dataSource",i),this.filtersDataGrid&&this.filtersDataGrid.option("dataSource",i)}async confirmChangesLoss(){return await new Promise(t=>setTimeout(()=>t(),0)),!this.hasChanges||!this.filterPopup.option("visible")?!0:DevExpress.ui.dialog.confirm("You have unsaved changes that will be lost if you close this popup. Do you want to close the popup and not save changes?","Unsaved changes")}};var gt=class{constructor(t){this.$container=t.$container,this.cssClass=t.cssClass,this.maxFileSize=t.maxFileSize,this.acceptedFileTypes=t.acceptedFileTypes,this.selectButtonText=t.selectButtonText,this.allowedFileExtensions=t.allowedFileExtensions,this.onValueChanged=t.onValueChanged,this.onUploadStarted=t.onUploadStarted,this.onUploaded=t.onUploaded}render(){let t=$("<div />");this.cssClass&&t.addClass(this.cssClass),this.fileUploader=t.dxFileUploader({selectButtonText:this.selectButtonText,labelText:"",allowedFileExtensions:this.allowedFileExtensions,accept:this.acceptedFileTypes,uploadMode:"useForm",maxFileSize:this.maxFileSize,showFileList:!1,onValueChanged:r=>{var i;r.component.option("labelText",r.value[0]?r.value[0].name:""),(i=this.onValueChanged)==null||i.call(this,r)},onUploadStarted:r=>{var i;r.element.find(".dx-fileuploader-upload-button").hide(),(i=this.onUploadStarted)==null||i.call(this,r)},onUploaded:r=>{var i;(i=this.onUploaded)==null||i.call(this,r)}}).dxFileUploader("instance"),this.$container.append(this.fileUploader.element())}upload(t,r){return new Promise((i,n)=>{let s=new FormData,l=this.fileUploader.element().find("input")[0].files[0];s.append("file",l);for(let g in r)s.append(g,r[g]);$.ajax({url:t,type:"post",data:s,contentType:!1,processData:!1,success:g=>{g.RequestState===1?i(g.Data):n(g.Message)},error:g=>n("Unknown error")})})}};var pt=class extends z{constructor(t){super();this.fileUploadUrl=t.fileUploadUrl,this.$container=t.$container,this.title=t.title,this.getTablesListUrl=t.getTablesListUrl,this.createTableUrl=t.createTableUrl,this.addRowsUrl=t.addRowsUrl,this.predefinedTable=t.predefinedTable,this.canChangeMode=t.predefinedImportFileMode===void 0,this.mode=t.predefinedImportFileMode!==void 0?t.predefinedImportFileMode:0,this.createTableButtonText=t.createTableButtonText||"Create Table",this.updateTableButtonText=t.updateTableButtonText||"Add New Rows",this.createTableModeText=t.createTableModeText||"Create Table",this.updateTableModeText=t.updateTableModeText||"Add New Rows",this.tableSelectorProperties=t.tableSelectorProperties}show(){this.popup=$("<div />").appendTo(this.$container).dxPopup({showTitle:!0,title:this.title,visible:!1,dragEnabled:!1,resizeEnabled:!1,showCloseButton:!0,hideOnOutsideClick:!1,fullScreen:!0,maxWidth:1300,maxHeight:800,contentTemplate:t=>{let r=$("<div />");this.form=this.createForm(),r.append(this.form.element()),r.dxScrollView({width:"100%",height:"100%"}).appendTo(t)},toolbarItems:[{toolbar:"bottom",widget:"dxButton",location:"after",options:{text:this.getActionButtonText(),type:"success",onInitialized:t=>{this.actionButton=t.component},onClick:async()=>{this.mode===0?this.createTable():this.addRowsToTable()}}},{toolbar:"bottom",widget:"dxButton",location:"after",options:{text:"Cancel",onClick:()=>this.popup.hide()}}]}).dxPopup("instance"),this.popup.show(),this.onModeSwitching()}dispose(){this.popup&&this.popup.dispose()}createForm(){return $("<div>").dxForm({showColonAfterLabel:!0,labelLocation:"top",colCountByScreen:{md:4,sm:1},screenByWidth:r=>r<1256?"sm":"md",items:[{dataField:"Mode",itemType:"simple",template:(r,i)=>{this.createModeSwitcher(i)}},{dataField:"Schema",editorOptions:{disabled:!this.canChangeMode},validationRules:[{type:"required"}]},{dataField:"Table",editorOptions:{disabled:!this.canChangeMode},validationRules:[{type:"required"}]},{dataField:"TableSelector",label:{text:"Table"},editorType:"dxSelectBox",visible:!1,colSpan:2,editorOptions:A({dataSource:new DevExpress.data.DataSource({store:ce({loadUrl:this.getTablesListUrl,loadParams:{contextName:"",tablesOnly:!0,isWarehouseContext:!0},loadMethod:"post",notifyError:!1}),paginate:!1}),searchEnabled:!0},this.tableSelectorProperties),validationRules:[{type:"required"}]},{dataField:"Source File",itemType:"simple",template:(r,i)=>{this.createFilesUploader(i)}},{dataField:"Columns Selector",label:{visible:!1},colSpan:4,itemType:"simple",template:(r,i)=>{this.createDataGrid(i)}}]}).dxForm("instance")}createModeSwitcher(t){$("<div />").dxButtonGroup({items:[{text:this.createTableModeText,icon:"inserttable",value:0},{text:this.updateTableModeText,icon:"insertrowbelow",value:1}],keyExpr:"value",disabled:!this.canChangeMode,stylingMode:"outlined",selectionMode:"single",selectedItemKeys:[this.mode],onItemClick:r=>{this.mode=r.itemData.value,this.onModeSwitching()}}).appendTo(t)}createFilesUploader(t){this.fileUploader=new gt({$container:t,cssClass:"table-creator__upload",maxFileSize:10*1e6,acceptedFileTypes:".xls, .xlsx",allowedFileExtensions:[".xls",".xlsx"],selectButtonText:"Select Excel file",onValueChanged:async()=>{this.dataGrid.beginCustomLoading("Parsing selected file..."),this.fileUploader.upload(this.fileUploadUrl).then(r=>{if(r){this.setRowsCount(r.RowsCount);let i=new DevExpress.data.DataSource({store:{type:"array",key:"Id",data:r.Columns},paginate:!1});this.dataGrid.option("dataSource",i)}}).catch(r=>{P(`Parsing Error : ${r}`,!1)}).finally(()=>{this.dataGrid.endCustomLoading()})}}),this.fileUploader.render()}createDataGrid(t){let r={noDataText:"Select Excel File",hoverStateEnabled:!0,searchPanel:{visible:!1},groupPanel:{visible:!1},headerFilter:{visible:!1},filterRow:{visible:!1},sorting:{mode:"none"},paging:{pageSize:1e4,enabled:!1},editing:{allowUpdating:!0,mode:"cell"},selection:{mode:"none"},columns:[{dataField:"Id",visible:!1},{dataField:"Selected",dataType:"boolean",visible:this.mode===0},{dataField:"IsKeyColumn",dataType:"boolean",visible:this.mode===0},{dataField:"Name",caption:"Column Name"},{dataField:"Type",allowEditing:!1},{dataField:"IsNullable",allowEditing:this.mode===0&&this.canChangeMode,setCellValue:(i,n)=>{i.IsNullable=n,n&&(i.IsKeyColumn=!1)}}],remoteOperations:!1,onToolbarPreparing:i=>{i.toolbarOptions.items.push({template:()=>$("<div>").append($("<span>").addClass("table-creator__table-header").text("Parsed File Metadata")),location:"before"},{template:()=>(this.rowsCounter=$("<span>").text("1000"),this.rowsCounterContainer=$("<div>").append($("<span>").text("Rows Count: "),this.rowsCounter).hide(),this.rowsCounterContainer),location:"after"})},onEditorPreparing:i=>{if(i.parentType==="dataRow"&&i.dataField==="IsKeyColumn"){let n=i.editorOptions;n.disabled=i.row.data.IsNullable}}};this.dataGrid=V($("<div />"),{options:r,summaryColumn:"Name",isFullScreen:!1,setDefaultColumnWidth:!1}),t.append(this.dataGrid.element())}createTable(){if(this.form.validate().isValid){let r=this.dataGrid.getDataSource();r||P("Select file with data",!1);let i=r.items();if(!this.areColumnsValid(i))P("At least 1 key column must be set",!1);else{let n={schema:this.form.option("formData").Schema,table:this.form.option("formData").Table,columns:JSON.stringify(i)};this.dataGrid.beginCustomLoading("Creating and filling DB table..."),this.fileUploader.upload(this.createTableUrl,n).then(s=>{s===!0?(this.popup.hide(),P(`The table [${n.schema}].[${n.table}] has been created`,!0),this.emit(pt.TABLE_UPDATED_EVENT),this.emit(pt.TABLE_CREATED_EVENT,n)):P("The table has not been created",!1)}).catch(s=>{P(`Table creating error: ${s}`,!1)}).finally(()=>{this.dataGrid.endCustomLoading()})}}}addRowsToTable(){if(this.form.validate().isValid){let r=this.dataGrid.getDataSource();r||P("Select file with data",!1);let i=r.items(),n={table:this.form.option("formData").TableSelector,columns:JSON.stringify(i)};this.dataGrid.beginCustomLoading("Adding rows to DB table..."),this.fileUploader.upload(this.addRowsUrl,n).then(s=>{s===!0?(this.popup.hide(),P(`The table ${n.table} has been updated`,!0),this.emit(pt.TABLE_UPDATED_EVENT)):P("The table has not been updated",!1)}).catch(s=>{P(`Table updating error: ${s}`,!1)}).finally(()=>{this.dataGrid.endCustomLoading()})}}onModeSwitching(){let t=this.mode===0;this.actionButton.option("text",this.getActionButtonText()),this.dataGrid.columnOption("IsKeyColumn","visible",t),this.dataGrid.columnOption("IsNullable","visible",t),this.canChangeMode?(this.form.itemOption("Schema","visible",t),this.form.itemOption("Table","visible",t),this.form.itemOption("TableSelector","visible",!t)):(this.form.itemOption("Schema","visible",!0),this.form.updateData("Schema",this.predefinedTable.schema),this.form.itemOption("Table","visible",!0),this.form.updateData("Table",this.predefinedTable.table),this.form.itemOption("TableSelector","visible",!1))}getActionButtonText(){return this.mode===0?this.createTableButtonText:this.updateTableButtonText}areColumnsValid(t){return t.filter(r=>r.Selected).some(r=>r.IsKeyColumn)}setRowsCount(t){this.rowsCounterContainer.show(),this.rowsCounter.text(t)}},be=pt;be.TABLE_UPDATED_EVENT="file-importer-table-updated-event",be.TABLE_CREATED_EVENT="file-importer-table-created-event";var Po=class{constructor(t){this.onGridToolbarPreparing=t=>{let r=t.toolbarOptions&&t.toolbarOptions.items;if(!r)return;let i=[this.displaysToolbarItem];this.importFileOptions&&this.importFileOptions.mode!==0&&i.push(this.importFileToolbarItem),r.splice(1,0,...i)};this.options=t,this.gridDisplaysManager=t.gridDisplaysManager,this.gridViewsManager=t.gridViewsManager,this.gridFiltersManager=t.gridFiltersManager,this.importFileOptions=t.importFileOptions,this.gridDisplaysManager.onDisplaisLoaded=r=>{let i=new DevExpress.data.ArrayStore({key:"Id",data:r});this.displaysDropdownBox&&this.displaysDropdownBox.option("dataSource",i),this.dataGrid&&this.dataGrid.option("dataSource",i),this.dataGrid&&this.dataGrid.endCustomLoading()},this.gridDisplaysManager.onDisplayChanged=r=>{this.displaysDropdownBox&&this.displaysDropdownBox.option("value",r?r.Id:null),this.currentDisplayTitle&&this.currentDisplayTitle.option("value",r?r.Name:null),this.currentDisplayTitle&&this.currentDisplayTitle.option("disabled",!r),this.saveAsButton&&this.saveAsButton.option("disabled",!r),this.saveButton&&this.saveButton.option("disabled",!r),this.dataGrid&&(r?this.dataGrid.selectRows([r.Id],!1):this.dataGrid.deselectAll())},this.integrateToGrid(this.options.owner)}integrateToGrid(t){let r=t.option("onToolbarPreparing");t.option("onToolbarPreparing",i=>{r&&r(i),this.onGridToolbarPreparing(i)})}createDataGrid(t){return $("<div />").dxDataGrid({dataSource:t.getDataSource(),remoteOperations:!1,editing:{allowAdding:!1,allowUpdating:!1,allowDeleting:this.options.editMode,mode:"row",useIcons:!0,texts:{confirmDeleteMessage:"Are you sure you want to delete this display?"}},loadPanel:{shading:!0},allowColumnResizing:!0,columnAutoWidth:!0,wordWrapEnabled:!0,columns:[{dataField:"Name",caption:"Display"},{dataField:"FilterId",caption:"Data Set",lookup:{valueExpr:"id",displayExpr:"name"}},{dataField:"ViewId",caption:"View",lookup:{valueExpr:"id",displayExpr:"name"}}],keyboardNavigation:{editOnKeyPress:!1,enabled:!1},showColumnHeaders:!0,hoverStateEnabled:!0,focusedRowEnabled:!1,showBorders:!1,height:this.options.editMode?"calc(100% - 51px)":"100%",scrolling:{mode:"standard"},paging:{enabled:!1},noDataText:"No displays",onInitialized:async r=>{let i=await this.gridFiltersManager.getFilters(),n=await this.gridViewsManager.getViews();r.component.columnOption("FilterId","lookup.dataSource",i),r.component.columnOption("ViewId","lookup.dataSource",n)},onCellClick:async r=>{r.rowType==="data"&&t.option("value",r.data.Id)},onRowRemoving:async r=>{this.dataGrid.beginCustomLoading("Loading"),await this.gridDisplaysManager.deleteDisplay(r.key)}}).dxDataGrid("instance")}createDisplaysToolbarItem(){let t={valueExpr:"Id",displayExpr:"Name",showClearButton:!0,placeholder:"None",width:200,onInitialized:i=>{this.displaysDropdownBox=i.component,this.gridDisplaysManager.getDisplays()},onValueChanged:async i=>{let n=this.gridDisplaysManager.currentDisplay,s=n&&n.FilterId!==this.gridFiltersManager.currentFilterId,l=n&&n.ViewId!==this.gridViewsManager.currentViewId;await(s||l?this.confirmChangesLoss():Promise.resolve(!0))&&(this.gridDisplaysManager.currentDisplayId=i.value)}},r={elementAttr:{class:"iszolea-md"},dropDownOptions:{width:800},contentTemplate:this.options.editMode?i=>{this.dataGrid=this.createDataGrid(i.component),this.currentDisplayTitle=this.createCurrentDisplayTitle(i.component),this.saveButton=this.createSaveViewButton(),this.saveAsButton=this.createSaveViewAsButton();let n=$("<div />").addClass("aps-displays__header").append(this.currentDisplayTitle.element()).append(this.saveButton.element()).append(this.saveAsButton.element()),s=$("<div />").height("100%");return this.options.editMode&&s.append(n),s.append(this.dataGrid.element()),s}:void 0,onOpened:()=>{this.saveAsButton&&this.saveAsButton.option("disabled",!this.gridFiltersManager.currentFilterId),this.saveButton&&this.saveButton.option("disabled",!this.gridDisplaysManager.currentDisplay)}};return{widget:this.options.editMode?"dxDropDownBox":"dxSelectBox",location:"after",text:"Displays",cssClass:"aps-displays__toolbar-item",options:this.options.editMode?$.extend(t,r):t}}createImportFileToolbarItem(){return{location:"after",widget:"dxButton",options:{icon:"upload",hint:"Import file",height:30,stylingMode:"text",onClick:()=>{this.fileImporter&&this.fileImporter.dispose(),this.fileImporter=new be({$container:this.options.owner.element().parent(),title:"Import File to CDM",createTableUrl:this.importFileOptions.createTableUrl,addRowsUrl:this.importFileOptions.addRowsUrl,fileUploadUrl:this.importFileOptions.fileUploadUrl,predefinedImportFileMode:this.getPredefinedImportFileMode(this.importFileOptions.mode),predefinedTable:this.importFileOptions.predefinedTable,createTableButtonText:"Replace All Rows",createTableModeText:"Replace Rows"}),this.fileImporter.on(be.TABLE_UPDATED_EVENT,()=>this.options.owner.refresh()),this.fileImporter.show()},onContentReady:t=>{t.element.find(".dx-button-content").css({paddingTop:5,paddingBottom:5})}}}}getPredefinedImportFileMode(t){switch(t){case 1:return 1;case 2:return 0;default:throw new Error("Unsupported mode")}}createCurrentDisplayTitle(t){return $("<div />").addClass("aps-displays__current-display iszolea-md").dxTextBox({value:t.option("text")||t.option("placeholder"),disabled:!this.gridDisplaysManager.currentDisplay}).dxTextBox("instance")}createSaveViewButton(){return $("<button />").addClass("aps-displays__save-display iszolea-md").dxButton({text:"Save",type:"normal",disabled:!this.gridDisplaysManager.currentDisplay,onClick:()=>{this.dataGrid.beginCustomLoading("Loading"),this.gridDisplaysManager.updateCurrentDisplay(this.currentDisplayTitle.option("value"),this.gridFiltersManager.currentFilterId,this.gridViewsManager.currentViewId)},icon:"save",width:125}).dxButton("instance")}createSaveViewAsButton(){return $("<button />").addClass("aps-display__save-display-as iszolea-md").dxButton({text:"Save As",type:"normal",disabled:!this.gridFiltersManager.currentFilterId,onClick:()=>this.createSaveAsDialog(),icon:"save",width:160}).dxButton("instance")}createSaveAsDialog(){let t=$("<div />"),r=$('<div style="margin-bottom:8px;" />').dxTextBox({placeholder:"Display Name",showClearButton:!0}).dxValidator({validationRules:[{type:"required"}]}),i=r.dxTextBox("instance"),n=r.dxValidator("instance");return i.element().appendTo(t),J({title:"Create New Display",height:"auto",width:"100%",maxWidth:"300px"},t,{text:"Ok",onClick:async s=>{!n.validate().isValid||(this.dataGrid.beginCustomLoading("Loading"),this.gridDisplaysManager.createNewDisplay(i.option("value"),this.gridFiltersManager.currentFilterId,this.gridViewsManager.currentViewId),s())}},{text:"Cancel",onClick:s=>s()})}async confirmChangesLoss(){return DevExpress.ui.dialog.confirm("You have unsaved changes that will be lost if you close this popup. Do you want to close the popup and not save changes?","Unsaved changes")}get displaysToolbarItem(){return this._displaysToolbarItem||(this._displaysToolbarItem=this.createDisplaysToolbarItem()),this._displaysToolbarItem}get importFileToolbarItem(){return this._importFileToolbarItem||(this._importFileToolbarItem=this.createImportFileToolbarItem()),this._importFileToolbarItem}};var No=class{constructor(t){this._currentDisplayId=0;this.getDisplayById=t=>!t||!this.displays?null:this.displays.find(r=>r.Id===t);this.loadDataUrl=t.loadDataUrl,this.insertDataUrl=t.insertDataUrl,this.updateDataUrl=t.updateDataUrl,this.deleteDataUrl=t.deleteDataUrl,this.eventHandlers={changed:[],loaded:[]}}async loadDisplays(){return this.displays=await se(this.loadDataUrl),this.onDisplaisLoadedPrivate(),this.displays}async getDisplays(){return this.displays||await this.loadDisplays()}async createNewDisplay(t,r,i){let n={Id:0,Name:t,FilterId:r,ViewId:i};await x(this.insertDataUrl,"POST",n),await this.loadDisplays()}async deleteDisplay(t){await x(this.deleteDataUrl,"DELETE",{id:t}),await this.loadDisplays()}updateCurrentDisplay(t,r,i){return this.updateDisplay(this.currentDisplay.Id,t,r,i)}async updateDisplay(t,r,i,n){await x(this.updateDataUrl,"PUT",{id:t,name:r,filterId:i,viewId:n}),await this.loadDisplays()}onDisplayChangedPrivate(){this.eventHandlers.changed.forEach(t=>t(this.currentDisplay))}onDisplaisLoadedPrivate(){this.eventHandlers.loaded.forEach(t=>t(this.displays))}get currentDisplayId(){return this._currentDisplayId}set currentDisplayId(t){this._currentDisplayId=t,this.onDisplayChangedPrivate()}get currentDisplay(){return this.getDisplayById(this._currentDisplayId)}set onDisplayChanged(t){this.eventHandlers.changed.push(t)}set onDisplaisLoaded(t){this.eventHandlers.loaded.push(t)}};var Lo=class{constructor(t){this.onGridEditorPreparing=t=>{if(!t.component||!t.editorOptions||t.parentType!=="dataRow"||!t.dataField||!t.row||!t.row.key)return;let r=t.dataField,i=t.row.key,n=t.editorOptions.onValueChanged;t.editorOptions.onValueChanged=s=>{n(s),this.updateMultipleRows(r,i,s.value)}};this.options=O(A({},t),{autoIntegration:t.autoIntegration!==void 0&&t.autoIntegration!==null?t.autoIntegration:!0}),this.options.autoIntegration&&this.integrateToGrid(this.options.owner)}integrateToGrid(t){t.option("selection",{mode:"multiple"}),t.on("editorPreparing",this.onGridEditorPreparing)}async updateMultipleRows(t,r,i){let n=await this.options.owner.getSelectedRowKeys();if(!n.length)return;let s=n.findIndex(l=>l===r);s<0||n.length===1||(n.splice(s,1),n.forEach(l=>{this.options.owner.cellValue(this.options.owner.getRowIndexByKey(l),t,i)}))}};var Bo=class{constructor(t){this.defaultUserSettings={defaultFilterId:void 0,defaultViewId:W.defaultControlDisplayView.id};this.isLatestLoadedUserSettingsExpired=!0;this.options=A({},t),this.options.loadedUserSettings&&(this.latestLoadedUserSettings=this.options.loadedUserSettings),this.startAutoCacheResettingTimer()}get latestLoadedUserSettings(){return this._latestLoadedUserSettings}set latestLoadedUserSettings(t){this._latestLoadedUserSettings=t,this.isLatestLoadedUserSettingsExpired=!1}async getUserSettings(){if(!this.isLatestLoadedUserSettingsExpired)return this.latestLoadedUserSettings;try{this.latestLoadedUserSettings=await this.loadUserSettings()}catch(t){console.error(t)}return this.latestLoadedUserSettings}async updateUserSettings(t){try{this.latestLoadedUserSettings=await this.updateUserSettingsInternal(t)}catch(r){console.error(r)}return this.latestLoadedUserSettings}startAutoCacheResettingTimer(){this.autoResettingCacheTimerId=window.setInterval(()=>{this.isLatestLoadedUserSettingsExpired=!0},5e3)}stopAutoCacheResettingTimer(){window.clearInterval(this.autoResettingCacheTimerId)}},jt=class extends Bo{async loadUserSettings(){let t=localStorage.getItem(jt.userSettingsStorageKey);return t?JSON.parse(t):this.defaultUserSettings}async updateUserSettingsInternal(t){let r=await this.getUserSettings(),i=A(A({},r),t);return localStorage.setItem(jt.userSettingsStorageKey,JSON.stringify(i)),i}},Mr=jt;Mr.userSettingsStorageKey="aps:control-display:user-settings";var Fo=class extends Bo{constructor(t){super(t);this.loadDataUrl=t.loadDataUrl,this.updateDataUrl=t.updateDataUrl}async loadUserSettings(){let t=await se(this.loadDataUrl);return t?this.mapControlDisplayUserSettingsDtoToModel(t):this.defaultUserSettings}async updateUserSettingsInternal(t){let r=await this.getUserSettings(),i=A(A({},r),t),n=await x(this.updateDataUrl,"PUT",this.mapControlDisplayUserSettingsModelToDto(i));return this.mapControlDisplayUserSettingsDtoToModel(n)}mapControlDisplayUserSettingsModelToDto(t){return{DefaultFilterId:t.defaultFilterId,DefaultViewId:t.defaultViewId}}mapControlDisplayUserSettingsDtoToModel(t){return{defaultFilterId:t.DefaultFilterId,defaultViewId:t.DefaultViewId}}};function Or(o){let t="",r=o.filter(n=>n.visible),i=r.filter(n=>n.visibleIndex!==null&&n.visibleIndex!==void 0);return i.length?t=i.sort((n,s)=>n.visibleIndex-s.visibleIndex)[0].dataField:t=r[0]&&r[0].dataField||"",t}var ze=class{constructor(t){this.gridGetter=t,this.privateContructor()}get grid(){return this.gridGetter()}getServiceColumns(){return[]}getRowUpdatingHandler(){}dataRowCellPrepared(t,r,i){}};function jo(o){return typeof o=="string"?o:JSON.stringify(o)}var Vt=class{constructor(){this.invalidCells={}}addInvalidCell(t,r){let i=jo(t);this.invalidCells[i]||(this.invalidCells[i]={}),this.invalidCells[i][r]=!0}markValid(t,r){let i=jo(t);this.invalidCells[i]&&delete this.invalidCells[i][r]}isValid(t,r){let i=jo(t);return!this.invalidCells[i]||!this.invalidCells[i][r]}reset(){this.invalidCells={}}};var Vo=class extends z{constructor(t){super();this.REQUEST_STATUS_UPDATED_EVENT="REQUEST_STATUS_UPDATED";this.pendingChanges=[];this.isRequestPending=!1;this.updateUrl=t}push(t,r=!1){this.emit(this.REQUEST_STATUS_UPDATED_EVENT,{dataChange:[t],status:0}),t.isSeparatedRequest=r,this.isRequestPending?this.pendingChanges.push(t):this.sendRequest([t])}async sendRequest(t){if(t.length!==0){this.isRequestPending=!0,this.emit(this.REQUEST_STATUS_UPDATED_EVENT,{dataChange:t,status:1});try{let r=await x(this.updateUrl,"POST",JSON.stringify(t),!1,{contentType:"application/json"}),i=r.filter(n=>n.isSuccess);i.length&&this.emit(this.REQUEST_STATUS_UPDATED_EVENT,{status:2,dataChange:i.map(n=>n.dataChange),requestsInQueue:this.pendingChanges.length>0}),r.filter(n=>!n.isSuccess).forEach(n=>{this.emit(this.REQUEST_STATUS_UPDATED_EVENT,{status:3,dataChange:[n.dataChange],requestsInQueue:this.pendingChanges.length>0,error:n.error})})}catch(r){this.emit(this.REQUEST_STATUS_UPDATED_EVENT,{status:3,dataChange:t,requestsInQueue:this.pendingChanges.length>0,error:r})}finally{this.isRequestPending=!1;let r=[];for(;this.pendingChanges.length;){if(this.pendingChanges[0].isSeparatedRequest){r.length||(r.push(this.pendingChanges.shift()),this.pendingChanges.shift());break}r.push(this.pendingChanges.shift())}r.length&&this.sendRequest(r)}}}};function ko(){let o=new Date().getTime(),t=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){let i=Math.random()*16;return o>0?(i=(o+i)%16|0,o=Math.floor(o/16)):(i=(t+i)%16|0,t=Math.floor(t/16)),(r==="x"?i:i&3|8).toString(16)})}var en=(o,t)=>o.getDataSource().items().find(i=>{for(let n in t)if(i[n]!==t[n])return!1;return!0}),Ye="isoz-uuid",kt="isoz-updating-error",Gt=class extends ze{constructor(t,r,i){super(t);this.editValidationTracker=new Vt;this.pendingInsertPromise=null;this.requestQueue=new Vo(r),this.setupRequestQueue(i)}setupRequestQueue(t){let r=null,i=(n,s,l)=>{window.setTimeout(()=>{let g=this.grid.getRowElement(this.grid.getRowIndexByKey(s));!g||(n==="updating"&&g.addClass("saving"),n==="updated"&&(g.removeClass("saving").addClass("saved"),g.css({opacity:"",pointerEvents:""}),window.setTimeout(()=>g.removeClass("saved"),1e3)))})};this.requestQueue.on(this.requestQueue.REQUEST_STATUS_UPDATED_EVENT,async n=>{switch(n.status){case 0:n.dataChange.forEach(s=>{s.type==="update"&&i("updating",s.key)});break;case 1:r&&window.clearTimeout(r),t.html("<i class='dx-icon-refresh'></i> Saving...");break;case 2:r&&window.clearTimeout(r),n.requestsInQueue||(t.html("<i class='dx-icon-floppy'></i> Saved"),r=window.setTimeout(()=>t.html(""),3e3)),n.dataChange.forEach(s=>{s.type==="update"&&i("updated",s.key),s.type==="insert"&&this.pendingInsertPromise&&this.pendingInsertPromise&&(this.pendingInsertPromise.resolve(s.data),this.pendingInsertPromise=null)});break;case 3:n.dataChange.forEach(s=>{if(s.type==="insert"&&this.pendingInsertPromise&&(this.pendingInsertPromise.reject(n.error),this.pendingInsertPromise=null),s.type==="update"){let l=s.data[Ye],g="";if(l){let p=this.grid.getVisibleRows();for(let h=0;h<p.length;h++)if(p[h].data[Ye]===l){let E=n.error,m=h,S=Object.keys(s.data).find(T=>T!==Ye);g=S,this.grid.cellValue(h,kt,JSON.stringify({errMsg:E,rowIndex:m,editingField:S})),this.grid.saveEditData();break}}}});break}})}privateContructor(){}createDataSource(t){return{store:new DevExpress.data.CustomStore({key:t.key(),load:r=>t.load(r),byKey:(r,i)=>t.byKey(r,i),update:(r,i)=>{let n=$.Deferred();if(i[kt]){let{errMsg:s,rowIndex:l,editingField:g}=JSON.parse(i[kt]);n.reject(s);let p=this.grid.getKeyByRowIndex(l);p&&this.editValidationTracker.addInvalidCell(p,g),this.grid.getCellElement(l,g).addClass("aps-grid__editing-failed")}else{let s=en(this.grid,r);Object.keys(i).forEach(l=>{this.editValidationTracker.markValid(r,l)}),n.resolve($.extend(s||{},i)),this.requestQueue.push({key:r,type:"update",data:i})}return n.promise()},insert:r=>(this.pendingInsertPromise=$.Deferred(),this.requestQueue.push({type:"insert",data:r}),this.pendingInsertPromise.promise()),remove:r=>{let i=$.Deferred();return i.resolve(),this.requestQueue.push({type:"remove",key:r}),i.promise()},onLoaded:()=>{this.editValidationTracker.reset()}})}}getServiceColumns(){return[{visible:!1,dataField:Ye},{visible:!1,dataField:kt}]}getRowUpdatingHandler(){return t=>{let r=t.component.getRowIndexByKey(t.key),i=ko();t.component.getVisibleRows()[r].data[Ye]=i,t.newData[Ye]=i}}dataRowCellPrepared(t,r,i){this.editValidationTracker.isValid(t,r)||i.addClass("aps-grid__editing-failed")}};var $t=class extends ze{createDataSource(t){return{store:t}}privateContructor(){}};var tn={[1]:"string",[2]:"string",[8]:"string",[3]:"string",[4]:"string",[5]:"number",[6]:"string",[7]:"string",[10001]:"string",[10002]:"number",[10003]:"number",[10004]:"boolean",[10005]:"datetime",[10006]:"date"},ut=class{constructor(t){this.editingMode=2;this.fieldRefDataDict={};this.tryParseJson=t=>{try{return JSON.parse(t.toString())}catch{return}};this.onViewApplied=t=>{this.clearFilterRowAfterViewSwitching()};this.$container=t.$container,this.$savingIndicator=t.$savingIndicator,this.isStandalonePage=t.isStandalonePage,this.pageTitle=t.pageTitle,this.exportFileName=t.exportFileName,this.userName=t.userName,this.userConfigUrl=t.userConfigUrl,this.controlLogsUrl=t.controlLogsUrl,this.loadDataUrl=t.loadDataUrl,this.updateDataUrl=t.updateDataUrl,this.addDataUrl=t.addDataUrl,this.deleteDataUrl=t.deleteDataUrl,this.uploadDocumentUrl=t.uploadDocumentUrl,this.downloadDocumentUrl=t.downloadDocumentUrl,this.gridFiltersManagerOptions=t.gridFiltersManagerOptions,this.gridViewsManagerOptions=t.gridViewsManagerOptions,this.gridDisplaysManagerOptions=t.gridDisplaysManagerOptions,this.remoteControlDisplayUserSettingsManagerLoadOptions=t.remoteControlDisplayUserSettingsManagerLoadOptions,this.importFileOptions=t.importFileOptions,this.disableGlobalSearch=!!t.disableGlobalSearch,this.editingMode=t.enableInlineEditing?2:1,this.allowDataEditing=t.allowDataEditing,this.getReferencedDataUrl=t.getReferencedDataUrl,this.asyncSummaryLoad=t.asyncSummaryLoad,this.editingManager=this.editingMode===2?new Gt(()=>this.mainGrid,t.batchUpdateDataUrl,this.$savingIndicator):new $t(()=>this.mainGrid),this.imageManager=new ke,this.imageManager.onUploaded(async r=>{let i=this.imageManager.images.length;this.imageManager.images=await this.uploadAndUpdateDocuments(r,1),this.imageManager.selectedIndex=i}),this.imageManager.onDeleted(r=>{this.imageManager.images=this.deleteDocumentHandler(r)}),this.imageManager.onReordered(()=>this.reorderImagesHandler(this.imageManager.images)),this.documentManager=new Ge({width:550,height:600}),this.documentManager.onUploaded(async r=>{this.documentManager.documents=await this.uploadAndUpdateDocuments(r,2)}),this.documentManager.onDeleted(r=>{this.documentManager.documents=this.deleteDocumentHandler(r)}),this.documentManager.onOpen(r=>{window.open(`${this.downloadDocumentUrl}?name=${r}`,"_blank")}),this.documentManager.onDownload(r=>{window.open(r,"_blank")}),this.imageGallery=new $e,this.$container.addClass(["aps-grid","control-display-grid"]),this.loadPanel=$("<div />").dxLoadPanel({message:"Uploading..."}).dxLoadPanel("instance"),$(document.body).append(this.loadPanel.element())}showLoader(t="Uploading..."){this.loadPanel.option("message",t),this.loadPanel.show()}hideLoader(){this.loadPanel.hide()}async render(){this.showLoader("Loading...");let t=await x(this.userConfigUrl),i=t.FieldsConfiguration.filter(p=>{let h=p.DisplayType?JSON.parse(p.DisplayType):null;return(h==null?void 0:h.type)===8}).map(p=>p.Name).map(p=>x(`${this.getReferencedDataUrl}?field=${p}`).then(h=>this.fieldRefDataDict[p]=h));await Promise.all(i),this.hideLoader();let n=new dt(this.gridFiltersManagerOptions),s=new W(this.gridViewsManagerOptions),l=new No(this.gridDisplaysManagerOptions);this.mainGrid=this.createMainGrid(t.FieldsConfiguration,t.CanBeCreated,t.CanBeDeleted);let g=t.CanCreateDisplays&&t.CanCreateViews&&t.CanCreateFilters;(g||t.CanApplayDisplays)&&(this.gridDisplaysToolbarComponent=new Po({owner:this.mainGrid,editMode:g,gridFiltersManager:n,gridViewsManager:s,gridDisplaysManager:l,importFileOptions:this.importFileOptions})),this.gridViewsToolbarComponent=new Oo({owner:this.mainGrid,onViewApplied:this.onViewApplied,onViewDeleted:async()=>{await l.loadDisplays()},autoIntegration:!0,gridViewsManager:s,canCreateGlobalViews:t.CanCreateGlobalViews,visible:t.CanCreateViews}),this.gridFiltersToolbarComponent=new Uo({apsControlDisplayUserSettingsManager:new Fo({userId:this.userName,loadDataUrl:this.remoteControlDisplayUserSettingsManagerLoadOptions.loadDataUrl,updateDataUrl:this.remoteControlDisplayUserSettingsManagerLoadOptions.updateDataUrl}),owner:this.mainGrid,onFilterDeleted:async p=>{await l.loadDisplays()},autoIntegration:!0,gridFiltersManager:n,canCreateGlobalFilters:t.CanCreateGlobalFilters,visible:t.CanCreateFilters}),this.multipleEditingDataGridPlugin=new Lo({owner:this.mainGrid}),l.onDisplayChanged=async p=>{p?(await this.gridFiltersToolbarComponent.applyFilter(p.FilterId,!0),await this.gridViewsToolbarComponent.applyView(p.ViewId)):(this.gridFiltersToolbarComponent.applyFilter(void 0,!0),await this.gridViewsToolbarComponent.applyView(W.defaultControlDisplayView.id))}}async uploadAndUpdateDocuments(t,r){let i=[];try{this.showLoader("Uploading...");let n=new FormData;n.append("type",r.toString());for(let g of t)n.append("files",g);let l=await(await fetch(this.uploadDocumentUrl,{method:"POST",body:n})).json();if(l.RequestState===1){let g=this.mainGrid.cellValue(this.activeDocumentCellInfo.rowIndex,this.activeDocumentCellInfo.field),p=ae(g)?JSON.parse(g):[],h=l.Data;p.push(...h),this.mainGrid.cellValue(this.activeDocumentCellInfo.rowIndex,this.activeDocumentCellInfo.field,JSON.stringify(p)),this.editingMode===2&&this.mainGrid.saveEditData(),i=p}else P(l.Message,!1)}catch{P("Error",!1)}finally{this.hideLoader()}return i}changePreviewImageSizeHandler(t,r){this.gridViewsToolbarComponent.options.gridStateManager.setFieldPreviewSize(t,r);let n=this.mainGrid.getVisibleRows().map(s=>s.rowIndex);this.mainGrid.repaintRows(n)}deleteDocumentHandler(t){let r=this.mainGrid.cellValue(this.activeDocumentCellInfo.rowIndex,this.activeDocumentCellInfo.field),n=(ae(r)?JSON.parse(r):[]).filter(s=>s.Id!==t);return this.mainGrid.cellValue(this.activeDocumentCellInfo.rowIndex,this.activeDocumentCellInfo.field,n.length?JSON.stringify(n):""),this.editingMode===2&&this.mainGrid.saveEditData(),n}reorderImagesHandler(t){this.mainGrid.cellValue(this.activeDocumentCellInfo.rowIndex,this.activeDocumentCellInfo.field,t.length?JSON.stringify(t):"")}hasPermission(t,r){return(t&r)!==0}buildTree(t){let r="__GROUP__",i=t.reduce((s,l)=>(l.Columns=[],l.GroupField=l.GroupField?`${r}${l.GroupField}`:null,s[l.Name]=l,s),{});i=t.filter(s=>s.GroupField).map(s=>s.GroupField).filter((s,l,g)=>g.indexOf(s)===l).reduce((s,l)=>{let g=l.replace(r,""),p={Name:l,Label:g,Columns:[],GroupField:i[g]&&i[g].GroupField&&i[g].GroupField!==l?i[g].GroupField:null};return s[l]=p,s},i);let n=[];for(let s in i)if(i.hasOwnProperty(s)){let l=i[s];l.GroupField?i[l.GroupField].Columns.push(l):n.push(l)}return n}renderDisplayType(t,r,i,n){var s;if(t.type===1&&(r.cellTemplate=(l,g)=>{let p=String(g.value),h=t.data.find(E=>String(E.value)===p);h?$("<div>").css({"text-align":"center"}).attr("title",h.title).append($("<img>",{src:h.image})).appendTo(l):$("<div />").css({"text-align":"center"}).text(g.value).appendTo(l)},r.editCellTemplate=(l,g)=>{var p;$("<div />").dxSelectBox({dataSource:t.data,displayValue:"title",itemTemplate:h=>$("<div />").css({"text-align":"center"}).attr("title",h.title).append($("<img>",{src:h.image})).appendTo(l),fieldTemplate:(h,E)=>{let m=t.data.find(I=>{var y;return I.value.toString()===((y=g.value)==null?void 0:y.toString())}),S=$("<div />").addClass("item-name"),T=$("<div />").addClass("aps-icon-editor__custom-item").append($("<img>",{src:m?m.image:""}).attr("title",m?m.title:"")).append(S);S.dxTextBox({value:"",readOnly:!0}),E.append(T)},onValueChanged:({value:h,component:E})=>{g.setValue(parseInt(h.value)),E.blur()},value:(p=g.value)==null?void 0:p.toString(),selectedItem:t.data.find(h=>parseInt(h.value)===g.value)}).appendTo(l)},r.allowSearch=!1,r.allowFiltering=!1,r.allowHeaderFiltering=!0,r.allowGrouping=!1),t.type===2){let l=((s=t.data)==null?void 0:s.items)||[];r.cellTemplate=(g,p)=>{let h=this.getPredefinedValuesToString(p.value,t);g.append(h)},r.editCellTemplate=(g,p)=>{let h=(p.value||"").toString().split(";").map(m=>parseInt(m)),E=$("<div />").dxDropDownBox({dataSource:l,valueExpr:"key",displayExpr:"value",value:h,showClearButton:!0,acceptCustomValue:!1,dropDownOptions:{width:400},contentTemplate:m=>{var S;return $("<div />").dxDataGrid({dataSource:l,keyExpr:"key",columns:[{dataField:"key",visible:!1},{dataField:"value"}],showBorders:!1,showColumnLines:!1,showRowLines:!1,showColumnHeaders:!1,selection:{mode:((S=t.data)==null?void 0:S.multiselect)?"multiple":"single"},selectedRowKeys:h,activeStateEnabled:!1,onSelectionChanged:T=>{let I=T.component.option("selectedRowKeys");m.component.option("value",I)}})},onValueChanged:m=>{let S=(m.value||[]).join(";");p.setValue(S)}}).dxDropDownBox("instance");g.append(E.element()),E.open()},r.headerFilter={dataSource:l.map(g=>({text:g.value,value:[r.dataField,"contains",g.key.toString()]}))},r.filterOperations=["contains"],r.calculateFilterExpression=(g,p,h)=>{if(h==="headerFilter")return[r.dataField,"contains",g];{let E=p==="<>"||p==="notcontains",m=l.filter(T=>{switch(p){case"contains":return T.value.includes(g);case"notcontains":return T.value.includes(g);case"startswith":return T.value.startsWith(g);case"endswith":return T.value.endsWith(g);case"=":return T.value===g;case"<>":return T.value===g;default:return!1}}).map(T=>[r.dataField,E?"notcontains":"contains",T.key.toString()]);return E?m.push([r.dataField,"=",null]):m.length||m.push([r.dataField,"=","__no_value__"]),m.flatMap(T=>[E?"and":"or",T]).slice(1)}}}if(t.type===8){let l=t.data.fields.map(m=>({dataField:m,allowSearch:!0,allowFiltering:!0})),g=this.getReferencedDataUrl[r.dataField]||[],p=m=>{if(m===null)return[];if(Array.isArray(m))return m;let S=this.tryParseJson(m)||m;return Array.isArray(S)?S:[S]},h=(m,S,T)=>m?S.length===1?m[S[0]]:S.reduce((y,u)=>(y.push(`${u}: ${m.hasOwnProperty(u)?m[u]:T?'<i class="referenced-value-error">Field deleted or renamed</i>':"undefined"}`),y),[]).join(", "):"",E=(m,S,T)=>{let I=$("<div />");return p(m).forEach(y=>{let u=S.lookup.calculateCellValue(y);u||T||!y?I.append(u?`<div>${u}</div>`:""):I.append(`<div><i class="referenced-value-error">Row ${t.data.table}.[${t.data.key}]=${y} not found</i></div>`)}),I};r.cellTemplate=(m,S)=>{m.append(E(S.value,S.column,S.row.isNewRow))},r.editCellTemplate=(m,S)=>{let T=$("<div />").dxDataGrid({height:500,width:"100%",dataSource:g,remoteOperations:!0,scrolling:{mode:"virtual"},selection:{mode:t.data.multiselect?"multiple":"single",showCheckBoxesMode:"always"},headerFilter:{visible:!0},filterRow:{visible:!0},selectedRowKeys:p(S.value),columns:[{dataField:t.data.key,visible:!1},...l],onSelectionChanged:y=>{I.option("value",y.selectedRowKeys)}}).dxDataGrid("instance"),I=$("<div />").dxDropDownBox({dataSource:g,value:p(S.value),valueExpr:t.data.key,displayExpr:y=>h(y,t.data.fields,!1),contentTemplate:()=>T.element(),showClearButton:!0,dropDownOptions:{width:500},onValueChanged:y=>{let u=y.value;if(!(u==null?void 0:u.length))S.setValue(null);else{let v=t.data.multiselect?JSON.stringify(u):u[0];S.setValue(v)}!t.data.multiselect&&(u==null?void 0:u.length)&&I.close()}}).dxDropDownBox("instance");m.append(I.element()),I.open()},r.lookup={dataSource:g,valueExpr:t.data.key,displayExpr:m=>h(m,t.data.fields,!0)},r.groupCellTemplate=(m,S)=>{m.append($(`
|
|
55
|
+
`);s.push({location:"before",template:()=>T})}},onEditorPreparing:n=>{n.parentType==="dataRow"&&n.dataField==="Name"&&(n.editorOptions.disabled=!n.row.isNewRow||!!n.row.data.IsSystemColumn)},onInitNewRow:n=>{n.data=A({IsKeyColumn:!1,IsDefaultViewField:!0,IsExported:!0,IsSystemColumn:!1,IsIdentity:!1,IsComputed:!1,IsNullable:!0,HasDefaultValue:!1},this.systemFieldPredefinedData||{}),this.systemFieldPredefinedData=null},onRowRemoved:n=>{this.fields=this.fields.filter(s=>s!==n.data.Name)},onRowInserted:n=>{this.fields.push(n.data.Name)}},i={summaryColumn:"Name"};return this.isStandalonePage?t=He(this.$container,r,i,this.pageTitle,"",!0):t=V(this.$container,{options:r,summaryColumn:i.summaryColumn,title:this.pageTitle,isFullScreen:!1}),t}prepareMainGridColumns(t){return t.forEach(r=>{(r.allowHiding===void 0||r.allowHiding===null)&&(r.allowHiding=!1),(r.showInColumnChooser===void 0||r.showInColumnChooser===null)&&(r.showInColumnChooser=!1)}),t}createMainGridDataSource(){return{store:It({loadUrl:this.loadDataUrl,key:"Name",notifyError:!1})}}};DevExpress.ui.dxDataGrid.registerModule("columnChooserSorting",{extenders:{controllers:{columns(o){return class extends o{getChooserColumns(r){return(super.getChooserColumns(r)||[]).slice().sort((n,s)=>{let l=(n==null?void 0:n.caption)||"",g=(s==null?void 0:s.caption)||"";return l.localeCompare(g)})}}}}}});var Nr=ft(yo());var en=(o,t)=>{if(o===null||t===null||o.length!==t.length)return!1;for(let r=0;r<o.length;r++)if(o[r]!==t[r])return!1;return!0},We=o=>{let t=null,r=null;return function(...i){return en(t,i)||(r=o(...i)),t=i,r}};var me=class{constructor(t){this._currentViewId=me.defaultControlDisplayView.id;this.views=me.defaultViews;this.getViewByIdInternal=t=>this.views&&this.views.find(r=>r.id===t);this.getViewById=We(this.getViewByIdInternal);this.loadDataUrl=t.loadDataUrl,this.insertDataUrl=t.insertDataUrl,this.updateDataUrl=t.updateDataUrl,this.deleteDataUrl=t.deleteDataUrl}get currentView(){return this.getViewById(this._currentViewId)}get currentViewId(){return this._currentViewId}set currentViewId(t){this._currentViewId=t}async getViews(){return this.views===me.defaultViews&&await this.loadViews(),this.views}updateCurrentView(t){return this.updateView(this.currentView.id,t)}async createNewView(t,r,i){let n=this.mapViewModelToDto({id:-1,name:t,gridState:r,isGlobal:i});return n=await x(this.insertDataUrl,"POST",n),await this.loadViews(),this.mapViewDtoToModel(n)}async updateView(t,r){if(t===me.defaultControlDisplayView.id)return!1;let i=this.getViewById(t);if(!i)return!1;let n=A(A({},i),r),s=this.mapViewModelToDto(n);return s=await x(this.updateDataUrl,"PUT",s),await this.loadViews(),!0}async deleteView(t){return t===me.defaultControlDisplayView.id||!this.getViewById(t)?!1:(await x(this.deleteDataUrl,"DELETE",{viewId:t}),await this.loadViews(),!0)}async loadViews(){let t=await se(this.loadDataUrl);return this.views=t.map(r=>this.mapViewDtoToModel(r)),this.views.unshift(me.defaultControlDisplayView),this.resetCachedResultOfGetViewByIdFunction(),this.views}mapViewModelToDto(t){return{Id:t.id,Name:t.name,GridState:JSON.stringify(t.gridState),IsGlobal:t.isGlobal}}mapViewDtoToModel(t){return{id:t.Id,name:t.Name,gridState:JSON.parse(t.GridState),isGlobal:t.IsGlobal}}resetCachedResultOfGetViewByIdFunction(){this.getViewById=We(this.getViewByIdInternal)}},W=me;W.defaultControlDisplayView={id:0,name:"Default",gridState:null,isGlobal:!1},W.defaultViews=[me.defaultControlDisplayView];var Uo=class{constructor(t){var r;this.options=t,this.currentSavedGridState=t.initialState,this.imagePreviewSizeMap=((r=t.initialState)==null?void 0:r.imagePreviewSizeMap)??{},this.options.owner.option("stateStoring",{enabled:!0,type:"custom",customLoad:()=>Promise.resolve(this.currentSavedGridState)})}prepareUnsavedGridState(t){if(t.columns){let r=t.columns.filter(n=>n.visible),i=r[r.length-1];i.width=void 0}return t.imagePreviewSizeMap=this.imagePreviewSizeMap,t}get hasChanges(){return this.currentSavedGridState!==null&&JSON.stringify(this.currentUnsavedGridState)!==JSON.stringify(this.currentSavedGridState)}get currentUnsavedGridState(){return this.prepareUnsavedGridState(this.options.owner.state())}async apply(t,r=!0){return new Promise((i,n)=>{this.imagePreviewSizeMap=(t==null?void 0:t.imagePreviewSizeMap)||{};let s=r?void 0:this.options.owner.filter();this.options.owner.beginUpdate(),this.options.owner.clearFilter("filterValue"),this.options.owner.state(t);let l=this.options.owner.getVisibleColumns().filter(p=>!p.type);l[0]&&l[0].dataField&&this.options.owner.option("summary",{totalItems:[{column:l[0].dataField,summaryType:"count"}]}),s&&this.options.owner.filter(s),this.options.owner.endUpdate();let g=()=>{this.save(),i(),this.options.owner.off("contentReady",g)};this.options.owner.on("contentReady",g)})}save(){this.currentSavedGridState=this.currentUnsavedGridState}reset(){this.options.owner.state(this.currentSavedGridState)}setFieldPreviewSize(t,r){this.imagePreviewSizeMap[t]=r}getFieldPreviewSize(t){return this.imagePreviewSizeMap[t]}};var Po=class{constructor(t){this.onGridToolbarPreparing=t=>{let r=t.toolbarOptions&&t.toolbarOptions.items;!r||(this.removeDefaultColumnChooserButton(r),r.splice(1,0,this.viewsToolbarItem))};this.options=O(A({},t),{gridStateManager:t.gridStateManager?t.gridStateManager:new Uo({owner:t.owner,initialState:null}),gridViewsManager:t.gridViewsManager?t.gridViewsManager:new W(t.gridViewsManagerOptions),autoIntegration:t.autoIntegration!==void 0&&t.autoIntegration!==null?t.autoIntegration:!0}),this.options.autoIntegration&&this.integrateToGrid(this.options.owner)}async tryApplyView(t){let r=await this.confirmChangesLoss();return r&&await this.applyView(t),r}async applyView(t){this.beginViewApplyingLoading(),this.options.gridViewsManager.currentViewId=t,await this.options.gridStateManager.apply(this.options.gridViewsManager.currentView.gridState,!1),this.endViewApplyingLoading(),this.syncUIWithCurrentView(),this.options.onViewApplied&&this.options.onViewApplied(t)}integrateToGrid(t){let r=t.option("onToolbarPreparing");t.option("onToolbarPreparing",i=>{r&&r(i),this.onGridToolbarPreparing(i)})}removeDefaultColumnChooserButton(t){t.splice(t.findIndex(r=>r.name==="columnChooserButton"),1)}get viewsToolbarItem(){return this._viewsToolbarItem||(this._viewsToolbarItem=this.createViewsToolbarItem()),this._viewsToolbarItem}get isDefaultView(){return this.options.gridViewsManager.currentViewId===W.defaultControlDisplayView.id}get hasChanges(){let t=this.options.gridViewsManager.currentView;return this.currentViewTitle?this.currentViewTitle.option("value")!==t.name||this.options.gridStateManager.hasChanges:!1}createViewsToolbarItem(){let t=!0;return{widget:"dxDropDownBox",location:"after",text:"Views",visible:this.options.visible,cssClass:"aps-views__toolbar-item",options:{elementAttr:{class:"iszolea-md"},items:[W.defaultControlDisplayView],value:W.defaultControlDisplayView.id,valueExpr:"id",displayExpr:"name",width:200,dropDownOptions:{width:550},onInitialized:r=>{this.viewsDropdownBox=r.component,this.loadViewDropdownBoxData()},onValueChanged:async r=>{if(r.value===this.options.gridViewsManager.currentViewId||!t){t=!0;return}await this.tryApplyView(r.value)||(t=!1,this.syncUIWithCurrentView(!0))},contentTemplate:r=>{if(!r.component)return;this.viewsDataGrid=this.createViewsDataGrid(r.component),this.currentViewTitle=this.createCurrentViewTitle(r.component),this.saveViewButton=this.createSaveViewButton(),this.saveViewAsButton=this.createSaveViewAsButton(),this.columnChooserButton=this.createColumnChooserButton();let i=$("<div />").addClass("aps-views__header").append(this.currentViewTitle.element()).append(this.saveViewButton.element()).append(this.saveViewAsButton.element()).append(this.columnChooserButton.element());return $("<div />").height("100%").append(i).append(this.viewsDataGrid.element())}}}}createViewsDataGrid(t){return $("<div />").dxDataGrid({dataSource:t.getDataSource(),remoteOperations:!1,editing:{allowAdding:!1,allowUpdating:!0,allowDeleting:!0,mode:"cell",useIcons:!0,texts:{confirmDeleteMessage:"Are you sure you want to delete this view?"}},wordWrapEnabled:!0,loadPanel:{shading:!0},columns:[{dataField:"name",allowEditing:!1},{dataField:"isGlobal",caption:"Is Global",dataType:"boolean",width:70},{type:"buttons",buttons:[{name:"delete",visible:r=>r.row&&r.row.key!==W.defaultControlDisplayView.id}]}],keyboardNavigation:{editOnKeyPress:!1,enabled:!1},showColumnHeaders:!0,hoverStateEnabled:!0,focusedRowEnabled:!1,showBorders:!1,showColumnLines:!1,selection:{mode:"single"},height:"calc(100% - 51px)",scrolling:{mode:"standard"},paging:{enabled:!1},noDataText:"No views",onSelectionChanged:r=>{t.option("value",r.selectedRowKeys&&r.selectedRowKeys.length?r.selectedRowKeys[0]:0)},onEditorPreparing:r=>{if(r.dataField==="isGlobal"){r.editorOptions.disabled=!this.options.canCreateGlobalViews,r.editorOptions.visible=r.row.data.id!==W.defaultControlDisplayView.id;let i=r.editorOptions.onValueChanged;r.editorOptions.onValueChanged=async n=>{r.component.beginCustomLoading("Updating"),await this.options.gridViewsManager.updateView(r.row.data.id,{isGlobal:n.value}),r.component.endCustomLoading(),i(n)}}},onCellPrepared:r=>{if(r.column.type!=="buttons"||!r.data)return;!r.data.isGlobal||r.data.isGlobal&&this.options.canCreateGlobalViews||Array.from(r.cellElement.children()).forEach(n=>{$(n).css({color:"#ddd !important",cursor:"default"}).off("click")})},onRowRemoving:r=>{!r.key||this.deleteView(r.key)}}).dxDataGrid("instance")}createCurrentViewTitle(t){return $("<div />").addClass("aps-views__current-view iszolea-md").dxTextBox({value:t.option("text")||t.option("placeholder"),readOnly:this.isDefaultView}).dxTextBox("instance")}createSaveViewButton(){return $("<button />").addClass("aps-views__save-view iszolea-md").dxButton({text:"Save",type:"normal",disabled:this.isDefaultView,onClick:this.save.bind(this),icon:"save",width:87}).dxButton("instance")}createSaveViewAsButton(){return $("<button />").addClass("aps-views__save-view-as iszolea-md").dxButton({text:"Save As",type:"normal",onClick:this.createSaveAsDialog.bind(this),icon:"save",width:118}).dxButton("instance")}createColumnChooserButton(){return $("<button />").addClass("aps-views__column-chooser iszolea-md").dxButton({onClick:this.openColumnChooser.bind(this),icon:"column-chooser"}).dxButton("instance")}createSaveAsDialog(){let t=$("<div />"),r=$('<div style="margin-bottom:8px;" />').dxTextBox({placeholder:"View Name",showClearButton:!0}).dxValidator({validationRules:[{type:"required"}]}),i=r.dxTextBox("instance"),n=r.dxValidator("instance");i.element().appendTo(t);let s=$('<div style="margin-bottom:16px;" />').dxCheckBox({text:"Global view",disabled:!this.options.canCreateGlobalViews}).dxCheckBox("instance");return s.element().appendTo(t),J({title:"Create New View",height:"auto",width:"100%",maxWidth:"300px"},t,{text:"Ok",onClick:async l=>{!n.validate().isValid||(await this.saveAs(i.option("value"),s.option("value")),l())}},{text:"Cancel",onClick:l=>l()})}openColumnChooser(){this.options.owner.showColumnChooser()}async loadViewDropdownBoxData(){if(!this.viewsDropdownBox)return;let t=await this.options.gridViewsManager.getViews(),r=new DevExpress.data.ArrayStore({key:"id",data:t});this.viewsDropdownBox.option("dataSource",r),this.viewsDropdownBox.option("value",this.options.gridViewsManager.currentViewId),this.viewsDataGrid&&this.viewsDataGrid.option("dataSource",r)}async save(){!this.hasChanges||(this.options.gridStateManager.save(),await this.options.gridViewsManager.updateCurrentView({name:this.currentViewTitle.option("value"),gridState:this.options.gridStateManager.currentSavedGridState}),P("Saved",!0),await this.loadViewDropdownBoxData())}async saveAs(t,r){if(!this.options.gridStateManager)return;this.options.gridStateManager.save();let i=await this.options.gridViewsManager.createNewView(t,this.options.gridStateManager.currentSavedGridState,r);await this.loadViewDropdownBoxData(),await this.applyView(i.id),P("View is created",!0)}async deleteView(t){await this.options.gridViewsManager.deleteView(t),this.options.onViewDeleted&&this.options.onViewDeleted(t),await this.loadViewDropdownBoxData(),this.options.gridViewsManager.currentViewId!==W.defaultControlDisplayView.id&&await this.applyView(W.defaultControlDisplayView.id)}beginViewApplyingLoading(){this.currentViewTitle&&this.currentViewTitle.option("readOnly",!0),this.saveViewButton&&this.saveViewButton.option("disabled",!0),this.saveViewAsButton&&this.saveViewAsButton.option("disabled",!0),this.viewsDataGrid&&this.viewsDataGrid.beginCustomLoading("Applying...")}endViewApplyingLoading(){this.currentViewTitle&&this.currentViewTitle.option("readOnly",!1),this.saveViewButton&&this.saveViewButton.option("disabled",!1),this.saveViewAsButton&&this.saveViewAsButton.option("disabled",!1),this.viewsDataGrid&&this.viewsDataGrid.endCustomLoading()}syncUIWithCurrentView(t=!1){!t&&this.currentViewTitle&&(this.currentViewTitle.option("value",this.options.gridViewsManager.currentView.name),this.currentViewTitle.option("readOnly",this.isDefaultView)),this.viewsDropdownBox.option("value",this.options.gridViewsManager.currentViewId),setTimeout(()=>{this.viewsDataGrid&&(this.options.gridViewsManager.currentViewId===W.defaultControlDisplayView.id?this.viewsDataGrid.selectRowsByIndexes([0]):this.viewsDataGrid.selectRows([this.options.gridViewsManager.currentViewId],!1))},0);let r=this.options.gridViewsManager.currentView.isGlobal&&!this.options.canCreateGlobalViews;this.saveViewButton&&this.saveViewButton.option("disabled",this.isDefaultView||r)}async confirmChangesLoss(){return this.hasChanges?DevExpress.ui.dialog.confirm("You have unsaved changes that will be lost if you close this popup. Do you want to close the popup and not save changes?","Unsaved changes"):!0}};var dt=class{constructor(t){this.getFilterByIdInternal=t=>this.filters&&this.filters.find(r=>r.id===t);this.getFilterById=We(this.getFilterByIdInternal);this.loadDataUrl=t.loadDataUrl,this.insertDataUrl=t.insertDataUrl,this.updateDataUrl=t.updateDataUrl,this.deleteDataUrl=t.deleteDataUrl}get currentFilter(){return this.getFilterById(this._currentFilterId)}get currentFilterId(){return this._currentFilterId}set currentFilterId(t){this._currentFilterId=t}async getFilters(){return this.filters||await this.loadFilters(),this.filters}updateCurrentFilter(t){return!!this.currentFilter&&this.updateFilter(this.currentFilter.id,t)}async createNewFilter(t,r,i,n){let s=this.mapFilterModelToDto({id:-1,name:t,isDefault:i,isGlobal:n,filterState:r});return s=await x(this.insertDataUrl,"POST",s),await this.loadFilters(),this.mapFilterDtoToModel(s)}async updateFilter(t,r){let i=this.getFilterById(t);if(!i)return!1;let n=A(A({},i),r),s=this.mapFilterModelToDto(n);return s=await x(this.updateDataUrl,"PUT",s),await this.loadFilters(),!0}async deleteFilter(t){return this.getFilterById(t)?(await x(this.deleteDataUrl,"DELETE",{filterId:t}),await this.loadFilters(),!0):!1}async loadFilters(){let t=await se(this.loadDataUrl);return this.filters=t.map(r=>this.mapFilterDtoToModel(r)),this.resetCachedResultOfGetFilterByIdFunction(),this.filters}mapFilterModelToDto(t){return{Id:t.id,Name:t.name,IsDefault:t.isDefault,IsGlobal:t.isGlobal,FilterState:JSON.stringify(t.filterState)}}mapFilterDtoToModel(t){return{id:t.Id,name:t.Name,isDefault:t.IsDefault||!1,isGlobal:t.IsGlobal||!1,filterState:JSON.parse(t.FilterState)}}resetCachedResultOfGetFilterByIdFunction(){this.getFilterById=We(this.getFilterByIdInternal)}};var No=class{constructor(t){this.isInFilterApplying=!1;this.onGridToolbarPreparing=t=>{let r=t.toolbarOptions&&t.toolbarOptions.items;!r||r.splice(1,0,this.filtersToolbarItem)};this.options=O(A({},t),{gridFiltersManager:t.gridFiltersManager?t.gridFiltersManager:new dt(t.gridFiltersManagerOptions),autoIntegration:t.autoIntegration!==void 0&&t.autoIntegration!==null?t.autoIntegration:!0}),this.options.autoIntegration&&this.integrateToGrid(this.options.owner),this.filterExpressionCalculator=$("<div />").dxFilterBuilder({fields:this.getFlatColumnsList(this.options.owner.option("columns"))}).dxFilterBuilder("instance")}async tryApplyFilter(t){let r=await this.confirmChangesLoss();return r&&await this.applyFilter(t),r}async applyFilter(t,r=!1){this.isInFilterApplying=!0,this.options.gridFiltersManager.currentFilterId=t,this.updateFilterPopupContent(this.options.gridFiltersManager.currentFilter),this.filtersDropdownBox.option("value",this.options.gridFiltersManager.currentFilterId);let i=this.options.owner.getDataSource();if(this.options.gridFiltersManager.currentFilter){this.filterExpressionCalculator.option("value",this.options.gridFiltersManager.currentFilter.filterState);let n=this.filterExpressionCalculator.getFilterExpression();if(i.isLoading()){let s=()=>{i.off("loadingChanged",s),setTimeout(()=>{i=this.options.owner.getDataSource(),i.filter(n)})};i.on("loadingChanged",s)}else i.filter(n)}else i.filter(null);r||await i.load(),this.options.onFilterApplied&&this.options.onFilterApplied(t),this.isInFilterApplying=!1}integrateToGrid(t){let r=t.option("onToolbarPreparing");t.option("onToolbarPreparing",i=>{r&&r(i),this.onGridToolbarPreparing(i)})}get filtersToolbarItem(){return this._filtersToolbarItem||(this._filtersToolbarItem=this.createFiltersToolbarItem()),this._filtersToolbarItem}get filterPopup(){return this._filterPopup||(this._filterPopup=this.createFilterPopup()),this._filterPopup}get hasChanges(){let t=this.options.gridFiltersManager.currentFilter,r=this.filterNameTextBox&&this.filterNameTextBox.option("value"),i=t&&t.name,n=this.filterBuilder&&this.filterBuilder.option("value"),s=t&&t.filterState,l=this.filterIsGlobalCheckbox&&this.filterIsGlobalCheckbox.option("value"),g=t&&t.isGlobal;return r!==i||n!==s||l!==g}createFiltersToolbarItem(){let t=!0;return{widget:"dxDropDownBox",location:"after",text:"Data Sets",visible:this.options.visible,cssClass:"aps-filters__toolbar-item",options:{elementAttr:{class:"iszolea-md"},value:this.options.gridFiltersManager.currentFilterId,valueExpr:"id",displayExpr:"name",showClearButton:!0,placeholder:"None",width:200,dropDownOptions:{width:500},onInitialized:async r=>{this.filtersDropdownBox=r.component;let[,i]=await Promise.all([this.loadFilterDropdownBoxData(),this.options.apsControlDisplayUserSettingsManager.getUserSettings()]);i.defaultFilterId&&r.component.option("value",i.defaultFilterId)},onValueChanged:async r=>{if(this.isInFilterApplying)return;if(!t){t=!0;return}let i=r.value;await this.tryApplyFilter(i)||(t=!1,i=r.previousValue,r.component.option("value",i)),this.filtersDataGrid&&this.filtersDataGrid.selectRows(i,!1),this.currentFilterTitle&&this.currentFilterTitle.option("value",r.component.option("text")||r.component.option("placeholder"))},onOpened:r=>{!r.component||this.filtersDataGrid&&this.filtersDataGrid.selectRows(r.component.option("value"),!1)},contentTemplate:r=>{if(!r.component)return;this.filtersDataGrid=this.createFiltersDataGrid(r.component),this.currentFilterTitle=this.createCurrentFilterTitle(r.component),this.newFilterButton=this.createNewFilterButton();let i=$("<div />").addClass("aps-filters__header").append(this.currentFilterTitle.element()).append(this.newFilterButton.element());return $("<div />").css("height","100%").append(i).append(this.filtersDataGrid.element())}}}}createFiltersDataGrid(t){return $("<div />").dxDataGrid({dataSource:t.getDataSource(),remoteOperations:!1,editing:{allowAdding:!1,allowUpdating:!0,allowDeleting:!0,mode:"cell",useIcons:!0,texts:{confirmDeleteMessage:"Are you sure you want to delete this data set?"}},wordWrapEnabled:!0,columns:[{dataField:"name",allowEditing:!1},{dataField:"isDefault",caption:"Is Default",dataType:"boolean",width:80},{dataField:"isGlobal",caption:"Is Global",dataType:"boolean",width:70},{type:"buttons",buttons:[{icon:"edit",hint:"Edit",onClick:async r=>{if(!r.row||!r.row.key)return;await this.tryApplyFilter(r.row.key)&&!this.filterPopup.option("visible")&&this.openEditFilterPopup(this.options.gridFiltersManager.currentFilter)}},"delete"]}],keyboardNavigation:{editOnKeyPress:!1,enabled:!1},showColumnHeaders:!0,hoverStateEnabled:!0,focusedRowEnabled:!1,showBorders:!1,showColumnLines:!1,selection:{mode:"single"},height:"calc(100% - 51px)",scrolling:{mode:"standard"},paging:{enabled:!1},noDataText:"No data sets",onSelectionChanged:r=>{t.option("value",r.selectedRowKeys?r.selectedRowKeys[0]:null)},onEditorPreparing:r=>{if(r.dataField==="isGlobal"){r.editorOptions.disabled=!this.options.canCreateGlobalFilters;let i=r.editorOptions.onValueChanged;r.editorOptions.onValueChanged=async n=>{r.component.beginCustomLoading("Updating"),await this.options.gridFiltersManager.updateFilter(r.row.data.id,{isGlobal:n.value}),r.component.endCustomLoading(),i(n)}}},onCellPrepared:r=>{r.column.type!=="buttons"||!r.data||r.column.type==="buttons"&&(!r.data.isGlobal||r.data.isGlobal&&this.options.canCreateGlobalFilters||Array.from(r.cellElement.children()).forEach(n=>{$(n).css({color:"#ddd !important",cursor:"default"}).off("click")}))},onRowUpdating:r=>{if(!r.key||r.newData.isDefault===void 0)return;let i=r.component.getDataSource().items().find(n=>n.isDefault);i&&(i.isDefault=!1),this.options.apsControlDisplayUserSettingsManager.updateUserSettings({defaultFilterId:r.newData.isDefault?r.key:void 0})},onRowRemoving:r=>{!r.key||this.deleteFilter(r.key)}}).dxDataGrid("instance")}createCurrentFilterTitle(t){return $("<div />").addClass("aps-filters__current-filter").dxTextBox({value:t.option("text")||t.option("placeholder"),readOnly:!0}).dxTextBox("instance")}createNewFilterButton(){return $("<button />").addClass("aps-filters__add-new-filter iszolea-md").dxButton({text:"New Data Set",type:"normal",onClick:()=>{this.openNewFilterPopup()},icon:"plus"}).dxButton("instance")}createFilterPopup(){let t=$("<div />").appendTo("body"),r=!1;return t.dxPopup({container:this.options.owner.element(),shading:!1,resizeEnabled:!0,width:650,height:500,onShowing:i=>{this.filtersDropdownBox&&this.filtersDropdownBox.close()},onHiding:async i=>{if(!this.hasChanges||r){r=!1;return}i.cancel=!0,r=await this.confirmChangesLoss(),r&&(i.component.hide(),this.filtersDropdownBox&&this.filtersDropdownBox.open())}}).dxPopup("instance")}createFilterNameTextBox(){return $("<div />").dxTextBox({placeholder:"Enter Data Set Name..."}).dxTextBox("instance")}createFilterIsGlobalCheckbox(){return $("<div />").dxCheckBox({text:"Global data set"}).dxCheckBox("instance")}getFlatColumnsList(t,...r){let i=[];for(let n of t)if(n.columns&&n.columns.length>0){let s=this.getFlatColumnsList(n.columns);i=i.concat(s)}else{let s=$.extend({},n);if(s.dataType==="date"||s.dataType==="datetime"){let l=s.dataType==="datetime",g="dd MMM yy",h=l?"hh:mm, dd MMM yy":g,S=E=>{let y=E.split(", "),T=DevExpress.localization.parseDate(y[1],g)||null;if(T){let I=y[0].split(":");return T.setHours(parseInt(I[0])),T.setMinutes(parseInt(I[1])),T}else return null};s.format=h,s.editorTemplate=E=>$("<div />").dxDateBox({displayFormat:h,type:l?"datetime":"date",width:150,onValueChanged:({value:y})=>{E.setValue(DevExpress.localization.formatDate(y,h))},value:(l?S(E.value):DevExpress.localization.parseDate(E.value,h))||null}),s.filterOperations=["=","<>","<",">","<=",">=","isblank","isnotblank"],s.calculateFilterExpression=function(E){let y=[t,...r];return y[0]&&(l?y[0]=S(y[0]):y[0]=DevExpress.localization.parseDate(E,h)||null),this.defaultCalculateFilterExpression(...y)}}i.push(s)}return i.sort((n,s)=>{let l=(n.caption||"").toLowerCase(),g=(s.caption||"").toLowerCase();return l<g?-1:l>g?1:0})}createFilterBuilder(){return $("<div />").dxFilterBuilder({fields:this.getFlatColumnsList(this.options.owner.option("columns"))}).dxFilterBuilder("instance")}createFilterPopupContent(t){let r=$("<div />").height("100%"),i=$('<div class="aps-filters__name-container" />').height("36px");this.filterNameTextBox=this.createFilterNameTextBox(),this.filterBuilder=this.createFilterBuilder(),this.filterIsGlobalCheckbox=this.createFilterIsGlobalCheckbox(),this.filterNameTextBox.option("value",t&&t.name),this.filterNameTextBox.element().appendTo(i),this.filterIsGlobalCheckbox.option("value",t&&t.isGlobal),this.filterIsGlobalCheckbox.element().appendTo(i),this.filterIsGlobalCheckbox.option("disabled",!this.options.canCreateGlobalFilters),i.appendTo(r),this.filterBuilder.option("value",t&&t.filterState);let n=$("<div />").height("calc(100% - 36px)").appendTo(r);return this.filterBuilder.element().appendTo(n),n.dxScrollView({scrollByContent:!0}),r}createFilterPopupToolbarItems(t){return t?[this.createUpdateFilterPopupToolbarItem(),this.createSaveFilterAsNewPopupToolbarItem(),this.createResetFilterPopupToolbarItem(),this.createDeleteFilterPopupToolbarItem()]:[this.createSaveFilterPopupToolbarItem()]}createSaveFilterPopupToolbarItem(){return{toolbar:"bottom",widget:"dxButton",location:"before",options:{text:"Apply and Save",onClick:this.createNewFilter.bind(this),icon:"save"}}}createUpdateFilterPopupToolbarItem(){return{toolbar:"bottom",widget:"dxButton",location:"before",options:{text:"Apply and Update",onClick:()=>{!this.options.gridFiltersManager.currentFilter||this.updateFilter(this.options.gridFiltersManager.currentFilter)},icon:"save"}}}createSaveFilterAsNewPopupToolbarItem(){return{toolbar:"bottom",widget:"dxButton",location:"before",options:{text:"Save As New",onClick:this.createNewFilter.bind(this),icon:"save"}}}createResetFilterPopupToolbarItem(){return{toolbar:"bottom",widget:"dxButton",location:"before",options:{text:"Reset",onClick:async()=>{!this.hasChanges||!this.filterBuilder||!this.options.gridFiltersManager.currentFilter||!await DevExpress.ui.dialog.confirm("Are you sure you want to reset unsaved changes?","Reset the data set")||this.resetChanges()},icon:"undo"}}}createDeleteFilterPopupToolbarItem(){return{toolbar:"bottom",widget:"dxButton",location:"before",options:{text:"Delete Data Set",onClick:async()=>{!this.options.gridFiltersManager.currentFilter||!await DevExpress.ui.dialog.confirm(`Are you sure you want to delete the "${this.options.gridFiltersManager.currentFilter.name}" data set?`,"Delete the data set")||(await this.deleteFilter(this.options.gridFiltersManager.currentFilterId),this.filterPopup.hide())},icon:"trash"}}}async openNewFilterPopup(){!await this.tryApplyFilter(void 0)||(this.updateFilterPopupContent(),this.filterPopup.show())}openEditFilterPopup(t){this.updateFilterPopupContent(t),this.filterPopup.show()}updateFilterPopupContent(t){let r=this.filterPopup.option("animation");this.filterPopup.option("animation",void 0),this.filterPopup.option("title",t?`Edit the "${t.name}" data set`:"Create a new data set"),this.filterPopup.option("contentTemplate",()=>this.createFilterPopupContent(t)),this.filterPopup.option("toolbarItems",this.createFilterPopupToolbarItems(t)),this.filterPopup.repaint(),this.filterPopup.option("animation",r)}async createNewFilter(){if(!this.filterNameTextBox||!this.filterBuilder||!this.filterIsGlobalCheckbox)return;let t=this.filterNameTextBox.option("value"),r=this.filterBuilder.option("value"),i=!1,n=this.filterIsGlobalCheckbox.option("value");if(!t)return;let s=await this.options.gridFiltersManager.createNewFilter(t,r,i,n);await this.loadFilterDropdownBoxData(),await this.applyFilter(s.id),P("Created",!0)}async updateFilter(t){if(!this.filterNameTextBox||!this.filterBuilder||!this.filterIsGlobalCheckbox)return;let r=this.filterNameTextBox.option("value"),i=this.filterBuilder.option("value"),n=this.filterIsGlobalCheckbox.option("value");!r||!await this.options.gridFiltersManager.updateFilter(t.id,{name:r,filterState:i,isGlobal:n})||(P("Updated",!0),await this.applyFilter(this.options.gridFiltersManager.currentFilter.id),await this.loadFilterDropdownBoxData())}async deleteFilter(t){await this.options.gridFiltersManager.deleteFilter(t),this.options.onFilterDeleted&&this.options.onFilterDeleted(t),await this.applyFilter(void 0),await this.loadFilterDropdownBoxData()}resetChanges(){this.filterNameTextBox.option("value",this.options.gridFiltersManager.currentFilter.name),this.filterBuilder.option("value",this.options.gridFiltersManager.currentFilter.filterState),this.filterIsGlobalCheckbox.option("value",this.options.gridFiltersManager.currentFilter.isGlobal)}async loadFilterDropdownBoxData(){if(!this.filtersDropdownBox)return;let[t,r]=await Promise.all([this.options.apsControlDisplayUserSettingsManager.getUserSettings(),this.options.gridFiltersManager.getFilters()]);if(t.defaultFilterId){let n=r.find(s=>s.id===t.defaultFilterId);n&&(n.isDefault=!0)}let i=new DevExpress.data.ArrayStore({key:"id",data:r});this.filtersDropdownBox.option("dataSource",i),this.filtersDataGrid&&this.filtersDataGrid.option("dataSource",i)}async confirmChangesLoss(){return await new Promise(t=>setTimeout(()=>t(),0)),!this.hasChanges||!this.filterPopup.option("visible")?!0:DevExpress.ui.dialog.confirm("You have unsaved changes that will be lost if you close this popup. Do you want to close the popup and not save changes?","Unsaved changes")}};var gt=class{constructor(t){this.$container=t.$container,this.cssClass=t.cssClass,this.maxFileSize=t.maxFileSize,this.acceptedFileTypes=t.acceptedFileTypes,this.selectButtonText=t.selectButtonText,this.allowedFileExtensions=t.allowedFileExtensions,this.onValueChanged=t.onValueChanged,this.onUploadStarted=t.onUploadStarted,this.onUploaded=t.onUploaded}render(){let t=$("<div />");this.cssClass&&t.addClass(this.cssClass),this.fileUploader=t.dxFileUploader({selectButtonText:this.selectButtonText,labelText:"",allowedFileExtensions:this.allowedFileExtensions,accept:this.acceptedFileTypes,uploadMode:"useForm",maxFileSize:this.maxFileSize,showFileList:!1,onValueChanged:r=>{var i;r.component.option("labelText",r.value[0]?r.value[0].name:""),(i=this.onValueChanged)==null||i.call(this,r)},onUploadStarted:r=>{var i;r.element.find(".dx-fileuploader-upload-button").hide(),(i=this.onUploadStarted)==null||i.call(this,r)},onUploaded:r=>{var i;(i=this.onUploaded)==null||i.call(this,r)}}).dxFileUploader("instance"),this.$container.append(this.fileUploader.element())}upload(t,r){return new Promise((i,n)=>{let s=new FormData,l=this.fileUploader.element().find("input")[0].files[0];s.append("file",l);for(let g in r)s.append(g,r[g]);$.ajax({url:t,type:"post",data:s,contentType:!1,processData:!1,success:g=>{g.RequestState===1?i(g.Data):n(g.Message)},error:g=>n("Unknown error")})})}};var pt=class extends z{constructor(t){super();this.fileUploadUrl=t.fileUploadUrl,this.$container=t.$container,this.title=t.title,this.getTablesListUrl=t.getTablesListUrl,this.createTableUrl=t.createTableUrl,this.addRowsUrl=t.addRowsUrl,this.predefinedTable=t.predefinedTable,this.canChangeMode=t.predefinedImportFileMode===void 0,this.mode=t.predefinedImportFileMode!==void 0?t.predefinedImportFileMode:0,this.createTableButtonText=t.createTableButtonText||"Create Table",this.updateTableButtonText=t.updateTableButtonText||"Add New Rows",this.createTableModeText=t.createTableModeText||"Create Table",this.updateTableModeText=t.updateTableModeText||"Add New Rows",this.tableSelectorProperties=t.tableSelectorProperties}show(){this.popup=$("<div />").appendTo(this.$container).dxPopup({showTitle:!0,title:this.title,visible:!1,dragEnabled:!1,resizeEnabled:!1,showCloseButton:!0,hideOnOutsideClick:!1,fullScreen:!0,maxWidth:1300,maxHeight:800,contentTemplate:t=>{let r=$("<div />");this.form=this.createForm(),r.append(this.form.element()),r.dxScrollView({width:"100%",height:"100%"}).appendTo(t)},toolbarItems:[{toolbar:"bottom",widget:"dxButton",location:"after",options:{text:this.getActionButtonText(),type:"success",onInitialized:t=>{this.actionButton=t.component},onClick:async()=>{this.mode===0?this.createTable():this.addRowsToTable()}}},{toolbar:"bottom",widget:"dxButton",location:"after",options:{text:"Cancel",onClick:()=>this.popup.hide()}}]}).dxPopup("instance"),this.popup.show(),this.onModeSwitching()}dispose(){this.popup&&this.popup.dispose()}createForm(){return $("<div>").dxForm({showColonAfterLabel:!0,labelLocation:"top",colCountByScreen:{md:4,sm:1},screenByWidth:r=>r<1256?"sm":"md",items:[{dataField:"Mode",itemType:"simple",template:(r,i)=>{this.createModeSwitcher(i)}},{dataField:"Schema",editorOptions:{disabled:!this.canChangeMode},validationRules:[{type:"required"}]},{dataField:"Table",editorOptions:{disabled:!this.canChangeMode},validationRules:[{type:"required"}]},{dataField:"TableSelector",label:{text:"Table"},editorType:"dxSelectBox",visible:!1,colSpan:2,editorOptions:A({dataSource:new DevExpress.data.DataSource({store:ce({loadUrl:this.getTablesListUrl,loadParams:{contextName:"",tablesOnly:!0,isWarehouseContext:!0},loadMethod:"post",notifyError:!1}),paginate:!1}),searchEnabled:!0},this.tableSelectorProperties),validationRules:[{type:"required"}]},{dataField:"Source File",itemType:"simple",template:(r,i)=>{this.createFilesUploader(i)}},{dataField:"Columns Selector",label:{visible:!1},colSpan:4,itemType:"simple",template:(r,i)=>{this.createDataGrid(i)}}]}).dxForm("instance")}createModeSwitcher(t){$("<div />").dxButtonGroup({items:[{text:this.createTableModeText,icon:"inserttable",value:0},{text:this.updateTableModeText,icon:"insertrowbelow",value:1}],keyExpr:"value",disabled:!this.canChangeMode,stylingMode:"outlined",selectionMode:"single",selectedItemKeys:[this.mode],onItemClick:r=>{this.mode=r.itemData.value,this.onModeSwitching()}}).appendTo(t)}createFilesUploader(t){this.fileUploader=new gt({$container:t,cssClass:"table-creator__upload",maxFileSize:10*1e6,acceptedFileTypes:".xls, .xlsx",allowedFileExtensions:[".xls",".xlsx"],selectButtonText:"Select Excel file",onValueChanged:async()=>{this.dataGrid.beginCustomLoading("Parsing selected file..."),this.fileUploader.upload(this.fileUploadUrl).then(r=>{if(r){this.setRowsCount(r.RowsCount);let i=new DevExpress.data.DataSource({store:{type:"array",key:"Id",data:r.Columns},paginate:!1});this.dataGrid.option("dataSource",i)}}).catch(r=>{P(`Parsing Error : ${r}`,!1)}).finally(()=>{this.dataGrid.endCustomLoading()})}}),this.fileUploader.render()}createDataGrid(t){let r={noDataText:"Select Excel File",hoverStateEnabled:!0,searchPanel:{visible:!1},groupPanel:{visible:!1},headerFilter:{visible:!1},filterRow:{visible:!1},sorting:{mode:"none"},paging:{pageSize:1e4,enabled:!1},editing:{allowUpdating:!0,mode:"cell"},selection:{mode:"none"},columns:[{dataField:"Id",visible:!1},{dataField:"Selected",dataType:"boolean",visible:this.mode===0},{dataField:"IsKeyColumn",dataType:"boolean",visible:this.mode===0},{dataField:"Name",caption:"Column Name"},{dataField:"Type",allowEditing:!1},{dataField:"IsNullable",allowEditing:this.mode===0&&this.canChangeMode,setCellValue:(i,n)=>{i.IsNullable=n,n&&(i.IsKeyColumn=!1)}}],remoteOperations:!1,onToolbarPreparing:i=>{i.toolbarOptions.items.push({template:()=>$("<div>").append($("<span>").addClass("table-creator__table-header").text("Parsed File Metadata")),location:"before"},{template:()=>(this.rowsCounter=$("<span>").text("1000"),this.rowsCounterContainer=$("<div>").append($("<span>").text("Rows Count: "),this.rowsCounter).hide(),this.rowsCounterContainer),location:"after"})},onEditorPreparing:i=>{if(i.parentType==="dataRow"&&i.dataField==="IsKeyColumn"){let n=i.editorOptions;n.disabled=i.row.data.IsNullable}}};this.dataGrid=V($("<div />"),{options:r,summaryColumn:"Name",isFullScreen:!1,setDefaultColumnWidth:!1}),t.append(this.dataGrid.element())}createTable(){if(this.form.validate().isValid){let r=this.dataGrid.getDataSource();r||P("Select file with data",!1);let i=r.items();if(!this.areColumnsValid(i))P("At least 1 key column must be set",!1);else{let n={schema:this.form.option("formData").Schema,table:this.form.option("formData").Table,columns:JSON.stringify(i)};this.dataGrid.beginCustomLoading("Creating and filling DB table..."),this.fileUploader.upload(this.createTableUrl,n).then(s=>{s===!0?(this.popup.hide(),P(`The table [${n.schema}].[${n.table}] has been created`,!0),this.emit(pt.TABLE_UPDATED_EVENT),this.emit(pt.TABLE_CREATED_EVENT,n)):P("The table has not been created",!1)}).catch(s=>{P(`Table creating error: ${s}`,!1)}).finally(()=>{this.dataGrid.endCustomLoading()})}}}addRowsToTable(){if(this.form.validate().isValid){let r=this.dataGrid.getDataSource();r||P("Select file with data",!1);let i=r.items(),n={table:this.form.option("formData").TableSelector,columns:JSON.stringify(i)};this.dataGrid.beginCustomLoading("Adding rows to DB table..."),this.fileUploader.upload(this.addRowsUrl,n).then(s=>{s===!0?(this.popup.hide(),P(`The table ${n.table} has been updated`,!0),this.emit(pt.TABLE_UPDATED_EVENT)):P("The table has not been updated",!1)}).catch(s=>{P(`Table updating error: ${s}`,!1)}).finally(()=>{this.dataGrid.endCustomLoading()})}}onModeSwitching(){let t=this.mode===0;this.actionButton.option("text",this.getActionButtonText()),this.dataGrid.columnOption("IsKeyColumn","visible",t),this.dataGrid.columnOption("IsNullable","visible",t),this.canChangeMode?(this.form.itemOption("Schema","visible",t),this.form.itemOption("Table","visible",t),this.form.itemOption("TableSelector","visible",!t)):(this.form.itemOption("Schema","visible",!0),this.form.updateData("Schema",this.predefinedTable.schema),this.form.itemOption("Table","visible",!0),this.form.updateData("Table",this.predefinedTable.table),this.form.itemOption("TableSelector","visible",!1))}getActionButtonText(){return this.mode===0?this.createTableButtonText:this.updateTableButtonText}areColumnsValid(t){return t.filter(r=>r.Selected).some(r=>r.IsKeyColumn)}setRowsCount(t){this.rowsCounterContainer.show(),this.rowsCounter.text(t)}},be=pt;be.TABLE_UPDATED_EVENT="file-importer-table-updated-event",be.TABLE_CREATED_EVENT="file-importer-table-created-event";var Lo=class{constructor(t){this.onGridToolbarPreparing=t=>{let r=t.toolbarOptions&&t.toolbarOptions.items;if(!r)return;let i=[this.displaysToolbarItem];this.importFileOptions&&this.importFileOptions.mode!==0&&i.push(this.importFileToolbarItem),r.splice(1,0,...i)};this.options=t,this.gridDisplaysManager=t.gridDisplaysManager,this.gridViewsManager=t.gridViewsManager,this.gridFiltersManager=t.gridFiltersManager,this.importFileOptions=t.importFileOptions,this.gridDisplaysManager.onDisplaisLoaded=r=>{let i=new DevExpress.data.ArrayStore({key:"Id",data:r});this.displaysDropdownBox&&this.displaysDropdownBox.option("dataSource",i),this.dataGrid&&this.dataGrid.option("dataSource",i),this.dataGrid&&this.dataGrid.endCustomLoading()},this.gridDisplaysManager.onDisplayChanged=r=>{this.displaysDropdownBox&&this.displaysDropdownBox.option("value",r?r.Id:null),this.currentDisplayTitle&&this.currentDisplayTitle.option("value",r?r.Name:null),this.currentDisplayTitle&&this.currentDisplayTitle.option("disabled",!r),this.saveAsButton&&this.saveAsButton.option("disabled",!r),this.saveButton&&this.saveButton.option("disabled",!r),this.dataGrid&&(r?this.dataGrid.selectRows([r.Id],!1):this.dataGrid.deselectAll())},this.integrateToGrid(this.options.owner)}integrateToGrid(t){let r=t.option("onToolbarPreparing");t.option("onToolbarPreparing",i=>{r&&r(i),this.onGridToolbarPreparing(i)})}createDataGrid(t){return $("<div />").dxDataGrid({dataSource:t.getDataSource(),remoteOperations:!1,editing:{allowAdding:!1,allowUpdating:!1,allowDeleting:this.options.editMode,mode:"row",useIcons:!0,texts:{confirmDeleteMessage:"Are you sure you want to delete this display?"}},loadPanel:{shading:!0},allowColumnResizing:!0,columnAutoWidth:!0,wordWrapEnabled:!0,columns:[{dataField:"Name",caption:"Display"},{dataField:"FilterId",caption:"Data Set",lookup:{valueExpr:"id",displayExpr:"name"}},{dataField:"ViewId",caption:"View",lookup:{valueExpr:"id",displayExpr:"name"}}],keyboardNavigation:{editOnKeyPress:!1,enabled:!1},showColumnHeaders:!0,hoverStateEnabled:!0,focusedRowEnabled:!1,showBorders:!1,height:this.options.editMode?"calc(100% - 51px)":"100%",scrolling:{mode:"standard"},paging:{enabled:!1},noDataText:"No displays",onInitialized:async r=>{let i=await this.gridFiltersManager.getFilters(),n=await this.gridViewsManager.getViews();r.component.columnOption("FilterId","lookup.dataSource",i),r.component.columnOption("ViewId","lookup.dataSource",n)},onCellClick:async r=>{r.rowType==="data"&&t.option("value",r.data.Id)},onRowRemoving:async r=>{this.dataGrid.beginCustomLoading("Loading"),await this.gridDisplaysManager.deleteDisplay(r.key)}}).dxDataGrid("instance")}createDisplaysToolbarItem(){let t={valueExpr:"Id",displayExpr:"Name",showClearButton:!0,placeholder:"None",width:200,onInitialized:i=>{this.displaysDropdownBox=i.component,this.gridDisplaysManager.getDisplays()},onValueChanged:async i=>{let n=this.gridDisplaysManager.currentDisplay,s=n&&n.FilterId!==this.gridFiltersManager.currentFilterId,l=n&&n.ViewId!==this.gridViewsManager.currentViewId;await(s||l?this.confirmChangesLoss():Promise.resolve(!0))&&(this.gridDisplaysManager.currentDisplayId=i.value)}},r={elementAttr:{class:"iszolea-md"},dropDownOptions:{width:800},contentTemplate:this.options.editMode?i=>{this.dataGrid=this.createDataGrid(i.component),this.currentDisplayTitle=this.createCurrentDisplayTitle(i.component),this.saveButton=this.createSaveViewButton(),this.saveAsButton=this.createSaveViewAsButton();let n=$("<div />").addClass("aps-displays__header").append(this.currentDisplayTitle.element()).append(this.saveButton.element()).append(this.saveAsButton.element()),s=$("<div />").height("100%");return this.options.editMode&&s.append(n),s.append(this.dataGrid.element()),s}:void 0,onOpened:()=>{this.saveAsButton&&this.saveAsButton.option("disabled",!this.gridFiltersManager.currentFilterId),this.saveButton&&this.saveButton.option("disabled",!this.gridDisplaysManager.currentDisplay)}};return{widget:this.options.editMode?"dxDropDownBox":"dxSelectBox",location:"after",text:"Displays",cssClass:"aps-displays__toolbar-item",options:this.options.editMode?$.extend(t,r):t}}createImportFileToolbarItem(){return{location:"after",widget:"dxButton",options:{icon:"upload",hint:"Import file",height:30,stylingMode:"text",onClick:()=>{this.fileImporter&&this.fileImporter.dispose(),this.fileImporter=new be({$container:this.options.owner.element().parent(),title:"Import File to CDM",createTableUrl:this.importFileOptions.createTableUrl,addRowsUrl:this.importFileOptions.addRowsUrl,fileUploadUrl:this.importFileOptions.fileUploadUrl,predefinedImportFileMode:this.getPredefinedImportFileMode(this.importFileOptions.mode),predefinedTable:this.importFileOptions.predefinedTable,createTableButtonText:"Replace All Rows",createTableModeText:"Replace Rows"}),this.fileImporter.on(be.TABLE_UPDATED_EVENT,()=>this.options.owner.refresh()),this.fileImporter.show()},onContentReady:t=>{t.element.find(".dx-button-content").css({paddingTop:5,paddingBottom:5})}}}}getPredefinedImportFileMode(t){switch(t){case 1:return 1;case 2:return 0;default:throw new Error("Unsupported mode")}}createCurrentDisplayTitle(t){return $("<div />").addClass("aps-displays__current-display iszolea-md").dxTextBox({value:t.option("text")||t.option("placeholder"),disabled:!this.gridDisplaysManager.currentDisplay}).dxTextBox("instance")}createSaveViewButton(){return $("<button />").addClass("aps-displays__save-display iszolea-md").dxButton({text:"Save",type:"normal",disabled:!this.gridDisplaysManager.currentDisplay,onClick:()=>{this.dataGrid.beginCustomLoading("Loading"),this.gridDisplaysManager.updateCurrentDisplay(this.currentDisplayTitle.option("value"),this.gridFiltersManager.currentFilterId,this.gridViewsManager.currentViewId)},icon:"save",width:125}).dxButton("instance")}createSaveViewAsButton(){return $("<button />").addClass("aps-display__save-display-as iszolea-md").dxButton({text:"Save As",type:"normal",disabled:!this.gridFiltersManager.currentFilterId,onClick:()=>this.createSaveAsDialog(),icon:"save",width:160}).dxButton("instance")}createSaveAsDialog(){let t=$("<div />"),r=$('<div style="margin-bottom:8px;" />').dxTextBox({placeholder:"Display Name",showClearButton:!0}).dxValidator({validationRules:[{type:"required"}]}),i=r.dxTextBox("instance"),n=r.dxValidator("instance");return i.element().appendTo(t),J({title:"Create New Display",height:"auto",width:"100%",maxWidth:"300px"},t,{text:"Ok",onClick:async s=>{!n.validate().isValid||(this.dataGrid.beginCustomLoading("Loading"),this.gridDisplaysManager.createNewDisplay(i.option("value"),this.gridFiltersManager.currentFilterId,this.gridViewsManager.currentViewId),s())}},{text:"Cancel",onClick:s=>s()})}async confirmChangesLoss(){return DevExpress.ui.dialog.confirm("You have unsaved changes that will be lost if you close this popup. Do you want to close the popup and not save changes?","Unsaved changes")}get displaysToolbarItem(){return this._displaysToolbarItem||(this._displaysToolbarItem=this.createDisplaysToolbarItem()),this._displaysToolbarItem}get importFileToolbarItem(){return this._importFileToolbarItem||(this._importFileToolbarItem=this.createImportFileToolbarItem()),this._importFileToolbarItem}};var Bo=class{constructor(t){this._currentDisplayId=0;this.getDisplayById=t=>!t||!this.displays?null:this.displays.find(r=>r.Id===t);this.loadDataUrl=t.loadDataUrl,this.insertDataUrl=t.insertDataUrl,this.updateDataUrl=t.updateDataUrl,this.deleteDataUrl=t.deleteDataUrl,this.eventHandlers={changed:[],loaded:[]}}async loadDisplays(){return this.displays=await se(this.loadDataUrl),this.onDisplaisLoadedPrivate(),this.displays}async getDisplays(){return this.displays||await this.loadDisplays()}async createNewDisplay(t,r,i){let n={Id:0,Name:t,FilterId:r,ViewId:i};await x(this.insertDataUrl,"POST",n),await this.loadDisplays()}async deleteDisplay(t){await x(this.deleteDataUrl,"DELETE",{id:t}),await this.loadDisplays()}updateCurrentDisplay(t,r,i){return this.updateDisplay(this.currentDisplay.Id,t,r,i)}async updateDisplay(t,r,i,n){await x(this.updateDataUrl,"PUT",{id:t,name:r,filterId:i,viewId:n}),await this.loadDisplays()}onDisplayChangedPrivate(){this.eventHandlers.changed.forEach(t=>t(this.currentDisplay))}onDisplaisLoadedPrivate(){this.eventHandlers.loaded.forEach(t=>t(this.displays))}get currentDisplayId(){return this._currentDisplayId}set currentDisplayId(t){this._currentDisplayId=t,this.onDisplayChangedPrivate()}get currentDisplay(){return this.getDisplayById(this._currentDisplayId)}set onDisplayChanged(t){this.eventHandlers.changed.push(t)}set onDisplaisLoaded(t){this.eventHandlers.loaded.push(t)}};var Fo=class{constructor(t){this.onGridEditorPreparing=t=>{if(!t.component||!t.editorOptions||t.parentType!=="dataRow"||!t.dataField||!t.row||!t.row.key)return;let r=t.dataField,i=t.row.key,n=t.editorOptions.onValueChanged;t.editorOptions.onValueChanged=s=>{n(s),this.updateMultipleRows(r,i,s.value)}};this.options=O(A({},t),{autoIntegration:t.autoIntegration!==void 0&&t.autoIntegration!==null?t.autoIntegration:!0}),this.options.autoIntegration&&this.integrateToGrid(this.options.owner)}integrateToGrid(t){t.option("selection",{mode:"multiple"}),t.on("editorPreparing",this.onGridEditorPreparing)}async updateMultipleRows(t,r,i){let n=await this.options.owner.getSelectedRowKeys();if(!n.length)return;let s=n.findIndex(l=>l===r);s<0||n.length===1||(n.splice(s,1),n.forEach(l=>{this.options.owner.cellValue(this.options.owner.getRowIndexByKey(l),t,i)}))}};var jo=class{constructor(t){this.defaultUserSettings={defaultFilterId:void 0,defaultViewId:W.defaultControlDisplayView.id};this.isLatestLoadedUserSettingsExpired=!0;this.options=A({},t),this.options.loadedUserSettings&&(this.latestLoadedUserSettings=this.options.loadedUserSettings),this.startAutoCacheResettingTimer()}get latestLoadedUserSettings(){return this._latestLoadedUserSettings}set latestLoadedUserSettings(t){this._latestLoadedUserSettings=t,this.isLatestLoadedUserSettingsExpired=!1}async getUserSettings(){if(!this.isLatestLoadedUserSettingsExpired)return this.latestLoadedUserSettings;try{this.latestLoadedUserSettings=await this.loadUserSettings()}catch(t){console.error(t)}return this.latestLoadedUserSettings}async updateUserSettings(t){try{this.latestLoadedUserSettings=await this.updateUserSettingsInternal(t)}catch(r){console.error(r)}return this.latestLoadedUserSettings}startAutoCacheResettingTimer(){this.autoResettingCacheTimerId=window.setInterval(()=>{this.isLatestLoadedUserSettingsExpired=!0},5e3)}stopAutoCacheResettingTimer(){window.clearInterval(this.autoResettingCacheTimerId)}},Vt=class extends jo{async loadUserSettings(){let t=localStorage.getItem(Vt.userSettingsStorageKey);return t?JSON.parse(t):this.defaultUserSettings}async updateUserSettingsInternal(t){let r=await this.getUserSettings(),i=A(A({},r),t);return localStorage.setItem(Vt.userSettingsStorageKey,JSON.stringify(i)),i}},Ur=Vt;Ur.userSettingsStorageKey="aps:control-display:user-settings";var Vo=class extends jo{constructor(t){super(t);this.loadDataUrl=t.loadDataUrl,this.updateDataUrl=t.updateDataUrl}async loadUserSettings(){let t=await se(this.loadDataUrl);return t?this.mapControlDisplayUserSettingsDtoToModel(t):this.defaultUserSettings}async updateUserSettingsInternal(t){let r=await this.getUserSettings(),i=A(A({},r),t),n=await x(this.updateDataUrl,"PUT",this.mapControlDisplayUserSettingsModelToDto(i));return this.mapControlDisplayUserSettingsDtoToModel(n)}mapControlDisplayUserSettingsModelToDto(t){return{DefaultFilterId:t.defaultFilterId,DefaultViewId:t.defaultViewId}}mapControlDisplayUserSettingsDtoToModel(t){return{defaultFilterId:t.DefaultFilterId,defaultViewId:t.DefaultViewId}}};function Pr(o){let t="",r=o.filter(n=>n.visible),i=r.filter(n=>n.visibleIndex!==null&&n.visibleIndex!==void 0);return i.length?t=i.sort((n,s)=>n.visibleIndex-s.visibleIndex)[0].dataField:t=r[0]&&r[0].dataField||"",t}var ze=class{constructor(t){this.gridGetter=t,this.privateContructor()}get grid(){return this.gridGetter()}getServiceColumns(){return[]}getRowUpdatingHandler(){}dataRowCellPrepared(t,r,i){}};function ko(o){return typeof o=="string"?o:JSON.stringify(o)}var kt=class{constructor(){this.invalidCells={}}addInvalidCell(t,r){let i=ko(t);this.invalidCells[i]||(this.invalidCells[i]={}),this.invalidCells[i][r]=!0}markValid(t,r){let i=ko(t);this.invalidCells[i]&&delete this.invalidCells[i][r]}isValid(t,r){let i=ko(t);return!this.invalidCells[i]||!this.invalidCells[i][r]}reset(){this.invalidCells={}}};var Go=class extends z{constructor(t){super();this.REQUEST_STATUS_UPDATED_EVENT="REQUEST_STATUS_UPDATED";this.pendingChanges=[];this.isRequestPending=!1;this.updateUrl=t}push(t,r=!1){this.emit(this.REQUEST_STATUS_UPDATED_EVENT,{dataChange:[t],status:0}),t.isSeparatedRequest=r,this.isRequestPending?this.pendingChanges.push(t):this.sendRequest([t])}async sendRequest(t){if(t.length===0)return;this.isRequestPending=!0,this.emit(this.REQUEST_STATUS_UPDATED_EVENT,{dataChange:t,status:1});let r=t.map(s=>{var l=s,{gridKey:i}=l,n=Qo(l,["gridKey"]);return n});try{let i=await x(this.updateUrl,"POST",JSON.stringify(r),!1,{contentType:"application/json"}),n=i.filter(s=>s.isSuccess).map(s=>O(A({},s),{dataChange:this.attachGridKey(s.dataChange,t)}));n.length&&this.emit(this.REQUEST_STATUS_UPDATED_EVENT,{status:2,dataChange:n.map(s=>s.dataChange),requestsInQueue:this.pendingChanges.length>0}),i.filter(s=>!s.isSuccess).forEach(s=>{let l=this.attachGridKey(s.dataChange,t);this.emit(this.REQUEST_STATUS_UPDATED_EVENT,{status:3,dataChange:[l],requestsInQueue:this.pendingChanges.length>0,error:s.error})})}catch(i){this.emit(this.REQUEST_STATUS_UPDATED_EVENT,{status:3,dataChange:t,requestsInQueue:this.pendingChanges.length>0,error:i})}finally{this.isRequestPending=!1;let i=[];for(;this.pendingChanges.length;){if(this.pendingChanges[0].isSeparatedRequest){i.length||(i.push(this.pendingChanges.shift()),this.pendingChanges.shift());break}i.push(this.pendingChanges.shift())}i.length&&this.sendRequest(i)}}attachGridKey(t,r){if(!t||t.gridKey!==void 0)return t;let i=r.find(n=>n.type!==t.type?!1:this.areKeysEqual(n.key,t.key));return i&&i.gridKey!==void 0?O(A({},t),{gridKey:i.gridKey}):t}areKeysEqual(t,r){if(t===r)return!0;if(!t||!r||typeof t!="object"||typeof r!="object")return!1;try{return JSON.stringify(t)===JSON.stringify(r)}catch{return!1}}};function $o(){let o=new Date().getTime(),t=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){let i=Math.random()*16;return o>0?(i=(o+i)%16|0,o=Math.floor(o/16)):(i=(t+i)%16|0,t=Math.floor(t/16)),(r==="x"?i:i&3|8).toString(16)})}var tn=(o,t)=>{var i;if(t===null||typeof t!="object"){let n=o.getRowIndexByKey(t),s=o.getVisibleRows();return n>=0?(i=s[n])==null?void 0:i.data:void 0}return o.getDataSource().items().find(n=>{for(let s in t)if(n[s]!==t[s])return!1;return!0})},Ke="isoz-uuid",Gt="isoz-updating-error",$t=class extends ze{constructor(t,r,i){super(t);this.editValidationTracker=new kt;this.pendingInsertPromise=null;this.requestQueue=new Go(r),this.setupRequestQueue(i)}setupRequestQueue(t){let r=null,i=(n,s,l)=>{window.setTimeout(()=>{let g=this.grid.getRowElement(this.grid.getRowIndexByKey(s));!g||(n==="updating"&&g.addClass("saving"),n==="updated"&&(g.removeClass("saving").addClass("saved"),g.css({opacity:"",pointerEvents:""}),window.setTimeout(()=>g.removeClass("saved"),1e3)))})};this.requestQueue.on(this.requestQueue.REQUEST_STATUS_UPDATED_EVENT,async n=>{switch(n.status){case 0:n.dataChange.forEach(s=>{s.type==="update"&&i("updating",s.gridKey??s.key)});break;case 1:r&&window.clearTimeout(r),t.html("<i class='dx-icon-refresh'></i> Saving...");break;case 2:r&&window.clearTimeout(r),n.requestsInQueue||(t.html("<i class='dx-icon-floppy'></i> Saved"),r=window.setTimeout(()=>t.html(""),3e3)),n.dataChange.forEach(s=>{s.type==="update"&&i("updated",s.gridKey??s.key),s.type==="insert"&&this.pendingInsertPromise&&this.pendingInsertPromise&&(this.pendingInsertPromise.resolve(s.data),this.pendingInsertPromise=null)});break;case 3:n.dataChange.forEach(s=>{if(s.type==="insert"&&this.pendingInsertPromise&&(this.pendingInsertPromise.reject(n.error),this.pendingInsertPromise=null),s.type==="update"){let l=s.data[Ke],g="";if(l){let p=this.grid.getVisibleRows();for(let h=0;h<p.length;h++)if(p[h].data[Ke]===l){let S=n.error,E=h,y=Object.keys(s.data).find(T=>T!==Ke);g=y,this.grid.cellValue(h,Gt,JSON.stringify({errMsg:S,rowIndex:E,editingField:y})),this.grid.saveEditData();break}}}});break}})}privateContructor(){}createDataSource(t){return this.keyExpr=t.key(),{store:new DevExpress.data.CustomStore({key:t.key(),load:r=>t.load(r),byKey:(r,i)=>t.byKey(r,i),update:(r,i)=>{let n=$.Deferred();if(i[Gt]){let{errMsg:s,rowIndex:l,editingField:g}=JSON.parse(i[Gt]);n.reject(s);let p=this.grid.getKeyByRowIndex(l);p&&this.editValidationTracker.addInvalidCell(p,g),this.grid.getCellElement(l,g).addClass("aps-grid__editing-failed")}else{let s=this.getGridKey(r),l=tn(this.grid,s);Object.keys(i).forEach(g=>{this.editValidationTracker.markValid(s,g)}),n.resolve($.extend(l||{},i)),this.requestQueue.push({key:this.getRequestKey(r),gridKey:s,type:"update",data:i})}return n.promise()},insert:r=>(this.pendingInsertPromise=$.Deferred(),this.requestQueue.push({type:"insert",data:r}),this.pendingInsertPromise.promise()),remove:r=>{let i=$.Deferred();return i.resolve(),this.requestQueue.push({type:"remove",key:this.getRequestKey(r),gridKey:this.getGridKey(r)}),i.promise()},onLoaded:()=>{this.editValidationTracker.reset()}})}}getServiceColumns(){return[{visible:!1,dataField:Ke},{visible:!1,dataField:Gt}]}getRowUpdatingHandler(){return t=>{let r=t.component.getRowIndexByKey(t.key),i=$o();t.component.getVisibleRows()[r].data[Ke]=i,t.newData[Ke]=i}}dataRowCellPrepared(t,r,i){this.editValidationTracker.isValid(t,r)||i.addClass("aps-grid__editing-failed")}getRequestKey(t){return this.keyExpr?Array.isArray(this.keyExpr)?t&&typeof t=="object"?t:this.keyExpr.reduce((r,i)=>(r[i]=t[i],r),{}):t&&typeof t=="object"&&this.keyExpr in t?{[this.keyExpr]:t[this.keyExpr]}:{[this.keyExpr]:t}:t}getGridKey(t){return!this.keyExpr||Array.isArray(this.keyExpr)?t:t&&typeof t=="object"?t[this.keyExpr]:t}};var Ht=class extends ze{createDataSource(t){return{store:t}}privateContructor(){}};var on={[1]:"string",[2]:"string",[8]:"string",[3]:"string",[4]:"string",[5]:"number",[6]:"string",[7]:"string",[10001]:"string",[10002]:"number",[10003]:"number",[10004]:"boolean",[10005]:"datetime",[10006]:"date"},ut=class{constructor(t){this.editingMode=2;this.fieldRefDataDict={};this.tryParseJson=t=>{try{return JSON.parse(t.toString())}catch{return}};this.onViewApplied=t=>{this.clearFilterRowAfterViewSwitching()};this.$container=t.$container,this.$savingIndicator=t.$savingIndicator,this.isStandalonePage=t.isStandalonePage,this.pageTitle=t.pageTitle,this.exportFileName=t.exportFileName,this.userName=t.userName,this.userConfigUrl=t.userConfigUrl,this.controlLogsUrl=t.controlLogsUrl,this.loadDataUrl=t.loadDataUrl,this.updateDataUrl=t.updateDataUrl,this.addDataUrl=t.addDataUrl,this.deleteDataUrl=t.deleteDataUrl,this.uploadDocumentUrl=t.uploadDocumentUrl,this.downloadDocumentUrl=t.downloadDocumentUrl,this.gridFiltersManagerOptions=t.gridFiltersManagerOptions,this.gridViewsManagerOptions=t.gridViewsManagerOptions,this.gridDisplaysManagerOptions=t.gridDisplaysManagerOptions,this.remoteControlDisplayUserSettingsManagerLoadOptions=t.remoteControlDisplayUserSettingsManagerLoadOptions,this.importFileOptions=t.importFileOptions,this.disableGlobalSearch=!!t.disableGlobalSearch,this.editingMode=t.enableInlineEditing?2:1,this.allowDataEditing=t.allowDataEditing,this.getReferencedDataUrl=t.getReferencedDataUrl,this.asyncSummaryLoad=t.asyncSummaryLoad,this.editingManager=this.editingMode===2?new $t(()=>this.mainGrid,t.batchUpdateDataUrl,this.$savingIndicator):new Ht(()=>this.mainGrid),this.imageManager=new ke,this.imageManager.onUploaded(async r=>{let i=this.imageManager.images.length;this.imageManager.images=await this.uploadAndUpdateDocuments(r,1),this.imageManager.selectedIndex=i}),this.imageManager.onDeleted(r=>{this.imageManager.images=this.deleteDocumentHandler(r)}),this.imageManager.onReordered(()=>this.reorderImagesHandler(this.imageManager.images)),this.documentManager=new Ge({width:550,height:600}),this.documentManager.onUploaded(async r=>{this.documentManager.documents=await this.uploadAndUpdateDocuments(r,2)}),this.documentManager.onDeleted(r=>{this.documentManager.documents=this.deleteDocumentHandler(r)}),this.documentManager.onOpen(r=>{window.open(`${this.downloadDocumentUrl}?name=${r}`,"_blank")}),this.documentManager.onDownload(r=>{window.open(r,"_blank")}),this.imageGallery=new $e,this.$container.addClass(["aps-grid","control-display-grid"]),this.loadPanel=$("<div />").dxLoadPanel({message:"Uploading..."}).dxLoadPanel("instance"),$(document.body).append(this.loadPanel.element())}showLoader(t="Uploading..."){this.loadPanel.option("message",t),this.loadPanel.show()}hideLoader(){this.loadPanel.hide()}async render(){this.showLoader("Loading...");let t=await x(this.userConfigUrl),i=t.FieldsConfiguration.filter(p=>{let h=p.DisplayType?JSON.parse(p.DisplayType):null;return(h==null?void 0:h.type)===8}).map(p=>p.Name).map(p=>x(`${this.getReferencedDataUrl}?field=${p}`).then(h=>this.fieldRefDataDict[p]=h));await Promise.all(i),this.hideLoader();let n=new dt(this.gridFiltersManagerOptions),s=new W(this.gridViewsManagerOptions),l=new Bo(this.gridDisplaysManagerOptions);this.mainGrid=this.createMainGrid(t.FieldsConfiguration,t.CanBeCreated,t.CanBeDeleted);let g=t.CanCreateDisplays&&t.CanCreateViews&&t.CanCreateFilters;(g||t.CanApplayDisplays)&&(this.gridDisplaysToolbarComponent=new Lo({owner:this.mainGrid,editMode:g,gridFiltersManager:n,gridViewsManager:s,gridDisplaysManager:l,importFileOptions:this.importFileOptions})),this.gridViewsToolbarComponent=new Po({owner:this.mainGrid,onViewApplied:this.onViewApplied,onViewDeleted:async()=>{await l.loadDisplays()},autoIntegration:!0,gridViewsManager:s,canCreateGlobalViews:t.CanCreateGlobalViews,visible:t.CanCreateViews}),this.gridFiltersToolbarComponent=new No({apsControlDisplayUserSettingsManager:new Vo({userId:this.userName,loadDataUrl:this.remoteControlDisplayUserSettingsManagerLoadOptions.loadDataUrl,updateDataUrl:this.remoteControlDisplayUserSettingsManagerLoadOptions.updateDataUrl}),owner:this.mainGrid,onFilterDeleted:async p=>{await l.loadDisplays()},autoIntegration:!0,gridFiltersManager:n,canCreateGlobalFilters:t.CanCreateGlobalFilters,visible:t.CanCreateFilters}),this.multipleEditingDataGridPlugin=new Fo({owner:this.mainGrid}),l.onDisplayChanged=async p=>{p?(await this.gridFiltersToolbarComponent.applyFilter(p.FilterId,!0),await this.gridViewsToolbarComponent.applyView(p.ViewId)):(this.gridFiltersToolbarComponent.applyFilter(void 0,!0),await this.gridViewsToolbarComponent.applyView(W.defaultControlDisplayView.id))}}async uploadAndUpdateDocuments(t,r){let i=[];try{this.showLoader("Uploading...");let n=new FormData;n.append("type",r.toString());for(let g of t)n.append("files",g);let l=await(await fetch(this.uploadDocumentUrl,{method:"POST",body:n})).json();if(l.RequestState===1){let g=this.mainGrid.cellValue(this.activeDocumentCellInfo.rowIndex,this.activeDocumentCellInfo.field),p=ae(g)?JSON.parse(g):[],h=l.Data;p.push(...h),this.mainGrid.cellValue(this.activeDocumentCellInfo.rowIndex,this.activeDocumentCellInfo.field,JSON.stringify(p)),this.editingMode===2&&!this.isActiveDocumentRowNew()&&this.mainGrid.saveEditData(),i=p}else P(l.Message,!1)}catch{P("Error",!1)}finally{this.hideLoader()}return i}changePreviewImageSizeHandler(t,r){this.gridViewsToolbarComponent.options.gridStateManager.setFieldPreviewSize(t,r);let n=this.mainGrid.getVisibleRows().map(s=>s.rowIndex);this.mainGrid.repaintRows(n)}deleteDocumentHandler(t){let r=this.mainGrid.cellValue(this.activeDocumentCellInfo.rowIndex,this.activeDocumentCellInfo.field),n=(ae(r)?JSON.parse(r):[]).filter(s=>s.Id!==t);return this.mainGrid.cellValue(this.activeDocumentCellInfo.rowIndex,this.activeDocumentCellInfo.field,n.length?JSON.stringify(n):""),this.editingMode===2&&!this.isActiveDocumentRowNew()&&this.mainGrid.saveEditData(),n}reorderImagesHandler(t){this.mainGrid.cellValue(this.activeDocumentCellInfo.rowIndex,this.activeDocumentCellInfo.field,t.length?JSON.stringify(t):"")}isActiveDocumentRowNew(){if(!this.mainGrid||!this.activeDocumentCellInfo)return!1;if(this.activeDocumentCellInfo.isNewRow)return!0;let t=this.mainGrid.getVisibleRows().find(i=>i.rowIndex===this.activeDocumentCellInfo.rowIndex),r=!!(t==null?void 0:t.isNewRow);return this.activeDocumentCellInfo.isNewRow=r,r}hasPermission(t,r){return(t&r)!==0}buildTree(t){let r="__GROUP__",i=t.reduce((s,l)=>(l.Columns=[],l.GroupField=l.GroupField?`${r}${l.GroupField}`:null,s[l.Name]=l,s),{});i=t.filter(s=>s.GroupField).map(s=>s.GroupField).filter((s,l,g)=>g.indexOf(s)===l).reduce((s,l)=>{let g=l.replace(r,""),p={Name:l,Label:g,Columns:[],GroupField:i[g]&&i[g].GroupField&&i[g].GroupField!==l?i[g].GroupField:null};return s[l]=p,s},i);let n=[];for(let s in i)if(i.hasOwnProperty(s)){let l=i[s];l.GroupField?i[l.GroupField].Columns.push(l):n.push(l)}return n}renderDisplayType(t,r,i,n){var s;if(t.type===1&&(r.cellTemplate=(l,g)=>{let p=String(g.value),h=t.data.find(S=>String(S.value)===p);h?$("<div>").css({"text-align":"center"}).attr("title",h.title).append($("<img>",{src:h.image})).appendTo(l):$("<div />").css({"text-align":"center"}).text(g.value).appendTo(l)},r.editCellTemplate=(l,g)=>{var p;$("<div />").dxSelectBox({dataSource:t.data,displayValue:"title",itemTemplate:h=>$("<div />").css({"text-align":"center"}).attr("title",h.title).append($("<img>",{src:h.image})).appendTo(l),fieldTemplate:(h,S)=>{let E=t.data.find(I=>{var m;return I.value.toString()===((m=g.value)==null?void 0:m.toString())}),y=$("<div />").addClass("item-name"),T=$("<div />").addClass("aps-icon-editor__custom-item").append($("<img>",{src:E?E.image:""}).attr("title",E?E.title:"")).append(y);y.dxTextBox({value:"",readOnly:!0}),S.append(T)},onValueChanged:({value:h,component:S})=>{g.setValue(parseInt(h.value)),S.blur()},value:(p=g.value)==null?void 0:p.toString(),selectedItem:t.data.find(h=>parseInt(h.value)===g.value)}).appendTo(l)},r.allowSearch=!1,r.allowFiltering=!1,r.allowHeaderFiltering=!0,r.allowGrouping=!1),t.type===2){let l=((s=t.data)==null?void 0:s.items)||[];r.cellTemplate=(g,p)=>{let h=this.getPredefinedValuesToString(p.value,t);g.append(h)},r.editCellTemplate=(g,p)=>{let h=(p.value||"").toString().split(";").map(E=>parseInt(E)),S=$("<div />").dxDropDownBox({dataSource:l,valueExpr:"key",displayExpr:"value",value:h,showClearButton:!0,acceptCustomValue:!1,dropDownOptions:{width:400},contentTemplate:E=>{var y;return $("<div />").dxDataGrid({dataSource:l,keyExpr:"key",columns:[{dataField:"key",visible:!1},{dataField:"value"}],showBorders:!1,showColumnLines:!1,showRowLines:!1,showColumnHeaders:!1,selection:{mode:((y=t.data)==null?void 0:y.multiselect)?"multiple":"single"},selectedRowKeys:h,activeStateEnabled:!1,onSelectionChanged:T=>{let I=T.component.option("selectedRowKeys");E.component.option("value",I)}})},onValueChanged:E=>{let y=(E.value||[]).join(";");p.setValue(y)}}).dxDropDownBox("instance");g.append(S.element()),S.open()},r.headerFilter={dataSource:l.map(g=>({text:g.value,value:[r.dataField,"contains",g.key.toString()]}))},r.filterOperations=["contains"],r.calculateFilterExpression=(g,p,h)=>{if(h==="headerFilter")return[r.dataField,"contains",g];{let S=p==="<>"||p==="notcontains",E=l.filter(T=>{switch(p){case"contains":return T.value.includes(g);case"notcontains":return T.value.includes(g);case"startswith":return T.value.startsWith(g);case"endswith":return T.value.endsWith(g);case"=":return T.value===g;case"<>":return T.value===g;default:return!1}}).map(T=>[r.dataField,S?"notcontains":"contains",T.key.toString()]);return S?E.push([r.dataField,"=",null]):E.length||E.push([r.dataField,"=","__no_value__"]),E.flatMap(T=>[S?"and":"or",T]).slice(1)}}}if(t.type===8){let l=t.data.fields.map(E=>({dataField:E,allowSearch:!0,allowFiltering:!0})),g=this.getReferencedDataUrl[r.dataField]||[],p=E=>{if(E===null)return[];if(Array.isArray(E))return E;let y=this.tryParseJson(E)||E;return Array.isArray(y)?y:[y]},h=(E,y,T)=>E?y.length===1?E[y[0]]:y.reduce((m,u)=>(m.push(`${u}: ${E.hasOwnProperty(u)?E[u]:T?'<i class="referenced-value-error">Field deleted or renamed</i>':"undefined"}`),m),[]).join(", "):"",S=(E,y,T)=>{let I=$("<div />");return p(E).forEach(m=>{let u=y.lookup.calculateCellValue(m);u||T||!m?I.append(u?`<div>${u}</div>`:""):I.append(`<div><i class="referenced-value-error">Row ${t.data.table}.[${t.data.key}]=${m} not found</i></div>`)}),I};r.cellTemplate=(E,y)=>{E.append(S(y.value,y.column,y.row.isNewRow))},r.editCellTemplate=(E,y)=>{let T=$("<div />").dxDataGrid({height:500,width:"100%",dataSource:g,remoteOperations:!0,scrolling:{mode:"virtual"},selection:{mode:t.data.multiselect?"multiple":"single",showCheckBoxesMode:"always"},headerFilter:{visible:!0},filterRow:{visible:!0},selectedRowKeys:p(y.value),columns:[{dataField:t.data.key,visible:!1},...l],onSelectionChanged:m=>{I.option("value",m.selectedRowKeys)}}).dxDataGrid("instance"),I=$("<div />").dxDropDownBox({dataSource:g,value:p(y.value),valueExpr:t.data.key,displayExpr:m=>h(m,t.data.fields,!1),contentTemplate:()=>T.element(),showClearButton:!0,dropDownOptions:{width:500},onValueChanged:m=>{let u=m.value;if(!(u==null?void 0:u.length))y.setValue(null);else{let v=t.data.multiselect?JSON.stringify(u):u[0];y.setValue(v)}!t.data.multiselect&&(u==null?void 0:u.length)&&I.close()}}).dxDropDownBox("instance");E.append(I.element()),I.open()},r.lookup={dataSource:g,valueExpr:t.data.key,displayExpr:E=>h(E,t.data.fields,!0)},r.groupCellTemplate=(E,y)=>{E.append($(`
|
|
56
56
|
<div class="referenced-value-group-header">
|
|
57
|
-
<div class="referenced-value-group-header__caption">${
|
|
57
|
+
<div class="referenced-value-group-header__caption">${y.column.caption}: </div>
|
|
58
58
|
</div>
|
|
59
|
-
`).append(
|
|
60
|
-
<span class='aps-control-log__field'>${
|
|
61
|
-
<span class='aps-control-log__old-value'>${
|
|
59
|
+
`).append(S(y.value,y.column,y.row.isNewRow)))},t.data.grouping&&(r.groupIndex=0)}t.type===3&&(r.editCellTemplate=(l,g)=>{$("<div />").dxCheckBox({value:g.value||!1,readOnly:!this.hasPermission(i,4),onValueChanged:p=>{g.component.cellValue(g.rowIndex,g.column.dataField,p.value)}}).appendTo(l)}),t.type===4&&(r.cellTemplate=(l,g)=>{let p=g.value,h=t.data,E=(typeof h.useStaticLink>"u"?!0:h.useStaticLink)?h.url:p;if(E){let y=$(`<a href="${E}"></a>`);h.text?y.text(h.text):(l.css("text-align","center"),y.css("text-decoration","none"),y.append($('<i class="icon dx-icon-link" style="font-size: 20px;"></i>'))),h.openNewTab&&y.attr("target","_blank"),y.appendTo(l)}}),t.type===5&&(r.cellTemplate=(l,g)=>{let p=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"});l.append(p.format(g.value))}),t.type===7&&(r.alignment="center",r.allowEditing=!1,r.allowHeaderFiltering=!1,r.allowSearch=!1,r.allowFiltering=!0,r.filterOperations=[],r.cellTemplate=(l,g)=>{let p=this.gridViewsToolbarComponent.options.gridStateManager.getFieldPreviewSize(r.dataField)||2,h=0;switch(p){case 1:h=100;break;case 2:h=200;break;case 3:h=300;break}let S=this.hasPermission(i,4)&&this.allowDataEditing,E={images:ae(g.value)?JSON.parse(g.value):[],metaData:t.data.metaDataFields?t.data.metaDataFields.map(I=>{let m=n.find(u=>u.Name===I);return{name:(m==null?void 0:m.Label)||I,value:g.row.data[I]}}):[]},y=()=>{var I;this.activeDocumentCellInfo={rowIndex:g.rowIndex,field:r.dataField,isNewRow:(I=g.row)==null?void 0:I.isNewRow},this.imageManager.open(E,!S)},T=h&&E.images.length?$("<div />").dxGallery({dataSource:E.images.map(I=>({imageSrc:I.PreviewUrl,imageAlt:I.Name})),width:h,height:h,loop:!1,showNavButtons:!0,showIndicator:!1,onItemClick:()=>y()}):$('<i class="fa-solid fa-image" style="font-size: 20px; cursor: pointer;"></i>').on("click",()=>y());l.append(T),l.addClass("display-type-image-cell"),E.images.length&&T.css("color","#4cae4c")}),t.type===6&&(r.alignment="center",r.allowEditing=!1,r.allowHeaderFiltering=!1,r.allowSearch=!1,r.allowFiltering=!1,r.cellTemplate=(l,g)=>{let p=this.hasPermission(i,4)&&this.allowDataEditing,h=ae(g.value)?JSON.parse(g.value):[],S=$('<i class="fa-solid fa-file" style="font-size: 20px; cursor: pointer;"></i>');S.on("click",()=>{var E;this.activeDocumentCellInfo={rowIndex:g.rowIndex,field:r.dataField,isNewRow:(E=g.row)==null?void 0:E.isNewRow},this.documentManager.open(h,!p)}),l.append(S),h.length&&S.css("color","#4cae4c")})}configureColumn(t,r){let i=t.Label||t.Name,n=t.ToolTip||i,s=t.DisplayType?JSON.parse(t.DisplayType):null,l=s?on[s.type]:t.Type;l==="decimal"&&(l="number");let g=!!this.hasPermission(t.Permissions,1),p=g&&this.hasPermission(t.Permissions,4)&&!t.IsComputed&&!t.IsIdentity&&this.allowDataEditing,h=t.Columns.length?{caption:i,columns:t.Columns.map(S=>this.configureColumn(S,r))}:{dataField:t.Name,dataType:l,caption:i,headerCellTemplate:de(i,n),visible:g&&t.IsDefaultViewField,visibleIndex:t.Order,allowFixing:!1,allowEditing:p,width:t.Width,hidingPriority:t.HidingOrder,allowExporting:g&&t.IsExported,validationRules:p&&!t.IsNullable&&!t.HasDefaultValue||p&&t.IsKeyColumn?[{type:"required"}]:[]};if(s){if(s.type===1){let S=s.data.map(E=>({text:E.title,value:E.value}));S.splice(0,0,{text:"Blank",value:null}),h.headerFilter={dataSource:S}}this.renderDisplayType(s,h,t.Permissions,r)}return h}configureColumns(t){t=this.buildTree(t);let r=t.map(n=>this.configureColumn(n,t)),i=this.editingManager.getServiceColumns();return r.push(...i),r}createMainGrid(t,r,i){let n=t.some(y=>y.IsKeyColumn),s=this.configureColumns(t),l=Pr(s),g=t.filter(y=>y.IsKeyColumn).map(y=>y.Name),p=g.length===1?g[0]:g,h=ce({key:p,loadUrl:this.loadDataUrl,updateUrl:this.updateDataUrl,deleteUrl:this.deleteDataUrl||void 0,insertUrl:this.addDataUrl||void 0,notifyError:!0}),S={dataSource:this.editingManager.createDataSource(h),columnResizingMode:"widget",width:"100%",editing:{allowUpdating:this.allowDataEditing&&n,allowAdding:this.allowDataEditing&&!!this.addDataUrl&&r,allowDeleting:this.allowDataEditing&&!!this.deleteDataUrl&&i,mode:this.editingMode===2?"cell":"batch",useIcons:!0,refreshMode:this.editingMode===2?"repaint":void 0},onRowUpdating:this.editingManager.getRowUpdatingHandler(),loadPanel:{enabled:this.editingMode===1},repaintChangesOnly:this.editingMode===2,errorRowEnabled:!0,searchPanel:{visible:!this.disableGlobalSearch},scrolling:{mode:"virtual",preloadEnabled:!0},remoteOperations:!0,pager:{visible:!1},height:this.isStandalonePage?void 0:"100%",columnChooser:{enabled:!0,mode:"dragAndDrop"},columnFixing:{enabled:!0},filterPanel:{visible:!0,texts:{createFilter:"None"}},summary:{totalItems:[{summaryType:"count",column:l}]},allowColumnResizing:!0,columnHidingEnabled:!1,hoverStateEnabled:!0,columns:s,allowColumnReordering:!0,grouping:{contextMenuEnabled:!0,autoExpandAll:!0,allowCollapsing:!0,expandMode:"buttonClick"},groupPanel:{visible:!0},masterDetail:n?{enabled:!0,template:(y,T)=>{let I={};t.filter(m=>m.IsKeyColumn).forEach(m=>I[m.Name]=T.data[m.Name]),$("<div>").dxDataGrid({dataSource:{store:ce({loadUrl:`${this.controlLogsUrl}?key=${JSON.stringify(I)}`})},showBorders:!0,columns:[{dataField:"User",width:200},{dataField:"CreatedAt",caption:"Date",dataType:"date",format:"shortDateShortTime",width:200},{dataField:"Changes",cellTemplate:(m,u)=>{let v=u.data.Changes.map(w=>`<div class='aps-control-log'>
|
|
60
|
+
<span class='aps-control-log__field'>${w.Field}</span>
|
|
61
|
+
<span class='aps-control-log__old-value'>${w.OldValue}</span>
|
|
62
62
|
\u2192
|
|
63
|
-
<span class='aps-control-log__new-value'>${
|
|
64
|
-
</div>`).join("");$(`<div class='aps-control-logs'>${
|
|
63
|
+
<span class='aps-control-log__new-value'>${w.NewValue}</span>
|
|
64
|
+
</div>`).join("");$(`<div class='aps-control-logs'>${v}</div>`).appendTo(m)}}]}).appendTo(y)}}:void 0,onContentReady:y=>{!y.component||this.prepareFilterPanel(y.component)},onEditorPreparing:y=>{let T=t.find(m=>m.Name===y.dataField);if(!T)return;let I=T.DisplayType?JSON.parse(T.DisplayType):null;if(y.parentType==="filterRow"&&(I==null?void 0:I.type)===7)y.editorName="dxSelectBox",y.editorOptions.dataSource=[{value:4,text:"Icon"},{value:1,text:"Small"},{value:2,text:"Medium"},{value:3,text:"Large"}],y.editorOptions.value=this.gridViewsToolbarComponent.options.gridStateManager.getFieldPreviewSize(y.dataField)||2,y.editorOptions.valueExpr="value",y.editorOptions.displayExpr="text",y.editorOptions.fieldTemplate=(m,u)=>{let v=$(`
|
|
65
65
|
<div class="preview-size-switch">
|
|
66
66
|
<i class="preview-size-switch__icon fa-solid fa-maximize"></i>
|
|
67
67
|
<div class="preview-size-switch__input"></div>
|
|
68
68
|
</div>
|
|
69
|
-
`);$(".preview-size-switch__input",u).dxTextBox({value:I.text,readOnly:!0}),y.append(u)},m.editorOptions.onValueChanged=I=>this.changePreviewImageSizeHandler(m.dataField,I.value);else if(m.parentType==="dataRow"){let I=!this.hasPermission(S.Permissions,4);if(m.editorOptions.readOnly=I,!I&&S.Type==="string"){let y=m.setValue;m.setValue=u=>{y(u.trim())}}}},onCellPrepared:m=>{if(m.rowType==="data"){let S=t.find(T=>T.Name===m.column.dataField);S&&!this.hasPermission(S.Permissions,4)&&$(m.cellElement).addClass("aps-grid__disabled-cell"),this.editingManager.dataRowCellPrepared(m.key,m.column.dataField,m.cellElement)}},onRowExpanded:m=>{let S=m.component.getRowIndexByKey(m.key)+1;m.component.getCellElement(S,0).parent().find(".dx-master-detail-cell").find(".dx-datagrid").first().parent().dxDataGrid("instance").refresh()},onExporting:m=>{if(!this.exportFileName)return;let S=new window.ExcelJS.Workbook,T=S.addWorksheet(this.exportFileName),I=this.getPredefinedValuesFields(t);DevExpress.excelExporter.exportDataGrid({component:m.component,worksheet:T,customizeCell:y=>{let{gridCell:u}=y,{excelCell:v}=y;if(v.font={name:"Arial",size:12},v.alignment={horizontal:"left"},u.rowType==="data"){let w=I.find(_=>_.Name===u.column.dataField),D=(w==null?void 0:w.DisplayType)?JSON.parse(w.DisplayType):null;D&&(v.value=this.getPredefinedValuesToString(u.value,D))}}}).then(()=>{S.xlsx.writeBuffer().then(y=>{(0,Ur.default)(new Blob([y],{type:"application/octet-stream"}),`${this.exportFileName}.xlsx`)})})}};return V(this.$container,{options:h,isFullScreen:this.isStandalonePage,setDefaultColumnWidth:!0,exportFileName:this.exportFileName,title:this.pageTitle,disableSummaryColumnDetection:!0,asyncSummaryLoad:this.asyncSummaryLoad},this.loadDataUrl)}prepareFilterPanel(t){let r=t.element().find(".dx-datagrid-filter-panel"),i=r.find(".dx-icon-filter"),n=r.find(".dx-datagrid-filter-panel-text");i.off("click"),n.off("click")}initRowsCountSummary(t){let r=t.getVisibleColumns().find(l=>!!l.dataField);if(!r)return;let i="RowsCount",n=t.option("summary.totalItems")||[],s=n.find(l=>l&&l.name===i);s&&s.column===r.dataField||(s?s.column=r.dataField:n.push({name:i,column:r.dataField,summaryType:"count",alignment:"left"}),this.mainGrid.option("summary.totalItems",n))}clearFilterRowAfterViewSwitching(){let t=()=>{let r={};(this.gridViewsToolbarComponent.options.gridStateManager.currentSavedGridState.columns||this.gridViewsToolbarComponent.options.owner.option("columns")).filter(n=>n.visibleIndex&&(n.filterValue||n.filterValues)).forEach(n=>r[n.visibleIndex]=n),$('td [aria-label*="Filter cell"]').filter(n=>!r[n]).val(""),this.mainGrid.off("contentReady",t)};this.mainGrid.on("contentReady",t)}getPredefinedValuesToString(t,r){var s;let i=((s=r.data)==null?void 0:s.items)||[],n=(t||"").toString().split(";").map(l=>parseInt(l));return i.filter(l=>n.includes(l.key)).map(l=>l.value).join(", ")}getPredefinedValuesFields(t){var i;let r=[];for(let n of t){let s=n.DisplayType?JSON.parse(n.DisplayType):null;(s==null?void 0:s.type)===2&&r.push(n),((i=n.Columns)==null?void 0:i.length)&&r.push(...this.getPredefinedValuesFields(n.Columns))}return r}};var ct=class{constructor(t){this.$container=t.$container,this.isStandalonePage=t.isStandalonePage,this.loadDataUrl=t.loadDataUrl,this.updateDataUrl=t.updateDataUrl,this.pageTitle=t.pageTitle}render(){let t=[],r=x(this.loadDataUrl,"get").then(g=>{t=g.Displays.map(E=>({Id:E.Id.toString(),Caption:E.Name}));let p=[];for(let E of g.Users){let m={UserName:E.UserName,UserId:E.Id};g.Assignments.filter(T=>T.UserId===E.Id).forEach(T=>{m[T.DisplayId]=!0}),p.push(m)}let h=[{dataField:"UserName",width:300,fixed:!0,fixedPosition:"left",allowEditing:!1},{dataField:"UserId",visible:!1}];return l.option("columns",h.concat(t.map(E=>({dataField:E.Id,caption:E.Caption,dataType:"boolean",calculateCellValue:m=>!!m[E.Id]})))),p}),i=!1,n={elementAttr:{class:"aps-display-manager"},dataSource:{store:new DevExpress.data.CustomStore({key:"UserId",loadMode:"raw",load:()=>r,update:(g,p)=>{let h=[],E=[],m=i;return i=!0,Object.keys(p).forEach(T=>{p[T]?E.push(parseInt(T)):h.push(parseInt(T))}),window.setTimeout(()=>{i=!1},0),x(this.updateDataUrl,"put",{userId:g,displaysToRemove:h,displaysToAdd:E},!m).promise()}})},height:"100%",width:"100%",selection:{mode:"none"},allowColumnResizing:!0,grouping:{contextMenuEnabled:!0},groupPanel:{visible:!0},remoteOperations:!1,editing:{allowUpdating:!0,mode:"cell",refreshMode:"repaint"}},s={exportFileName:"DisplayManagement",summaryColumn:"UserName"},l;this.isStandalonePage?l=He(this.$container,n,s,this.pageTitle,"",!0):l=V(this.$container,{options:n,summaryColumn:s.summaryColumn,title:this.pageTitle,isFullScreen:!1})}};var Pr=new Map,Go=class{constructor(t){this.roles=[];this.rowPermissionsChanges={};this.rowPermissionChangeHandler=(t,r,i)=>{this.saveButton.option("disabled",!1),this.saveButton.element().parents(".dx-toolbar-item").removeClass("dx-state-disabled"),this.cancelButton.option("disabled",!1),this.cancelButton.element().parents(".dx-toolbar-item").removeClass("dx-state-disabled"),this.rowPermissionsChanges[t]||(this.rowPermissionsChanges[t]={CanBeCreated:!1,CanBeDelete:!1}),r==="add"?this.rowPermissionsChanges[t].CanBeCreated=i:this.rowPermissionsChanges[t].CanBeDelete=i};this.setRowPermissionValues=t=>{for(let r of t){let i=$(`.add-permission--${r.Id}`).dxCheckBox("instance"),n=$(`.del-permission--${r.Id}`).dxCheckBox("instance");i==null||i.option("value",r.CanBeCreated),n==null||n.option("value",r.CanBeDeleted)}};this.getRowPermissionValues=()=>{let t=[];for(let r of this.roles){let i=$(`.add-permission--${r.Id}`).dxCheckBox("instance"),n=$(`.del-permission--${r.Id}`).dxCheckBox("instance");i==null||i.option("value"),n==null||n.option("value"),t.push({Id:r.Id,Name:r.Name,CanBeCreated:(i==null?void 0:i.option("value"))||!1,CanBeDeleted:(n==null?void 0:n.option("value"))||!1})}return t};this.$container=t.$container,this.isStandalonePage=t.isStandalonePage,this.availableRolesUrl=t.availableRolesUrl,this.loadDataUrl=t.loadDataUrl,this.updateDataUrl=t.updateDataUrl,this.batchUpdateDataUrl=t.batchUpdateDataUrl,this.updateRowPermissionsUrl=t.updateRowPermissionsUrl,this.getRowPermissionsUrl=t.getRowPermissionsUrl,this.pageTitle=t.pageTitle,this.isDataReadonly=!!t.isDataReadonly}render(){this.$container.addClass("aps-grid"),Promise.all([this.getFieldPermissionSettings(),this.getAvailableRoles(),this.getRowPermissionSettings()]).then(t=>{this.roles=t[1],this.createMainGrid(t[0],t[2])})}async getAvailableRoles(){let t=await x(this.availableRolesUrl);return t.sort((r,i)=>{let n=Pr.get(r.Name)||9999,s=Pr.get(i.Name)||9999;return n-s}),t}async getFieldPermissionSettings(){return(await x(this.loadDataUrl)).data}async getRowPermissionSettings(){return await x(this.getRowPermissionsUrl)}async updatePermissionSettings(t){return await x(this.updateRowPermissionsUrl,"POST",{data:t})}createMainGrid(t,r){let i,n={dataSource:t,keyExpr:"Name",height:"100%",width:"100%",editing:{mode:"batch",allowUpdating:!0,allowAdding:!1,allowDeleting:!1,refreshMode:"repaint",useIcons:!0},repaintChangesOnly:!0,remoteOperations:!1,grouping:{allowCollapsing:!1},groupPanel:{visible:!1},selection:{mode:"none"},allowColumnReordering:!1,columnHidingEnabled:!1,hoverStateEnabled:!0,columnAutoWidth:!1,rowAlternationEnabled:!0,columnMinWidth:80,columns:this.prepareMainGridColumns([{dataField:"Name",caption:"Field",fixed:!0,fixedPosition:"left",sortOrder:"asc",sortIndex:1,width:180,allowEditing:!1,cellTemplate:(l,g)=>{let p=$(`<div style="display: flex; align-items: center;">${(g==null?void 0:g.value)||""}</div>`);g.data.IsSystemColumn&&p.prepend('<i class="icon dx-icon-info" style="margin-right: 4px; color: #aaa;" title="System field"></i>'),l.append(p)}},{dataField:"IsSystemColumn",allowEditing:!1,dataType:"boolean",sortOrder:"asc",sortIndex:0,visible:!1},{dataField:"Label",allowEditing:!1,fixed:!0,fixedPosition:"left",width:180},{name:"Roles",caption:"Roles",allowEditing:!0,allowHiding:!1,columns:this.createRolesColumns(this.roles,r)},{dataField:"GroupField",visible:!1},{dataField:"Type",visible:!1},{dataField:"DataOwner",visible:!1},{dataField:"XLSScheduleLabel",visible:!1},{dataField:"DisplayType",visible:!1},{dataField:"IsDefaultViewField",visible:!1},{dataField:"IsKeyColumn",visible:!1},{dataField:"Order",visible:!1},{dataField:"Width",visible:!1},{dataField:"HidingOrder",visible:!1},{dataField:"ToolTip",visible:!1}]),onSaving:l=>{l.cancel=!0,l.component.beginCustomLoading("Saving...");let g=(h,E,m)=>{E.hasOwnProperty(h)||(E[h]=m[h])},p=l.component.getDataSource().items();l.changes.forEach(h=>{let m=p.find(T=>T.Name===h.key).Roles;Object.getOwnPropertyNames(h.data.Roles).forEach(T=>{let I=this.roles.find(v=>v.Name===T),y=m[T],u=h.data.Roles[T];I&&h.data.Roles[T]&&(u.Id=I.Id),g("CanBeCreated",u,y),g("CanBeRead",u,y),g("CanBeUpdated",u,y),g("CanBeDeleted",u,y)})}),l.promise=at(this.batchUpdateDataUrl,l.changes).then(()=>this.updatePermissionSettings(this.getRowPermissionValues())).then(()=>Promise.all([this.getFieldPermissionSettings(),this.getRowPermissionSettings()])).then(h=>{l.component.option("dataSource",h[0]),this.setRowPermissionValues(h[1]),l.component.cancelEditData()}).done(()=>l.component.endCustomLoading())},onRowUpdated:l=>{l.component.endCustomLoading(),l.component.repaint()},onInitNewRow:l=>{l.data={Roles:this.roles.reduce((g,p)=>(g[p.Name]={Id:p.Id,Name:p.Name,CanBeRead:!0,CanBeUpdated:!1},g),{})}},onToolbarPreparing:l=>{let g=l.toolbarOptions.items;this.isDataReadonly&&g.push({location:"before",text:"The source data is read only, editing is not available"})},onContentReady:()=>{var g;this.saveButton=$(".dx-datagrid-save-button").dxButton("instance"),this.cancelButton=$(".dx-datagrid-cancel-button").dxButton("instance");let l=(g=this.cancelButton)==null?void 0:g.option("onClick");l&&this.cancelButton.option("onClick",p=>{l(p),this.setRowPermissionValues(r)})}},s={summaryColumn:"Name"};return this.isStandalonePage?i=He(this.$container,n,s,this.pageTitle,"",!0):i=V(this.$container,{options:n,summaryColumn:s.summaryColumn,title:this.pageTitle,isFullScreen:!1}),i}prepareMainGridColumns(t){return t.forEach(r=>{(r.allowHiding===void 0||r.allowHiding===null)&&(r.allowHiding=!1),(r.showInColumnChooser===void 0||r.showInColumnChooser===null)&&(r.showInColumnChooser=!1)}),t}createRolesColumns(t,r){return t.map(i=>({name:i.Name,caption:i.Name,allowHiding:!0,visible:!0,showInColumnChooser:!0,columns:[this.createRolesPermissionColumn(i.Name,"CanBeRead",{headerCellTemplate:de("Read","Read")}),this.createRolesPermissionColumn(i.Name,"CanBeUpdated",{headerCellTemplate:de("Edit",this.isDataReadonly?"The source data is read only, editing is not available":"Edit")},!0)],headerCellTemplate:(n,s)=>{let l=r.find(p=>p.Id===i.Id),g=$(`
|
|
69
|
+
`);$(".preview-size-switch__input",v).dxTextBox({value:m.text,readOnly:!0}),u.append(v)},y.editorOptions.onValueChanged=m=>this.changePreviewImageSizeHandler(y.dataField,m.value);else if(y.parentType==="dataRow"){let m=!this.hasPermission(T.Permissions,4);if(y.editorOptions.readOnly=m,!m&&T.Type==="string"){let u=y.setValue;y.setValue=v=>{u(v.trim())}}}},onCellPrepared:y=>{if(y.rowType==="data"){let T=t.find(I=>I.Name===y.column.dataField);T&&!this.hasPermission(T.Permissions,4)&&$(y.cellElement).addClass("aps-grid__disabled-cell"),this.editingManager.dataRowCellPrepared(y.key,y.column.dataField,y.cellElement)}},onRowExpanded:y=>{let T=y.component.getRowIndexByKey(y.key)+1;y.component.getCellElement(T,0).parent().find(".dx-master-detail-cell").find(".dx-datagrid").first().parent().dxDataGrid("instance").refresh()},onExporting:y=>{if(!this.exportFileName)return;let T=new window.ExcelJS.Workbook,I=T.addWorksheet(this.exportFileName),m=this.getPredefinedValuesFields(t);DevExpress.excelExporter.exportDataGrid({component:y.component,worksheet:I,customizeCell:u=>{let{gridCell:v}=u,{excelCell:w}=u;if(w.font={name:"Arial",size:12},w.alignment={horizontal:"left"},v.rowType==="data"){let D=m.find(_=>_.Name===v.column.dataField),C=(D==null?void 0:D.DisplayType)?JSON.parse(D.DisplayType):null;C&&(w.value=this.getPredefinedValuesToString(v.value,C))}}}).then(()=>{T.xlsx.writeBuffer().then(u=>{(0,Nr.default)(new Blob([u],{type:"application/octet-stream"}),`${this.exportFileName}.xlsx`)})})}};return V(this.$container,{options:S,isFullScreen:this.isStandalonePage,setDefaultColumnWidth:!0,exportFileName:this.exportFileName,title:this.pageTitle,disableSummaryColumnDetection:!0,asyncSummaryLoad:this.asyncSummaryLoad},this.loadDataUrl)}prepareFilterPanel(t){let r=t.element().find(".dx-datagrid-filter-panel"),i=r.find(".dx-icon-filter"),n=r.find(".dx-datagrid-filter-panel-text");i.off("click"),n.off("click")}initRowsCountSummary(t){let r=t.getVisibleColumns().find(l=>!!l.dataField);if(!r)return;let i="RowsCount",n=t.option("summary.totalItems")||[],s=n.find(l=>l&&l.name===i);s&&s.column===r.dataField||(s?s.column=r.dataField:n.push({name:i,column:r.dataField,summaryType:"count",alignment:"left"}),this.mainGrid.option("summary.totalItems",n))}clearFilterRowAfterViewSwitching(){let t=()=>{let r={};(this.gridViewsToolbarComponent.options.gridStateManager.currentSavedGridState.columns||this.gridViewsToolbarComponent.options.owner.option("columns")).filter(n=>n.visibleIndex&&(n.filterValue||n.filterValues)).forEach(n=>r[n.visibleIndex]=n),$('td [aria-label*="Filter cell"]').filter(n=>!r[n]).val(""),this.mainGrid.off("contentReady",t)};this.mainGrid.on("contentReady",t)}getPredefinedValuesToString(t,r){var s;let i=((s=r.data)==null?void 0:s.items)||[],n=(t||"").toString().split(";").map(l=>parseInt(l));return i.filter(l=>n.includes(l.key)).map(l=>l.value).join(", ")}getPredefinedValuesFields(t){var i;let r=[];for(let n of t){let s=n.DisplayType?JSON.parse(n.DisplayType):null;(s==null?void 0:s.type)===2&&r.push(n),((i=n.Columns)==null?void 0:i.length)&&r.push(...this.getPredefinedValuesFields(n.Columns))}return r}};var ct=class{constructor(t){this.$container=t.$container,this.isStandalonePage=t.isStandalonePage,this.loadDataUrl=t.loadDataUrl,this.updateDataUrl=t.updateDataUrl,this.pageTitle=t.pageTitle}render(){let t=[],r=x(this.loadDataUrl,"get").then(g=>{t=g.Displays.map(S=>({Id:S.Id.toString(),Caption:S.Name}));let p=[];for(let S of g.Users){let E={UserName:S.UserName,UserId:S.Id};g.Assignments.filter(T=>T.UserId===S.Id).forEach(T=>{E[T.DisplayId]=!0}),p.push(E)}let h=[{dataField:"UserName",width:300,fixed:!0,fixedPosition:"left",allowEditing:!1},{dataField:"UserId",visible:!1}];return l.option("columns",h.concat(t.map(S=>({dataField:S.Id,caption:S.Caption,dataType:"boolean",calculateCellValue:E=>!!E[S.Id]})))),p}),i=!1,n={elementAttr:{class:"aps-display-manager"},dataSource:{store:new DevExpress.data.CustomStore({key:"UserId",loadMode:"raw",load:()=>r,update:(g,p)=>{let h=[],S=[],E=i;return i=!0,Object.keys(p).forEach(T=>{p[T]?S.push(parseInt(T)):h.push(parseInt(T))}),window.setTimeout(()=>{i=!1},0),x(this.updateDataUrl,"put",{userId:g,displaysToRemove:h,displaysToAdd:S},!E).promise()}})},height:"100%",width:"100%",selection:{mode:"none"},allowColumnResizing:!0,grouping:{contextMenuEnabled:!0},groupPanel:{visible:!0},remoteOperations:!1,editing:{allowUpdating:!0,mode:"cell",refreshMode:"repaint"}},s={exportFileName:"DisplayManagement",summaryColumn:"UserName"},l;this.isStandalonePage?l=He(this.$container,n,s,this.pageTitle,"",!0):l=V(this.$container,{options:n,summaryColumn:s.summaryColumn,title:this.pageTitle,isFullScreen:!1})}};var Lr=new Map,Ho=class{constructor(t){this.roles=[];this.rowPermissionsChanges={};this.rowPermissionChangeHandler=(t,r,i)=>{this.saveButton.option("disabled",!1),this.saveButton.element().parents(".dx-toolbar-item").removeClass("dx-state-disabled"),this.cancelButton.option("disabled",!1),this.cancelButton.element().parents(".dx-toolbar-item").removeClass("dx-state-disabled"),this.rowPermissionsChanges[t]||(this.rowPermissionsChanges[t]={CanBeCreated:!1,CanBeDelete:!1}),r==="add"?this.rowPermissionsChanges[t].CanBeCreated=i:this.rowPermissionsChanges[t].CanBeDelete=i};this.setRowPermissionValues=t=>{for(let r of t){let i=$(`.add-permission--${r.Id}`).dxCheckBox("instance"),n=$(`.del-permission--${r.Id}`).dxCheckBox("instance");i==null||i.option("value",r.CanBeCreated),n==null||n.option("value",r.CanBeDeleted)}};this.getRowPermissionValues=()=>{let t=[];for(let r of this.roles){let i=$(`.add-permission--${r.Id}`).dxCheckBox("instance"),n=$(`.del-permission--${r.Id}`).dxCheckBox("instance");i==null||i.option("value"),n==null||n.option("value"),t.push({Id:r.Id,Name:r.Name,CanBeCreated:(i==null?void 0:i.option("value"))||!1,CanBeDeleted:(n==null?void 0:n.option("value"))||!1})}return t};this.$container=t.$container,this.isStandalonePage=t.isStandalonePage,this.availableRolesUrl=t.availableRolesUrl,this.loadDataUrl=t.loadDataUrl,this.updateDataUrl=t.updateDataUrl,this.batchUpdateDataUrl=t.batchUpdateDataUrl,this.updateRowPermissionsUrl=t.updateRowPermissionsUrl,this.getRowPermissionsUrl=t.getRowPermissionsUrl,this.pageTitle=t.pageTitle,this.isDataReadonly=!!t.isDataReadonly}render(){this.$container.addClass("aps-grid"),Promise.all([this.getFieldPermissionSettings(),this.getAvailableRoles(),this.getRowPermissionSettings()]).then(t=>{this.roles=t[1],this.createMainGrid(t[0],t[2])})}async getAvailableRoles(){let t=await x(this.availableRolesUrl);return t.sort((r,i)=>{let n=Lr.get(r.Name)||9999,s=Lr.get(i.Name)||9999;return n-s}),t}async getFieldPermissionSettings(){return(await x(this.loadDataUrl)).data}async getRowPermissionSettings(){return await x(this.getRowPermissionsUrl)}async updatePermissionSettings(t){return await x(this.updateRowPermissionsUrl,"POST",{data:t})}createMainGrid(t,r){let i,n={dataSource:t,keyExpr:"Name",height:"100%",width:"100%",editing:{mode:"batch",allowUpdating:!0,allowAdding:!1,allowDeleting:!1,refreshMode:"repaint",useIcons:!0},repaintChangesOnly:!0,remoteOperations:!1,grouping:{allowCollapsing:!1},groupPanel:{visible:!1},selection:{mode:"none"},allowColumnReordering:!1,columnHidingEnabled:!1,hoverStateEnabled:!0,columnAutoWidth:!1,rowAlternationEnabled:!0,columnMinWidth:80,columns:this.prepareMainGridColumns([{dataField:"Name",caption:"Field",fixed:!0,fixedPosition:"left",sortOrder:"asc",sortIndex:1,width:180,allowEditing:!1,cellTemplate:(l,g)=>{let p=$(`<div style="display: flex; align-items: center;">${(g==null?void 0:g.value)||""}</div>`);g.data.IsSystemColumn&&p.prepend('<i class="icon dx-icon-info" style="margin-right: 4px; color: #aaa;" title="System field"></i>'),l.append(p)}},{dataField:"IsSystemColumn",allowEditing:!1,dataType:"boolean",sortOrder:"asc",sortIndex:0,visible:!1},{dataField:"Label",allowEditing:!1,fixed:!0,fixedPosition:"left",width:180},{name:"Roles",caption:"Roles",allowEditing:!0,allowHiding:!1,columns:this.createRolesColumns(this.roles,r)},{dataField:"GroupField",visible:!1},{dataField:"Type",visible:!1},{dataField:"DataOwner",visible:!1},{dataField:"XLSScheduleLabel",visible:!1},{dataField:"DisplayType",visible:!1},{dataField:"IsDefaultViewField",visible:!1},{dataField:"IsKeyColumn",visible:!1},{dataField:"Order",visible:!1},{dataField:"Width",visible:!1},{dataField:"HidingOrder",visible:!1},{dataField:"ToolTip",visible:!1}]),onSaving:l=>{l.cancel=!0,l.component.beginCustomLoading("Saving...");let g=(h,S,E)=>{S.hasOwnProperty(h)||(S[h]=E[h])},p=l.component.getDataSource().items();l.changes.forEach(h=>{let E=p.find(T=>T.Name===h.key).Roles;Object.getOwnPropertyNames(h.data.Roles).forEach(T=>{let I=this.roles.find(v=>v.Name===T),m=E[T],u=h.data.Roles[T];I&&h.data.Roles[T]&&(u.Id=I.Id),g("CanBeCreated",u,m),g("CanBeRead",u,m),g("CanBeUpdated",u,m),g("CanBeDeleted",u,m)})}),l.promise=at(this.batchUpdateDataUrl,l.changes).then(()=>this.updatePermissionSettings(this.getRowPermissionValues())).then(()=>Promise.all([this.getFieldPermissionSettings(),this.getRowPermissionSettings()])).then(h=>{l.component.option("dataSource",h[0]),this.setRowPermissionValues(h[1]),l.component.cancelEditData()}).done(()=>l.component.endCustomLoading())},onRowUpdated:l=>{l.component.endCustomLoading(),l.component.repaint()},onInitNewRow:l=>{l.data={Roles:this.roles.reduce((g,p)=>(g[p.Name]={Id:p.Id,Name:p.Name,CanBeRead:!0,CanBeUpdated:!1},g),{})}},onToolbarPreparing:l=>{let g=l.toolbarOptions.items;this.isDataReadonly&&g.push({location:"before",text:"The source data is read only, editing is not available"})},onContentReady:()=>{var g;this.saveButton=$(".dx-datagrid-save-button").dxButton("instance"),this.cancelButton=$(".dx-datagrid-cancel-button").dxButton("instance");let l=(g=this.cancelButton)==null?void 0:g.option("onClick");l&&this.cancelButton.option("onClick",p=>{l(p),this.setRowPermissionValues(r)})}},s={summaryColumn:"Name"};return this.isStandalonePage?i=He(this.$container,n,s,this.pageTitle,"",!0):i=V(this.$container,{options:n,summaryColumn:s.summaryColumn,title:this.pageTitle,isFullScreen:!1}),i}prepareMainGridColumns(t){return t.forEach(r=>{(r.allowHiding===void 0||r.allowHiding===null)&&(r.allowHiding=!1),(r.showInColumnChooser===void 0||r.showInColumnChooser===null)&&(r.showInColumnChooser=!1)}),t}createRolesColumns(t,r){return t.map(i=>({name:i.Name,caption:i.Name,allowHiding:!0,visible:!0,showInColumnChooser:!0,columns:[this.createRolesPermissionColumn(i.Name,"CanBeRead",{headerCellTemplate:de("Read","Read")}),this.createRolesPermissionColumn(i.Name,"CanBeUpdated",{headerCellTemplate:de("Edit",this.isDataReadonly?"The source data is read only, editing is not available":"Edit")},!0)],headerCellTemplate:(n,s)=>{let l=r.find(p=>p.Id===i.Id),g=$(`
|
|
70
70
|
<div class="permissions-column-header">
|
|
71
71
|
<div class="permissions-column-header__role">${s.column.caption}</div>
|
|
72
72
|
<div class="permissions-column-header__group">
|
|
@@ -83,10 +83,10 @@ to disable the global search function and allow filtering by column only.`).dxPo
|
|
|
83
83
|
|
|
84
84
|
</div>
|
|
85
85
|
</div>
|
|
86
|
-
`);$(".add-permission",g).dxCheckBox({value:(l==null?void 0:l.CanBeCreated)||!1,onValueChanged:p=>this.rowPermissionChangeHandler(s.column.name,"add",p.value)}),$(".del-permission",g).dxCheckBox({value:(l==null?void 0:l.CanBeDeleted)||!1,onValueChanged:p=>this.rowPermissionChangeHandler(s.column.name,"delete",p.value)}),n.css("width","100%").append(g),n.parent().css("padding","0px")}}))}createRolesPermissionColumn(t,r,i,n=!1){let s=`Roles.${t}.${r}`;return O(A({},i),{name:`${t}_${r}`,dataField:s,allowHiding:!1,showInColumnChooser:!1,allowHeaderFiltering:!1,allowFiltering:!1,minWidth:100,allowEditing:!1,cellTemplate:(l,g)=>$('<div class="roles-permission-checkbox" />').dxCheckBox({value:g.value,disabled:n&&(this.isDataReadonly||g.data.IsSystemColumn),onValueChanged:p=>g.component.cellValue(g.rowIndex,s,p.value)})})}createMainGridDataSource(){return{store:Tt({loadUrl:this.loadDataUrl,updateUrl:this.updateDataUrl,key:"Name"})}}};var Ae=class{constructor(t){this.SWITCH_TO_DESIGNER_TEXT="Switch to Settings";this.SWITCH_TO_VIEWER_TEXT="Switch to Display";this.STORAGE_MODE_KEY="CDM_STORAGE_MODE_KEY";let r=`/${t.cdmReportControllerUrl}/${t.reportParams.ReportId}`;this.$rootElement=t.$container,this.reportParams=t.reportParams,this.allowEditing=t.allowEditing,this.mode=window.sessionStorage.getItem(this.getSessionKey())||"Viewer",this.controlConfiguratorOptions=this.getControlConfiguratorOptions(r,t.cdmReportControllerUrl,!!t.isDataReadonly,t.reportParams.DisableGlobalSearch,t.reportParams.EnableInlineEditing),this.displayManagerOptions=this.getDisplayManagerOptions(r),this.controlDisplayOptions=this.getControlDisplayOptions(r,t.userName,t.reportParams,t.isDataReadonly,t.reportParams.EnableInlineEditing,t.asyncSummaryLoad)}init(){this.reportParams.Details&&(this.popover=ee(".report-details-link",this.reportParams.Details)),this.allowEditing&&this.initSwitchModeButton(),this.renderContent()}dispose(){var t,r,i;(t=this.multiView)==null||t.dispose(),(r=this.tabPanel)==null||r.dispose(),(i=this.popover)==null||i.dispose()}refresh(){}renderContent(){this.mode==="Viewer"?this.renderDisplay():this.renderTabPanel()}getControlConfiguratorOptions(t,r,i=!1,n=!1,s=!1){return{$container:null,isStandalonePage:!1,pageTitle:"",availableRolesUrl:`/${r}/AvailableRoles`,groupFieldsUrl:`${t}/AllControlFields`,loadDataUrl:`${t}/ConfiguratorData`,batchUpdateDataUrl:`${t}/ConfiguratorData/BatchUpdate`,updateRowPermissionsUrl:`${t}/ConfiguratorData/UpdateRowPermissions`,getRowPermissionsUrl:`${t}/ConfiguratorData/GetRowPermissions`,updateDataUrl:`${t}/ConfiguratorData`,addDataUrl:`${t}/ConfiguratorData`,deleteDataUrl:`${t}/ConfiguratorData`,updateGlobalSearchUrl:`${t}/UpdateGlobalSearch`,updateInlineEditingUrl:`${t}/UpdateInlineEditing`,getReportSourceDetailsUrl:`${t}/GetReportSourceDetails`,getContextTablesUrl:`${t}/GetTablesList`,getTableFieldsUrl:`${t}/GetTableFieldList`,isDataReadonly:i,disableGlobalSearch:n,enableInlineEditing:s}}getDisplayManagerOptions(t){return{$container:null,isStandalonePage:!1,pageTitle:"",loadDataUrl:`${t}/ControlDisplayUserAssignments`,updateDataUrl:`${t}/UpdateControlDisplayUserAssignments`}}getControlDisplayOptions(t,r,i,n,s,l){return{$container:null,isStandalonePage:!1,pageTitle:"",exportFileName:i.Name,allowDataEditing:!n,enableInlineEditing:s,userConfigUrl:`${t}/FieldsPermissions`,controlLogsUrl:`${t}/GetControlLogs`,loadDataUrl:`${t}/ControlDisplayData`,updateDataUrl:`${t}/UpdateControlDisplayData`,batchUpdateDataUrl:`${t}/BatchUpdateControlDisplayData`,addDataUrl:`${t}/AddControlDisplayData`,deleteDataUrl:`${t}/DeleteControlDisplayData`,uploadDocumentUrl:`${t}/UploadControlDisplayDocument`,downloadDocumentUrl:`${t}/DownloadControlDisplayDocument`,getReferencedDataUrl:`${t}/ReferencedTableData`,userName:r,disableGlobalSearch:!!i.DisableGlobalSearch,importFileOptions:i.AllowImporting?{mode:i.ImportFileMode,createTableUrl:`${t}/create-table`,addRowsUrl:`${t}/add-rows`,fileUploadUrl:`${t}/get-columns`,predefinedTable:i.FileImporterTableInfo}:void 0,gridFiltersManagerOptions:{loadDataUrl:`${t}/GetControlFilters`,insertDataUrl:`${t}/AddControlFilter`,updateDataUrl:`${t}/UpdateControlFilter`,deleteDataUrl:`${t}/RemoveControlFilter`},gridViewsManagerOptions:{loadDataUrl:`${t}/GetControlViews`,insertDataUrl:`${t}/AddControlView`,updateDataUrl:`${t}/UpdateControlView`,deleteDataUrl:`${t}/RemoveControlView`},gridDisplaysManagerOptions:{loadDataUrl:`${t}/GetControlDisplays`,insertDataUrl:`${t}/AddControlDisplay`,updateDataUrl:`${t}/UpdateControlDisplay`,deleteDataUrl:`${t}/RemoveControlDisplay`},remoteControlDisplayUserSettingsManagerLoadOptions:{loadDataUrl:`${t}/GetControlDisplayUserSettings`,updateDataUrl:`${t}/UpdateControlDisplayUserSettings`},asyncSummaryLoad:l}}initSwitchModeButton(){let t=$(".switch-mode-btn").dxButton({text:this.mode==="Viewer"?this.SWITCH_TO_DESIGNER_TEXT:this.SWITCH_TO_VIEWER_TEXT,onClick:()=>{this.mode=this.mode==="Viewer"?"Designer":"Viewer",window.sessionStorage.setItem(this.getSessionKey(),this.mode),t.option("text",this.mode==="Viewer"?this.SWITCH_TO_DESIGNER_TEXT:this.SWITCH_TO_VIEWER_TEXT),this.renderContent()}}).addClass("iszolea-md").dxButton("instance")}renderDisplay(){this.$rootElement.html("");let t=$("<div />").appendTo(this.$rootElement);this.multiView=t.dxMultiView({items:[{template:()=>{let r=new ut(O(A({},this.controlDisplayOptions),{$container:$("<div />"),$savingIndicator:$(".report-header .saving-indicator")}));return r.render(),r.$container}}]}).addClass("cdm-report__disply-grid").dxMultiView("instance"),le(this.multiView,!1)}renderTabPanel(){this.$rootElement.html("");let t=$("<div />").appendTo(this.$rootElement);this.tabPanel=this.createTabPanel(t),le(this.tabPanel,!1)}createTabPanel(t){return t.dxTabPanel({swipeEnabled:!1,showNavButtons:!0,focusStateEnabled:!1,activeStateEnabled:!1,hoverStateEnabled:!1,onSelectionChanged:r=>{setTimeout(()=>{r.component.repaint()})},items:[{title:"Configurator",template:()=>{let r=new lt(O(A({},this.controlConfiguratorOptions),{$container:$("<div />")}),i=>{this.controlDisplayOptions.disableGlobalSearch=this.controlConfiguratorOptions.disableGlobalSearch=!i},i=>{this.controlDisplayOptions.enableInlineEditing=this.controlConfiguratorOptions.enableInlineEditing=!!i});return r.render(),r.$container}},{title:"Permissions",template:()=>{let r=new Go(O(A({},this.controlConfiguratorOptions),{$container:$("<div />")}));return r.render(),r.$container}},{title:"Display Manager",template:()=>{let r=new ct(O(A({},this.displayManagerOptions),{$container:$("<div />")}));return r.render(),r.$container}}]}).addClass("cdm-report__configuration-tab-panel").dxTabPanel("instance")}getSessionKey(){return this.STORAGE_MODE_KEY+this.reportParams.ReportId}};var Ho=class{get popup(){return this._popup||(this._popup=this.createPopup()),this._popup}constructor(t){this.sessionExpireTimeMs=t.sessionExpireTimeMs,this.displayDurationMs=t.displayDurationMs,this.sessionPingUrl=t.sessionPingUrl,this.logoutUrl=t.logoutUrl,this.pingSessionIfTabIsActive=this.pingSessionIfTabIsActive.bind(this)}reset(){var t;this.clearTimeoutsAndIntervals(),(t=this.popup)==null||t.hide(),this.expirationTime=this.getExpirationTime(),this.watingTimeoutId=window.setTimeout(()=>{this.showNotification()},Math.max(this.sessionExpireTimeMs-this.displayDurationMs,0)),this.pingIntervalId=window.setInterval(()=>{this.pingSessionIfTabIsActive()},60*1e3),$(document).on("visibilitychange",this.pingSessionIfTabIsActive)}dispose(){this.clearTimeoutsAndIntervals()}showNotification(){var t;(t=this.popup)==null||t.show(),this.clearTimeoutsAndIntervals(),this.updatePopupContent(),this.counterIntervalId=window.setInterval(()=>{this.updatePopupContent()},1e3)}clearTimeoutsAndIntervals(){this.watingTimeoutId&&clearTimeout(this.watingTimeoutId),this.counterIntervalId&&clearInterval(this.counterIntervalId),this.pingIntervalId&&clearInterval(this.pingIntervalId),$(document).off("visibilitychange",this.pingSessionIfTabIsActive)}getExpirationTime(){let t=new Date;return t.setMilliseconds(t.getMilliseconds()+this.sessionExpireTimeMs),t}createPopup(){return $("<div />").dxPopup({title:"Session Expiring",hideOnOutsideClick:!1,resizeEnabled:!1,showCloseButton:!1,dragEnabled:!1,maxHeight:190,maxWidth:370,visible:!1,contentTemplate:()=>(this.$textContainer=$("<span />"),this.$textContainer.append(this.getCounterText()),$("<div />").append(this.$textContainer)),toolbarItems:[{widget:"dxButton",toolbar:"bottom",location:"before",options:{type:"default",text:"Continue session",onInitialized:t=>this.continuerButton=t.component,onClick:()=>{this.refreshSession()}}},{widget:"dxButton",toolbar:"bottom",location:"before",options:{type:"default",text:"Reload page",onInitialized:t=>this.okButton=t.component,onClick:()=>{window.location.reload()}}},{widget:"dxButton",toolbar:"bottom",location:"after",options:{text:"Log Out",onInitialized:t=>this.logoutButton=t.component,onClick:()=>{this.logOut()}}}]}).appendTo($(document.body)).dxPopup("instance")}getCounterText(){let t=Math.max(this.getSecondsToExpiration(),0);if(t===0)return $("<span />").text("Your session has been expired");{let r=$("<span />").text("Your session will expire in "),i=$("<span />").addClass("session-notifier__counter").text(t.toFixed(0)),n=$("<span />").text(" seconds");return $("<span />").append(r,i,n)}}getSecondsToExpiration(){return(this.expirationTime.getTime()-new Date().getTime())/1e3}refreshSession(){this.reset(),x(this.sessionPingUrl,"GET",null,!1,{notifyError:!1}).then(t=>{t.isAuthenticated||window.location.reload()}).catch(()=>window.location.reload())}pingSessionIfTabIsActive(){document.hidden||x(this.sessionPingUrl,"GET",null,!1,{notifyError:!1}).then(t=>{t.isAuthenticated||this.setExpired()})}setExpired(){this.expirationTime=new Date,this.showNotification(),this.pingIntervalId&&clearInterval(this.pingIntervalId)}logOut(){window.location.href=this.logoutUrl}updatePopupContent(){var r;let t=this.getSecondsToExpiration()<=0;(r=this.$textContainer)==null||r.html("").append(this.getCounterText()),this.okButton.option("visible",t),this.continuerButton.option("visible",!t),this.logoutButton.option("visible",!t)}};var on={edit:"edit",saving:"saving",saved:"saved"},re=on;var Wt=class extends z{constructor(t,r){super();this.OUTDATE_COLUMNS_FOUND_EVENT="outdated-columns-found-event";this.stateLoaded=!1;this.loadedColumns={};this.additionalColumnsSettings={};this.id=t,this.gridDataLayer=r}load(t,r){return this.gridDataLayer.getGridViewSettings(this.id).then(i=>(this.onDataLoaded(i),t&&this.checkColumnsRelevance(i.columns,r),i))}save(t,r,i){let n={};if(!t.columns)return;t.columns.forEach(l=>{let g=this.additionalColumnsSettings[l.dataField];g&&(l.caption=g.caption,l.tooltip=g.tooltip),l.dataType||(l.dataType="default"),!!l.width&&l.visible&&(n[l.visibleIndex]=l.width)});let s=JSON.stringify(t.columns);return!this.stateLoaded||s===this.lastColumnSettingsStr?null:(this.lastColumnSettingsStr=s,r&&r(),this.gridDataLayer.updateGridViewSettings(this.id,t).then(()=>{i&&i()}),n)}checkNewColumns(t){let r=[];if(t.columns){let i=t.columns.filter(n=>!this.loadedColumns[n.dataField]&&n.visible);i.length&&i.forEach(n=>{r.push(n.dataField),this.loadedColumns[n.dataField]=!0})}return r}getColumnCaptions(){return Object.keys(this.additionalColumnsSettings).map(t=>({dataField:t,caption:this.additionalColumnsSettings[t].caption}))}setColumnCaption(t,r){this.additionalColumnsSettings[t]||(this.additionalColumnsSettings[t]={caption:"",tooltip:""}),this.additionalColumnsSettings[t].caption=r}getColumnAdditionalSettings(t){return this.additionalColumnsSettings[t]}checkColumnsRelevance(t,r){this.gridDataLayer.getColumnsByReportId(this.id).then(i=>{let n={};i.forEach(l=>n[l.Name]=!0);let s=t.filter(l=>!n[l.dataField]).map(l=>l.dataField);s.length&&DevExpress.ui.dialog.confirm(`Grid settings contain some colunms which don't exist in the database table anymore:
|
|
86
|
+
`);$(".add-permission",g).dxCheckBox({value:(l==null?void 0:l.CanBeCreated)||!1,onValueChanged:p=>this.rowPermissionChangeHandler(s.column.name,"add",p.value)}),$(".del-permission",g).dxCheckBox({value:(l==null?void 0:l.CanBeDeleted)||!1,onValueChanged:p=>this.rowPermissionChangeHandler(s.column.name,"delete",p.value)}),n.css("width","100%").append(g),n.parent().css("padding","0px")}}))}createRolesPermissionColumn(t,r,i,n=!1){let s=`Roles.${t}.${r}`;return O(A({},i),{name:`${t}_${r}`,dataField:s,allowHiding:!1,showInColumnChooser:!1,allowHeaderFiltering:!1,allowFiltering:!1,minWidth:100,allowEditing:!1,cellTemplate:(l,g)=>$('<div class="roles-permission-checkbox" />').dxCheckBox({value:g.value,disabled:n&&(this.isDataReadonly||g.data.IsSystemColumn),onValueChanged:p=>g.component.cellValue(g.rowIndex,s,p.value)})})}createMainGridDataSource(){return{store:It({loadUrl:this.loadDataUrl,updateUrl:this.updateDataUrl,key:"Name"})}}};var Ae=class{constructor(t){this.SWITCH_TO_DESIGNER_TEXT="Switch to Settings";this.SWITCH_TO_VIEWER_TEXT="Switch to Display";this.STORAGE_MODE_KEY="CDM_STORAGE_MODE_KEY";let r=`/${t.cdmReportControllerUrl}/${t.reportParams.ReportId}`;this.$rootElement=t.$container,this.reportParams=t.reportParams,this.allowEditing=t.allowEditing,this.mode=window.sessionStorage.getItem(this.getSessionKey())||"Viewer",this.controlConfiguratorOptions=this.getControlConfiguratorOptions(r,t.cdmReportControllerUrl,!!t.isDataReadonly,t.reportParams.DisableGlobalSearch,t.reportParams.EnableInlineEditing),this.displayManagerOptions=this.getDisplayManagerOptions(r),this.controlDisplayOptions=this.getControlDisplayOptions(r,t.userName,t.reportParams,t.isDataReadonly,t.reportParams.EnableInlineEditing,t.asyncSummaryLoad)}init(){this.reportParams.Details&&(this.popover=ee(".report-details-link",this.reportParams.Details)),this.allowEditing&&this.initSwitchModeButton(),this.renderContent()}dispose(){var t,r,i;(t=this.multiView)==null||t.dispose(),(r=this.tabPanel)==null||r.dispose(),(i=this.popover)==null||i.dispose()}refresh(){}renderContent(){this.mode==="Viewer"?this.renderDisplay():this.renderTabPanel()}getControlConfiguratorOptions(t,r,i=!1,n=!1,s=!1){return{$container:null,isStandalonePage:!1,pageTitle:"",availableRolesUrl:`/${r}/AvailableRoles`,groupFieldsUrl:`${t}/AllControlFields`,loadDataUrl:`${t}/ConfiguratorData`,batchUpdateDataUrl:`${t}/ConfiguratorData/BatchUpdate`,updateRowPermissionsUrl:`${t}/ConfiguratorData/UpdateRowPermissions`,getRowPermissionsUrl:`${t}/ConfiguratorData/GetRowPermissions`,updateDataUrl:`${t}/ConfiguratorData`,addDataUrl:`${t}/ConfiguratorData`,deleteDataUrl:`${t}/ConfiguratorData`,updateGlobalSearchUrl:`${t}/UpdateGlobalSearch`,updateInlineEditingUrl:`${t}/UpdateInlineEditing`,getReportSourceDetailsUrl:`${t}/GetReportSourceDetails`,getContextTablesUrl:`${t}/GetTablesList`,getTableFieldsUrl:`${t}/GetTableFieldList`,isDataReadonly:i,disableGlobalSearch:n,enableInlineEditing:s}}getDisplayManagerOptions(t){return{$container:null,isStandalonePage:!1,pageTitle:"",loadDataUrl:`${t}/ControlDisplayUserAssignments`,updateDataUrl:`${t}/UpdateControlDisplayUserAssignments`}}getControlDisplayOptions(t,r,i,n,s,l){return{$container:null,isStandalonePage:!1,pageTitle:"",exportFileName:i.Name,allowDataEditing:!n,enableInlineEditing:s,userConfigUrl:`${t}/FieldsPermissions`,controlLogsUrl:`${t}/GetControlLogs`,loadDataUrl:`${t}/ControlDisplayData`,updateDataUrl:`${t}/UpdateControlDisplayData`,batchUpdateDataUrl:`${t}/BatchUpdateControlDisplayData`,addDataUrl:`${t}/AddControlDisplayData`,deleteDataUrl:`${t}/DeleteControlDisplayData`,uploadDocumentUrl:`${t}/UploadControlDisplayDocument`,downloadDocumentUrl:`${t}/DownloadControlDisplayDocument`,getReferencedDataUrl:`${t}/ReferencedTableData`,userName:r,disableGlobalSearch:!!i.DisableGlobalSearch,importFileOptions:i.AllowImporting?{mode:i.ImportFileMode,createTableUrl:`${t}/create-table`,addRowsUrl:`${t}/add-rows`,fileUploadUrl:`${t}/get-columns`,predefinedTable:i.FileImporterTableInfo}:void 0,gridFiltersManagerOptions:{loadDataUrl:`${t}/GetControlFilters`,insertDataUrl:`${t}/AddControlFilter`,updateDataUrl:`${t}/UpdateControlFilter`,deleteDataUrl:`${t}/RemoveControlFilter`},gridViewsManagerOptions:{loadDataUrl:`${t}/GetControlViews`,insertDataUrl:`${t}/AddControlView`,updateDataUrl:`${t}/UpdateControlView`,deleteDataUrl:`${t}/RemoveControlView`},gridDisplaysManagerOptions:{loadDataUrl:`${t}/GetControlDisplays`,insertDataUrl:`${t}/AddControlDisplay`,updateDataUrl:`${t}/UpdateControlDisplay`,deleteDataUrl:`${t}/RemoveControlDisplay`},remoteControlDisplayUserSettingsManagerLoadOptions:{loadDataUrl:`${t}/GetControlDisplayUserSettings`,updateDataUrl:`${t}/UpdateControlDisplayUserSettings`},asyncSummaryLoad:l}}initSwitchModeButton(){let t=$(".switch-mode-btn").dxButton({text:this.mode==="Viewer"?this.SWITCH_TO_DESIGNER_TEXT:this.SWITCH_TO_VIEWER_TEXT,onClick:()=>{this.mode=this.mode==="Viewer"?"Designer":"Viewer",window.sessionStorage.setItem(this.getSessionKey(),this.mode),t.option("text",this.mode==="Viewer"?this.SWITCH_TO_DESIGNER_TEXT:this.SWITCH_TO_VIEWER_TEXT),this.renderContent()}}).addClass("iszolea-md").dxButton("instance")}renderDisplay(){this.$rootElement.html("");let t=$("<div />").appendTo(this.$rootElement);this.multiView=t.dxMultiView({items:[{template:()=>{let r=new ut(O(A({},this.controlDisplayOptions),{$container:$("<div />"),$savingIndicator:$(".report-header .saving-indicator")}));return r.render(),r.$container}}]}).addClass("cdm-report__disply-grid").dxMultiView("instance"),le(this.multiView,!1)}renderTabPanel(){this.$rootElement.html("");let t=$("<div />").appendTo(this.$rootElement);this.tabPanel=this.createTabPanel(t),le(this.tabPanel,!1)}createTabPanel(t){return t.dxTabPanel({swipeEnabled:!1,showNavButtons:!0,focusStateEnabled:!1,activeStateEnabled:!1,hoverStateEnabled:!1,onSelectionChanged:r=>{setTimeout(()=>{r.component.repaint()})},items:[{title:"Configurator",template:()=>{let r=new lt(O(A({},this.controlConfiguratorOptions),{$container:$("<div />")}),i=>{this.controlDisplayOptions.disableGlobalSearch=this.controlConfiguratorOptions.disableGlobalSearch=!i},i=>{this.controlDisplayOptions.enableInlineEditing=this.controlConfiguratorOptions.enableInlineEditing=!!i});return r.render(),r.$container}},{title:"Permissions",template:()=>{let r=new Ho(O(A({},this.controlConfiguratorOptions),{$container:$("<div />")}));return r.render(),r.$container}},{title:"Display Manager",template:()=>{let r=new ct(O(A({},this.displayManagerOptions),{$container:$("<div />")}));return r.render(),r.$container}}]}).addClass("cdm-report__configuration-tab-panel").dxTabPanel("instance")}getSessionKey(){return this.STORAGE_MODE_KEY+this.reportParams.ReportId}};var zo=class{get popup(){return this._popup||(this._popup=this.createPopup()),this._popup}constructor(t){this.sessionExpireTimeMs=t.sessionExpireTimeMs,this.displayDurationMs=t.displayDurationMs,this.sessionPingUrl=t.sessionPingUrl,this.logoutUrl=t.logoutUrl,this.pingSessionIfTabIsActive=this.pingSessionIfTabIsActive.bind(this)}reset(){var t;this.clearTimeoutsAndIntervals(),(t=this.popup)==null||t.hide(),this.expirationTime=this.getExpirationTime(),this.watingTimeoutId=window.setTimeout(()=>{this.showNotification()},Math.max(this.sessionExpireTimeMs-this.displayDurationMs,0)),this.pingIntervalId=window.setInterval(()=>{this.pingSessionIfTabIsActive()},60*1e3),$(document).on("visibilitychange",this.pingSessionIfTabIsActive)}dispose(){this.clearTimeoutsAndIntervals()}showNotification(){var t;(t=this.popup)==null||t.show(),this.clearTimeoutsAndIntervals(),this.updatePopupContent(),this.counterIntervalId=window.setInterval(()=>{this.updatePopupContent()},1e3)}clearTimeoutsAndIntervals(){this.watingTimeoutId&&clearTimeout(this.watingTimeoutId),this.counterIntervalId&&clearInterval(this.counterIntervalId),this.pingIntervalId&&clearInterval(this.pingIntervalId),$(document).off("visibilitychange",this.pingSessionIfTabIsActive)}getExpirationTime(){let t=new Date;return t.setMilliseconds(t.getMilliseconds()+this.sessionExpireTimeMs),t}createPopup(){return $("<div />").dxPopup({title:"Session Expiring",hideOnOutsideClick:!1,resizeEnabled:!1,showCloseButton:!1,dragEnabled:!1,maxHeight:190,maxWidth:370,visible:!1,contentTemplate:()=>(this.$textContainer=$("<span />"),this.$textContainer.append(this.getCounterText()),$("<div />").append(this.$textContainer)),toolbarItems:[{widget:"dxButton",toolbar:"bottom",location:"before",options:{type:"default",text:"Continue session",onInitialized:t=>this.continuerButton=t.component,onClick:()=>{this.refreshSession()}}},{widget:"dxButton",toolbar:"bottom",location:"before",options:{type:"default",text:"Reload page",onInitialized:t=>this.okButton=t.component,onClick:()=>{window.location.reload()}}},{widget:"dxButton",toolbar:"bottom",location:"after",options:{text:"Log Out",onInitialized:t=>this.logoutButton=t.component,onClick:()=>{this.logOut()}}}]}).appendTo($(document.body)).dxPopup("instance")}getCounterText(){let t=Math.max(this.getSecondsToExpiration(),0);if(t===0)return $("<span />").text("Your session has been expired");{let r=$("<span />").text("Your session will expire in "),i=$("<span />").addClass("session-notifier__counter").text(t.toFixed(0)),n=$("<span />").text(" seconds");return $("<span />").append(r,i,n)}}getSecondsToExpiration(){return(this.expirationTime.getTime()-new Date().getTime())/1e3}refreshSession(){this.reset(),x(this.sessionPingUrl,"GET",null,!1,{notifyError:!1}).then(t=>{t.isAuthenticated||window.location.reload()}).catch(()=>window.location.reload())}pingSessionIfTabIsActive(){document.hidden||x(this.sessionPingUrl,"GET",null,!1,{notifyError:!1}).then(t=>{t.isAuthenticated||this.setExpired()})}setExpired(){this.expirationTime=new Date,this.showNotification(),this.pingIntervalId&&clearInterval(this.pingIntervalId)}logOut(){window.location.href=this.logoutUrl}updatePopupContent(){var r;let t=this.getSecondsToExpiration()<=0;(r=this.$textContainer)==null||r.html("").append(this.getCounterText()),this.okButton.option("visible",t),this.continuerButton.option("visible",!t),this.logoutButton.option("visible",!t)}};var rn={edit:"edit",saving:"saving",saved:"saved"},re=rn;var zt=class extends z{constructor(t,r){super();this.OUTDATE_COLUMNS_FOUND_EVENT="outdated-columns-found-event";this.stateLoaded=!1;this.loadedColumns={};this.additionalColumnsSettings={};this.id=t,this.gridDataLayer=r}load(t,r){return this.gridDataLayer.getGridViewSettings(this.id).then(i=>(this.onDataLoaded(i),t&&this.checkColumnsRelevance(i.columns,r),i))}save(t,r,i){let n={};if(!t.columns)return;t.columns.forEach(l=>{let g=this.additionalColumnsSettings[l.dataField];g&&(l.caption=g.caption,l.tooltip=g.tooltip),l.dataType||(l.dataType="default"),!!l.width&&l.visible&&(n[l.visibleIndex]=l.width)});let s=JSON.stringify(t.columns);return!this.stateLoaded||s===this.lastColumnSettingsStr?null:(this.lastColumnSettingsStr=s,r&&r(),this.gridDataLayer.updateGridViewSettings(this.id,t).then(()=>{i&&i()}),n)}checkNewColumns(t){let r=[];if(t.columns){let i=t.columns.filter(n=>!this.loadedColumns[n.dataField]&&n.visible);i.length&&i.forEach(n=>{r.push(n.dataField),this.loadedColumns[n.dataField]=!0})}return r}getColumnCaptions(){return Object.keys(this.additionalColumnsSettings).map(t=>({dataField:t,caption:this.additionalColumnsSettings[t].caption}))}setColumnCaption(t,r){this.additionalColumnsSettings[t]||(this.additionalColumnsSettings[t]={caption:"",tooltip:""}),this.additionalColumnsSettings[t].caption=r}getColumnAdditionalSettings(t){return this.additionalColumnsSettings[t]}checkColumnsRelevance(t,r){this.gridDataLayer.getColumnsByReportId(this.id).then(i=>{let n={};i.forEach(l=>n[l.Name]=!0);let s=t.filter(l=>!n[l.dataField]).map(l=>l.dataField);s.length&&DevExpress.ui.dialog.confirm(`Grid settings contain some colunms which don't exist in the database table anymore:
|
|
87
87
|
|
|
88
88
|
'${s.join(", ")}'.
|
|
89
89
|
|
|
90
90
|
Do you want to remove these columns from grid settings?
|
|
91
|
-
`,"Remove redundant columns?").then(l=>{!l||r(s)})})}resetSettings(){return this.gridDataLayer.resetSettings(this.id).then(t=>(this.onDataLoaded(t),t))}onDataLoaded(t){let r=t&&t.columns,i=0;this.stateLoaded=!0,r&&(this.loadedColumns={},r.forEach(n=>{this.loadedColumns[n.dataField]=!0,n.visible&&n.visibleIndex===null&&(n.visibleIndex=i++),Object.keys(n).forEach(l=>{(n[l]===null||n[l]===void 0||n[l]==="")&&delete n[l]});let s=this.additionalColumnsSettings[n.dataField];s?(s.caption=n.caption,s.tooltip=n.tooltip):this.additionalColumnsSettings[n.dataField]={caption:n.caption,tooltip:n.tooltip},delete n.caption,delete n.tooltip})),this.lastColumnSettingsStr=JSON.stringify(t.columns)}};var
|
|
92
|
-
By default grid shows only first 10 rows in the Edit mode.`).dxPopover({target:T,showEvent:"mouseenter",hideEvent:"mouseleave",position:"top",width:500}).appendTo(S),S}},p={widget:"dxButton",location:"after",options:{text:"Switch to View Mode",onClick:()=>this.switchToMode(j.View),icon:"switch-to-view-mode",elementAttr:{class:"iszolea-md"}}};n.splice(l,1);let h=n.filter(S=>S.name==="exportButton")[0],E=n.indexOf(h);n.splice(E,1),n.push(g),n.push(p),n.push(s);let m={location:"before",template:()=>(this.$gridStateIndicator=$("<div />").addClass("edit-grid-state"),this.updateGridStateIndicator(re.edit),this.$gridStateIndicator)};n.unshift(m)}if(this.addRefreshButton){let s=n.filter(g=>g.name==="refresh")[0],l=n.indexOf(s);n[l]={location:"after",template:()=>{let g=$("<div />");return this.refreshButton=new ge(g,()=>this.refresh()),g}}}},onCellPrepared:({rowType:i,column:n,cellElement:s})=>{if(i==="header"&&!n.command){let l=n.dataField,g=this.gridStateManager.getColumnAdditionalSettings(l);this.initGridHeaderCell(s,g),this.currentGridMode===j.Edit&&this.initGridHeaderCellEditPanel(n,s,g)}},onContentReady:i=>{let n=i.component,s=n.state();if(!this.columnNamesUpdated)this.updateColumnNaming(s);else return;if(window.setTimeout(()=>n.endCustomLoading()),this.currentGridMode!==j.Edit)return;this.gridStateManager.checkNewColumns(s).forEach(p=>i.component.columnOption(p,"visible",!1)),this.gridStateManager.getColumnCaptions().forEach(p=>{p.caption&&n.columnOption(p.dataField,"caption")!==p.caption&&n.columnOption(p.dataField,"caption",p.caption)})},stateStoring:{enabled:!0,type:"custom",customLoad:()=>this.gridStateManager.load(this.currentGridMode===j.Edit,i=>{let n=this.grid.state();n.columns=n.columns.filter(s=>i.indexOf(s.dataField)<0),this.grid.state(n)}),customSave:i=>this.saveGridState(i)},filterRow:{visible:this.currentGridMode===j.View,applyFilter:"onClick"},headerFilter:{visible:this.currentGridMode===j.View},searchPanel:{visible:this.currentGridMode===j.View},errorRowEnabled:!1,allowColumnResizing:!0,sorting:{mode:"multiple"},groupPanel:{visible:!0},grouping:{autoExpandAll:!1},allowColumnReordering:this.currentGridMode===j.Edit,columnChooser:{enabled:this.currentGridMode===j.Edit},showColumnHeaders:!0,keyboardNavigation:{enabled:!1},showBorders:!0,paging:{pageSize:50,enabled:!0},remoteOperations:!0,summary:this.reportParams.TotalSummaryColumn?{totalItems:[{column:this.reportParams.TotalSummaryColumn,summaryType:"count"}]}:void 0,onEditorPreparing(i){if(i.parentType==="filterRow"){let n=()=>i.element.find(".dx-apply-button").trigger("dxclick");i.editorOptions.onEnterKey=n,i.editorOptions.onFocusOut=n}if(i.parentType==="searchPanel"){let n=s=>{i.component.searchByText(s.component.option("value"))};i.editorOptions.onValueChanged=void 0,i.editorOptions.onEnterKey=n,i.editorOptions.onFocusOut=n}}};return this.grid=V(this.$gridTargetElement,{options:t,exportFileName:this.reportParams.Name,title:this.showHeader?this.reportParams.Name:null,headerDescription:this.showHeader?this.reportParams.Details:null,asyncSummaryLoad:this.asyncSummaryLoad}),(r=this.$resetSettingTargetElement)==null||r.remove(),this.currentGridMode===j.Edit&&(this.$resetSettingTargetElement=$("<span />").css({float:"right",position:"relative",bottom:"8px"}).addClass("iszolea-md").dxButton({text:"Reset settings",onClick:()=>this.resetSettings(),icon:"reset-grid-settings"}).appendTo("footer")),this.grid}updateGridStateIndicator(t){Object.keys(re).forEach(i=>this.$gridStateIndicator.removeClass(re[i])),this.$gridStateIndicator.addClass(t),this.gridStateIndicatorTimeout&&window.clearTimeout(this.gridStateIndicatorTimeout),t===re.saved&&(this.gridStateIndicatorTimeout=window.setTimeout(()=>{this.updateGridStateIndicator(re.edit)},sn));let r="";switch(t){case re.edit:r="Edit mode";break;case re.saved:r="Saved";break;case re.saving:r="Saving";break}this.$gridStateIndicator.attr("title",r)}updateColumnNaming(t){t.columns&&t.columns.forEach(r=>{/[^a-zA-Z0-9_]/.test(r.dataField)&&this.grid.columnOption(r.dataField,"calculateCellValue",i=>i[r.dataField])}),this.columnNamesUpdated=!0}createDataSource(t,r,i){let n=this.dataLayer.getGridDataSource(t,r,i),s=new DevExpress.data.DataSource({store:n,onChanged:r===j.View?void 0:()=>{this.columnNamesUpdated=!1},onLoadError:l=>{s.isLoaded()||this.$gridErrorPlaceholder.show(),this.grid.endCustomLoading()},onLoadingChanged:l=>{l?(this.$gridErrorPlaceholder.hide(),this.loadingTimeout=setTimeout(()=>{this.grid.beginCustomLoading("Please wait, data loading in progress.")},1e4)):(this.loadingTimeout&&(clearTimeout(this.loadingTimeout),this.loadingTimeout=null),this.grid.endCustomLoading())}});return s}resetSettings(){DevExpress.ui.dialog.confirm("Reset grid settings to default values?","Reset to default?").then(t=>{t&&(this.grid.beginCustomLoading("Loading"),this.gridStateManager.resetSettings().then(r=>{this.grid.state(r),this.grid.option("dataSource",this.createDataSource(this.reportParams,this.currentGridMode,this.showAllDataInEdit)),this.grid.refresh()}))})}switchToMode(t){if(this.currentGridMode===t||t===j.Edit&&!this.allowEditing)return;this.currentGridMode=t;let r=this.grid.option("summary.totalItems[0].column"),i=O(A({},this.reportParams),{TotalSummaryColumn:r||this.reportParams.TotalSummaryColumn});this.reportParams=i,this.grid.dispose(),this.$gridTargetElement.remove(),this.grid=this.initInternal()}saveGridState(t){if(this.currentGridMode!==j.Edit)return;this.columnNamesUpdated=!1;let r=this.gridStateManager.save(t,()=>this.updateGridStateIndicator(re.saving),()=>this.updateGridStateIndicator(re.saved));r&&Object.keys(r).forEach(i=>{let n=this.editWidthEditBoxes[i],s=r[i]==="inherit"?"":r[i];n&&n.option("value")!==s&&n.option("value",s)})}initGridHeaderCellEditPanel(t,r,i){let n=t.dataField,s=r.find(".dx-datagrid-text-content"),l=$("<span />").addClass("column-editor-area").insertAfter(s);s.css("maxWidth","55%");let g=$("<div />").addClass("edit-type-panel").width("100%").appendTo(r),p=$("<div />").addClass("edit-width-panel").width("100%").appendTo(r);g[0].addEventListener("click",u=>{u.preventDefault(),u.stopImmediatePropagation();let v=S.dxSelectBox("instance");v.option("opened")?v.close():v.open()},!0);let h=t.caption,E=$("<span />").dxButton({hint:"Edit column caption",template:(u,v)=>v.append($("<span />").addClass("edit-caption-btn")),onClick:({event:u})=>{u.preventDefault(),u.stopImmediatePropagation(),s.hide(),E.hide(),m.hide();let v=$("<span />").dxTextBox({value:h,elementAttr:{class:"caption-editor"},onEnterKey:D=>{w.blur(),D.event.stopPropagation()},onKeyDown:D=>{D.event.stopPropagation()},onFocusOut:D=>{let _=w.option("value");v.remove(),s.text(_).show(),E.show(),m.show(),h=_,this.gridStateManager.setColumnCaption(n,_),this.saveGridState(this.grid.state())}}).addClass("iszolea-sm").appendTo(l).on("click",D=>{D.stopImmediatePropagation(),D.preventDefault()}),w=v.dxTextBox("instance");w.focus()}}).insertAfter(s),m=$("<span />").dxButton({hint:"Edit column tooltip",template:(u,v)=>v.append($("<span />").addClass("edit-tooltip-btn")),onClick:({event:u})=>{u.preventDefault(),u.stopImmediatePropagation(),s.hide(),E.hide(),m.hide();let v=$("<span />").dxTextBox({value:i&&i.tooltip,text:i&&i.tooltip,placeholder:"Enter column tooltip...",onEnterKey:D=>{w.blur(),D.event.stopPropagation()},onKeyDown:D=>{D.event.stopPropagation()},onFocusOut:()=>{let D=w.option("value");v.remove(),s.show(),E.show(),m.show(),i.tooltip=D,r.attr("title",D),this.saveGridState(this.grid.state())}}).addClass("iszolea-sm").appendTo(l).on("click",D=>{D.stopImmediatePropagation(),D.preventDefault()}),w=v.dxTextBox("instance");w.focus()}}).insertAfter(E),S=$("<span />").dxSelectBox({dataSource:Be,value:t.dataType||"default",placeholder:"Select column type...",onValueChanged:({value:u})=>{this.grid.columnOption(n,"dataType",u)}}).addClass("iszolea-sm").appendTo(g),T=t.width?t.width.toString():"",I=u=>{let v=u.component.option("value");(!v||v==="inherit")&&(v=""),(!T||T==="inherit")&&(T=""),v!==T&&(T=v,this.grid.columnOption(n,"width",v||"inherit"),this.gridRepaintQueued||(window.setTimeout(()=>{this.grid.repaint(),this.gridRepaintQueued=!1},100),this.gridRepaintQueued=!0))},y=$("<span />").dxTextBox({text:T==="inherit"?"":T,placeholder:"Set width...",onEnterKey:()=>y.dxTextBox("instance").blur(),onFocusOut:I,onValueChanged:I}).addClass("iszolea-sm").appendTo(p).on("click",u=>{u.stopImmediatePropagation(),u.preventDefault()});this.editWidthEditBoxes[t.visibleIndex]=y.dxTextBox("instance")}initGridHeaderCell(t,r){let i=t.find(".dx-datagrid-text-content"),n=r&&r.tooltip,s=r&&r.caption;t.attr("title",n||void 0),s&&i.text(s)}};var an={subvalues:[],type:"triangleMarker",color:"#8798a5",secondColor:"#e18e92",width:10,isCustomPalette:!1,palette:null,customPalette:["#61a595","Grey","rgb(153, 102, 255)","Navy"]},fe="isoz-subvalueEditorFormGroup",ln=`${fe}__name`,Br=`${fe}__is-bound`,Fr=`${fe}__value`,jr=`${fe}__measure-id`,dn=`${fe}__color`,gn=["rectangleNeedle","triangleNeedle","rangeBar","triangleMarker","textCloud"],pn=["rectangle","circle","rhombus","rangeBar","triangleMarker","textCloud"];var un=["LinearHorizontal","LinearVertical"],zt=["#1db2f5","#f5564a","#97c95c","#ffc720","#eb3573","#a63db8","#6593bc","#faa335","#ff887c"];var Gr,$r,Kt={ownerType:($r=(Gr=DevExpress==null?void 0:DevExpress.Dashboard)==null?void 0:Gr.Model)==null?void 0:$r.GaugeItem,propertyName:"GaugeSubvaluesSettings",defaultValue:JSON.stringify(an),valueType:"string"},Hr,Wr;(Wr=(Hr=DevExpress==null?void 0:DevExpress.Dashboard)==null?void 0:Hr.Model)==null||Wr.registerCustomProperty(Kt);function Vr(o){var t,r,i;if(o.dashboardItem instanceof((r=(t=DevExpress==null?void 0:DevExpress.Dashboard)==null?void 0:t.Model)==null?void 0:r.GaugeItem)){let n=Re(o.dashboardItem),s=o.options;s.subvalues=s.subvalues||[],s.subvalueIndicator=s.subvalueIndicator||{},s.subvalueIndicator.type=n.type,s.subvalueIndicator.width=n.width;let l=!!((i=o.dashboardItem.gauges()[0])==null?void 0:i.targetValue());s.subvalueIndicator.palette=n.subvalues.filter(g=>l||g.key>-1).map(g=>g.color),n.subvalues.forEach(g=>{if(g.key===-1)return;let p=g.isBound?o.itemData.getMeasureValue(g.measureId).getValue():g.value;s.subvalues.push(p)})}}function kr(o){var r,i;let t=o.dashboardItem;t instanceof((i=(r=DevExpress==null?void 0:DevExpress.Dashboard)==null?void 0:r.Model)==null?void 0:i.GaugeItem)&&o.addSection({title:"Subvalues",items:[{dataField:Kt.propertyName,template(n,s){let l=document.createElement("div");return new DevExpress.ui.dxButton(l,{text:"Edit in Wizard",onClick(){cn(t)}}),l},label:{visible:!1}}]})}function cn(o){let t=document.createElement("div");document.body.appendChild(t);let r={width:"800px",height:"auto",maxHeight:"100%",hideOnOutsideClick:!1,contentTemplate(n){let s=document.createElement("div"),l=mn(o);this._subvaluesForm=new DevExpress.ui.dxForm(s,l);let g=document.createElement("div"),p=yn(o);this._indicatorForm=new DevExpress.ui.dxForm(g,p);let h=$("<div />").append(s,g),E=$("<div />");return E.append(h),E.dxScrollView({width:"100%",height:"100%"}),E},onHidden(){document.body.removeChild(t)},title:"Subvalues Wizard"};new DevExpress.ui.dxPopup(t,r).show()}function Re(o){var i,n;let t=JSON.parse(o.customProperties.getValue(Kt.propertyName));return!!((i=o.gauges()[0])==null?void 0:i.targetValue())&&(!t.subvalues||!t.subvalues.some(s=>s.key===-1))&&t.subvalues.splice(0,0,{key:-1,name:"Target Value",isBound:!1,measureId:"",value:0,color:zt[(((n=t.subvalues)==null?void 0:n.length)||0)%(zt.length-1)]}),t}function Yt(o,t){return o.customProperties.setValue(Kt.propertyName,JSON.stringify(t))}function hn(o,t){let r=$("<div />"),i=$("<div />");r.append(i);let n=null,s=null,l={items:[{location:"before",widget:"dxButton",options:{icon:"add",stylingMode:"text",onClick(m){let S=Re(t),T=S.subvalues.reduce((u,v)=>u<v.key?v.key:u,0)+1,I={key:T,name:`Subvalue ${T}`,isBound:!1,measureId:"",value:0,color:zt[S.subvalues.length%(zt.length-1)]};o.option("formData",I);let y=S.subvalues.filter(u=>u.key===I.key)[0];if(!y)S.subvalues.push(I);else{let u=S.subvalues.indexOf(y);S[u]=I}Yt(t,S),s.reload(),s.option("selectedItem",S.subvalues[S.subvalues.length-1])}}}]},g=m=>{n&&n.option("disabled",!m)},p=new DevExpress.ui.dxToolbar(i,l);o.element().find(`.${fe}`).css("display","none");let h={dataSource:new DevExpress.data.DataSource({load:()=>Re(t).subvalues,remove:()=>{}}),displayExpr:"name",height:"200px",keyExpr:"key",noDataText:"Add a Subvalue",allowItemDeleting:!0,itemDeleteMode:"static",selectionMode:"single",onContentReady(m){g(!!m.component.option("selectedItem"))},onItemRendered(m){if(m.itemData.key===-1){let T=m.itemElement[0].getElementsByClassName("dx-list-static-delete-button-container")[0];T.style.display="none"}},onSelectionChanged(m){g(!!m.component.option("selectedItem"));let S=m.component.option("selectedItem");o.option("formData",S);let T=o.element().find(`.${fe}`).css("display")==="block",I=!!S;(!T&&I||T&&!I)&&o.element().find(`.${fe}`).css("display",I?"block":"none")},onItemDeleted:m=>{let S=Re(t),T=m.itemData.key,I=S.subvalues.indexOf(S.subvalues.filter(y=>y.key===T)[0]);I>=0&&(S.subvalues.splice(I,1),Yt(t,S)),s.reload(),s.option("selectedItem",S.subvalues[S.subvalues.length-1])}},E=$("<div />");return r.append(E),s=new DevExpress.ui.dxList(E,h),[r,s,p]}function mn(o){let t=null,r=i=>{let n=i.getEditor("value"),s=i.getEditor("measureId"),l=i.getEditor("name"),g=i.option("formData").isBound,p=i.option("formData").key===-1;n&&n.option("disabled",g),s&&s.option("disabled",!g),i.element().find(`.${Br}`).css("display",p?"none":"flex"),i.element().find(`.${Fr}`).css("display",p?"none":"flex"),i.element().find(`.${jr}`).css("display",p?"none":"flex"),l&&l.option("disabled",p)};return{formData:null,colCount:2,items:[{itemType:"group",caption:"Subvalues items",template:i=>{let[n,s]=hn(i.component,o);return t=s,n}},{name:"subvalueEditor",cssClass:fe,itemType:"group",caption:"Item options",items:[{dataField:"name",cssClass:ln,editorType:"dxTextBox",editorOptions:{valueChangeEvent:"keyup"}},{dataField:"isBound",cssClass:Br,editorType:"dxRadioGroup",editorOptions:{displayExpr:"text",valueExpr:"value",layout:"horizontal",items:[{text:"Unbound",value:!1},{text:"Bound",value:!0}]},label:{text:"Type"}},{dataField:"value",cssClass:Fr,editorType:"dxNumberBox",label:{text:"Value"},editorOptions:{showSpinButtons:!0}},{dataField:"measureId",cssClass:jr,editorType:"dxSelectBox",label:{text:"Hidden measures"},editorOptions:{displayExpr:"text",valueExpr:"value",items:o.hiddenMeasures().map(i=>({text:fn(i),value:i.uniqueName()}))}},{name:"color",cssClass:dn,dataField:"color",editorType:"dxColorBox",label:{text:"Color"}}]}],onContentReady(i){r(i.component)},onFieldDataChanged(i){let n=i.component.option("formData"),s=Re(o),l=s.subvalues.filter(g=>g.key===n.key)[0];s.subvalues[s.subvalues.indexOf(l)]=n,Yt(o,s),l&&l.name!==n.name&&t&&t.repaint(),r(i.component)}}}function fn(o){if(o.name())return o.name();let t=o.dataMember();return o.summaryType&&o.summaryType()&&(t+=` (${o.summaryType()})`),t}function yn(o){let t=o.viewType(),r=un.some(i=>i===t)?pn:gn;return{formData:Re(o)||null,items:[{caption:"Indicator options",itemType:"group",items:[{dataField:"type",editorType:"dxSelectBox",label:{text:"Type"},editorOptions:{displayExpr:"text",valueExpr:"value",items:r.map(i=>({text:i,value:i}))}},{dataField:"width",editorType:"dxNumberBox",editorOptions:{showSpinButtons:!0},label:{text:"Width"}}]}],onFieldDataChanged(i){let n=i.component.option("formData"),s=Re(o);s.width=n.width,s.type=n.type,Yt(o,s)}}}function zr(o){this.name="GaugeSubvalues",this.start=()=>{let t=o.findExtension("viewer-api");t&&t.on("itemWidgetOptionsPrepared",Vr);let r=o.findExtension("item-options-panel");r&&r.on("customizeSections",kr)},this.stop=()=>{let t=o.findExtension("viewer-api");t&&t.off("itemWidgetOptionsPrepared",Vr);let r=o.findExtension("item-options-panel");r&&r.off("customizeSections",kr)}}var vn="DASHBOARD_MODE_KEY",qe=class{constructor(t){this.refreshButton=null;this.dashboard=null;this.popover=null;this.$dashboardContainer=t.$dashboardContainer,this.addRefreshButton=t.addRefreshButton,this.reportParams=t.reportParams,this.reportId=t.reportParams.ReportId,this.permissions=t.permissions,this.urls=t.urls}init(){let t=this.reportParams.ReportId&&this.reportParams.ReportId.toString();DevExpress.Dashboard.ResourceManager.embedBundledResources();let r=this.permissions.AllowEditing&&window.sessionStorage.getItem(this.getSessionKey())||"Viewer";if(this.reportParams.Details&&(this.popover=ee(".report-details-link",this.reportParams.Details)),this.dashboard=new DevExpress.Dashboard.DashboardControl(this.$dashboardContainer[0],{workingMode:r,initialDashboardId:t,endpoint:this.urls.EndPoint,ajaxRemoteService:{headers:this.reportParams.Token?{token:this.reportParams.Token}:void 0},onDashboardInitializing:i=>{i.component.registerExtension(new zr(i.component)),t!==i.dashboardId&&(t=i.dashboardId,window.location.href=encodeURI(this.urls.PreviewUrl+i.dashboardId))},onBeforeRender:i=>{i.component.registerExtension(new DevExpress.Dashboard.Designer.TextBoxItemEditorExtension(i.component))},extensions:{"data-source-wizard":{enableCustomSql:!0},"dashboard-export":{allowExportDashboardItems:!0},"data-inspector":{allowInspectAggregatedData:!0,allowInspectRawData:!0,onGridInitialized:i=>{i.component.option("export.enabled",!0)}}}}),this.dashboard.render(),this.permissions.AllowEditing){let i=$(".switch-mode-btn").dxButton({text:r==="Viewer"?"Switch to Designer":"Switch to Viewer",onClick:()=>{r=r==="Viewer"?"Designer":"Viewer",window.sessionStorage.setItem(this.getSessionKey(),r),r==="Viewer"?(this.dashboard.switchToViewer(),i.option("text","Switch to Designer")):(this.dashboard.switchToDesigner(),i.option("text","Switch to Viewer"))}}).addClass("iszolea-md").dxButton("instance");Sn(this.dashboard)}this.addRefreshButton&&(this.refreshButton=new ge($(".report-refresh-button"),()=>this.refresh()))}dispose(){var t,r;(t=this.dashboard)==null||t.dispose(),this.dashboard=null,(r=this.popover)==null||r.dispose(),this.popover=null}getSessionKey(){return vn+this.reportId}refresh(){var t;(t=this.dashboard)==null||t.refresh()}};function Sn(o){let t=["create-dashboard","open-dashboard"],r=o.findExtension("toolbox");t.forEach(i=>{r.menuItems().filter(s=>s.id===i)[0]&&r.removeMenuItem(i)})}var Jt=(l=>(l[l.Key=1]="Key",l[l.Title=2]="Title",l[l.Start=3]="Start",l[l.End=4]="End",l[l.ParentId=5]="ParentId",l[l.Progress=6]="Progress",l))(Jt||{}),Qe=class{constructor(t){this.SWITCH_TO_DESIGNER_TEXT="Switch to Designer";this.SWITCH_TO_VIEWER_TEXT="Switch to Viewer";this.CHART_STORAGE_MODE_KEY="CHART_STORAGE_MODE_KEY";this.hasForm=!1;this.chart=null;this.chartPositionMarker=t.chartPositionMarker,this.reportParams=t.reportParams,this.addRefreshButton=t.addRefreshButton,this.allowEditing=t.allowEditing,this.ganttReportControllerUrl=t.ganttReportControllerUrl,this.showHeader=t.showHeader,this.mode=window.sessionStorage.getItem(this.getSessionKey())||"Viewer"}init(){let t={DbConnectionName:"",TableName:"",TaskColumns:[],ResourcesTableName:"",ResourcesTextField:"",ResourcesKeyField:"",ResourceAssignmentTaskIdField:"",ResourceAssignmentResourceIdField:"",ResourceAssignmentKeyField:"",ResourceAssignmentTableName:"",DependenciesKeyField:"",DependenciesPredecessorIdField:"",DependenciesSuccessorIdField:"",DependenciesTableName:"",DependenciesTypeField:"",EndDateRange:void 0,StartDateRange:void 0,TaskTitlePosition:"outside",ScaleType:"auto"},r=[],i=!1;x(`${this.ganttReportControllerUrl}/GetGanttChartSettings`,"post",{id:this.reportParams.ReportId},!1,{dataType:"json"}).then(n=>{if(t=n,!t.DbConnectionName||!t.TableName||!t.TaskColumns||!t.TaskColumns.length){t.TaskColumns=[];for(let s=0;s<6;s++)t.TaskColumns.push({taskColumnType:Jt[Jt[s+1]]});this.setupForm(t,!0);return}return n.TaskColumns.forEach(s=>{r[s.taskColumnType-1]=s}),t.TaskColumns=r,i=!0,this.fetchData()}).then(n=>{if(!i)return!1;this.mode==="Designer"&&this.setupForm(t,!i),this.setupChart(r,t),this.updateData(n.Data)}).catch(()=>{this.setupForm(t,!0)}),this.allowEditing&&this.initSwitchModeButton(),this.reportParams.Details&&(this.popover=ee(".diagram-details-link",this.reportParams.Details))}fetchData(){return x(`${this.ganttReportControllerUrl}/GetGanttChartData`,"post",{id:this.reportParams.ReportId},!1,{dataType:"json"})}initSwitchModeButton(){let t=$(".switch-mode-btn").dxButton({text:this.mode==="Viewer"?this.SWITCH_TO_DESIGNER_TEXT:this.SWITCH_TO_VIEWER_TEXT,onClick:()=>{this.mode=this.mode==="Viewer"?"Designer":"Viewer",window.sessionStorage.setItem(this.getSessionKey(),this.mode),t.option("text",this.mode==="Viewer"?this.SWITCH_TO_DESIGNER_TEXT:this.SWITCH_TO_VIEWER_TEXT),window.location.reload()}}).addClass("iszolea-md").dxButton("instance")}setupForm(t,r){this.hasForm=!0;let i=[{dataField:"DbConnectionName",caption:"Connection Name"},{dataField:"TableName",caption:"Table"}];for(let s=1;s<7;s++)i.push({itemType:"group",colCount:8,items:[{dataField:`TaskColumns[${s-1}].taskColumnType`,visible:!1},{dataField:`TaskColumns[${s-1}].dataField`,label:{location:"top",text:`${Jt[s]} Data Field`}},{dataField:`TaskColumns[${s-1}].caption`,label:{location:"top",text:"Caption"}},{dataField:`TaskColumns[${s-1}].dataType`,label:{location:"top",text:"DataType"}},{dataField:`TaskColumns[${s-1}].width`,label:{location:"top",text:"Width"},editorType:"dxNumberBox"},{dataField:`TaskColumns[${s-1}].sortIndex`,label:{location:"top",text:"SortIndex"},editorType:"dxNumberBox"},{dataField:`TaskColumns[${s-1}].sortOrder`,label:{location:"top",text:"SortOrder"},editorType:"dxSelectBox",editorOptions:{items:["asc","desc"],showClearButton:!0}},{dataField:`TaskColumns[${s-1}].visible`,label:{location:"top",text:"Visible"},editorType:"dxCheckBox"},{dataField:`TaskColumns[${s-1}].visibleIndex`,label:{location:"top",text:"VisibleIndex"}}]});i.push({itemType:"group",caption:"Resources",colCount:4,items:[{dataField:"ResourcesTableName",label:{location:"top",text:"Table"},colSpan:2},{dataField:"ResourcesKeyField",label:{location:"top",text:"Key Field"}},{dataField:"ResourcesTextField",label:{location:"top",text:"Text Field"}}]}),i.push({itemType:"group",caption:"Resource Assignments",colCount:5,items:[{dataField:"ResourceAssignmentTableName",label:{location:"top",text:"Table"},colSpan:2},{dataField:"ResourceAssignmentKeyField",label:{location:"top",text:"Key Field"}},{dataField:"ResourceAssignmentTaskIdField",label:{location:"top",text:"Task Id Field"}},{dataField:"ResourceAssignmentResourceIdField",label:{location:"top",text:"Resource Id Field"}}]}),i.push({itemType:"group",caption:"Dependencies",colCount:6,items:[{dataField:"DependenciesTableName",label:{location:"top",text:"Table"},colSpan:2},{dataField:"DependenciesKeyField",label:{location:"top",text:"Key Field"}},{dataField:"DependenciesPredecessorIdField",label:{location:"top",text:"Predecessor Id Field"}},{dataField:"DependenciesSuccessorIdField",label:{location:"top",text:"Successor Id Field"}},{dataField:"DependenciesTypeField",label:{location:"top",text:"Dependency Type Field"}}]}),i.push({itemType:"button",buttonOptions:{text:"Save",onClick:()=>this.saveFormData(n).then(()=>window.location.reload())}}),i.push({itemType:"group",caption:"Appearance",colCount:5,items:[{dataField:"TaskTitlePosition",label:{location:"top"},editorType:"dxSelectBox",editorOptions:{items:["inside","outside","none"]}},{dataField:"ScaleType",label:{location:"top"},editorType:"dxSelectBox",editorOptions:{items:["auto","minutes","hours","days","weeks","months","quarters","years"]}},{dataField:"StartDateRange",label:{location:"top"},editorType:"dxDateBox",editorOptions:{showClearButton:!0}},{dataField:"EndDateRange",label:{location:"top"},editorType:"dxDateBox",editorOptions:{showClearButton:!0}},{itemType:"button",buttonOptions:{text:"Update",onClick:()=>{if(!this.chart)return;let s=n.option("formData");this.chart.beginUpdate(),this.chart.option({scaleType:s.ScaleType,taskTitlePosition:s.TaskTitlePosition,startDateRange:s.StartDateRange?new Date(s.StartDateRange):null,endDateRange:s.EndDateRange?new Date(s.EndDateRange):null}),this.chart.endUpdate(),this.chart.repaint(),this.saveFormData(n)}}}]});let n=$("<div />").css("padding",20).insertAfter(this.chartPositionMarker).dxForm({width:"100%",height:r?"calc(100% - 50px)":"calc(50% - 50px)",formData:t,scrollingEnabled:!0,items:i}).dxForm("instance")}saveFormData(t){let r=t.option("formData");return r.TaskColumns&&(r.TaskColumns=r.TaskColumns.filter(i=>!!i.dataField)),x(`${this.ganttReportControllerUrl}/UpdateGanttChartSettings`,"post",{id:this.reportParams.ReportId,settings:JSON.stringify(t.option("formData"))},!0,{dataType:"json"})}setupChart(t,r){let i=0,n=!1,s={};t.forEach(l=>{l.taskColumnType&&(s[l.taskColumnType]=l.dataField)}),t.filter(l=>l.visible).forEach(l=>{let g=parseInt(l.width);isNaN(g)?n=!0:i+=g}),this.chart=this.chartPositionMarker.dxGantt({width:"100%",height:this.hasForm?"50%":"calc(100% - 60px)",firstDayOfWeek:6,taskListWidth:!n&&i>0?i:void 0,toolbar:{items:["zoomIn","zoomOut","separator","taskDetails"]},editing:{enabled:!0},startDateRange:r.StartDateRange?new Date(r.StartDateRange):void 0,endDateRange:r.EndDateRange?new Date(r.EndDateRange):void 0,scaleType:r.ScaleType,taskTitlePosition:r.TaskTitlePosition,columns:t.filter(l=>l.visible).map(l=>({dataField:l.dataField,dataType:l.dataType,width:l.width,visibleIndex:l.visibleIndex,sortIndex:l.sortIndex,sortOrder:l.sortOrder&&(l.sortOrder==="asc"?"asc":"desc"),caption:l.caption||void 0})),tasks:{keyExpr:s[1],startExpr:s[3],endExpr:s[4],parentIdExpr:s[5],progressExpr:s[6],titleExpr:s[2]},dependencies:{keyExpr:r.DependenciesKeyField,predecessorIdExpr:r.DependenciesPredecessorIdField,successorIdExpr:r.DependenciesSuccessorIdField,typeExpr:r.DependenciesTypeField},resources:{keyExpr:r.ResourcesKeyField,textExpr:r.ResourcesTextField},resourceAssignments:{keyExpr:r.ResourceAssignmentKeyField,resourceIdExpr:r.ResourceAssignmentResourceIdField,taskIdExpr:r.ResourceAssignmentTaskIdField}}).dxGantt("instance"),this.addRefreshButton&&new ge($(".report-refresh-button"),()=>this.refresh())}updateData(t){!this.chart||(this.chart.option("tasks.dataSource",t.Tasks),this.chart.option("dependencies.dataSource",t.Dependencies),this.chart.option("resources.dataSource",t.Resources),this.chart.option("resourceAssignments.dataSource",t.ResourceAssignments))}refresh(){this.fetchData().then(t=>{this.updateData(t.Data)})}dispose(){var t;(t=this.chart)==null||t.dispose(),this.chart=null}getSessionKey(){return this.CHART_STORAGE_MODE_KEY+this.reportParams.ReportId}};var Yr="Switch to Designer",Kr="Switch to Viewer",bn="reportMode",Me="customCurrentUrl",qt=window.ko,Xe=class{constructor(t){this.popover=null;this.$reportContainer=t.$reportContainer,this.reportParams=t.reportParams,this.allowEditing=t.allowEditing,this.designerModelUrl=t.designerModelUrl,this.reportId=t.reportParams.ReportId}init(){let t=window.sessionStorage.getItem(this.getSessionKey())||"Viewer",r=null;this.reportParams.Details&&(this.popover=ee(".report-details-link",this.reportParams.Details)),this.allowEditing&&(r=$(".switch-mode-btn").dxButton({text:t==="Viewer"?Yr:Kr,onClick:()=>{t=t==="Viewer"?"Designer":"Viewer",window.sessionStorage.setItem(this.getSessionKey(),t),this.switchMode(t,r)}}).addClass("iszolea-md").dxButton("instance")),this.createReportDesigner(this.$reportContainer,this.designerModelUrl,"dxReportDesigner",this.reportParams.ReportId.toString(),i=>{setTimeout(()=>{this.updateSwitchModeButton(t,r)})},t==="Viewer"),window.addEventListener("beforeunload",i=>{dxReportDesigner&&dxReportDesigner.GetDesignerModel()&&dxReportDesigner.GetDesignerModel().isDirty&&(i.preventDefault(),i.returnValue="The report document is not saved. Are you sure you want to leave the page?")})}dispose(){var t;(t=this.popover)==null||t.dispose(),this.popover=null}refresh(){}initializePreview(t){let r=t.designerModel.reportPreviewModel.reportPreview,i=DevExpress.Reporting.Designer.Internal.ReportPreviewService;r.initialize(i.initializePreview(t.designerModel.model()))}switchMode(t,r){t==="Viewer"?(dxReportDesigner.designerModel.reportPreviewModel.reportPreview.previewVisible=!0,this.initializePreview(dxReportDesigner)):(dxReportDesigner.designerModel.reportPreviewModel.reportPreview.previewVisible=!1,dxReportDesigner.designerModel.reportPreviewModel.reportPreview.deactivate()),this.updateSwitchModeButton(t,r)}updateSwitchModeButton(t,r){r&&r.option("text",t==="Viewer"?Yr:Kr)}createReportDesigner(t,r,i,n,s,l){let g=t.attr("data-bind","dxReportDesigner: designerOptions").addClass("report-designer"),p={reportUrl:n,requestOptions:{getDesignerModelAction:r},callbacks:{BeforeRender:h=>{window[i]=h,l&&(h.designerModel.reportPreviewModel.reportPreview.previewVisible=!0),s(h)},CustomizeMenuActions:this.CustomizeMenuActions,PreviewCustomizeMenuActions:this.PreviewCustomizeMenuActions,ReportOpened:(h,E)=>{l&&this.initializePreview(h),this.ReportOpened(h,E)},ReportTabClosed:this.ReportTabClosed}};return qt.applyBindings({designerOptions:p},g[0]),g}PreviewCustomizeMenuActions(t,r){let i=r.GetById(DevExpress.Reporting.Viewer.ActionId.Design);i&&(i.visible=!1)}CustomizeMenuActions(t,r){let i=DevExpress.Reporting.Designer.Actions.ActionId,n=[i.Save],s=[i.NewReport,i.NewReportViaWizard,i.OpenReport,i.Preview,i.SaveAs,i.Exit];n.forEach(p=>{let h=r.GetById(p);h&&h.container==="menu"&&(h.container=void 0)}),s.forEach(p=>{let h=r.GetById(p);h&&(h.visible=!1)});let l=r.GetById(DevExpress.Reporting.Designer.Actions.ActionId.Save),g=l.clickAction;l.clickAction=()=>{t.GetCurrentTab().url(qt.unwrap(t[Me])),g()}}ReportOpened(t,r){t[Me]=t[Me]||qt.observable(),t[Me](r.Url)}ReportTabClosed(t,r){t[Me]=t[Me]||qt.observable(),t[Me](null)}getSessionKey(){return bn+this.reportId}};var Ze=class{constructor(t){this.SWITCH_TO_DESIGNER_TEXT="Switch to Designer";this.SWITCH_TO_VIEWER_TEXT="Switch to Viewer";this.DIAGRAM_STORAGE_MODE_KEY="DIAGRAM_STORAGE_MODE_KEY";this.$container=t.$container,this.reportParams=t.reportParams,this.allowEditing=t.allowEditing,this.addRefreshButton=t.addRefreshButton,this.diagramControllerUrl=t.diagramControllerUrl,this.mode=window.sessionStorage.getItem(this.getSessionKey())||"Viewer"}init(){this.createDiagramControl(),this.initDiagram(),this.allowEditing&&this.initSwitchModeButton(),this.reportParams.Details&&(this.popover=ee(".diagram-details-link",this.reportParams.Details))}dispose(){var t;this.diagram.dispose(),(t=this.popover)==null||t.dispose(),this.diagram=null}refresh(){this.diagram&&x(`${this.diagramControllerUrl}?id=${this.reportParams.ReportId}`,"get").then(t=>{this.diagram.import(JSON.stringify(t),!1),this.diagram.option("hasChanges",!1)})}createDiagramControl(){this.diagram=this.$container.dxDiagram({historyToolbar:{visible:!0,commands:["separator","undo","redo","separator",{name:"save",text:"Save",icon:"save"}]},onCustomCommand:t=>{switch(t.name){case"save":this.saveReport(t.component.export());break}},fullScreen:!1,readOnly:this.mode==="Viewer"}).dxDiagram("instance")}initDiagram(){x(`${this.diagramControllerUrl}?id=${this.reportParams.ReportId}`,"get").then(t=>{this.diagram.import(JSON.stringify(t)),this.diagram.option("hasChanges",!1)}),this.addRefreshButton&&(this.refreshButton=new ge($(".report-refresh-button"),()=>this.refresh())),window.addEventListener("beforeunload",t=>{this.diagram.option("hasChanges")&&(t.returnValue="The document is not saved. Are you sure you want to leave the page?")})}initSwitchModeButton(){let t=$(".switch-mode-btn").dxButton({text:this.mode==="Viewer"?this.SWITCH_TO_DESIGNER_TEXT:this.SWITCH_TO_VIEWER_TEXT,onClick:()=>{this.mode=this.mode==="Viewer"?"Designer":"Viewer",window.sessionStorage.setItem(this.getSessionKey(),this.mode),this.diagram.option("readOnly",this.mode==="Viewer"),t.option("text",this.mode==="Viewer"?this.SWITCH_TO_DESIGNER_TEXT:this.SWITCH_TO_VIEWER_TEXT)}}).addClass("iszolea-md").dxButton("instance")}async saveReport(t){let r=this.reportParams.ReportId;await x(this.diagramControllerUrl,"post",{id:r,source:t},!0),this.diagram.option("hasChanges",!1)}getSessionKey(){return this.DIAGRAM_STORAGE_MODE_KEY+this.reportParams.ReportId}};var Qt=class{constructor(t){this.reports=[];this.options=t.reportParams,this.$rootElement=t.$container,this.defaultReportSettings=t.defaultReportSettings}init(){this.renderContent()}dispose(){if(this.reports){for(this.reports.forEach(t=>{t.dispose()});this.reports.length;)this.reports.pop();this.reports=null}this.refreshTimer&&(this.refreshTimer.dispose(),this.refreshTimer=null)}refresh(){this.reports&&this.reports.forEach(t=>{t.refresh()})}renderContent(){let t=0,r=null,i=this.options.Reports.length,n=()=>{r=window.setTimeout(()=>{let g=t+1;g>=i&&(g=0),this.dxGallery.goToItem(g,!0)},this.options.DelaySec*1e3)},s=$("<div />").attr({class:"slideshow-report"}).appendTo(this.$rootElement),l=$("<div />",{class:"slideshow-report__gallery"}).dxGallery({loop:!1,dataSource:this.options.Reports,slideshowDelay:0,showNavButtons:!1,showIndicator:!0,stretchImages:!0,height:"100%",onInitialized:()=>n(),onSelectionChanged:g=>{t=g.component.option("selectedIndex"),window.clearTimeout(r),n()},itemTemplate:(g,p,h)=>{h.attr({class:"slideshow-report__gallery-item"}).height("100%");let E=$("<div />",{class:"slideshow-report__slide-content"}).height("100%"),m;window.setTimeout(()=>{switch(g.Type){case 1:let S=$("<div />",{class:"report-position"});S.appendTo(E),m=new qe(O(A({},this.defaultReportSettings[1]||{}),{$dashboardContainer:S,reportParams:g})),E.find("dashboard-title").hide(),E.find(".dx-dashboard-layout-container").css({top:0});break;case 0:let T=$("<div />",{class:"slideshow-report__grid-position"});E.addClass("iszolea-theme").addClass("panel-body"),T.appendTo(E),m=new Je(O(A({},this.defaultReportSettings[0]||{}),{gridPositionMarker:T,reportParams:g}));break;case 5:m=new Ae(O(A({},this.defaultReportSettings[5]||{}),{$container:E,reportParams:g}));break;case 3:let I=$("<div />",{class:"report-position"});I.appendTo(E),m=new Xe(O(A({},this.defaultReportSettings[3]||{}),{$reportContainer:I,reportParams:g}));break;case 4:let y=$("<div />",{class:"report-position"});y.appendTo(E),m=new Ze(O(A({},this.defaultReportSettings[4]||{}),{$container:y,reportParams:g}));break;case 7:let u=$("<div />",{class:"slideshow-report__grid-position"});E.addClass("iszolea-theme").addClass("panel-body"),u.appendTo(E),m=new Qe(O(A({},this.defaultReportSettings[7]||{}),{chartPositionMarker:u,reportParams:g}));break;case 2:case 6:break}m&&(m.init(),this.reports.push(m))},500),E.appendTo(h)}});this.dxGallery=l.dxGallery("instance"),l.appendTo(s),this.refreshTimer=new Ke({callback:()=>this.refresh(),elapsedCallback:g=>{}}),this.refreshTimer.start(this.options.RefreshSec*1e3)}};var Xt=class{constructor(t){this.STORAGE_MODE_KEY="CDM_STORAGE_MODE_KEY";this.SWITCH_TO_DESIGNER_TEXT="Switch to Designer";this.SWITCH_TO_VIEWER_TEXT="Switch to Viewer";this.options=t;let r=`/${t.baseUrl}/${t.reportParams.ReportId}`;this.getDataUrl=`${r}/Get`,this.getTableFieldsUrl=`${r}/Configurator/GetTableFieldList`,this.saveConfigurationUrl=`${r}/Configurator/Save`,this.getConfigurationUrl=`${r}/Configurator/Get`,this.mode=window.sessionStorage.getItem(this.getSessionKey())||"Viewer",this.loadPanel=$("<div />").dxLoadPanel({message:"Loading..."}).dxLoadPanel("instance"),$(document.body).append(this.loadPanel.element())}getSessionKey(){return this.STORAGE_MODE_KEY+this.options.reportParams.ReportId}renderContent(){this.options.$container.empty().removeAttr("style"),this.mode==="Viewer"?this.renderViewer():this.renderDesigner()}initSwitchModeButton(){let t=$(".switch-mode-btn").dxButton({text:this.mode==="Viewer"?this.SWITCH_TO_DESIGNER_TEXT:this.SWITCH_TO_VIEWER_TEXT,onClick:()=>{this.mode=this.mode==="Viewer"?"Designer":"Viewer",window.sessionStorage.setItem(this.getSessionKey(),this.mode),t.option("text",this.mode==="Viewer"?this.SWITCH_TO_DESIGNER_TEXT:this.SWITCH_TO_VIEWER_TEXT),this.renderContent()}}).addClass("iszolea-md").dxButton("instance")}initScheduler(){return this.options.$container.dxScheduler({height:"calc(100% - 49px)",editing:!1,firstDayOfWeek:1,startDayHour:8,endDayHour:18,views:["month","week","day"]}).dxScheduler("instance")}initForm(){return this.options.$container.dxForm({height:"100%",elementAttr:{style:"max-width: 400px; margin: 0 auto"},labelLocation:"top",items:[{itemType:"group",caption:"Fields mapping",items:[{dataField:"Title",editorType:"dxSelectBox",validationRules:[{type:"required"}],editorOptions:{}},{dataField:"StartDate",editorType:"dxSelectBox",validationRules:[{type:"required"}],editorOptions:{}},{dataField:"EndDate",editorType:"dxSelectBox",validationRules:[{type:"required"}],editorOptions:{}}]},{itemType:"group",caption:"View settings",items:[{dataField:"DefaultView",editorType:"dxSelectBox",editorOptions:{dataSource:["Month","Week","Day"]}}]},{itemType:"button",buttonOptions:{text:"Save",type:"default",onClick:()=>this.saveFormHandler()}}]}).dxForm("instance")}async renderViewer(){try{this.loadPanel.option("message","Loading..."),this.loadPanel.show(),this.scheduler=this.initScheduler(),this.scheduler.option("dataSource",[]);let t=await Promise.all([this.getConfiguration(),this.getDate()]),r=t[0],i=t[1];this.scheduler.option("dataSource",i),this.scheduler.option("currentView",((r==null?void 0:r.DefaultView)||"week").toLowerCase()),this.scheduler.option("currentDate",new Date)}finally{this.loadPanel.hide()}}async renderDesigner(){try{this.loadPanel.option("message","Loading..."),this.loadPanel.show(),this.form=this.initForm();let t=await Promise.all([this.getConfiguration(),this.getTableFields()]),r=t[0],i=t[1].map(s=>s.Name),n=t[1].filter(s=>s.Type==="datetime").map(s=>s.Name);this.form.option("formData",r),this.form.getEditor("Title").option("dataSource",i),this.form.getEditor("StartDate").option("dataSource",n),this.form.getEditor("EndDate").option("dataSource",n)}finally{this.loadPanel.hide()}}async saveFormHandler(){if(!!this.form.validate().isValid)try{let r=this.form.option("formData");this.loadPanel.option("message","Saving..."),this.loadPanel.show(),await x(this.saveConfigurationUrl,"POST",{data:r},!0)}finally{this.loadPanel.hide()}}async getConfiguration(){return await x(this.getConfigurationUrl)}async getTableFields(){return await x(this.getTableFieldsUrl)}async getDate(){return(await x(this.getDataUrl)).map(r=>O(A({},r),{startDate:new Date(r.startDate),endDate:new Date(r.endDate)}))}init(){this.options.allowEditing&&this.initSwitchModeButton(),this.renderContent()}refresh(){}dispose(){}};var Jr={config:k,Header:Ce,Footer:Ve,NavigationMenu:Ne,UserMenu:De,MenuSwitcher:Le,data:sr,widgets:{notify:P,fullScreen:le,popup:ro,confirm:xo,landing:Ao,accessDenied:Ro,defaultGridObsolete:Dr,defaultTreeList:_r,defaultGrid:V,defaultToolbar:fr,backgroundImageViewer:Ct,imageCropDialog:Do,ImageManager:ke,DocumentManager:Ge,ImageGallery:$e},pages:{AccountSettingsPage:Co},components:{CDM:$o,SessionNotifier:Ho,FileImporter:be,FileUploader:gt},styling:to,helpers:lo,utils:fo,reports:{CDMReportPage:Ae,DiagramReportPage:Ze,GridReportPage:Je,DashboardReportPage:qe,DXReportPage:Xe,SlideshowReportPage:Qt,GanttChartReportPage:Qe,SchedulerReportPage:Xt,gridColumnTypes:Be},business:{LicenceStatus:ot,MenuItemType:Ee,CdmImportFileMode:Fe,FooterIndicatorStatus:vo,GridDataColumnDataType:je}},Rr=Jr;window.IszoleaUI=Jr;})();
|
|
91
|
+
`,"Remove redundant columns?").then(l=>{!l||r(s)})})}resetSettings(){return this.gridDataLayer.resetSettings(this.id).then(t=>(this.onDataLoaded(t),t))}onDataLoaded(t){let r=t&&t.columns,i=0;this.stateLoaded=!0,r&&(this.loadedColumns={},r.forEach(n=>{this.loadedColumns[n.dataField]=!0,n.visible&&n.visibleIndex===null&&(n.visibleIndex=i++),Object.keys(n).forEach(l=>{(n[l]===null||n[l]===void 0||n[l]==="")&&delete n[l]});let s=this.additionalColumnsSettings[n.dataField];s?(s.caption=n.caption,s.tooltip=n.tooltip):this.additionalColumnsSettings[n.dataField]={caption:n.caption,tooltip:n.tooltip},delete n.caption,delete n.tooltip})),this.lastColumnSettingsStr=JSON.stringify(t.columns)}};var Br=(r=>(r[r.View=1]="View",r[r.Edit=2]="Edit",r))(Br||{}),j=Br;var Fr=o=>{let t={gridResult:`${o}/GridViewResult`,getColumnsByReportId:`${o}/GetDbTableFields`,resetGridSettings:`${o}/ResetGridViewSettings`,updateGridViewSettings:`${o}/UpdateGridViewSettings`,getGridViewSettings:`${o}/GetGridViewSettings`};return{getGridDataSource(r,i,n){return ce({loadParams:{id:r.ReportId,appName:r.AppName,gridMode:i,rowsLimit:i===j.Edit&&!n?15:null},loadUrl:t.gridResult,getUserFriendlyErrorMessage:nn})},getColumnsByReportId:r=>x(t.getColumnsByReportId,"post",{id:r},!1,{dataType:"json"}),resetSettings:r=>x(t.resetGridSettings,"post",{id:r},!1,{dataType:"json"}),updateGridViewSettings:(r,i)=>x(t.updateGridViewSettings,"post",{id:r,columnsSettings:JSON.stringify(i.columns)},!1,{dataType:"json"}),getGridViewSettings:r=>x(t.getGridViewSettings,"post",{id:r},!1,{dataType:"json"})}},nn=o=>{switch(o){case 1:return"We attempted to execute the data query however it appears there is an error in the data source. Please contact the report author to confirm the data requirements.";default:return""}};var Ye=class{constructor(t){this.activeTimerId=0;this.currentInterval=0;this.elapsedCallback=t.elapsedCallback,this.callback=t.callback}start(t){if(t<=0){this.callback();return}this.lastStateChecked=new Date,this.currentInterval=t;let r=this.activeTimerId=Math.random();if(this.currentInterval<0){this.elapsedCallback(this.currentInterval);return}this.tickTimerFunction(r)}triggerChange(){this.lastStateChecked=new Date,this.callback()}dispose(){this.activeTimerId--}tickTimerFunction(t){if(t!==this.activeTimerId)return;let r=this.currentInterval-(new Date-this.lastStateChecked);r<=0&&(r=this.currentInterval+999,this.callback(),this.lastStateChecked=new Date),this.elapsedCallback(r),setTimeout(()=>this.tickTimerFunction(t),100)}};var sn=[{timeout:0,text:"refresh now",refreshTemplate:""},{timeout:15*1e3,text:"15 sec",refreshTemplate:"Auto Update (%)"},{timeout:30*1e3,text:"30 sec",refreshTemplate:"Auto Update (%)"},{timeout:60*1e3,text:"1 min",refreshTemplate:"Auto Update (%)"},{timeout:180*1e3,text:"3 min",refreshTemplate:"Auto Update (%)"},{timeout:300*1e3,text:"5 min",refreshTemplate:"Auto Update (%)"},{timeout:600*1e3,text:"10 min",refreshTemplate:"Auto Update (%)"},{timeout:-1,text:"off",refreshTemplate:"Auto Update: off",isDefault:!0}],ge=class{constructor(t,r,i=sn){this.menuIsOpened=!1;this.refreshComponent=new Ye({callback:r,elapsedCallback:n=>this.elapsedCallback(n)}),this.selectedEntry=i.find(n=>n.isDefault)||i.filter(n=>!!n.timeout)[0],this.contextMenu=$("<div />").dxContextMenu({dataSource:i,target:t,position:{my:"right top",at:"right bottom"},onItemClick:n=>{n.itemData.timeout?(this.selectedEntry=n.itemData,n.component.selectItem(this.selectedEntry),this.refreshComponent.start(n.itemData.timeout),n.component.hide()):(n.component.hide(),this.refresh())},onHidden:()=>{this.menuIsOpened=!1},onShown:n=>{this.menuIsOpened=!0,n.component.itemsContainer()[0].parentElement.classList.add("iszolea-theme")},itemTemplate:n=>n.text,cssClass:"iszolea-theme"}).appendTo("body").dxContextMenu("instance"),this.contextMenu.selectItem(this.selectedEntry),this.dropDownButton=t.dxButton({text:this.selectedEntry.text,template:(n,s)=>($("<i />").addClass("dx-icon dx-icon-refresh").appendTo(s),$("<span>").addClass("button-with-expand-text").text(n.text).appendTo(s),$("<span>").addClass("button-with-expand-icon isoz-icon-16 isoz-icon-arrow-down-16").appendTo(s),s),elementAttr:{class:"iszolea-md button-with-expand"},onClick:n=>{this.contextMenu.element().width(t.outerWidth()),this.menuIsOpened?this.contextMenu.hide():this.contextMenu.show()}}).dxButton("instance"),this.selectedEntry.timeout>0&&this.refreshComponent.start(this.selectedEntry.timeout)}refresh(){this.refreshComponent.triggerChange()}elapsedCallback(t){this.dropDownButton.option("text",this.selectedEntry.refreshTemplate.replace("%",Math.floor(t/1e3).toString()))}};var an=3e3,Je=class{constructor(t){this.currentGridMode=null;this.showAllDataInEdit=!1;this.loadingTimeout=null;this.grid=null;this.popover=null;this.gridStateManager=null;this.$gridStateIndicator=null;this.$gridErrorPlaceholder=null;this.$gridTargetElement=null;this.$resetSettingTargetElement=null;this.gridStateIndicatorTimeout=null;this.editWidthEditBoxes=null;this.gridRepaintQueued=!1;this.columnNamesUpdated=!1;this.refreshButton=null;this.gridPositionMarker=t.gridPositionMarker,this.reportParams=t.reportParams,this.allowEditing=t.allowEditing,this.addRefreshButton=t.addRefreshButton,this.gridReportControllerUrl=t.gridReportControllerUrl,this.showHeader=t.showHeader,this.asyncSummaryLoad=t.asyncSummaryLoad}init(){this.currentGridMode||(this.currentGridMode=j.View),this.initInternal()}refresh(){var t;(t=this.grid)==null||t.refresh()}dispose(){var t,r,i,n;(t=this.grid)==null||t.dispose(),this.grid=null,this.currentGridMode=null,(r=this.$resetSettingTargetElement)==null||r.remove(),(i=this.$gridTargetElement)==null||i.remove(),(n=this.popover)==null||n.dispose(),this.popover=null}initInternal(){var r;this.dataLayer=Fr(this.gridReportControllerUrl),this.$gridTargetElement&&this.$gridTargetElement.remove(),this.$gridTargetElement=$("<div />").insertAfter(this.gridPositionMarker),this.gridStateManager=new zt(this.reportParams.ReportId,this.dataLayer),this.$gridErrorPlaceholder=$("<div />").text("Data loading failed.").addClass("dx-datagrid-nodata").css({zIndex:1}),this.$gridErrorPlaceholder.appendTo(this.gridPositionMarker),this.$gridErrorPlaceholder.hide(),this.reportParams.Details&&(this.popover=ee(".report-details-link",this.reportParams.Details)),this.editWidthEditBoxes=[];let t={width:"100%",dataSource:this.createDataSource(this.reportParams,this.currentGridMode,this.showAllDataInEdit),elementAttr:{class:this.currentGridMode===j.Edit?"edit-mode":"view-mode"},repaintChangesOnly:!0,onToolbarPreparing:i=>{let n=i.toolbarOptions.items;if(this.currentGridMode===j.View&&this.allowEditing){let s=n.filter(p=>p.name==="searchPanel")[0],l=n.indexOf(s),g={widget:"dxButton",location:"after",options:{text:"Switch to Edit Mode",onClick:()=>this.switchToMode(j.Edit),icon:"switch-to-edit-mode",elementAttr:{class:"iszolea-md"}}};n.splice(l,1),n.push(g),n.push(s)}if(this.currentGridMode===j.Edit){let s=n.filter(y=>y.name==="columnChooserButton")[0],l=n.indexOf(s),g={location:"after",template:()=>{let y=$("<div />").css({border:"1px #e0e0e0 solid",padding:"3px 6px",borderRadius:"4px",background:"white"});$("<span />").css({margin:"0 5px 0 0",width:"54px"}).dxSwitch({value:this.showAllDataInEdit,onValueChanged:({value:I})=>{this.showAllDataInEdit=I,this.grid.option("dataSource",this.createDataSource(this.reportParams,this.currentGridMode,this.showAllDataInEdit)),this.grid.refresh()}}).appendTo(y),$("<span />").text("Show all data ").appendTo(y);let T=$("<a />").css({textDecoration:"underline",color:"blue"}).text("(?)").appendTo(y);return $("<div />").text(`If the table contains a lot of columns showing all data can lead to slow page performance when you're editing the grid.
|
|
92
|
+
By default grid shows only first 10 rows in the Edit mode.`).dxPopover({target:T,showEvent:"mouseenter",hideEvent:"mouseleave",position:"top",width:500}).appendTo(y),y}},p={widget:"dxButton",location:"after",options:{text:"Switch to View Mode",onClick:()=>this.switchToMode(j.View),icon:"switch-to-view-mode",elementAttr:{class:"iszolea-md"}}};n.splice(l,1);let h=n.filter(y=>y.name==="exportButton")[0],S=n.indexOf(h);n.splice(S,1),n.push(g),n.push(p),n.push(s);let E={location:"before",template:()=>(this.$gridStateIndicator=$("<div />").addClass("edit-grid-state"),this.updateGridStateIndicator(re.edit),this.$gridStateIndicator)};n.unshift(E)}if(this.addRefreshButton){let s=n.filter(g=>g.name==="refresh")[0],l=n.indexOf(s);n[l]={location:"after",template:()=>{let g=$("<div />");return this.refreshButton=new ge(g,()=>this.refresh()),g}}}},onCellPrepared:({rowType:i,column:n,cellElement:s})=>{if(i==="header"&&!n.command){let l=n.dataField,g=this.gridStateManager.getColumnAdditionalSettings(l);this.initGridHeaderCell(s,g),this.currentGridMode===j.Edit&&this.initGridHeaderCellEditPanel(n,s,g)}},onContentReady:i=>{let n=i.component,s=n.state();if(!this.columnNamesUpdated)this.updateColumnNaming(s);else return;if(window.setTimeout(()=>n.endCustomLoading()),this.currentGridMode!==j.Edit)return;this.gridStateManager.checkNewColumns(s).forEach(p=>i.component.columnOption(p,"visible",!1)),this.gridStateManager.getColumnCaptions().forEach(p=>{p.caption&&n.columnOption(p.dataField,"caption")!==p.caption&&n.columnOption(p.dataField,"caption",p.caption)})},stateStoring:{enabled:!0,type:"custom",customLoad:()=>this.gridStateManager.load(this.currentGridMode===j.Edit,i=>{let n=this.grid.state();n.columns=n.columns.filter(s=>i.indexOf(s.dataField)<0),this.grid.state(n)}),customSave:i=>this.saveGridState(i)},filterRow:{visible:this.currentGridMode===j.View,applyFilter:"onClick"},headerFilter:{visible:this.currentGridMode===j.View},searchPanel:{visible:this.currentGridMode===j.View},errorRowEnabled:!1,allowColumnResizing:!0,sorting:{mode:"multiple"},groupPanel:{visible:!0},grouping:{autoExpandAll:!1},allowColumnReordering:this.currentGridMode===j.Edit,columnChooser:{enabled:this.currentGridMode===j.Edit},showColumnHeaders:!0,keyboardNavigation:{enabled:!1},showBorders:!0,paging:{pageSize:50,enabled:!0},remoteOperations:!0,summary:this.reportParams.TotalSummaryColumn?{totalItems:[{column:this.reportParams.TotalSummaryColumn,summaryType:"count"}]}:void 0,onEditorPreparing(i){if(i.parentType==="filterRow"){let n=()=>i.element.find(".dx-apply-button").trigger("dxclick");i.editorOptions.onEnterKey=n,i.editorOptions.onFocusOut=n}if(i.parentType==="searchPanel"){let n=s=>{i.component.searchByText(s.component.option("value"))};i.editorOptions.onValueChanged=void 0,i.editorOptions.onEnterKey=n,i.editorOptions.onFocusOut=n}}};return this.grid=V(this.$gridTargetElement,{options:t,exportFileName:this.reportParams.Name,title:this.showHeader?this.reportParams.Name:null,headerDescription:this.showHeader?this.reportParams.Details:null,asyncSummaryLoad:this.asyncSummaryLoad}),(r=this.$resetSettingTargetElement)==null||r.remove(),this.currentGridMode===j.Edit&&(this.$resetSettingTargetElement=$("<span />").css({float:"right",position:"relative",bottom:"8px"}).addClass("iszolea-md").dxButton({text:"Reset settings",onClick:()=>this.resetSettings(),icon:"reset-grid-settings"}).appendTo("footer")),this.grid}updateGridStateIndicator(t){Object.keys(re).forEach(i=>this.$gridStateIndicator.removeClass(re[i])),this.$gridStateIndicator.addClass(t),this.gridStateIndicatorTimeout&&window.clearTimeout(this.gridStateIndicatorTimeout),t===re.saved&&(this.gridStateIndicatorTimeout=window.setTimeout(()=>{this.updateGridStateIndicator(re.edit)},an));let r="";switch(t){case re.edit:r="Edit mode";break;case re.saved:r="Saved";break;case re.saving:r="Saving";break}this.$gridStateIndicator.attr("title",r)}updateColumnNaming(t){t.columns&&t.columns.forEach(r=>{/[^a-zA-Z0-9_]/.test(r.dataField)&&this.grid.columnOption(r.dataField,"calculateCellValue",i=>i[r.dataField])}),this.columnNamesUpdated=!0}createDataSource(t,r,i){let n=this.dataLayer.getGridDataSource(t,r,i),s=new DevExpress.data.DataSource({store:n,onChanged:r===j.View?void 0:()=>{this.columnNamesUpdated=!1},onLoadError:l=>{s.isLoaded()||this.$gridErrorPlaceholder.show(),this.grid.endCustomLoading()},onLoadingChanged:l=>{l?(this.$gridErrorPlaceholder.hide(),this.loadingTimeout=setTimeout(()=>{this.grid.beginCustomLoading("Please wait, data loading in progress.")},1e4)):(this.loadingTimeout&&(clearTimeout(this.loadingTimeout),this.loadingTimeout=null),this.grid.endCustomLoading())}});return s}resetSettings(){DevExpress.ui.dialog.confirm("Reset grid settings to default values?","Reset to default?").then(t=>{t&&(this.grid.beginCustomLoading("Loading"),this.gridStateManager.resetSettings().then(r=>{this.grid.state(r),this.grid.option("dataSource",this.createDataSource(this.reportParams,this.currentGridMode,this.showAllDataInEdit)),this.grid.refresh()}))})}switchToMode(t){if(this.currentGridMode===t||t===j.Edit&&!this.allowEditing)return;this.currentGridMode=t;let r=this.grid.option("summary.totalItems[0].column"),i=O(A({},this.reportParams),{TotalSummaryColumn:r||this.reportParams.TotalSummaryColumn});this.reportParams=i,this.grid.dispose(),this.$gridTargetElement.remove(),this.grid=this.initInternal()}saveGridState(t){if(this.currentGridMode!==j.Edit)return;this.columnNamesUpdated=!1;let r=this.gridStateManager.save(t,()=>this.updateGridStateIndicator(re.saving),()=>this.updateGridStateIndicator(re.saved));r&&Object.keys(r).forEach(i=>{let n=this.editWidthEditBoxes[i],s=r[i]==="inherit"?"":r[i];n&&n.option("value")!==s&&n.option("value",s)})}initGridHeaderCellEditPanel(t,r,i){let n=t.dataField,s=r.find(".dx-datagrid-text-content"),l=$("<span />").addClass("column-editor-area").insertAfter(s);s.css("maxWidth","55%");let g=$("<div />").addClass("edit-type-panel").width("100%").appendTo(r),p=$("<div />").addClass("edit-width-panel").width("100%").appendTo(r);g[0].addEventListener("click",u=>{u.preventDefault(),u.stopImmediatePropagation();let v=y.dxSelectBox("instance");v.option("opened")?v.close():v.open()},!0);let h=t.caption,S=$("<span />").dxButton({hint:"Edit column caption",template:(u,v)=>v.append($("<span />").addClass("edit-caption-btn")),onClick:({event:u})=>{u.preventDefault(),u.stopImmediatePropagation(),s.hide(),S.hide(),E.hide();let v=$("<span />").dxTextBox({value:h,elementAttr:{class:"caption-editor"},onEnterKey:D=>{w.blur(),D.event.stopPropagation()},onKeyDown:D=>{D.event.stopPropagation()},onFocusOut:D=>{let C=w.option("value");v.remove(),s.text(C).show(),S.show(),E.show(),h=C,this.gridStateManager.setColumnCaption(n,C),this.saveGridState(this.grid.state())}}).addClass("iszolea-sm").appendTo(l).on("click",D=>{D.stopImmediatePropagation(),D.preventDefault()}),w=v.dxTextBox("instance");w.focus()}}).insertAfter(s),E=$("<span />").dxButton({hint:"Edit column tooltip",template:(u,v)=>v.append($("<span />").addClass("edit-tooltip-btn")),onClick:({event:u})=>{u.preventDefault(),u.stopImmediatePropagation(),s.hide(),S.hide(),E.hide();let v=$("<span />").dxTextBox({value:i&&i.tooltip,text:i&&i.tooltip,placeholder:"Enter column tooltip...",onEnterKey:D=>{w.blur(),D.event.stopPropagation()},onKeyDown:D=>{D.event.stopPropagation()},onFocusOut:()=>{let D=w.option("value");v.remove(),s.show(),S.show(),E.show(),i.tooltip=D,r.attr("title",D),this.saveGridState(this.grid.state())}}).addClass("iszolea-sm").appendTo(l).on("click",D=>{D.stopImmediatePropagation(),D.preventDefault()}),w=v.dxTextBox("instance");w.focus()}}).insertAfter(S),y=$("<span />").dxSelectBox({dataSource:Be,value:t.dataType||"default",placeholder:"Select column type...",onValueChanged:({value:u})=>{this.grid.columnOption(n,"dataType",u)}}).addClass("iszolea-sm").appendTo(g),T=t.width?t.width.toString():"",I=u=>{let v=u.component.option("value");(!v||v==="inherit")&&(v=""),(!T||T==="inherit")&&(T=""),v!==T&&(T=v,this.grid.columnOption(n,"width",v||"inherit"),this.gridRepaintQueued||(window.setTimeout(()=>{this.grid.repaint(),this.gridRepaintQueued=!1},100),this.gridRepaintQueued=!0))},m=$("<span />").dxTextBox({text:T==="inherit"?"":T,placeholder:"Set width...",onEnterKey:()=>m.dxTextBox("instance").blur(),onFocusOut:I,onValueChanged:I}).addClass("iszolea-sm").appendTo(p).on("click",u=>{u.stopImmediatePropagation(),u.preventDefault()});this.editWidthEditBoxes[t.visibleIndex]=m.dxTextBox("instance")}initGridHeaderCell(t,r){let i=t.find(".dx-datagrid-text-content"),n=r&&r.tooltip,s=r&&r.caption;t.attr("title",n||void 0),s&&i.text(s)}};var ln={subvalues:[],type:"triangleMarker",color:"#8798a5",secondColor:"#e18e92",width:10,isCustomPalette:!1,palette:null,customPalette:["#61a595","Grey","rgb(153, 102, 255)","Navy"]},fe="isoz-subvalueEditorFormGroup",dn=`${fe}__name`,jr=`${fe}__is-bound`,Vr=`${fe}__value`,kr=`${fe}__measure-id`,gn=`${fe}__color`,pn=["rectangleNeedle","triangleNeedle","rangeBar","triangleMarker","textCloud"],un=["rectangle","circle","rhombus","rangeBar","triangleMarker","textCloud"];var cn=["LinearHorizontal","LinearVertical"],Kt=["#1db2f5","#f5564a","#97c95c","#ffc720","#eb3573","#a63db8","#6593bc","#faa335","#ff887c"];var Hr,Wr,Jt={ownerType:(Wr=(Hr=DevExpress==null?void 0:DevExpress.Dashboard)==null?void 0:Hr.Model)==null?void 0:Wr.GaugeItem,propertyName:"GaugeSubvaluesSettings",defaultValue:JSON.stringify(ln),valueType:"string"},zr,Kr;(Kr=(zr=DevExpress==null?void 0:DevExpress.Dashboard)==null?void 0:zr.Model)==null||Kr.registerCustomProperty(Jt);function Gr(o){var t,r,i;if(o.dashboardItem instanceof((r=(t=DevExpress==null?void 0:DevExpress.Dashboard)==null?void 0:t.Model)==null?void 0:r.GaugeItem)){let n=Re(o.dashboardItem),s=o.options;s.subvalues=s.subvalues||[],s.subvalueIndicator=s.subvalueIndicator||{},s.subvalueIndicator.type=n.type,s.subvalueIndicator.width=n.width;let l=!!((i=o.dashboardItem.gauges()[0])==null?void 0:i.targetValue());s.subvalueIndicator.palette=n.subvalues.filter(g=>l||g.key>-1).map(g=>g.color),n.subvalues.forEach(g=>{if(g.key===-1)return;let p=g.isBound?o.itemData.getMeasureValue(g.measureId).getValue():g.value;s.subvalues.push(p)})}}function $r(o){var r,i;let t=o.dashboardItem;t instanceof((i=(r=DevExpress==null?void 0:DevExpress.Dashboard)==null?void 0:r.Model)==null?void 0:i.GaugeItem)&&o.addSection({title:"Subvalues",items:[{dataField:Jt.propertyName,template(n,s){let l=document.createElement("div");return new DevExpress.ui.dxButton(l,{text:"Edit in Wizard",onClick(){hn(t)}}),l},label:{visible:!1}}]})}function hn(o){let t=document.createElement("div");document.body.appendChild(t);let r={width:"800px",height:"auto",maxHeight:"100%",hideOnOutsideClick:!1,contentTemplate(n){let s=document.createElement("div"),l=fn(o);this._subvaluesForm=new DevExpress.ui.dxForm(s,l);let g=document.createElement("div"),p=vn(o);this._indicatorForm=new DevExpress.ui.dxForm(g,p);let h=$("<div />").append(s,g),S=$("<div />");return S.append(h),S.dxScrollView({width:"100%",height:"100%"}),S},onHidden(){document.body.removeChild(t)},title:"Subvalues Wizard"};new DevExpress.ui.dxPopup(t,r).show()}function Re(o){var i,n;let t=JSON.parse(o.customProperties.getValue(Jt.propertyName));return!!((i=o.gauges()[0])==null?void 0:i.targetValue())&&(!t.subvalues||!t.subvalues.some(s=>s.key===-1))&&t.subvalues.splice(0,0,{key:-1,name:"Target Value",isBound:!1,measureId:"",value:0,color:Kt[(((n=t.subvalues)==null?void 0:n.length)||0)%(Kt.length-1)]}),t}function Yt(o,t){return o.customProperties.setValue(Jt.propertyName,JSON.stringify(t))}function mn(o,t){let r=$("<div />"),i=$("<div />");r.append(i);let n=null,s=null,l={items:[{location:"before",widget:"dxButton",options:{icon:"add",stylingMode:"text",onClick(E){let y=Re(t),T=y.subvalues.reduce((u,v)=>u<v.key?v.key:u,0)+1,I={key:T,name:`Subvalue ${T}`,isBound:!1,measureId:"",value:0,color:Kt[y.subvalues.length%(Kt.length-1)]};o.option("formData",I);let m=y.subvalues.filter(u=>u.key===I.key)[0];if(!m)y.subvalues.push(I);else{let u=y.subvalues.indexOf(m);y[u]=I}Yt(t,y),s.reload(),s.option("selectedItem",y.subvalues[y.subvalues.length-1])}}}]},g=E=>{n&&n.option("disabled",!E)},p=new DevExpress.ui.dxToolbar(i,l);o.element().find(`.${fe}`).css("display","none");let h={dataSource:new DevExpress.data.DataSource({load:()=>Re(t).subvalues,remove:()=>{}}),displayExpr:"name",height:"200px",keyExpr:"key",noDataText:"Add a Subvalue",allowItemDeleting:!0,itemDeleteMode:"static",selectionMode:"single",onContentReady(E){g(!!E.component.option("selectedItem"))},onItemRendered(E){if(E.itemData.key===-1){let T=E.itemElement[0].getElementsByClassName("dx-list-static-delete-button-container")[0];T.style.display="none"}},onSelectionChanged(E){g(!!E.component.option("selectedItem"));let y=E.component.option("selectedItem");o.option("formData",y);let T=o.element().find(`.${fe}`).css("display")==="block",I=!!y;(!T&&I||T&&!I)&&o.element().find(`.${fe}`).css("display",I?"block":"none")},onItemDeleted:E=>{let y=Re(t),T=E.itemData.key,I=y.subvalues.indexOf(y.subvalues.filter(m=>m.key===T)[0]);I>=0&&(y.subvalues.splice(I,1),Yt(t,y)),s.reload(),s.option("selectedItem",y.subvalues[y.subvalues.length-1])}},S=$("<div />");return r.append(S),s=new DevExpress.ui.dxList(S,h),[r,s,p]}function fn(o){let t=null,r=i=>{let n=i.getEditor("value"),s=i.getEditor("measureId"),l=i.getEditor("name"),g=i.option("formData").isBound,p=i.option("formData").key===-1;n&&n.option("disabled",g),s&&s.option("disabled",!g),i.element().find(`.${jr}`).css("display",p?"none":"flex"),i.element().find(`.${Vr}`).css("display",p?"none":"flex"),i.element().find(`.${kr}`).css("display",p?"none":"flex"),l&&l.option("disabled",p)};return{formData:null,colCount:2,items:[{itemType:"group",caption:"Subvalues items",template:i=>{let[n,s]=mn(i.component,o);return t=s,n}},{name:"subvalueEditor",cssClass:fe,itemType:"group",caption:"Item options",items:[{dataField:"name",cssClass:dn,editorType:"dxTextBox",editorOptions:{valueChangeEvent:"keyup"}},{dataField:"isBound",cssClass:jr,editorType:"dxRadioGroup",editorOptions:{displayExpr:"text",valueExpr:"value",layout:"horizontal",items:[{text:"Unbound",value:!1},{text:"Bound",value:!0}]},label:{text:"Type"}},{dataField:"value",cssClass:Vr,editorType:"dxNumberBox",label:{text:"Value"},editorOptions:{showSpinButtons:!0}},{dataField:"measureId",cssClass:kr,editorType:"dxSelectBox",label:{text:"Hidden measures"},editorOptions:{displayExpr:"text",valueExpr:"value",items:o.hiddenMeasures().map(i=>({text:yn(i),value:i.uniqueName()}))}},{name:"color",cssClass:gn,dataField:"color",editorType:"dxColorBox",label:{text:"Color"}}]}],onContentReady(i){r(i.component)},onFieldDataChanged(i){let n=i.component.option("formData"),s=Re(o),l=s.subvalues.filter(g=>g.key===n.key)[0];s.subvalues[s.subvalues.indexOf(l)]=n,Yt(o,s),l&&l.name!==n.name&&t&&t.repaint(),r(i.component)}}}function yn(o){if(o.name())return o.name();let t=o.dataMember();return o.summaryType&&o.summaryType()&&(t+=` (${o.summaryType()})`),t}function vn(o){let t=o.viewType(),r=cn.some(i=>i===t)?un:pn;return{formData:Re(o)||null,items:[{caption:"Indicator options",itemType:"group",items:[{dataField:"type",editorType:"dxSelectBox",label:{text:"Type"},editorOptions:{displayExpr:"text",valueExpr:"value",items:r.map(i=>({text:i,value:i}))}},{dataField:"width",editorType:"dxNumberBox",editorOptions:{showSpinButtons:!0},label:{text:"Width"}}]}],onFieldDataChanged(i){let n=i.component.option("formData"),s=Re(o);s.width=n.width,s.type=n.type,Yt(o,s)}}}function Yr(o){this.name="GaugeSubvalues",this.start=()=>{let t=o.findExtension("viewer-api");t&&t.on("itemWidgetOptionsPrepared",Gr);let r=o.findExtension("item-options-panel");r&&r.on("customizeSections",$r)},this.stop=()=>{let t=o.findExtension("viewer-api");t&&t.off("itemWidgetOptionsPrepared",Gr);let r=o.findExtension("item-options-panel");r&&r.off("customizeSections",$r)}}var Sn="DASHBOARD_MODE_KEY",qe=class{constructor(t){this.refreshButton=null;this.dashboard=null;this.popover=null;this.$dashboardContainer=t.$dashboardContainer,this.addRefreshButton=t.addRefreshButton,this.reportParams=t.reportParams,this.reportId=t.reportParams.ReportId,this.permissions=t.permissions,this.urls=t.urls}init(){let t=this.reportParams.ReportId&&this.reportParams.ReportId.toString();DevExpress.Dashboard.ResourceManager.embedBundledResources();let r=this.permissions.AllowEditing&&window.sessionStorage.getItem(this.getSessionKey())||"Viewer";if(this.reportParams.Details&&(this.popover=ee(".report-details-link",this.reportParams.Details)),this.dashboard=new DevExpress.Dashboard.DashboardControl(this.$dashboardContainer[0],{workingMode:r,initialDashboardId:t,endpoint:this.urls.EndPoint,ajaxRemoteService:{headers:this.reportParams.Token?{token:this.reportParams.Token}:void 0},onDashboardInitializing:i=>{i.component.registerExtension(new Yr(i.component)),t!==i.dashboardId&&(t=i.dashboardId,window.location.href=encodeURI(this.urls.PreviewUrl+i.dashboardId))},onBeforeRender:i=>{i.component.registerExtension(new DevExpress.Dashboard.Designer.TextBoxItemEditorExtension(i.component))},extensions:{"data-source-wizard":{enableCustomSql:!0},"dashboard-export":{allowExportDashboardItems:!0},"data-inspector":{allowInspectAggregatedData:!0,allowInspectRawData:!0,onGridInitialized:i=>{i.component.option("export.enabled",!0)}}}}),this.dashboard.render(),this.permissions.AllowEditing){let i=$(".switch-mode-btn").dxButton({text:r==="Viewer"?"Switch to Designer":"Switch to Viewer",onClick:()=>{r=r==="Viewer"?"Designer":"Viewer",window.sessionStorage.setItem(this.getSessionKey(),r),r==="Viewer"?(this.dashboard.switchToViewer(),i.option("text","Switch to Designer")):(this.dashboard.switchToDesigner(),i.option("text","Switch to Viewer"))}}).addClass("iszolea-md").dxButton("instance");bn(this.dashboard)}this.addRefreshButton&&(this.refreshButton=new ge($(".report-refresh-button"),()=>this.refresh()))}dispose(){var t,r;(t=this.dashboard)==null||t.dispose(),this.dashboard=null,(r=this.popover)==null||r.dispose(),this.popover=null}getSessionKey(){return Sn+this.reportId}refresh(){var t;(t=this.dashboard)==null||t.refresh()}};function bn(o){let t=["create-dashboard","open-dashboard"],r=o.findExtension("toolbox");t.forEach(i=>{r.menuItems().filter(s=>s.id===i)[0]&&r.removeMenuItem(i)})}var qt=(l=>(l[l.Key=1]="Key",l[l.Title=2]="Title",l[l.Start=3]="Start",l[l.End=4]="End",l[l.ParentId=5]="ParentId",l[l.Progress=6]="Progress",l))(qt||{}),Qe=class{constructor(t){this.SWITCH_TO_DESIGNER_TEXT="Switch to Designer";this.SWITCH_TO_VIEWER_TEXT="Switch to Viewer";this.CHART_STORAGE_MODE_KEY="CHART_STORAGE_MODE_KEY";this.hasForm=!1;this.chart=null;this.chartPositionMarker=t.chartPositionMarker,this.reportParams=t.reportParams,this.addRefreshButton=t.addRefreshButton,this.allowEditing=t.allowEditing,this.ganttReportControllerUrl=t.ganttReportControllerUrl,this.showHeader=t.showHeader,this.mode=window.sessionStorage.getItem(this.getSessionKey())||"Viewer"}init(){let t={DbConnectionName:"",TableName:"",TaskColumns:[],ResourcesTableName:"",ResourcesTextField:"",ResourcesKeyField:"",ResourceAssignmentTaskIdField:"",ResourceAssignmentResourceIdField:"",ResourceAssignmentKeyField:"",ResourceAssignmentTableName:"",DependenciesKeyField:"",DependenciesPredecessorIdField:"",DependenciesSuccessorIdField:"",DependenciesTableName:"",DependenciesTypeField:"",EndDateRange:void 0,StartDateRange:void 0,TaskTitlePosition:"outside",ScaleType:"auto"},r=[],i=!1;x(`${this.ganttReportControllerUrl}/GetGanttChartSettings`,"post",{id:this.reportParams.ReportId},!1,{dataType:"json"}).then(n=>{if(t=n,!t.DbConnectionName||!t.TableName||!t.TaskColumns||!t.TaskColumns.length){t.TaskColumns=[];for(let s=0;s<6;s++)t.TaskColumns.push({taskColumnType:qt[qt[s+1]]});this.setupForm(t,!0);return}return n.TaskColumns.forEach(s=>{r[s.taskColumnType-1]=s}),t.TaskColumns=r,i=!0,this.fetchData()}).then(n=>{if(!i)return!1;this.mode==="Designer"&&this.setupForm(t,!i),this.setupChart(r,t),this.updateData(n.Data)}).catch(()=>{this.setupForm(t,!0)}),this.allowEditing&&this.initSwitchModeButton(),this.reportParams.Details&&(this.popover=ee(".diagram-details-link",this.reportParams.Details))}fetchData(){return x(`${this.ganttReportControllerUrl}/GetGanttChartData`,"post",{id:this.reportParams.ReportId},!1,{dataType:"json"})}initSwitchModeButton(){let t=$(".switch-mode-btn").dxButton({text:this.mode==="Viewer"?this.SWITCH_TO_DESIGNER_TEXT:this.SWITCH_TO_VIEWER_TEXT,onClick:()=>{this.mode=this.mode==="Viewer"?"Designer":"Viewer",window.sessionStorage.setItem(this.getSessionKey(),this.mode),t.option("text",this.mode==="Viewer"?this.SWITCH_TO_DESIGNER_TEXT:this.SWITCH_TO_VIEWER_TEXT),window.location.reload()}}).addClass("iszolea-md").dxButton("instance")}setupForm(t,r){this.hasForm=!0;let i=[{dataField:"DbConnectionName",caption:"Connection Name"},{dataField:"TableName",caption:"Table"}];for(let s=1;s<7;s++)i.push({itemType:"group",colCount:8,items:[{dataField:`TaskColumns[${s-1}].taskColumnType`,visible:!1},{dataField:`TaskColumns[${s-1}].dataField`,label:{location:"top",text:`${qt[s]} Data Field`}},{dataField:`TaskColumns[${s-1}].caption`,label:{location:"top",text:"Caption"}},{dataField:`TaskColumns[${s-1}].dataType`,label:{location:"top",text:"DataType"}},{dataField:`TaskColumns[${s-1}].width`,label:{location:"top",text:"Width"},editorType:"dxNumberBox"},{dataField:`TaskColumns[${s-1}].sortIndex`,label:{location:"top",text:"SortIndex"},editorType:"dxNumberBox"},{dataField:`TaskColumns[${s-1}].sortOrder`,label:{location:"top",text:"SortOrder"},editorType:"dxSelectBox",editorOptions:{items:["asc","desc"],showClearButton:!0}},{dataField:`TaskColumns[${s-1}].visible`,label:{location:"top",text:"Visible"},editorType:"dxCheckBox"},{dataField:`TaskColumns[${s-1}].visibleIndex`,label:{location:"top",text:"VisibleIndex"}}]});i.push({itemType:"group",caption:"Resources",colCount:4,items:[{dataField:"ResourcesTableName",label:{location:"top",text:"Table"},colSpan:2},{dataField:"ResourcesKeyField",label:{location:"top",text:"Key Field"}},{dataField:"ResourcesTextField",label:{location:"top",text:"Text Field"}}]}),i.push({itemType:"group",caption:"Resource Assignments",colCount:5,items:[{dataField:"ResourceAssignmentTableName",label:{location:"top",text:"Table"},colSpan:2},{dataField:"ResourceAssignmentKeyField",label:{location:"top",text:"Key Field"}},{dataField:"ResourceAssignmentTaskIdField",label:{location:"top",text:"Task Id Field"}},{dataField:"ResourceAssignmentResourceIdField",label:{location:"top",text:"Resource Id Field"}}]}),i.push({itemType:"group",caption:"Dependencies",colCount:6,items:[{dataField:"DependenciesTableName",label:{location:"top",text:"Table"},colSpan:2},{dataField:"DependenciesKeyField",label:{location:"top",text:"Key Field"}},{dataField:"DependenciesPredecessorIdField",label:{location:"top",text:"Predecessor Id Field"}},{dataField:"DependenciesSuccessorIdField",label:{location:"top",text:"Successor Id Field"}},{dataField:"DependenciesTypeField",label:{location:"top",text:"Dependency Type Field"}}]}),i.push({itemType:"button",buttonOptions:{text:"Save",onClick:()=>this.saveFormData(n).then(()=>window.location.reload())}}),i.push({itemType:"group",caption:"Appearance",colCount:5,items:[{dataField:"TaskTitlePosition",label:{location:"top"},editorType:"dxSelectBox",editorOptions:{items:["inside","outside","none"]}},{dataField:"ScaleType",label:{location:"top"},editorType:"dxSelectBox",editorOptions:{items:["auto","minutes","hours","days","weeks","months","quarters","years"]}},{dataField:"StartDateRange",label:{location:"top"},editorType:"dxDateBox",editorOptions:{showClearButton:!0}},{dataField:"EndDateRange",label:{location:"top"},editorType:"dxDateBox",editorOptions:{showClearButton:!0}},{itemType:"button",buttonOptions:{text:"Update",onClick:()=>{if(!this.chart)return;let s=n.option("formData");this.chart.beginUpdate(),this.chart.option({scaleType:s.ScaleType,taskTitlePosition:s.TaskTitlePosition,startDateRange:s.StartDateRange?new Date(s.StartDateRange):null,endDateRange:s.EndDateRange?new Date(s.EndDateRange):null}),this.chart.endUpdate(),this.chart.repaint(),this.saveFormData(n)}}}]});let n=$("<div />").css("padding",20).insertAfter(this.chartPositionMarker).dxForm({width:"100%",height:r?"calc(100% - 50px)":"calc(50% - 50px)",formData:t,scrollingEnabled:!0,items:i}).dxForm("instance")}saveFormData(t){let r=t.option("formData");return r.TaskColumns&&(r.TaskColumns=r.TaskColumns.filter(i=>!!i.dataField)),x(`${this.ganttReportControllerUrl}/UpdateGanttChartSettings`,"post",{id:this.reportParams.ReportId,settings:JSON.stringify(t.option("formData"))},!0,{dataType:"json"})}setupChart(t,r){let i=0,n=!1,s={};t.forEach(l=>{l.taskColumnType&&(s[l.taskColumnType]=l.dataField)}),t.filter(l=>l.visible).forEach(l=>{let g=parseInt(l.width);isNaN(g)?n=!0:i+=g}),this.chart=this.chartPositionMarker.dxGantt({width:"100%",height:this.hasForm?"50%":"calc(100% - 60px)",firstDayOfWeek:6,taskListWidth:!n&&i>0?i:void 0,toolbar:{items:["zoomIn","zoomOut","separator","taskDetails"]},editing:{enabled:!0},startDateRange:r.StartDateRange?new Date(r.StartDateRange):void 0,endDateRange:r.EndDateRange?new Date(r.EndDateRange):void 0,scaleType:r.ScaleType,taskTitlePosition:r.TaskTitlePosition,columns:t.filter(l=>l.visible).map(l=>({dataField:l.dataField,dataType:l.dataType,width:l.width,visibleIndex:l.visibleIndex,sortIndex:l.sortIndex,sortOrder:l.sortOrder&&(l.sortOrder==="asc"?"asc":"desc"),caption:l.caption||void 0})),tasks:{keyExpr:s[1],startExpr:s[3],endExpr:s[4],parentIdExpr:s[5],progressExpr:s[6],titleExpr:s[2]},dependencies:{keyExpr:r.DependenciesKeyField,predecessorIdExpr:r.DependenciesPredecessorIdField,successorIdExpr:r.DependenciesSuccessorIdField,typeExpr:r.DependenciesTypeField},resources:{keyExpr:r.ResourcesKeyField,textExpr:r.ResourcesTextField},resourceAssignments:{keyExpr:r.ResourceAssignmentKeyField,resourceIdExpr:r.ResourceAssignmentResourceIdField,taskIdExpr:r.ResourceAssignmentTaskIdField}}).dxGantt("instance"),this.addRefreshButton&&new ge($(".report-refresh-button"),()=>this.refresh())}updateData(t){!this.chart||(this.chart.option("tasks.dataSource",t.Tasks),this.chart.option("dependencies.dataSource",t.Dependencies),this.chart.option("resources.dataSource",t.Resources),this.chart.option("resourceAssignments.dataSource",t.ResourceAssignments))}refresh(){this.fetchData().then(t=>{this.updateData(t.Data)})}dispose(){var t;(t=this.chart)==null||t.dispose(),this.chart=null}getSessionKey(){return this.CHART_STORAGE_MODE_KEY+this.reportParams.ReportId}};var Jr="Switch to Designer",qr="Switch to Viewer",En="reportMode",Me="customCurrentUrl",Qt=window.ko,Xe=class{constructor(t){this.popover=null;this.$reportContainer=t.$reportContainer,this.reportParams=t.reportParams,this.allowEditing=t.allowEditing,this.designerModelUrl=t.designerModelUrl,this.reportId=t.reportParams.ReportId}init(){let t=window.sessionStorage.getItem(this.getSessionKey())||"Viewer",r=null;this.reportParams.Details&&(this.popover=ee(".report-details-link",this.reportParams.Details)),this.allowEditing&&(r=$(".switch-mode-btn").dxButton({text:t==="Viewer"?Jr:qr,onClick:()=>{t=t==="Viewer"?"Designer":"Viewer",window.sessionStorage.setItem(this.getSessionKey(),t),this.switchMode(t,r)}}).addClass("iszolea-md").dxButton("instance")),this.createReportDesigner(this.$reportContainer,this.designerModelUrl,"dxReportDesigner",this.reportParams.ReportId.toString(),i=>{setTimeout(()=>{this.updateSwitchModeButton(t,r)})},t==="Viewer"),window.addEventListener("beforeunload",i=>{dxReportDesigner&&dxReportDesigner.GetDesignerModel()&&dxReportDesigner.GetDesignerModel().isDirty&&(i.preventDefault(),i.returnValue="The report document is not saved. Are you sure you want to leave the page?")})}dispose(){var t;(t=this.popover)==null||t.dispose(),this.popover=null}refresh(){}initializePreview(t){let r=t.designerModel.reportPreviewModel.reportPreview,i=DevExpress.Reporting.Designer.Internal.ReportPreviewService;r.initialize(i.initializePreview(t.designerModel.model()))}switchMode(t,r){t==="Viewer"?(dxReportDesigner.designerModel.reportPreviewModel.reportPreview.previewVisible=!0,this.initializePreview(dxReportDesigner)):(dxReportDesigner.designerModel.reportPreviewModel.reportPreview.previewVisible=!1,dxReportDesigner.designerModel.reportPreviewModel.reportPreview.deactivate()),this.updateSwitchModeButton(t,r)}updateSwitchModeButton(t,r){r&&r.option("text",t==="Viewer"?Jr:qr)}createReportDesigner(t,r,i,n,s,l){let g=t.attr("data-bind","dxReportDesigner: designerOptions").addClass("report-designer"),p={reportUrl:n,requestOptions:{getDesignerModelAction:r},callbacks:{BeforeRender:h=>{window[i]=h,l&&(h.designerModel.reportPreviewModel.reportPreview.previewVisible=!0),s(h)},CustomizeMenuActions:this.CustomizeMenuActions,PreviewCustomizeMenuActions:this.PreviewCustomizeMenuActions,ReportOpened:(h,S)=>{l&&this.initializePreview(h),this.ReportOpened(h,S)},ReportTabClosed:this.ReportTabClosed}};return Qt.applyBindings({designerOptions:p},g[0]),g}PreviewCustomizeMenuActions(t,r){let i=r.GetById(DevExpress.Reporting.Viewer.ActionId.Design);i&&(i.visible=!1)}CustomizeMenuActions(t,r){let i=DevExpress.Reporting.Designer.Actions.ActionId,n=[i.Save],s=[i.NewReport,i.NewReportViaWizard,i.OpenReport,i.Preview,i.SaveAs,i.Exit];n.forEach(p=>{let h=r.GetById(p);h&&h.container==="menu"&&(h.container=void 0)}),s.forEach(p=>{let h=r.GetById(p);h&&(h.visible=!1)});let l=r.GetById(DevExpress.Reporting.Designer.Actions.ActionId.Save),g=l.clickAction;l.clickAction=()=>{t.GetCurrentTab().url(Qt.unwrap(t[Me])),g()}}ReportOpened(t,r){t[Me]=t[Me]||Qt.observable(),t[Me](r.Url)}ReportTabClosed(t,r){t[Me]=t[Me]||Qt.observable(),t[Me](null)}getSessionKey(){return En+this.reportId}};var Ze=class{constructor(t){this.SWITCH_TO_DESIGNER_TEXT="Switch to Designer";this.SWITCH_TO_VIEWER_TEXT="Switch to Viewer";this.DIAGRAM_STORAGE_MODE_KEY="DIAGRAM_STORAGE_MODE_KEY";this.$container=t.$container,this.reportParams=t.reportParams,this.allowEditing=t.allowEditing,this.addRefreshButton=t.addRefreshButton,this.diagramControllerUrl=t.diagramControllerUrl,this.mode=window.sessionStorage.getItem(this.getSessionKey())||"Viewer"}init(){this.createDiagramControl(),this.initDiagram(),this.allowEditing&&this.initSwitchModeButton(),this.reportParams.Details&&(this.popover=ee(".diagram-details-link",this.reportParams.Details))}dispose(){var t;this.diagram.dispose(),(t=this.popover)==null||t.dispose(),this.diagram=null}refresh(){this.diagram&&x(`${this.diagramControllerUrl}?id=${this.reportParams.ReportId}`,"get").then(t=>{this.diagram.import(JSON.stringify(t),!1),this.diagram.option("hasChanges",!1)})}createDiagramControl(){this.diagram=this.$container.dxDiagram({historyToolbar:{visible:!0,commands:["separator","undo","redo","separator",{name:"save",text:"Save",icon:"save"}]},onCustomCommand:t=>{switch(t.name){case"save":this.saveReport(t.component.export());break}},fullScreen:!1,readOnly:this.mode==="Viewer"}).dxDiagram("instance")}initDiagram(){x(`${this.diagramControllerUrl}?id=${this.reportParams.ReportId}`,"get").then(t=>{this.diagram.import(JSON.stringify(t)),this.diagram.option("hasChanges",!1)}),this.addRefreshButton&&(this.refreshButton=new ge($(".report-refresh-button"),()=>this.refresh())),window.addEventListener("beforeunload",t=>{this.diagram.option("hasChanges")&&(t.returnValue="The document is not saved. Are you sure you want to leave the page?")})}initSwitchModeButton(){let t=$(".switch-mode-btn").dxButton({text:this.mode==="Viewer"?this.SWITCH_TO_DESIGNER_TEXT:this.SWITCH_TO_VIEWER_TEXT,onClick:()=>{this.mode=this.mode==="Viewer"?"Designer":"Viewer",window.sessionStorage.setItem(this.getSessionKey(),this.mode),this.diagram.option("readOnly",this.mode==="Viewer"),t.option("text",this.mode==="Viewer"?this.SWITCH_TO_DESIGNER_TEXT:this.SWITCH_TO_VIEWER_TEXT)}}).addClass("iszolea-md").dxButton("instance")}async saveReport(t){let r=this.reportParams.ReportId;await x(this.diagramControllerUrl,"post",{id:r,source:t},!0),this.diagram.option("hasChanges",!1)}getSessionKey(){return this.DIAGRAM_STORAGE_MODE_KEY+this.reportParams.ReportId}};var Xt=class{constructor(t){this.reports=[];this.options=t.reportParams,this.$rootElement=t.$container,this.defaultReportSettings=t.defaultReportSettings}init(){this.renderContent()}dispose(){if(this.reports){for(this.reports.forEach(t=>{t.dispose()});this.reports.length;)this.reports.pop();this.reports=null}this.refreshTimer&&(this.refreshTimer.dispose(),this.refreshTimer=null)}refresh(){this.reports&&this.reports.forEach(t=>{t.refresh()})}renderContent(){let t=0,r=null,i=this.options.Reports.length,n=()=>{r=window.setTimeout(()=>{let g=t+1;g>=i&&(g=0),this.dxGallery.goToItem(g,!0)},this.options.DelaySec*1e3)},s=$("<div />").attr({class:"slideshow-report"}).appendTo(this.$rootElement),l=$("<div />",{class:"slideshow-report__gallery"}).dxGallery({loop:!1,dataSource:this.options.Reports,slideshowDelay:0,showNavButtons:!1,showIndicator:!0,stretchImages:!0,height:"100%",onInitialized:()=>n(),onSelectionChanged:g=>{t=g.component.option("selectedIndex"),window.clearTimeout(r),n()},itemTemplate:(g,p,h)=>{h.attr({class:"slideshow-report__gallery-item"}).height("100%");let S=$("<div />",{class:"slideshow-report__slide-content"}).height("100%"),E;window.setTimeout(()=>{switch(g.Type){case 1:let y=$("<div />",{class:"report-position"});y.appendTo(S),E=new qe(O(A({},this.defaultReportSettings[1]||{}),{$dashboardContainer:y,reportParams:g})),S.find("dashboard-title").hide(),S.find(".dx-dashboard-layout-container").css({top:0});break;case 0:let T=$("<div />",{class:"slideshow-report__grid-position"});S.addClass("iszolea-theme").addClass("panel-body"),T.appendTo(S),E=new Je(O(A({},this.defaultReportSettings[0]||{}),{gridPositionMarker:T,reportParams:g}));break;case 5:E=new Ae(O(A({},this.defaultReportSettings[5]||{}),{$container:S,reportParams:g}));break;case 3:let I=$("<div />",{class:"report-position"});I.appendTo(S),E=new Xe(O(A({},this.defaultReportSettings[3]||{}),{$reportContainer:I,reportParams:g}));break;case 4:let m=$("<div />",{class:"report-position"});m.appendTo(S),E=new Ze(O(A({},this.defaultReportSettings[4]||{}),{$container:m,reportParams:g}));break;case 7:let u=$("<div />",{class:"slideshow-report__grid-position"});S.addClass("iszolea-theme").addClass("panel-body"),u.appendTo(S),E=new Qe(O(A({},this.defaultReportSettings[7]||{}),{chartPositionMarker:u,reportParams:g}));break;case 2:case 6:break}E&&(E.init(),this.reports.push(E))},500),S.appendTo(h)}});this.dxGallery=l.dxGallery("instance"),l.appendTo(s),this.refreshTimer=new Ye({callback:()=>this.refresh(),elapsedCallback:g=>{}}),this.refreshTimer.start(this.options.RefreshSec*1e3)}};var Zt=class{constructor(t){this.STORAGE_MODE_KEY="CDM_STORAGE_MODE_KEY";this.SWITCH_TO_DESIGNER_TEXT="Switch to Designer";this.SWITCH_TO_VIEWER_TEXT="Switch to Viewer";this.options=t;let r=`/${t.baseUrl}/${t.reportParams.ReportId}`;this.getDataUrl=`${r}/Get`,this.getTableFieldsUrl=`${r}/Configurator/GetTableFieldList`,this.saveConfigurationUrl=`${r}/Configurator/Save`,this.getConfigurationUrl=`${r}/Configurator/Get`,this.mode=window.sessionStorage.getItem(this.getSessionKey())||"Viewer",this.loadPanel=$("<div />").dxLoadPanel({message:"Loading..."}).dxLoadPanel("instance"),$(document.body).append(this.loadPanel.element())}getSessionKey(){return this.STORAGE_MODE_KEY+this.options.reportParams.ReportId}renderContent(){this.options.$container.empty().removeAttr("style"),this.mode==="Viewer"?this.renderViewer():this.renderDesigner()}initSwitchModeButton(){let t=$(".switch-mode-btn").dxButton({text:this.mode==="Viewer"?this.SWITCH_TO_DESIGNER_TEXT:this.SWITCH_TO_VIEWER_TEXT,onClick:()=>{this.mode=this.mode==="Viewer"?"Designer":"Viewer",window.sessionStorage.setItem(this.getSessionKey(),this.mode),t.option("text",this.mode==="Viewer"?this.SWITCH_TO_DESIGNER_TEXT:this.SWITCH_TO_VIEWER_TEXT),this.renderContent()}}).addClass("iszolea-md").dxButton("instance")}initScheduler(){return this.options.$container.dxScheduler({height:"calc(100% - 49px)",editing:!1,firstDayOfWeek:1,startDayHour:8,endDayHour:18,views:["month","week","day"]}).dxScheduler("instance")}initForm(){return this.options.$container.dxForm({height:"100%",elementAttr:{style:"max-width: 400px; margin: 0 auto"},labelLocation:"top",items:[{itemType:"group",caption:"Fields mapping",items:[{dataField:"Title",editorType:"dxSelectBox",validationRules:[{type:"required"}],editorOptions:{}},{dataField:"StartDate",editorType:"dxSelectBox",validationRules:[{type:"required"}],editorOptions:{}},{dataField:"EndDate",editorType:"dxSelectBox",validationRules:[{type:"required"}],editorOptions:{}}]},{itemType:"group",caption:"View settings",items:[{dataField:"DefaultView",editorType:"dxSelectBox",editorOptions:{dataSource:["Month","Week","Day"]}}]},{itemType:"button",buttonOptions:{text:"Save",type:"default",onClick:()=>this.saveFormHandler()}}]}).dxForm("instance")}async renderViewer(){try{this.loadPanel.option("message","Loading..."),this.loadPanel.show(),this.scheduler=this.initScheduler(),this.scheduler.option("dataSource",[]);let t=await Promise.all([this.getConfiguration(),this.getDate()]),r=t[0],i=t[1];this.scheduler.option("dataSource",i),this.scheduler.option("currentView",((r==null?void 0:r.DefaultView)||"week").toLowerCase()),this.scheduler.option("currentDate",new Date)}finally{this.loadPanel.hide()}}async renderDesigner(){try{this.loadPanel.option("message","Loading..."),this.loadPanel.show(),this.form=this.initForm();let t=await Promise.all([this.getConfiguration(),this.getTableFields()]),r=t[0],i=t[1].map(s=>s.Name),n=t[1].filter(s=>s.Type==="datetime").map(s=>s.Name);this.form.option("formData",r),this.form.getEditor("Title").option("dataSource",i),this.form.getEditor("StartDate").option("dataSource",n),this.form.getEditor("EndDate").option("dataSource",n)}finally{this.loadPanel.hide()}}async saveFormHandler(){if(!!this.form.validate().isValid)try{let r=this.form.option("formData");this.loadPanel.option("message","Saving..."),this.loadPanel.show(),await x(this.saveConfigurationUrl,"POST",{data:r},!0)}finally{this.loadPanel.hide()}}async getConfiguration(){return await x(this.getConfigurationUrl)}async getTableFields(){return await x(this.getTableFieldsUrl)}async getDate(){return(await x(this.getDataUrl)).map(r=>O(A({},r),{startDate:new Date(r.startDate),endDate:new Date(r.endDate)}))}init(){this.options.allowEditing&&this.initSwitchModeButton(),this.renderContent()}refresh(){}dispose(){}};var Qr={config:k,Header:_e,Footer:Ve,NavigationMenu:Ne,UserMenu:De,MenuSwitcher:Le,data:lr,widgets:{notify:P,fullScreen:le,popup:no,confirm:Ro,landing:Mo,accessDenied:Oo,defaultGridObsolete:_r,defaultTreeList:xr,defaultGrid:V,defaultToolbar:vr,backgroundImageViewer:xt,imageCropDialog:_o,ImageManager:ke,DocumentManager:Ge,ImageGallery:$e},pages:{AccountSettingsPage:Ao},components:{CDM:Wo,SessionNotifier:zo,FileImporter:be,FileUploader:gt},styling:ro,helpers:po,utils:vo,reports:{CDMReportPage:Ae,DiagramReportPage:Ze,GridReportPage:Je,DashboardReportPage:qe,DXReportPage:Xe,SlideshowReportPage:Xt,GanttChartReportPage:Qe,SchedulerReportPage:Zt,gridColumnTypes:Be},business:{LicenceStatus:ot,MenuItemType:Ee,CdmImportFileMode:Fe,FooterIndicatorStatus:bo,GridDataColumnDataType:je}},Or=Qr;window.IszoleaUI=Qr;})();
|