@easydata/crud 1.4.11 → 1.4.13

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.
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see easydata.min.js.LICENSE.txt */
2
- window.easydata=function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=34)}([function(t,e,n){"use strict";n.r(e),n.d(e,"DataType",(function(){return r.a})),n.d(e,"EntityAttrKind",(function(){return i})),n.d(e,"EditorTag",(function(){return s})),n.d(e,"HttpMethod",(function(){return a.a})),n.d(e,"HttpRequest",(function(){return u.a})),n.d(e,"HttpResponseError",(function(){return l.b})),n.d(e,"HttpClient",(function(){return l.a})),n.d(e,"MetaData",(function(){return g})),n.d(e,"MetaEntity",(function(){return h})),n.d(e,"MetaEntityAttr",(function(){return p})),n.d(e,"ValueEditor",(function(){return f})),n.d(e,"AggregationSettings",(function(){return y})),n.d(e,"ColumnAlignment",(function(){return v.a})),n.d(e,"DataColumn",(function(){return v.b})),n.d(e,"DataColumnList",(function(){return v.c})),n.d(e,"DataRow",(function(){return b.a})),n.d(e,"EasyDataTable",(function(){return w.a})),n.d(e,"EventEmitter",(function(){return D})),n.d(e,"i18n",(function(){return c.a})),n.d(e,"EasyGuid",(function(){return C})),n.d(e,"repeatString",(function(){return T.b})),n.d(e,"reverseString",(function(){return T.c})),n.d(e,"strEndsWith",(function(){return T.d})),n.d(e,"combinePath",(function(){return T.a})),n.d(e,"utils",(function(){return d.a})),n.d(e,"liquid",(function(){return o}));var i,r=n(2);!function(t){t[t.Data=0]="Data",t[t.Virtual=1]="Virtual",t[t.Lookup=2]="Lookup"}(i||(i={}));var o,s={Unknown:"Unknown",Edit:"EDIT",DateTime:"DATETIME",List:"LIST",CustomList:"CUSTOMLIST",File:"FILE"},a=n(11),u=n(16),l=n(24),c=n(5),d=n(4),h=function(){function t(t){this.isEditable=!0,this.name="",this.caption="",this.description="",this.parent=t,this.attributes=new Array,this.subEntities=new Array}return t.prototype.loadFromData=function(t,e){if(e){if(this.id=e.id,this.name=e.name,this.captionPlural=e.namePlur,this.caption=e.name,this.description=e.desc,void 0!==e.ied&&(this.isEditable=e.ied),this.subEntities=new Array,e.ents)for(var n=0;n<e.ents.length;n++){var i=t.createEntity(this);i.loadFromData(t,e.ents[n]),this.subEntities.push(i)}if(this.attributes=new Array,e.attrs)for(n=0;n<e.attrs.length;n++){var r=t.createEntityAttr(this);r.loadFromData(t,e.attrs[n]),this.attributes.push(r)}}},t.prototype.scan=function(t,e){var n={stop:!1},i=function(r){if(e&&e(r,n),r.attributes)for(var o=r.attributes.length,s=0;s<o&&!n.stop;s++){var a=r.attributes[s];if(t&&t(a,n),n.stop)return}if(r.subEntities){var u=r.subEntities.length;for(s=0;s<u&&!n.stop;s++)i(r.subEntities[s])}};i(this)},t.prototype.getFirstPrimaryAttr=function(){return this.getPrimaryAttrs()[0]},t.prototype.getPrimaryAttrs=function(){return this.attributes.filter((function(t){return t.isPrimaryKey}))},t}(),p=function(){function t(t){this.id="",this.caption="{Unrecognized attribute}",this.dataType=r.a.String,this.size=0,this.isPrimaryKey=!1,this.isForeignKey=!1,this.isNullable=!0,this.showOnView=!0,this.isEditable=!0,this.showOnCreate=!0,this.showOnEdit=!0,this.showInLookup=!1,this.lookupAttr="",this.expr="",this.entity=t,this.kind=i.Data}return t.prototype.loadFromData=function(t,e){if(e){this.id=e.id,this.description=e.desc,this.caption=e.cptn,this.dataType=e.dtype,this.isPrimaryKey=e.ipk,this.isForeignKey=e.ifk,this.size=e.size,this.lookupAttr=e.lattr,this.lookupEntity=e.lent,this.dataAttr=e.dattr,this.lookupDataAttr=e.ldattr;var n=d.a.getDateDataTypes().indexOf(this.dataType);this.defaultValue=e.defVal&&n?new Date(e.defVal):e.defVal,this.isNullable=d.a.getIfDefined(e.nul,this.isNullable),this.isEditable=d.a.getIfDefined(e.ied,this.isEditable),this.showOnView=d.a.getIfDefined(e.ivis||e.sov,this.showOnView),this.showOnCreate=d.a.getIfDefined(e.soc,this.showOnCreate),this.showOnEdit=d.a.getIfDefined(e.soe,this.showOnEdit),this.showInLookup=d.a.getIfDefined(e.sil,this.showInLookup),this.kind=e.kind,this.displayFormat=e.dfmt,e.udata&&(this.userData=e.udata),e.edtr&&(this.defaultEditor=t.getEditorById(e.edtr)||t.createValueEditor())}},t}(),f=function(){function t(){this.id="",this.tag=s.Unknown,this.resType=r.a.Unknown,this.defValue=""}return t.prototype.loadFromData=function(t){t&&(this.id=t.id,this.tag=t.tag,this.defValue=t.defval,this.resType=t.rtype,this.accept=t.accept,this.multiline=t.multiline,t.subType&&(this.resType=t.subType),t.name&&(this.name=t.name),t.values&&(this.values=t.values))},t.prototype.getValueText=function(t){var e="";if(!this.values)return e;if(Array.isArray(t))for(var n=0,i=this.values;n<i.length;n++){var r=i[n];t.indexOf(r.id)>=0&&(e+=r.text+",")}else for(var o=0,s=this.values;o<s.length;o++){(r=s[o]).id===t&&(e+=r.text+",")}return e&&(e=e.substring(0,e.length-1)),e},t}(),g=function(){function t(){this.mainEntity=null,this.id="__none",this.name="Empty model",this.rootEntity=this.createEntity(),this.displayFormats=new Map}return t.prototype.getMainEntity=function(){return this.mainEntity},t.prototype.createEntity=function(t){return new h(t)},t.prototype.createEntityAttr=function(t){return new p(t)},t.prototype.createValueEditor=function(){return new f},t.prototype.loadFromJSON=function(t){var e=JSON.parse(t);this.loadFromData(e)},t.prototype.loadFromData=function(t){if(this.id=t.id,this.name=t.name,this.version=t.vers,this.editors=new Array,t.editors)for(var e=0;e<t.editors.length;e++){var n=this.createValueEditor();n.loadFromData(t.editors[e]),this.editors.push(n)}if(this.rootEntity.loadFromData(this,t.entroot),this.displayFormats=new Map,t.displayFormats)for(var i in t.displayFormats){var o=r.a[i],s=t.displayFormats[i]||new Array;this.displayFormats.set(o,s)}},t.prototype.getDisplayFormats=function(){return this.displayFormats},t.prototype.getDisplayFormatsForType=function(t){return this.displayFormats.has(t)?this.displayFormats.get(t):[]},t.prototype.getDefaultFormat=function(t){return this.displayFormats.has(t)?this.displayFormats.get(t).filter((function(t){return t.isdef}))[0]:null},t.prototype.setData=function(t){"string"==typeof t?this.loadFromJSON(t):this.loadFromData(t)},t.prototype.isEmpty=function(){return 0===this.rootEntity.subEntities.length&&0===this.rootEntity.attributes.length},t.prototype.getId=function(){return this.id},t.prototype.getName=function(){return this.name},t.prototype.getRootEntity=function(){return this.rootEntity},t.prototype.getEditorById=function(t){for(var e=0,n=this.editors;e<n.length;e++){var i=n[e];if(i.id===t)return i}return null},t.prototype.getAttributeById=function(t){var e=this.getEntityAttrById(this.getRootEntity(),t);return e||null},t.prototype.checkAttrProperty=function(t,e){var n=this.getAttributeById(t);if(n){if(void 0===n[e])throw"No such property: "+e;return!!n[e]||!!n.lookupAttr&&(t=n.lookupAttr,(n=this.getAttributeById(t))&&n[e])}return!1},t.prototype.getEntityAttrById=function(t,e){var n,i;if(t.attributes){var r=t.attributes.length;for(n=0;n<r;n++)if(t.attributes[n].id==e)return t.attributes[n]}if(t.subEntities){var o=t.subEntities.length;for(n=0;n<o;n++)if(i=this.getEntityAttrById(t.subEntities[n],e))return i}return null},t.prototype.listByEntityWithFilter=function(t,e){var n,i=new Array,r=null;if(t.subEntities)for(var o=t.subEntities.length,s=0;s<o;s++){if(r=t.subEntities[s],!e||e(r,null))(n=c.a.getText("Entities",r.name))||(n=r.caption),(h=d.a.assign(this.createEntity(),{id:r.name,text:n,items:[],isEntity:!0})).items=this.listByEntityWithFilter(r,e),h.items.length>0&&i.push(h)}var a=null;if(t.attributes)for(var u=t.attributes.length,l=0;l<u;l++)if(a=t.attributes[l],!e||e(t,a)){(n=c.a.getText("Attributes",a.id))||(n=a.caption);var h=d.a.assign(this.createEntity(),{id:a.id,text:n,dataType:a.dataType});i.push(h)}return i},t.prototype.listByEntity=function(t,e,n){e=e||{};var i,r=[],o=[],s=null;if(t.subEntities)for(var a=t.subEntities.length,u=0;u<a;u++)if(s=t.subEntities[u],!n||n(s,null)){i=c.a.getText("Entities",s.name)||s.caption;var l=d.a.assign(this.createEntity(),{id:s.name,text:i,items:[],isEntity:!0,description:s.description}),h=d.a.assign({},e);h.includeRootData=!1,l.items=this.listByEntity(s,h,n),l.items.length>0&&r.push(l)}var p=null;if(t.attributes)for(var f=t.attributes.length,g=0;g<f;g++)p=t.attributes[g],n&&!n(t,p)||(i=c.a.getText("Attributes",p.id)||p.caption,o.push(d.a.assign(this.createEntityAttr(t),{id:p.id,text:i,dataType:p.dataType,lookupAttr:p.lookupAttr,description:p.description})));var m,y=function(t,e){return t.text.toLowerCase()==e.text.toLowerCase()?0:t.text.toLowerCase()>e.text.toLowerCase()?1:-1};return e.sortEntities&&(r.sort(y),o.sort(y)),m=e.attrPlacement&&0!=e.attrPlacement?o.concat(r):r.concat(o),2==e.attrPlacement&&m.sort(y),e.includeRootData?((i=c.a.getText("Entities",t.name))||(i=t.caption),{id:t.name,text:i,items:m}):m},t.prototype.clear=function(){this.rootEntity=this.createEntity(),this.editors=[],this.version=""},t.prototype.addDefaultValueEditors=function(){this.addOrUpdateValueEditor("_DTE",s.Edit,r.a.String).defValue="",this.addOrUpdateValueEditor("_DPDE",s.DateTime,r.a.DateTime),this.addOrUpdateValueEditor("_DPTE",s.DateTime,r.a.DateTime)},t.prototype.addOrUpdateValueEditor=function(t,e,n){var i=d.a.findItemById(this.editors,t);return i||((i=this.createValueEditor()).id=t,this.editors.push(i)),i.tag=e,i.resType=n,i},t.prototype.getEntitiesTree=function(t,e){return this.listByEntity(this.getRootEntity(),t,e)},t.prototype.getEntitiesTreeWithFilter=function(t){return this.listByEntityWithFilter(this.getRootEntity(),t)},t.prototype.getFullEntityPathByAttr=function(t,e){return e=e||" ",this.getEntityPathByAttr(this.getRootEntity(),t,e,!0)},t.prototype.getEntityPathByAttr=function(t,e,n,i){if(!t)return"";n=n||" ";var r="";if(t.caption&&!i){var o=c.a.getText("Entities",t.caption);r=o||t.caption}if(t.attributes)for(var s=t.attributes.length,a=0;a<s;a++)if(t.attributes[a].id==e)return r;if(t.subEntities){var u=t.subEntities.length;for(a=0;a<u;a++){var l=t.subEntities[a],d=this.getEntityPathByAttr(l,e,n,!1);if(""!==d)return""!==r&&(d=r+n+d),d}}return""},t.prototype.getAttributeText=function(t,e){var n=c.a.getText("Attributes",t.id);if(n||(n=t.caption),!e)return n;var i=this.getFullEntityPathByAttr(t.id," ");return(i?e.replace(new RegExp("{attr}","g"),n).replace(new RegExp("{entity}","g"),i):n).trim()},t.prototype.runThroughEntities=function(t,e){this.getRootEntity().scan(t,e)},t.prototype.getFirstAttributeByFilter=function(t){var e=null;return this.runThroughEntities((function(n,i){t(n)&&(i.stop=!0,e=n)}),null),e},t}(),m=function(){return m=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},m.apply(this,arguments)},y=function(){function t(t){this.colStore=t,this.aggregates=[],this.groups=[],this.useGrandTotals=!1,this.useRecordCount=!1,this._caseSensitiveGroups=!1,this.COUNT_FIELD_NAME="GRPRECCNT"}return Object.defineProperty(t.prototype,"caseSensitiveGroups",{get:function(){return this._caseSensitiveGroups},set:function(t){this._caseSensitiveGroups=t,this.updateCompareProc()},enumerable:!0,configurable:!0}),t.prototype.updateCompareProc=function(){this.compareValues=this._caseSensitiveGroups?this.strictCompare:this.caseInsensitiveCompare},t.prototype.addGroup=function(t){var e=t.columns||this.colStore.getColumnIds(t.from,t.to);if(!this.colStore.validateColumns(e))throw"Invalid columns: "+e;if(this.hasColumnsInUse(e))throw"Can't add same columns to different groups/aggregates";return this.groups.push(m({columns:e},t)),this},t.prototype.addAggregateColumn=function(t,e){var n="string"==typeof t?t:this.colStore.getColumnIds(t,t)[0];if(this.hasColumnsInUse([n])||!this.colStore.validateAggregate(n,e))throw"Invalid aggregation function for the column: "+n;return this.aggregates.push({colId:n,funcId:e}),this},t.prototype.addGrandTotals=function(){return this.useGrandTotals=!0,this},t.prototype.addCounts=function(){return this.useRecordCount=!0,this},t.prototype.getGroups=function(){var t=this,e=[];return this.groups.map((function(n){return e=e.concat(n.columns),m(m({},n),{columns:Array.from(e),aggregates:Array.from(t.aggregates)})}))},t.prototype.getInternalGroups=function(){return this.groups},t.prototype.lastGroup=function(){var t=this.getGroups();return t[t.length-1]},t.prototype.getAggregates=function(){return this.aggregates},t.prototype.hasAggregates=function(){return this.aggregates.length>0},t.prototype.hasGroups=function(){return this.groups.length>0},t.prototype.hasGrandTotals=function(){return this.useGrandTotals},t.prototype.hasRecordCount=function(){return this.useRecordCount},t.prototype.isEmpty=function(){return!(this.hasAggregates()||this.hasGroups()||this.hasAggregates()||this.hasRecordCount())},t.prototype.drop=function(){console.warn('"drop()" method is obsolete. Use "clear()" instead'),this.clear()},t.prototype.clear=function(){return this.groups=[],this.aggregates=[],this.useGrandTotals=!1,this.useRecordCount=!1,this.caseSensitiveGroups=!1,this},t.prototype.hasColumnsInUse=function(t){for(var e=0,n=this.groups;e<n.length;e++){if(n[e].columns.filter((function(e){return t.indexOf(e)>=0})).length>0)return!0}for(var i=0,r=this.aggregates;i<r.length;i++){var o=r[i];if(t.indexOf(o.colId)>=0)return!0}return!1},t.prototype.needAggrCalculation=function(){return(this.hasAggregates()||this.hasRecordCount())&&(this.hasGrandTotals()||this.hasGroups())},t.prototype.saveToData=function(){return{groups:Array.from(this.groups),ugt:this.useGrandTotals,urc:this.useRecordCount,csg:this.caseSensitiveGroups,aggregates:Array.from(this.aggregates)}},t.prototype.loadFromData=function(t){t&&(void 0!==t.ugt&&(this.useGrandTotals=t.ugt),void 0!==t.urc&&(this.useRecordCount=t.urc),void 0!==t.csg&&(this.caseSensitiveGroups=t.csg),t.groups&&(this.groups=Array.from(t.groups)),t.aggregates&&(this.aggregates=Array.from(t.aggregates)))},t.prototype.buildGroupKey=function(t,e){var n=!this.caseSensitiveGroups,i={};if(t)for(var r=0,o=t.columns;r<o.length;r++){var s=o[r],a=e.getValue(s);n&&"string"==typeof a&&(a=a.toLowerCase()),i[s]=a}return i},t.prototype.strictCompare=function(t,e){return t===e},t.prototype.caseInsensitiveCompare=function(t,e){return("string"==typeof t?t.toLowerCase():t)===("string"==typeof e?e.toLowerCase():e)},t}(),v=n(17),b=n(15),w=n(28),C=function(){function t(){}return t.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))},t}(),D=function(){function t(t){this.silentMode=0,this.events=new Array,this.source=t}return t.prototype.subscribe=function(t,e){var n=this.getEventRecByType(t),i={id:C.newGuid(),callback:e};return n?n.eventCallbacks.push(i):(n={type:t,eventCallbacks:new Array(i)},this.events.push(n)),i.id},t.prototype.unsubscribe=function(t,e){var n=this.getEventRecByType(t);if(n){var i=-1;for(i=0;i<n.eventCallbacks.length&&n.eventCallbacks[i].id!==e;i++);i>=0&&n.eventCallbacks.splice(i,1)}},t.prototype.fire=function(t,e,n,i){if(void 0===n&&(n=0),void 0===i&&(i=!1),!this.silentMode||i){var r=this.getEventRecByType(t);if(r){var o={type:t,source:this.source,data:e},s=function(){for(var t=0,e=r.eventCallbacks;t<e.length;t++){e[t].callback(o)}};n>0?setTimeout(s,n):s()}}},t.prototype.enterSilentMode=function(){this.silentMode++},t.prototype.exitSilentMode=function(){this.silentMode&&this.silentMode--},t.prototype.isSilent=function(){return this.silentMode>0},t.prototype.getEventRecByType=function(t){for(var e=0,n=this.events;e<n.length;e++){var i=n[e];if(i.type==t)return i}return null},t}(),T=n(14);!function(t){t.renderLiquidTemplate=function(t,e){var n=t;if(e)for(var i in e){var r=new RegExp("{{"+i+"}}","g");n=n.replace(r,e[i])}return n}}(o||(o={})),c.a.resetLocales(),"function"!=typeof Object.values&&(Object.values=function(t){return Object.keys(t).map((function(e){return t[e]}))}),"function"!=typeof Math.trunc&&(Math.trunc=function(t){return isNaN(t)?NaN:t>0?Math.floor(t):Math.ceil(t)})},function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"d",(function(){return u})),n.d(e,"b",(function(){return l})),n.d(e,"c",(function(){return c})),n.d(e,"e",(function(){return d}));var i,r=n(19),o=(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},i(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var i=Array(t),r=0;for(e=0;e<n;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,r++)i[r]=o[s];return i},a=function(){function t(t,e){this.element="string"==typeof t?document.createElement(t):t,e&&this.element.parentElement!==e&&e.appendChild(this.element)}return t.prototype.addChild=function(t,e){var n=d(t,this.element);return e&&e(n),this},t.prototype.addChildElement=function(t){return t&&this.element.appendChild(t),this},t.prototype.attr=function(t,e){return this.element.setAttribute(t,e),this},t.prototype.id=function(t){return this.attr("id",t)},t.prototype.focus=function(){return this.element.focus(),this},t.prototype.title=function(t){return this.attr("title",t)},t.prototype.data=function(t,e){return void 0===e&&(e=null),null===e?(this.element.removeAttribute("data-"+t),this):this.attr("data-"+t,e)},t.prototype.show=function(){return this.removeStyle("display")},t.prototype.hide=function(t){return void 0===t&&(t=!0),t?this.setStyle("display","none"):this},t.prototype.visible=function(t){return void 0===t&&(t=!0),t?this.setStyle("visibility","visible"):this.setStyle("visibility","hidden")},t.prototype.isVisible=function(){return!!(this.element.offsetWidth||this.element.offsetHeight||this.element.getClientRects().length)},t.prototype.addClass=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t)for(var i=s(t.trim().split(" "),e),r=0;r<i.length;r++)this.element.classList.add(i[r]);return this},t.prototype.removeClass=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t)for(var i=s(t.trim().split(" "),e),r=0;r<i.length;r++)this.element.classList.remove(i[r]);return this},t.prototype.toggleClass=function(t,e){return void 0===e&&(e=void 0),t&&this.element.classList.toggle(t,e),this},t.prototype.on=function(t,e){for(var n=t.split(" "),i=0;i<n.length;i++)this.element.addEventListener(n[i],e);return this},t.prototype.off=function(t,e){for(var n=t.split(" "),i=0;i<n.length;i++)this.element.removeEventListener(n[i],e);return this},t.prototype.setStyle=function(t,e){return this.element.style.setProperty(t,e),this},t.prototype.removeStyle=function(t){return this.element.style.removeProperty(t),this},t.prototype.text=function(t){return this.element.innerText=t,this},t.prototype.html=function(t){return this.element.innerHTML=t,this},t.prototype.clear=function(){var t=this.element;this.element=document.createElement(this.element.tagName),t.replaceWith(this.element)},t.prototype.addText=function(t){var e=document.createTextNode(t);return this.element.appendChild(e),this},t.prototype.addHtml=function(t){return this.element.innerHTML+=t,this},t.prototype.toDOM=function(){return this.element},t.prototype.appendTo=function(t){return t&&t.appendChild(this.element),this},t}(),u=function(t){function e(e,n){return e?t.call(this,e,n)||this:t.call(this,"textarea",n)||this}return o(e,t),e.prototype.name=function(t){return this.element.name=t,this},e.prototype.rows=function(t){return this.element.rows=t,this},e.prototype.cols=function(t){return this.element.cols=t,this},e.prototype.value=function(t){return this.element.value=t,this},e}(a),l=function(t){function e(e,n){return e?t.call(this,e,n)||this:t.call(this,"input",n)||this}return o(e,t),e.prototype.name=function(t){return this.element.name=t,this},e.prototype.type=function(t){return this.element.type=t,this},e.prototype.size=function(t){return this.element.size=t,this},e.prototype.value=function(t){return t instanceof Date?this.element.valueAsDate=t:"number"==typeof t?this.element.valueAsNumber=t:this.element.value=t,this},e.prototype.mask=function(t){return Object(r.a)(this.element,t),this},e}(a),c=function(t){function e(e,n){return e?t.call(this,e,n)||this:t.call(this,"select",n)||this}return o(e,t),e.prototype.addOption=function(t){var e=document.createElement("option");return"string"==typeof t?(e.value=t,e.innerHTML=t):(e.value=t.value,e.innerHTML=t.title||t.value,e.selected=t.selected||!1),this.element.appendChild(e),this},e.prototype.value=function(t){return this.element.value=t,this},e}(a);function d(t,e){return"div"===t||t instanceof HTMLDivElement||"span"===t||t instanceof HTMLSpanElement||"a"===t||t instanceof HTMLAnchorElement||"button"===t||t instanceof HTMLButtonElement||"img"===t||t instanceof HTMLImageElement?new a(t,e):"input"===t||t instanceof HTMLInputElement?new l(t instanceof HTMLInputElement?t:null,e):"textarea"===t||t instanceof HTMLTextAreaElement?new u(t instanceof HTMLTextAreaElement?t:null,e):"select"===t||t instanceof HTMLSelectElement?new c(t instanceof HTMLSelectElement?t:null,e):new a(t,e)}},function(t,e,n){"use strict";var i;n.d(e,"a",(function(){return i})),function(t){t[t.Unknown=0]="Unknown",t[t.String=1]="String",t[t.Byte=2]="Byte",t[t.Word=3]="Word",t[t.Int32=4]="Int32",t[t.Int64=5]="Int64",t[t.Bool=6]="Bool",t[t.Float=7]="Float",t[t.Currency=8]="Currency",t[t.BCD=9]="BCD",t[t.Date=10]="Date",t[t.Time=11]="Time",t[t.DateTime=12]="DateTime",t[t.Autoinc=13]="Autoinc",t[t.Memo=14]="Memo",t[t.Blob=15]="Blob",t[t.FixedChar=16]="FixedChar",t[t.Guid=17]="Guid",t[t.Geometry=18]="Geometry",t[t.Geography=19]="Geography"}(i||(i={}))},function(t,e,n){"use strict";n.r(e),n.d(e,"EasyGrid",(function(){return r.a})),n.d(e,"AutoResizeColumns",(function(){return o.a})),n.d(e,"GridColumnAlign",(function(){return s.b})),n.d(e,"GridColumn",(function(){return s.a})),n.d(e,"GridColumnList",(function(){return s.c})),n.d(e,"DFMT_REGEX",(function(){return a.b})),n.d(e,"CellRendererType",(function(){return a.a})),n.d(e,"GridCellRendererStore",(function(){return a.c})),n.d(e,"Calendar",(function(){return u})),n.d(e,"DateTimePicker",(function(){return c})),n.d(e,"DefaultCalendar",(function(){return f})),n.d(e,"DefaultDateTimePicker",(function(){return b})),n.d(e,"DefaultTimePicker",(function(){return y})),n.d(e,"TimePicker",(function(){return g})),n.d(e,"browserUtils",(function(){return w.a})),n.d(e,"DomElementBuilder",(function(){return h.a})),n.d(e,"DomTextAreaElementBuilder",(function(){return h.d})),n.d(e,"DomInputElementBuilder",(function(){return h.b})),n.d(e,"DomSelectElementBuilder",(function(){return h.c})),n.d(e,"domel",(function(){return h.e})),n.d(e,"DropEffect",(function(){return C.b})),n.d(e,"EqDragEvent",(function(){return C.c})),n.d(e,"DragManager",(function(){return C.a})),n.d(e,"eqDragManager",(function(){return C.d})),n.d(e,"mask",(function(){return D.a})),n.d(e,"wrapInner",(function(){return l.q})),n.d(e,"addElement",(function(){return l.b})),n.d(e,"addCssClass",(function(){return l.a})),n.d(e,"hideElement",(function(){return l.k})),n.d(e,"showElement",(function(){return l.m})),n.d(e,"toggleVisibility",(function(){return l.p})),n.d(e,"isVisible",(function(){return l.l})),n.d(e,"createBrowserEvent",(function(){return l.c})),n.d(e,"getViewportSize",(function(){return l.i})),n.d(e,"getDocSize",(function(){return l.f})),n.d(e,"getScrollPos",(function(){return l.h})),n.d(e,"getElementAbsolutePos",(function(){return l.g})),n.d(e,"getWinSize",(function(){return l.j})),n.d(e,"slideDown",(function(){return l.n})),n.d(e,"slideUp",(function(){return l.o})),n.d(e,"eqCssPrefix",(function(){return l.e})),n.d(e,"eqCssMobile",(function(){return l.d})),n.d(e,"DefaultDialogService",(function(){return T.b})),n.d(e,"DefaultDialog",(function(){return T.a})),n.d(e,"DefaultProgressDialog",(function(){return T.d})),n.d(e,"DefaultDialogSet",(function(){return T.c})),n.d(e,"DialogFooterAlignment",(function(){return E.a})),n.d(e,"dialogs",(function(){return x}));var i,r=n(29),o=n(10),s=n(8),a=n(13),u=function(){function t(t,e){this.slot=t,this.options=e||{},this.options.yearRange||(this.options.yearRange="c-10:c+10")}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"kdtp-cal"},enumerable:!0,configurable:!0}),t.prototype.setDate=function(t){this.currentDate=new Date(t)},t.prototype.getDate=function(){return new Date(this.currentDate)},t.prototype.dateChanged=function(t){this.options.onDateChanged&&this.options.onDateChanged(this.currentDate,t)},t}(),l=n(6),c=function(){function t(t){this.calendar=null,this.timePicker=null,this.options=t,this.render()}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"kdtp"},enumerable:!0,configurable:!0}),t.prototype.setDateTime=function(t){this.currentDateTime=new Date(t),this.calendar&&this.calendar.setDate(this.currentDateTime),this.timePicker&&this.timePicker.setTime(this.currentDateTime)},t.prototype.getDateTime=function(){return new Date(this.currentDateTime)},t.prototype.render=function(){var t=this;this.options.showCalendar&&(this.calendar=this.createCalendar({yearRange:this.options.yearRange,showDateTimeInput:this.options.showDateTimeInput,timePickerIsUsed:this.options.showTimePicker,oneClickDateSelection:this.options.oneClickDateSelection,onDateChanged:function(e,n){t.currentDateTime=e,t.timePicker&&t.timePicker.setTime(t.currentDateTime),t.options.showTimePicker&&t.dateTimeChanged(),n&&t.apply(t.currentDateTime)}}),this.calendar&&this.calendar.render()),this.options.showTimePicker&&(this.timePicker=this.createTimePicker({onTimeChanged:function(e){t.currentDateTime.setHours(e.getHours()),t.currentDateTime.setMinutes(e.getMinutes()),t.calendar&&t.calendar.setDate(t.currentDateTime),t.dateTimeChanged()}}),this.timePicker&&this.timePicker.render()),this.setDateTime(new Date)},t.prototype.createCalendar=function(t){return null},t.prototype.createTimePicker=function(t){return null},t.prototype.show=function(t){this.options.beforeShow&&this.options.beforeShow();var e=Object(l.g)(t||document.body);this.slot.style.top=e.y+t.clientHeight+"px",this.slot.style.left=e.x+"px"},t.prototype.apply=function(t){this.options.onApply&&this.options.onApply(t),this.destroy()},t.prototype.cancel=function(){this.options.onCancel&&this.options.onCancel(),this.destroy()},t.prototype.destroy=function(){this.slot&&this.slot.parentElement&&this.slot.parentElement.removeChild(this.slot)},t.prototype.dateTimeChanged=function(){this.options.onDateTimeChanged&&this.options.onDateTimeChanged(this.currentDateTime)},t}(),d=n(0),h=n(1),p=(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},i(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),f=function(t){function e(e,n){var i=t.call(this,e,n)||this;i.daysOfWeek=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],i.months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],i.calendarBody=null,i.isManualInputChanging=!1;for(var r=0;r<i.daysOfWeek.length;r++)i.daysOfWeek[r]=d.i18n.getShortWeekDayName(r+1);for(r=0;r<i.months.length;r++)i.months[r]=d.i18n.getLongMonthName(r+1);return i}return p(e,t),e.prototype.setDate=function(e){t.prototype.setDate.call(this,e),this.selectedMonth=this.currentDate.getMonth(),this.selectedYear=this.currentDate.getFullYear(),this.rerenderMonth()},e.prototype.render=function(){var t=this,e=Object(h.e)("div",this.slot).addClass(this.cssPrefix+"-header");this.options.showDateTimeInput?e.addChildElement(this.renderManualDateInput()):e.addChild("span",(function(e){return t.headerTextElem=e.toDOM()})),Object(h.e)(this.slot).addChildElement(this.renderCalendarButtons()),this.calendarBody=Object(h.e)("div",this.slot).addClass(this.cssPrefix+"-body").toDOM()},e.prototype.getInputDateFormat=function(){var t=d.i18n.getLocaleSettings();return this.options.timePickerIsUsed?t.editDateFormat+" "+t.editTimeFormat:t.editDateFormat},e.prototype.renderManualDateInput=function(){var t=this,e=this.getInputDateFormat(),n=Object(h.e)("input").attr("placeholder",e).addClass(this.cssPrefix+"-header-input");return n.mask(e.replace("yyyy","9999").replace("MM","99").replace("dd","99").replace("HH","99").replace("mm","99").replace("ss","99")).on("input",(function(i){n.removeClass("error");try{t.isManualInputChanging=!0;var r=d.utils.strToDateTime(t.manualInputElem.value,e);t.currentDate=r,t.jump(t.currentDate.getFullYear(),t.currentDate.getMonth()),t.dateChanged(!1)}catch(t){n.addClass("error")}finally{t.isManualInputChanging=!1}})).on("keydown",(function(e){13===e.keyCode&&(e.preventDefault(),e.stopPropagation(),t.manualInputElem.className.indexOf("error")<0&&!t.isManualInputChanging&&t.dateChanged(!0))})).on("focus",(function(){setTimeout((function(){t.manualInputElem.selectionStart=0,t.manualInputElem.selectionEnd=0}),50)})),this.manualInputElem=n.toDOM(),this.manualInputElem},e.prototype.updateDisplayedDateValue=function(){if(this.manualInputElem){if(!this.isManualInputChanging){var t=this.getInputDateFormat();this.manualInputElem.value=d.utils.dateTimeToStr(this.currentDate,t),this.manualInputElem.focus()}}else if(this.headerTextElem){var e=d.i18n.getCurrentLocale();this.headerTextElem.innerText=this.currentDate.toLocaleString("en"==e?void 0:e,{year:"numeric",month:"long",day:"numeric"})}},e.prototype.renderCalendarButtons=function(){var t=this;return Object(h.e)("nav").addClass(this.cssPrefix+"-nav").addChild("div",(function(e){return e.addClass(t.cssPrefix+"-nav-prev").on("click",(function(){t.prev()})).addChild("span",(function(t){return t.html("&lsaquo;")}))})).addChild("div",(function(e){return e.addClass(t.cssPrefix+"-nav-selectors").addChild("div",(function(e){return e.addClass(t.cssPrefix+"-nav-month").addChild("select",(function(e){e.on("change",(function(){t.jump(t.selectedYear,parseInt(t.selectMonthElem.value))}));for(var n=function(n){e.addChild("option",(function(e){return e.attr("value",n.toString()).text(t.months[n])}))},i=0;i<t.months.length;i++)n(i);t.selectMonthElem=e.toDOM()}))})).addChild("div",(function(e){return e.addClass(t.cssPrefix+"-nav-year").addChild("select",(function(e){return t.selectYearElem=e.on("change",(function(){t.jump(parseInt(t.selectYearElem.value),t.selectedMonth)})).toDOM()}))}))})).addChild("div",(function(e){return e.addClass(t.cssPrefix+"-nav-next").on("click",(function(){t.next()})).addChild("span",(function(t){return t.html("&rsaquo;")}))})).toDOM()},e.prototype.prev=function(){this.selectedYear=0===this.selectedMonth?this.selectedYear-1:this.selectedYear,this.selectedMonth=0===this.selectedMonth?11:this.selectedMonth-1,this.rerenderMonth()},e.prototype.next=function(){this.selectedYear=11===this.selectedMonth?this.selectedYear+1:this.selectedYear,this.selectedMonth=(this.selectedMonth+1)%12,this.rerenderMonth()},e.prototype.rerenderSelectYear=function(){var t=/c-(\d*):c\+(\d*)/g.exec(this.options.yearRange),e=0,n=1;null!==t&&(e=parseInt(t[1]),n=parseInt(t[2])),this.selectYearElem.innerHTML="";for(var i=0;i<=e+n;i++){var r=document.createElement("option"),o=this.selectedYear-e+i;r.value=o.toString(),r.innerText=o.toString(),this.selectYearElem.appendChild(r)}},e.prototype.jump=function(t,e){this.selectedYear=t,this.selectedMonth=e,this.rerenderMonth()},e.prototype.rerenderMonth=function(){var t=this;this.updateDisplayedDateValue(),this.rerenderSelectYear();var e=new Date(this.selectedYear,this.selectedMonth).getDay(),n=new Date(this.selectedYear,this.selectedMonth+1,0).getDate();this.calendarBody.innerHTML="",this.selectYearElem.value=this.selectedYear.toString(),this.selectMonthElem.value=this.selectedMonth.toString(),this.daysOfWeek.forEach((function(e,n){Object(h.e)("div",t.calendarBody).addClass(t.cssPrefix+"-weekday").addClass(0==n||6==n?t.cssPrefix+"-weekend":"").text(e)}));for(var i=0;i<e;i++)Object(h.e)("div",this.calendarBody).addClass(this.cssPrefix+"-day-empty");for(var r=new Date,o=1;o<=n;o++){var s=Object(h.e)("div",this.calendarBody).addClass(this.cssPrefix+"-day").attr("data-date",o.toString()).text(o.toString()).on("click",(function(e){t.currentDate.setFullYear(t.selectedYear),t.currentDate.setMonth(t.selectedMonth),t.currentDate.setDate(parseInt(e.target.getAttribute("data-date"))),t.dateChanged(t.options.oneClickDateSelection)}));o===r.getDate()&&this.selectedYear===r.getFullYear()&&this.selectedMonth===r.getMonth()&&s.addClass(this.cssPrefix+"-day-current"),o===this.currentDate.getDate()&&this.selectedYear===this.currentDate.getFullYear()&&this.selectedMonth===this.currentDate.getMonth()&&s.addClass(this.cssPrefix+"-day-selected");var a=(e+o-1)%7;0!=a&&6!=a||s.addClass(this.cssPrefix+"-weekend")}var u=(e+n)%7,l=0==u?0:7-u;for(i=0;i<l;i++)Object(h.e)("div",this.calendarBody).addClass(this.cssPrefix+"-day-empty")},e.prototype.dateChanged=function(e){t.prototype.dateChanged.call(this,e),this.rerenderMonth()},e}(u),g=function(){function t(t,e){this.slot=t,this.options=e||{}}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"kdtp-tp"},enumerable:!0,configurable:!0}),t.prototype.setTime=function(t){this.currentTime=new Date(t)},t.prototype.getTime=function(){return new Date(this.currentTime)},t.prototype.timeChanged=function(){this.options.onTimeChanged&&this.options.onTimeChanged(this.currentTime)},t}(),m=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.prototype.setTime=function(e){t.prototype.setTime.call(this,e),this.updateDisplayedTime(),this.hoursInput.valueAsNumber=e.getHours(),this.minutesInput.valueAsNumber=e.getMinutes()},e.prototype.render=function(){var t=this;Object(h.e)("div",this.slot).addClass(this.cssPrefix+"-time").addChild("span",(function(e){return t.timeText=e.toDOM()})).toDOM();var e=Object(h.e)("div",this.slot).addClass(this.cssPrefix+"-sliders");return e.addChild("div",(function(e){return e.addClass(t.cssPrefix+"-time-row").title("Hours").addChild("input",(function(e){return t.hoursInput=e.addClass(t.cssPrefix+"-input-hours").type("range").attr("min","0").attr("max","23").attr("step","1").on("input",(function(e){t.currentTime.setHours(t.hoursInput.valueAsNumber),t.updateDisplayedTime(),t.timeChanged()})).toDOM()}))})),e.addChild("div",(function(e){return e.addClass(t.cssPrefix+"-time-row").title("Minutes").addChild("input",(function(e){return t.minutesInput=e.addClass(t.cssPrefix+"-input-minutes").type("range").attr("min","0").attr("max","59").attr("step","1").on("input",(function(e){t.currentTime.setMinutes(t.minutesInput.valueAsNumber),t.updateDisplayedTime(),t.timeChanged()})).toDOM()}))})),this.slot},e.prototype.updateDisplayedTime=function(){var t=d.i18n.getCurrentLocale(),e=this.currentTime.toLocaleString("en"==t?void 0:t,{hour:"numeric",minute:"numeric"});this.timeText.innerText=e},e}(g),v=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.prototype.render=function(){var e=this,n=Object(h.e)("div",document.body).addClass(""+this.cssPrefix).attr("tabIndex","0").setStyle("position","absolute").setStyle("top","-1000px").setStyle("left","-1000px").on("keydown",(function(t){return 27===t.keyCode?e.cancel():13===t.keyCode&&e.apply(e.getDateTime()),!1}));this.options.zIndex&&n.setStyle("z-index",""+this.options.zIndex),this.slot=n.toDOM(),t.prototype.render.call(this),this.renderButtons(),this.globalMouseDownHandler=function(t){var n=window.event||t;n.srcElement||n.target;return!e.slot.contains(n.target)&&(document.removeEventListener("mousedown",e.globalMouseDownHandler,!0),e.cancel()),!0}},e.prototype.renderButtons=function(){var t=this,e=Object(h.e)("div",this.slot).addClass(this.cssPrefix+"-buttons").addChild("button",(function(e){return t.nowButton=e.addClass(t.cssPrefix+"-button "+t.cssPrefix+"-button-now").text(d.i18n.getText("ButtonNow")).on("click",(function(){return t.setDateTime(new Date),t.dateTimeChanged(),!1})).toDOM()}));!this.options.showTimePicker&&this.options.oneClickDateSelection||e.addChild("button",(function(e){return t.submitButton=e.addClass(t.cssPrefix+"-button "+t.cssPrefix+"-button-apply").text(d.i18n.getText("ButtonApply")).on("click",(function(){return t.apply(t.getDateTime()),!1})).toDOM()})),e.addChild("button",(function(e){return t.submitButton=e.addClass(t.cssPrefix+"-button "+t.cssPrefix+"-button-cancel").text(d.i18n.getText("ButtonCancel")).on("click",(function(){return t.cancel(),!1})).toDOM()}))},e.prototype.createCalendar=function(t){return this.calendarSlot=Object(h.e)("div",this.slot).addClass(this.cssPrefix+"-cal").toDOM(),new f(this.calendarSlot,t)},e.prototype.createTimePicker=function(t){return this.timePickerSlot=Object(h.e)("div",this.slot).addClass(this.cssPrefix+"-tp").toDOM(),new y(this.timePickerSlot,t)},e.prototype.show=function(e){var n=this;if(this.options.showDateTimeInput){this.options.beforeShow&&this.options.beforeShow();var i=Object(l.g)(e||document.body),r=Object(l.g)(e?e.parentElement||e:document.body);this.slot.style.top=r.y+"px",this.slot.style.left=i.x+"px"}else t.prototype.show.call(this,e),this.slot.focus();setTimeout((function(){document.addEventListener("mousedown",n.globalMouseDownHandler,!0)}),1)},e}(c),w=n(18),C=n(12),D=n(19),T=n(20),E=n(21);d.i18n.updateDefaultTexts({GridPageInfo:"{FirstPageRecordNum} - {LastPageRecordNum} of {Total} records",GridItemsPerPage:"items per page",ButtonOK:"OK",ButtonCancel:"Cancel",ButtonApply:"Apply",ButtonNow:"Now",LblTotal:"Total"});var x=new T.b},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i,r=n(14),o=n(2),s=n(5);!function(t){t.getAllDataTypes=function(){return Object.values(o.a).filter((function(t){return"number"==typeof t}))},t.getDateDataTypes=function(){return[o.a.Time,o.a.Date,o.a.DateTime]},t.getStringDataTypes=function(){return[o.a.String,o.a.Memo,o.a.FixedChar]};var e=[o.a.Byte,o.a.Word,o.a.Int32,o.a.Int64,o.a.Float,o.a.Currency,o.a.Autoinc];t.getNumericDataTypes=function(){return e};var n=[o.a.Byte,o.a.Word,o.a.Int32,o.a.Int64,o.a.Autoinc];function i(t,e,n){e||(e={});for(var r=0,o=n;r<o.length;r++){var s=o[r];if(s)for(var u in s)if(s.hasOwnProperty(u)){var l=s[u];null!==l&&"object"==typeof l?t.has(l)?e[u]=t.get(l):Array.isArray(l)?(e[u]=a(l),t.set(l,e[u])):(void 0!==e[u]&&null!=e[u]||(e[u]=Object.create(Object.getPrototypeOf(l))),t.set(l,e[u]),i(t,e[u],[l])):e[u]=l}}return e}function a(t){for(var e=[],n=0,i=t;n<i.length;n++){var r=i[n];e.push(r)}return e}t.assign=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var i=0;i<e.length;i++){var r=e[i];if(r)for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])}return t},t.assignDeep=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return i(new WeakMap,t,e)},t.getIfDefined=function(t,e){return void 0!==t?t:e},t.IsDefinedAndNotNull=function(t){return null!=t},t.copyArrayTo=function(t,e){for(var n=t.length,i=e.length,r=0;r<n&&r<i;r++)e[r]=t[r]},t.createArrayFrom=a,t.findItemById=function(t,e){for(var n=t.length,i=0;i<n;i++)if(t[i].id===e)return t[i];return null},t.findItemIndexById=function(t,e){for(var n=t.length,i=0;i<n;i++)if(t[i].id===e)return i;return-1},t.indexOfArrayItem=function(t,e){if(t.indexOf)return t.indexOf(e);for(var n=t.length,i=0;i<n;i++)if(e==t[i])return i;return-1},t.moveArrayItem=function(t,e,n){if(e>=t.length)throw"Index out of bounds: "+e;n>=t.length&&(n=t.length-1);var i=t.splice(e,1)[0];t.splice(n,0,i)},t.removeArrayItem=function(t,e){var n=t.indexOf(e);if(-1!=n)return t.splice(n,1)[0]},t.insertArrayItem=function(t,e,n){t.splice(e,0,n)},t.fillArray=function(t,e,n,i){void 0===n&&(n=0);for(var r=t.length>>>0,o=n>>0,s=o<0?Math.max(r+o,0):Math.min(o,r),a=void 0===i?r:i>>0,u=a<0?Math.max(r+a,0):Math.min(a,r);s<u;)t[s]=e,s++;return t},t.shiftToFitWindow=function(t,e){var n=document.getElementsByTagName("body")[0],i=window.innerWidth||document.documentElement.clientWidth||n.clientWidth,r=t+e,o=0;return r>i&&t+(o=i-r-10)<0&&(o=10-t),o},t.isObject=function(t){return null!==t&&("function"==typeof t||"object"==typeof t)},t.isNumericType=function(t){return e.indexOf(t)>=0},t.isIntType=function(t){return n.indexOf(t)>=0},t.isNumeric=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},t.areCompatibleDataTypes=function(t,e){return void 0===t||void 0===e||t==o.a.Unknown||e==o.a.Unknown||t==e||t==o.a.Date&&e==o.a.DateTime||t==o.a.DateTime&&e==o.a.Date},t.isPropSet=function(t,e){return t[e]||t[e.toLowerCase()]||t[e.toUpperCase()]};var u="0123456789abcdefghijklmnopqrstuvwxyz";function l(t,e){var n=t.length;if(n>e){var i=n/e,r="";r+=t[0];for(var o=i,s=void 0,a=1;a<n;a++)s=t[a],a+1>o&&(r+=s,o+=i);return r}return t}function c(t,e,n){return t.substr(0,e)+n+t.substr(e+n.length)}function d(t,e){return Math.floor(Math.random()*(e-t))+t}function h(t){var e=parseInt(t);if(isNaN(e))throw'"'+t+'" is not a valid number';return e}t.generateId=function(t){t||(t="easy");var e=t.length>4?function(t,e){var n=t.split("-"),i=1,r=e;n.length<e&&(i=e/n.length,r=n.length);for(var o="",s=0;s<r;s++)o+=l(n[s],i);return o}(t,4):t;e&&e.length>0&&(e+="-");var n=r.b("",2),i=u.length-1;return n=c(n,0,u[d(0,i)]),e+(n=c(n,1,u[d(0,i)]))+function(t){var e=36,n=14,i=r.b("",n),o=t;do{i=c(i,n--,u[o%e]),o=Math.floor(o/=e)}while(o>0);return r.c(i.trim())}(621355968e9+1e4*(new Date).getTime()-0x8d60e562e627800)},t.strToDateTime=function(t,e){if(!t||0==t.length)return new Date;var n=t.replace(/[^a-zA-Z0-9_]/g,"-"),i=e.replace(/[^a-zA-Z0-9_]/g,"-").split("-"),r=n.split("-"),o=i.indexOf("MM"),s=i.indexOf("dd"),a=i.indexOf("yyyy"),u=i.indexOf("HH"),l=i.indexOf("mm"),c=i.indexOf("ss"),d=new Date;try{var p=a>-1&&a<r.length?h(r[a]):d.getFullYear(),f=o>-1&&o<r.length?h(r[o])-1:d.getMonth()-1;if(f>11)throw"";var g=s>-1&&s<r.length?h(r[s]):d.getDate();if(g>function(t,e){return new Date(e,t+1,0).getDate()}(f,p))throw"";var m=u>-1&&u<r.length?h(r[u]):0;if(m>23)throw"";var y=l>-1&&l<r.length?h(r[l]):0;if(y>59)throw"";var v=c>-1&&c<r.length?h(r[c]):0;if(v>59)throw"";return new Date(p,f,g,m,y,v)}catch(e){throw t+" is not a valid date."}},t.strToTime=function(t){var e=t.split(":");try{var n=e.length>0?h(e[0]):0;if(n>23)throw"";var i=e.length>1?h(e[1]):0;if(i>59)throw"";var r=e.length>1?h(e[1]):0;if(r>59)throw"";return new Date(0,0,0,n,i,r)}catch(e){throw t+" is not a valid time."}};var p=/\[([^\]]+)]|y{2,4}|M{1,4}|d{1,2}|H{1,2}|h{1,2}|m{2}|s{2}|t{2}/g;t.dateTimeToStr=function(t,e){var n=t.getFullYear().toString(),i=t.getMonth()+1,r=t.getDate(),o=t.getHours(),a=t.getMinutes(),u=t.getSeconds(),l=o%12||12,c=o>11,d={yyyy:n,yy:n.substring(n.length-2),MMMM:s.a.getLongMonthName(i),MMM:s.a.getShortMonthName(i),MM:i<10?"0"+i:i.toString(),M:i.toString(),dd:r<10?"0"+r:r.toString(),d:r.toString(),HH:o<10?"0"+o:o.toString(),H:o.toString(),hh:l<10?"0"+l:l.toString(),h:l.toString(),tt:c?"PM":"AM",mm:a<10?"0"+a:a.toString(),ss:u<10?"0"+u:u.toString()};return e.replace(p,(function(t,e){return e||d[t]}))},t.numberToStr=function(t,e){return e=e||s.a.getLocaleSettings().decimalSeparator,t.toString().replace(".",e)}}(i||(i={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i,r=n(2),o=n(4);!function(t){var e,n={shortDateFormat:"MM/dd/yyyy",longDateFormat:"dd MMM, yyyy",editDateFormat:"MM/dd/yyyy",shortTimeFormat:"HH:mm",editTimeFormat:"HH:mm",longTimeFormat:"HH:mm:ss",shortMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longMonthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],shortWeekDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longWeekDayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],decimalSeparator:".",currency:"USD"},i={localeId:"en-US",englishName:"English",displayName:"English",texts:{ButtonOK:"OK",ButtonCancel:"Cancel",Yes:"Yes",No:"No",True:"True",False:"False"},settings:n},s={"en-US":i},a=[];function u(t){for(var e=0,n=a;e<n.length;e++){(0,n[e])(t)}}function l(){return e.localeId}function c(t){var n=s[t];n?o.a.assignDeep(e,n):(e.englishName=t,e.displayName=t,e.texts=o.a.assignDeep({},i.texts)),e.localeId=t}function d(){return e.settings}function h(t){e.settings||(e.settings=o.a.assignDeep({},n)),e.settings=o.a.assignDeep(e.settings,t)}function p(t,n){u(n);var r=e;t&&(n.localeId||(n.localeId=t),(r=s[t])||(r=o.a.assignDeep({},i),s[t]=r)),o.a.assignDeep(r,n)}function f(){var t,n,i,r,o,s,a="object"==typeof navigator?navigator.language:void 0;t=a,n=new Date(2020,5,7,19,34,56,88),i=n.toLocaleDateString(t,{year:"numeric",month:"numeric",day:"numeric"}),r=n.toLocaleTimeString(t,{hour:"numeric",minute:"numeric",second:"numeric"}),o=i.replace("07","dd").replace("7","d").replace("06","MM").replace("6","M").replace("2020","yyyy").replace("20","yy"),s=r.replace("19","HH").replace("07","hh").replace("7","h").replace("34","mm").replace("56","ss").replace("PM","tt"),e.settings||(e.settings={}),h({shortDateFormat:o,shortTimeFormat:s})}function g(t){var e,n=d();switch(t){case r.a.Date:e=n.shortDateFormat;break;case r.a.Time:e=n.shortTimeFormat;break;default:e=n.shortDateFormat+" "+n.shortTimeFormat}return e}function m(t){var e,n=d();switch(t){case r.a.Date:e=n.longDateFormat;break;case r.a.Time:e=n.longTimeFormat;break;default:e=n.longDateFormat+" "+n.longTimeFormat}return e}t.addMapper=function(t){a.push(t)},t.getLocales=function(){var t=[];for(var e in s)t.push({locale:e,englishName:s[e].englishName,displayName:s[e].displayName});return t.sort((function(t,e){return t.englishName>e.englishName?1:t.englishName===e.englishName?0:-1}))},t.getCurrentLocale=l,t.setLocale=function(t){console.warn("This method is deprecated. Use setCurrentLocale instead"),c(t)},t.setCurrentLocale=c,t.getText=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=e.texts,r="";if(t&&t.length)for(var o=t.length,s=0;s<o&&"object"==typeof(r=i[t[s]]);s++)i=r;return r},t.getLocaleSettings=d,t.getOneLocaleSetting=function(t){return e.settings[t]},t.getShortMonthName=function(t){var e=d();if(t>0&&t<13)return e.shortMonthNames[t-1];throw"Wrong month number: "+t},t.getLongMonthName=function(t){var e=d();if(t>0&&t<13)return e.longMonthNames[t-1];throw"Wrong month number: "+t},t.getShortWeekDayName=function(t){var e=d();if(t>0&&t<8)return e.shortWeekDayNames.length>=t?e.shortWeekDayNames[t-1]:t.toString();throw"Wrong month number: "+t},t.getLongWeekDayName=function(t){var e=d();if(t>0&&t<8)return e.longWeekDayNames.length>=t?e.longWeekDayNames[t-1]:t.toString();throw"Wrong month number: "+t},t.updateLocaleSettings=h,t.updateLocaleTexts=function(t){"object"==typeof t?(u({localeId:e.localeId,texts:t}),o.a.assignDeep(e.texts,t)):console.error("Wrong parameter type in updateLocaleTexts function call.The first parameter (localeId) is not necessary. Use updateLocaleTexts(texts) instead")},t.updateDefaultTexts=function(t){for(var n in s){var i=s[n];i.texts=o.a.assignDeep({},t,i.texts)}e.texts=o.a.assignDeep({},t,e.texts)},t.updateLocaleInfo=p,t.addLocale=function(t,e){p(t,e)},t.resetLocales=function(){e||(e=o.a.assignDeep({},i),f())},t.dateTimeToStr=function(t,e,n){return n?"d"==n?n=g(r.a.Date):"D"==n?n=m(r.a.Date):"f"==n?n=g(r.a.DateTime):"F"==n&&(n=m(r.a.DateTime)):n=g(e),o.a.dateTimeToStr(t,n)},t.numberToStr=function(e,n){if(n&&n.length>0){var i=n.charAt(0).toUpperCase();if("S"===i)return function(e,n){if(!y[n]){var i=n.split("|").filter((function(t){return t.length>0})).map((function(t){return t.split("=")}));if(y[n]={},i.length>0)if(i[0].length>1)for(var r=0,o=i;r<o.length;r++){var s=o[r];y[n][Number.parseInt(s[1])]=s[0]}else i.forEach((function(t,e){y[n][e]=t[0]}))}var a=y[n];if(void 0!==a[e]){s=a[e];return t.getText(s)||s}return e.toString()}(e,n.slice(1));if(["D","F","C"].indexOf(i)>=0){var r=l();return e.toLocaleString(r,function(t){var e=d(),n=t[0].toUpperCase(),i=t.length>1?Number.parseInt(t.slice(1)):"D"==n?1:2;switch(n){case"D":return{style:"decimal",useGrouping:!1,minimumIntegerDigits:i};case"C":return{style:"currency",currency:e.currency,minimumFractionDigits:i};default:return{style:"decimal",minimumFractionDigits:i,maximumFractionDigits:i}}}(n))}return function(t,e){for(var n=t.toString(),i="",r=n.length-1,o=e.length-1;o>=0;o--){var s=e.charAt(o);"#"===s||"0"===s?r>=0?(i+=n.charAt(r),r--):"0"===s&&(i+=0):i+=s}return i.split("").reverse().join("")}(Math.trunc(e),n)}var s=d();return o.a.numberToStr(e,s.decimalSeparator)},t.booleanToStr=function(e,n){if(n&&n.length>0&&"S"===n.charAt(0).toUpperCase()){var i=n.slice(1).split("|");if(i.length>1){var r=i[e?1:0];return t.getText(r)||r}}return""+e};var y={}}(i||(i={}))},function(t,e,n){"use strict";n.d(e,"q",(function(){return r})),n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return s})),n.d(e,"k",(function(){return a})),n.d(e,"m",(function(){return u})),n.d(e,"p",(function(){return l})),n.d(e,"l",(function(){return c})),n.d(e,"c",(function(){return d})),n.d(e,"i",(function(){return h})),n.d(e,"f",(function(){return p})),n.d(e,"h",(function(){return f})),n.d(e,"g",(function(){return g})),n.d(e,"j",(function(){return m})),n.d(e,"n",(function(){return y})),n.d(e,"o",(function(){return v})),n.d(e,"e",(function(){return b})),n.d(e,"d",(function(){return w}));var i=n(18);function r(t,e){for(t.appendChild(e);t.firstChild!==e;)e.appendChild(t.firstChild)}function o(t,e,n){var i=document.createElement(e),r=n||{};return r.cssClass&&(i.className=r.cssClass),t.appendChild(i),i}function s(t,e){t.className=t.className?t.className+" "+e:e}function a(t){t.style.display="none"}function u(t,e){e||(e=""),t.style.display=e}function l(t,e,n){n||(n={}),n.display||(n.display=""),n.duration||(n.duration=200),a(t),u(e,n.display),n.complete&&n.complete()}function c(t){return"none"!=t.style.display&&0!=t.offsetWidth&&0!=t.offsetHeight}function d(t){var e;return"function"==typeof Event?e=new Event(t):(e=document.createEvent("Event")).initEvent(t,!0,!0),e}function h(){return{width:Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),height:Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)}}function p(){return i.a.IsIE()?m():{width:Math.max(document.documentElement.clientWidth,document.body.clientWidth||0),height:Math.max(document.documentElement.clientHeight,document.body.clientHeight||0)}}function f(){var t=document.body,e=document.documentElement;return{top:window.pageYOffset||e.scrollTop||t.scrollTop,left:window.pageXOffset||e.scrollLeft||t.scrollLeft}}function g(t){var e={x:0,y:0};if(null!==t){var n=function(t){var e,n={top:0,right:0,bottom:0,left:0,width:0,height:0};try{e=t.getBoundingClientRect()}catch(t){e=n}var i=document.body,r=document.documentElement,o=f(),s=o.top,a=o.left,u=r.clientTop||i.clientTop||0,l=r.clientLeft||i.clientLeft||0,c=e.top+s-u,d=e.left+a-l;return{top:Math.round(c),left:Math.round(d)}}(t);e={x:n.left,y:n.top}}return e}function m(){return{width:window.innerWidth,height:window.innerHeight}}function y(t,e,n){t.style.removeProperty("display");var i=window.getComputedStyle(t).display;"none"===i&&(i="block"),t.style.display=i;var r=t.offsetHeight;t.style.overflow="hidden",t.style.height="0px",t.style.paddingTop="0px",t.style.paddingBottom="0px",t.style.marginTop="0px",t.style.marginBottom="0px",t.offsetHeight,t.style.boxSizing="border-box",t.style.transitionProperty="height, margin, padding",t.style.transitionDuration=e+"ms",t.style.height=r+"px",t.style.removeProperty("padding-top"),t.style.removeProperty("padding-bottom"),t.style.removeProperty("margin-top"),t.style.removeProperty("margin-bottom"),window.setTimeout((function(){t.style.removeProperty("height"),t.style.removeProperty("overflow"),t.style.removeProperty("transition-duration"),t.style.removeProperty("transition-property"),t.style.removeProperty("box-sizing"),n&&n()}),e)}function v(t,e,n){t.style.transitionProperty="height, margin, padding",t.style.transitionDuration=e+"ms",t.style.boxSizing="border-box",t.style.height=t.offsetHeight+"px",t.offsetHeight,t.style.overflow="hidden",t.style.height="0px",t.style.paddingTop="0px",t.style.paddingBottom="0px",t.style.marginTop="0px",t.style.marginBottom="0px",window.setTimeout((function(){t.style.display="none",t.style.removeProperty("height"),t.style.removeProperty("padding-top"),t.style.removeProperty("padding-bottom"),t.style.removeProperty("margin-top"),t.style.removeProperty("margin-bottom"),t.style.removeProperty("overflow"),t.style.removeProperty("transition-duration"),t.style.removeProperty("transition-property"),t.style.removeProperty("box-sizing"),n&&n()}),e)}var b="eqjs",w="eqjs-mobile"},function(t,e,n){"use strict";n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return a})),n.d(e,"c",(function(){return u}));var i=n(0),r="yyyy-MM-dd",o="HH:mm",s=function(t){return t==i.DataType.Date?r:t==i.DataType.Time?o:r+"T"+o},a=function(t){var e=i.i18n.getLocaleSettings();return t==i.DataType.Date?e.editDateFormat:t==i.DataType.Time?e.editTimeFormat:e.editDateFormat+" "+e.editTimeFormat},u=function(t){var e=window.history.state;history.pushState(e,document.title,t),window.dispatchEvent(new Event("ed_set_location"))}},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return s})),n.d(e,"c",(function(){return a}));var i,r=n(0),o=n(13);!function(t){t[t.NONE=1]="NONE",t[t.LEFT=2]="LEFT",t[t.CENTER=3]="CENTER",t[t.RIGHT=4]="RIGHT"}(i||(i={}));var s=function(){function t(t,e,n){void 0===n&&(n=!1),this._label=null,this._description=null,this.align=i.NONE,this.isVisible=!0,this.isRowNum=!1,this.dataColumn=t,this.grid=e;var s=e.options.columnWidths||{};t?(t.style.alignment&&(this.align=function(t){switch(t){case r.ColumnAlignment.Left:return i.LEFT;case r.ColumnAlignment.Center:return i.CENTER;case r.ColumnAlignment.Right:return i.RIGHT;default:return i.NONE}}(t.style.alignment)),this.width=s&&s[this.type]?s[this.type].default:250,this.cellRenderer=this.grid.cellRendererStore.getDefaultRenderer(t.type),this._description=t.description):n&&(this.isRowNum=!0,this.width=s&&s.rowNumColumn?s.rowNumColumn.default:60,this._label="",this.cellRenderer=this.grid.cellRendererStore.getDefaultRendererByType(o.a.NUMBER)),e&&e.options&&e.options.onGetCellRenderer&&(this.cellRenderer=e.options.onGetCellRenderer(this,this.cellRenderer)||this.cellRenderer)}return Object.defineProperty(t.prototype,"label",{get:function(){return this._label?this._label:this.isRowNum?"":this.dataColumn.label},set:function(t){this._label=this.label},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"description",{get:function(){return this._description},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this.dataColumn?this.dataColumn.type:null},enumerable:!0,configurable:!0}),t}(),a=function(){function t(t,e){this.items=[],this.grid=e,this.sync(t)}return t.prototype.sync=function(t,e){void 0===e&&(e=!0),this.clear();var n=new s(null,this.grid,!0);if(this.add(n),e||(n.isVisible=!1),t)for(var i=0,r=t.getItems();i<r.length;i++){var o=r[i],a=new s(o,this.grid);this.grid.options.onSyncGridColumn&&this.grid.options.onSyncGridColumn(a),this.add(a)}},Object.defineProperty(t.prototype,"count",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),t.prototype.add=function(t){var e=this.items.length;return this.items.push(t),e},t.prototype.put=function(t,e){t>=0&&t<this.items.length&&(this.items[t]=e)},t.prototype.move=function(t,e){var n=this.items.indexOf(t);n>=0&&n!=e&&r.utils.moveArrayItem(this.items,n,e)},t.prototype.get=function(t){return t>=0&&t<this.items.length?this.items[t]:null},t.prototype.getItems=function(){return this.items},t.prototype.removeAt=function(t){this.get(t);this.items.splice(t,1)},t.prototype.clear=function(){this.items=[]},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i=function(){}},function(t,e,n){"use strict";var i;n.d(e,"a",(function(){return i})),function(t){t[t.Always=0]="Always",t[t.Once=1]="Once",t[t.Never=2]="Never"}(i||(i={}))},function(t,e,n){"use strict";var i;n.d(e,"a",(function(){return i})),function(t){t.Trace="TRACE",t.Options="OPTIONS",t.Get="GET",t.Put="PUT",t.Post="POST",t.Delete="DELETE"}(i||(i={}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return u})),n.d(e,"a",(function(){return c})),n.d(e,"d",(function(){return d}));var i,r=n(0),o=n(6),s=n(1),a="undefined"!=typeof TouchEvent;!function(t){t.None="none",t.Allow="allow",t.Forbid="forbid"}(i||(i={}));var u=function(t,e,n){this.dropEffect=i.Allow,this.pageX=0,this.pageY=0,this.item=t,this.dragImage=e,this.data=t.data,this.sourceEvent=n,n&&n instanceof MouseEvent&&(this.pageX=n.pageX,this.pageY=n.pageY),n&&a&&n instanceof TouchEvent&&n.touches[0]&&(this.pageX=n.touches[0].pageX,this.pageY=n.touches[0].pageY)},l=function(t){t&&t instanceof MouseEvent&&(this.x=t.pageX,this.y=t.pageY),t&&a&&t instanceof TouchEvent&&t.touches[0]&&(this.x=t.touches[0].pageX,this.y=t.touches[0].pageY)},c=function(){function t(){this.delta=5,this.draggableItem=null,this.dragImage=null,this.finishedSuccessfully=!1,this.mouseDownPosition=null,this.containerDescriptors=[],this.containerDescriptorIndex=-1,this.dropEffect=i.None,this.classPrefix="eqjs-drop",this.DRAG_DISABLED_ATTR="drag-disabled"}return t.prototype.registerDraggableItem=function(t){var e=this,n=t.element;if(!n)throw Error("Element in draggle item is null or undefined");n.ondragstart=function(){return!1};var r=function(t){if(!n.hasAttribute(e.DRAG_DISABLED_ATTR)){t.preventDefault(),t instanceof MouseEvent&&t.stopPropagation();var i=new l(t);(Math.abs(i.x-e.mouseDownPosition.x)>e.delta||Math.abs(i.y-e.mouseDownPosition.y)>e.delta)&&c(t)}},o=function(t){e.mouseMoveDragListener(t)},c=function(a){a.preventDefault(),a.stopPropagation(),n.removeEventListener("mousemove",r),n.removeEventListener("touchmove",r),e.finishedSuccessfully=!1,t.beforeDragStart&&t.beforeDragStart(),e.dragImage=Object(s.e)("div").setStyle("position","absolute").setStyle("z-index","65530").toDOM(),document.body.appendChild(e.dragImage),e.dragImage.appendChild(n.cloneNode(!0)),t.renderer&&t.renderer(e.dragImage),e.dropEffect=i.None,e.updateCusror(e.dropEffect),e.updateImageClass(e.dropEffect),e.draggableItem={element:n,scope:t.scope,data:t.data},e.updateDragItemPosition(a);var l=new u(e.draggableItem,e.dragImage,a);l.dropEffect=e.dropEffect,t.onDragStart&&t.onDragStart(l),e.dropEffect!==l.dropEffect&&(e.dropEffect=l.dropEffect,e.updateImageClass(e.dropEffect)),document.addEventListener("mousemove",o,!0),document.addEventListener("touchmove",o,!0)},d=function(t){a&&t instanceof TouchEvent&&t.preventDefault(),e.mouseDownPosition=new l(t),n.addEventListener("mousemove",r),n.addEventListener("touchmove",r),document.addEventListener("mouseup",h),document.addEventListener("touchend",h)};n.addEventListener("mousedown",d),n.addEventListener("touchstart",d);var h=function(t){e.mouseDownPosition=null,n.removeEventListener("mousemove",r),n.removeEventListener("touchmove",r),document.removeEventListener("mousemove",o,!0),document.removeEventListener("touchmove",o,!0),e.draggableItem&&p(t)},p=function(n){try{if(e.containerDescriptorIndex>=0){var r=e.containerDescriptors[e.containerDescriptorIndex],o={element:r.element,scopes:r.scopes,data:r.data},s=new u(e.draggableItem,e.dragImage,n);try{o.scopes.indexOf(e.draggableItem.scope)>=0&&e.dropEffect===i.Allow&&(e.finishedSuccessfully=!0,r.onDrop&&r.onDrop(o,s))}finally{r.onDragLeave&&r.onDragLeave(o,s)}}}finally{try{var a=new u(e.draggableItem,e.dragImage,n);a.data.finishedSuccessfully=e.finishedSuccessfully,t.onDragEnd&&t.onDragEnd(a)}finally{e.draggableItem=null,e.dragImage&&e.dragImage.parentElement&&e.dragImage.parentElement.removeChild(e.dragImage),e.dragImage=null,e.finishedSuccessfully=!1,document.removeEventListener("mouseup",h),document.removeEventListener("touchend",h)}}}},t.prototype.registerDropContainer=function(t){if(!t.element)throw Error("Element in drop container is null or undefined");this.containerDescriptors.push(t)},t.prototype.removeDropContainer=function(t){var e=this.containerDescriptors.filter((function(e){return e===t||e.element==t}));if(e)for(var n=0,i=e;n<i.length;n++){var o=i[n];r.utils.removeArrayItem(this.containerDescriptors,o)}},t.prototype.mouseMoveDragListener=function(t){if(t instanceof MouseEvent&&t.preventDefault(),t.stopPropagation(),this.updateDragItemPosition(t),-1==this.containerDescriptorIndex){for(var e=0;e<this.containerDescriptors.length;e++){var n=this.containerDescriptors[e];if(this.detectDragEnterEvent(n.element,t)){this.containerDescriptorIndex=e;break}}this.containerDescriptorIndex>=0&&this.dragEnterEvent(t)}else{n=this.containerDescriptors[this.containerDescriptorIndex];this.detectDragLeaveEvent(n.element,t)&&(this.dragLeaveEvent(t),this.containerDescriptorIndex=-1)}if(this.containerDescriptorIndex>=0){var i={element:(n=this.containerDescriptors[this.containerDescriptorIndex]).element,scopes:n.scopes,data:n.data};if(i.scopes.indexOf(this.draggableItem.scope)>=0){var r=new u(this.draggableItem,this.dragImage,t);r.dropEffect=this.dropEffect,n.onDragOver&&n.onDragOver(i,r)}}},t.prototype.updateCusror=function(t){switch(t){case i.Allow:this.setCursorStyle(this.dragImage,"grabbing");break;case i.Forbid:this.setCursorStyle(this.dragImage,"no-drop");break;default:this.setCursorStyle(this.dragImage,"grabbing")}},t.prototype.updateImageClass=function(t){switch(this.dragImage.classList.remove(this.classPrefix+"-allow"),this.dragImage.classList.remove(this.classPrefix+"-forbid"),this.dragImage.classList.remove(this.classPrefix+"-none"),t){case i.Allow:this.dragImage.classList.add(this.classPrefix+"-allow");break;case i.None:this.dragImage.classList.add(this.classPrefix+"-none");break;case i.Forbid:this.dragImage.classList.add(this.classPrefix+"-forbid");break;default:this.dragImage.classList.add(this.classPrefix+"-none")}},t.prototype.setCursorStyle=function(t,e){if(t){t.style.cursor=e;for(var n=0;n<t.children.length;n++)this.setCursorStyle(t.children[n],e)}},t.prototype.updateDragItemPosition=function(t){if(this.dragImage){var e=new l(t);this.dragImage.style.top=e.y-this.dragImage.offsetHeight/2+"px",this.dragImage.style.left=e.x-this.dragImage.offsetWidth/2+"px"}},t.prototype.dragEnterEvent=function(t){var e=this.containerDescriptors[this.containerDescriptorIndex],n={element:e.element,scopes:e.scopes,data:e.data};if(n.scopes.indexOf(this.draggableItem.scope)>=0){var r=new u(this.draggableItem,this.dragImage,t);r.dropEffect=i.Allow,e.onDragEnter&&e.onDragEnter(n,r),this.dropEffect=r.dropEffect,this.updateCusror(this.dropEffect),this.updateImageClass(this.dropEffect)}else this.dropEffect!==i.Forbid&&(this.dropEffect=i.None,this.updateCusror(this.dropEffect),this.updateImageClass(this.dropEffect))},t.prototype.dragLeaveEvent=function(t){var e=this.containerDescriptors[this.containerDescriptorIndex],n={element:e.element,scopes:e.scopes,data:e.data};if(n.scopes.indexOf(this.draggableItem.scope)>=0){var r=new u(this.draggableItem,this.dragImage,t);r.dropEffect=i.None,e.onDragLeave&&e.onDragLeave(n,r),this.dropEffect=r.dropEffect,this.updateCusror(this.dropEffect),this.updateImageClass(this.dropEffect)}},t.prototype.detectDragEnterEvent=function(t,e){var n=Object(o.g)(t),i=new l(e);return!(i.y<n.y||i.y>n.y+t.offsetHeight)&&!(i.x<n.x||i.x>n.x+t.offsetWidth)},t.prototype.detectDragLeaveEvent=function(t,e){var n=Object(o.g)(t),i=new l(e);return!(i.y>n.y&&i.y<n.y+t.offsetHeight&&i.x>n.x&&i.x<n.x+t.offsetWidth)},t}(),d=new c},function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return h}));var i,r=n(0),o=n(8),s="keg",a=/{0:(.*?)}/g;!function(t){t[t.STRING=1]="STRING",t[t.NUMBER=2]="NUMBER",t[t.DATETIME=3]="DATETIME",t[t.BOOL=4]="BOOL"}(i||(i={}));var u=function(t,e,n,i){var r=t?t.toString().replace(/\n/g,"↵ "):"";n.innerText=r,n.title=r,e.align==o.b.NONE&&n.classList.add(s+"-cell-value-align-left")},l=function(t,e,n,i){var u=(t||"").toString();"number"==typeof t&&(u=e.dataColumn&&e.dataColumn.displayFormat&&a.test(e.dataColumn.displayFormat)?e.dataColumn.displayFormat.replace(a,(function(e,n){return r.i18n.numberToStr(t,n)})):t.toLocaleString()),n.innerText=u,n.title=u,e.align==o.b.NONE&&n.classList.add(s+"-cell-value-align-right")},c=function(t,e,n,i){var u="[object Date]"===Object.prototype.toString.call(t),l=(t||"").toString();if(u)if(e.dataColumn&&e.dataColumn.displayFormat&&a.test(e.dataColumn.displayFormat))l=e.dataColumn.displayFormat.replace(a,(function(n,i){return r.i18n.dateTimeToStr(t,e.type,i)}));else{var c=r.i18n.getCurrentLocale(),d={hour:"numeric",minute:"numeric",second:"numeric"};switch(e.type){case r.DataType.Date:l=t.toLocaleDateString(c);break;case r.DataType.Time:l=t.toLocaleTimeString(c,d);break;case r.DataType.DateTime:l=t.toLocaleDateString(c)+" "+t.toLocaleTimeString(c,d)}}n.innerText=l,n.title=l,e.align==o.b.NONE&&n.classList.add(s+"-cell-value-align-right")},d=function(t,e,n,i){if(e.dataColumn&&e.dataColumn.displayFormat&&a.test(e.dataColumn.displayFormat)){var o=e.dataColumn.displayFormat.replace(a,(function(e,n){return r.i18n.booleanToStr(t,n)}));return u(o,e,n)}n.classList.add(s+"-cell-value-bool"),n.classList.add(s+"-"+(t?"cell-value-true":"cell-value-false"))},h=function(){function t(t){this.renderers={},this.defaultRenderers={},this.registerRenderer("StringDefault",u),this.setDefaultRenderer(i.STRING,u),this.registerRenderer("NumberDefault",l),this.setDefaultRenderer(i.NUMBER,l),this.registerRenderer("DateTimeDefault",c),this.setDefaultRenderer(i.DATETIME,c),this.registerRenderer("BoolDefault",d),this.setDefaultRenderer(i.BOOL,d)}return t.prototype.getDefaultRenderer=function(t){var e=this.getCellType(t);return this.defaultRenderers[i[e]]},t.prototype.getDefaultRendererByType=function(t){return this.defaultRenderers[i[t]]},t.prototype.setDefaultRenderer=function(t,e){e&&(this.defaultRenderers[i[t]]=e)},t.prototype.getRenderer=function(t){return this.renderers[t]},t.prototype.registerRenderer=function(t,e){this.renderers[t]=e},t.prototype.getCellType=function(t){switch(t){case r.DataType.Autoinc:case r.DataType.Byte:case r.DataType.Word:case r.DataType.Currency:case r.DataType.Float:case r.DataType.Int32:case r.DataType.Int64:return i.NUMBER;case r.DataType.Date:case r.DataType.DateTime:case r.DataType.Time:return i.DATETIME;case r.DataType.Bool:return i.BOOL;default:return i.STRING}},t}()},function(t,e,n){"use strict";function i(t,e){for(var n="",i=0;i<e;i++)n+=t;return n}function r(t){return t.split("").reverse().join("")}function o(t,e){return t&&t.lastIndexOf(e)==t.length-e.length}function s(t,e){var n=t;return null!=n&&n.length>0?("/"!=n.charAt(n.length-1)&&(n+="/"),n+=e):n=e,n}n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return r})),n.d(e,"d",(function(){return o})),n.d(e,"a",(function(){return s}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i=function(){function t(t,e){this.columns=t,this.values=e}return t.prototype.toArray=function(){return Array.from(this.values)},t.prototype.size=function(){return this.values.length},t.prototype.getValue=function(t){var e;if("string"==typeof t){if(void 0===(e=this.columns.getIndex(t)))throw new RangeError("No column with id '"+t+"'")}else e=t;if(e>=this.values.length)throw new RangeError("Out of range: "+e);return this.values[e]},t.prototype.setValue=function(t,e){var n;if("string"==typeof t){if(void 0===(n=this.columns.getIndex(t)))throw new RangeError("No column with id '"+t+"'")}else n=t;if(n>=this.values.length)throw new RangeError("Out of range: "+n);this.values[n]=e},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i=function(){function t(t,e){this.xhr=t,this.method=e.method,this.url=e.url,this.headers=e.headers,this.queryParams=e.queryParams,this.data=e.data}return t.prototype.setHeader=function(t,e){this.headers[t]=e},t.prototype.setQueryParam=function(t,e){this.queryParams[t]=e},t.prototype.getXMLHttpRequest=function(){return this.xhr},t.prototype.getResponseHeaders=function(){if(this.xhr.readyState==this.xhr.HEADERS_RECEIVED){for(var t={},e=0,n=this.xhr.getAllResponseHeaders().trim().split(/[\r\n]+/);e<n.length;e++){var i=n[e].split(": "),r=i.shift(),o=i.join(": ");t[r]=o}return t}return{}},t.prototype.open=function(){var t=this;if(this.xhr.readyState===this.xhr.UNSENT){var e=this.url;for(var n in this.queryParams&&Object.keys(this.queryParams).length>0&&(e+=encodeURI("?"+Object.keys(this.queryParams).map((function(e){return e+"="+t.queryParams[e]})).join("&"))),this.xhr.open(this.method,e,!0),this.xhr.setRequestHeader("X-Requested-With","XMLHttpRequest"),this.headers)this.xhr.setRequestHeader(n,this.headers[n])}},t.prototype.abort=function(){this.xhr.abort()},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return a}));var i,r=n(2),o=n(4);!function(t){t[t.None=0]="None",t[t.Left=1]="Left",t[t.Center=2]="Center",t[t.Right=3]="Right"}(i||(i={}));var s=function(t){if(!t)throw Error("Options are required");if(!t.id)throw Error("Field Id is required");if(!t.label)throw Error("Label is required");this.id=t.id,this.type=o.a.getIfDefined(t.type,r.a.String),this.label=t.label,this.originAttrId=t.originAttrId,this.isAggr=t.isAggr||!1,this.displayFormat=t.dfmt,this.groupFooterColumnTemplate=t.gfct,this.style=t.style||{},this.description=t.description,this.calculatedWidth=0},a=function(){function t(){this.items=[],this.mapper={},this._dateColumnIdx=[]}return Object.defineProperty(t.prototype,"count",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),t.prototype.add=function(t){var e;e=t instanceof s?t:new s(t);var n=this.items.length;return this.items.push(e),this.mapper[e.id]=n,[r.a.Date,r.a.DateTime,r.a.Time].indexOf(e.type)>=0&&this._dateColumnIdx.push(n),n},t.prototype.updateDateColumnIdx=function(){this._dateColumnIdx=this.getItems().filter((function(t){return[r.a.Date,r.a.DateTime,r.a.Time].indexOf(t.type)>=0})).map((function(t,e){return e}))},t.prototype.put=function(t,e){t>=0&&t<this.count&&(this.items[t]=e,this.updateDateColumnIdx())},t.prototype.move=function(t,e){var n=this.items.indexOf(t);n>=0&&n!=e&&(o.a.moveArrayItem(this.items,n,e),this.updateDateColumnIdx())},t.prototype.get=function(t){return t>=0&&t<this.count?this.items[t]:null},t.prototype.getIndex=function(t){return this.mapper[t]},t.prototype.getItems=function(){return this.items},t.prototype.getDateColumnIndexes=function(){return this._dateColumnIdx},t.prototype.removeAt=function(t){var e=this.get(t);this.items.splice(t,1);var n=this._dateColumnIdx.indexOf(t);n>=0&&this._dateColumnIdx.splice(n,1),delete this.mapper[e.id]},t.prototype.clear=function(){this.items=[],this._dateColumnIdx=[],this.mapper={}},t}()},function(module,__webpack_exports__,__webpack_require__){"use strict";var browserUtils;__webpack_require__.d(__webpack_exports__,"a",(function(){return browserUtils})),function(browserUtils){var _isFirefox=null,_isIE=null;function IsIE(){if(null===_isIE){var t=navigator.userAgent;_isIE=t.indexOf("MSIE ")>-1||t.indexOf("Trident/")>-1}return _isIE}function IsEdge(){return!IsIE()&&eval("!!window.StyleMedia")}function IsFirefox(){if(null===_isFirefox){var t=navigator.userAgent;_isFirefox=t.toLowerCase().indexOf("firefox")>-1}return _isFirefox}browserUtils.IsIE=IsIE,browserUtils.IsEdge=IsEdge,browserUtils.IsFirefox=IsFirefox;var _detectedIsMobileMode=!1,_isMobileMode=void 0,detectIsMobileMode=function(){var t=isMobileMode();_detectedIsMobileMode=window.matchMedia("only screen and (max-width: 840px)").matches||window.matchMedia("only screen and (max-height: 420px)").matches;var e=isMobileMode();e!==t&&mobileModeChangeHandler&&mobileModeChangeHandler(e)},mobileModeChangeHandler;function isMobileMode(){return void 0!==_isMobileMode?_isMobileMode:_detectedIsMobileMode}function setIsMobileMode(t){var e=isMobileMode();_isMobileMode=t;var n=isMobileMode();n!==e&&mobileModeChangeHandler&&mobileModeChangeHandler(n)}function onMobileModeChanged(t){mobileModeChangeHandler=t}function getMobileCssClass(){return isMobileMode()?"k-mobile":null}detectIsMobileMode(),window.addEventListener("resize",(function(){return detectIsMobileMode()})),browserUtils.isMobileMode=isMobileMode,browserUtils.setIsMobileMode=setIsMobileMode,browserUtils.onMobileModeChanged=onMobileModeChanged,browserUtils.getMobileCssClass=getMobileCssClass}(browserUtils||(browserUtils={}))},function(t,e,n){"use strict";function i(t,e){var n={9:"[0-9]",a:"[a-z]"},i=e.split(""),r=function(e){if("focus"!==e.type||""===t.value){var r=[],o=t.selectionStart;i.forEach((function(e,i){if(n[e]){var o=new RegExp(n[e],"i").test(t.value.charAt(i));r.push(o?t.value.charAt(i):"_")}else r.push(e)})),t.value=r.join(""),t.selectionStart=t.selectionEnd=o}};t.addEventListener("keydown",(function(e){if(8===e.keyCode||46===e.keyCode){e.preventDefault();var r=[],o=t.selectionStart;if(0==o)return;for(var s=o,a=!0,u=i.length-1;u>=0;u--){var l=i[u];if(n[l]){var c=new RegExp(n[l],"i").test(t.value.charAt(u));c&&u!=o-1&&(a=!1),u===o-1&&s--,r.push(c&&u!=o-1?t.value.charAt(u):"_")}else u===s-1&&s--,o-1===u&&o--,r.push(l)}t.value=a?"":r.reverse().join(""),t.selectionStart=t.selectionEnd=s<0?0:s;var d=document.createEvent("Event");d.initEvent("input",!0,!0),t.dispatchEvent(d)}})),t.addEventListener("keypress",(function(e){var r=String.fromCharCode(e.charCode);if(r){e.preventDefault();var o=[],s=t.selectionStart,a=s;i.forEach((function(e,i){if(n[e]){var u=i!=s?t.value.charAt(i):r,l=new RegExp(n[e],"i").test(u);o.push(l?u:"_"),l&&s===i&&a++}else o.push(e),a===i&&a++,s===i&&s++})),t.value=o.join(""),t.selectionStart=t.selectionEnd=a;var u=document.createEvent("Event");u.initEvent("input",!0,!0),t.dispatchEvent(u)}})),t.addEventListener("input",r),t.addEventListener("focus",r)}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";(function(t){n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return c})),n.d(e,"d",(function(){return d})),n.d(e,"c",(function(){return h}));var i,r=n(0),o=n(21),s=n(1),a=(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},i(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u="kdlg",l=function(){function e(){}return e.prototype.openConfirm=function(e,n,i){var r=this,o={title:e,closable:!1,submitable:!0,cancelable:!0,body:'<div id="kdlg-dialog-confirm">'+n+"</div>"};return i?(o.onSubmit=function(){i(!0)},o.onCancel=function(){i(!1)},void this.open(o)):new t((function(t){o.onSubmit=function(){t(!0)},o.onCancel=function(){t(!1)},r.open(o)}))},e.prototype.openPrompt=function(e,n,i,r){var o=this,s={title:e,submitable:!0,closable:!0,cancelable:!0,submitOnEnter:!0,body:'<div id="kdlg-dialog-form" class="kfrm-form">\n <div class="kfrm-fields label-above">\n <label for="kdlg-dialog-form-input" id="kdlg-dialog-form-content">'+n+'</label>\n <input type="text" name="'+u+'-dialog-form-input" id="'+u+'-dialog-form-input" />\n </div>\n </div>',arrangeParents:!1,beforeOpen:function(){var t=document.getElementById(u+"-dialog-form-input");i&&(t.value=i),t.focus()}},a=function(t){var e=document.getElementById(u+"-dialog-form-input"),n=e.value;return n&&n.replace(/\s/g,"").length>0?(t(n),!0):(e.classList.add("eqjs-invalid"),!1)};return r?(s.onSubmit=function(){return a(r)},s.onCancel=function(){r("")},void this.open(s)):new t((function(t){s.onSubmit=function(){return a(t)},s.onCancel=function(){t("")},o.open(s)}))},e.prototype.open=function(t,e){var n=this,i=new c(t,e),r=t.onDestroy;return t.onDestroy=function(t){n.untrack(t),r&&r(t)},i.open(),this.track(i),i},e.prototype.createSet=function(t){return new h(t,this)},e.prototype.untrack=function(t){var n=e.openDialogs.indexOf(t);n>=0&&e.openDialogs.splice(n,1)},e.prototype.track=function(t){e.openDialogs.push(t)},e.prototype.openProgress=function(t){var e=this,n=new d(t),i=t.onDestroy;return t.onDestroy=function(t){e.untrack(t),i&&i(t)},n.open(),this.track(n),n},e.prototype.getAllDialogs=function(){return Array.from(e.openDialogs)},e.prototype.closeAllDialogs=function(){for(var t=0,n=Array.from(e.openDialogs);t<n.length;t++){n[t].close()}},e.openDialogs=[],e}(),c=function(){function t(t,e){var n=this;this.options=t,this.submitHandler=function(t){return(!n.options.onSubmit||!1!==n.options.onSubmit(n,t))&&(n.destroy(),!0)},this.cancelHandler=function(){n.options.onCancel&&n.options.onCancel(n),n.destroy()},this.keydownHandler=function(t){return 13!=t.keyCode||!n.isActiveDialog()||(t.preventDefault(),t.stopPropagation(),!n.submitHandler())||(window.removeEventListener("keydown",n.keydownHandler,!1),!1)},this.dialogId=r.utils.generateId("dlg"),this.data=e,this.slot=Object(s.e)("div",document.body).attr("tab-index","-1").data("dialog-id",this.dialogId).addClass(u+"-modal","is-active").focus().addChild("div",(function(t){return t.addClass("kdlg-modal-background")})).addChild("div",(function(i){return n.windowElement=i.addClass(u+"-modal-window").addChild("header",(function(e){n.headerElement=e.addClass(u+"-header").addChild("p",(function(e){return e.addClass(u+"-header-title").addText(t.title)})).toDOM(),!1!==t.closable&&e.addChild("button",(function(t){return t.addClass(u+"-modal-close").on("click",(function(){n.cancelHandler()})).focus()}))})).addChild("div",(function(t){t.addClass(u+"-alert-container"),n.alertElement=t.toDOM()})).addChild("section",(function(i){if(n.bodyElement=i.addClass(u+"-body").toDOM(),"string"==typeof t.body){var o=r.liquid.renderLiquidTemplate(t.body,e);i.addHtml(o)}else i.addChildElement(t.body)})).addChild("footer",(function(e){var i=null;i=t.footerAlignment&&t.footerAlignment==o.a.Center?"align-center":"align-right",n.footerElement=e.addClass(u+"-footer").toDOM(),e.addClass(i),!1!==t.submitable&&(e.addChild("button",(function(e){e.id(n.dialogId+"-btn-submit").addClass("kfrm-button","is-info").addText(t.submitButtonText||r.i18n.getText("ButtonOK")),t.recaptchaSiteKey?(e.data("sitekey",t.recaptchaSiteKey),e.addClass("g-recaptcha"),e.on("click",(function(e){grecaptcha?grecaptcha.ready((function(){grecaptcha.execute(t.recaptchaSiteKey,{action:"submit"}).then((function(t){n.submitHandler(t)}))})):n.submitHandler()}))):e.on("click",(function(t){n.submitHandler()})),e.focus()})),!1!==t.cancelable&&e.addChild("button",(function(e){return e.id(n.dialogId+"-btn-cancel").addClass("kfrm-button").addText(t.cancelButtonText||r.i18n.getText("ButtonCancel")).on("click",(function(t){n.cancelHandler()}))})))})).toDOM()})).toDOM()}return t.prototype.getData=function(){return this.data},t.prototype.getRootElement=function(){return this.slot},t.prototype.getSubmitButtonElement=function(){return document.getElementById(this.dialogId+"-btn-submit")},t.prototype.getCancelButtonElement=function(){return document.getElementById(this.dialogId+"-btn-cancel")},t.prototype.open=function(){var t=this;this.options.beforeOpen&&this.options.beforeOpen(this),Object(s.e)(this.slot).show(),this.options.arrangeParents&&this.arrangeParents(!0);var e=this.slot.querySelector(".kdlg-modal-window");this.options.height&&(e.style.height="string"==typeof this.options.height?this.options.height:this.options.height+"px"),this.options.width&&(e.style.width="string"==typeof this.options.width?this.options.width:this.options.width+"px"),this.options.submitOnEnter&&window.addEventListener("keydown",this.keydownHandler,!1),this.slot.querySelectorAll("input").forEach((function(e){return e.addEventListener("input",(function(){t.clearAlert(),t.options.onInput&&t.options.onInput(t)}))})),this.options.onShow&&this.options.onShow(this)},t.prototype.submit=function(){this.submitHandler()},t.prototype.cancel=function(){this.cancelHandler()},t.prototype.close=function(){this.destroy()},t.prototype.disableButtons=function(){this.slot.querySelectorAll("button").forEach((function(t){return t.disabled=!0}))},t.prototype.enableButtons=function(){this.slot.querySelectorAll("button").forEach((function(t){return t.disabled=!1}))},t.prototype.showAlert=function(t,e,n){var i=Object(s.e)("div").addClass(u+"-alert "+(e||"")).addChild("span",(function(t){return t.addClass(u+"-alert-closebtn").text("×").on("click",(function(t){var e=t.target.parentElement;e.parentElement.removeChild(e)}))})).addText(t).toDOM();!0===n&&this.clearAlert(),this.alertElement.appendChild(i)},t.prototype.clearAlert=function(){this.alertElement.innerHTML=""},t.prototype.destroy=function(){document.querySelectorAll('[data-dialog-id="'+this.dialogId+'"]').length<=0||(this.options.arrangeParents&&this.arrangeParents(!1),document.body.removeChild(this.slot),this.options.submitOnEnter&&window.removeEventListener("keydown",this.keydownHandler,!1),this.options.onDestroy&&this.options.onDestroy(this))},t.prototype.isActiveDialog=function(){var t=document.documentElement.querySelectorAll(".kdlg-modal");return t[t.length-1]===this.slot},t.prototype.arrangeParents=function(t){for(var e=document.documentElement.querySelectorAll(".kdlg-modal-window"),n=0;n<e.length-1;n++)if(t){var i=0==n?20:40*n+20;Object(s.e)(e[n]).setStyle("margin-top",i+"px").setStyle("margin-left",i+"px")}else Object(s.e)(e[n]).removeStyle("margin-top").removeStyle("margin-left")},t}(),d=function(t){function e(e,n){var i,r,o=this,a=Object(s.e)("div").addChild("div",(function(t){return i=t.text(e.content||"").toDOM()})).addChild("div",(function(t){t.addClass(u+"-progress-line").addChild("div",(function(t){r=t.addClass("fill").toDOM(),e.determinated?t.setStyle("width","0%"):t.addClass("indeterminate")}))})).toDOM();return(o=t.call(this,{title:e.title,body:a,beforeOpen:e.beforeOpen,onSubmit:e.onSubmit,width:e.width,height:e.height,submitable:!1,cancelable:!1,closable:!1,onDestroy:e.onDestroy},n)||this).contentElement=i,o.progressElement=r,o}return a(e,t),e.prototype.updateContent=function(t){this.contentElement.innerText=t},e.prototype.updateProgress=function(t){var e=this;t=this.in01(t),this.progressElement.style.width=100*t+"%",1===t&&setTimeout((function(){e.submit()}),500)},e.prototype.in01=function(t){return t>1?1:t<0?0:t},e}(c),h=function(){function t(t,e){this.options=t,this.dialogService=e,this.currentDialog=null,this.currentIndex=0,this.options=t,this.dialogService=e}return t.prototype.getCurrent=function(){return this.currentDialog},t.prototype.openNext=function(t){return this.open(this.currentIndex+1,t)},t.prototype.openPrev=function(t){return this.open(this.currentIndex-1,t)},t.prototype.open=function(t,e){if(t<0?this.currentIndex=0:t>=this.options.length?this.currentIndex=this.options.length-1:this.currentIndex=t,this.currentDialog)try{this.currentDialog.close()}catch(t){}var n=this.options[this.currentIndex];return this.currentDialog=this.dialogService.open(n,e),this.currentDialog},t.prototype.close=function(){this.currentDialog&&(this.currentDialog.close(),this.currentDialog=null)},t}()}).call(this,n(30))},function(t,e,n){"use strict";var i;n.d(e,"a",(function(){return i})),function(t){t[t.Left=1]="Left",t[t.Center=2]="Center",t[t.Right=3]="Right"}(i||(i={}))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return o}));var i=n(0),r=function(){return r=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},r.apply(this,arguments)},o=function(){function e(t,e,n,i){void 0===i&&(i=!1),this.loader=t,this.sourceTable=e,this.sourceId=n,this.isLookup=i,this.filterValue="",this.justServerSide=!1}return e.prototype.getValue=function(){return this.filterValue},e.prototype.apply=function(t){return this.filterValue=t,this.filterValue?this.applyCore():this.clear()},e.prototype.clear=function(){return this.filterValue="",t.resolve(this.sourceTable)},e.prototype.applyCore=function(){var t=this;if(this.sourceTable.getTotal()!=this.sourceTable.getCachedCount()||this.justServerSide){var e=[{class:"__substring",value:this.filterValue}];return this.loader.loadChunk({offset:0,limit:this.sourceTable.chunkSize,needTotal:!0,filters:e,sourceId:this.sourceId,lookup:this.isLookup}).then((function(n){for(var o=new i.EasyDataTable({chunkSize:t.sourceTable.chunkSize,loader:{loadChunk:function(n){return t.loader.loadChunk(r(r({},n),{filters:e,sourceId:t.sourceId,lookup:t.isLookup}))}}}),s=0,a=t.sourceTable.columns.getItems();s<a.length;s++){var u=a[s];o.columns.add(u)}o.setTotal(n.total);for(var l=0,c=n.table.getCachedRows();l<c.length;l++){var d=c[l];o.addRow(d)}return o}))}return this.applyInMemoryFilter()},e.prototype.applyInMemoryFilter=function(){var e=this;return new t((function(t,n){for(var r=new i.EasyDataTable({chunkSize:e.sourceTable.chunkSize,inMemory:!0}),o=0,s=e.sourceTable.columns.getItems();o<s.length;o++){var a=s[o];r.columns.add(a)}for(var u=e.filterValue.split("||").map((function(t){return t.trim().toLowerCase()})),l=e.sourceTable.columns.getItems().filter((function(t){return i.utils.isNumericType(t.type)||i.utils.getStringDataTypes().indexOf(t.type)>=0})),c=function(t){for(var e=0,n=l;e<n.length;e++){var i=n[e],r=t.getValue(i.id);if(r)for(var o=r.toString().toLowerCase(),s=0,a=u;s<a.length;s++){var c=a[s];if(o.indexOf(c)>=0)return!0}}return!1},d=0,h=e.sourceTable.getCachedRows();d<h.length;d++){var p=h[d];c(p)&&r.addRow(p)}r.setTotal(r.getCachedCount()),t(r)}))},e}()}).call(this,n(31))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return a}));var i=n(0),r=n(3),o=n(7),s=n(33),a=function(){function e(t){this.context=t,this.validators=[new s.a]}return e.prototype.getHtml=function(){return this.html},e.prototype.setHtmlInt=function(t){this.html=t,this.errorsDiv=this.html.querySelector(".errors-block")},e.prototype.validate=function(){this.clearErrors();for(var t=!0,e=0,n=Array.from(this.html.querySelectorAll("input, select"));e<n.length;e++){var i=n[e],o=this.context.getMetaData().getAttributeById(i.name);if("checkbox"!==i.type){var s=this.validateValue(o,i.value);if(!s.successed){t&&Object(r.domel)(this.errorsDiv).addChild("ul"),t=!1;for(var a=0,u=s.messages;a<u.length;a++){var l=u[a];this.errorsDiv.firstElementChild.innerHTML+="<li>"+o.caption+": "+l+"</li>"}}this.markInputValid(i,s.successed)}}return t},e.prototype.getData=function(){var e=this;return new t((function(n,i){for(var r=[],o=Array.from(e.html.querySelectorAll("input, select, textarea")),s={},a=function(t){var n=t.name.substring(t.name.lastIndexOf(".")+1),i=e.context.getMetaData().getAttributeById(t.name);"checkbox"===t.type?s[n]=t.checked:"file"===t.type?r.push(e.fileToBase64(t.files[0]).then((function(t){return s[n]=t}))):s[n]=e.mapValue(i.dataType,t.value)},u=0,l=o;u<l.length;u++){a(l[u])}t.all(r).then((function(){return n(s)})).catch((function(t){return i(t)}))}))},e.prototype.fileToBase64=function(e){return new t((function(t,n){var i=new FileReader;i.readAsDataURL(e),i.onload=function(){var e=i.result.toString();t(e.substring(e.indexOf(",")+1))},i.onerror=function(t){return n(t)}}))},e.prototype.useValidator=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.useValidators(t)},e.prototype.useValidators=function(t){this.validators=this.validators.concat(t)},e.prototype.mapValue=function(t,e){if(i.utils.getDateDataTypes().indexOf(t)>=0){if(t!==i.DataType.Time&&e&&e.length){var n=o.a(t),r=o.b(t),s=i.utils.strToDateTime(e,n);return i.utils.dateTimeToStr(s,r)}return e&&e.length?e:null}return i.utils.isIntType(t)?parseInt(e):i.utils.isNumericType(t)?parseFloat(e):e},e.prototype.clearErrors=function(){this.errorsDiv.innerHTML="",this.html.querySelectorAll("input, select").forEach((function(t){t.classList.remove("is-valid"),t.classList.remove("is-invalid")}))},e.prototype.markInputValid=function(t,e){t.classList.add(e?"is-valid":"is-invalid")},e.prototype.validateValue=function(t,e){for(var n={successed:!0,messages:[]},i=0,r=this.validators;i<r.length;i++){var o=r[i].validate(t,e);o.successed||(n.successed=!1,n.messages=n.messages.concat(o.messages))}return n},e}()}).call(this,n(31))},function(t,e,n){"use strict";(function(t){n.d(e,"b",(function(){return c})),n.d(e,"a",(function(){return d}));var i,r=n(4),o=n(32),s=n(11),a=n(16),u=(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},i(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(){return l=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},l.apply(this,arguments)},c=function(t){function e(e,n){var i=t.call(this,n)||this;return i.status=e,i}return u(e,t),e}(Error),d=function(){function e(){this.defaultHeaders={},this.customPayload=void 0}return Object.defineProperty(e.prototype,"responseBody",{get:function(){return this._responseBody},enumerable:!0,configurable:!0}),e.prototype.get=function(t,e){return this.send(s.a.Get,t,null,e)},e.prototype.post=function(t,e,n){return this.send(s.a.Post,t,e,n)},e.prototype.put=function(t,e,n){return this.send(s.a.Put,t,e,n)},e.prototype.delete=function(t,e,n){return this.send(s.a.Delete,t,e,n)},e.prototype.send=function(n,i,s,u){var d=this,h=(u=u||{}).dataType||"json",p=u.contentType||"form-data"!==h?"application/json":null;s&&"form-data"!=h&&this.customPayload&&(s.data=r.a.assignDeep(s.data||{},this.customPayload));var f=new("onload"in new XMLHttpRequest?XMLHttpRequest:window.XDomainRequest),g={method:n,url:i,headers:l(l({},this.defaultHeaders),u.headers||{}),queryParams:u.queryParams||{},data:s};p&&(g.headers["Content-Type"]=p);var m=new a.a(f,g);this.beforeEachRequest&&(console.warn("HttpClient: 'beforeEachRequest' is deprecated and will be removed in future updates.\n Use 'onRequest' instead"),this.beforeEachRequest(m)),this.onRequest&&this.onRequest(m);var y=m.data&&"string"!=typeof m.data&&"json"==h?JSON.stringify(m.data):m.data;return m.open(),new o.a(m,new t((function(n,r){u.responseType&&(f.responseType=u.responseType),f.onerror=function(t){r(new c(f.status,f.responseText))},f.onreadystatechange=function(){if(4==f.readyState){var o=f.getResponseHeader("Content-Type")||"",s=f.status;if(0===s)r(new c(s,"Network error or the request was aborted"));else if(s>=200&&s<400){var a="arraybuffer"===f.responseType||"blob"===f.responseType?f.response:0==o.indexOf("application/json")?JSON.parse(f.responseText):f.responseText;d._responseBody=a,d.onResponse&&d.onResponse(f),n(a)}else{("arraybuffer"===f.responseType||"blob"===f.responseType?e.decodeArrayBuffer(f.response):t.resolve(f.responseText)).then((function(t){var e=0==o.indexOf("application/json")?JSON.parse(t):t;d._responseBody=e;var n=e.message||(404==s?"No such endpoint: "+i:e);r(new c(s,n))}))}}},f.send(y)})))},e.decodeArrayBuffer=function(e){var n=new FileReader;return new t((function(t){n.onloadend=function(){n.readyState==FileReader.DONE&&t(n.result)},n.readAsText(new Blob([e]))}))},e}()}).call(this,n(25))},function(t,e,n){(function(e,n){var i;i=function(){"use strict";function t(t){return"function"==typeof t}var i=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},r=0,o=void 0,s=void 0,a=function(t,e){f[r]=t,f[r+1]=e,2===(r+=2)&&(s?s(g):w())},u="undefined"!=typeof window?window:void 0,l=u||{},c=l.MutationObserver||l.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var t=setTimeout;return function(){return t(g,1)}}var f=new Array(1e3);function g(){for(var t=0;t<r;t+=2)(0,f[t])(f[t+1]),f[t]=void 0,f[t+1]=void 0;r=0}var m,y,v,b,w=void 0;function C(t,e){var n=this,i=new this.constructor(E);void 0===i[T]&&L(i);var r=n._state;if(r){var o=arguments[r-1];a((function(){return R(r,i,o,n._result)}))}else P(n,i,t,e);return i}function D(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(E);return S(e,t),e}d?w=function(){return e.nextTick(g)}:c?(y=0,v=new c(g),b=document.createTextNode(""),v.observe(b,{characterData:!0}),w=function(){b.data=y=++y%2}):h?((m=new MessageChannel).port1.onmessage=g,w=function(){return m.port2.postMessage(0)}):w=void 0===u?function(){try{var t=Function("return this")().require("vertx");return void 0!==(o=t.runOnLoop||t.runOnContext)?function(){o(g)}:p()}catch(t){return p()}}():p();var T=Math.random().toString(36).substring(2);function E(){}var x=void 0;function I(e,n,i){n.constructor===e.constructor&&i===C&&n.constructor.resolve===D?function(t,e){1===e._state?M(t,e._result):2===e._state?_(t,e._result):P(e,void 0,(function(e){return S(t,e)}),(function(e){return _(t,e)}))}(e,n):void 0===i?M(e,n):t(i)?function(t,e,n){a((function(t){var i=!1,r=function(t,e,n,i){try{t.call(e,n,i)}catch(t){return t}}(n,e,(function(n){i||(i=!0,e!==n?S(t,n):M(t,n))}),(function(e){i||(i=!0,_(t,e))}),t._label);!i&&r&&(i=!0,_(t,r))}),t)}(e,n,i):M(e,n)}function S(t,e){if(t===e)_(t,new TypeError("You cannot resolve a promise with itself"));else if(r=typeof(i=e),null===i||"object"!==r&&"function"!==r)M(t,e);else{var n=void 0;try{n=e.then}catch(e){return void _(t,e)}I(t,e,n)}var i,r}function O(t){t._onerror&&t._onerror(t._result),A(t)}function M(t,e){t._state===x&&(t._result=e,t._state=1,0!==t._subscribers.length&&a(A,t))}function _(t,e){t._state===x&&(t._state=2,t._result=e,a(O,t))}function P(t,e,n,i){var r=t._subscribers,o=r.length;t._onerror=null,r[o]=e,r[o+1]=n,r[o+2]=i,0===o&&t._state&&a(A,t)}function A(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var i=void 0,r=void 0,o=t._result,s=0;s<e.length;s+=3)i=e[s],r=e[s+n],i?R(n,i,r,o):r(o);t._subscribers.length=0}}function R(e,n,i,r){var o=t(i),s=void 0,a=void 0,u=!0;if(o){try{s=i(r)}catch(t){u=!1,a=t}if(n===s)return void _(n,new TypeError("A promises callback cannot return that same promise."))}else s=r;n._state!==x||(o&&u?S(n,s):!1===u?_(n,a):1===e?M(n,s):2===e&&_(n,s))}var k=0;function L(t){t[T]=k++,t._state=void 0,t._result=void 0,t._subscribers=[]}var N=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(E),this.promise[T]||L(this.promise),i(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?M(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&M(this.promise,this._result))):_(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===x&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,i=n.resolve;if(i===D){var r=void 0,o=void 0,s=!1;try{r=t.then}catch(t){s=!0,o=t}if(r===C&&t._state!==x)this._settledAt(t._state,e,t._result);else if("function"!=typeof r)this._remaining--,this._result[e]=t;else if(n===j){var a=new n(E);s?_(a,o):I(a,t,r),this._willSettleAt(a,e)}else this._willSettleAt(new n((function(e){return e(t)})),e)}else this._willSettleAt(i(t),e)},t.prototype._settledAt=function(t,e,n){var i=this.promise;i._state===x&&(this._remaining--,2===t?_(i,n):this._result[e]=n),0===this._remaining&&M(i,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;P(t,void 0,(function(t){return n._settledAt(1,e,t)}),(function(t){return n._settledAt(2,e,t)}))},t}(),j=function(){function e(t){this[T]=k++,this._result=this._state=void 0,this._subscribers=[],E!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(t,e){try{e((function(e){S(t,e)}),(function(e){_(t,e)}))}catch(e){_(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var n=this,i=n.constructor;return t(e)?n.then((function(t){return i.resolve(e()).then((function(){return t}))}),(function(t){return i.resolve(e()).then((function(){throw t}))})):n.then(e,e)},e}();return j.prototype.then=C,j.all=function(t){return new N(this,t).promise},j.race=function(t){var e=this;return i(t)?new e((function(n,i){for(var r=t.length,o=0;o<r;o++)e.resolve(t[o]).then(n,i)})):new e((function(t,e){return e(new TypeError("You must pass an array to race."))}))},j.resolve=D,j.reject=function(t){var e=new this(E);return _(e,t),e},j._setScheduler=function(t){s=t},j._setAsap=function(t){a=t},j._asap=a,j.polyfill=function(){var t=void 0;if(void 0!==n)t=n;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var i=null;try{i=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===i&&!e.cast)return}t.Promise=j},j.Promise=j,j},t.exports=i()}).call(this,n(26),n(27))},function(t,e){var n,i,r=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var u,l=[],c=!1,d=-1;function h(){c&&u&&(c=!1,u.length?l=u.concat(l):d=-1,l.length&&p())}function p(){if(!c){var t=a(h);c=!0;for(var e=l.length;e;){for(u=l,l=[];++d<e;)u&&u[d].run();d=-1,e=l.length}u=null,c=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function g(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new f(t,e)),1!==l.length||c||a(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=g,r.addListener=g,r.once=g,r.off=g,r.removeListener=g,r.removeAllListeners=g,r.emit=g,r.prependListener=g,r.prependOnceListener=g,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return a}));var i=n(17),r=n(15),o=n(2),s=n(4),a=function(){function e(t){if(this._chunkSize=1e3,this._elasticChunks=!1,this.cachedRows=[],this.total=0,this.loader=null,this.needTotal=!0,this.isInMemory=!1,t=t||{},this._chunkSize=t.chunkSize||this._chunkSize,this._elasticChunks=t.elasticChunks||this._elasticChunks,this.loader=t.loader,void 0!==t.inMemory&&(this.isInMemory=t.inMemory),this.isInMemory&&(this.needTotal=!1),this._columns=new i.c,this.onUpdate=t.onUpdate,t.columns)for(var e=0,n=t.columns;e<n.length;e++){var r=n[e];this._columns.add(r)}if(t.rows)for(var o=0,s=t.rows;o<s.length;o++){var a=s[o],u=this.createRow(a);this.addRow(u)}this.needTotal=!this._elasticChunks}return Object.defineProperty(e.prototype,"columns",{get:function(){return this._columns},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"chunkSize",{get:function(){return this._chunkSize},set:function(t){this._chunkSize=t,this.total=0,this.needTotal=!this.elasticChunks,this.cachedRows=[]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"elasticChunks",{get:function(){return this._elasticChunks},set:function(t){this._elasticChunks=t,this.total=0,this.needTotal=!this.elasticChunks,this.cachedRows=[]},enumerable:!0,configurable:!0}),e.prototype.getRows=function(e){var n=this,i=0,r=this._chunkSize;e&&("page"in e?(i=e.pageSize*(e.page-1),r=e.pageSize):(i=e.offset,r=e.limit));var o=i+r;if(!this.needTotal&&!this.elasticChunks){if(i>=this.total)return t.resolve([]);o>this.total&&(o=this.total)}if(this.isInMemory&&o>this.cachedRows.length&&(o=this.cachedRows.length),o<=this.cachedRows.length)return t.resolve(this.cachedRows.slice(i,o));if(!this.loader)throw"Loader is not defined. Can't get the rows from "+i+" to "+o;var s=this.needTotal;this.needTotal&&(this.needTotal=!1);var a=this.cachedRows.length,u=o-a;return u<this._chunkSize&&(u=this._chunkSize),this.loader.loadChunk({offset:a,limit:u,needTotal:s}).then((function(t){(s&&(n.total=t.total),Array.prototype.push.apply(n.cachedRows,t.table.getCachedRows()),o>n.cachedRows.length&&(o=n.cachedRows.length),n.elasticChunks)&&(t.table.getCachedCount()<u&&(n.total=n.cachedRows.length));return n.fireUpdated(),n.cachedRows.slice(i,o)}))},e.prototype.getRow=function(t){return this.getRows({offset:t,limit:1}).then((function(t){return t.length>0?t[0]:null}))},e.prototype.getTotal=function(){return this.total},e.prototype.setTotal=function(t){this.total=t,this.needTotal=!1},e.prototype.getCachedCount=function(){return this.cachedRows.length},e.prototype.clear=function(){this.columns.clear(),this.cachedRows=[],this.total=0,this.needTotal=!this._elasticChunks,this.fireUpdated()},e.prototype.createRow=function(t){var e=this,n=this._columns.getDateColumnIndexes(),i=new Array(this._columns.count),o=t instanceof r.a?function(e){return t.getValue(e)}:function(e){return t[e]};return t&&this.columns.getItems().forEach((function(t){var r=o(t.id),s=e.columns.getIndex(t.id);i[s]=n.indexOf(s)>=0?e.mapDate(r,t.type):r})),new r.a(this._columns,i)},e.prototype.mapDate=function(t,e){if(t){var n=new Date(t);return isNaN(n.getTime())&&e==o.a.Time&&(n=s.a.strToTime(t)),n}return null},e.prototype.addRow=function(t){var e;if(Array.isArray(t)){var n=t,i=this._columns.getDateColumnIndexes();if(i.length>0)for(var o=0,s=i;o<s.length;o++){var a=s[o];n[a]&&(n[a]=this.mapDate(n[a],this._columns.get(a).type))}e=new r.a(this._columns,n)}else e=this.createRow(t);this.cachedRows.push(e);var u=this.getCachedCount();return u>this.total&&(this.total=u),e},e.prototype.getCachedRows=function(){return this.cachedRows},e.prototype.totalIsKnown=function(){return this.elasticChunks?this.getCachedCount()===this.total:!this.needTotal},e.prototype.fireUpdated=function(){this.onUpdate&&this.onUpdate(this)},e}()}).call(this,n(25))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return h}));var i=n(0),r=n(12),o=n(1),s=n(6),a=n(10),u=n(8),l=n(13),c=function(){return c=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},c.apply(this,arguments)},d=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var i=Array(t),r=0;for(e=0;e<n;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,r++)i[r]=o[s];return i},h=function(){function e(t){if(this.cssPrefix="keg",this.pagination={page:1,pageSize:30,total:0},this.paginationOptions={maxButtonCount:10,useBootstrap:!1},this.defaultDataGridOptions={slot:null,dataTable:null,fixHeightOnFirstRender:!1,syncGridColumns:!0,useRowNumeration:!0,allowDragDrop:!1,aggregates:{settings:null,calculator:null},paging:{enabled:!0,pageSize:30,pageSizeItems:[20,30,50,100,200]},columnWidths:{autoResize:a.a.Always,stringColumns:{min:100,max:500,default:250},numberColumns:{min:60,default:120},boolColumns:{min:50,default:80},dateColumns:{min:80,default:200},otherColumns:{min:100,max:500,default:250},rowNumColumn:{min:40,default:60}},showPlusButton:!1,viewportRowsCount:null,showActiveRow:!0},this.rowsOnPagePromise=null,this.containerInitialHeight=0,this.firstRender=!0,this.prevRowTotals=null,this.landingIndex=-1,this.landingSlot=Object(o.e)("div").addClass(this.cssPrefix+"-col-landing-slot").addChildElement(Object(o.e)("div").toDOM()).toDOM(),this._activeRowIndex=-1,t&&t.paging&&(t.paging=i.utils.assign(this.defaultDataGridOptions.paging,t.paging)),this.options=this.mergeOptions(t),this.processColumnWidthsOptions(),!this.options.slot)throw Error('"slot" parameter is required to initialize EasyDataGrid');if(!this.options.dataTable)throw Error('"dataTable" parameter is required to initialize EasyDataGrid');this.dataTable=t.dataTable,this.eventEmitter=new i.EventEmitter(this),this.cellRendererStore=new l.c(t),this.columns=new u.c(this.dataTable.columns,this),this.setSlot(this.options.slot),this.init(this.options)}return e.prototype.mergeOptions=function(t){var e=i.utils.assignDeep({},this.defaultDataGridOptions.columnWidths,t.columnWidths),n=i.utils.assignDeep({},this.defaultDataGridOptions.paging,t.paging),r=i.utils.assign({},this.defaultDataGridOptions,t);return r.columnWidths=e,r.paging=n,r},e.prototype.processColumnWidthsOptions=function(){var t=this.options.columnWidths;if(t){i.utils.getStringDataTypes().forEach((function(e){t[e]=c(c({},t.stringColumns),t[e])})),i.utils.getNumericDataTypes().forEach((function(e){t[e]=c(c({},t.numberColumns),t[e])})),t[i.DataType.Bool]=c(c({},t.boolColumns),t[i.DataType.Bool]),i.utils.getDateDataTypes().forEach((function(e){t[e]=c(c({},t.dateColumns),t[e])}));var e=d(i.utils.getStringDataTypes(),i.utils.getNumericDataTypes(),i.utils.getDateDataTypes(),[i.DataType.Bool]);i.utils.getAllDataTypes().forEach((function(n){n in e||(t[n]=c(c({},t.otherColumns),t[n]))})),t[i.DataType.Unknown]=t.otherColumns}},e.prototype.setSlot=function(t){if("string"==typeof t){if(t.length)if("#"===t[0])this.slot=document.getElementById(t.substring(1));else{if("."!==t[0])throw Error("Unrecognized slot parameter (Must be id, class or HTMLElement): "+t);var e=document.getElementsByClassName(t.substring(1));e.length&&(this.slot=e[0])}}else this.slot=t},e.prototype.init=function(t){var e=this;t.onInit&&this.addEventListener("init",t.onInit),t.onRowClick&&this.addEventListener("rowClick",t.onRowClick),t.onRowDbClick&&this.addEventListener("rowDbClick",t.onRowDbClick),t.onPlusButtonClick&&this.addEventListener("plusButtonClick",t.onPlusButtonClick),t.onColumnChanged&&this.addEventListener("columnChanged",t.onColumnChanged),t.onColumnDeleted&&this.addEventListener("columnDeleted",t.onColumnDeleted),t.onColumnMoved&&this.addEventListener("columnMoved",t.onColumnMoved),t.onPageChanged&&this.addEventListener("pageChanged",t.onPageChanged),t.onActiveRowChanged&&this.addEventListener("activeRowChanged",t.onActiveRowChanged),this.addEventListener("pageChanged",(function(t){return e.activeRowIndex=-1})),i.utils.assignDeep(this.paginationOptions,t.pagination),this.pagination.pageSize=this.options.paging.pageSize||this.pagination.pageSize,this.options.allowDragDrop&&r.d.registerDropContainer({element:this.slot,scopes:["gridColumnMove"],onDragEnter:function(t,n){e.slot.classList.add(s.e+"-drophover"),e.showLandingSlot(n.pageX,n.pageY)},onDragOver:function(t,n){e.showLandingSlot(n.pageX,n.pageY)},onDragLeave:function(t,n){n.dropEffect=r.b.Forbid,e.slot.classList.remove(s.e+"-drophover"),e.hideLandingSlot()},onDrop:function(t,n){e.dataTable.columns.move(n.data.column,e.landingIndex),e.refresh(),e.fireEvent({type:"columnMoved",columnId:n.data.column.id,newIndex:e.landingIndex})}}),this.refresh(),this.fireEvent("init")},e.prototype.fireEvent=function(t){"string"==typeof t?this.eventEmitter.fire(t):this.eventEmitter.fire(t.type,t)},e.prototype.setData=function(t){this.dataTable=t,this.clear(),this.refresh()},e.prototype.getData=function(){return this.dataTable},e.prototype.getColumns=function(){return this.columns},e.prototype.destroy=function(){this.slot.innerHTML=""},e.prototype.refresh=function(){this.clearDOM(),this.render()},e.prototype.clearDOM=function(){this.slot.innerHTML=""},e.prototype.clear=function(){this.pagination.page=1,this.clearDOM()},e.prototype.render=function(){var t=this;if(this.hasData()||this.options.showPlusButton){this.containerInitialHeight=this.slot.clientHeight,this.rootDiv=document.createElement("div"),this.rootDiv.style.width="100%",this.rootDiv.classList.add(this.cssPrefix+"-root"),this.columns.sync(this.dataTable.columns,this.options.useRowNumeration),this.renderHeader(),this.rootDiv.appendChild(this.headerDiv),this.renderBody(),this.rootDiv.appendChild(this.bodyDiv),this.renderFooter(),this.rootDiv.appendChild(this.footerDiv);var e=document.createElement("div");e.classList.add(this.cssPrefix+"-container"),e.appendChild(this.rootDiv),this.slot.appendChild(e);var n=this.options.columnWidths.autoResize!==a.a.Never;this.rowsOnPagePromise?this.rowsOnPagePromise.then((function(){return t.updateHeight()})).then((function(){t.firstRender=!1,t.rowsOnPagePromise=null})):setTimeout((function(){t.updateHeight().then((function(){t.firstRender=!1,n&&t.resizeColumns()}))}),100)}},e.prototype.updateHeight=function(){var e=this;return new t((function(t){if(e.options.viewportRowsCount){var n=e.bodyCellContainerDiv.firstElementChild,i=(n?n.offsetHeight:36)*e.options.viewportRowsCount;return Object(o.e)(e.bodyViewportDiv).setStyle("height",i+"px"),void setTimeout((function(){var n=e.bodyViewportDiv.offsetHeight-e.bodyViewportDiv.clientHeight;i+=n,Object(o.e)(e.bodyViewportDiv).setStyle("height",i+"px"),t()}),100)}e.containerInitialHeight,t()})).then((function(){e.options.fixHeightOnFirstRender&&e.firstRender&&(e.slot.style.height=e.slot.offsetHeight+"px")}))},e.prototype.getContainerWidth=function(){return this.columns.getItems().filter((function(t){return t.isVisible})).map((function(t){return t.width})).reduce((function(t,e){return t+e}))},e.prototype.renderHeader=function(){var t=this;this.headerDiv=Object(o.e)("div").addClass(this.cssPrefix+"-header").toDOM(),this.headerViewportDiv=Object(o.e)("div",this.headerDiv).addClass(this.cssPrefix+"-header-viewport").toDOM(),this.headerCellContainerDiv=Object(o.e)("div",this.headerViewportDiv).addClass(this.cssPrefix+"-header-cell-container").toDOM(),this.headerRowDiv=Object(o.e)("div",this.headerCellContainerDiv).addClass(this.cssPrefix+"-header-row").toDOM(),this.columns.getItems().forEach((function(e,n){if(e.isVisible){var i=t.renderColumnHeader(e,n);t.headerRowDiv.appendChild(i),e.isRowNum&&Object(o.e)(i).addChildElement(t.renderHeaderButtons())}}));var e=this.getContainerWidth();Object(o.e)(this.headerCellContainerDiv).setStyle("width",e+"px")},e.prototype.hasData=function(){return this.dataTable.columns.count>0},e.prototype.renderColumnHeader=function(t,e){var n=this,i=Object(o.e)("div").addClass(this.cssPrefix+"-header-cell").data("col-idx",""+e).setStyle("width",t.width+"px");t.dataColumn&&i.data("col-id",""+t.dataColumn.id);var s=i.toDOM();return Object(o.e)("div",s).addClass(this.cssPrefix+"-header-cell-resize"),t.isRowNum||Object(o.e)("div",s).addClass(this.cssPrefix+"-header-cell-label").text(t.label),t.description&&Object(o.e)("div",s).addClass("question-mark").title(t.description),this.options.allowDragDrop&&r.d.registerDraggableItem({element:s,scope:"gridColumnMove",data:{column:t},renderer:function(e){e.innerHTML="";var i=document.createElement("div");i.innerText=t.label,e.classList.add(n.cssPrefix+"-sortable-helper"),e.appendChild(i)},onDragStart:function(t){t.dropEffect=r.b.Allow}}),s},e.prototype.renderBody=function(){var t=this;this.bodyDiv=Object(o.e)("div").addClass(this.cssPrefix+"-body").toDOM(),this.bodyViewportDiv=Object(o.e)("div",this.bodyDiv).addClass(this.cssPrefix+"-body-viewport").attr("tabIndex","0").toDOM(),this.bodyCellContainerDiv=Object(o.e)("div",this.bodyViewportDiv).addClass(this.cssPrefix+"-cell-container").toDOM();var e=this.canShowAggregates();this.dataTable&&(this.showProgress(),this.rowsOnPagePromise=this.getRowsToRender().then((function(n){t.pagination.total=t.dataTable.getTotal(),t.hideProgress(),t.bodyCellContainerDiv.innerHTML="",t.prevRowTotals=null;var r=0;if(n.length){var s=e?t.options.aggregates.settings.getGroups():[];r=n.length<t.pagination.pageSize?n.length:t.pagination.pageSize,n.forEach((function(n,i){if(e&&t.updateTotalsState(s,n),i<r){var o=t.renderRow(n,i);t.bodyCellContainerDiv.appendChild(o)}}));var u=t.options.aggregates&&t.options.aggregates.showGrandTotalsOnEachPage;if(e&&(t.isLastPage()||u)){var l=new i.DataRow(t.dataTable.columns,new Array(t.dataTable.columns.count));t.updateTotalsState(s,l,!0)}}if(t.options.columnWidths.autoResize!==a.a.Never)t.resizeColumns();else{var c=t.getContainerWidth();Object(o.e)(t.bodyCellContainerDiv).setStyle("width",c+"px")}return r})).catch((function(t){return console.error(t),0}))),this.bodyViewportDiv.addEventListener("scroll",(function(e){Object(o.e)(t.headerViewportDiv).setStyle("margin-left","-"+t.bodyViewportDiv.scrollLeft+"px")})),this.bodyViewportDiv.addEventListener("keydown",this.onViewportKeydown.bind(this))},e.prototype.isLastPage=function(){return this.dataTable.elasticChunks?this.dataTable.totalIsKnown()&&this.pagination.page*this.pagination.pageSize>=this.pagination.total:this.pagination.page*this.pagination.pageSize>=this.pagination.total},e.prototype.canShowAggregates=function(){if(!this.options||!this.options.aggregates||!this.options.aggregates.settings)return!1;var t=this.options.aggregates.settings;return(t.hasAggregates()||t.hasRecordCount())&&(t.hasGroups()||t.hasGrandTotals())},e.prototype.updateTotalsState=function(t,e,n){void 0===n&&(n=!1);var r=this.options.aggregates.settings;if(this.prevRowTotals&&r.hasGroups()){for(var o=-1,s=1;s<=t.length;s++){for(var a=0,u=t[s-1].columns;a<u.length;a++){var l=u[a];if(!r.compareValues(this.prevRowTotals.getValue(l),e.getValue(l))){o=s;break}}if(-1!==o)break}if(-1!==o)for(s=t.length;s>=o;s--){var c=new i.DataRow(this.dataTable.columns,this.prevRowTotals.toArray()),d=this.renderTotalsRow(s,c);this.bodyCellContainerDiv.appendChild(d)}}if(n&&r.hasGrandTotals()&&r.hasAggregates()){d=this.renderTotalsRow(0,e);this.bodyCellContainerDiv.appendChild(d)}this.prevRowTotals=e},e.prototype.applyGroupColumnTemplate=function(t,e,n){var i=t.replace(/{{\s*GroupValue\s*}}/g,e?"<span>"+e+"</span>":"-");return i=i.replace(/{{\s*GroupCount\s*}}/g,n?"<span>"+n+"</span>":"-")},e.prototype.renderTotalsRow=function(t,e){var n=this,i=this.options.aggregates.settings,r=t>0?i.getGroups()[t-1]:{columns:[],aggregates:i.getAggregates()},s=Object(o.e)("div").addClass(this.cssPrefix+"-row").addClass(this.cssPrefix+"-row-totals").addClass(this.cssPrefix+"-totals-lv"+t).data("totals-level",""+t).attr("tabindex","-1").toDOM();this.columns.getItems().forEach((function(t,i){if(t.isVisible){var o="",a=t.isRowNum?-1:n.dataTable.columns.getIndex(t.dataColumn.id);!t.isRowNum&&t.dataColumn&&r.columns.indexOf(t.dataColumn.id)>=0&&(o=e.getValue(a)),a==n.dataTable.columns.count-1&&(o=". . . . . ."),s.appendChild(n.renderCell(t,i,o,s))}}));var a=this.options.aggregates.calculator.getAggrContainer(),u=i.getAggregates().map((function(t){return t.colId})),l=i.buildGroupKey(r,e);return a.getAggregateData(t,l).then((function(o){for(var a=0,l=u;a<l.length;a++){var c=l[a];e.setValue(c,o[c])}s.innerHTML="",n.columns.getItems().forEach((function(a,l){if(a.isVisible){var c="",d=a.isRowNum?-1:n.dataTable.columns.getIndex(a.dataColumn.id);if(!a.isRowNum){var h=!1;if(a.dataColumn){var p=r.columns.indexOf(a.dataColumn.id),f=u.indexOf(a.dataColumn.id);h=t>0?p==r.columns.length-1:0==d,(p>=0||f>=0)&&(c=e.getValue(d))}var g="";if(t>0&&!(g=a.dataColumn.groupFooterColumnTemplate)&&i.hasRecordCount()&&h&&(g="{{GroupValue}} ({{GroupCount}})"),g)c=n.renderCell(a,l,c,s).firstChild.innerHTML,c=n.applyGroupColumnTemplate(g,c,o[i.COUNT_FIELD_NAME])}var m=n.renderCell(a,l,c,s);s.appendChild(m)}}))})).catch((function(t){return console.error(t)})),s},e.prototype.onViewportKeydown=function(t){if(this.options.showActiveRow){var e=this.bodyCellContainerDiv.querySelectorAll("."+this.cssPrefix+"-row").length,n=void 0;switch(t.key){case"ArrowLeft":case"ArrowRight":break;case"ArrowUp":t.preventDefault(),n=this.activeRowIndex<0||this.activeRowIndex>=e?e-1:this.activeRowIndex-1,this.activeRowIndex=n>=0?n:0;break;case"ArrowDown":t.preventDefault(),n=this.activeRowIndex<0||this.activeRowIndex>=e?0:this.activeRowIndex+1,this.activeRowIndex=n<e?n:e-1}}},e.prototype.ensureRowVisibility=function(t){var e="number"==typeof t?this.getDataRow(t):t;if(e){var n=e.getBoundingClientRect(),i=this.bodyViewportDiv.getBoundingClientRect(),r=n.top-i.top,o=n.bottom-i.top,s=this.bodyViewportDiv.clientHeight,a=window.innerHeight||document.documentElement.clientHeight;if(r>0&&o<=s&&n.top>0&&n.bottom<a)return;r<0?this.bodyViewportDiv.scrollTop=this.bodyViewportDiv.scrollTop+r:o>s&&(this.bodyViewportDiv.scrollTop=this.bodyViewportDiv.scrollTop+o-s),(n=e.getBoundingClientRect()).top<0?document.documentElement.scrollTop=document.documentElement.scrollTop+n.top:n.bottom>a&&(document.documentElement.scrollTop=document.documentElement.scrollTop+n.bottom-a)}},e.prototype.getRowsToRender=function(){return!1===this.options.paging.enabled?t.resolve(this.dataTable.getCachedRows()):this.dataTable.getRows({offset:(this.pagination.page-1)*this.pagination.pageSize,limit:this.pagination.pageSize+1}).catch((function(t){return console.error(t),[]}))},e.prototype.renderFooter=function(){var t=this;this.footerDiv=Object(o.e)("div").addClass(this.cssPrefix+"-footer").toDOM(),this.rowsOnPagePromise&&this.rowsOnPagePromise.then((function(e){t.footerDiv.innerHTML="",t.footerPaginateDiv=t.renderPageNavigator(),t.footerDiv.appendChild(t.footerPaginateDiv);var n=t.renderPageInfoBlock(e);t.footerDiv.appendChild(n)}))},e.prototype.renderPageInfoBlock=function(t){var e=Object(o.e)("div").addClass(this.cssPrefix+"-page-info").toDOM();if(this.dataTable.getTotal()>0){var n=t?(this.pagination.page-1)*this.pagination.pageSize+1:0,r=t?n+t-1:0,s=this.dataTable.getTotal().toString();if(this.dataTable.elasticChunks)this.dataTable.getCachedCount()!==this.dataTable.getTotal()&&(s="?");e.innerHTML=i.i18n.getText("GridPageInfo").replace("{FirstPageRecordNum}","<span>"+n.toString()+"</span>").replace("{LastPageRecordNum}","<span>"+r.toString()+"</span>").replace("{Total}","<span>"+s+"</span>")}return e},e.prototype.showProgress=function(){},e.prototype.hideProgress=function(){},e.prototype.getLocalIndexByGlobal=function(t){return this.pagination?t%this.pagination.pageSize:t},e.prototype.getGlobalIndexByLocal=function(t){return this.pagination?(this.pagination.page-1)*this.pagination.pageSize+t:t},e.prototype.renderRow=function(t,e){var n=this,i=this.getGlobalIndexByLocal(e),r=Object(o.e)("div").addClass(this.cssPrefix+"-row").addClass(this.cssPrefix+"-row-"+(e%2==1?"odd":"even")).data("row-idx",""+i).attr("tabindex","-1").on("click",(function(i){n.activeRowIndex=e,n.fireEvent({type:"rowClick",row:t,rowIndex:e,sourceEvent:i})})).on("dblclick",(function(i){n.fireEvent({type:"rowDbClick",row:t,rowIndex:e,sourceEvent:i})}));0==e&&r.addClass(this.cssPrefix+"-row-first");var s=r.toDOM();return this.options.showActiveRow&&e==this.activeRowIndex&&r.addClass(this.cssPrefix+"-row-active"),this.columns.getItems().forEach((function(e,r){if(e.isVisible){var o=e.isRowNum?-1:n.dataTable.columns.getIndex(e.dataColumn.id),a=e.isRowNum?i+1:t.getValue(o);s.appendChild(n.renderCell(e,r,a,s))}})),s},e.prototype.renderCell=function(t,e,n,i){var r=Object(o.e)("div").addClass(this.cssPrefix+"-cell").data("col-idx",""+e).attr("tabindex","-1").setStyle("width",t.width+"px");t.align==u.b.LEFT?r.addClass(this.cssPrefix+"-cell-align-left"):t.align==u.b.RIGHT?r.addClass(this.cssPrefix+"-cell-align-right"):t.align==u.b.CENTER&&r.addClass(this.cssPrefix+"-cell-align-center");var s=r.toDOM(),a=s.appendChild(Object(o.e)("div").addClass(this.cssPrefix+"-cell-value").toDOM());return t.cellRenderer&&t.cellRenderer(n,t,a,i),s},e.prototype.setPage=function(t){this.pagination.page=t,this.fireEvent({type:"pageChanged",page:t}),this.refresh(),this.bodyViewportDiv.focus()},e.prototype.renderPageNavigator=function(){var t=this,e=document.createElement("div");e.className=this.cssPrefix+"-pagination-wrapper";var n=this.dataTable.getTotal();if(this.options.paging&&this.options.paging.enabled&&n>0){var r=this.paginationOptions.useBootstrap?"":this.cssPrefix+"-",o=function(e){var n=e.target;if(n.hasAttribute("data-page")){var i=parseInt(n.getAttribute("data-page"));t.setPage(i)}},s=function(e,n,i,s,a){var u=document.createElement("li");if(u.className=r+"page-item",!s){a&&(u.className+=" active");var l=document.createElement("a");return l.setAttribute("href","javascript:void(0)"),l.innerHTML=n||e.toString(),l.setAttribute("data-page",""+e),l.className=r+"page-link",l.addEventListener("click",o),u.appendChild(l),u}var c=document.createElement("span");if(c.setAttribute("aria-hidden","true"),c.className=r+"page-link",i)u.className+=" disabled";else{if(t.paginationOptions.useBootstrap)(c=document.createElement("a")).setAttribute("href","javascript:void(0)"),c.setAttribute("data-page",""+e);else{var d=document.createElement("a");d.setAttribute("href","javascript:void(0)"),d.setAttribute("data-page",""+e),c=d}c.className=r+"page-link",c.addEventListener("click",o)}return c.innerHTML=n,u.appendChild(c),u};if(this.dataTable.elasticChunks){var a=this.pagination.page||1;(l=document.createElement("ul")).className=r+"pagination";var u=s(a-1,"&laquo;",1==a,!0,!1);l.appendChild(u),u=s(a+1,"&raquo;",this.isLastPage(),!0,!1),l.appendChild(u),e.appendChild(l)}else if(this.pagination.total>this.pagination.pageSize){a=this.pagination.page||1;var l,c=Math.ceil(this.pagination.total/this.pagination.pageSize)||1,d=this.paginationOptions.maxButtonCount||10,h=a-1,p=h-h%d+1,f=p+d-1;f>c&&(f=c),(l=document.createElement("ul")).className=r+"pagination";u=s(p-1,"&laquo;",1==p,!0,!1);l.appendChild(u);for(var g=p;g<=f;g++)u=s(g,g.toString(),!1,!1,g==a),l.appendChild(u);u=s(f+1,"&raquo;",f==c,!0,!1),l.appendChild(u),e.appendChild(l)}if(this.options.paging.allowPageSizeChange){var m=document.createElement("div");m.className=this.cssPrefix+"-page-sizes";var y=document.createElement("div");y.className="kfrm-select "+this.cssPrefix+"-page-sizes-select",m.appendChild(y);var v=document.createElement("select"),b=this.options.paging.pageSizeItems||[],w=new Set(b);w.add(this.options.paging.pageSize||20),Array.from(w).forEach((function(t){var e=document.createElement("option");e.value=t.toString(),e.text=t.toString(),v.appendChild(e)})),v.value=(this.pagination.pageSize||20).toString(),y.appendChild(v),v.addEventListener("change",(function(e){var n=parseInt(e.target.value);t.pagination.pageSize=n,t.pagination.page=1,t.refresh()}));var C=document.createElement("div");C.className=this.cssPrefix+"-page-sizes-label",m.appendChild(C);var D=document.createElement("span");D.innerText=i.i18n.getText("GridItemsPerPage"),C.appendChild(D),e.appendChild(m)}}return e},e.prototype.addEventListener=function(t,e){return this.eventEmitter.subscribe(t,(function(t){return e(t.data)}))},e.prototype.removeEventListener=function(t,e){this.eventEmitter.unsubscribe(t,e)},e.prototype.renderHeaderButtons=function(){var t=this;return this.options.showPlusButton?Object(o.e)("div").addClass(this.cssPrefix+"-header-btn-plus").title(this.options.plusButtonTitle||"Add").addChild("a",(function(e){return e.attr("href","javascript:void(0)").on("click",(function(e){e.preventDefault(),t.fireEvent({type:"plusButtonClick",sourceEvent:e})}))})).toDOM():Object(o.e)("span").addText("#").toDOM()},e.prototype.showLandingSlot=function(t,e){for(var n=this.headerRowDiv.querySelectorAll("[class*="+this.cssPrefix+"-table-col]"),i=[],r=1;r<n.length;r++){var o=n[r];"none"!==o.style.display&&i.push(o)}if(0===i.length)return this.landingIndex=0,void this.headerRowDiv.appendChild(this.landingSlot);var a=Object(s.g)(this.landingSlot);if(!(t>=a.x&&t<=a.x+this.landingSlot.offsetWidth)){for(var u=this.landingIndex,l=0,c=i;l<c.length;l++){var d=c[l],h=Object(s.g)(d),p=d.offsetWidth;t>h.x&&t<h.x+p&&(u=parseInt(d.getAttribute("data-col-idx"))-1)}u!=this.landingIndex&&(this.landingIndex=u,this.landingIndex<i.length?this.headerRowDiv.insertBefore(this.landingSlot,i[this.landingIndex]):this.headerRowDiv.appendChild(this.landingSlot))}},e.prototype.hideLandingSlot=function(){var t=this;this.landingIndex=-1,setTimeout((function(){t.landingSlot.parentElement&&t.landingSlot.parentElement.removeChild(t.landingSlot)}),10)},Object.defineProperty(e.prototype,"activeRowIndex",{get:function(){return this._activeRowIndex},set:function(t){if(t!==this._activeRowIndex){var e=this._activeRowIndex;this._activeRowIndex=t,this.updateActiveRow(),this.fireEvent({type:"activeRowChanged",oldValue:e,newValue:this.activeRowIndex,rowIndex:this.getGlobalIndexByLocal(this.activeRowIndex)})}},enumerable:!0,configurable:!0}),e.prototype.updateActiveRow=function(){var t=this;if(this.options.showActiveRow){this.bodyCellContainerDiv.querySelectorAll("[class*="+this.cssPrefix+"-row-active]").forEach((function(e){e.classList.remove(t.cssPrefix+"-row-active")}));var e=this.getActiveRow();e&&(e.classList.add(this.cssPrefix+"-row-active"),this.ensureRowVisibility(this.activeRowIndex))}},e.prototype.getActiveRow=function(){return this.getDataRow(this.activeRowIndex)},e.prototype.getDataRow=function(t){var e=Array.from(this.bodyCellContainerDiv.querySelectorAll("."+this.cssPrefix+"-row:not(."+this.cssPrefix+"-row-totals)"));return t>=0&&t<e.length?e[t]:null},e.prototype.focus=function(){this.bodyViewportDiv.focus()},e.prototype.resizeColumns=function(){if(this.options.columnWidths.autoResize!==a.a.Never){var t=this.bodyCellContainerDiv.style.width;this.bodyCellContainerDiv.style.visibility="hidden",this.bodyCellContainerDiv.style.width="1px",this.headerRowDiv.style.width="1px";for(var e=0,n=this.columns.getItems(),r=this.headerCellContainerDiv.querySelectorAll("."+this.cssPrefix+"-header-cell"),o=0,s=function(t){var s=n[t];if(!s.isVisible)return"continue";var l=u.options.columnWidths.autoResize!==a.a.Always&&s.dataColumn?s.dataColumn.calculatedWidth:0,c=u.bodyCellContainerDiv.querySelectorAll("."+u.cssPrefix+'-cell[data-col-idx="'+t+'"] > .'+u.cssPrefix+"-cell-value"),d=0;if(l>0)e+=l,s.width=l,c.forEach((function(t){t.parentElement.style.width=l+"px"})),r[o].style.width=l+"px";else if(0==c.length&&(r[o].style.width=null,r[o].style.whiteSpace="nowrap"),d=r[o].offsetWidth,c.length>0){c.forEach((function(t){t.parentElement.style.width=null;var e=t.parentElement.offsetWidth;e>d&&(d=e)})),d+=3;var h=s.isRowNum?u.options.columnWidths.rowNumColumn.max||500:u.options.columnWidths[s.dataColumn.type].max||2e3,p=s.isRowNum?u.options.columnWidths.rowNumColumn.min||0:u.options.columnWidths[s.dataColumn.type].min||20;d>h&&(d=h),d<p&&(d=p),i.utils.isNumericType(s.type)&&(d=Math.round(1.3*d)),e+=d,s.width=d,c.forEach((function(t){t.parentElement.style.width=d+"px"})),r[o].style.width=d+"px",s.dataColumn&&(s.dataColumn.calculatedWidth=d)}else e+=d;o++},u=this,l=0;l<this.columns.count;l++)s(l);e>0?(this.bodyCellContainerDiv.style.width=e+"px",this.headerCellContainerDiv.style.width=e+"px"):(this.bodyCellContainerDiv.style.width=t,this.headerCellContainerDiv.style.width=t),this.bodyCellContainerDiv.style.visibility=null,this.headerRowDiv.removeAttribute("style")}},e}()}).call(this,n(30))},function(t,e,n){(function(e,n){var i;i=function(){"use strict";function t(t){return"function"==typeof t}var i=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},r=0,o=void 0,s=void 0,a=function(t,e){f[r]=t,f[r+1]=e,2===(r+=2)&&(s?s(g):w())},u="undefined"!=typeof window?window:void 0,l=u||{},c=l.MutationObserver||l.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var t=setTimeout;return function(){return t(g,1)}}var f=new Array(1e3);function g(){for(var t=0;t<r;t+=2)(0,f[t])(f[t+1]),f[t]=void 0,f[t+1]=void 0;r=0}var m,y,v,b,w=void 0;function C(t,e){var n=this,i=new this.constructor(E);void 0===i[T]&&L(i);var r=n._state;if(r){var o=arguments[r-1];a((function(){return R(r,i,o,n._result)}))}else P(n,i,t,e);return i}function D(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(E);return S(e,t),e}d?w=function(){return e.nextTick(g)}:c?(y=0,v=new c(g),b=document.createTextNode(""),v.observe(b,{characterData:!0}),w=function(){b.data=y=++y%2}):h?((m=new MessageChannel).port1.onmessage=g,w=function(){return m.port2.postMessage(0)}):w=void 0===u?function(){try{var t=Function("return this")().require("vertx");return void 0!==(o=t.runOnLoop||t.runOnContext)?function(){o(g)}:p()}catch(t){return p()}}():p();var T=Math.random().toString(36).substring(2);function E(){}var x=void 0;function I(e,n,i){n.constructor===e.constructor&&i===C&&n.constructor.resolve===D?function(t,e){1===e._state?M(t,e._result):2===e._state?_(t,e._result):P(e,void 0,(function(e){return S(t,e)}),(function(e){return _(t,e)}))}(e,n):void 0===i?M(e,n):t(i)?function(t,e,n){a((function(t){var i=!1,r=function(t,e,n,i){try{t.call(e,n,i)}catch(t){return t}}(n,e,(function(n){i||(i=!0,e!==n?S(t,n):M(t,n))}),(function(e){i||(i=!0,_(t,e))}),t._label);!i&&r&&(i=!0,_(t,r))}),t)}(e,n,i):M(e,n)}function S(t,e){if(t===e)_(t,new TypeError("You cannot resolve a promise with itself"));else if(r=typeof(i=e),null===i||"object"!==r&&"function"!==r)M(t,e);else{var n=void 0;try{n=e.then}catch(e){return void _(t,e)}I(t,e,n)}var i,r}function O(t){t._onerror&&t._onerror(t._result),A(t)}function M(t,e){t._state===x&&(t._result=e,t._state=1,0!==t._subscribers.length&&a(A,t))}function _(t,e){t._state===x&&(t._state=2,t._result=e,a(O,t))}function P(t,e,n,i){var r=t._subscribers,o=r.length;t._onerror=null,r[o]=e,r[o+1]=n,r[o+2]=i,0===o&&t._state&&a(A,t)}function A(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var i=void 0,r=void 0,o=t._result,s=0;s<e.length;s+=3)i=e[s],r=e[s+n],i?R(n,i,r,o):r(o);t._subscribers.length=0}}function R(e,n,i,r){var o=t(i),s=void 0,a=void 0,u=!0;if(o){try{s=i(r)}catch(t){u=!1,a=t}if(n===s)return void _(n,new TypeError("A promises callback cannot return that same promise."))}else s=r;n._state!==x||(o&&u?S(n,s):!1===u?_(n,a):1===e?M(n,s):2===e&&_(n,s))}var k=0;function L(t){t[T]=k++,t._state=void 0,t._result=void 0,t._subscribers=[]}var N=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(E),this.promise[T]||L(this.promise),i(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?M(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&M(this.promise,this._result))):_(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===x&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,i=n.resolve;if(i===D){var r=void 0,o=void 0,s=!1;try{r=t.then}catch(t){s=!0,o=t}if(r===C&&t._state!==x)this._settledAt(t._state,e,t._result);else if("function"!=typeof r)this._remaining--,this._result[e]=t;else if(n===j){var a=new n(E);s?_(a,o):I(a,t,r),this._willSettleAt(a,e)}else this._willSettleAt(new n((function(e){return e(t)})),e)}else this._willSettleAt(i(t),e)},t.prototype._settledAt=function(t,e,n){var i=this.promise;i._state===x&&(this._remaining--,2===t?_(i,n):this._result[e]=n),0===this._remaining&&M(i,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;P(t,void 0,(function(t){return n._settledAt(1,e,t)}),(function(t){return n._settledAt(2,e,t)}))},t}(),j=function(){function e(t){this[T]=k++,this._result=this._state=void 0,this._subscribers=[],E!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(t,e){try{e((function(e){S(t,e)}),(function(e){_(t,e)}))}catch(e){_(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var n=this,i=n.constructor;return t(e)?n.then((function(t){return i.resolve(e()).then((function(){return t}))}),(function(t){return i.resolve(e()).then((function(){throw t}))})):n.then(e,e)},e}();return j.prototype.then=C,j.all=function(t){return new N(this,t).promise},j.race=function(t){var e=this;return i(t)?new e((function(n,i){for(var r=t.length,o=0;o<r;o++)e.resolve(t[o]).then(n,i)})):new e((function(t,e){return e(new TypeError("You must pass an array to race."))}))},j.resolve=D,j.reject=function(t){var e=new this(E);return _(e,t),e},j._setScheduler=function(t){s=t},j._setAsap=function(t){a=t},j._asap=a,j.polyfill=function(){var t=void 0;if(void 0!==n)t=n;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var i=null;try{i=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===i&&!e.cast)return}t.Promise=j},j.Promise=j,j},t.exports=i()}).call(this,n(26),n(27))},function(t,e,n){(function(e,n){var i;i=function(){"use strict";function t(t){return"function"==typeof t}var i=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},r=0,o=void 0,s=void 0,a=function(t,e){f[r]=t,f[r+1]=e,2===(r+=2)&&(s?s(g):w())},u="undefined"!=typeof window?window:void 0,l=u||{},c=l.MutationObserver||l.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var t=setTimeout;return function(){return t(g,1)}}var f=new Array(1e3);function g(){for(var t=0;t<r;t+=2)(0,f[t])(f[t+1]),f[t]=void 0,f[t+1]=void 0;r=0}var m,y,v,b,w=void 0;function C(t,e){var n=this,i=new this.constructor(E);void 0===i[T]&&L(i);var r=n._state;if(r){var o=arguments[r-1];a((function(){return R(r,i,o,n._result)}))}else P(n,i,t,e);return i}function D(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(E);return S(e,t),e}d?w=function(){return e.nextTick(g)}:c?(y=0,v=new c(g),b=document.createTextNode(""),v.observe(b,{characterData:!0}),w=function(){b.data=y=++y%2}):h?((m=new MessageChannel).port1.onmessage=g,w=function(){return m.port2.postMessage(0)}):w=void 0===u?function(){try{var t=Function("return this")().require("vertx");return void 0!==(o=t.runOnLoop||t.runOnContext)?function(){o(g)}:p()}catch(t){return p()}}():p();var T=Math.random().toString(36).substring(2);function E(){}var x=void 0;function I(e,n,i){n.constructor===e.constructor&&i===C&&n.constructor.resolve===D?function(t,e){1===e._state?M(t,e._result):2===e._state?_(t,e._result):P(e,void 0,(function(e){return S(t,e)}),(function(e){return _(t,e)}))}(e,n):void 0===i?M(e,n):t(i)?function(t,e,n){a((function(t){var i=!1,r=function(t,e,n,i){try{t.call(e,n,i)}catch(t){return t}}(n,e,(function(n){i||(i=!0,e!==n?S(t,n):M(t,n))}),(function(e){i||(i=!0,_(t,e))}),t._label);!i&&r&&(i=!0,_(t,r))}),t)}(e,n,i):M(e,n)}function S(t,e){if(t===e)_(t,new TypeError("You cannot resolve a promise with itself"));else if(r=typeof(i=e),null===i||"object"!==r&&"function"!==r)M(t,e);else{var n=void 0;try{n=e.then}catch(e){return void _(t,e)}I(t,e,n)}var i,r}function O(t){t._onerror&&t._onerror(t._result),A(t)}function M(t,e){t._state===x&&(t._result=e,t._state=1,0!==t._subscribers.length&&a(A,t))}function _(t,e){t._state===x&&(t._state=2,t._result=e,a(O,t))}function P(t,e,n,i){var r=t._subscribers,o=r.length;t._onerror=null,r[o]=e,r[o+1]=n,r[o+2]=i,0===o&&t._state&&a(A,t)}function A(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var i=void 0,r=void 0,o=t._result,s=0;s<e.length;s+=3)i=e[s],r=e[s+n],i?R(n,i,r,o):r(o);t._subscribers.length=0}}function R(e,n,i,r){var o=t(i),s=void 0,a=void 0,u=!0;if(o){try{s=i(r)}catch(t){u=!1,a=t}if(n===s)return void _(n,new TypeError("A promises callback cannot return that same promise."))}else s=r;n._state!==x||(o&&u?S(n,s):!1===u?_(n,a):1===e?M(n,s):2===e&&_(n,s))}var k=0;function L(t){t[T]=k++,t._state=void 0,t._result=void 0,t._subscribers=[]}var N=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(E),this.promise[T]||L(this.promise),i(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?M(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&M(this.promise,this._result))):_(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===x&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,i=n.resolve;if(i===D){var r=void 0,o=void 0,s=!1;try{r=t.then}catch(t){s=!0,o=t}if(r===C&&t._state!==x)this._settledAt(t._state,e,t._result);else if("function"!=typeof r)this._remaining--,this._result[e]=t;else if(n===j){var a=new n(E);s?_(a,o):I(a,t,r),this._willSettleAt(a,e)}else this._willSettleAt(new n((function(e){return e(t)})),e)}else this._willSettleAt(i(t),e)},t.prototype._settledAt=function(t,e,n){var i=this.promise;i._state===x&&(this._remaining--,2===t?_(i,n):this._result[e]=n),0===this._remaining&&M(i,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;P(t,void 0,(function(t){return n._settledAt(1,e,t)}),(function(t){return n._settledAt(2,e,t)}))},t}(),j=function(){function e(t){this[T]=k++,this._result=this._state=void 0,this._subscribers=[],E!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(t,e){try{e((function(e){S(t,e)}),(function(e){_(t,e)}))}catch(e){_(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var n=this,i=n.constructor;return t(e)?n.then((function(t){return i.resolve(e()).then((function(){return t}))}),(function(t){return i.resolve(e()).then((function(){throw t}))})):n.then(e,e)},e}();return j.prototype.then=C,j.all=function(t){return new N(this,t).promise},j.race=function(t){var e=this;return i(t)?new e((function(n,i){for(var r=t.length,o=0;o<r;o++)e.resolve(t[o]).then(n,i)})):new e((function(t,e){return e(new TypeError("You must pass an array to race."))}))},j.resolve=D,j.reject=function(t){var e=new this(E);return _(e,t),e},j._setScheduler=function(t){s=t},j._setAsap=function(t){a=t},j._asap=a,j.polyfill=function(){var t=void 0;if(void 0!==n)t=n;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var i=null;try{i=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===i&&!e.cast)return}t.Promise=j},j.Promise=j,j},t.exports=i()}).call(this,n(40),n(41))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i=function(){function t(t,e){this.request=t,this.promise=e}return t.prototype.getPromise=function(){return this.promise},t.prototype.getRequest=function(){return this.request},t.prototype.then=function(t,e){return this.promise.then(t,e)},t.prototype.catch=function(t){return this.promise.catch(t)},t.prototype.finally=function(t){return this.promise.finally(t)},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var i,r=n(0),o=n(9),s=n(7),a=(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},i(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(t){function e(){var e=t.call(this)||this;return e.name="DateTime",e}return a(e,t),e.prototype.validate=function(t,e){if(!r.utils.IsDefinedAndNotNull(e)||""==e)return{successed:!0};if(r.utils.getDateDataTypes().indexOf(t.dataType)>=0)try{var n=Object(s.a)(t.dataType);r.utils.strToDateTime(e,n)}catch(t){return{successed:!1,messages:[r.i18n.getText("DateTimeError")]}}return{successed:!0}},e}(o.a)},function(t,e,n){n(35),t.exports=n(42)},function(t,e,n){n(36),n(37),n(38),n(39)},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e){var n,i,r=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var u,l=[],c=!1,d=-1;function h(){c&&u&&(c=!1,u.length?l=u.concat(l):d=-1,l.length&&p())}function p(){if(!c){var t=a(h);c=!0;for(var e=l.length;e;){for(u=l,l=[];++d<e;)u&&u[d].run();d=-1,e=l.length}u=null,c=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function g(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new f(t,e)),1!==l.length||c||a(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=g,r.addListener=g,r.once=g,r.off=g,r.removeListener=g,r.removeAllListeners=g,r.emit=g,r.prependListener=g,r.prependOnceListener=g,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";n.r(e),n.d(e,"core",(function(){return o})),n.d(e,"ui",(function(){return s})),n.d(e,"crud",(function(){return i}));var i={};n.r(i),n.d(i,"TextDataFilter",(function(){return a.a})),n.d(i,"EntityEditForm",(function(){return u.a})),n.d(i,"EntityEditFormBuilder",(function(){return p})),n.d(i,"TextFilterWidget",(function(){return c})),n.d(i,"ProgressBar",(function(){return f})),n.d(i,"DataContext",(function(){return y})),n.d(i,"EasyDataServerLoader",(function(){return g})),n.d(i,"Validator",(function(){return v.a})),n.d(i,"TypeValidator",(function(){return w})),n.d(i,"RequiredValidator",(function(){return D})),n.d(i,"EasyDataViewDispatcher",(function(){return x})),n.d(i,"RootDataView",(function(){return E})),n.d(i,"EntityDataView",(function(){return T}));var r,o=n(0),s=n(3),a=n(22),u=n(23),l=n(7),c=function(){function t(t,e,n,i){var r=this;this.slot=t,this.grid=e,this.filter=n,this.options={focus:!1,instantMode:!1,instantTimeout:1e3},this.options=o.utils.assignDeep(this.options,i||{});var a=this.grid.cellRendererStore.getDefaultRendererByType(s.CellRendererType.STRING);this.grid.cellRendererStore.setDefaultRenderer(s.CellRendererType.STRING,(function(t,e,n,i){return r.highlightCellRenderer(a,t,e,n,i)}));var u=this.grid.cellRendererStore.getDefaultRendererByType(s.CellRendererType.NUMBER);this.grid.cellRendererStore.setDefaultRenderer(s.CellRendererType.NUMBER,(function(t,e,n,i){return r.highlightCellRenderer(u,t,e,n,i)})),this.render()}return t.prototype.render=function(){var t=this,e=s.browserUtils.IsIE()?"kfrm-fields-ie is-horizontal":"kfrm-fields is-horizontal",n=s.browserUtils.IsIE()||s.browserUtils.IsEdge();Object(s.domel)(this.slot).addClass(e).addChild("div",(function(e){e.addClass("control").addChild("input",(function(e){t.filterInput=e.toDOM(),e.attr("placeholder",o.i18n.getText("SearchInputPlaceholder")).type("text"),e.on("keydown",t.inputKeydownHandler.bind(t)),t.options.instantMode&&e.on("keyup",t.inputKeyupHandler.bind(t))})),n||e.addClass("has-icons-right").addChild("span",(function(e){e.addClass("icon").addClass("is-right").addClass("is-clickable").html("&#x1F5D9;").on("click",t.clearButtonClickHander.bind(t))}))})),this.options.instantMode||Object(s.domel)(this.slot).addChild("button",(function(e){return e.addClass("kfrm-button").addText(o.i18n.getText("SearchBtn")).on("click",t.searchButtonClickHandler.bind(t))})),this.options.focus&&this.filterInput.focus()},t.prototype.inputKeydownHandler=function(t){13==t.keyCode&&this.applyFilter(!0)},t.prototype.inputKeyupHandler=function(){var t=this;this.applyFilterTimeout&&clearTimeout(this.applyFilterTimeout),this.applyFilterTimeout=setTimeout((function(){t.applyFilter(!0)}),this.options.instantTimeout)},t.prototype.clearButtonClickHander=function(){this.filterInput.value="",this.filterInput.focus(),this.applyFilter(!0)},t.prototype.searchButtonClickHandler=function(){this.applyFilter(!0)},t.prototype.applyFilter=function(t){var e=this;this.applyFilterTimeout&&clearTimeout(this.applyFilterTimeout);var n=this.filter.getValue();return(!t||n!=this.filterInput.value)&&(this.filter.apply(this.filterInput.value).then((function(t){e.grid.setData(t)})),!0)},t.prototype.highlightCellRenderer=function(t,e,n,i,r){if((o.utils.isNumericType(n.type)||o.utils.getStringDataTypes().indexOf(n.type)>=0)&&e){e=n.dataColumn&&n.dataColumn.displayFormat&&s.DFMT_REGEX.test(n.dataColumn.displayFormat)?n.dataColumn.displayFormat.replace(s.DFMT_REGEX,(function(t,n){return o.i18n.numberToStr(e,n)})):e.toLocaleString();var a=this.highlightText(e.toString());if(a instanceof HTMLElement)return i.title=e,void i.appendChild(a)}t(e,n,i,r)},t.prototype.highlightText=function(t){var e=t.toLowerCase(),n=this.filter.getValue().toString();if(n&&n.length>0&&t&&t.length>0){for(var i=[],r=n.split("||").map((function(t){return t.trim().toLowerCase()})),o=0;o<r.length;o++){var s=0,a=r[o];if(a.length){if(a===e)return(p=document.createElement("span")).style.backgroundColor="yellow",p.innerText=t,p;for(;s<t.length-1;){var u=e.indexOf(a,s);u>=0?(i.push({index:u,length:r[o].length}),s=u+a.length):s++}}}if(i.length>0){i.sort((function(t,e){return t.index>e.index?1:t.index==e.index2?0:-1}));for(o=0;o<i.length-1;){var l=i[o+1].index-(i[o].index+i[o].length);if(l<0){var c=i[o+1].length+l;c>0&&(i[o].length+=c),i.splice(o+1,1)}else o++}var d=document.createElement("div");for(o=0;o<i.length;o++){if(0===o){var h=document.createTextNode(t.substring(0,i[o].index));d.appendChild(h)}var p;(p=document.createElement("span")).style.backgroundColor="yellow",p.innerText=t.substring(i[o].index,i[o].index+i[o].length),d.appendChild(p);var f=o<i.length-1?document.createTextNode(t.substring(i[o].index+i[o].length,i[o+1].index)):document.createTextNode(t.substring(i[o].index+i[o].length));d.appendChild(f)}return d}}return t},t}(),d=function(){return d=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},d.apply(this,arguments)},h=s.browserUtils.IsIE(),p=function(){function t(t,e){this.context=t,this.params=e,this.params=e||{},this.reset()}return t.prototype.reset=function(){this.form=new u.a(this.context)},t.prototype.setupLookupField=function(t,e,n,i){var r=this,a=this.context.getMetaData().getRootEntity().subEntities.filter((function(t){return t.id==e.lookupEntity}))[0],u=this.context.getMetaData().getAttributeById(e.dataAttr);if(u){n=n||!u.isEditable,i=this.params.values?this.params.values.getValue(u.id):void 0;var l,p=h?"kfrm-fields-ie is-horizontal":"kfrm-fields is-horizontal";Object(s.domel)(t).addChild("div",(function(t){t.addClass(p).addChild("input",(function(t){l=t.toDOM(),t.attr("readonly",""),t.name(u.id),t.type(r.resolveInputType(u.dataType)),t.value(o.utils.IsDefinedAndNotNull(i)?i.toString():"")})),n||t.addChild("button",(function(t){return t.addClass("kfrm-button").attr("title",o.i18n.getText("NavigationBtnTitle")).addText("...").on("click",(function(n){var i=new o.EasyDataTable({loader:{loadChunk:function(t){return r.context.getDataLoader().loadChunk(d(d({},t),{id:a.id}))}}});r.context.getDataLoader().loadChunk({offset:0,limit:1e3,needTotal:!0,sourceId:a.id}).then((function(n){for(var u,d=function(t){var e=a.attributes.filter((function(e){return e.id==t.id&&(e.isPrimaryKey||e.showInLookup)}));e.length&&i.columns.add(t)},h=0,p=n.table.columns.getItems();h<p.length;h++){d(p[h])}i.setTotal(n.total);for(var f=0,g=n.table.getCachedRows();f<g.length;f++){var m=g[f];i.addRow(m)}var y,v=new s.DefaultDialogService,b=null,w=null,C=Object(s.domel)("div").addClass("kfrm-form").addChild("div",(function(t){return t.addClass("kfrm-field").addChild("label",(function(t){return t.addText(o.i18n.getText("LookupSelectedItem")).toDOM()})).addChild("div",(function(t){return w=t.addText("None").toDOM()}))})).addChild("div",(function(t){return y=t.toDOM()})).addChild("div",(function(t){return t.addClass("kfrm-control").addChild("div",(function(t){return b=t.toDOM()}))})).toDOM(),D=l.value,T=function(t){w.innerHTML=i.columns.getItems().map((function(e){return"<b>"+e.label+":</b> "+function(t,e){return t instanceof o.DataRow?t.getValue(e):t[e.substring(e.lastIndexOf(".")+1)]}(t,e.id)})).join(", ")};if(D){var E=a.getFirstPrimaryAttr(),x=E.id.substring(E.id.lastIndexOf(".")+1);r.context.fetchRecord((u={},u[x]=D,u),a.id).then((function(t){t.entity&&T(t.entity)})).catch((function(t){console.error(t)}))}var I=new s.EasyGrid({slot:b,dataTable:i,fixHeightOnFirstRender:!0,paging:{pageSize:10},onActiveRowChanged:function(t){I.getData().getRow(t.rowIndex).then((function(t){D=t.getValue(e.lookupDataAttr),T(t)}))}});v.open({title:o.i18n.getText("LookupDlgCaption").replace("{entity}",a.caption),body:C,arrangeParents:!0,beforeOpen:function(){var t=r.context.createFilter(a.id,I.getData(),!0);new c(y,I,t,{instantMode:!0,focus:!0})},onSubmit:function(){return l.value=D,!0},onDestroy:function(){I.destroy(),t.toDOM().focus()}})}))}))}))}))}},t.prototype.setupDateTimeField=function(t,e,n,i,r){var a,u=this,c=h?"kfrm-fields-ie is-horizontal":"kfrm-fields is-horizontal",d=l.a(e.dataType),p=d.replace("yyyy","9999").replace("MM","99").replace("dd","99").replace("HH","99").replace("mm","99").replace("ss","99");Object(s.domel)(t).addChild("div",(function(t){t.addClass(c).addChild("input",(function(t){a=t.toDOM(),t.name(e.id),t.type(r?"hidden":u.resolveInputType(e.dataType)),i?t.attr("readonly",""):(t.mask(p),t.on("keypress",(function(t){return u.applySumbit(t)})).on("input",(function(e){t.removeClass("is-invalid");try{o.utils.strToDateTime(a.value,d)}catch(e){t.addClass("is-invalid")}})).on("blur",(function(t){a.value===p.replace(/[9]/g,"_")&&(a.value="")}))),t.value(o.utils.IsDefinedAndNotNull(n)?o.utils.dateTimeToStr(n,d):"")})),i||t.addChild("button",(function(t){return t.addClass("kfrm-button").attr("title",o.i18n.getText(e.dataType!==o.DataType.Time?"CalendarBtnTitle":"TimerBtnTitle")).addChild("i",(function(t){return t.addClass(e.dataType!==o.DataType.Time?"ed-calendar-icon":"ed-timer-icon")})).on("click",(function(t){var n;try{n=a.value.length?e.dataType!==o.DataType.Time?o.utils.strToDateTime(a.value,d):o.utils.strToTime(a.value):new Date((new Date).setSeconds(0))}catch(t){n=new Date((new Date).setSeconds(0))}var i={zIndex:9999999999,showCalendar:e.dataType!==o.DataType.Time,showTimePicker:e.dataType!==o.DataType.Date,onApply:function(t){t.setSeconds(0),t.setMilliseconds(0),a.value=o.utils.dateTimeToStr(t,d)}},r=new s.DefaultDateTimePicker(i);r.setDateTime(n),r.show(t.target)})).toDOM()}))}))},t.prototype.setupListField=function(t,e,n,i,r){var o=this;Object(s.domel)(t).addChild("div",(function(t){return t.addClass("kfrm-select full-width").addChild("select",(function(t){if(r&&t.attr("readonly",""),t.attr("name",e.id),t.on("keypress",(function(t){return o.applySumbit(t)})),i)for(var s=0;s<i.length;s++){var a=i[s];t.addOption({value:a.id,title:a.text,selected:0===s})}t.value(n)}))}))},t.prototype.setupFileField=function(t,e,n,i){var r=this;Object(s.domel)(t).addChild("input",(function(t){n&&t.attr("readonly",""),t.name(e.id).type(r.resolveInputType(e.dataType)),t.attr("accept",i)}))},t.prototype.setupTextField=function(t,e,n,i,r){var a=this;Object(s.domel)(t).addChild("input",(function(t){i&&t.attr("readonly",""),t.type(r?"hidden":a.resolveInputType(e.dataType)),t.name(e.id).type(a.resolveInputType(e.dataType)),e.dataType==o.DataType.Bool?n&&t.attr("checked",""):t.on("keypress",(function(t){return a.applySumbit(t)})).value(o.utils.IsDefinedAndNotNull(n)?n.toString():"")}))},t.prototype.setupTextArea=function(t,e,n,i){Object(s.domel)(t).addChild("textarea",(function(t){i&&t.attr("readonly",""),t.attr("name",e.id),t.setStyle("height","120px"),t.value(o.utils.IsDefinedAndNotNull(n)?n.toString():"")}))},t.prototype.addFormField=function(t,e){var n=this.params.values&&e.kind!==o.EntityAttrKind.Lookup?this.params.values.getValue(e.id):this.params.isEditForm?void 0:e.defaultValue,i=this.resolveEditor(e),r=this.params.isEditForm&&(e.isPrimaryKey||!e.isEditable),a=!e.isNullable;h&&(t=Object(s.domel)("div",t).addClass("kfrm-field-ie").toDOM()),Object(s.domel)(t).addChild("label",(function(t){t.attr("for",e.id),t.addHtml(e.caption+" "+(a?'<sup style="color: red">*</sup>':"")+": "),e.description&&t.addChild("div",(function(t){return t.attr("title",e.description).addClass("question-mark").setStyle("vertical-align","middle").setStyle("display","inline-block")}))}));var u=e.isPrimaryKey;if(e.kind!==o.EntityAttrKind.Lookup)switch(i.tag){case o.EditorTag.DateTime:this.setupDateTimeField(t,e,n,r,u);break;case o.EditorTag.List:this.setupListField(t,e,n,i.values,r);break;case o.EditorTag.File:this.setupFileField(t,e,r,i.accept);break;case o.EditorTag.Edit:default:i.multiline?this.setupTextArea(t,e,n,r):this.setupTextField(t,e,n,r,u)}else this.setupLookupField(t,e,r,n)},t.prototype.resolveInputType=function(t){return t===o.DataType.Bool?"checkbox":t===o.DataType.Blob?"file":"text"},t.prototype.resolveEditor=function(t){var e=t.defaultEditor||new o.ValueEditor;return e.tag==o.EditorTag.Unknown&&(o.utils.getDateDataTypes().indexOf(t.dataType)>=0?e.tag=o.EditorTag.DateTime:e.tag=o.EditorTag.Edit),e},t.prototype.applySumbit=function(t){return 13===t.keyCode&&(this.sumbitCallback&&this.sumbitCallback(),!1)},t.prototype.onSubmit=function(t){return this.sumbitCallback=t,this},t.prototype.build=function(){var t,e=Object(s.domel)("div").addClass("kfrm-form").addChild("div",(function(t){return t.addClass("errors-block").toDOM()})).addChild("div",(function(e){e.addClass(h?"kfrm-fields-ie col-ie-1-4 label-align-right":"kfrm-fields col-a-1 label-align-right"),t=e})).toDOM();this.form.setHtmlInt(e);for(var n=0,i=this.context.getActiveEntity().attributes;n<i.length;n++){var r=i[n];(this.params.isEditForm||r.showOnCreate)&&((r.isPrimaryKey||!this.params.isEditForm||r.showOnEdit)&&this.addFormField(t.toDOM(),r))}return this.form},t}(),f=function(){function t(t){this.slot=t,this.hide(),this.slot.classList.add("ed-progress-bar")}return t.prototype.show=function(){this.slot.style.removeProperty("display")},t.prototype.hide=function(){this.slot.style.display="none"},t}(),g=function(){function t(t){this.context=t}return t.prototype.loadChunk=function(t){var e=this,n=this.context.resolveEndpoint("FetchDataset",{sourceId:t.sourceId||this.context.getActiveEntity().id});return delete t.sourceId,this.context.startProcess(),this.context.getHttpClient().post(n,t).then((function(e){for(var n=new o.EasyDataTable({chunkSize:1e3}),i=e.resultSet,r=0,s=i.cols;r<s.length;r++){var a=s[r];n.columns.add(a)}for(var u=0,l=i.rows;u<l.length;u++){var c=l[u];n.addRow(c)}var d=0;return e.meta&&e.meta.totalRecords&&(d=e.meta.totalRecords),{table:n,total:d,hasNext:!t.needTotal||t.offset+t.limit<d}})).finally((function(){e.context.endProcess()}))},t}(),m=function(){return m=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},m.apply(this,arguments)},y=function(){function t(t){this.endpoints=new Map,this.endpointVarsRegex=/\{.*?\}/g,this.options=t||{},this.http=new o.HttpClient,this.model=new o.MetaData,this.model.id=t.metaDataId||"__default",this.dataLoader=new g(this);var e=m({loader:this.dataLoader},t.dataTable);this.data=new o.EasyDataTable(e),this.setDefaultEndpoints(this.options.endpoint||"/api/easydata")}return t.prototype.getActiveEntity=function(){return this.activeEntity},t.prototype.setActiveSource=function(t){this.activeEntity=this.model.getRootEntity().subEntities.filter((function(e){return e.id==t}))[0]},t.prototype.getMetaData=function(){return this.model},t.prototype.getData=function(){return this.data},t.prototype.getDataLoader=function(){return this.dataLoader},t.prototype.createFilter=function(t,e,n){return new a.a(this.dataLoader,e||this.getData(),t||this.activeEntity.id,n)},t.prototype.loadMetaData=function(){var t=this,e=this.resolveEndpoint("GetMetaData");return this.startProcess(),this.http.get(e).then((function(e){return e.model&&t.model.loadFromData(e.model),t.model})).catch((function(t){return console.error("Error: "+t.message+". Source: "+t.sourceError),null})).finally((function(){t.endProcess()}))},t.prototype.getHttpClient=function(){return this.http},t.prototype.fetchDataset=function(){var t=this;return this.data.clear(),this.dataLoader.loadChunk({offset:0,limit:this.data.chunkSize,needTotal:!0}).then((function(e){for(var n=0,i=e.table.columns.getItems();n<i.length;n++){var r=i[n];t.data.columns.add(r)}t.data.setTotal(e.total);for(var o=0,s=e.table.getCachedRows();o<s.length;o++){var a=s[o];t.data.addRow(a)}return t.data}))},t.prototype.fetchRecord=function(t,e){var n=this,i=this.resolveEndpoint("FetchRecord",{sourceId:e||this.activeEntity.id});return this.startProcess(),this.http.get(i,{queryParams:t}).finally((function(){return n.endProcess()}))},t.prototype.createRecord=function(t,e){var n=this,i=this.resolveEndpoint("CreateRecord",{sourceId:e||this.activeEntity.id});return this.startProcess(),this.http.post(i,t,{dataType:"json"}).finally((function(){return n.endProcess()}))},t.prototype.updateRecord=function(t,e){var n=this,i=this.resolveEndpoint("UpdateRecord",{sourceId:e||this.activeEntity.id});return this.startProcess(),this.http.post(i,t,{dataType:"json"}).finally((function(){return n.endProcess()}))},t.prototype.deleteRecord=function(t,e){var n=this,i=this.resolveEndpoint("DeleteRecord",{sourceId:e||this.activeEntity.id});return this.startProcess(),this.http.post(i,t,{dataType:"json"}).finally((function(){return n.endProcess()}))},t.prototype.setEndpoint=function(t,e){this.endpoints.set(t,e)},t.prototype.setEnpointIfNotExist=function(t,e){this.endpoints.has(t)||this.endpoints.set(t,e)},t.prototype.resolveEndpoint=function(t,e){e=e||{};var n=this.endpoints.get(t);if(!n)throw t+" endpoint is not defined";var i=n.match(this.endpointVarsRegex);if(i)for(var r=0,o=i;r<o.length;r++){var s=o[r],a=s.substring(1,s.length-1),u=e[a];if(!u)if("modelId"==a)u=this.model.getId();else{if("sourceId"!=a)throw"Parameter ["+a+"] is not defined";u=this.activeEntity.id}n=n.replace(s,u)}return n},t.prototype.startProcess=function(){this.options.onProcessStart&&this.options.onProcessStart()},t.prototype.endProcess=function(){this.options.onProcessEnd&&this.options.onProcessEnd()},t.prototype.setDefaultEndpoints=function(t){this.setEnpointIfNotExist("GetMetaData",Object(o.combinePath)(t,"models/{modelId}")),this.setEnpointIfNotExist("FetchDataset",Object(o.combinePath)(t,"models/{modelId}/sources/{sourceId}/fetch")),this.setEnpointIfNotExist("FetchRecord",Object(o.combinePath)(t,"models/{modelId}/sources/{sourceId}/fetch")),this.setEnpointIfNotExist("CreateRecord",Object(o.combinePath)(t,"models/{modelId}/sources/{sourceId}/create")),this.setEnpointIfNotExist("UpdateRecord",Object(o.combinePath)(t,"models/{modelId}/sources/{sourceId}/update")),this.setEnpointIfNotExist("DeleteRecord",Object(o.combinePath)(t,"models/{modelId}/sources/{sourceId}/delete"))},t}(),v=n(9),b=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),w=function(t){function e(){var e=t.call(this)||this;return e.name="Type",e}return b(e,t),e.prototype.validate=function(t,e){if(!o.utils.IsDefinedAndNotNull(e)||""==e)return{successed:!0};if(o.utils.isNumericType(t.dataType)){if(!o.utils.isNumeric(e))return{successed:!1,messages:[o.i18n.getText("NumberError")]};if(o.utils.isIntType(t.dataType)&&!Number.isInteger(Number.parseFloat(e)))return{successed:!1,messages:[o.i18n.getText("IntNumberError")]}}return{successed:!0}},e}(v.a),C=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),D=function(t){function e(){var e=t.call(this)||this;return e.name="Required",e}return C(e,t),e.prototype.validate=function(t,e){return t.isNullable||o.utils.IsDefinedAndNotNull(e)&&""!==e?{successed:!0}:{successed:!1,messages:[o.i18n.getText("RequiredError")]}},e}(v.a),T=function(){function t(t,e,n,i){var r=this;this.slot=t,this.context=e,this.basePath=n,this.options={showFilterBox:!0,showBackToEntities:!0},this.defaultValidators=[new D,new w],this.options=o.utils.assignDeep(this.options,i||{}),this.dlg=new s.DefaultDialogService;var a=this.context.getActiveEntity();if(!a)throw"Can't find active entity for "+window.location.pathname;this.slot.innerHTML+="<h1>"+(a.captionPlural||a.caption)+"</h1>",this.options.showBackToEntities&&Object(s.domel)(this.slot).addChild("a",(function(t){return t.attr("href","javascript:void(0)").text("← "+o.i18n.getText("BackToEntities")).on("click",(function(t){t.preventDefault(),Object(l.c)(r.basePath)}))})),this.renderGrid()}return t.prototype.syncGridColumnHandler=function(t){if(t.dataColumn){var e=this.context.getMetaData().getAttributeById(t.dataColumn.id);e&&(t.isVisible=e.showOnView)}},t.prototype.renderGrid=function(){var t=this;this.context.fetchDataset().then((function(e){var n=document.createElement("div");if(t.slot.appendChild(n),n.id="Grid",t.grid=new s.EasyGrid(o.utils.assignDeep({slot:n,dataTable:e,paging:{pageSize:15,allowPageSizeChange:!0,pageSizeItems:[15,30,50,100,200]},showPlusButton:t.context.getActiveEntity().isEditable,plusButtonTitle:o.i18n.getText("AddRecordBtnTitle"),showActiveRow:!1,onPlusButtonClick:t.addClickHandler.bind(t),onGetCellRenderer:t.manageCellRenderer.bind(t),onRowDbClick:t.rowDbClickHandler.bind(t),onSyncGridColumn:t.syncGridColumnHandler.bind(t)},t.options.grid||{})),t.options.showFilterBox){var i,r=Object(s.domel)("div").addClass("kfrm-form").setStyle("margin","10px 0px").addChild("div",(function(t){return i=t.toDOM()})).toDOM();t.slot.insertBefore(r,n);var a=t.context.createFilter();t.filterWidget=new c(i,t.grid,a)}}))},t.prototype.manageCellRenderer=function(t,e){var n=this;if(t.isRowNum)return t.width=110,function(t,e,i,r){var a=Object(s.domel)("div",i).addClass("keg-cell-value");n.context.getActiveEntity().isEditable&&a.addChild("a",(function(t){return t.attr("href","javascript:void(0)").text(o.i18n.getText("EditBtn")).on("click",(function(t){return n.editClickHandler(t,parseInt(r.getAttribute("data-row-idx")))}))})).addChild("span",(function(t){return t.text(" | ")})).addChild("a",(function(t){return t.attr("href","javascript:void(0)").text(o.i18n.getText("DeleteBtn")).on("click",(function(t){return n.deleteClickHandler(t,parseInt(r.getAttribute("data-row-idx")))}))}))}},t.prototype.addClickHandler=function(){var t=this,e=this.context.getActiveEntity(),n=new p(this.context).onSubmit((function(){return i.submit()})).build();n.useValidators(this.defaultValidators);var i=this.dlg.open({title:o.i18n.getText("AddDlgCaption").replace("{entity}",e.caption),body:n.getHtml(),onSubmit:function(){if(!n.validate())return!1;n.getData().then((function(e){return t.context.createRecord(e)})).then((function(){return t.refreshData()})).catch((function(e){t.processError(e)}))}})},t.prototype.editClickHandler=function(t,e){var n=this;this.grid.getData().getRow(e).then((function(t){t&&n.showEditForm(t)}))},t.prototype.showEditForm=function(t){var e=this,n=this.context.getActiveEntity(),i=new p(this.context,{isEditForm:!0,values:t}).onSubmit((function(){return r.submit()})).build();i.useValidators(this.defaultValidators);var r=this.dlg.open({title:o.i18n.getText("EditDlgCaption").replace("{entity}",n.caption),body:i.getHtml(),onSubmit:function(){if(!i.validate())return!1;i.getData().then((function(t){return e.context.updateRecord(t)})).then((function(){return e.refreshData()})).catch((function(t){e.processError(t)}))}})},t.prototype.rowDbClickHandler=function(t){this.context.getActiveEntity().isEditable&&this.showEditForm(t.row)},t.prototype.deleteClickHandler=function(t,e){var n=this;this.grid.getData().getRow(e).then((function(t){if(t){var e=n.context.getActiveEntity(),i=e.getPrimaryAttrs(),r=i.map((function(e){return t.getValue(e.id)})),s=i.reduce((function(t,e,n){return t[e.id.substring(e.id.lastIndexOf(".")+1)]=r[n],t}),{});n.dlg.openConfirm(o.i18n.getText("DeleteDlgCaption").replace("{entity}",e.caption),o.i18n.getText("DeleteDlgMessage").replace("{recordId}",Object.keys(s).map((function(t){return t+":"+s[t]})).join(";"))).then((function(t){t&&n.context.deleteRecord(s).then((function(){return n.refreshData()})).catch((function(t){n.processError(t)}))}))}}))},t.prototype.processError=function(t){this.dlg.open({title:"Ooops, something went wrong",body:t.message,closable:!0,cancelable:!1})},t.prototype.refreshData=function(){var t=this;return this.context.fetchDataset().then((function(){var e=!1;t.filterWidget&&(e=t.filterWidget.applyFilter(!1)),e||t.grid.refresh()}))},t}(),E=function(){function t(t,e,n){this.slot=t,this.context=e,this.basePath=n,this.metaData=this.context.getMetaData(),this.slot.innerHTML+="<h1>"+o.i18n.getText("RootViewTitle")+"</h1>",this.renderEntitySelector()}return t.prototype.renderEntitySelector=function(){var t=this,e=this.metaData.getRootEntity().subEntities;this.slot&&Object(s.domel)(this.slot).addChild("div",(function(n){return n.addClass("ed-root").addChild("div",(function(e){return e.addClass("ed-menu-description").addText(o.i18n.getText(t.metaData.isEmpty()?"ModelIsEmpty":"EntityMenuDesc"))})).addChild("ul",(function(n){n.addClass("ed-entity-menu"),e.forEach((function(e){n.addChild("li",(function(n){n.addClass("ed-entity-item").on("click",(function(){Object(l.c)(t.basePath+"/"+decodeURIComponent(e.id))})).addChild("div",(function(t){t.addClass("ed-entity-item-caption").addText(e.captionPlural||e.caption)})),e.description&&n.addChild("div",(function(t){t.addClass("ed-entity-item-descr").addText(""+e.description)}))}))}))}))}))},t}(),x=function(){function t(t){var e=this;this.options={container:"#EasyDataContainer",basePath:"easydata"},this.onSetLocation=function(){e.setActiveView()},this.attach=function(){window.addEventListener("ed_set_location",e.onSetLocation),window.addEventListener("popstate",e.onSetLocation)},this.options=o.utils.assign(this.options,t||{}),this.options.rootEntity?(this.options.showBackToEntities=!1,this.basePath="/"):this.basePath=this.normalizeBasePath(this.options.basePath),this.setContainer(this.options.container);var n=document.createElement("div"),i=new f(n),r=this.container.parentElement;r.insertBefore(n,r.firstElementChild),this.context=new y({endpoint:this.options.endpoint,dataTable:this.options.dataTable,onProcessStart:function(){return i.show()},onProcessEnd:function(){return i.hide()}})}return t.prototype.normalizeBasePath=function(t){t=this.trimSlashes(t);var e=decodeURIComponent(window.location.pathname),n=e.toLocaleLowerCase().indexOf(t);return n>=0?e.substring(0,n+t.length):"/"},t.prototype.trimSlashes=function(t){return t.replace(/^\/|\/$/g,"")},t.prototype.setContainer=function(t){if(!t)throw"Container is undefined";if("string"==typeof t){if(t.length){if("."===t[0]){var e=document.getElementsByClassName(t.substring(1));e.length&&(this.container=e[0])}else"#"===t[0]&&(t=t.substring(1)),this.container=document.getElementById(t);if(!this.container)throw Error("Unrecognized `container` parameter: "+t+"\nIt must be an element ID, a class name (starting with .) or an HTMLElement object itself.")}}else this.container=t},t.prototype.getActiveSourceId=function(){if(this.options.rootEntity)return this.options.rootEntity;var t=decodeURIComponent(window.location.pathname),e=this.basePath.length+1;return e<t.length?t.substring(e):null},t.prototype.run=function(){var t=this;return this.attach(),this.context.loadMetaData().then((function(){t.setActiveView()})).catch((function(t){return console.error(t)}))},t.prototype.setActiveView=function(){this.clear();var t=this.getActiveSourceId();t?(this.context.setActiveSource(t),window.EDView=new T(this.container,this.context,this.basePath,this.options)):window.EDView=new E(this.container,this.context,this.basePath)},t.prototype.clear=function(){this.container.innerHTML="",this.context.getData().clear()},t.prototype.detach=function(){window.removeEventListener("ed_set_location",this.onSetLocation),window.removeEventListener("popstate",this.onSetLocation)},t}();o.i18n.updateDefaultTexts({RequiredError:"Value is required.",NumberError:"Value should be a number",IntNumberError:"Value should be an integer number",DateTimeError:"Invalid date or time value",LookupSelectedItem:"Selected item: ",LookupDlgCaption:"Select {entity}",None:"None",NavigationBtnTitle:"Navigation values",CalendarBtnTitle:"Open calendar",TimerBtnTitle:"Open timer",AddBtnTitle:"Add",AddRecordBtnTitle:"Add record",EditBtn:"Edit",DeleteBtn:"Delete",SelectLink:"[ select ]",AddDlgCaption:"Create {entity}",EditDlgCaption:"Edit {entity}",DeleteDlgCaption:"Delete {entity}",DeleteDlgMessage:"Are you sure you want to remove this record: {{recordId}}?",EntityMenuDesc:"Click on an entity to view/edit its content",BackToEntities:"Back to entities",SearchBtn:"Search",SearchInputPlaceholder:"Search...",RootViewTitle:"Entities",ModelIsEmpty:"No entity was found."})}]);
2
+ window.easydata=function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=34)}([function(t,e,n){"use strict";n.r(e),n.d(e,"DataType",(function(){return r.a})),n.d(e,"EntityAttrKind",(function(){return i})),n.d(e,"EditorTag",(function(){return s})),n.d(e,"HttpMethod",(function(){return a.a})),n.d(e,"HttpRequest",(function(){return u.a})),n.d(e,"HttpResponseError",(function(){return l.b})),n.d(e,"HttpClient",(function(){return l.a})),n.d(e,"MetaData",(function(){return g})),n.d(e,"MetaEntity",(function(){return h})),n.d(e,"MetaEntityAttr",(function(){return p})),n.d(e,"ValueEditor",(function(){return f})),n.d(e,"AggregationSettings",(function(){return y})),n.d(e,"ColumnAlignment",(function(){return v.a})),n.d(e,"DataColumn",(function(){return v.b})),n.d(e,"DataColumnList",(function(){return v.c})),n.d(e,"DataRow",(function(){return b.a})),n.d(e,"EasyDataTable",(function(){return w.a})),n.d(e,"EventEmitter",(function(){return D})),n.d(e,"i18n",(function(){return c.a})),n.d(e,"EasyGuid",(function(){return C})),n.d(e,"repeatString",(function(){return T.b})),n.d(e,"reverseString",(function(){return T.c})),n.d(e,"strEndsWith",(function(){return T.d})),n.d(e,"combinePath",(function(){return T.a})),n.d(e,"utils",(function(){return d.a})),n.d(e,"liquid",(function(){return o}));var i,r=n(2);!function(t){t[t.Data=0]="Data",t[t.Virtual=1]="Virtual",t[t.Lookup=2]="Lookup"}(i||(i={}));var o,s={Unknown:"Unknown",Edit:"EDIT",DateTime:"DATETIME",List:"LIST",CustomList:"CUSTOMLIST",File:"FILE"},a=n(11),u=n(16),l=n(24),c=n(5),d=n(4),h=function(){function t(t){this.isEditable=!0,this.name="",this.caption="",this.description="",this.parent=t,this.attributes=new Array,this.subEntities=new Array}return t.prototype.loadFromData=function(t,e){if(e){if(this.id=e.id,this.name=e.name,this.captionPlural=e.namePlur,this.caption=e.name,this.description=e.desc,void 0!==e.ied&&(this.isEditable=e.ied),this.subEntities=new Array,e.ents)for(var n=0;n<e.ents.length;n++){var i=t.createEntity(this);i.loadFromData(t,e.ents[n]),this.subEntities.push(i)}if(this.attributes=new Array,e.attrs)for(n=0;n<e.attrs.length;n++){var r=t.createEntityAttr(this);r.loadFromData(t,e.attrs[n]),this.attributes.push(r)}}},t.prototype.scan=function(t,e){var n={stop:!1},i=function(r){if(e&&e(r,n),r.attributes)for(var o=r.attributes.length,s=0;s<o&&!n.stop;s++){var a=r.attributes[s];if(t&&t(a,n),n.stop)return}if(r.subEntities){var u=r.subEntities.length;for(s=0;s<u&&!n.stop;s++)i(r.subEntities[s])}};i(this)},t.prototype.getFirstPrimaryAttr=function(){return this.getPrimaryAttrs()[0]},t.prototype.getPrimaryAttrs=function(){return this.attributes.filter((function(t){return t.isPrimaryKey}))},t}(),p=function(){function t(t){this.id="",this.caption="{Unrecognized attribute}",this.dataType=r.a.String,this.size=0,this.isPrimaryKey=!1,this.isForeignKey=!1,this.isNullable=!0,this.showOnView=!0,this.isEditable=!0,this.showOnCreate=!0,this.showOnEdit=!0,this.showInLookup=!1,this.lookupAttr="",this.expr="",this.entity=t,this.kind=i.Data}return t.prototype.loadFromData=function(t,e){if(e){this.id=e.id,this.description=e.desc,this.caption=e.cptn,this.dataType=e.dtype,this.isPrimaryKey=e.ipk,this.isForeignKey=e.ifk,this.size=e.size,this.lookupAttr=e.lattr,this.lookupEntity=e.lent,this.dataAttr=e.dattr,this.lookupDataAttr=e.ldattr;var n=d.a.getDateDataTypes().indexOf(this.dataType);this.defaultValue=e.defVal&&n?new Date(e.defVal):e.defVal,this.isNullable=d.a.getIfDefined(e.nul,this.isNullable),this.isEditable=d.a.getIfDefined(e.ied,this.isEditable),this.showOnView=d.a.getIfDefined(e.ivis||e.sov,this.showOnView),this.showOnCreate=d.a.getIfDefined(e.soc,this.showOnCreate),this.showOnEdit=d.a.getIfDefined(e.soe,this.showOnEdit),this.showInLookup=d.a.getIfDefined(e.sil,this.showInLookup),this.kind=e.kind,this.displayFormat=e.dfmt,e.udata&&(this.userData=e.udata),e.edtr&&(this.defaultEditor=t.getEditorById(e.edtr)||t.createValueEditor())}},t}(),f=function(){function t(){this.id="",this.tag=s.Unknown,this.resType=r.a.Unknown,this.defValue=""}return t.prototype.loadFromData=function(t){t&&(this.id=t.id,this.tag=t.tag,this.defValue=t.defval,this.resType=t.rtype,this.accept=t.accept,this.multiline=t.multiline,t.subType&&(this.resType=t.subType),t.name&&(this.name=t.name),t.values&&(this.values=t.values))},t.prototype.getValueText=function(t){var e="";if(!this.values)return e;if(Array.isArray(t))for(var n=0,i=this.values;n<i.length;n++){var r=i[n];t.indexOf(r.id)>=0&&(e+=r.text+",")}else for(var o=0,s=this.values;o<s.length;o++){(r=s[o]).id===t&&(e+=r.text+",")}return e&&(e=e.substring(0,e.length-1)),e},t}(),g=function(){function t(){this.mainEntity=null,this.id="__none",this.name="Empty model",this.rootEntity=this.createEntity(),this.displayFormats=new Map}return t.prototype.getMainEntity=function(){return this.mainEntity},t.prototype.createEntity=function(t){return new h(t)},t.prototype.createEntityAttr=function(t){return new p(t)},t.prototype.createValueEditor=function(){return new f},t.prototype.loadFromJSON=function(t){var e=JSON.parse(t);this.loadFromData(e)},t.prototype.loadFromData=function(t){if(this.id=t.id,this.name=t.name,this.version=t.vers,this.editors=new Array,t.editors)for(var e=0;e<t.editors.length;e++){var n=this.createValueEditor();n.loadFromData(t.editors[e]),this.editors.push(n)}if(this.rootEntity.loadFromData(this,t.entroot),this.displayFormats=new Map,t.displayFormats)for(var i in t.displayFormats){var o=r.a[i],s=t.displayFormats[i]||new Array;this.displayFormats.set(o,s)}},t.prototype.getDisplayFormats=function(){return this.displayFormats},t.prototype.getDisplayFormatsForType=function(t){return this.displayFormats.has(t)?this.displayFormats.get(t):[]},t.prototype.getDefaultFormat=function(t){return this.displayFormats.has(t)?this.displayFormats.get(t).filter((function(t){return t.isdef}))[0]:null},t.prototype.setData=function(t){"string"==typeof t?this.loadFromJSON(t):this.loadFromData(t)},t.prototype.isEmpty=function(){return 0===this.rootEntity.subEntities.length&&0===this.rootEntity.attributes.length},t.prototype.getId=function(){return this.id},t.prototype.getName=function(){return this.name},t.prototype.getRootEntity=function(){return this.rootEntity},t.prototype.getEditorById=function(t){for(var e=0,n=this.editors;e<n.length;e++){var i=n[e];if(i.id===t)return i}return null},t.prototype.getAttributeById=function(t){var e=this.getEntityAttrById(this.getRootEntity(),t);return e||null},t.prototype.checkAttrProperty=function(t,e){var n=this.getAttributeById(t);if(n){if(void 0===n[e])throw"No such property: "+e;return!!n[e]||!!n.lookupAttr&&(t=n.lookupAttr,(n=this.getAttributeById(t))&&n[e])}return!1},t.prototype.getEntityAttrById=function(t,e){var n,i;if(t.attributes){var r=t.attributes.length;for(n=0;n<r;n++)if(t.attributes[n].id==e)return t.attributes[n]}if(t.subEntities){var o=t.subEntities.length;for(n=0;n<o;n++)if(i=this.getEntityAttrById(t.subEntities[n],e))return i}return null},t.prototype.listByEntityWithFilter=function(t,e){var n,i=new Array,r=null;if(t.subEntities)for(var o=t.subEntities.length,s=0;s<o;s++){if(r=t.subEntities[s],!e||e(r,null))(n=c.a.getText("Entities",r.name))||(n=r.caption),(h=d.a.assign(this.createEntity(),{id:r.name,text:n,items:[],isEntity:!0})).items=this.listByEntityWithFilter(r,e),h.items.length>0&&i.push(h)}var a=null;if(t.attributes)for(var u=t.attributes.length,l=0;l<u;l++)if(a=t.attributes[l],!e||e(t,a)){(n=c.a.getText("Attributes",a.id))||(n=a.caption);var h=d.a.assign(this.createEntity(),{id:a.id,text:n,dataType:a.dataType});i.push(h)}return i},t.prototype.listByEntity=function(t,e,n){e=e||{};var i,r=[],o=[],s=null;if(t.subEntities)for(var a=t.subEntities.length,u=0;u<a;u++)if(s=t.subEntities[u],!n||n(s,null)){i=c.a.getText("Entities",s.name)||s.caption;var l=d.a.assign(this.createEntity(),{id:s.name,text:i,items:[],isEntity:!0,description:s.description}),h=d.a.assign({},e);h.includeRootData=!1,l.items=this.listByEntity(s,h,n),l.items.length>0&&r.push(l)}var p=null;if(t.attributes)for(var f=t.attributes.length,g=0;g<f;g++)p=t.attributes[g],n&&!n(t,p)||(i=c.a.getText("Attributes",p.id)||p.caption,o.push(d.a.assign(this.createEntityAttr(t),{id:p.id,text:i,dataType:p.dataType,lookupAttr:p.lookupAttr,description:p.description})));var m,y=function(t,e){return t.text.toLowerCase()==e.text.toLowerCase()?0:t.text.toLowerCase()>e.text.toLowerCase()?1:-1};return e.sortEntities&&(r.sort(y),o.sort(y)),m=e.attrPlacement&&0!=e.attrPlacement?o.concat(r):r.concat(o),2==e.attrPlacement&&m.sort(y),e.includeRootData?((i=c.a.getText("Entities",t.name))||(i=t.caption),{id:t.name,text:i,items:m}):m},t.prototype.clear=function(){this.rootEntity=this.createEntity(),this.editors=[],this.version=""},t.prototype.addDefaultValueEditors=function(){this.addOrUpdateValueEditor("_DTE",s.Edit,r.a.String).defValue="",this.addOrUpdateValueEditor("_DPDE",s.DateTime,r.a.DateTime),this.addOrUpdateValueEditor("_DPTE",s.DateTime,r.a.DateTime)},t.prototype.addOrUpdateValueEditor=function(t,e,n){var i=d.a.findItemById(this.editors,t);return i||((i=this.createValueEditor()).id=t,this.editors.push(i)),i.tag=e,i.resType=n,i},t.prototype.getEntitiesTree=function(t,e){return this.listByEntity(this.getRootEntity(),t,e)},t.prototype.getEntitiesTreeWithFilter=function(t){return this.listByEntityWithFilter(this.getRootEntity(),t)},t.prototype.getFullEntityPathByAttr=function(t,e){return e=e||" ",this.getEntityPathByAttr(this.getRootEntity(),t,e,!0)},t.prototype.getEntityPathByAttr=function(t,e,n,i){if(!t)return"";n=n||" ";var r="";if(t.caption&&!i){var o=c.a.getText("Entities",t.caption);r=o||t.caption}if(t.attributes)for(var s=t.attributes.length,a=0;a<s;a++)if(t.attributes[a].id==e)return r;if(t.subEntities){var u=t.subEntities.length;for(a=0;a<u;a++){var l=t.subEntities[a],d=this.getEntityPathByAttr(l,e,n,!1);if(""!==d)return""!==r&&(d=r+n+d),d}}return""},t.prototype.getAttributeText=function(t,e){var n=c.a.getText("Attributes",t.id);if(n||(n=t.caption),!e)return n;var i=this.getFullEntityPathByAttr(t.id," ");return(i?e.replace(new RegExp("{attr}","g"),n).replace(new RegExp("{entity}","g"),i):n).trim()},t.prototype.runThroughEntities=function(t,e){this.getRootEntity().scan(t,e)},t.prototype.getFirstAttributeByFilter=function(t){var e=null;return this.runThroughEntities((function(n,i){t(n)&&(i.stop=!0,e=n)}),null),e},t}(),m=function(){return m=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},m.apply(this,arguments)},y=function(){function t(t){this.colStore=t,this.aggregates=[],this.groups=[],this.useGrandTotals=!1,this.useRecordCount=!1,this._caseSensitiveGroups=!1,this.COUNT_FIELD_NAME="GRPRECCNT"}return Object.defineProperty(t.prototype,"caseSensitiveGroups",{get:function(){return this._caseSensitiveGroups},set:function(t){this._caseSensitiveGroups=t,this.updateCompareProc()},enumerable:!0,configurable:!0}),t.prototype.updateCompareProc=function(){this.compareValues=this._caseSensitiveGroups?this.strictCompare:this.caseInsensitiveCompare},t.prototype.addGroup=function(t){var e=t.columns||this.colStore.getColumnIds(t.from,t.to);if(!this.colStore.validateColumns(e))throw"Invalid columns: "+e;if(this.hasColumnsInUse(e))throw"Can't add same columns to different groups/aggregates";return this.groups.push(m({columns:e},t)),this},t.prototype.addAggregateColumn=function(t,e){var n="string"==typeof t?t:this.colStore.getColumnIds(t,t)[0];if(this.hasColumnsInUse([n])||!this.colStore.validateAggregate(n,e))throw"Invalid aggregation function for the column: "+n;return this.aggregates.push({colId:n,funcId:e}),this},t.prototype.addGrandTotals=function(){return this.useGrandTotals=!0,this},t.prototype.addCounts=function(){return this.useRecordCount=!0,this},t.prototype.getGroups=function(){var t=this,e=[];return this.groups.map((function(n){return e=e.concat(n.columns),m(m({},n),{columns:Array.from(e),aggregates:Array.from(t.aggregates)})}))},t.prototype.getInternalGroups=function(){return this.groups},t.prototype.lastGroup=function(){var t=this.getGroups();return t[t.length-1]},t.prototype.getAggregates=function(){return this.aggregates},t.prototype.hasAggregates=function(){return this.aggregates.length>0},t.prototype.hasGroups=function(){return this.groups.length>0},t.prototype.hasGrandTotals=function(){return this.useGrandTotals},t.prototype.hasRecordCount=function(){return this.useRecordCount},t.prototype.isEmpty=function(){return!(this.hasAggregates()||this.hasGroups()||this.hasAggregates()||this.hasRecordCount())},t.prototype.drop=function(){console.warn('"drop()" method is obsolete. Use "clear()" instead'),this.clear()},t.prototype.clear=function(){return this.groups=[],this.aggregates=[],this.useGrandTotals=!1,this.useRecordCount=!1,this.caseSensitiveGroups=!1,this},t.prototype.hasColumnsInUse=function(t){for(var e=0,n=this.groups;e<n.length;e++){if(n[e].columns.filter((function(e){return t.indexOf(e)>=0})).length>0)return!0}for(var i=0,r=this.aggregates;i<r.length;i++){var o=r[i];if(t.indexOf(o.colId)>=0)return!0}return!1},t.prototype.needAggrCalculation=function(){return(this.hasAggregates()||this.hasRecordCount())&&(this.hasGrandTotals()||this.hasGroups())},t.prototype.saveToData=function(){return{groups:Array.from(this.groups),ugt:this.useGrandTotals,urc:this.useRecordCount,csg:this.caseSensitiveGroups,aggregates:Array.from(this.aggregates)}},t.prototype.loadFromData=function(t){t&&(void 0!==t.ugt&&(this.useGrandTotals=t.ugt),void 0!==t.urc&&(this.useRecordCount=t.urc),void 0!==t.csg&&(this.caseSensitiveGroups=t.csg),t.groups&&(this.groups=Array.from(t.groups)),t.aggregates&&(this.aggregates=Array.from(t.aggregates)))},t.prototype.buildGroupKey=function(t,e){var n=!this.caseSensitiveGroups,i={};if(t)for(var r=0,o=t.columns;r<o.length;r++){var s=o[r],a=e.getValue(s);n&&"string"==typeof a&&(a=a.toLowerCase()),i[s]=a}return i},t.prototype.strictCompare=function(t,e){return t instanceof Date?t.getTime()===e.getTime():t===e},t.prototype.caseInsensitiveCompare=function(t,e){return t instanceof Date?t.getTime()===e.getTime():("string"==typeof t?t.toLowerCase():t)===("string"==typeof e?e.toLowerCase():e)},t}(),v=n(17),b=n(15),w=n(28),C=function(){function t(){}return t.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))},t}(),D=function(){function t(t){this.silentMode=0,this.events=new Array,this.source=t}return t.prototype.subscribe=function(t,e){var n=this.getEventRecByType(t),i={id:C.newGuid(),callback:e};return n?n.eventCallbacks.push(i):(n={type:t,eventCallbacks:new Array(i)},this.events.push(n)),i.id},t.prototype.unsubscribe=function(t,e){var n=this.getEventRecByType(t);if(n){var i=-1;for(i=0;i<n.eventCallbacks.length&&n.eventCallbacks[i].id!==e;i++);i>=0&&n.eventCallbacks.splice(i,1)}},t.prototype.fire=function(t,e,n,i){if(void 0===n&&(n=0),void 0===i&&(i=!1),!this.silentMode||i){var r=this.getEventRecByType(t);if(r){var o={type:t,source:this.source,data:e},s=function(){for(var t=0,e=r.eventCallbacks;t<e.length;t++){e[t].callback(o)}};n>0?setTimeout(s,n):s()}}},t.prototype.enterSilentMode=function(){this.silentMode++},t.prototype.exitSilentMode=function(){this.silentMode&&this.silentMode--},t.prototype.isSilent=function(){return this.silentMode>0},t.prototype.getEventRecByType=function(t){for(var e=0,n=this.events;e<n.length;e++){var i=n[e];if(i.type==t)return i}return null},t}(),T=n(14);!function(t){t.renderLiquidTemplate=function(t,e){var n=t;if(e)for(var i in e){var r=new RegExp("{{"+i+"}}","g");n=n.replace(r,e[i])}return n}}(o||(o={})),c.a.resetLocales(),"function"!=typeof Object.values&&(Object.values=function(t){return Object.keys(t).map((function(e){return t[e]}))}),"function"!=typeof Math.trunc&&(Math.trunc=function(t){return isNaN(t)?NaN:t>0?Math.floor(t):Math.ceil(t)})},function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"d",(function(){return u})),n.d(e,"b",(function(){return l})),n.d(e,"c",(function(){return c})),n.d(e,"e",(function(){return d}));var i,r=n(19),o=(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},i(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var i=Array(t),r=0;for(e=0;e<n;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,r++)i[r]=o[s];return i},a=function(){function t(t,e){this.element="string"==typeof t?document.createElement(t):t,e&&this.element.parentElement!==e&&e.appendChild(this.element)}return t.prototype.addChild=function(t,e){var n=d(t,this.element);return e&&e(n),this},t.prototype.addChildElement=function(t){return t&&this.element.appendChild(t),this},t.prototype.attr=function(t,e){return this.element.setAttribute(t,e),this},t.prototype.id=function(t){return this.attr("id",t)},t.prototype.focus=function(){return this.element.focus(),this},t.prototype.title=function(t){return this.attr("title",t)},t.prototype.data=function(t,e){return void 0===e&&(e=null),null===e?(this.element.removeAttribute("data-"+t),this):this.attr("data-"+t,e)},t.prototype.show=function(){return this.removeStyle("display")},t.prototype.hide=function(t){return void 0===t&&(t=!0),t?this.setStyle("display","none"):this},t.prototype.visible=function(t){return void 0===t&&(t=!0),t?this.setStyle("visibility","visible"):this.setStyle("visibility","hidden")},t.prototype.isVisible=function(){return!!(this.element.offsetWidth||this.element.offsetHeight||this.element.getClientRects().length)},t.prototype.addClass=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t)for(var i=s(t.trim().split(" "),e),r=0;r<i.length;r++)this.element.classList.add(i[r]);return this},t.prototype.removeClass=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t)for(var i=s(t.trim().split(" "),e),r=0;r<i.length;r++)this.element.classList.remove(i[r]);return this},t.prototype.toggleClass=function(t,e){return void 0===e&&(e=void 0),t&&this.element.classList.toggle(t,e),this},t.prototype.on=function(t,e){for(var n=t.split(" "),i=0;i<n.length;i++)this.element.addEventListener(n[i],e);return this},t.prototype.off=function(t,e){for(var n=t.split(" "),i=0;i<n.length;i++)this.element.removeEventListener(n[i],e);return this},t.prototype.setStyle=function(t,e){return this.element.style.setProperty(t,e),this},t.prototype.removeStyle=function(t){return this.element.style.removeProperty(t),this},t.prototype.text=function(t){return this.element.innerText=t,this},t.prototype.html=function(t){return this.element.innerHTML=t,this},t.prototype.clear=function(){var t=this.element;this.element=document.createElement(this.element.tagName),t.replaceWith(this.element)},t.prototype.addText=function(t){var e=document.createTextNode(t);return this.element.appendChild(e),this},t.prototype.addHtml=function(t){return this.element.innerHTML+=t,this},t.prototype.toDOM=function(){return this.element},t.prototype.appendTo=function(t){return t&&t.appendChild(this.element),this},t}(),u=function(t){function e(e,n){return e?t.call(this,e,n)||this:t.call(this,"textarea",n)||this}return o(e,t),e.prototype.name=function(t){return this.element.name=t,this},e.prototype.rows=function(t){return this.element.rows=t,this},e.prototype.cols=function(t){return this.element.cols=t,this},e.prototype.value=function(t){return this.element.value=t,this},e}(a),l=function(t){function e(e,n){return e?t.call(this,e,n)||this:t.call(this,"input",n)||this}return o(e,t),e.prototype.name=function(t){return this.element.name=t,this},e.prototype.type=function(t){return this.element.type=t,this},e.prototype.size=function(t){return this.element.size=t,this},e.prototype.value=function(t){return t instanceof Date?this.element.valueAsDate=t:"number"==typeof t?this.element.valueAsNumber=t:this.element.value=t,this},e.prototype.mask=function(t){return Object(r.a)(this.element,t),this},e}(a),c=function(t){function e(e,n){return e?t.call(this,e,n)||this:t.call(this,"select",n)||this}return o(e,t),e.prototype.addOption=function(t){var e=document.createElement("option");return"string"==typeof t?(e.value=t,e.innerHTML=t):(e.value=t.value,e.innerHTML=t.title||t.value,e.selected=t.selected||!1),this.element.appendChild(e),this},e.prototype.value=function(t){return this.element.value=t,this},e}(a);function d(t,e){return"div"===t||t instanceof HTMLDivElement||"span"===t||t instanceof HTMLSpanElement||"a"===t||t instanceof HTMLAnchorElement||"button"===t||t instanceof HTMLButtonElement||"img"===t||t instanceof HTMLImageElement?new a(t,e):"input"===t||t instanceof HTMLInputElement?new l(t instanceof HTMLInputElement?t:null,e):"textarea"===t||t instanceof HTMLTextAreaElement?new u(t instanceof HTMLTextAreaElement?t:null,e):"select"===t||t instanceof HTMLSelectElement?new c(t instanceof HTMLSelectElement?t:null,e):new a(t,e)}},function(t,e,n){"use strict";var i;n.d(e,"a",(function(){return i})),function(t){t[t.Unknown=0]="Unknown",t[t.String=1]="String",t[t.Byte=2]="Byte",t[t.Word=3]="Word",t[t.Int32=4]="Int32",t[t.Int64=5]="Int64",t[t.Bool=6]="Bool",t[t.Float=7]="Float",t[t.Currency=8]="Currency",t[t.BCD=9]="BCD",t[t.Date=10]="Date",t[t.Time=11]="Time",t[t.DateTime=12]="DateTime",t[t.Autoinc=13]="Autoinc",t[t.Memo=14]="Memo",t[t.Blob=15]="Blob",t[t.FixedChar=16]="FixedChar",t[t.Guid=17]="Guid",t[t.Geometry=18]="Geometry",t[t.Geography=19]="Geography"}(i||(i={}))},function(t,e,n){"use strict";n.r(e),n.d(e,"EasyGrid",(function(){return r.a})),n.d(e,"AutoResizeColumns",(function(){return o.a})),n.d(e,"GridColumnAlign",(function(){return s.b})),n.d(e,"GridColumn",(function(){return s.a})),n.d(e,"GridColumnList",(function(){return s.c})),n.d(e,"DFMT_REGEX",(function(){return a.b})),n.d(e,"CellRendererType",(function(){return a.a})),n.d(e,"GridCellRendererStore",(function(){return a.c})),n.d(e,"Calendar",(function(){return u})),n.d(e,"DateTimePicker",(function(){return c})),n.d(e,"DefaultCalendar",(function(){return f})),n.d(e,"DefaultDateTimePicker",(function(){return b})),n.d(e,"DefaultTimePicker",(function(){return y})),n.d(e,"TimePicker",(function(){return g})),n.d(e,"browserUtils",(function(){return w.a})),n.d(e,"DomElementBuilder",(function(){return h.a})),n.d(e,"DomTextAreaElementBuilder",(function(){return h.d})),n.d(e,"DomInputElementBuilder",(function(){return h.b})),n.d(e,"DomSelectElementBuilder",(function(){return h.c})),n.d(e,"domel",(function(){return h.e})),n.d(e,"DropEffect",(function(){return C.b})),n.d(e,"EqDragEvent",(function(){return C.c})),n.d(e,"DragManager",(function(){return C.a})),n.d(e,"eqDragManager",(function(){return C.d})),n.d(e,"mask",(function(){return D.a})),n.d(e,"wrapInner",(function(){return l.q})),n.d(e,"addElement",(function(){return l.b})),n.d(e,"addCssClass",(function(){return l.a})),n.d(e,"hideElement",(function(){return l.k})),n.d(e,"showElement",(function(){return l.m})),n.d(e,"toggleVisibility",(function(){return l.p})),n.d(e,"isVisible",(function(){return l.l})),n.d(e,"createBrowserEvent",(function(){return l.c})),n.d(e,"getViewportSize",(function(){return l.i})),n.d(e,"getDocSize",(function(){return l.f})),n.d(e,"getScrollPos",(function(){return l.h})),n.d(e,"getElementAbsolutePos",(function(){return l.g})),n.d(e,"getWinSize",(function(){return l.j})),n.d(e,"slideDown",(function(){return l.n})),n.d(e,"slideUp",(function(){return l.o})),n.d(e,"eqCssPrefix",(function(){return l.e})),n.d(e,"eqCssMobile",(function(){return l.d})),n.d(e,"DefaultDialogService",(function(){return T.b})),n.d(e,"DefaultDialog",(function(){return T.a})),n.d(e,"DefaultProgressDialog",(function(){return T.d})),n.d(e,"DefaultDialogSet",(function(){return T.c})),n.d(e,"DialogFooterAlignment",(function(){return E.a})),n.d(e,"dialogs",(function(){return x}));var i,r=n(29),o=n(10),s=n(8),a=n(13),u=function(){function t(t,e){this.slot=t,this.options=e||{},this.options.yearRange||(this.options.yearRange="c-10:c+10")}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"kdtp-cal"},enumerable:!0,configurable:!0}),t.prototype.setDate=function(t){this.currentDate=new Date(t)},t.prototype.getDate=function(){return new Date(this.currentDate)},t.prototype.dateChanged=function(t){this.options.onDateChanged&&this.options.onDateChanged(this.currentDate,t)},t}(),l=n(6),c=function(){function t(t){this.calendar=null,this.timePicker=null,this.options=t,this.render()}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"kdtp"},enumerable:!0,configurable:!0}),t.prototype.setDateTime=function(t){this.currentDateTime=new Date(t),this.calendar&&this.calendar.setDate(this.currentDateTime),this.timePicker&&this.timePicker.setTime(this.currentDateTime)},t.prototype.getDateTime=function(){return new Date(this.currentDateTime)},t.prototype.render=function(){var t=this;this.options.showCalendar&&(this.calendar=this.createCalendar({yearRange:this.options.yearRange,showDateTimeInput:this.options.showDateTimeInput,timePickerIsUsed:this.options.showTimePicker,oneClickDateSelection:this.options.oneClickDateSelection,onDateChanged:function(e,n){t.currentDateTime=e,t.timePicker&&t.timePicker.setTime(t.currentDateTime),t.options.showTimePicker&&t.dateTimeChanged(),n&&t.apply(t.currentDateTime)}}),this.calendar&&this.calendar.render()),this.options.showTimePicker&&(this.timePicker=this.createTimePicker({onTimeChanged:function(e){t.currentDateTime.setHours(e.getHours()),t.currentDateTime.setMinutes(e.getMinutes()),t.calendar&&t.calendar.setDate(t.currentDateTime),t.dateTimeChanged()}}),this.timePicker&&this.timePicker.render()),this.setDateTime(new Date)},t.prototype.createCalendar=function(t){return null},t.prototype.createTimePicker=function(t){return null},t.prototype.show=function(t){this.options.beforeShow&&this.options.beforeShow();var e=Object(l.g)(t||document.body);this.slot.style.top=e.y+t.clientHeight+"px",this.slot.style.left=e.x+"px"},t.prototype.apply=function(t){this.options.onApply&&this.options.onApply(t),this.destroy()},t.prototype.cancel=function(){this.options.onCancel&&this.options.onCancel(),this.destroy()},t.prototype.destroy=function(){this.slot&&this.slot.parentElement&&this.slot.parentElement.removeChild(this.slot)},t.prototype.dateTimeChanged=function(){this.options.onDateTimeChanged&&this.options.onDateTimeChanged(this.currentDateTime)},t}(),d=n(0),h=n(1),p=(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},i(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),f=function(t){function e(e,n){var i=t.call(this,e,n)||this;i.daysOfWeek=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],i.months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],i.calendarBody=null,i.isManualInputChanging=!1;for(var r=0;r<i.daysOfWeek.length;r++)i.daysOfWeek[r]=d.i18n.getShortWeekDayName(r+1);for(r=0;r<i.months.length;r++)i.months[r]=d.i18n.getLongMonthName(r+1);return i}return p(e,t),e.prototype.setDate=function(e){t.prototype.setDate.call(this,e),this.selectedMonth=this.currentDate.getMonth(),this.selectedYear=this.currentDate.getFullYear(),this.rerenderMonth()},e.prototype.render=function(){var t=this,e=Object(h.e)("div",this.slot).addClass(this.cssPrefix+"-header");this.options.showDateTimeInput?e.addChildElement(this.renderManualDateInput()):e.addChild("span",(function(e){return t.headerTextElem=e.toDOM()})),Object(h.e)(this.slot).addChildElement(this.renderCalendarButtons()),this.calendarBody=Object(h.e)("div",this.slot).addClass(this.cssPrefix+"-body").toDOM()},e.prototype.getInputDateFormat=function(){var t=d.i18n.getLocaleSettings();return this.options.timePickerIsUsed?t.editDateFormat+" "+t.editTimeFormat:t.editDateFormat},e.prototype.renderManualDateInput=function(){var t=this,e=this.getInputDateFormat(),n=Object(h.e)("input").attr("placeholder",e).addClass(this.cssPrefix+"-header-input");return n.mask(e.replace("yyyy","9999").replace("MM","99").replace("dd","99").replace("HH","99").replace("mm","99").replace("ss","99")).on("input",(function(i){n.removeClass("error");try{t.isManualInputChanging=!0;var r=d.utils.strToDateTime(t.manualInputElem.value,e);t.currentDate=r,t.jump(t.currentDate.getFullYear(),t.currentDate.getMonth()),t.dateChanged(!1)}catch(t){n.addClass("error")}finally{t.isManualInputChanging=!1}})).on("keydown",(function(e){13===e.keyCode&&(e.preventDefault(),e.stopPropagation(),t.manualInputElem.className.indexOf("error")<0&&!t.isManualInputChanging&&t.dateChanged(!0))})).on("focus",(function(){setTimeout((function(){t.manualInputElem.selectionStart=0,t.manualInputElem.selectionEnd=0}),50)})),this.manualInputElem=n.toDOM(),this.manualInputElem},e.prototype.updateDisplayedDateValue=function(){if(this.manualInputElem){if(!this.isManualInputChanging){var t=this.getInputDateFormat();this.manualInputElem.value=d.utils.dateTimeToStr(this.currentDate,t),this.manualInputElem.focus()}}else if(this.headerTextElem){var e=d.i18n.getCurrentLocale();this.headerTextElem.innerText=this.currentDate.toLocaleString("en"==e?void 0:e,{year:"numeric",month:"long",day:"numeric"})}},e.prototype.renderCalendarButtons=function(){var t=this;return Object(h.e)("nav").addClass(this.cssPrefix+"-nav").addChild("div",(function(e){return e.addClass(t.cssPrefix+"-nav-prev").on("click",(function(){t.prev()})).addChild("span",(function(t){return t.html("&lsaquo;")}))})).addChild("div",(function(e){return e.addClass(t.cssPrefix+"-nav-selectors").addChild("div",(function(e){return e.addClass(t.cssPrefix+"-nav-month").addChild("select",(function(e){e.on("change",(function(){t.jump(t.selectedYear,parseInt(t.selectMonthElem.value))}));for(var n=function(n){e.addChild("option",(function(e){return e.attr("value",n.toString()).text(t.months[n])}))},i=0;i<t.months.length;i++)n(i);t.selectMonthElem=e.toDOM()}))})).addChild("div",(function(e){return e.addClass(t.cssPrefix+"-nav-year").addChild("select",(function(e){return t.selectYearElem=e.on("change",(function(){t.jump(parseInt(t.selectYearElem.value),t.selectedMonth)})).toDOM()}))}))})).addChild("div",(function(e){return e.addClass(t.cssPrefix+"-nav-next").on("click",(function(){t.next()})).addChild("span",(function(t){return t.html("&rsaquo;")}))})).toDOM()},e.prototype.prev=function(){this.selectedYear=0===this.selectedMonth?this.selectedYear-1:this.selectedYear,this.selectedMonth=0===this.selectedMonth?11:this.selectedMonth-1,this.rerenderMonth()},e.prototype.next=function(){this.selectedYear=11===this.selectedMonth?this.selectedYear+1:this.selectedYear,this.selectedMonth=(this.selectedMonth+1)%12,this.rerenderMonth()},e.prototype.rerenderSelectYear=function(){var t=/c-(\d*):c\+(\d*)/g.exec(this.options.yearRange),e=0,n=1;null!==t&&(e=parseInt(t[1]),n=parseInt(t[2])),this.selectYearElem.innerHTML="";for(var i=0;i<=e+n;i++){var r=document.createElement("option"),o=this.selectedYear-e+i;r.value=o.toString(),r.innerText=o.toString(),this.selectYearElem.appendChild(r)}},e.prototype.jump=function(t,e){this.selectedYear=t,this.selectedMonth=e,this.rerenderMonth()},e.prototype.rerenderMonth=function(){var t=this;this.updateDisplayedDateValue(),this.rerenderSelectYear();var e=new Date(this.selectedYear,this.selectedMonth).getDay(),n=new Date(this.selectedYear,this.selectedMonth+1,0).getDate();this.calendarBody.innerHTML="",this.selectYearElem.value=this.selectedYear.toString(),this.selectMonthElem.value=this.selectedMonth.toString(),this.daysOfWeek.forEach((function(e,n){Object(h.e)("div",t.calendarBody).addClass(t.cssPrefix+"-weekday").addClass(0==n||6==n?t.cssPrefix+"-weekend":"").text(e)}));for(var i=0;i<e;i++)Object(h.e)("div",this.calendarBody).addClass(this.cssPrefix+"-day-empty");for(var r=new Date,o=1;o<=n;o++){var s=Object(h.e)("div",this.calendarBody).addClass(this.cssPrefix+"-day").attr("data-date",o.toString()).text(o.toString()).on("click",(function(e){t.currentDate.setFullYear(t.selectedYear),t.currentDate.setMonth(t.selectedMonth),t.currentDate.setDate(parseInt(e.target.getAttribute("data-date"))),t.dateChanged(t.options.oneClickDateSelection)}));o===r.getDate()&&this.selectedYear===r.getFullYear()&&this.selectedMonth===r.getMonth()&&s.addClass(this.cssPrefix+"-day-current"),o===this.currentDate.getDate()&&this.selectedYear===this.currentDate.getFullYear()&&this.selectedMonth===this.currentDate.getMonth()&&s.addClass(this.cssPrefix+"-day-selected");var a=(e+o-1)%7;0!=a&&6!=a||s.addClass(this.cssPrefix+"-weekend")}var u=(e+n)%7,l=0==u?0:7-u;for(i=0;i<l;i++)Object(h.e)("div",this.calendarBody).addClass(this.cssPrefix+"-day-empty")},e.prototype.dateChanged=function(e){t.prototype.dateChanged.call(this,e),this.rerenderMonth()},e}(u),g=function(){function t(t,e){this.slot=t,this.options=e||{}}return Object.defineProperty(t.prototype,"cssPrefix",{get:function(){return"kdtp-tp"},enumerable:!0,configurable:!0}),t.prototype.setTime=function(t){this.currentTime=new Date(t)},t.prototype.getTime=function(){return new Date(this.currentTime)},t.prototype.timeChanged=function(){this.options.onTimeChanged&&this.options.onTimeChanged(this.currentTime)},t}(),m=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.prototype.setTime=function(e){t.prototype.setTime.call(this,e),this.updateDisplayedTime(),this.hoursInput.valueAsNumber=e.getHours(),this.minutesInput.valueAsNumber=e.getMinutes()},e.prototype.render=function(){var t=this;Object(h.e)("div",this.slot).addClass(this.cssPrefix+"-time").addChild("span",(function(e){return t.timeText=e.toDOM()})).toDOM();var e=Object(h.e)("div",this.slot).addClass(this.cssPrefix+"-sliders");return e.addChild("div",(function(e){return e.addClass(t.cssPrefix+"-time-row").title("Hours").addChild("input",(function(e){return t.hoursInput=e.addClass(t.cssPrefix+"-input-hours").type("range").attr("min","0").attr("max","23").attr("step","1").on("input",(function(e){t.currentTime.setHours(t.hoursInput.valueAsNumber),t.updateDisplayedTime(),t.timeChanged()})).toDOM()}))})),e.addChild("div",(function(e){return e.addClass(t.cssPrefix+"-time-row").title("Minutes").addChild("input",(function(e){return t.minutesInput=e.addClass(t.cssPrefix+"-input-minutes").type("range").attr("min","0").attr("max","59").attr("step","1").on("input",(function(e){t.currentTime.setMinutes(t.minutesInput.valueAsNumber),t.updateDisplayedTime(),t.timeChanged()})).toDOM()}))})),this.slot},e.prototype.updateDisplayedTime=function(){var t=d.i18n.getCurrentLocale(),e=this.currentTime.toLocaleString("en"==t?void 0:t,{hour:"numeric",minute:"numeric"});this.timeText.innerText=e},e}(g),v=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.prototype.render=function(){var e=this,n=Object(h.e)("div",document.body).addClass(""+this.cssPrefix).attr("tabIndex","0").setStyle("position","absolute").setStyle("top","-1000px").setStyle("left","-1000px").on("keydown",(function(t){return 27===t.keyCode?e.cancel():13===t.keyCode&&e.apply(e.getDateTime()),!1}));this.options.zIndex&&n.setStyle("z-index",""+this.options.zIndex),this.slot=n.toDOM(),t.prototype.render.call(this),this.renderButtons(),this.globalMouseDownHandler=function(t){var n=window.event||t;n.srcElement||n.target;return!e.slot.contains(n.target)&&(document.removeEventListener("mousedown",e.globalMouseDownHandler,!0),e.cancel()),!0}},e.prototype.renderButtons=function(){var t=this,e=Object(h.e)("div",this.slot).addClass(this.cssPrefix+"-buttons").addChild("button",(function(e){return t.nowButton=e.addClass(t.cssPrefix+"-button "+t.cssPrefix+"-button-now").text(d.i18n.getText("ButtonNow")).on("click",(function(){return t.setDateTime(new Date),t.dateTimeChanged(),!1})).toDOM()}));!this.options.showTimePicker&&this.options.oneClickDateSelection||e.addChild("button",(function(e){return t.submitButton=e.addClass(t.cssPrefix+"-button "+t.cssPrefix+"-button-apply").text(d.i18n.getText("ButtonApply")).on("click",(function(){return t.apply(t.getDateTime()),!1})).toDOM()})),e.addChild("button",(function(e){return t.submitButton=e.addClass(t.cssPrefix+"-button "+t.cssPrefix+"-button-cancel").text(d.i18n.getText("ButtonCancel")).on("click",(function(){return t.cancel(),!1})).toDOM()}))},e.prototype.createCalendar=function(t){return this.calendarSlot=Object(h.e)("div",this.slot).addClass(this.cssPrefix+"-cal").toDOM(),new f(this.calendarSlot,t)},e.prototype.createTimePicker=function(t){return this.timePickerSlot=Object(h.e)("div",this.slot).addClass(this.cssPrefix+"-tp").toDOM(),new y(this.timePickerSlot,t)},e.prototype.show=function(e){var n=this;if(this.options.showDateTimeInput){this.options.beforeShow&&this.options.beforeShow();var i=Object(l.g)(e||document.body),r=Object(l.g)(e?e.parentElement||e:document.body);this.slot.style.top=r.y+"px",this.slot.style.left=i.x+"px"}else t.prototype.show.call(this,e),this.slot.focus();setTimeout((function(){document.addEventListener("mousedown",n.globalMouseDownHandler,!0)}),1)},e}(c),w=n(18),C=n(12),D=n(19),T=n(20),E=n(21);d.i18n.updateDefaultTexts({GridPageInfo:"{FirstPageRecordNum} - {LastPageRecordNum} of {Total} records",GridItemsPerPage:"items per page",ButtonOK:"OK",ButtonCancel:"Cancel",ButtonApply:"Apply",ButtonNow:"Now",LblTotal:"Total"});var x=new T.b},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i,r=n(14),o=n(2),s=n(5);!function(t){t.getAllDataTypes=function(){return Object.values(o.a).filter((function(t){return"number"==typeof t}))},t.getDateDataTypes=function(){return[o.a.Time,o.a.Date,o.a.DateTime]},t.getStringDataTypes=function(){return[o.a.String,o.a.Memo,o.a.FixedChar]};var e=[o.a.Byte,o.a.Word,o.a.Int32,o.a.Int64,o.a.Float,o.a.Currency,o.a.Autoinc];t.getNumericDataTypes=function(){return e};var n=[o.a.Byte,o.a.Word,o.a.Int32,o.a.Int64,o.a.Autoinc];function i(t,e,n){e||(e={});for(var r=0,o=n;r<o.length;r++){var s=o[r];if(s)for(var u in s)if(s.hasOwnProperty(u)){var l=s[u];null!==l&&"object"==typeof l?t.has(l)?e[u]=t.get(l):Array.isArray(l)?(e[u]=a(l),t.set(l,e[u])):(void 0!==e[u]&&null!=e[u]||(e[u]=Object.create(Object.getPrototypeOf(l))),t.set(l,e[u]),i(t,e[u],[l])):e[u]=l}}return e}function a(t){for(var e=[],n=0,i=t;n<i.length;n++){var r=i[n];e.push(r)}return e}t.assign=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var i=0;i<e.length;i++){var r=e[i];if(r)for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])}return t},t.assignDeep=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return i(new WeakMap,t,e)},t.getIfDefined=function(t,e){return void 0!==t?t:e},t.IsDefinedAndNotNull=function(t){return null!=t},t.copyArrayTo=function(t,e){for(var n=t.length,i=e.length,r=0;r<n&&r<i;r++)e[r]=t[r]},t.createArrayFrom=a,t.findItemById=function(t,e){for(var n=t.length,i=0;i<n;i++)if(t[i].id===e)return t[i];return null},t.findItemIndexById=function(t,e){for(var n=t.length,i=0;i<n;i++)if(t[i].id===e)return i;return-1},t.indexOfArrayItem=function(t,e){if(t.indexOf)return t.indexOf(e);for(var n=t.length,i=0;i<n;i++)if(e==t[i])return i;return-1},t.moveArrayItem=function(t,e,n){if(e>=t.length)throw"Index out of bounds: "+e;n>=t.length&&(n=t.length-1);var i=t.splice(e,1)[0];t.splice(n,0,i)},t.removeArrayItem=function(t,e){var n=t.indexOf(e);if(-1!=n)return t.splice(n,1)[0]},t.insertArrayItem=function(t,e,n){t.splice(e,0,n)},t.fillArray=function(t,e,n,i){void 0===n&&(n=0);for(var r=t.length>>>0,o=n>>0,s=o<0?Math.max(r+o,0):Math.min(o,r),a=void 0===i?r:i>>0,u=a<0?Math.max(r+a,0):Math.min(a,r);s<u;)t[s]=e,s++;return t},t.shiftToFitWindow=function(t,e){var n=document.getElementsByTagName("body")[0],i=window.innerWidth||document.documentElement.clientWidth||n.clientWidth,r=t+e,o=0;return r>i&&t+(o=i-r-10)<0&&(o=10-t),o},t.isObject=function(t){return null!==t&&("function"==typeof t||"object"==typeof t)},t.isNumericType=function(t){return e.indexOf(t)>=0},t.isIntType=function(t){return n.indexOf(t)>=0},t.isNumeric=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},t.areCompatibleDataTypes=function(t,e){return void 0===t||void 0===e||t==o.a.Unknown||e==o.a.Unknown||t==e||t==o.a.Date&&e==o.a.DateTime||t==o.a.DateTime&&e==o.a.Date},t.isPropSet=function(t,e){return t[e]||t[e.toLowerCase()]||t[e.toUpperCase()]};var u=4,l="0123456789abcdefghijklmnopqrstuvwxyz",c=0x8d60e562e627800;function d(t,e){var n=t.length;if(n>e){var i=n/e,r="";r+=t[0];for(var o=i,s=void 0,a=1;a<n;a++)s=t[a],a+1>o&&(r+=s,o+=i);return r}return t}function h(t,e,n){return t.substr(0,e)+n+t.substr(e+n.length)}function p(t,e){return Math.floor(Math.random()*(e-t))+t}function f(t){var e=parseInt(t);if(isNaN(e))throw'"'+t+'" is not a valid number';return e}t.generateId=function(t){t||(t="easy");var e=t.length>u?function(t,e){var n=t.split("-"),i=1,r=e;n.length<e&&(i=e/n.length,r=n.length);for(var o="",s=0;s<r;s++)o+=d(n[s],i);return o}(t,u):t;e&&e.length>0&&(e+="-");var n=r.b("",2),i=l.length-1;return n=h(n,0,l[p(0,i)]),e+(n=h(n,1,l[p(0,i)]))+function(t){var e=36,n=14,i=r.b("",n),o=t;do{i=h(i,n--,l[o%e]),o=Math.floor(o/=e)}while(o>0);return r.c(i.trim())}(621355968e9+1e4*(new Date).getTime()-c)},t.strToDateTime=function(t,e){if(!t||0==t.length)return new Date;var n=t.replace(/[^a-zA-Z0-9_]/g,"-"),i=e.replace(/[^a-zA-Z0-9_]/g,"-").split("-"),r=n.split("-"),o=i.indexOf("MM"),s=i.indexOf("dd"),a=i.indexOf("yyyy"),u=i.indexOf("HH"),l=i.indexOf("mm"),c=i.indexOf("ss"),d=new Date;try{var h=a>-1&&a<r.length?f(r[a]):d.getFullYear(),p=o>-1&&o<r.length?f(r[o])-1:d.getMonth()-1;if(p>11)throw"";var g=s>-1&&s<r.length?f(r[s]):d.getDate();if(g>function(t,e){return new Date(e,t+1,0).getDate()}(p,h))throw"";var m=u>-1&&u<r.length?f(r[u]):0;if(m>23)throw"";var y=l>-1&&l<r.length?f(r[l]):0;if(y>59)throw"";var v=c>-1&&c<r.length?f(r[c]):0;if(v>59)throw"";return new Date(h,p,g,m,y,v)}catch(e){throw t+" is not a valid date."}},t.strToTime=function(t){var e=t.split(":");try{var n=e.length>0?f(e[0]):0;if(n>23)throw"";var i=e.length>1?f(e[1]):0;if(i>59)throw"";var r=e.length>1?f(e[1]):0;if(r>59)throw"";return new Date(0,0,0,n,i,r)}catch(e){throw t+" is not a valid time."}};var g=/\[([^\]]+)]|y{2,4}|M{1,4}|d{1,2}|H{1,2}|h{1,2}|m{2}|s{2}|t{2}/g;t.dateTimeToStr=function(t,e){var n=t.getFullYear().toString(),i=t.getMonth()+1,r=t.getDate(),o=t.getHours(),a=t.getMinutes(),u=t.getSeconds(),l=o%12||12,c=o>11,d={yyyy:n,yy:n.substring(n.length-2),MMMM:s.a.getLongMonthName(i),MMM:s.a.getShortMonthName(i),MM:i<10?"0"+i:i.toString(),M:i.toString(),dd:r<10?"0"+r:r.toString(),d:r.toString(),HH:o<10?"0"+o:o.toString(),H:o.toString(),hh:l<10?"0"+l:l.toString(),h:l.toString(),tt:c?"PM":"AM",mm:a<10?"0"+a:a.toString(),ss:u<10?"0"+u:u.toString()};return e.replace(g,(function(t,e){return e||d[t]}))},t.numberToStr=function(t,e){return e=e||s.a.getLocaleSettings().decimalSeparator,t.toString().replace(".",e)}}(i||(i={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i,r=n(2),o=n(4);!function(t){var e,n={shortDateFormat:"MM/dd/yyyy",longDateFormat:"dd MMM, yyyy",editDateFormat:"MM/dd/yyyy",shortTimeFormat:"HH:mm",editTimeFormat:"HH:mm",longTimeFormat:"HH:mm:ss",shortMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longMonthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],shortWeekDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longWeekDayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],decimalSeparator:".",currency:"USD"},i={localeId:"en-US",englishName:"English",displayName:"English",texts:{ButtonOK:"OK",ButtonCancel:"Cancel",Yes:"Yes",No:"No",True:"True",False:"False"},settings:n},s={"en-US":i},a=[];function u(t){for(var e=0,n=a;e<n.length;e++){(0,n[e])(t)}}function l(){return e.localeId}function c(t){var n=s[t];n?o.a.assignDeep(e,n):(e.englishName=t,e.displayName=t,e.texts=o.a.assignDeep({},i.texts)),e.localeId=t}function d(){return e.settings}function h(t){e.settings||(e.settings=o.a.assignDeep({},n)),e.settings=o.a.assignDeep(e.settings,t)}function p(t,n){u(n);var r=e;t&&(n.localeId||(n.localeId=t),(r=s[t])||(r=o.a.assignDeep({},i),s[t]=r)),o.a.assignDeep(r,n)}function f(){var t,n,i,r,o,s,a="object"==typeof navigator?navigator.language:void 0;t=a,n=new Date(2020,5,7,19,34,56,88),i=n.toLocaleDateString(t,{year:"numeric",month:"numeric",day:"numeric"}),r=n.toLocaleTimeString(t,{hour:"numeric",minute:"numeric",second:"numeric"}),o=i.replace("07","dd").replace("7","d").replace("06","MM").replace("6","M").replace("2020","yyyy").replace("20","yy"),s=r.replace("19","HH").replace("07","hh").replace("7","h").replace("34","mm").replace("56","ss").replace("PM","tt"),e.settings||(e.settings={}),h({shortDateFormat:o,shortTimeFormat:s})}function g(t){var e,n=d();switch(t){case r.a.Date:e=n.shortDateFormat;break;case r.a.Time:e=n.shortTimeFormat;break;default:e=n.shortDateFormat+" "+n.shortTimeFormat}return e}function m(t){var e,n=d();switch(t){case r.a.Date:e=n.longDateFormat;break;case r.a.Time:e=n.longTimeFormat;break;default:e=n.longDateFormat+" "+n.longTimeFormat}return e}t.addMapper=function(t){a.push(t)},t.getLocales=function(){var t=[];for(var e in s)t.push({locale:e,englishName:s[e].englishName,displayName:s[e].displayName});return t.sort((function(t,e){return t.englishName>e.englishName?1:t.englishName===e.englishName?0:-1}))},t.getCurrentLocale=l,t.setLocale=function(t){console.warn("This method is deprecated. Use setCurrentLocale instead"),c(t)},t.setCurrentLocale=c,t.getText=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=e.texts,r="";if(t&&t.length)for(var o=t.length,s=0;s<o&&"object"==typeof(r=i[t[s]]);s++)i=r;return r},t.getLocaleSettings=d,t.getOneLocaleSetting=function(t){return e.settings[t]},t.getShortMonthName=function(t){var e=d();if(t>0&&t<13)return e.shortMonthNames[t-1];throw"Wrong month number: "+t},t.getLongMonthName=function(t){var e=d();if(t>0&&t<13)return e.longMonthNames[t-1];throw"Wrong month number: "+t},t.getShortWeekDayName=function(t){var e=d();if(t>0&&t<8)return e.shortWeekDayNames.length>=t?e.shortWeekDayNames[t-1]:t.toString();throw"Wrong month number: "+t},t.getLongWeekDayName=function(t){var e=d();if(t>0&&t<8)return e.longWeekDayNames.length>=t?e.longWeekDayNames[t-1]:t.toString();throw"Wrong month number: "+t},t.updateLocaleSettings=h,t.updateLocaleTexts=function(t){"object"==typeof t?(u({localeId:e.localeId,texts:t}),o.a.assignDeep(e.texts,t)):console.error("Wrong parameter type in updateLocaleTexts function call.The first parameter (localeId) is not necessary. Use updateLocaleTexts(texts) instead")},t.updateDefaultTexts=function(t){for(var n in s){var i=s[n];i.texts=o.a.assignDeep({},t,i.texts)}e.texts=o.a.assignDeep({},t,e.texts)},t.updateLocaleInfo=p,t.addLocale=function(t,e){p(t,e)},t.resetLocales=function(){e||(e=o.a.assignDeep({},i),f())},t.dateTimeToStr=function(t,e,n){return n?"d"==n?n=g(r.a.Date):"D"==n?n=m(r.a.Date):"f"==n?n=g(r.a.DateTime):"F"==n&&(n=m(r.a.DateTime)):n=g(e),o.a.dateTimeToStr(t,n)},t.numberToStr=function(e,n){if(n&&n.length>0){var i=n.charAt(0).toUpperCase();if("S"===i)return function(e,n){if(!y[n]){var i=n.split("|").filter((function(t){return t.length>0})).map((function(t){return t.split("=")}));if(y[n]={},i.length>0)if(i[0].length>1)for(var r=0,o=i;r<o.length;r++){var s=o[r];y[n][Number.parseInt(s[1])]=s[0]}else i.forEach((function(t,e){y[n][e]=t[0]}))}var a=y[n];if(void 0!==a[e]){s=a[e];return t.getText(s)||s}return e.toString()}(e,n.slice(1));if(["D","F","C"].indexOf(i)>=0){var r=l();return e.toLocaleString(r,function(t){var e=d(),n=t[0].toUpperCase(),i=t.length>1?Number.parseInt(t.slice(1)):"D"==n?1:2;switch(n){case"D":return{style:"decimal",useGrouping:!1,minimumIntegerDigits:i};case"C":return{style:"currency",currency:e.currency,minimumFractionDigits:i};default:return{style:"decimal",minimumFractionDigits:i,maximumFractionDigits:i}}}(n))}return function(t,e){for(var n=t.toString(),i="",r=n.length-1,o=e.length-1;o>=0;o--){var s=e.charAt(o);"#"===s||"0"===s?r>=0?(i+=n.charAt(r),r--):"0"===s&&(i+=0):i+=s}return i.split("").reverse().join("")}(Math.trunc(e),n)}var s=d();return o.a.numberToStr(e,s.decimalSeparator)},t.booleanToStr=function(e,n){if(n&&n.length>0&&"S"===n.charAt(0).toUpperCase()){var i=n.slice(1).split("|");if(i.length>1){var r=i[e?1:0];return t.getText(r)||r}}return""+e};var y={}}(i||(i={}))},function(t,e,n){"use strict";n.d(e,"q",(function(){return r})),n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return s})),n.d(e,"k",(function(){return a})),n.d(e,"m",(function(){return u})),n.d(e,"p",(function(){return l})),n.d(e,"l",(function(){return c})),n.d(e,"c",(function(){return d})),n.d(e,"i",(function(){return h})),n.d(e,"f",(function(){return p})),n.d(e,"h",(function(){return f})),n.d(e,"g",(function(){return g})),n.d(e,"j",(function(){return m})),n.d(e,"n",(function(){return y})),n.d(e,"o",(function(){return v})),n.d(e,"e",(function(){return b})),n.d(e,"d",(function(){return w}));var i=n(18);function r(t,e){for(t.appendChild(e);t.firstChild!==e;)e.appendChild(t.firstChild)}function o(t,e,n){var i=document.createElement(e),r=n||{};return r.cssClass&&(i.className=r.cssClass),t.appendChild(i),i}function s(t,e){t.className=t.className?t.className+" "+e:e}function a(t){t.style.display="none"}function u(t,e){e||(e=""),t.style.display=e}function l(t,e,n){n||(n={}),n.display||(n.display=""),n.duration||(n.duration=200),a(t),u(e,n.display),n.complete&&n.complete()}function c(t){return"none"!=t.style.display&&0!=t.offsetWidth&&0!=t.offsetHeight}function d(t){var e;return"function"==typeof Event?e=new Event(t):(e=document.createEvent("Event")).initEvent(t,!0,!0),e}function h(){return{width:Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),height:Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)}}function p(){return i.a.IsIE()?m():{width:Math.max(document.documentElement.clientWidth,document.body.clientWidth||0),height:Math.max(document.documentElement.clientHeight,document.body.clientHeight||0)}}function f(){var t=document.body,e=document.documentElement;return{top:window.pageYOffset||e.scrollTop||t.scrollTop,left:window.pageXOffset||e.scrollLeft||t.scrollLeft}}function g(t){var e={x:0,y:0};if(null!==t){var n=function(t){var e,n={top:0,right:0,bottom:0,left:0,width:0,height:0};try{e=t.getBoundingClientRect()}catch(t){e=n}var i=document.body,r=document.documentElement,o=f(),s=o.top,a=o.left,u=r.clientTop||i.clientTop||0,l=r.clientLeft||i.clientLeft||0,c=e.top+s-u,d=e.left+a-l;return{top:Math.round(c),left:Math.round(d)}}(t);e={x:n.left,y:n.top}}return e}function m(){return{width:window.innerWidth,height:window.innerHeight}}function y(t,e,n){t.style.removeProperty("display");var i=window.getComputedStyle(t).display;"none"===i&&(i="block"),t.style.display=i;var r=t.offsetHeight;t.style.overflow="hidden",t.style.height="0px",t.style.paddingTop="0px",t.style.paddingBottom="0px",t.style.marginTop="0px",t.style.marginBottom="0px",t.offsetHeight,t.style.boxSizing="border-box",t.style.transitionProperty="height, margin, padding",t.style.transitionDuration=e+"ms",t.style.height=r+"px",t.style.removeProperty("padding-top"),t.style.removeProperty("padding-bottom"),t.style.removeProperty("margin-top"),t.style.removeProperty("margin-bottom"),window.setTimeout((function(){t.style.removeProperty("height"),t.style.removeProperty("overflow"),t.style.removeProperty("transition-duration"),t.style.removeProperty("transition-property"),t.style.removeProperty("box-sizing"),n&&n()}),e)}function v(t,e,n){t.style.transitionProperty="height, margin, padding",t.style.transitionDuration=e+"ms",t.style.boxSizing="border-box",t.style.height=t.offsetHeight+"px",t.offsetHeight,t.style.overflow="hidden",t.style.height="0px",t.style.paddingTop="0px",t.style.paddingBottom="0px",t.style.marginTop="0px",t.style.marginBottom="0px",window.setTimeout((function(){t.style.display="none",t.style.removeProperty("height"),t.style.removeProperty("padding-top"),t.style.removeProperty("padding-bottom"),t.style.removeProperty("margin-top"),t.style.removeProperty("margin-bottom"),t.style.removeProperty("overflow"),t.style.removeProperty("transition-duration"),t.style.removeProperty("transition-property"),t.style.removeProperty("box-sizing"),n&&n()}),e)}var b="eqjs",w="eqjs-mobile"},function(t,e,n){"use strict";n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return a})),n.d(e,"c",(function(){return u}));var i=n(0),r="yyyy-MM-dd",o="HH:mm",s=function(t){return t==i.DataType.Date?r:t==i.DataType.Time?o:r+"T"+o},a=function(t){var e=i.i18n.getLocaleSettings();return t==i.DataType.Date?e.editDateFormat:t==i.DataType.Time?e.editTimeFormat:e.editDateFormat+" "+e.editTimeFormat},u=function(t){var e=window.history.state;history.pushState(e,document.title,t),window.dispatchEvent(new Event("ed_set_location"))}},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return s})),n.d(e,"c",(function(){return a}));var i,r=n(0),o=n(13);!function(t){t[t.NONE=1]="NONE",t[t.LEFT=2]="LEFT",t[t.CENTER=3]="CENTER",t[t.RIGHT=4]="RIGHT"}(i||(i={}));var s=function(){function t(t,e,n){void 0===n&&(n=!1),this._label=null,this._description=null,this.align=i.NONE,this.isVisible=!0,this.isRowNum=!1,this.dataColumn=t,this.grid=e;var s=e.options.columnWidths||{};t?(t.style.alignment&&(this.align=function(t){switch(t){case r.ColumnAlignment.Left:return i.LEFT;case r.ColumnAlignment.Center:return i.CENTER;case r.ColumnAlignment.Right:return i.RIGHT;default:return i.NONE}}(t.style.alignment)),this.width=s&&s[this.type]?s[this.type].default:250,this.cellRenderer=this.grid.cellRendererStore.getDefaultRenderer(t.type),this._description=t.description):n&&(this.isRowNum=!0,this.width=s&&s.rowNumColumn?s.rowNumColumn.default:60,this._label="",this.cellRenderer=this.grid.cellRendererStore.getDefaultRendererByType(o.a.NUMBER)),e&&e.options&&e.options.onGetCellRenderer&&(this.cellRenderer=e.options.onGetCellRenderer(this,this.cellRenderer)||this.cellRenderer)}return Object.defineProperty(t.prototype,"label",{get:function(){return this._label?this._label:this.isRowNum?"":this.dataColumn.label},set:function(t){this._label=this.label},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"description",{get:function(){return this._description},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this.dataColumn?this.dataColumn.type:null},enumerable:!0,configurable:!0}),t}(),a=function(){function t(t,e){this.items=[],this.grid=e,this.sync(t)}return t.prototype.sync=function(t,e){void 0===e&&(e=!0),this.clear();var n=new s(null,this.grid,!0);if(this.add(n),e||(n.isVisible=!1),t)for(var i=0,r=t.getItems();i<r.length;i++){var o=r[i],a=new s(o,this.grid);this.grid.options.onSyncGridColumn&&this.grid.options.onSyncGridColumn(a),this.add(a)}},Object.defineProperty(t.prototype,"count",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),t.prototype.add=function(t){var e=this.items.length;return this.items.push(t),e},t.prototype.put=function(t,e){t>=0&&t<this.items.length&&(this.items[t]=e)},t.prototype.move=function(t,e){var n=this.items.indexOf(t);n>=0&&n!=e&&r.utils.moveArrayItem(this.items,n,e)},t.prototype.get=function(t){return t>=0&&t<this.items.length?this.items[t]:null},t.prototype.getItems=function(){return this.items},t.prototype.removeAt=function(t){this.get(t);this.items.splice(t,1)},t.prototype.clear=function(){this.items=[]},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i=function(){}},function(t,e,n){"use strict";var i;n.d(e,"a",(function(){return i})),function(t){t[t.Always=0]="Always",t[t.Once=1]="Once",t[t.Never=2]="Never"}(i||(i={}))},function(t,e,n){"use strict";var i;n.d(e,"a",(function(){return i})),function(t){t.Trace="TRACE",t.Options="OPTIONS",t.Get="GET",t.Put="PUT",t.Post="POST",t.Delete="DELETE"}(i||(i={}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return u})),n.d(e,"a",(function(){return c})),n.d(e,"d",(function(){return d}));var i,r=n(0),o=n(6),s=n(1),a="undefined"!=typeof TouchEvent;!function(t){t.None="none",t.Allow="allow",t.Forbid="forbid"}(i||(i={}));var u=function(t,e,n){this.dropEffect=i.Allow,this.pageX=0,this.pageY=0,this.item=t,this.dragImage=e,this.data=t.data,this.sourceEvent=n,n&&n instanceof MouseEvent&&(this.pageX=n.pageX,this.pageY=n.pageY),n&&a&&n instanceof TouchEvent&&n.touches[0]&&(this.pageX=n.touches[0].pageX,this.pageY=n.touches[0].pageY)},l=function(t){t&&t instanceof MouseEvent&&(this.x=t.pageX,this.y=t.pageY),t&&a&&t instanceof TouchEvent&&t.touches[0]&&(this.x=t.touches[0].pageX,this.y=t.touches[0].pageY)},c=function(){function t(){this.delta=5,this.draggableItem=null,this.dragImage=null,this.finishedSuccessfully=!1,this.mouseDownPosition=null,this.containerDescriptors=[],this.containerDescriptorIndex=-1,this.dropEffect=i.None,this.classPrefix="eqjs-drop",this.DRAG_DISABLED_ATTR="drag-disabled"}return t.prototype.registerDraggableItem=function(t){var e=this,n=t.element;if(!n)throw Error("Element in draggle item is null or undefined");n.ondragstart=function(){return!1};var r=function(t){if(!n.hasAttribute(e.DRAG_DISABLED_ATTR)){t.preventDefault(),t instanceof MouseEvent&&t.stopPropagation();var i=new l(t);(Math.abs(i.x-e.mouseDownPosition.x)>e.delta||Math.abs(i.y-e.mouseDownPosition.y)>e.delta)&&c(t)}},o=function(t){e.mouseMoveDragListener(t)},c=function(a){a.preventDefault(),a.stopPropagation(),n.removeEventListener("mousemove",r),n.removeEventListener("touchmove",r),e.finishedSuccessfully=!1,t.beforeDragStart&&t.beforeDragStart(),e.dragImage=Object(s.e)("div").setStyle("position","absolute").setStyle("z-index","65530").toDOM(),document.body.appendChild(e.dragImage),e.dragImage.appendChild(n.cloneNode(!0)),t.renderer&&t.renderer(e.dragImage),e.dropEffect=i.None,e.updateCusror(e.dropEffect),e.updateImageClass(e.dropEffect),e.draggableItem={element:n,scope:t.scope,data:t.data},e.updateDragItemPosition(a);var l=new u(e.draggableItem,e.dragImage,a);l.dropEffect=e.dropEffect,t.onDragStart&&t.onDragStart(l),e.dropEffect!==l.dropEffect&&(e.dropEffect=l.dropEffect,e.updateImageClass(e.dropEffect)),document.addEventListener("mousemove",o,!0),document.addEventListener("touchmove",o,!0)},d=function(t){a&&t instanceof TouchEvent&&t.preventDefault(),e.mouseDownPosition=new l(t),n.addEventListener("mousemove",r),n.addEventListener("touchmove",r),document.addEventListener("mouseup",h),document.addEventListener("touchend",h)};n.addEventListener("mousedown",d),n.addEventListener("touchstart",d);var h=function(t){e.mouseDownPosition=null,n.removeEventListener("mousemove",r),n.removeEventListener("touchmove",r),document.removeEventListener("mousemove",o,!0),document.removeEventListener("touchmove",o,!0),e.draggableItem&&p(t)},p=function(n){try{if(e.containerDescriptorIndex>=0){var r=e.containerDescriptors[e.containerDescriptorIndex],o={element:r.element,scopes:r.scopes,data:r.data},s=new u(e.draggableItem,e.dragImage,n);try{o.scopes.indexOf(e.draggableItem.scope)>=0&&e.dropEffect===i.Allow&&(e.finishedSuccessfully=!0,r.onDrop&&r.onDrop(o,s))}finally{r.onDragLeave&&r.onDragLeave(o,s)}}}finally{try{var a=new u(e.draggableItem,e.dragImage,n);a.data.finishedSuccessfully=e.finishedSuccessfully,t.onDragEnd&&t.onDragEnd(a)}finally{e.draggableItem=null,e.dragImage&&e.dragImage.parentElement&&e.dragImage.parentElement.removeChild(e.dragImage),e.dragImage=null,e.finishedSuccessfully=!1,document.removeEventListener("mouseup",h),document.removeEventListener("touchend",h)}}}},t.prototype.registerDropContainer=function(t){if(!t.element)throw Error("Element in drop container is null or undefined");this.containerDescriptors.push(t)},t.prototype.removeDropContainer=function(t){var e=this.containerDescriptors.filter((function(e){return e===t||e.element==t}));if(e)for(var n=0,i=e;n<i.length;n++){var o=i[n];r.utils.removeArrayItem(this.containerDescriptors,o)}},t.prototype.mouseMoveDragListener=function(t){if(t instanceof MouseEvent&&t.preventDefault(),t.stopPropagation(),this.updateDragItemPosition(t),-1==this.containerDescriptorIndex){for(var e=0;e<this.containerDescriptors.length;e++){var n=this.containerDescriptors[e];if(this.detectDragEnterEvent(n.element,t)){this.containerDescriptorIndex=e;break}}this.containerDescriptorIndex>=0&&this.dragEnterEvent(t)}else{n=this.containerDescriptors[this.containerDescriptorIndex];this.detectDragLeaveEvent(n.element,t)&&(this.dragLeaveEvent(t),this.containerDescriptorIndex=-1)}if(this.containerDescriptorIndex>=0){var i={element:(n=this.containerDescriptors[this.containerDescriptorIndex]).element,scopes:n.scopes,data:n.data};if(i.scopes.indexOf(this.draggableItem.scope)>=0){var r=new u(this.draggableItem,this.dragImage,t);r.dropEffect=this.dropEffect,n.onDragOver&&n.onDragOver(i,r)}}},t.prototype.updateCusror=function(t){switch(t){case i.Allow:this.setCursorStyle(this.dragImage,"grabbing");break;case i.Forbid:this.setCursorStyle(this.dragImage,"no-drop");break;default:this.setCursorStyle(this.dragImage,"grabbing")}},t.prototype.updateImageClass=function(t){switch(this.dragImage.classList.remove(this.classPrefix+"-allow"),this.dragImage.classList.remove(this.classPrefix+"-forbid"),this.dragImage.classList.remove(this.classPrefix+"-none"),t){case i.Allow:this.dragImage.classList.add(this.classPrefix+"-allow");break;case i.None:this.dragImage.classList.add(this.classPrefix+"-none");break;case i.Forbid:this.dragImage.classList.add(this.classPrefix+"-forbid");break;default:this.dragImage.classList.add(this.classPrefix+"-none")}},t.prototype.setCursorStyle=function(t,e){if(t){t.style.cursor=e;for(var n=0;n<t.children.length;n++)this.setCursorStyle(t.children[n],e)}},t.prototype.updateDragItemPosition=function(t){if(this.dragImage){var e=new l(t);this.dragImage.style.top=e.y-this.dragImage.offsetHeight/2+"px",this.dragImage.style.left=e.x-this.dragImage.offsetWidth/2+"px"}},t.prototype.dragEnterEvent=function(t){var e=this.containerDescriptors[this.containerDescriptorIndex],n={element:e.element,scopes:e.scopes,data:e.data};if(n.scopes.indexOf(this.draggableItem.scope)>=0){var r=new u(this.draggableItem,this.dragImage,t);r.dropEffect=i.Allow,e.onDragEnter&&e.onDragEnter(n,r),this.dropEffect=r.dropEffect,this.updateCusror(this.dropEffect),this.updateImageClass(this.dropEffect)}else this.dropEffect!==i.Forbid&&(this.dropEffect=i.None,this.updateCusror(this.dropEffect),this.updateImageClass(this.dropEffect))},t.prototype.dragLeaveEvent=function(t){var e=this.containerDescriptors[this.containerDescriptorIndex],n={element:e.element,scopes:e.scopes,data:e.data};if(n.scopes.indexOf(this.draggableItem.scope)>=0){var r=new u(this.draggableItem,this.dragImage,t);r.dropEffect=i.None,e.onDragLeave&&e.onDragLeave(n,r),this.dropEffect=r.dropEffect,this.updateCusror(this.dropEffect),this.updateImageClass(this.dropEffect)}},t.prototype.detectDragEnterEvent=function(t,e){var n=Object(o.g)(t),i=new l(e);return!(i.y<n.y||i.y>n.y+t.offsetHeight)&&!(i.x<n.x||i.x>n.x+t.offsetWidth)},t.prototype.detectDragLeaveEvent=function(t,e){var n=Object(o.g)(t),i=new l(e);return!(i.y>n.y&&i.y<n.y+t.offsetHeight&&i.x>n.x&&i.x<n.x+t.offsetWidth)},t}(),d=new c},function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return h}));var i,r=n(0),o=n(8),s="keg",a=/{0:(.*?)}/g;!function(t){t[t.STRING=1]="STRING",t[t.NUMBER=2]="NUMBER",t[t.DATETIME=3]="DATETIME",t[t.BOOL=4]="BOOL"}(i||(i={}));var u=function(t,e,n,i){var r=t?t.toString().replace(/\n/g,"↵ "):"";n.innerText=r,n.title=r,e.align==o.b.NONE&&n.classList.add(s+"-cell-value-align-left")},l=function(t,e,n,i){var u=(t||"").toString();"number"==typeof t&&(u=e.dataColumn&&e.dataColumn.displayFormat&&a.test(e.dataColumn.displayFormat)?e.dataColumn.displayFormat.replace(a,(function(e,n){return r.i18n.numberToStr(t,n)})):t.toLocaleString()),n.innerText=u,n.title=u,e.align==o.b.NONE&&n.classList.add(s+"-cell-value-align-right")},c=function(t,e,n,i){var u="[object Date]"===Object.prototype.toString.call(t),l=(t||"").toString();if(u)if(e.dataColumn&&e.dataColumn.displayFormat&&a.test(e.dataColumn.displayFormat))l=e.dataColumn.displayFormat.replace(a,(function(n,i){return r.i18n.dateTimeToStr(t,e.type,i)}));else{var c=r.i18n.getCurrentLocale(),d={hour:"numeric",minute:"numeric",second:"numeric"};switch(e.type){case r.DataType.Date:l=t.toLocaleDateString(c);break;case r.DataType.Time:l=t.toLocaleTimeString(c,d);break;case r.DataType.DateTime:l=t.toLocaleDateString(c)+" "+t.toLocaleTimeString(c,d)}}n.innerText=l,n.title=l,e.align==o.b.NONE&&n.classList.add(s+"-cell-value-align-right")},d=function(t,e,n,i){if(e.dataColumn&&e.dataColumn.displayFormat&&a.test(e.dataColumn.displayFormat)){var o=e.dataColumn.displayFormat.replace(a,(function(e,n){return r.i18n.booleanToStr(t,n)}));return u(o,e,n)}n.classList.add(s+"-cell-value-bool"),n.classList.add(s+"-"+(t?"cell-value-true":"cell-value-false"))},h=function(){function t(t){this.renderers={},this.defaultRenderers={},this.registerRenderer("StringDefault",u),this.setDefaultRenderer(i.STRING,u),this.registerRenderer("NumberDefault",l),this.setDefaultRenderer(i.NUMBER,l),this.registerRenderer("DateTimeDefault",c),this.setDefaultRenderer(i.DATETIME,c),this.registerRenderer("BoolDefault",d),this.setDefaultRenderer(i.BOOL,d)}return t.prototype.getDefaultRenderer=function(t){var e=this.getCellType(t);return this.defaultRenderers[i[e]]},t.prototype.getDefaultRendererByType=function(t){return this.defaultRenderers[i[t]]},t.prototype.setDefaultRenderer=function(t,e){e&&(this.defaultRenderers[i[t]]=e)},t.prototype.getRenderer=function(t){return this.renderers[t]},t.prototype.registerRenderer=function(t,e){this.renderers[t]=e},t.prototype.getCellType=function(t){switch(t){case r.DataType.Autoinc:case r.DataType.Byte:case r.DataType.Word:case r.DataType.Currency:case r.DataType.Float:case r.DataType.Int32:case r.DataType.Int64:return i.NUMBER;case r.DataType.Date:case r.DataType.DateTime:case r.DataType.Time:return i.DATETIME;case r.DataType.Bool:return i.BOOL;default:return i.STRING}},t}()},function(t,e,n){"use strict";function i(t,e){for(var n="",i=0;i<e;i++)n+=t;return n}function r(t){return t.split("").reverse().join("")}function o(t,e){return t&&t.lastIndexOf(e)==t.length-e.length}function s(t,e){var n=t;return null!=n&&n.length>0?("/"!=n.charAt(n.length-1)&&(n+="/"),n+=e):n=e,n}n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return r})),n.d(e,"d",(function(){return o})),n.d(e,"a",(function(){return s}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i=function(){function t(t,e){this.columns=t,this.values=e}return t.prototype.toArray=function(){return Array.from(this.values)},t.prototype.size=function(){return this.values.length},t.prototype.getValue=function(t){var e;if("string"==typeof t){if(void 0===(e=this.columns.getIndex(t)))throw new RangeError("No column with id '"+t+"'")}else e=t;if(e>=this.values.length)throw new RangeError("Out of range: "+e);return this.values[e]},t.prototype.setValue=function(t,e){var n;if("string"==typeof t){if(void 0===(n=this.columns.getIndex(t)))throw new RangeError("No column with id '"+t+"'")}else n=t;if(n>=this.values.length)throw new RangeError("Out of range: "+n);this.values[n]=e},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i=function(){function t(t,e){this.xhr=t,this.method=e.method,this.url=e.url,this.headers=e.headers,this.queryParams=e.queryParams,this.data=e.data}return t.prototype.setHeader=function(t,e){this.headers[t]=e},t.prototype.setQueryParam=function(t,e){this.queryParams[t]=e},t.prototype.getXMLHttpRequest=function(){return this.xhr},t.prototype.getResponseHeaders=function(){if(this.xhr.readyState==this.xhr.HEADERS_RECEIVED){for(var t={},e=0,n=this.xhr.getAllResponseHeaders().trim().split(/[\r\n]+/);e<n.length;e++){var i=n[e].split(": "),r=i.shift(),o=i.join(": ");t[r]=o}return t}return{}},t.prototype.open=function(){var t=this;if(this.xhr.readyState===this.xhr.UNSENT){var e=this.url;for(var n in this.queryParams&&Object.keys(this.queryParams).length>0&&(e+=encodeURI("?"+Object.keys(this.queryParams).map((function(e){return e+"="+t.queryParams[e]})).join("&"))),this.xhr.open(this.method,e,!0),this.xhr.setRequestHeader("X-Requested-With","XMLHttpRequest"),this.headers)this.xhr.setRequestHeader(n,this.headers[n])}},t.prototype.abort=function(){this.xhr.abort()},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return a}));var i,r=n(2),o=n(4);!function(t){t[t.None=0]="None",t[t.Left=1]="Left",t[t.Center=2]="Center",t[t.Right=3]="Right"}(i||(i={}));var s=function(t){if(!t)throw Error("Options are required");if(!t.id)throw Error("Field Id is required");if(!t.label)throw Error("Label is required");this.id=t.id,this.type=o.a.getIfDefined(t.type,r.a.String),this.label=t.label,this.originAttrId=t.originAttrId,this.isAggr=t.isAggr||!1,this.displayFormat=t.dfmt,this.groupFooterColumnTemplate=t.gfct,this.style=t.style||{},this.description=t.description,this.calculatedWidth=0},a=function(){function t(){this.items=[],this.mapper={},this._dateColumnIdx=[]}return Object.defineProperty(t.prototype,"count",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),t.prototype.add=function(t){var e;e=t instanceof s?t:new s(t);var n=this.items.length;return this.items.push(e),this.mapper[e.id]=n,[r.a.Date,r.a.DateTime,r.a.Time].indexOf(e.type)>=0&&this._dateColumnIdx.push(n),n},t.prototype.updateDateColumnIdx=function(){this._dateColumnIdx=this.getItems().filter((function(t){return[r.a.Date,r.a.DateTime,r.a.Time].indexOf(t.type)>=0})).map((function(t,e){return e}))},t.prototype.put=function(t,e){t>=0&&t<this.count&&(this.items[t]=e,this.updateDateColumnIdx())},t.prototype.move=function(t,e){var n=this.items.indexOf(t);n>=0&&n!=e&&(o.a.moveArrayItem(this.items,n,e),this.updateDateColumnIdx())},t.prototype.get=function(t){return t>=0&&t<this.count?this.items[t]:null},t.prototype.getIndex=function(t){return this.mapper[t]},t.prototype.getItems=function(){return this.items},t.prototype.getDateColumnIndexes=function(){return this._dateColumnIdx},t.prototype.removeAt=function(t){var e=this.get(t);this.items.splice(t,1);var n=this._dateColumnIdx.indexOf(t);n>=0&&this._dateColumnIdx.splice(n,1),delete this.mapper[e.id]},t.prototype.clear=function(){this.items=[],this._dateColumnIdx=[],this.mapper={}},t}()},function(module,__webpack_exports__,__webpack_require__){"use strict";var browserUtils;__webpack_require__.d(__webpack_exports__,"a",(function(){return browserUtils})),function(browserUtils){var _isFirefox=null,_isIE=null;function IsIE(){if(null===_isIE){var t=navigator.userAgent;_isIE=t.indexOf("MSIE ")>-1||t.indexOf("Trident/")>-1}return _isIE}function IsEdge(){return!IsIE()&&eval("!!window.StyleMedia")}function IsFirefox(){if(null===_isFirefox){var t=navigator.userAgent;_isFirefox=t.toLowerCase().indexOf("firefox")>-1}return _isFirefox}browserUtils.IsIE=IsIE,browserUtils.IsEdge=IsEdge,browserUtils.IsFirefox=IsFirefox;var _detectedIsMobileMode=!1,_isMobileMode=void 0,detectIsMobileMode=function(){var t=isMobileMode();_detectedIsMobileMode=window.matchMedia("only screen and (max-width: 840px)").matches||window.matchMedia("only screen and (max-height: 420px)").matches;var e=isMobileMode();e!==t&&mobileModeChangeHandler&&mobileModeChangeHandler(e)},mobileModeChangeHandler;function isMobileMode(){return void 0!==_isMobileMode?_isMobileMode:_detectedIsMobileMode}function setIsMobileMode(t){var e=isMobileMode();_isMobileMode=t;var n=isMobileMode();n!==e&&mobileModeChangeHandler&&mobileModeChangeHandler(n)}function onMobileModeChanged(t){mobileModeChangeHandler=t}function getMobileCssClass(){return isMobileMode()?"k-mobile":null}detectIsMobileMode(),window.addEventListener("resize",(function(){return detectIsMobileMode()})),browserUtils.isMobileMode=isMobileMode,browserUtils.setIsMobileMode=setIsMobileMode,browserUtils.onMobileModeChanged=onMobileModeChanged,browserUtils.getMobileCssClass=getMobileCssClass}(browserUtils||(browserUtils={}))},function(t,e,n){"use strict";function i(t,e){var n={9:"[0-9]",a:"[a-z]"},i=e.split(""),r=function(e){if("focus"!==e.type||""===t.value){var r=[],o=t.selectionStart;i.forEach((function(e,i){if(n[e]){var o=new RegExp(n[e],"i").test(t.value.charAt(i));r.push(o?t.value.charAt(i):"_")}else r.push(e)})),t.value=r.join(""),t.selectionStart=t.selectionEnd=o}};t.addEventListener("keydown",(function(e){if(8===e.keyCode||46===e.keyCode){e.preventDefault();var r=[],o=t.selectionStart;if(0==o)return;for(var s=o,a=!0,u=i.length-1;u>=0;u--){var l=i[u];if(n[l]){var c=new RegExp(n[l],"i").test(t.value.charAt(u));c&&u!=o-1&&(a=!1),u===o-1&&s--,r.push(c&&u!=o-1?t.value.charAt(u):"_")}else u===s-1&&s--,o-1===u&&o--,r.push(l)}t.value=a?"":r.reverse().join(""),t.selectionStart=t.selectionEnd=s<0?0:s;var d=document.createEvent("Event");d.initEvent("input",!0,!0),t.dispatchEvent(d)}})),t.addEventListener("keypress",(function(e){var r=String.fromCharCode(e.charCode);if(r){e.preventDefault();var o=[],s=t.selectionStart,a=s;i.forEach((function(e,i){if(n[e]){var u=i!=s?t.value.charAt(i):r,l=new RegExp(n[e],"i").test(u);o.push(l?u:"_"),l&&s===i&&a++}else o.push(e),a===i&&a++,s===i&&s++})),t.value=o.join(""),t.selectionStart=t.selectionEnd=a;var u=document.createEvent("Event");u.initEvent("input",!0,!0),t.dispatchEvent(u)}})),t.addEventListener("input",r),t.addEventListener("focus",r)}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";(function(t){n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return c})),n.d(e,"d",(function(){return d})),n.d(e,"c",(function(){return h}));var i,r=n(0),o=n(21),s=n(1),a=(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},i(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u="kdlg",l=function(){function e(){}return e.prototype.openConfirm=function(e,n,i){var r=this,o={title:e,closable:!1,submitable:!0,cancelable:!0,body:'<div id="kdlg-dialog-confirm">'+n+"</div>"};return i?(o.onSubmit=function(){i(!0)},o.onCancel=function(){i(!1)},void this.open(o)):new t((function(t){o.onSubmit=function(){t(!0)},o.onCancel=function(){t(!1)},r.open(o)}))},e.prototype.openPrompt=function(e,n,i,r){var o=this,s={title:e,submitable:!0,closable:!0,cancelable:!0,submitOnEnter:!0,body:'<div id="kdlg-dialog-form" class="kfrm-form">\n <div class="kfrm-fields label-above">\n <label for="kdlg-dialog-form-input" id="kdlg-dialog-form-content">'+n+'</label>\n <input type="text" name="'+u+'-dialog-form-input" id="'+u+'-dialog-form-input" />\n </div>\n </div>',arrangeParents:!1,beforeOpen:function(){var t=document.getElementById(u+"-dialog-form-input");i&&(t.value=i),t.focus()}},a=function(t){var e=document.getElementById(u+"-dialog-form-input"),n=e.value;return n&&n.replace(/\s/g,"").length>0?(t(n),!0):(e.classList.add("eqjs-invalid"),!1)};return r?(s.onSubmit=function(){return a(r)},s.onCancel=function(){r("")},void this.open(s)):new t((function(t){s.onSubmit=function(){return a(t)},s.onCancel=function(){t("")},o.open(s)}))},e.prototype.open=function(t,e){var n=this,i=new c(t,e),r=t.onDestroy;return t.onDestroy=function(t){n.untrack(t),r&&r(t)},i.open(),this.track(i),i},e.prototype.createSet=function(t){return new h(t,this)},e.prototype.untrack=function(t){var n=e.openDialogs.indexOf(t);n>=0&&e.openDialogs.splice(n,1)},e.prototype.track=function(t){e.openDialogs.push(t)},e.prototype.openProgress=function(t){var e=this,n=new d(t),i=t.onDestroy;return t.onDestroy=function(t){e.untrack(t),i&&i(t)},n.open(),this.track(n),n},e.prototype.getAllDialogs=function(){return Array.from(e.openDialogs)},e.prototype.closeAllDialogs=function(){for(var t=0,n=Array.from(e.openDialogs);t<n.length;t++){n[t].close()}},e.openDialogs=[],e}(),c=function(){function t(t,e){var n=this;this.options=t,this.submitHandler=function(t){return(!n.options.onSubmit||!1!==n.options.onSubmit(n,t))&&(n.destroy(),!0)},this.cancelHandler=function(){n.options.onCancel&&n.options.onCancel(n),n.destroy()},this.keydownHandler=function(t){return 13!=t.keyCode||!n.isActiveDialog()||(t.preventDefault(),t.stopPropagation(),!n.submitHandler())||(window.removeEventListener("keydown",n.keydownHandler,!1),!1)},this.dialogId=r.utils.generateId("dlg"),this.data=e,this.slot=Object(s.e)("div",document.body).attr("tab-index","-1").data("dialog-id",this.dialogId).addClass(u+"-modal","is-active").focus().addChild("div",(function(t){return t.addClass("kdlg-modal-background")})).addChild("div",(function(i){return n.windowElement=i.addClass(u+"-modal-window").addChild("header",(function(e){n.headerElement=e.addClass(u+"-header").addChild("p",(function(e){return e.addClass(u+"-header-title").addText(t.title)})).toDOM(),!1!==t.closable&&e.addChild("button",(function(t){return t.addClass(u+"-modal-close").on("click",(function(){n.cancelHandler()})).focus()}))})).addChild("div",(function(t){t.addClass(u+"-alert-container"),n.alertElement=t.toDOM()})).addChild("section",(function(i){if(n.bodyElement=i.addClass(u+"-body").toDOM(),"string"==typeof t.body){var o=r.liquid.renderLiquidTemplate(t.body,e);i.addHtml(o)}else i.addChildElement(t.body)})).addChild("footer",(function(e){var i=null;i=t.footerAlignment&&t.footerAlignment==o.a.Center?"align-center":"align-right",n.footerElement=e.addClass(u+"-footer").toDOM(),e.addClass(i),!1!==t.submitable&&(e.addChild("button",(function(e){e.id(n.dialogId+"-btn-submit").addClass("kfrm-button","is-info").addText(t.submitButtonText||r.i18n.getText("ButtonOK")),t.recaptchaSiteKey?(e.data("sitekey",t.recaptchaSiteKey),e.addClass("g-recaptcha"),e.on("click",(function(e){grecaptcha?grecaptcha.ready((function(){grecaptcha.execute(t.recaptchaSiteKey,{action:"submit"}).then((function(t){n.submitHandler(t)}))})):n.submitHandler()}))):e.on("click",(function(t){n.submitHandler()})),e.focus()})),!1!==t.cancelable&&e.addChild("button",(function(e){return e.id(n.dialogId+"-btn-cancel").addClass("kfrm-button").addText(t.cancelButtonText||r.i18n.getText("ButtonCancel")).on("click",(function(t){n.cancelHandler()}))})))})).toDOM()})).toDOM()}return t.prototype.getData=function(){return this.data},t.prototype.getRootElement=function(){return this.slot},t.prototype.getSubmitButtonElement=function(){return document.getElementById(this.dialogId+"-btn-submit")},t.prototype.getCancelButtonElement=function(){return document.getElementById(this.dialogId+"-btn-cancel")},t.prototype.open=function(){var t=this;this.options.beforeOpen&&this.options.beforeOpen(this),Object(s.e)(this.slot).show(),this.options.arrangeParents&&this.arrangeParents(!0);var e=this.slot.querySelector(".kdlg-modal-window");this.options.height&&(e.style.height="string"==typeof this.options.height?this.options.height:this.options.height+"px"),this.options.width&&(e.style.width="string"==typeof this.options.width?this.options.width:this.options.width+"px"),this.options.submitOnEnter&&window.addEventListener("keydown",this.keydownHandler,!1),this.slot.querySelectorAll("input").forEach((function(e){return e.addEventListener("input",(function(){t.clearAlert(),t.options.onInput&&t.options.onInput(t)}))})),this.options.onShow&&this.options.onShow(this)},t.prototype.submit=function(){this.submitHandler()},t.prototype.cancel=function(){this.cancelHandler()},t.prototype.close=function(){this.destroy()},t.prototype.disableButtons=function(){this.slot.querySelectorAll("button").forEach((function(t){return t.disabled=!0}))},t.prototype.enableButtons=function(){this.slot.querySelectorAll("button").forEach((function(t){return t.disabled=!1}))},t.prototype.showAlert=function(t,e,n){var i=Object(s.e)("div").addClass(u+"-alert "+(e||"")).addChild("span",(function(t){return t.addClass(u+"-alert-closebtn").text("×").on("click",(function(t){var e=t.target.parentElement;e.parentElement.removeChild(e)}))})).addText(t).toDOM();!0===n&&this.clearAlert(),this.alertElement.appendChild(i)},t.prototype.clearAlert=function(){this.alertElement.innerHTML=""},t.prototype.destroy=function(){document.querySelectorAll('[data-dialog-id="'+this.dialogId+'"]').length<=0||(this.options.arrangeParents&&this.arrangeParents(!1),document.body.removeChild(this.slot),this.options.submitOnEnter&&window.removeEventListener("keydown",this.keydownHandler,!1),this.options.onDestroy&&this.options.onDestroy(this))},t.prototype.isActiveDialog=function(){var t=document.documentElement.querySelectorAll(".kdlg-modal");return t[t.length-1]===this.slot},t.prototype.arrangeParents=function(t){for(var e=document.documentElement.querySelectorAll(".kdlg-modal-window"),n=0;n<e.length-1;n++)if(t){var i=0==n?20:40*n+20;Object(s.e)(e[n]).setStyle("margin-top",i+"px").setStyle("margin-left",i+"px")}else Object(s.e)(e[n]).removeStyle("margin-top").removeStyle("margin-left")},t}(),d=function(t){function e(e,n){var i,r,o=this,a=Object(s.e)("div").addChild("div",(function(t){return i=t.text(e.content||"").toDOM()})).addChild("div",(function(t){t.addClass(u+"-progress-line").addChild("div",(function(t){r=t.addClass("fill").toDOM(),e.determinated?t.setStyle("width","0%"):t.addClass("indeterminate")}))})).toDOM();return(o=t.call(this,{title:e.title,body:a,beforeOpen:e.beforeOpen,onSubmit:e.onSubmit,width:e.width,height:e.height,submitable:!1,cancelable:!1,closable:!1,onDestroy:e.onDestroy},n)||this).contentElement=i,o.progressElement=r,o}return a(e,t),e.prototype.updateContent=function(t){this.contentElement.innerText=t},e.prototype.updateProgress=function(t){var e=this;t=this.in01(t),this.progressElement.style.width=100*t+"%",1===t&&setTimeout((function(){e.submit()}),500)},e.prototype.in01=function(t){return t>1?1:t<0?0:t},e}(c),h=function(){function t(t,e){this.options=t,this.dialogService=e,this.currentDialog=null,this.currentIndex=0,this.options=t,this.dialogService=e}return t.prototype.getCurrent=function(){return this.currentDialog},t.prototype.openNext=function(t){return this.open(this.currentIndex+1,t)},t.prototype.openPrev=function(t){return this.open(this.currentIndex-1,t)},t.prototype.open=function(t,e){if(t<0?this.currentIndex=0:t>=this.options.length?this.currentIndex=this.options.length-1:this.currentIndex=t,this.currentDialog)try{this.currentDialog.close()}catch(t){}var n=this.options[this.currentIndex];return this.currentDialog=this.dialogService.open(n,e),this.currentDialog},t.prototype.close=function(){this.currentDialog&&(this.currentDialog.close(),this.currentDialog=null)},t}()}).call(this,n(30))},function(t,e,n){"use strict";var i;n.d(e,"a",(function(){return i})),function(t){t[t.Left=1]="Left",t[t.Center=2]="Center",t[t.Right=3]="Right"}(i||(i={}))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return o}));var i=n(0),r=function(){return r=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},r.apply(this,arguments)},o=function(){function e(t,e,n,i){void 0===i&&(i=!1),this.loader=t,this.sourceTable=e,this.sourceId=n,this.isLookup=i,this.filterValue="",this.justServerSide=!1}return e.prototype.getValue=function(){return this.filterValue},e.prototype.apply=function(t){return this.filterValue=t,this.filterValue?this.applyCore():this.clear()},e.prototype.clear=function(){return this.filterValue="",t.resolve(this.sourceTable)},e.prototype.applyCore=function(){var t=this;if(this.sourceTable.getTotal()!=this.sourceTable.getCachedCount()||this.justServerSide){var e=[{class:"__substring",value:this.filterValue}];return this.loader.loadChunk({offset:0,limit:this.sourceTable.chunkSize,needTotal:!0,filters:e,sourceId:this.sourceId,lookup:this.isLookup}).then((function(n){for(var o=new i.EasyDataTable({chunkSize:t.sourceTable.chunkSize,loader:{loadChunk:function(n){return t.loader.loadChunk(r(r({},n),{filters:e,sourceId:t.sourceId,lookup:t.isLookup}))}}}),s=0,a=t.sourceTable.columns.getItems();s<a.length;s++){var u=a[s];o.columns.add(u)}o.setTotal(n.total);for(var l=0,c=n.table.getCachedRows();l<c.length;l++){var d=c[l];o.addRow(d)}return o}))}return this.applyInMemoryFilter()},e.prototype.applyInMemoryFilter=function(){var e=this;return new t((function(t,n){for(var r=new i.EasyDataTable({chunkSize:e.sourceTable.chunkSize,inMemory:!0}),o=0,s=e.sourceTable.columns.getItems();o<s.length;o++){var a=s[o];r.columns.add(a)}for(var u=e.filterValue.split("||").map((function(t){return t.trim().toLowerCase()})),l=e.sourceTable.columns.getItems().filter((function(t){return i.utils.isNumericType(t.type)||i.utils.getStringDataTypes().indexOf(t.type)>=0})),c=function(t){for(var e=0,n=l;e<n.length;e++){var i=n[e],r=t.getValue(i.id);if(r)for(var o=r.toString().toLowerCase(),s=0,a=u;s<a.length;s++){var c=a[s];if(o.indexOf(c)>=0)return!0}}return!1},d=0,h=e.sourceTable.getCachedRows();d<h.length;d++){var p=h[d];c(p)&&r.addRow(p)}r.setTotal(r.getCachedCount()),t(r)}))},e}()}).call(this,n(31))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return a}));var i=n(0),r=n(3),o=n(7),s=n(33),a=function(){function e(t){this.context=t,this.validators=[new s.a]}return e.prototype.getHtml=function(){return this.html},e.prototype.setHtmlInt=function(t){this.html=t,this.errorsDiv=this.html.querySelector(".errors-block")},e.prototype.validate=function(){this.clearErrors();for(var t=!0,e=0,n=Array.from(this.html.querySelectorAll("input, select"));e<n.length;e++){var i=n[e],o=this.context.getMetaData().getAttributeById(i.name);if("checkbox"!==i.type){var s=this.validateValue(o,i.value);if(!s.successed){t&&Object(r.domel)(this.errorsDiv).addChild("ul"),t=!1;for(var a=0,u=s.messages;a<u.length;a++){var l=u[a];this.errorsDiv.firstElementChild.innerHTML+="<li>"+o.caption+": "+l+"</li>"}}this.markInputValid(i,s.successed)}}return t},e.prototype.getData=function(){var e=this;return new t((function(n,i){for(var r=[],o=Array.from(e.html.querySelectorAll("input, select, textarea")),s={},a=function(t){var n=t.name.substring(t.name.lastIndexOf(".")+1),i=e.context.getMetaData().getAttributeById(t.name);"checkbox"===t.type?s[n]=t.checked:"file"===t.type?r.push(e.fileToBase64(t.files[0]).then((function(t){return s[n]=t}))):s[n]=e.mapValue(i.dataType,t.value)},u=0,l=o;u<l.length;u++){a(l[u])}t.all(r).then((function(){return n(s)})).catch((function(t){return i(t)}))}))},e.prototype.fileToBase64=function(e){return new t((function(t,n){var i=new FileReader;i.readAsDataURL(e),i.onload=function(){var e=i.result.toString();t(e.substring(e.indexOf(",")+1))},i.onerror=function(t){return n(t)}}))},e.prototype.useValidator=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.useValidators(t)},e.prototype.useValidators=function(t){this.validators=this.validators.concat(t)},e.prototype.mapValue=function(t,e){if(i.utils.getDateDataTypes().indexOf(t)>=0){if(t!==i.DataType.Time&&e&&e.length){var n=o.a(t),r=o.b(t),s=i.utils.strToDateTime(e,n);return i.utils.dateTimeToStr(s,r)}return e&&e.length?e:null}return i.utils.isIntType(t)?parseInt(e):i.utils.isNumericType(t)?parseFloat(e):e},e.prototype.clearErrors=function(){this.errorsDiv.innerHTML="",this.html.querySelectorAll("input, select").forEach((function(t){t.classList.remove("is-valid"),t.classList.remove("is-invalid")}))},e.prototype.markInputValid=function(t,e){t.classList.add(e?"is-valid":"is-invalid")},e.prototype.validateValue=function(t,e){for(var n={successed:!0,messages:[]},i=0,r=this.validators;i<r.length;i++){var o=r[i].validate(t,e);o.successed||(n.successed=!1,n.messages=n.messages.concat(o.messages))}return n},e}()}).call(this,n(31))},function(t,e,n){"use strict";(function(t){n.d(e,"b",(function(){return c})),n.d(e,"a",(function(){return d}));var i,r=n(4),o=n(32),s=n(11),a=n(16),u=(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},i(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(){return l=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},l.apply(this,arguments)},c=function(t){function e(e,n){var i=t.call(this,n)||this;return i.status=e,i}return u(e,t),e}(Error),d=function(){function e(){this.defaultHeaders={},this.customPayload=void 0}return Object.defineProperty(e.prototype,"responseBody",{get:function(){return this._responseBody},enumerable:!0,configurable:!0}),e.prototype.get=function(t,e){return this.send(s.a.Get,t,null,e)},e.prototype.post=function(t,e,n){return this.send(s.a.Post,t,e,n)},e.prototype.put=function(t,e,n){return this.send(s.a.Put,t,e,n)},e.prototype.delete=function(t,e,n){return this.send(s.a.Delete,t,e,n)},e.prototype.send=function(n,i,s,u){var d=this,h=(u=u||{}).dataType||"json",p=u.contentType||"form-data"!==h?"application/json":null;s&&"form-data"!=h&&this.customPayload&&(s.data=r.a.assignDeep(s.data||{},this.customPayload));var f=new("onload"in new XMLHttpRequest?XMLHttpRequest:window.XDomainRequest),g={method:n,url:i,headers:l(l({},this.defaultHeaders),u.headers||{}),queryParams:u.queryParams||{},data:s};p&&(g.headers["Content-Type"]=p);var m=new a.a(f,g);this.beforeEachRequest&&(console.warn("HttpClient: 'beforeEachRequest' is deprecated and will be removed in future updates.\n Use 'onRequest' instead"),this.beforeEachRequest(m)),this.onRequest&&this.onRequest(m);var y=m.data&&"string"!=typeof m.data&&"json"==h?JSON.stringify(m.data):m.data;return m.open(),new o.a(m,new t((function(n,r){u.responseType&&(f.responseType=u.responseType),f.onerror=function(t){r(new c(f.status,f.responseText))},f.onreadystatechange=function(){if(4==f.readyState){var o=f.getResponseHeader("Content-Type")||"",s=f.status;if(0===s)r(new c(s,"Network error or the request was aborted"));else if(s>=200&&s<400){var a="arraybuffer"===f.responseType||"blob"===f.responseType?f.response:0==o.indexOf("application/json")?JSON.parse(f.responseText):f.responseText;d._responseBody=a,d.onResponse&&d.onResponse(f),n(a)}else{("arraybuffer"===f.responseType||"blob"===f.responseType?e.decodeArrayBuffer(f.response):t.resolve(f.responseText)).then((function(t){var e=0==o.indexOf("application/json")?JSON.parse(t):t;d._responseBody=e;var n=e.message||(404==s?"No such endpoint: "+i:e);r(new c(s,n))}))}}},f.send(y)})))},e.decodeArrayBuffer=function(e){var n=new FileReader;return new t((function(t){n.onloadend=function(){n.readyState==FileReader.DONE&&t(n.result)},n.readAsText(new Blob([e]))}))},e}()}).call(this,n(25))},function(t,e,n){(function(e,n){var i;i=function(){"use strict";function t(t){return"function"==typeof t}var i=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},r=0,o=void 0,s=void 0,a=function(t,e){f[r]=t,f[r+1]=e,2===(r+=2)&&(s?s(g):w())},u="undefined"!=typeof window?window:void 0,l=u||{},c=l.MutationObserver||l.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var t=setTimeout;return function(){return t(g,1)}}var f=new Array(1e3);function g(){for(var t=0;t<r;t+=2)(0,f[t])(f[t+1]),f[t]=void 0,f[t+1]=void 0;r=0}var m,y,v,b,w=void 0;function C(t,e){var n=this,i=new this.constructor(E);void 0===i[T]&&j(i);var r=n._state;if(r){var o=arguments[r-1];a((function(){return L(r,i,o,n._result)}))}else R(n,i,t,e);return i}function D(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(E);return M(e,t),e}d?w=function(){return e.nextTick(g)}:c?(y=0,v=new c(g),b=document.createTextNode(""),v.observe(b,{characterData:!0}),w=function(){b.data=y=++y%2}):h?((m=new MessageChannel).port1.onmessage=g,w=function(){return m.port2.postMessage(0)}):w=void 0===u?function(){try{var t=Function("return this")().require("vertx");return void 0!==(o=t.runOnLoop||t.runOnContext)?function(){o(g)}:p()}catch(t){return p()}}():p();var T=Math.random().toString(36).substring(2);function E(){}var x=void 0,I=1,S=2;function O(e,n,i){n.constructor===e.constructor&&i===C&&n.constructor.resolve===D?function(t,e){e._state===I?P(t,e._result):e._state===S?A(t,e._result):R(e,void 0,(function(e){return M(t,e)}),(function(e){return A(t,e)}))}(e,n):void 0===i?P(e,n):t(i)?function(t,e,n){a((function(t){var i=!1,r=function(t,e,n,i){try{t.call(e,n,i)}catch(t){return t}}(n,e,(function(n){i||(i=!0,e!==n?M(t,n):P(t,n))}),(function(e){i||(i=!0,A(t,e))}),t._label);!i&&r&&(i=!0,A(t,r))}),t)}(e,n,i):P(e,n)}function M(t,e){if(t===e)A(t,new TypeError("You cannot resolve a promise with itself"));else if(r=typeof(i=e),null===i||"object"!==r&&"function"!==r)P(t,e);else{var n=void 0;try{n=e.then}catch(e){return void A(t,e)}O(t,e,n)}var i,r}function _(t){t._onerror&&t._onerror(t._result),k(t)}function P(t,e){t._state===x&&(t._result=e,t._state=I,0!==t._subscribers.length&&a(k,t))}function A(t,e){t._state===x&&(t._state=S,t._result=e,a(_,t))}function R(t,e,n,i){var r=t._subscribers,o=r.length;t._onerror=null,r[o]=e,r[o+I]=n,r[o+S]=i,0===o&&t._state&&a(k,t)}function k(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var i=void 0,r=void 0,o=t._result,s=0;s<e.length;s+=3)i=e[s],r=e[s+n],i?L(n,i,r,o):r(o);t._subscribers.length=0}}function L(e,n,i,r){var o=t(i),s=void 0,a=void 0,u=!0;if(o){try{s=i(r)}catch(t){u=!1,a=t}if(n===s)return void A(n,new TypeError("A promises callback cannot return that same promise."))}else s=r;n._state!==x||(o&&u?M(n,s):!1===u?A(n,a):e===I?P(n,s):e===S&&A(n,s))}var N=0;function j(t){t[T]=N++,t._state=void 0,t._result=void 0,t._subscribers=[]}var F=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(E),this.promise[T]||j(this.promise),i(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?P(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&P(this.promise,this._result))):A(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===x&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,i=n.resolve;if(i===D){var r=void 0,o=void 0,s=!1;try{r=t.then}catch(t){s=!0,o=t}if(r===C&&t._state!==x)this._settledAt(t._state,e,t._result);else if("function"!=typeof r)this._remaining--,this._result[e]=t;else if(n===B){var a=new n(E);s?A(a,o):O(a,t,r),this._willSettleAt(a,e)}else this._willSettleAt(new n((function(e){return e(t)})),e)}else this._willSettleAt(i(t),e)},t.prototype._settledAt=function(t,e,n){var i=this.promise;i._state===x&&(this._remaining--,t===S?A(i,n):this._result[e]=n),0===this._remaining&&P(i,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;R(t,void 0,(function(t){return n._settledAt(I,e,t)}),(function(t){return n._settledAt(S,e,t)}))},t}(),B=function(){function e(t){this[T]=N++,this._result=this._state=void 0,this._subscribers=[],E!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(t,e){try{e((function(e){M(t,e)}),(function(e){A(t,e)}))}catch(e){A(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var n=this,i=n.constructor;return t(e)?n.then((function(t){return i.resolve(e()).then((function(){return t}))}),(function(t){return i.resolve(e()).then((function(){throw t}))})):n.then(e,e)},e}();return B.prototype.then=C,B.all=function(t){return new F(this,t).promise},B.race=function(t){var e=this;return i(t)?new e((function(n,i){for(var r=t.length,o=0;o<r;o++)e.resolve(t[o]).then(n,i)})):new e((function(t,e){return e(new TypeError("You must pass an array to race."))}))},B.resolve=D,B.reject=function(t){var e=new this(E);return A(e,t),e},B._setScheduler=function(t){s=t},B._setAsap=function(t){a=t},B._asap=a,B.polyfill=function(){var t=void 0;if(void 0!==n)t=n;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var i=null;try{i=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===i&&!e.cast)return}t.Promise=B},B.Promise=B,B},t.exports=i()}).call(this,n(26),n(27))},function(t,e){var n,i,r=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var u,l=[],c=!1,d=-1;function h(){c&&u&&(c=!1,u.length?l=u.concat(l):d=-1,l.length&&p())}function p(){if(!c){var t=a(h);c=!0;for(var e=l.length;e;){for(u=l,l=[];++d<e;)u&&u[d].run();d=-1,e=l.length}u=null,c=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{return i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function g(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new f(t,e)),1!==l.length||c||a(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=g,r.addListener=g,r.once=g,r.off=g,r.removeListener=g,r.removeAllListeners=g,r.emit=g,r.prependListener=g,r.prependOnceListener=g,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return a}));var i=n(17),r=n(15),o=n(2),s=n(4),a=function(){function e(t){if(this._chunkSize=1e3,this._elasticChunks=!1,this.cachedRows=[],this.total=0,this.loader=null,this.needTotal=!0,this.isInMemory=!1,t=t||{},this._chunkSize=t.chunkSize||this._chunkSize,this._elasticChunks=t.elasticChunks||this._elasticChunks,this.loader=t.loader,void 0!==t.inMemory&&(this.isInMemory=t.inMemory),this.isInMemory&&(this.needTotal=!1),this._columns=new i.c,this.onUpdate=t.onUpdate,t.columns)for(var e=0,n=t.columns;e<n.length;e++){var r=n[e];this._columns.add(r)}if(t.rows)for(var o=0,s=t.rows;o<s.length;o++){var a=s[o],u=this.createRow(a);this.addRow(u)}this.needTotal=!this._elasticChunks}return Object.defineProperty(e.prototype,"columns",{get:function(){return this._columns},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"chunkSize",{get:function(){return this._chunkSize},set:function(t){this._chunkSize=t,this.total=0,this.needTotal=!this.elasticChunks,this.cachedRows=[]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"elasticChunks",{get:function(){return this._elasticChunks},set:function(t){this._elasticChunks=t,this.total=0,this.needTotal=!this.elasticChunks,this.cachedRows=[]},enumerable:!0,configurable:!0}),e.prototype.getRows=function(e){var n=this,i=0,r=this._chunkSize;e&&("page"in e?(i=e.pageSize*(e.page-1),r=e.pageSize):(i=e.offset,r=e.limit));var o=i+r;if(!this.needTotal&&!this.elasticChunks){if(i>=this.total)return t.resolve([]);o>this.total&&(o=this.total)}if(this.isInMemory&&o>this.cachedRows.length&&(o=this.cachedRows.length),o<=this.cachedRows.length)return t.resolve(this.cachedRows.slice(i,o));if(!this.loader)throw"Loader is not defined. Can't get the rows from "+i+" to "+o;var s=this.needTotal;this.needTotal&&(this.needTotal=!1);var a=this.cachedRows.length,u=o-a;return u<this._chunkSize&&(u=this._chunkSize),this.loader.loadChunk({offset:a,limit:u,needTotal:s}).then((function(t){(s&&(n.total=t.total),Array.prototype.push.apply(n.cachedRows,t.table.getCachedRows()),o>n.cachedRows.length&&(o=n.cachedRows.length),n.elasticChunks)&&(t.table.getCachedCount()<u&&(n.total=n.cachedRows.length));return n.fireUpdated(),n.cachedRows.slice(i,o)}))},e.prototype.getRow=function(t){return this.getRows({offset:t,limit:1}).then((function(t){return t.length>0?t[0]:null}))},e.prototype.getTotal=function(){return this.total},e.prototype.setTotal=function(t){this.total=t,this.needTotal=!1},e.prototype.getCachedCount=function(){return this.cachedRows.length},e.prototype.clear=function(){this.columns.clear(),this.cachedRows=[],this.total=0,this.needTotal=!this._elasticChunks,this.fireUpdated()},e.prototype.createRow=function(t){var e=this,n=this._columns.getDateColumnIndexes(),i=new Array(this._columns.count),o=t instanceof r.a?function(e){return t.getValue(e)}:function(e){return t[e]};return t&&this.columns.getItems().forEach((function(t){var r=o(t.id),s=e.columns.getIndex(t.id);i[s]=n.indexOf(s)>=0?e.mapDate(r,t.type):r})),new r.a(this._columns,i)},e.prototype.mapDate=function(t,e){if(t){var n=new Date(t);return isNaN(n.getTime())&&e==o.a.Time&&(n=s.a.strToTime(t)),n}return null},e.prototype.addRow=function(t){var e;if(Array.isArray(t)){var n=t,i=this._columns.getDateColumnIndexes();if(i.length>0)for(var o=0,s=i;o<s.length;o++){var a=s[o];n[a]&&(n[a]=this.mapDate(n[a],this._columns.get(a).type))}e=new r.a(this._columns,n)}else e=this.createRow(t);this.cachedRows.push(e);var u=this.getCachedCount();return u>this.total&&(this.total=u),e},e.prototype.getCachedRows=function(){return this.cachedRows},e.prototype.totalIsKnown=function(){return this.elasticChunks?this.getCachedCount()===this.total:!this.needTotal},e.prototype.fireUpdated=function(){this.onUpdate&&this.onUpdate(this)},e}()}).call(this,n(25))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return h}));var i=n(0),r=n(12),o=n(1),s=n(6),a=n(10),u=n(8),l=n(13),c=function(){return c=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},c.apply(this,arguments)},d=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var i=Array(t),r=0;for(e=0;e<n;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,r++)i[r]=o[s];return i},h=function(){function e(t){if(this.cssPrefix="keg",this.pagination={page:1,pageSize:30,total:0},this.paginationOptions={maxButtonCount:10,useBootstrap:!1},this.defaultDataGridOptions={slot:null,dataTable:null,fixHeightOnFirstRender:!1,syncGridColumns:!0,useRowNumeration:!0,allowDragDrop:!1,aggregates:{settings:null,calculator:null},paging:{enabled:!0,pageSize:30,pageSizeItems:[20,30,50,100,200]},columnWidths:{autoResize:a.a.Always,stringColumns:{min:100,max:500,default:250},numberColumns:{min:60,default:120},boolColumns:{min:50,default:80},dateColumns:{min:80,default:200},otherColumns:{min:100,max:500,default:250},rowNumColumn:{min:40,default:60}},showPlusButton:!1,viewportRowsCount:null,showActiveRow:!0},this.rowsOnPagePromise=null,this.containerInitialHeight=0,this.firstRender=!0,this.prevRowTotals=null,this.landingIndex=-1,this.landingSlot=Object(o.e)("div").addClass(this.cssPrefix+"-col-landing-slot").addChildElement(Object(o.e)("div").toDOM()).toDOM(),this._activeRowIndex=-1,t&&t.paging&&(t.paging=i.utils.assign(this.defaultDataGridOptions.paging,t.paging)),this.options=this.mergeOptions(t),this.processColumnWidthsOptions(),!this.options.slot)throw Error('"slot" parameter is required to initialize EasyDataGrid');if(!this.options.dataTable)throw Error('"dataTable" parameter is required to initialize EasyDataGrid');this.dataTable=t.dataTable,this.eventEmitter=new i.EventEmitter(this),this.cellRendererStore=new l.c(t),this.columns=new u.c(this.dataTable.columns,this),this.setSlot(this.options.slot),this.init(this.options)}return e.prototype.mergeOptions=function(t){var e=i.utils.assignDeep({},this.defaultDataGridOptions.columnWidths,t.columnWidths),n=i.utils.assignDeep({},this.defaultDataGridOptions.paging,t.paging),r=i.utils.assign({},this.defaultDataGridOptions,t);return r.columnWidths=e,r.paging=n,r},e.prototype.processColumnWidthsOptions=function(){var t=this.options.columnWidths;if(t){i.utils.getStringDataTypes().forEach((function(e){t[e]=c(c({},t.stringColumns),t[e])})),i.utils.getNumericDataTypes().forEach((function(e){t[e]=c(c({},t.numberColumns),t[e])})),t[i.DataType.Bool]=c(c({},t.boolColumns),t[i.DataType.Bool]),i.utils.getDateDataTypes().forEach((function(e){t[e]=c(c({},t.dateColumns),t[e])}));var e=d(i.utils.getStringDataTypes(),i.utils.getNumericDataTypes(),i.utils.getDateDataTypes(),[i.DataType.Bool]);i.utils.getAllDataTypes().forEach((function(n){n in e||(t[n]=c(c({},t.otherColumns),t[n]))})),t[i.DataType.Unknown]=t.otherColumns}},e.prototype.setSlot=function(t){if("string"==typeof t){if(t.length)if("#"===t[0])this.slot=document.getElementById(t.substring(1));else{if("."!==t[0])throw Error("Unrecognized slot parameter (Must be id, class or HTMLElement): "+t);var e=document.getElementsByClassName(t.substring(1));e.length&&(this.slot=e[0])}}else this.slot=t},e.prototype.init=function(t){var e=this;t.onInit&&this.addEventListener("init",t.onInit),t.onRowClick&&this.addEventListener("rowClick",t.onRowClick),t.onRowDbClick&&this.addEventListener("rowDbClick",t.onRowDbClick),t.onPlusButtonClick&&this.addEventListener("plusButtonClick",t.onPlusButtonClick),t.onColumnChanged&&this.addEventListener("columnChanged",t.onColumnChanged),t.onColumnDeleted&&this.addEventListener("columnDeleted",t.onColumnDeleted),t.onColumnMoved&&this.addEventListener("columnMoved",t.onColumnMoved),t.onPageChanged&&this.addEventListener("pageChanged",t.onPageChanged),t.onActiveRowChanged&&this.addEventListener("activeRowChanged",t.onActiveRowChanged),this.addEventListener("pageChanged",(function(t){return e.activeRowIndex=-1})),i.utils.assignDeep(this.paginationOptions,t.pagination),this.pagination.pageSize=this.options.paging.pageSize||this.pagination.pageSize,this.options.allowDragDrop&&r.d.registerDropContainer({element:this.slot,scopes:["gridColumnMove"],onDragEnter:function(t,n){e.slot.classList.add(s.e+"-drophover"),e.showLandingSlot(n.pageX,n.pageY)},onDragOver:function(t,n){e.showLandingSlot(n.pageX,n.pageY)},onDragLeave:function(t,n){n.dropEffect=r.b.Forbid,e.slot.classList.remove(s.e+"-drophover"),e.hideLandingSlot()},onDrop:function(t,n){e.dataTable.columns.move(n.data.column,e.landingIndex),e.refresh(),e.fireEvent({type:"columnMoved",columnId:n.data.column.id,newIndex:e.landingIndex})}}),this.refresh(),this.fireEvent("init")},e.prototype.fireEvent=function(t){"string"==typeof t?this.eventEmitter.fire(t):this.eventEmitter.fire(t.type,t)},e.prototype.setData=function(t){this.dataTable=t,this.clear(),this.refresh()},e.prototype.getData=function(){return this.dataTable},e.prototype.getColumns=function(){return this.columns},e.prototype.destroy=function(){this.slot.innerHTML=""},e.prototype.refresh=function(){this.clearDOM(),this.render()},e.prototype.clearDOM=function(){this.slot.innerHTML=""},e.prototype.clear=function(){this.pagination.page=1,this.clearDOM()},e.prototype.render=function(){var t=this;if(this.hasData()||this.options.showPlusButton){this.containerInitialHeight=this.slot.clientHeight,this.rootDiv=document.createElement("div"),this.rootDiv.style.width="100%",this.rootDiv.classList.add(this.cssPrefix+"-root"),this.columns.sync(this.dataTable.columns,this.options.useRowNumeration),this.renderHeader(),this.rootDiv.appendChild(this.headerDiv),this.renderBody(),this.rootDiv.appendChild(this.bodyDiv),this.renderFooter(),this.rootDiv.appendChild(this.footerDiv);var e=document.createElement("div");e.classList.add(this.cssPrefix+"-container"),e.appendChild(this.rootDiv),this.slot.appendChild(e);var n=this.options.columnWidths.autoResize!==a.a.Never;this.rowsOnPagePromise?this.rowsOnPagePromise.then((function(){return t.updateHeight()})).then((function(){t.firstRender=!1,t.rowsOnPagePromise=null})):setTimeout((function(){t.updateHeight().then((function(){t.firstRender=!1,n&&t.resizeColumns()}))}),100)}},e.prototype.updateHeight=function(){var e=this;return new t((function(t){if(e.options.viewportRowsCount){var n=e.bodyCellContainerDiv.firstElementChild,i=(n?n.offsetHeight:36)*e.options.viewportRowsCount;return Object(o.e)(e.bodyViewportDiv).setStyle("height",i+"px"),void setTimeout((function(){var n=e.bodyViewportDiv.offsetHeight-e.bodyViewportDiv.clientHeight;i+=n,Object(o.e)(e.bodyViewportDiv).setStyle("height",i+"px"),t()}),100)}e.containerInitialHeight,t()})).then((function(){e.options.fixHeightOnFirstRender&&e.firstRender&&(e.slot.style.height=e.slot.offsetHeight+"px")}))},e.prototype.getContainerWidth=function(){return this.columns.getItems().filter((function(t){return t.isVisible})).map((function(t){return t.width})).reduce((function(t,e){return t+e}))},e.prototype.renderHeader=function(){var t=this;this.headerDiv=Object(o.e)("div").addClass(this.cssPrefix+"-header").toDOM(),this.headerViewportDiv=Object(o.e)("div",this.headerDiv).addClass(this.cssPrefix+"-header-viewport").toDOM(),this.headerCellContainerDiv=Object(o.e)("div",this.headerViewportDiv).addClass(this.cssPrefix+"-header-cell-container").toDOM(),this.headerRowDiv=Object(o.e)("div",this.headerCellContainerDiv).addClass(this.cssPrefix+"-header-row").toDOM(),this.columns.getItems().forEach((function(e,n){if(e.isVisible){var i=t.renderColumnHeader(e,n);t.headerRowDiv.appendChild(i),e.isRowNum&&Object(o.e)(i).addChildElement(t.renderHeaderButtons())}}));var e=this.getContainerWidth();Object(o.e)(this.headerCellContainerDiv).setStyle("width",e+"px")},e.prototype.hasData=function(){return this.dataTable.columns.count>0},e.prototype.renderColumnHeader=function(t,e){var n=this,i=Object(o.e)("div").addClass(this.cssPrefix+"-header-cell").data("col-idx",""+e).setStyle("width",t.width+"px");t.dataColumn&&i.data("col-id",""+t.dataColumn.id);var s=i.toDOM();return Object(o.e)("div",s).addClass(this.cssPrefix+"-header-cell-resize"),t.isRowNum||Object(o.e)("div",s).addClass(this.cssPrefix+"-header-cell-label").text(t.label),t.description&&Object(o.e)("div",s).addClass("question-mark").title(t.description),this.options.allowDragDrop&&r.d.registerDraggableItem({element:s,scope:"gridColumnMove",data:{column:t},renderer:function(e){e.innerHTML="";var i=document.createElement("div");i.innerText=t.label,e.classList.add(n.cssPrefix+"-sortable-helper"),e.appendChild(i)},onDragStart:function(t){t.dropEffect=r.b.Allow}}),s},e.prototype.renderBody=function(){var t=this;this.bodyDiv=Object(o.e)("div").addClass(this.cssPrefix+"-body").toDOM(),this.bodyViewportDiv=Object(o.e)("div",this.bodyDiv).addClass(this.cssPrefix+"-body-viewport").attr("tabIndex","0").toDOM(),this.bodyCellContainerDiv=Object(o.e)("div",this.bodyViewportDiv).addClass(this.cssPrefix+"-cell-container").toDOM();var e=this.canShowAggregates();this.dataTable&&(this.showProgress(),this.rowsOnPagePromise=this.getRowsToRender().then((function(n){t.pagination.total=t.dataTable.getTotal(),t.hideProgress(),t.bodyCellContainerDiv.innerHTML="",t.prevRowTotals=null;var r=0;if(n.length){var s=e?t.options.aggregates.settings.getGroups():[];r=n.length<t.pagination.pageSize?n.length:t.pagination.pageSize,n.forEach((function(n,i){if(e&&t.updateTotalsState(s,n),i<r){var o=t.renderRow(n,i);t.bodyCellContainerDiv.appendChild(o)}}));var u=t.options.aggregates&&t.options.aggregates.showGrandTotalsOnEachPage;if(e&&(t.isLastPage()||u)){var l=new i.DataRow(t.dataTable.columns,new Array(t.dataTable.columns.count));t.updateTotalsState(s,l,!0)}}if(t.options.columnWidths.autoResize!==a.a.Never)t.resizeColumns();else{var c=t.getContainerWidth();Object(o.e)(t.bodyCellContainerDiv).setStyle("width",c+"px")}return r})).catch((function(t){return console.error(t),0}))),this.bodyViewportDiv.addEventListener("scroll",(function(e){Object(o.e)(t.headerViewportDiv).setStyle("margin-left","-"+t.bodyViewportDiv.scrollLeft+"px")})),this.bodyViewportDiv.addEventListener("keydown",this.onViewportKeydown.bind(this))},e.prototype.isLastPage=function(){return this.dataTable.elasticChunks?this.dataTable.totalIsKnown()&&this.pagination.page*this.pagination.pageSize>=this.pagination.total:this.pagination.page*this.pagination.pageSize>=this.pagination.total},e.prototype.canShowAggregates=function(){if(!this.options||!this.options.aggregates||!this.options.aggregates.settings)return!1;var t=this.options.aggregates.settings;return(t.hasAggregates()||t.hasRecordCount())&&(t.hasGroups()||t.hasGrandTotals())},e.prototype.updateTotalsState=function(t,e,n){void 0===n&&(n=!1);var r=this.options.aggregates.settings;if(this.prevRowTotals&&r.hasGroups()){for(var o=-1,s=1;s<=t.length;s++){for(var a=0,u=t[s-1].columns;a<u.length;a++){var l=u[a];if(!r.compareValues(this.prevRowTotals.getValue(l),e.getValue(l))){o=s;break}}if(-1!==o)break}if(-1!==o)for(s=t.length;s>=o;s--){var c=new i.DataRow(this.dataTable.columns,this.prevRowTotals.toArray()),d=this.renderTotalsRow(s,c);this.bodyCellContainerDiv.appendChild(d)}}if(n&&r.hasGrandTotals()&&r.hasAggregates()){d=this.renderTotalsRow(0,e);this.bodyCellContainerDiv.appendChild(d)}this.prevRowTotals=e},e.prototype.applyGroupColumnTemplate=function(t,e,n){var i=t.replace(/{{\s*GroupValue\s*}}/g,e?""+e:"-");return i=i.replace(/{{\s*GroupCount\s*}}/g,n?""+n:"-")},e.prototype.renderTotalsRow=function(t,e){var n=this,i=this.options.aggregates.settings,r=t>0?i.getGroups()[t-1]:{columns:[],aggregates:i.getAggregates()},s=Object(o.e)("div").addClass(this.cssPrefix+"-row").addClass(this.cssPrefix+"-row-totals").addClass(this.cssPrefix+"-totals-lv"+t).data("totals-level",""+t).attr("tabindex","-1").toDOM();this.columns.getItems().forEach((function(t,i){if(t.isVisible){var o="",a=t.isRowNum?-1:n.dataTable.columns.getIndex(t.dataColumn.id);!t.isRowNum&&t.dataColumn&&r.columns.indexOf(t.dataColumn.id)>=0&&(o=e.getValue(a)),a==n.dataTable.columns.count-1&&(o=". . . . . ."),s.appendChild(n.renderCell(t,i,o,s))}}));var a=this.options.aggregates.calculator.getAggrContainer(),u=i.getAggregates().map((function(t){return t.colId})),l=i.buildGroupKey(r,e);return a.getAggregateData(t,l).then((function(o){for(var a=0,l=u;a<l.length;a++){var c=l[a];e.setValue(c,o[c])}s.innerHTML="",n.columns.getItems().forEach((function(a,l){if(a.isVisible){var c="",d=a.isRowNum?-1:n.dataTable.columns.getIndex(a.dataColumn.id);if(!a.isRowNum){var h=!1;if(a.dataColumn){var p=r.columns.indexOf(a.dataColumn.id),f=u.indexOf(a.dataColumn.id);h=t>0?p==r.columns.length-1:0==d,(p>=0||f>=0)&&(c=e.getValue(d))}var g="";if(t>0&&!(g=a.dataColumn.groupFooterColumnTemplate)&&i.hasRecordCount()&&h&&(g="{{GroupValue}} ({{GroupCount}})"),g)c=n.renderCell(a,l,c,s).firstChild.innerHTML,c=n.applyGroupColumnTemplate(g,c,o[i.COUNT_FIELD_NAME])}var m=n.renderCell(a,l,c,s);s.appendChild(m)}}))})).catch((function(t){return console.error(t)})),s},e.prototype.onViewportKeydown=function(t){if(this.options.showActiveRow){var e=this.bodyCellContainerDiv.querySelectorAll("."+this.cssPrefix+"-row").length,n=void 0;switch(t.key){case"ArrowLeft":case"ArrowRight":break;case"ArrowUp":t.preventDefault(),n=this.activeRowIndex<0||this.activeRowIndex>=e?e-1:this.activeRowIndex-1,this.activeRowIndex=n>=0?n:0;break;case"ArrowDown":t.preventDefault(),n=this.activeRowIndex<0||this.activeRowIndex>=e?0:this.activeRowIndex+1,this.activeRowIndex=n<e?n:e-1}}},e.prototype.ensureRowVisibility=function(t){var e="number"==typeof t?this.getDataRow(t):t;if(e){var n=e.getBoundingClientRect(),i=this.bodyViewportDiv.getBoundingClientRect(),r=n.top-i.top,o=n.bottom-i.top,s=this.bodyViewportDiv.clientHeight,a=window.innerHeight||document.documentElement.clientHeight;if(r>0&&o<=s&&n.top>0&&n.bottom<a)return;r<0?this.bodyViewportDiv.scrollTop=this.bodyViewportDiv.scrollTop+r:o>s&&(this.bodyViewportDiv.scrollTop=this.bodyViewportDiv.scrollTop+o-s),(n=e.getBoundingClientRect()).top<0?document.documentElement.scrollTop=document.documentElement.scrollTop+n.top:n.bottom>a&&(document.documentElement.scrollTop=document.documentElement.scrollTop+n.bottom-a)}},e.prototype.getRowsToRender=function(){return!1===this.options.paging.enabled?t.resolve(this.dataTable.getCachedRows()):this.dataTable.getRows({offset:(this.pagination.page-1)*this.pagination.pageSize,limit:this.pagination.pageSize+1}).catch((function(t){return console.error(t),[]}))},e.prototype.renderFooter=function(){var t=this;this.footerDiv=Object(o.e)("div").addClass(this.cssPrefix+"-footer").toDOM(),this.rowsOnPagePromise&&this.rowsOnPagePromise.then((function(e){t.footerDiv.innerHTML="",t.footerPaginateDiv=t.renderPageNavigator(),t.footerDiv.appendChild(t.footerPaginateDiv);var n=t.renderPageInfoBlock(e);t.footerDiv.appendChild(n)}))},e.prototype.renderPageInfoBlock=function(t){var e=Object(o.e)("div").addClass(this.cssPrefix+"-page-info").toDOM();if(this.dataTable.getTotal()>0){var n=t?(this.pagination.page-1)*this.pagination.pageSize+1:0,r=t?n+t-1:0,s=this.dataTable.getTotal().toString();if(this.dataTable.elasticChunks)this.dataTable.getCachedCount()!==this.dataTable.getTotal()&&(s="?");e.innerHTML=i.i18n.getText("GridPageInfo").replace("{FirstPageRecordNum}","<span>"+n.toString()+"</span>").replace("{LastPageRecordNum}","<span>"+r.toString()+"</span>").replace("{Total}","<span>"+s+"</span>")}return e},e.prototype.showProgress=function(){},e.prototype.hideProgress=function(){},e.prototype.getLocalIndexByGlobal=function(t){return this.pagination?t%this.pagination.pageSize:t},e.prototype.getGlobalIndexByLocal=function(t){return this.pagination?(this.pagination.page-1)*this.pagination.pageSize+t:t},e.prototype.renderRow=function(t,e){var n=this,i=this.getGlobalIndexByLocal(e),r=Object(o.e)("div").addClass(this.cssPrefix+"-row").addClass(this.cssPrefix+"-row-"+(e%2==1?"odd":"even")).data("row-idx",""+i).attr("tabindex","-1").on("click",(function(i){n.activeRowIndex=e,n.fireEvent({type:"rowClick",row:t,rowIndex:e,sourceEvent:i})})).on("dblclick",(function(i){n.fireEvent({type:"rowDbClick",row:t,rowIndex:e,sourceEvent:i})}));0==e&&r.addClass(this.cssPrefix+"-row-first");var s=r.toDOM();return this.options.showActiveRow&&e==this.activeRowIndex&&r.addClass(this.cssPrefix+"-row-active"),this.columns.getItems().forEach((function(e,r){if(e.isVisible){var o=e.isRowNum?-1:n.dataTable.columns.getIndex(e.dataColumn.id),a=e.isRowNum?i+1:t.getValue(o);s.appendChild(n.renderCell(e,r,a,s))}})),s},e.prototype.renderCell=function(t,e,n,i){var r=Object(o.e)("div").addClass(this.cssPrefix+"-cell").data("col-idx",""+e).attr("tabindex","-1").setStyle("width",t.width+"px");t.align==u.b.LEFT?r.addClass(this.cssPrefix+"-cell-align-left"):t.align==u.b.RIGHT?r.addClass(this.cssPrefix+"-cell-align-right"):t.align==u.b.CENTER&&r.addClass(this.cssPrefix+"-cell-align-center");var s=r.toDOM(),a=s.appendChild(Object(o.e)("div").addClass(this.cssPrefix+"-cell-value").toDOM());return t.cellRenderer&&t.cellRenderer(n,t,a,i),s},e.prototype.setPage=function(t){this.pagination.page=t,this.fireEvent({type:"pageChanged",page:t}),this.refresh(),this.bodyViewportDiv.focus()},e.prototype.renderPageNavigator=function(){var t=this,e=document.createElement("div");e.className=this.cssPrefix+"-pagination-wrapper";var n=this.dataTable.getTotal();if(this.options.paging&&this.options.paging.enabled&&n>0){var r=this.paginationOptions.useBootstrap?"":this.cssPrefix+"-",o=function(e){var n=e.target;if(n.hasAttribute("data-page")){var i=parseInt(n.getAttribute("data-page"));t.setPage(i)}},s=function(e,n,i,s,a){var u=document.createElement("li");if(u.className=r+"page-item",!s){a&&(u.className+=" active");var l=document.createElement("a");return l.setAttribute("href","javascript:void(0)"),l.innerHTML=n||e.toString(),l.setAttribute("data-page",""+e),l.className=r+"page-link",l.addEventListener("click",o),u.appendChild(l),u}var c=document.createElement("span");if(c.setAttribute("aria-hidden","true"),c.className=r+"page-link",i)u.className+=" disabled";else{if(t.paginationOptions.useBootstrap)(c=document.createElement("a")).setAttribute("href","javascript:void(0)"),c.setAttribute("data-page",""+e);else{var d=document.createElement("a");d.setAttribute("href","javascript:void(0)"),d.setAttribute("data-page",""+e),c=d}c.className=r+"page-link",c.addEventListener("click",o)}return c.innerHTML=n,u.appendChild(c),u};if(this.dataTable.elasticChunks){var a=this.pagination.page||1;(l=document.createElement("ul")).className=r+"pagination";var u=s(a-1,"&laquo;",1==a,!0,!1);l.appendChild(u),u=s(a+1,"&raquo;",this.isLastPage(),!0,!1),l.appendChild(u),e.appendChild(l)}else if(this.pagination.total>this.pagination.pageSize){a=this.pagination.page||1;var l,c=Math.ceil(this.pagination.total/this.pagination.pageSize)||1,d=this.paginationOptions.maxButtonCount||10,h=a-1,p=h-h%d+1,f=p+d-1;f>c&&(f=c),(l=document.createElement("ul")).className=r+"pagination";u=s(p-1,"&laquo;",1==p,!0,!1);l.appendChild(u);for(var g=p;g<=f;g++)u=s(g,g.toString(),!1,!1,g==a),l.appendChild(u);u=s(f+1,"&raquo;",f==c,!0,!1),l.appendChild(u),e.appendChild(l)}if(this.options.paging.allowPageSizeChange){var m=document.createElement("div");m.className=this.cssPrefix+"-page-sizes";var y=document.createElement("div");y.className="kfrm-select "+this.cssPrefix+"-page-sizes-select",m.appendChild(y);var v=document.createElement("select"),b=this.options.paging.pageSizeItems||[],w=new Set(b);w.add(this.options.paging.pageSize||20),Array.from(w).forEach((function(t){var e=document.createElement("option");e.value=t.toString(),e.text=t.toString(),v.appendChild(e)})),v.value=(this.pagination.pageSize||20).toString(),y.appendChild(v),v.addEventListener("change",(function(e){var n=parseInt(e.target.value);t.pagination.pageSize=n,t.pagination.page=1,t.refresh()}));var C=document.createElement("div");C.className=this.cssPrefix+"-page-sizes-label",m.appendChild(C);var D=document.createElement("span");D.innerText=i.i18n.getText("GridItemsPerPage"),C.appendChild(D),e.appendChild(m)}}return e},e.prototype.addEventListener=function(t,e){return this.eventEmitter.subscribe(t,(function(t){return e(t.data)}))},e.prototype.removeEventListener=function(t,e){this.eventEmitter.unsubscribe(t,e)},e.prototype.renderHeaderButtons=function(){var t=this;return this.options.showPlusButton?Object(o.e)("div").addClass(this.cssPrefix+"-header-btn-plus").title(this.options.plusButtonTitle||"Add").addChild("a",(function(e){return e.attr("href","javascript:void(0)").on("click",(function(e){e.preventDefault(),t.fireEvent({type:"plusButtonClick",sourceEvent:e})}))})).toDOM():Object(o.e)("span").addText("#").toDOM()},e.prototype.showLandingSlot=function(t,e){for(var n=this.headerRowDiv.querySelectorAll("[class*="+this.cssPrefix+"-table-col]"),i=[],r=1;r<n.length;r++){var o=n[r];"none"!==o.style.display&&i.push(o)}if(0===i.length)return this.landingIndex=0,void this.headerRowDiv.appendChild(this.landingSlot);var a=Object(s.g)(this.landingSlot);if(!(t>=a.x&&t<=a.x+this.landingSlot.offsetWidth)){for(var u=this.landingIndex,l=0,c=i;l<c.length;l++){var d=c[l],h=Object(s.g)(d),p=d.offsetWidth;t>h.x&&t<h.x+p&&(u=parseInt(d.getAttribute("data-col-idx"))-1)}u!=this.landingIndex&&(this.landingIndex=u,this.landingIndex<i.length?this.headerRowDiv.insertBefore(this.landingSlot,i[this.landingIndex]):this.headerRowDiv.appendChild(this.landingSlot))}},e.prototype.hideLandingSlot=function(){var t=this;this.landingIndex=-1,setTimeout((function(){t.landingSlot.parentElement&&t.landingSlot.parentElement.removeChild(t.landingSlot)}),10)},Object.defineProperty(e.prototype,"activeRowIndex",{get:function(){return this._activeRowIndex},set:function(t){if(t!==this._activeRowIndex){var e=this._activeRowIndex;this._activeRowIndex=t,this.updateActiveRow(),this.fireEvent({type:"activeRowChanged",oldValue:e,newValue:this.activeRowIndex,rowIndex:this.getGlobalIndexByLocal(this.activeRowIndex)})}},enumerable:!0,configurable:!0}),e.prototype.updateActiveRow=function(){var t=this;if(this.options.showActiveRow){this.bodyCellContainerDiv.querySelectorAll("[class*="+this.cssPrefix+"-row-active]").forEach((function(e){e.classList.remove(t.cssPrefix+"-row-active")}));var e=this.getActiveRow();e&&(e.classList.add(this.cssPrefix+"-row-active"),this.ensureRowVisibility(this.activeRowIndex))}},e.prototype.getActiveRow=function(){return this.getDataRow(this.activeRowIndex)},e.prototype.getDataRow=function(t){var e=Array.from(this.bodyCellContainerDiv.querySelectorAll("."+this.cssPrefix+"-row:not(."+this.cssPrefix+"-row-totals)"));return t>=0&&t<e.length?e[t]:null},e.prototype.focus=function(){this.bodyViewportDiv.focus()},e.prototype.resizeColumns=function(){if(this.options.columnWidths.autoResize!==a.a.Never){var t=this.bodyCellContainerDiv.style.width;this.bodyCellContainerDiv.style.visibility="hidden",this.bodyCellContainerDiv.style.width="1px",this.headerRowDiv.style.width="1px";for(var e=0,n=this.columns.getItems(),r=this.headerCellContainerDiv.querySelectorAll("."+this.cssPrefix+"-header-cell"),o=0,s=function(t){var s=n[t];if(!s.isVisible)return"continue";var l=u.options.columnWidths.autoResize!==a.a.Always&&s.dataColumn?s.dataColumn.calculatedWidth:0,c=u.bodyCellContainerDiv.querySelectorAll("."+u.cssPrefix+'-cell[data-col-idx="'+t+'"] > .'+u.cssPrefix+"-cell-value"),d=0;if(l>0)e+=l,s.width=l,c.forEach((function(t){t.parentElement.style.width=l+"px"})),r[o].style.width=l+"px";else if(0==c.length&&(r[o].style.width=null,r[o].style.whiteSpace="nowrap"),d=r[o].offsetWidth,c.length>0){c.forEach((function(t){t.parentElement.style.width=null;var e=t.parentElement.offsetWidth;e>d&&(d=e)})),d+=3;var h=s.isRowNum?u.options.columnWidths.rowNumColumn.max||500:u.options.columnWidths[s.dataColumn.type].max||2e3,p=s.isRowNum?u.options.columnWidths.rowNumColumn.min||0:u.options.columnWidths[s.dataColumn.type].min||20;d>h&&(d=h),d<p&&(d=p),i.utils.isNumericType(s.type)&&(d=Math.round(1.3*d)),e+=d,s.width=d,c.forEach((function(t){t.parentElement.style.width=d+"px"})),r[o].style.width=d+"px",s.dataColumn&&(s.dataColumn.calculatedWidth=d)}else e+=d;o++},u=this,l=0;l<this.columns.count;l++)s(l);e>0?(this.bodyCellContainerDiv.style.width=e+"px",this.headerCellContainerDiv.style.width=e+"px"):(this.bodyCellContainerDiv.style.width=t,this.headerCellContainerDiv.style.width=t),this.bodyCellContainerDiv.style.visibility=null,this.headerRowDiv.removeAttribute("style")}},e}()}).call(this,n(30))},function(t,e,n){(function(e,n){var i;i=function(){"use strict";function t(t){return"function"==typeof t}var i=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},r=0,o=void 0,s=void 0,a=function(t,e){f[r]=t,f[r+1]=e,2===(r+=2)&&(s?s(g):w())},u="undefined"!=typeof window?window:void 0,l=u||{},c=l.MutationObserver||l.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var t=setTimeout;return function(){return t(g,1)}}var f=new Array(1e3);function g(){for(var t=0;t<r;t+=2)(0,f[t])(f[t+1]),f[t]=void 0,f[t+1]=void 0;r=0}var m,y,v,b,w=void 0;function C(t,e){var n=this,i=new this.constructor(E);void 0===i[T]&&j(i);var r=n._state;if(r){var o=arguments[r-1];a((function(){return L(r,i,o,n._result)}))}else R(n,i,t,e);return i}function D(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(E);return M(e,t),e}d?w=function(){return e.nextTick(g)}:c?(y=0,v=new c(g),b=document.createTextNode(""),v.observe(b,{characterData:!0}),w=function(){b.data=y=++y%2}):h?((m=new MessageChannel).port1.onmessage=g,w=function(){return m.port2.postMessage(0)}):w=void 0===u?function(){try{var t=Function("return this")().require("vertx");return void 0!==(o=t.runOnLoop||t.runOnContext)?function(){o(g)}:p()}catch(t){return p()}}():p();var T=Math.random().toString(36).substring(2);function E(){}var x=void 0,I=1,S=2;function O(e,n,i){n.constructor===e.constructor&&i===C&&n.constructor.resolve===D?function(t,e){e._state===I?P(t,e._result):e._state===S?A(t,e._result):R(e,void 0,(function(e){return M(t,e)}),(function(e){return A(t,e)}))}(e,n):void 0===i?P(e,n):t(i)?function(t,e,n){a((function(t){var i=!1,r=function(t,e,n,i){try{t.call(e,n,i)}catch(t){return t}}(n,e,(function(n){i||(i=!0,e!==n?M(t,n):P(t,n))}),(function(e){i||(i=!0,A(t,e))}),t._label);!i&&r&&(i=!0,A(t,r))}),t)}(e,n,i):P(e,n)}function M(t,e){if(t===e)A(t,new TypeError("You cannot resolve a promise with itself"));else if(r=typeof(i=e),null===i||"object"!==r&&"function"!==r)P(t,e);else{var n=void 0;try{n=e.then}catch(e){return void A(t,e)}O(t,e,n)}var i,r}function _(t){t._onerror&&t._onerror(t._result),k(t)}function P(t,e){t._state===x&&(t._result=e,t._state=I,0!==t._subscribers.length&&a(k,t))}function A(t,e){t._state===x&&(t._state=S,t._result=e,a(_,t))}function R(t,e,n,i){var r=t._subscribers,o=r.length;t._onerror=null,r[o]=e,r[o+I]=n,r[o+S]=i,0===o&&t._state&&a(k,t)}function k(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var i=void 0,r=void 0,o=t._result,s=0;s<e.length;s+=3)i=e[s],r=e[s+n],i?L(n,i,r,o):r(o);t._subscribers.length=0}}function L(e,n,i,r){var o=t(i),s=void 0,a=void 0,u=!0;if(o){try{s=i(r)}catch(t){u=!1,a=t}if(n===s)return void A(n,new TypeError("A promises callback cannot return that same promise."))}else s=r;n._state!==x||(o&&u?M(n,s):!1===u?A(n,a):e===I?P(n,s):e===S&&A(n,s))}var N=0;function j(t){t[T]=N++,t._state=void 0,t._result=void 0,t._subscribers=[]}var F=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(E),this.promise[T]||j(this.promise),i(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?P(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&P(this.promise,this._result))):A(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===x&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,i=n.resolve;if(i===D){var r=void 0,o=void 0,s=!1;try{r=t.then}catch(t){s=!0,o=t}if(r===C&&t._state!==x)this._settledAt(t._state,e,t._result);else if("function"!=typeof r)this._remaining--,this._result[e]=t;else if(n===B){var a=new n(E);s?A(a,o):O(a,t,r),this._willSettleAt(a,e)}else this._willSettleAt(new n((function(e){return e(t)})),e)}else this._willSettleAt(i(t),e)},t.prototype._settledAt=function(t,e,n){var i=this.promise;i._state===x&&(this._remaining--,t===S?A(i,n):this._result[e]=n),0===this._remaining&&P(i,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;R(t,void 0,(function(t){return n._settledAt(I,e,t)}),(function(t){return n._settledAt(S,e,t)}))},t}(),B=function(){function e(t){this[T]=N++,this._result=this._state=void 0,this._subscribers=[],E!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(t,e){try{e((function(e){M(t,e)}),(function(e){A(t,e)}))}catch(e){A(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var n=this,i=n.constructor;return t(e)?n.then((function(t){return i.resolve(e()).then((function(){return t}))}),(function(t){return i.resolve(e()).then((function(){throw t}))})):n.then(e,e)},e}();return B.prototype.then=C,B.all=function(t){return new F(this,t).promise},B.race=function(t){var e=this;return i(t)?new e((function(n,i){for(var r=t.length,o=0;o<r;o++)e.resolve(t[o]).then(n,i)})):new e((function(t,e){return e(new TypeError("You must pass an array to race."))}))},B.resolve=D,B.reject=function(t){var e=new this(E);return A(e,t),e},B._setScheduler=function(t){s=t},B._setAsap=function(t){a=t},B._asap=a,B.polyfill=function(){var t=void 0;if(void 0!==n)t=n;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var i=null;try{i=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===i&&!e.cast)return}t.Promise=B},B.Promise=B,B},t.exports=i()}).call(this,n(26),n(27))},function(t,e,n){(function(e,n){var i;i=function(){"use strict";function t(t){return"function"==typeof t}var i=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},r=0,o=void 0,s=void 0,a=function(t,e){f[r]=t,f[r+1]=e,2===(r+=2)&&(s?s(g):w())},u="undefined"!=typeof window?window:void 0,l=u||{},c=l.MutationObserver||l.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var t=setTimeout;return function(){return t(g,1)}}var f=new Array(1e3);function g(){for(var t=0;t<r;t+=2)(0,f[t])(f[t+1]),f[t]=void 0,f[t+1]=void 0;r=0}var m,y,v,b,w=void 0;function C(t,e){var n=this,i=new this.constructor(E);void 0===i[T]&&j(i);var r=n._state;if(r){var o=arguments[r-1];a((function(){return L(r,i,o,n._result)}))}else R(n,i,t,e);return i}function D(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(E);return M(e,t),e}d?w=function(){return e.nextTick(g)}:c?(y=0,v=new c(g),b=document.createTextNode(""),v.observe(b,{characterData:!0}),w=function(){b.data=y=++y%2}):h?((m=new MessageChannel).port1.onmessage=g,w=function(){return m.port2.postMessage(0)}):w=void 0===u?function(){try{var t=Function("return this")().require("vertx");return void 0!==(o=t.runOnLoop||t.runOnContext)?function(){o(g)}:p()}catch(t){return p()}}():p();var T=Math.random().toString(36).substring(2);function E(){}var x=void 0,I=1,S=2;function O(e,n,i){n.constructor===e.constructor&&i===C&&n.constructor.resolve===D?function(t,e){e._state===I?P(t,e._result):e._state===S?A(t,e._result):R(e,void 0,(function(e){return M(t,e)}),(function(e){return A(t,e)}))}(e,n):void 0===i?P(e,n):t(i)?function(t,e,n){a((function(t){var i=!1,r=function(t,e,n,i){try{t.call(e,n,i)}catch(t){return t}}(n,e,(function(n){i||(i=!0,e!==n?M(t,n):P(t,n))}),(function(e){i||(i=!0,A(t,e))}),t._label);!i&&r&&(i=!0,A(t,r))}),t)}(e,n,i):P(e,n)}function M(t,e){if(t===e)A(t,new TypeError("You cannot resolve a promise with itself"));else if(r=typeof(i=e),null===i||"object"!==r&&"function"!==r)P(t,e);else{var n=void 0;try{n=e.then}catch(e){return void A(t,e)}O(t,e,n)}var i,r}function _(t){t._onerror&&t._onerror(t._result),k(t)}function P(t,e){t._state===x&&(t._result=e,t._state=I,0!==t._subscribers.length&&a(k,t))}function A(t,e){t._state===x&&(t._state=S,t._result=e,a(_,t))}function R(t,e,n,i){var r=t._subscribers,o=r.length;t._onerror=null,r[o]=e,r[o+I]=n,r[o+S]=i,0===o&&t._state&&a(k,t)}function k(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var i=void 0,r=void 0,o=t._result,s=0;s<e.length;s+=3)i=e[s],r=e[s+n],i?L(n,i,r,o):r(o);t._subscribers.length=0}}function L(e,n,i,r){var o=t(i),s=void 0,a=void 0,u=!0;if(o){try{s=i(r)}catch(t){u=!1,a=t}if(n===s)return void A(n,new TypeError("A promises callback cannot return that same promise."))}else s=r;n._state!==x||(o&&u?M(n,s):!1===u?A(n,a):e===I?P(n,s):e===S&&A(n,s))}var N=0;function j(t){t[T]=N++,t._state=void 0,t._result=void 0,t._subscribers=[]}var F=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(E),this.promise[T]||j(this.promise),i(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?P(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&P(this.promise,this._result))):A(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===x&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,i=n.resolve;if(i===D){var r=void 0,o=void 0,s=!1;try{r=t.then}catch(t){s=!0,o=t}if(r===C&&t._state!==x)this._settledAt(t._state,e,t._result);else if("function"!=typeof r)this._remaining--,this._result[e]=t;else if(n===B){var a=new n(E);s?A(a,o):O(a,t,r),this._willSettleAt(a,e)}else this._willSettleAt(new n((function(e){return e(t)})),e)}else this._willSettleAt(i(t),e)},t.prototype._settledAt=function(t,e,n){var i=this.promise;i._state===x&&(this._remaining--,t===S?A(i,n):this._result[e]=n),0===this._remaining&&P(i,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;R(t,void 0,(function(t){return n._settledAt(I,e,t)}),(function(t){return n._settledAt(S,e,t)}))},t}(),B=function(){function e(t){this[T]=N++,this._result=this._state=void 0,this._subscribers=[],E!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(t,e){try{e((function(e){M(t,e)}),(function(e){A(t,e)}))}catch(e){A(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var n=this,i=n.constructor;return t(e)?n.then((function(t){return i.resolve(e()).then((function(){return t}))}),(function(t){return i.resolve(e()).then((function(){throw t}))})):n.then(e,e)},e}();return B.prototype.then=C,B.all=function(t){return new F(this,t).promise},B.race=function(t){var e=this;return i(t)?new e((function(n,i){for(var r=t.length,o=0;o<r;o++)e.resolve(t[o]).then(n,i)})):new e((function(t,e){return e(new TypeError("You must pass an array to race."))}))},B.resolve=D,B.reject=function(t){var e=new this(E);return A(e,t),e},B._setScheduler=function(t){s=t},B._setAsap=function(t){a=t},B._asap=a,B.polyfill=function(){var t=void 0;if(void 0!==n)t=n;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var i=null;try{i=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===i&&!e.cast)return}t.Promise=B},B.Promise=B,B},t.exports=i()}).call(this,n(40),n(41))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i=function(){function t(t,e){this.request=t,this.promise=e}return t.prototype.getPromise=function(){return this.promise},t.prototype.getRequest=function(){return this.request},t.prototype.then=function(t,e){return this.promise.then(t,e)},t.prototype.catch=function(t){return this.promise.catch(t)},t.prototype.finally=function(t){return this.promise.finally(t)},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var i,r=n(0),o=n(9),s=n(7),a=(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},i(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(t){function e(){var e=t.call(this)||this;return e.name="DateTime",e}return a(e,t),e.prototype.validate=function(t,e){if(!r.utils.IsDefinedAndNotNull(e)||""==e)return{successed:!0};if(r.utils.getDateDataTypes().indexOf(t.dataType)>=0)try{var n=Object(s.a)(t.dataType);r.utils.strToDateTime(e,n)}catch(t){return{successed:!1,messages:[r.i18n.getText("DateTimeError")]}}return{successed:!0}},e}(o.a)},function(t,e,n){n(35),t.exports=n(42)},function(t,e,n){n(36),n(37),n(38),n(39)},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e){var n,i,r=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var u,l=[],c=!1,d=-1;function h(){c&&u&&(c=!1,u.length?l=u.concat(l):d=-1,l.length&&p())}function p(){if(!c){var t=a(h);c=!0;for(var e=l.length;e;){for(u=l,l=[];++d<e;)u&&u[d].run();d=-1,e=l.length}u=null,c=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{return i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function g(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new f(t,e)),1!==l.length||c||a(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=g,r.addListener=g,r.once=g,r.off=g,r.removeListener=g,r.removeAllListeners=g,r.emit=g,r.prependListener=g,r.prependOnceListener=g,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";n.r(e),n.d(e,"core",(function(){return o})),n.d(e,"ui",(function(){return s})),n.d(e,"crud",(function(){return i}));var i={};n.r(i),n.d(i,"TextDataFilter",(function(){return a.a})),n.d(i,"EntityEditForm",(function(){return u.a})),n.d(i,"EntityEditFormBuilder",(function(){return p})),n.d(i,"TextFilterWidget",(function(){return c})),n.d(i,"ProgressBar",(function(){return f})),n.d(i,"DataContext",(function(){return y})),n.d(i,"EasyDataServerLoader",(function(){return g})),n.d(i,"Validator",(function(){return v.a})),n.d(i,"TypeValidator",(function(){return w})),n.d(i,"RequiredValidator",(function(){return D})),n.d(i,"EasyDataViewDispatcher",(function(){return x})),n.d(i,"RootDataView",(function(){return E})),n.d(i,"EntityDataView",(function(){return T}));var r,o=n(0),s=n(3),a=n(22),u=n(23),l=n(7),c=function(){function t(t,e,n,i){var r=this;this.slot=t,this.grid=e,this.filter=n,this.options={focus:!1,instantMode:!1,instantTimeout:1e3},this.options=o.utils.assignDeep(this.options,i||{});var a=this.grid.cellRendererStore.getDefaultRendererByType(s.CellRendererType.STRING);this.grid.cellRendererStore.setDefaultRenderer(s.CellRendererType.STRING,(function(t,e,n,i){return r.highlightCellRenderer(a,t,e,n,i)}));var u=this.grid.cellRendererStore.getDefaultRendererByType(s.CellRendererType.NUMBER);this.grid.cellRendererStore.setDefaultRenderer(s.CellRendererType.NUMBER,(function(t,e,n,i){return r.highlightCellRenderer(u,t,e,n,i)})),this.render()}return t.prototype.render=function(){var t=this,e=s.browserUtils.IsIE()?"kfrm-fields-ie is-horizontal":"kfrm-fields is-horizontal",n=s.browserUtils.IsIE()||s.browserUtils.IsEdge();Object(s.domel)(this.slot).addClass(e).addChild("div",(function(e){e.addClass("control").addChild("input",(function(e){t.filterInput=e.toDOM(),e.attr("placeholder",o.i18n.getText("SearchInputPlaceholder")).type("text"),e.on("keydown",t.inputKeydownHandler.bind(t)),t.options.instantMode&&e.on("keyup",t.inputKeyupHandler.bind(t))})),n||e.addClass("has-icons-right").addChild("span",(function(e){e.addClass("icon").addClass("is-right").addClass("is-clickable").html("&#x1F5D9;").on("click",t.clearButtonClickHander.bind(t))}))})),this.options.instantMode||Object(s.domel)(this.slot).addChild("button",(function(e){return e.addClass("kfrm-button").addText(o.i18n.getText("SearchBtn")).on("click",t.searchButtonClickHandler.bind(t))})),this.options.focus&&this.filterInput.focus()},t.prototype.inputKeydownHandler=function(t){13==t.keyCode&&this.applyFilter(!0)},t.prototype.inputKeyupHandler=function(){var t=this;this.applyFilterTimeout&&clearTimeout(this.applyFilterTimeout),this.applyFilterTimeout=setTimeout((function(){t.applyFilter(!0)}),this.options.instantTimeout)},t.prototype.clearButtonClickHander=function(){this.filterInput.value="",this.filterInput.focus(),this.applyFilter(!0)},t.prototype.searchButtonClickHandler=function(){this.applyFilter(!0)},t.prototype.applyFilter=function(t){var e=this;this.applyFilterTimeout&&clearTimeout(this.applyFilterTimeout);var n=this.filter.getValue();return(!t||n!=this.filterInput.value)&&(this.filter.apply(this.filterInput.value).then((function(t){e.grid.setData(t)})),!0)},t.prototype.highlightCellRenderer=function(t,e,n,i,r){if((o.utils.isNumericType(n.type)||o.utils.getStringDataTypes().indexOf(n.type)>=0)&&e){e=n.dataColumn&&n.dataColumn.displayFormat&&s.DFMT_REGEX.test(n.dataColumn.displayFormat)?n.dataColumn.displayFormat.replace(s.DFMT_REGEX,(function(t,n){return o.i18n.numberToStr(e,n)})):e.toLocaleString();var a=this.highlightText(e.toString());if(a instanceof HTMLElement)return i.title=e,void i.appendChild(a)}t(e,n,i,r)},t.prototype.highlightText=function(t){var e=t.toLowerCase(),n=this.filter.getValue().toString();if(n&&n.length>0&&t&&t.length>0){for(var i=[],r=n.split("||").map((function(t){return t.trim().toLowerCase()})),o=0;o<r.length;o++){var s=0,a=r[o];if(a.length){if(a===e)return(p=document.createElement("span")).style.backgroundColor="yellow",p.innerText=t,p;for(;s<t.length-1;){var u=e.indexOf(a,s);u>=0?(i.push({index:u,length:r[o].length}),s=u+a.length):s++}}}if(i.length>0){i.sort((function(t,e){return t.index>e.index?1:t.index==e.index2?0:-1}));for(o=0;o<i.length-1;){var l=i[o+1].index-(i[o].index+i[o].length);if(l<0){var c=i[o+1].length+l;c>0&&(i[o].length+=c),i.splice(o+1,1)}else o++}var d=document.createElement("div");for(o=0;o<i.length;o++){if(0===o){var h=document.createTextNode(t.substring(0,i[o].index));d.appendChild(h)}var p;(p=document.createElement("span")).style.backgroundColor="yellow",p.innerText=t.substring(i[o].index,i[o].index+i[o].length),d.appendChild(p);var f=o<i.length-1?document.createTextNode(t.substring(i[o].index+i[o].length,i[o+1].index)):document.createTextNode(t.substring(i[o].index+i[o].length));d.appendChild(f)}return d}}return t},t}(),d=function(){return d=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},d.apply(this,arguments)},h=s.browserUtils.IsIE(),p=function(){function t(t,e){this.context=t,this.params=e,this.params=e||{},this.reset()}return t.prototype.reset=function(){this.form=new u.a(this.context)},t.prototype.setupLookupField=function(t,e,n,i){var r=this,a=this.context.getMetaData().getRootEntity().subEntities.filter((function(t){return t.id==e.lookupEntity}))[0],u=this.context.getMetaData().getAttributeById(e.dataAttr);if(u){n=n||!u.isEditable,i=this.params.values?this.params.values.getValue(u.id):void 0;var l,p=h?"kfrm-fields-ie is-horizontal":"kfrm-fields is-horizontal";Object(s.domel)(t).addChild("div",(function(t){t.addClass(p).addChild("input",(function(t){l=t.toDOM(),t.attr("readonly",""),t.name(u.id),t.type(r.resolveInputType(u.dataType)),t.value(o.utils.IsDefinedAndNotNull(i)?i.toString():"")})),n||t.addChild("button",(function(t){return t.addClass("kfrm-button").attr("title",o.i18n.getText("NavigationBtnTitle")).addText("...").on("click",(function(n){var i=new o.EasyDataTable({loader:{loadChunk:function(t){return r.context.getDataLoader().loadChunk(d(d({},t),{id:a.id}))}}});r.context.getDataLoader().loadChunk({offset:0,limit:1e3,needTotal:!0,sourceId:a.id}).then((function(n){for(var u,d=function(t){var e=a.attributes.filter((function(e){return e.id==t.id&&(e.isPrimaryKey||e.showInLookup)}));e.length&&i.columns.add(t)},h=0,p=n.table.columns.getItems();h<p.length;h++){d(p[h])}i.setTotal(n.total);for(var f=0,g=n.table.getCachedRows();f<g.length;f++){var m=g[f];i.addRow(m)}var y,v=new s.DefaultDialogService,b=null,w=null,C=Object(s.domel)("div").addClass("kfrm-form").addChild("div",(function(t){return t.addClass("kfrm-field").addChild("label",(function(t){return t.addText(o.i18n.getText("LookupSelectedItem")).toDOM()})).addChild("div",(function(t){return w=t.addText("None").toDOM()}))})).addChild("div",(function(t){return y=t.toDOM()})).addChild("div",(function(t){return t.addClass("kfrm-control").addChild("div",(function(t){return b=t.toDOM()}))})).toDOM(),D=l.value,T=function(t){w.innerHTML=i.columns.getItems().map((function(e){return"<b>"+e.label+":</b> "+function(t,e){return t instanceof o.DataRow?t.getValue(e):t[e.substring(e.lastIndexOf(".")+1)]}(t,e.id)})).join(", ")};if(D){var E=a.getFirstPrimaryAttr(),x=E.id.substring(E.id.lastIndexOf(".")+1);r.context.fetchRecord((u={},u[x]=D,u),a.id).then((function(t){t.entity&&T(t.entity)})).catch((function(t){console.error(t)}))}var I=new s.EasyGrid({slot:b,dataTable:i,fixHeightOnFirstRender:!0,paging:{pageSize:10},onActiveRowChanged:function(t){I.getData().getRow(t.rowIndex).then((function(t){D=t.getValue(e.lookupDataAttr),T(t)}))}});v.open({title:o.i18n.getText("LookupDlgCaption").replace("{entity}",a.caption),body:C,arrangeParents:!0,beforeOpen:function(){var t=r.context.createFilter(a.id,I.getData(),!0);new c(y,I,t,{instantMode:!0,focus:!0})},onSubmit:function(){return l.value=D,!0},onDestroy:function(){I.destroy(),t.toDOM().focus()}})}))}))}))}))}},t.prototype.setupDateTimeField=function(t,e,n,i,r){var a,u=this,c=h?"kfrm-fields-ie is-horizontal":"kfrm-fields is-horizontal",d=l.a(e.dataType),p=d.replace("yyyy","9999").replace("MM","99").replace("dd","99").replace("HH","99").replace("mm","99").replace("ss","99");Object(s.domel)(t).addChild("div",(function(t){t.addClass(c).addChild("input",(function(t){a=t.toDOM(),t.name(e.id),t.type(r?"hidden":u.resolveInputType(e.dataType)),i?t.attr("readonly",""):(t.mask(p),t.on("keypress",(function(t){return u.applySumbit(t)})).on("input",(function(e){t.removeClass("is-invalid");try{o.utils.strToDateTime(a.value,d)}catch(e){t.addClass("is-invalid")}})).on("blur",(function(t){a.value===p.replace(/[9]/g,"_")&&(a.value="")}))),t.value(o.utils.IsDefinedAndNotNull(n)?o.utils.dateTimeToStr(n,d):"")})),i||t.addChild("button",(function(t){return t.addClass("kfrm-button").attr("title",o.i18n.getText(e.dataType!==o.DataType.Time?"CalendarBtnTitle":"TimerBtnTitle")).addChild("i",(function(t){return t.addClass(e.dataType!==o.DataType.Time?"ed-calendar-icon":"ed-timer-icon")})).on("click",(function(t){var n;try{n=a.value.length?e.dataType!==o.DataType.Time?o.utils.strToDateTime(a.value,d):o.utils.strToTime(a.value):new Date((new Date).setSeconds(0))}catch(t){n=new Date((new Date).setSeconds(0))}var i={zIndex:9999999999,showCalendar:e.dataType!==o.DataType.Time,showTimePicker:e.dataType!==o.DataType.Date,onApply:function(t){t.setSeconds(0),t.setMilliseconds(0),a.value=o.utils.dateTimeToStr(t,d)}},r=new s.DefaultDateTimePicker(i);r.setDateTime(n),r.show(t.target)})).toDOM()}))}))},t.prototype.setupListField=function(t,e,n,i,r){var o=this;Object(s.domel)(t).addChild("div",(function(t){return t.addClass("kfrm-select full-width").addChild("select",(function(t){if(r&&t.attr("readonly",""),t.attr("name",e.id),t.on("keypress",(function(t){return o.applySumbit(t)})),i)for(var s=0;s<i.length;s++){var a=i[s];t.addOption({value:a.id,title:a.text,selected:0===s})}t.value(n)}))}))},t.prototype.setupFileField=function(t,e,n,i){var r=this;Object(s.domel)(t).addChild("input",(function(t){n&&t.attr("readonly",""),t.name(e.id).type(r.resolveInputType(e.dataType)),t.attr("accept",i)}))},t.prototype.setupTextField=function(t,e,n,i,r){var a=this;Object(s.domel)(t).addChild("input",(function(t){i&&t.attr("readonly",""),t.type(r?"hidden":a.resolveInputType(e.dataType)),t.name(e.id).type(a.resolveInputType(e.dataType)),e.dataType==o.DataType.Bool?n&&t.attr("checked",""):t.on("keypress",(function(t){return a.applySumbit(t)})).value(o.utils.IsDefinedAndNotNull(n)?n.toString():"")}))},t.prototype.setupTextArea=function(t,e,n,i){Object(s.domel)(t).addChild("textarea",(function(t){i&&t.attr("readonly",""),t.attr("name",e.id),t.setStyle("height","120px"),t.value(o.utils.IsDefinedAndNotNull(n)?n.toString():"")}))},t.prototype.addFormField=function(t,e){var n=this.params.values&&e.kind!==o.EntityAttrKind.Lookup?this.params.values.getValue(e.id):this.params.isEditForm?void 0:e.defaultValue,i=this.resolveEditor(e),r=this.params.isEditForm&&(e.isPrimaryKey||!e.isEditable),a=!e.isNullable;h&&(t=Object(s.domel)("div",t).addClass("kfrm-field-ie").toDOM()),Object(s.domel)(t).addChild("label",(function(t){t.attr("for",e.id),t.addHtml(e.caption+" "+(a?'<sup style="color: red">*</sup>':"")+": "),e.description&&t.addChild("div",(function(t){return t.attr("title",e.description).addClass("question-mark").setStyle("vertical-align","middle").setStyle("display","inline-block")}))}));var u=e.isPrimaryKey;if(e.kind!==o.EntityAttrKind.Lookup)switch(i.tag){case o.EditorTag.DateTime:this.setupDateTimeField(t,e,n,r,u);break;case o.EditorTag.List:this.setupListField(t,e,n,i.values,r);break;case o.EditorTag.File:this.setupFileField(t,e,r,i.accept);break;case o.EditorTag.Edit:default:i.multiline?this.setupTextArea(t,e,n,r):this.setupTextField(t,e,n,r,u)}else this.setupLookupField(t,e,r,n)},t.prototype.resolveInputType=function(t){return t===o.DataType.Bool?"checkbox":t===o.DataType.Blob?"file":"text"},t.prototype.resolveEditor=function(t){var e=t.defaultEditor||new o.ValueEditor;return e.tag==o.EditorTag.Unknown&&(o.utils.getDateDataTypes().indexOf(t.dataType)>=0?e.tag=o.EditorTag.DateTime:e.tag=o.EditorTag.Edit),e},t.prototype.applySumbit=function(t){return 13===t.keyCode&&(this.sumbitCallback&&this.sumbitCallback(),!1)},t.prototype.onSubmit=function(t){return this.sumbitCallback=t,this},t.prototype.build=function(){var t,e=Object(s.domel)("div").addClass("kfrm-form").addChild("div",(function(t){return t.addClass("errors-block").toDOM()})).addChild("div",(function(e){e.addClass(h?"kfrm-fields-ie col-ie-1-4 label-align-right":"kfrm-fields col-a-1 label-align-right"),t=e})).toDOM();this.form.setHtmlInt(e);for(var n=0,i=this.context.getActiveEntity().attributes;n<i.length;n++){var r=i[n];(this.params.isEditForm||r.showOnCreate)&&((r.isPrimaryKey||!this.params.isEditForm||r.showOnEdit)&&this.addFormField(t.toDOM(),r))}return this.form},t}(),f=function(){function t(t){this.slot=t,this.hide(),this.slot.classList.add("ed-progress-bar")}return t.prototype.show=function(){this.slot.style.removeProperty("display")},t.prototype.hide=function(){this.slot.style.display="none"},t}(),g=function(){function t(t){this.context=t}return t.prototype.loadChunk=function(t){var e=this,n=this.context.resolveEndpoint("FetchDataset",{sourceId:t.sourceId||this.context.getActiveEntity().id});return delete t.sourceId,this.context.startProcess(),this.context.getHttpClient().post(n,t).then((function(e){for(var n=new o.EasyDataTable({chunkSize:1e3}),i=e.resultSet,r=0,s=i.cols;r<s.length;r++){var a=s[r];n.columns.add(a)}for(var u=0,l=i.rows;u<l.length;u++){var c=l[u];n.addRow(c)}var d=0;return e.meta&&e.meta.totalRecords&&(d=e.meta.totalRecords),{table:n,total:d,hasNext:!t.needTotal||t.offset+t.limit<d}})).finally((function(){e.context.endProcess()}))},t}(),m=function(){return m=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},m.apply(this,arguments)},y=function(){function t(t){this.endpoints=new Map,this.endpointVarsRegex=/\{.*?\}/g,this.options=t||{},this.http=new o.HttpClient,this.model=new o.MetaData,this.model.id=t.metaDataId||"__default",this.dataLoader=new g(this);var e=m({loader:this.dataLoader},t.dataTable);this.data=new o.EasyDataTable(e),this.setDefaultEndpoints(this.options.endpoint||"/api/easydata")}return t.prototype.getActiveEntity=function(){return this.activeEntity},t.prototype.setActiveSource=function(t){this.activeEntity=this.model.getRootEntity().subEntities.filter((function(e){return e.id==t}))[0]},t.prototype.getMetaData=function(){return this.model},t.prototype.getData=function(){return this.data},t.prototype.getDataLoader=function(){return this.dataLoader},t.prototype.createFilter=function(t,e,n){return new a.a(this.dataLoader,e||this.getData(),t||this.activeEntity.id,n)},t.prototype.loadMetaData=function(){var t=this,e=this.resolveEndpoint("GetMetaData");return this.startProcess(),this.http.get(e).then((function(e){return e.model&&t.model.loadFromData(e.model),t.model})).catch((function(t){return console.error("Error: "+t.message+". Source: "+t.sourceError),null})).finally((function(){t.endProcess()}))},t.prototype.getHttpClient=function(){return this.http},t.prototype.fetchDataset=function(){var t=this;return this.data.clear(),this.dataLoader.loadChunk({offset:0,limit:this.data.chunkSize,needTotal:!0}).then((function(e){for(var n=0,i=e.table.columns.getItems();n<i.length;n++){var r=i[n];t.data.columns.add(r)}t.data.setTotal(e.total);for(var o=0,s=e.table.getCachedRows();o<s.length;o++){var a=s[o];t.data.addRow(a)}return t.data}))},t.prototype.fetchRecord=function(t,e){var n=this,i=this.resolveEndpoint("FetchRecord",{sourceId:e||this.activeEntity.id});return this.startProcess(),this.http.get(i,{queryParams:t}).finally((function(){return n.endProcess()}))},t.prototype.createRecord=function(t,e){var n=this,i=this.resolveEndpoint("CreateRecord",{sourceId:e||this.activeEntity.id});return this.startProcess(),this.http.post(i,t,{dataType:"json"}).finally((function(){return n.endProcess()}))},t.prototype.updateRecord=function(t,e){var n=this,i=this.resolveEndpoint("UpdateRecord",{sourceId:e||this.activeEntity.id});return this.startProcess(),this.http.post(i,t,{dataType:"json"}).finally((function(){return n.endProcess()}))},t.prototype.deleteRecord=function(t,e){var n=this,i=this.resolveEndpoint("DeleteRecord",{sourceId:e||this.activeEntity.id});return this.startProcess(),this.http.post(i,t,{dataType:"json"}).finally((function(){return n.endProcess()}))},t.prototype.setEndpoint=function(t,e){this.endpoints.set(t,e)},t.prototype.setEnpointIfNotExist=function(t,e){this.endpoints.has(t)||this.endpoints.set(t,e)},t.prototype.resolveEndpoint=function(t,e){e=e||{};var n=this.endpoints.get(t);if(!n)throw t+" endpoint is not defined";var i=n.match(this.endpointVarsRegex);if(i)for(var r=0,o=i;r<o.length;r++){var s=o[r],a=s.substring(1,s.length-1),u=e[a];if(!u)if("modelId"==a)u=this.model.getId();else{if("sourceId"!=a)throw"Parameter ["+a+"] is not defined";u=this.activeEntity.id}n=n.replace(s,u)}return n},t.prototype.startProcess=function(){this.options.onProcessStart&&this.options.onProcessStart()},t.prototype.endProcess=function(){this.options.onProcessEnd&&this.options.onProcessEnd()},t.prototype.setDefaultEndpoints=function(t){this.setEnpointIfNotExist("GetMetaData",Object(o.combinePath)(t,"models/{modelId}")),this.setEnpointIfNotExist("FetchDataset",Object(o.combinePath)(t,"models/{modelId}/sources/{sourceId}/fetch")),this.setEnpointIfNotExist("FetchRecord",Object(o.combinePath)(t,"models/{modelId}/sources/{sourceId}/fetch")),this.setEnpointIfNotExist("CreateRecord",Object(o.combinePath)(t,"models/{modelId}/sources/{sourceId}/create")),this.setEnpointIfNotExist("UpdateRecord",Object(o.combinePath)(t,"models/{modelId}/sources/{sourceId}/update")),this.setEnpointIfNotExist("DeleteRecord",Object(o.combinePath)(t,"models/{modelId}/sources/{sourceId}/delete"))},t}(),v=n(9),b=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),w=function(t){function e(){var e=t.call(this)||this;return e.name="Type",e}return b(e,t),e.prototype.validate=function(t,e){if(!o.utils.IsDefinedAndNotNull(e)||""==e)return{successed:!0};if(o.utils.isNumericType(t.dataType)){if(!o.utils.isNumeric(e))return{successed:!1,messages:[o.i18n.getText("NumberError")]};if(o.utils.isIntType(t.dataType)&&!Number.isInteger(Number.parseFloat(e)))return{successed:!1,messages:[o.i18n.getText("IntNumberError")]}}return{successed:!0}},e}(v.a),C=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),D=function(t){function e(){var e=t.call(this)||this;return e.name="Required",e}return C(e,t),e.prototype.validate=function(t,e){return t.isNullable||o.utils.IsDefinedAndNotNull(e)&&""!==e?{successed:!0}:{successed:!1,messages:[o.i18n.getText("RequiredError")]}},e}(v.a),T=function(){function t(t,e,n,i){var r=this;this.slot=t,this.context=e,this.basePath=n,this.options={showFilterBox:!0,showBackToEntities:!0},this.defaultValidators=[new D,new w],this.options=o.utils.assignDeep(this.options,i||{}),this.dlg=new s.DefaultDialogService;var a=this.context.getActiveEntity();if(!a)throw"Can't find active entity for "+window.location.pathname;this.slot.innerHTML+="<h1>"+(a.captionPlural||a.caption)+"</h1>",this.options.showBackToEntities&&Object(s.domel)(this.slot).addChild("a",(function(t){return t.attr("href","javascript:void(0)").text("← "+o.i18n.getText("BackToEntities")).on("click",(function(t){t.preventDefault(),Object(l.c)(r.basePath)}))})),this.renderGrid()}return t.prototype.syncGridColumnHandler=function(t){if(t.dataColumn){var e=this.context.getMetaData().getAttributeById(t.dataColumn.id);e&&(t.isVisible=e.showOnView)}},t.prototype.renderGrid=function(){var t=this;this.context.fetchDataset().then((function(e){var n=document.createElement("div");if(t.slot.appendChild(n),n.id="Grid",t.grid=new s.EasyGrid(o.utils.assignDeep({slot:n,dataTable:e,paging:{pageSize:15,allowPageSizeChange:!0,pageSizeItems:[15,30,50,100,200]},showPlusButton:t.context.getActiveEntity().isEditable,plusButtonTitle:o.i18n.getText("AddRecordBtnTitle"),showActiveRow:!1,onPlusButtonClick:t.addClickHandler.bind(t),onGetCellRenderer:t.manageCellRenderer.bind(t),onRowDbClick:t.rowDbClickHandler.bind(t),onSyncGridColumn:t.syncGridColumnHandler.bind(t)},t.options.grid||{})),t.options.showFilterBox){var i,r=Object(s.domel)("div").addClass("kfrm-form").setStyle("margin","10px 0px").addChild("div",(function(t){return i=t.toDOM()})).toDOM();t.slot.insertBefore(r,n);var a=t.context.createFilter();t.filterWidget=new c(i,t.grid,a)}}))},t.prototype.manageCellRenderer=function(t,e){var n=this;if(t.isRowNum)return t.width=110,function(t,e,i,r){var a=Object(s.domel)("div",i).addClass("keg-cell-value");n.context.getActiveEntity().isEditable&&a.addChild("a",(function(t){return t.attr("href","javascript:void(0)").text(o.i18n.getText("EditBtn")).on("click",(function(t){return n.editClickHandler(t,parseInt(r.getAttribute("data-row-idx")))}))})).addChild("span",(function(t){return t.text(" | ")})).addChild("a",(function(t){return t.attr("href","javascript:void(0)").text(o.i18n.getText("DeleteBtn")).on("click",(function(t){return n.deleteClickHandler(t,parseInt(r.getAttribute("data-row-idx")))}))}))}},t.prototype.addClickHandler=function(){var t=this,e=this.context.getActiveEntity(),n=new p(this.context).onSubmit((function(){return i.submit()})).build();n.useValidators(this.defaultValidators);var i=this.dlg.open({title:o.i18n.getText("AddDlgCaption").replace("{entity}",e.caption),body:n.getHtml(),onSubmit:function(){if(!n.validate())return!1;n.getData().then((function(e){return t.context.createRecord(e)})).then((function(){return t.refreshData()})).catch((function(e){t.processError(e)}))}})},t.prototype.editClickHandler=function(t,e){var n=this;this.grid.getData().getRow(e).then((function(t){t&&n.showEditForm(t)}))},t.prototype.showEditForm=function(t){var e=this,n=this.context.getActiveEntity(),i=new p(this.context,{isEditForm:!0,values:t}).onSubmit((function(){return r.submit()})).build();i.useValidators(this.defaultValidators);var r=this.dlg.open({title:o.i18n.getText("EditDlgCaption").replace("{entity}",n.caption),body:i.getHtml(),onSubmit:function(){if(!i.validate())return!1;i.getData().then((function(t){return e.context.updateRecord(t)})).then((function(){return e.refreshData()})).catch((function(t){e.processError(t)}))}})},t.prototype.rowDbClickHandler=function(t){this.context.getActiveEntity().isEditable&&this.showEditForm(t.row)},t.prototype.deleteClickHandler=function(t,e){var n=this;this.grid.getData().getRow(e).then((function(t){if(t){var e=n.context.getActiveEntity(),i=e.getPrimaryAttrs(),r=i.map((function(e){return t.getValue(e.id)})),s=i.reduce((function(t,e,n){return t[e.id.substring(e.id.lastIndexOf(".")+1)]=r[n],t}),{});n.dlg.openConfirm(o.i18n.getText("DeleteDlgCaption").replace("{entity}",e.caption),o.i18n.getText("DeleteDlgMessage").replace("{recordId}",Object.keys(s).map((function(t){return t+":"+s[t]})).join(";"))).then((function(t){t&&n.context.deleteRecord(s).then((function(){return n.refreshData()})).catch((function(t){n.processError(t)}))}))}}))},t.prototype.processError=function(t){this.dlg.open({title:"Ooops, something went wrong",body:t.message,closable:!0,cancelable:!1})},t.prototype.refreshData=function(){var t=this;return this.context.fetchDataset().then((function(){var e=!1;t.filterWidget&&(e=t.filterWidget.applyFilter(!1)),e||t.grid.refresh()}))},t}(),E=function(){function t(t,e,n){this.slot=t,this.context=e,this.basePath=n,this.metaData=this.context.getMetaData(),this.slot.innerHTML+="<h1>"+o.i18n.getText("RootViewTitle")+"</h1>",this.renderEntitySelector()}return t.prototype.renderEntitySelector=function(){var t=this,e=this.metaData.getRootEntity().subEntities;this.slot&&Object(s.domel)(this.slot).addChild("div",(function(n){return n.addClass("ed-root").addChild("div",(function(e){return e.addClass("ed-menu-description").addText(o.i18n.getText(t.metaData.isEmpty()?"ModelIsEmpty":"EntityMenuDesc"))})).addChild("ul",(function(n){n.addClass("ed-entity-menu"),e.forEach((function(e){n.addChild("li",(function(n){n.addClass("ed-entity-item").on("click",(function(){Object(l.c)(t.basePath+"/"+decodeURIComponent(e.id))})).addChild("div",(function(t){t.addClass("ed-entity-item-caption").addText(e.captionPlural||e.caption)})),e.description&&n.addChild("div",(function(t){t.addClass("ed-entity-item-descr").addText(""+e.description)}))}))}))}))}))},t}(),x=function(){function t(t){var e=this;this.options={container:"#EasyDataContainer",basePath:"easydata"},this.onSetLocation=function(){e.setActiveView()},this.attach=function(){window.addEventListener("ed_set_location",e.onSetLocation),window.addEventListener("popstate",e.onSetLocation)},this.options=o.utils.assign(this.options,t||{}),this.options.rootEntity?(this.options.showBackToEntities=!1,this.basePath="/"):this.basePath=this.normalizeBasePath(this.options.basePath),this.setContainer(this.options.container);var n=document.createElement("div"),i=new f(n),r=this.container.parentElement;r.insertBefore(n,r.firstElementChild),this.context=new y({endpoint:this.options.endpoint,dataTable:this.options.dataTable,onProcessStart:function(){return i.show()},onProcessEnd:function(){return i.hide()}})}return t.prototype.normalizeBasePath=function(t){t=this.trimSlashes(t);var e=decodeURIComponent(window.location.pathname),n=e.toLocaleLowerCase().indexOf(t);return n>=0?e.substring(0,n+t.length):"/"},t.prototype.trimSlashes=function(t){return t.replace(/^\/|\/$/g,"")},t.prototype.setContainer=function(t){if(!t)throw"Container is undefined";if("string"==typeof t){if(t.length){if("."===t[0]){var e=document.getElementsByClassName(t.substring(1));e.length&&(this.container=e[0])}else"#"===t[0]&&(t=t.substring(1)),this.container=document.getElementById(t);if(!this.container)throw Error("Unrecognized `container` parameter: "+t+"\nIt must be an element ID, a class name (starting with .) or an HTMLElement object itself.")}}else this.container=t},t.prototype.getActiveSourceId=function(){if(this.options.rootEntity)return this.options.rootEntity;var t=decodeURIComponent(window.location.pathname),e=this.basePath.length+1;return e<t.length?t.substring(e):null},t.prototype.run=function(){var t=this;return this.attach(),this.context.loadMetaData().then((function(){t.setActiveView()})).catch((function(t){return console.error(t)}))},t.prototype.setActiveView=function(){this.clear();var t=this.getActiveSourceId();t?(this.context.setActiveSource(t),window.EDView=new T(this.container,this.context,this.basePath,this.options)):window.EDView=new E(this.container,this.context,this.basePath)},t.prototype.clear=function(){this.container.innerHTML="",this.context.getData().clear()},t.prototype.detach=function(){window.removeEventListener("ed_set_location",this.onSetLocation),window.removeEventListener("popstate",this.onSetLocation)},t}();o.i18n.updateDefaultTexts({RequiredError:"Value is required.",NumberError:"Value should be a number",IntNumberError:"Value should be an integer number",DateTimeError:"Invalid date or time value",LookupSelectedItem:"Selected item: ",LookupDlgCaption:"Select {entity}",None:"None",NavigationBtnTitle:"Navigation values",CalendarBtnTitle:"Open calendar",TimerBtnTitle:"Open timer",AddBtnTitle:"Add",AddRecordBtnTitle:"Add record",EditBtn:"Edit",DeleteBtn:"Delete",SelectLink:"[ select ]",AddDlgCaption:"Create {entity}",EditDlgCaption:"Edit {entity}",DeleteDlgCaption:"Delete {entity}",DeleteDlgMessage:"Are you sure you want to remove this record: {{recordId}}?",EntityMenuDesc:"Click on an entity to view/edit its content",BackToEntities:"Back to entities",SearchBtn:"Search",SearchInputPlaceholder:"Search...",RootViewTitle:"Entities",ModelIsEmpty:"No entity was found."})}]);
3
3
  //# sourceMappingURL=easydata.min.js.map