UNPKG

@mescius/wijmo

Version:

UI library for pure JS, Angular, React, Vue and more...

14 lines (13 loc) 171 kB
/*! * * Wijmo Library 5.20252.44 * https://developer.mescius.com/wijmo * * Copyright(c) MESCIUS inc. All rights reserved. * * Licensed under the End-User License Agreement For MESCIUS Wijmo Software. * us.sales@mescius.com * https://developer.mescius.com/wijmo/licensing * */ "use strict";var __extends=this&&this.__extends||function(){var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};return function(e,t){extendStatics(e,t);function __(){this.constructor=e}e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}}(),__makeTemplateObject=this&&this.__makeTemplateObject||function(e,t){Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t;return e},__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);t.default=e;return t};Object.defineProperty(exports,"__esModule",{value:!0});var selfModule=__importStar(require("@mescius/wijmo"));function _ipTools(){var e={},t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp("^".concat(t,"\\.").concat(t,"\\.").concat(t,"\\.").concat(t,"$"),"i"),threeOctet:new RegExp("^".concat(t,"\\.").concat(t,"\\.").concat(t,"$"),"i"),twoOctet:new RegExp("^".concat(t,"\\.").concat(t,"$"),"i"),longValue:new RegExp("^".concat(t,"$"),"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),o="(?:[0-9a-f]+::?)+",s={zoneIndex:new RegExp("%[0-9a-z]{1,}","i"),native:new RegExp("^(::)?(".concat(o,")?([0-9a-f]+)?(::)?(").concat("%[0-9a-z]{1,}",")?$"),"i"),deprecatedTransitional:new RegExp("^(?:::)(".concat(t,"\\.").concat(t,"\\.").concat(t,"\\.").concat(t,"(").concat("%[0-9a-z]{1,}",")?)$"),"i"),transitional:new RegExp("^((?:".concat(o,")|(?:::)(?:").concat(o,")?)").concat(t,"\\.").concat(t,"\\.").concat(t,"\\.").concat(t,"(").concat("%[0-9a-z]{1,}",")?$"),"i")};function expandIPv6(e,t){if(e.indexOf("::")!==e.lastIndexOf("::"))return null;var r,n,i=0,o=-1,a=(e.match(s.zoneIndex)||[])[0];if(a){a=a.substring(1);e=e.replace(/%.+$/,"")}for(;(o=e.indexOf(":",o+1))>=0;)i++;"::"===e.substr(0,2)&&i--;"::"===e.substr(-2,2)&&i--;if(i>t)return null;n=t-i;r=":";for(;n--;)r+="0:";":"===(e=e.replace("::",r))[0]&&(e=e.slice(1));":"===e[e.length-1]&&(e=e.slice(0,-1));return{parts:t=function(){for(var t=e.split(":"),r=[],n=0;n<t.length;n++)r.push(parseInt(t[n],16));return r}(),zoneId:a}}function matchCIDR(e,t,r,n){if(e.length!==t.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");for(var i,o=0;n>0;){(i=r-n)<0&&(i=0);if(e[o]>>i!=t[o]>>i)return!1;n-=r;o+=1}return!0}function parseIntAuto(e){if(i.test(e))return parseInt(e,16);if("0"===e[0]&&!isNaN(parseInt(e[1],10))){if(n.test(e))return parseInt(e,8);throw new Error("ipaddr: cannot parse ".concat(e," as octal"))}return parseInt(e,10)}function padPart(e,t){for(;e.length<t;)e="0".concat(e);return e}e.IPv4=function(){function IPv4(e){if(4!==e.length)throw new Error("ipaddr: ipv4 octet count should be 4");var t,r;for(t=0;t<e.length;t++)if(!(0<=(r=e[t])&&r<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=e}IPv4.prototype.SpecialRanges={unspecified:[[new IPv4([0,0,0,0]),8]],broadcast:[[new IPv4([255,255,255,255]),32]],multicast:[[new IPv4([224,0,0,0]),4]],linkLocal:[[new IPv4([169,254,0,0]),16]],loopback:[[new IPv4([127,0,0,0]),8]],carrierGradeNat:[[new IPv4([100,64,0,0]),10]],private:[[new IPv4([10,0,0,0]),8],[new IPv4([172,16,0,0]),12],[new IPv4([192,168,0,0]),16]],reserved:[[new IPv4([192,0,0,0]),24],[new IPv4([192,0,2,0]),24],[new IPv4([192,88,99,0]),24],[new IPv4([198,51,100,0]),24],[new IPv4([203,0,113,0]),24],[new IPv4([240,0,0,0]),4]]};IPv4.prototype.kind=function(){return"ipv4"};IPv4.prototype.match=function(e,t){var r;if(void 0===t){e=(r=e)[0];t=r[1]}if("ipv4"!==e.kind())throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return matchCIDR(this.octets,e.octets,8,t)};IPv4.prototype.prefixLengthFromSubnetMask=function(){var e,t,r,n=0,i=!1,o={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};for(e=3;e>=0;e-=1){if(!((t=this.octets[e])in o))return null;r=o[t];if(i&&0!==r)return null;8!==r&&(i=!0);n+=r}return 32-n};IPv4.prototype.range=function(){return e.subnetMatch(this,this.SpecialRanges)};IPv4.prototype.toByteArray=function(){return this.octets.slice(0)};IPv4.prototype.toIPv4MappedAddress=function(){return e.IPv6.parse("::ffff:".concat(this.toString()))};IPv4.prototype.toNormalizedString=function(){return this.toString()};IPv4.prototype.toString=function(){return this.octets.join(".")};return IPv4}();e.IPv4.broadcastAddressFromCIDR=function(e){try{for(var t=this.parseCIDR(e),r=t[0].toByteArray(),n=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],o=0;o<4;){i.push(parseInt(r[o],10)|255^parseInt(n[o],10));o++}return new this(i)}catch(e){throw new Error("ipaddr: the address does not have IPv4 CIDR format")}};e.IPv4.isIPv4=function(e){return null!==this.parser(e)};e.IPv4.isValid=function(e){try{new this(this.parser(e));return!0}catch(e){return!1}};e.IPv4.isValidFourPartDecimal=function(t){return!(!e.IPv4.isValid(t)||!t.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))};e.IPv4.networkAddressFromCIDR=function(e){var t,r,n,i,o;try{n=(t=this.parseCIDR(e))[0].toByteArray();o=this.subnetMaskFromPrefixLength(t[1]).toByteArray();i=[];r=0;for(;r<4;){i.push(parseInt(n[r],10)&parseInt(o[r],10));r++}return new this(i)}catch(e){throw new Error("ipaddr: the address does not have IPv4 CIDR format")}};e.IPv4.parse=function(e){var t=this.parser(e);if(null===t)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(t)};e.IPv4.parseCIDR=function(e){var t;if(t=e.match(/^(.+)\/(\d+)$/)){var r=parseInt(t[2]);if(r>=0&&r<=32){var n=[this.parse(t[1]),r];Object.defineProperty(n,"toString",{value:function value(){return this.join("/")}});return n}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")};e.IPv4.parser=function(e){var t,n,i;if(t=e.match(r.fourOctet))return function(){for(var e=t.slice(1,6),r=[],i=0;i<e.length;i++){n=e[i];r.push(parseIntAuto(n))}return r}();if(t=e.match(r.longValue)){if((i=parseIntAuto(t[1]))>4294967295||i<0)throw new Error("ipaddr: address outside defined range");return function(){var e,t=[];for(e=0;e<=24;e+=8)t.push(i>>e&255);return t}().reverse()}return(t=e.match(r.twoOctet))?function(){var e=t.slice(1,4),r=[];if((i=parseIntAuto(e[1]))>16777215||i<0)throw new Error("ipaddr: address outside defined range");r.push(parseIntAuto(e[0]));r.push(i>>16&255);r.push(i>>8&255);r.push(255&i);return r}():(t=e.match(r.threeOctet))?function(){var e=t.slice(1,5),r=[];if((i=parseIntAuto(e[2]))>65535||i<0)throw new Error("ipaddr: address outside defined range");r.push(parseIntAuto(e[0]));r.push(parseIntAuto(e[1]));r.push(i>>8&255);r.push(255&i);return r}():null};e.IPv4.subnetMaskFromPrefixLength=function(e){if((e=parseInt(e))<0||e>32)throw new Error("ipaddr: invalid IPv4 prefix length");for(var t=[0,0,0,0],r=0,n=Math.floor(e/8);r<n;){t[r]=255;r++}n<4&&(t[n]=Math.pow(2,e%8)-1<<8-e%8);return new this(t)};e.IPv6=function(){function IPv6(e,t){var r,n;if(16===e.length){this.parts=[];for(r=0;r<=14;r+=2)this.parts.push(e[r]<<8|e[r+1])}else{if(8!==e.length)throw new Error("ipaddr: ipv6 part count should be 8 or 16");this.parts=e}for(r=0;r<this.parts.length;r++)if(!(0<=(n=this.parts[r])&&n<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");t&&(this.zoneId=t)}IPv6.prototype.SpecialRanges={unspecified:[new IPv6([0,0,0,0,0,0,0,0]),128],linkLocal:[new IPv6([65152,0,0,0,0,0,0,0]),10],multicast:[new IPv6([65280,0,0,0,0,0,0,0]),8],loopback:[new IPv6([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new IPv6([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new IPv6([0,0,0,0,0,65535,0,0]),96],rfc6145:[new IPv6([0,0,0,0,65535,0,0,0]),96],rfc6052:[new IPv6([100,65435,0,0,0,0,0,0]),96],"6to4":[new IPv6([8194,0,0,0,0,0,0,0]),16],teredo:[new IPv6([8193,0,0,0,0,0,0,0]),32],reserved:[[new IPv6([8193,3512,0,0,0,0,0,0]),32]]};IPv6.prototype.isIPv4MappedAddress=function(){return"ipv4Mapped"===this.range()};IPv6.prototype.kind=function(){return"ipv6"};IPv6.prototype.match=function(e,t){var r;if(void 0===t){e=(r=e)[0];t=r[1]}if("ipv6"!==e.kind())throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return matchCIDR(this.parts,e.parts,16,t)};IPv6.prototype.prefixLengthFromSubnetMask=function(){for(var e,t,r=0,n=!1,i={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},o=7;o>=0;o-=1){if(!((e=this.parts[o])in i))return null;t=i[e];if(n&&0!==t)return null;16!==t&&(n=!0);r+=t}return 128-r};IPv6.prototype.range=function(){return e.subnetMatch(this,this.SpecialRanges)};IPv6.prototype.toByteArray=function(){for(var e,t=[],r=this.parts,n=0;n<r.length;n++){e=r[n];t.push(e>>8);t.push(255&e)}return t};IPv6.prototype.toFixedLengthString=function(){var e=function(){for(var e=[],t=0;t<this.parts.length;t++)e.push(padPart(this.parts[t].toString(16),4));return e}.call(this).join(":"),t="";this.zoneId&&(t="%".concat(this.zoneId));return e+t};IPv6.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");var t=this.parts.slice(-2),r=t[0],n=t[1];return new e.IPv4([r>>8,255&r,n>>8,255&n])};IPv6.prototype.toNormalizedString=function(){var e=function(){for(var e=[],t=0;t<this.parts.length;t++)e.push(this.parts[t].toString(16));return e}.call(this).join(":"),t="";this.zoneId&&(t="%".concat(this.zoneId));return e+t};IPv6.prototype.toRFC5952String=function(){for(var e,t=/((^|:)(0(:|$)){2,})/g,r=this.toNormalizedString(),n=0,i=-1;e=t.exec(r);)if(e[0].length>i){n=e.index;i=e[0].length}return i<0?r:"".concat(r.substring(0,n),"::").concat(r.substring(n+i))};IPv6.prototype.toString=function(){return this.toNormalizedString().replace(/((^|:)(0(:|$))+)/,"::")};return IPv6}();e.IPv6.broadcastAddressFromCIDR=function(e){try{for(var t=this.parseCIDR(e),r=t[0].toByteArray(),n=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],o=0;o<16;){i.push(parseInt(r[o],10)|255^parseInt(n[o],10));o++}return new this(i)}catch(e){throw new Error("ipaddr: the address does not have IPv6 CIDR format (".concat(e,")"))}};e.IPv6.isIPv6=function(e){return null!==this.parser(e)};e.IPv6.isValid=function(e){if("string"==typeof e&&-1===e.indexOf(":"))return!1;try{var t=this.parser(e);new this(t.parts,t.zoneId);return!0}catch(e){return!1}};e.IPv6.networkAddressFromCIDR=function(e){var t,r,n,i,o;try{n=(t=this.parseCIDR(e))[0].toByteArray();o=this.subnetMaskFromPrefixLength(t[1]).toByteArray();i=[];r=0;for(;r<16;){i.push(parseInt(n[r],10)&parseInt(o[r],10));r++}return new this(i)}catch(e){throw new Error("ipaddr: the address does not have IPv6 CIDR format (".concat(e,")"))}};e.IPv6.parse=function(e){var t=this.parser(e);if(null===t.parts)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(t.parts,t.zoneId)};e.IPv6.parseCIDR=function(e){var t,r,n;if((r=e.match(/^(.+)\/(\d+)$/))&&(t=parseInt(r[2]))>=0&&t<=128){n=[this.parse(r[1]),t];Object.defineProperty(n,"toString",{value:function value(){return this.join("/")}});return n}throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")};e.IPv6.parser=function(e){var t,r,n,i,o,a;if(n=e.match(s.deprecatedTransitional))return this.parser("::ffff:".concat(n[1]));if(s.native.test(e))return expandIPv6(e,8);if(n=e.match(s.transitional)){a=n[6]||"";if((t=expandIPv6(n[1].slice(0,-1)+a,6)).parts){o=[parseInt(n[2]),parseInt(n[3]),parseInt(n[4]),parseInt(n[5])];for(r=0;r<o.length;r++)if(!(0<=(i=o[r])&&i<=255))return null;t.parts.push(o[0]<<8|o[1]);t.parts.push(o[2]<<8|o[3]);return{parts:t.parts,zoneId:t.zoneId}}}return null};e.IPv6.subnetMaskFromPrefixLength=function(e){if((e=parseInt(e))<0||e>128)throw new Error("ipaddr: invalid IPv6 prefix length");for(var t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=0,n=Math.floor(e/8);r<n;){t[r]=255;r++}n<16&&(t[n]=Math.pow(2,e%8)-1<<8-e%8);return new this(t)};e.fromByteArray=function(t){var r=t.length;if(4===r)return new e.IPv4(t);if(16===r)return new e.IPv6(t);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")};e.isValid=function(t){return e.IPv6.isValid(t)||e.IPv4.isValid(t)};e.parse=function(t){if(e.IPv6.isValid(t))return e.IPv6.parse(t);if(e.IPv4.isValid(t))return e.IPv4.parse(t);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")};e.parseCIDR=function(t){try{return e.IPv6.parseCIDR(t)}catch(r){try{return e.IPv4.parseCIDR(t)}catch(e){throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}};e.process=function(e){var t=this.parse(e);return"ipv6"===t.kind()&&t.isIPv4MappedAddress()?t.toIPv4Address():t};e.subnetMatch=function(e,t,r){var n,i,o,s;null==r&&(r="unicast");for(i in t)if(Object.prototype.hasOwnProperty.call(t,i)){!(o=t[i])[0]||o[0]instanceof Array||(o=[o]);for(n=0;n<o.length;n++){s=o[n];if(e.kind()===s[0].kind()&&e.match.apply(e,s))return i}}return r};return e}exports.ipaddr=_ipTools();var Binding=function(){function Binding(e){this.path=e}Object.defineProperty(Binding.prototype,"path",{get:function(){return this._path},set:function(e){this._path=e;this._parts=e?e.split("."):[];for(var t=0;t<this._parts.length;t++){var r=this._parts[t],n=r.indexOf("[");if(n>-1){this._parts[t]=r.substr(0,n);this._parts.splice(++t,0,parseInt(r.substr(n+1)))}}this._key=1==this._parts.length?this._parts[0]:null},enumerable:!0,configurable:!0});Binding.prototype.getValue=function(e){if(e){if(this._key)return e[this._key];if(this._path&&this._path in e)return e[this._path];for(var t=0;t<this._parts.length&&e;t++)e=e[this._parts[t]]}return e};Binding.prototype.setValue=function(e,t){if(e)try{var r=this._path;if(r in e){e[r]=t;return e[r]==t}for(var n=0;n<this._parts.length-1;n++)if(null==(e=e[this._parts[n]]))return!1;e[r=this._parts[this._parts.length-1]]=t;return e[r]==t}catch(e){return!1}return!1};return Binding}();exports.Binding=Binding;var EventHandler=function EventHandler(e,t){this.handler=e;this.self=t},Event=function(){function Event(e){this._handlers=[];this._handlersChanged=e}Event.prototype.addHandler=function(e,t){e=asFunction(e);this._handlers.push(new EventHandler(e,t));isFunction(this._handlersChanged)&&this._handlersChanged()};Event.prototype.getHandler=function(e){void 0===e&&(e=0);var t=this._handlers[e];if(t)return t.handler};Event.prototype.removeHandler=function(e,t){var r=!1;e=asFunction(e);for(var n=0;n<this._handlers.length;n++){var i=this._handlers[n];if(!(i.handler!=e&&null!=e||i.self!=t&&null!=t)){this._handlers.splice(n--,1);r=!0;if(e&&t)break}}r&&isFunction(this._handlersChanged)&&this._handlersChanged()};Event.prototype.removeAllHandlers=function(){var e=this._handlers.length>0;this._handlers.length=0;e&&isFunction(this._handlersChanged)&&this._handlersChanged()};Event.prototype.raise=function(e,t){void 0===t&&(t=EventArgs.empty);for(var r=this._handlers,n=0;n<r.length;n++){var i=r[n];i.handler.call(i.self,e,t);r[n]!==i&&n--}};Object.defineProperty(Event.prototype,"hasHandlers",{get:function(){return this._handlers.length>0},enumerable:!0,configurable:!0});Object.defineProperty(Event.prototype,"handlerCount",{get:function(){return this._handlers.length},enumerable:!0,configurable:!0});return Event}();exports.Event=Event;var EventArgs=function(){function EventArgs(){}EventArgs.empty=new EventArgs;return EventArgs}();exports.EventArgs=EventArgs;var CancelEventArgs=function(e){__extends(CancelEventArgs,e);function CancelEventArgs(){var t=null!==e&&e.apply(this,arguments)||this;t.cancel=!1;return t}return CancelEventArgs}(EventArgs);exports.CancelEventArgs=CancelEventArgs;var PropertyChangedEventArgs=function(e){__extends(PropertyChangedEventArgs,e);function PropertyChangedEventArgs(t,r,n){var i=e.call(this)||this;i._name=t;i._oldVal=r;i._newVal=n;return i}Object.defineProperty(PropertyChangedEventArgs.prototype,"propertyName",{get:function(){return this._name},enumerable:!0,configurable:!0});Object.defineProperty(PropertyChangedEventArgs.prototype,"oldValue",{get:function(){return this._oldVal},enumerable:!0,configurable:!0});Object.defineProperty(PropertyChangedEventArgs.prototype,"newValue",{get:function(){return this._newVal},enumerable:!0,configurable:!0});return PropertyChangedEventArgs}(EventArgs);exports.PropertyChangedEventArgs=PropertyChangedEventArgs;var NotifyCollectionChangedAction,RequestErrorEventArgs=function(e){__extends(RequestErrorEventArgs,e);function RequestErrorEventArgs(t,r){var n=e.call(this)||this;n._xhr=t;n._msg=r;return n}Object.defineProperty(RequestErrorEventArgs.prototype,"request",{get:function(){return this._xhr},enumerable:!0,configurable:!0});Object.defineProperty(RequestErrorEventArgs.prototype,"message",{get:function(){return this._msg},set:function(e){this._msg=e},enumerable:!0,configurable:!0});return RequestErrorEventArgs}(CancelEventArgs);exports.RequestErrorEventArgs=RequestErrorEventArgs;!function(e){e[e.Add=0]="Add";e[e.Remove=1]="Remove";e[e.Change=2]="Change";e[e.Reset=3]="Reset"}(NotifyCollectionChangedAction=exports.NotifyCollectionChangedAction||(exports.NotifyCollectionChangedAction={}));var NotifyCollectionChangedEventArgs=function(e){__extends(NotifyCollectionChangedEventArgs,e);function NotifyCollectionChangedEventArgs(t,r,n){void 0===t&&(t=NotifyCollectionChangedAction.Reset);void 0===r&&(r=null);void 0===n&&(n=-1);var i=e.call(this)||this;i.action=t;i.item=r;i.index=n;return i}NotifyCollectionChangedEventArgs.reset=new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset);return NotifyCollectionChangedEventArgs}(EventArgs);exports.NotifyCollectionChangedEventArgs=NotifyCollectionChangedEventArgs;var SortDescription=function(){function SortDescription(e,t){this._bnd=new Binding(e);this._asc=t}Object.defineProperty(SortDescription.prototype,"property",{get:function(){return this._bnd.path},enumerable:!0,configurable:!0});Object.defineProperty(SortDescription.prototype,"ascending",{get:function(){return this._asc},enumerable:!0,configurable:!0});return SortDescription}();exports.SortDescription=SortDescription;var PageChangingEventArgs=function(e){__extends(PageChangingEventArgs,e);function PageChangingEventArgs(t){var r=e.call(this)||this;r.newPageIndex=t;return r}return PageChangingEventArgs}(CancelEventArgs);exports.PageChangingEventArgs=PageChangingEventArgs;var GroupDescription=function(){function GroupDescription(){}GroupDescription.prototype.groupNameFromItem=function(e,t){return""};GroupDescription.prototype.namesMatch=function(e,t){return e===t};return GroupDescription}();exports.GroupDescription=GroupDescription;var PropertyGroupDescription=function(e){__extends(PropertyGroupDescription,e);function PropertyGroupDescription(t,r){var n=e.call(this)||this;n._bnd=new Binding(t);n._converter=r;return n}Object.defineProperty(PropertyGroupDescription.prototype,"propertyName",{get:function(){return this._bnd.path},enumerable:!0,configurable:!0});PropertyGroupDescription.prototype.groupNameFromItem=function(e,t){return this._converter?this._converter(e,this.propertyName):this._bnd.getValue(e)};PropertyGroupDescription.prototype.namesMatch=function(e,t){return e===t};return PropertyGroupDescription}(GroupDescription);exports.PropertyGroupDescription=PropertyGroupDescription;exports.empty={};exports.ClipboardClsNames={clipboard:"wj-clipboard"};exports.ControlClsNames={content:"wj-content",hostElement:"wj-control",template:"wj-template"};exports.ControlStateClsNames={active:"wj-state-active",checked:"wj-state-checked",collapsed:"wj-state-collapsed",collapsing:"wj-state-collapsing",disabled:"wj-state-disabled",dragSrc:"wj-state-dragsrc",empty:"wj-state-empty",focus:"wj-state-focus",focused:"wj-state-focused",invalid:"wj-state-invalid",lastSelected:"wj-state-last-selected",loading:"wj-state-loading",match:"wj-state-match",exactMatchSpace:"wj-state-exact-match-space",measuring:"wj-state-measuring",multiSelected:"wj-state-multi-selected",pinned:"wj-state-pinned",readOnly:"wj-state-readonly",selected:"wj-state-selected",sticky:"wj-state-sticky",updating:"wj-state-updating",labeledInput:".wj-labeled-input",wjError:".wj-error",errorVisible:"wj-error-visible"};exports.GlyphClsNames={backward:"wj-glyph-backward",btnGlyph:"wj-btn-glyph",calendar:"wj-glyph-calendar",circle:"wj-glyph-circle",clock:"wj-glyph-clock",down:"wj-glyph-down",downLeft:"wj-glyph-down-left",drag:"wj-glyph-drag",file:"wj-glyph-file",filter:"wj-glyph-filter",forward:"wj-glyph-forward",glyph:"wj-glyph",left:"wj-glyph-left",minus:"wj-glyph-minus",plus:"wj-glyph-plus",right:"wj-glyph-right",stepBackward:"wj-glyph-step-backward",stepForward:"wj-glyph-step-forward",up:"wj-glyph-up"};exports.InputFormElementsClsNames={btn:"wj-btn",btnDefault:"wj-btn-default",btnGroup:"wj-btn-group",btnGroupVertical:"wj-btn-group-vertical",btnsOutside:"wj-btns-outside",formControl:"wj-form-control",svgBtn:"wj-svg-btn"};exports.PrintDocumentClsNames={printDocument:"wj-printdocument"};exports.TooltipClsNames={hostElement:"wj-tooltip"};exports.UtilitesClsNames={align:"wj-align",alignVCenter:"wj-align-vcenter",animated:"wj-animated",centerVert:"wj-center-vert",close:"wj-close",hide:"wj-hide",hideOk:"wj-hide-ok",remove:"wj-remove",right:"wj-right",rtl:"wj-rtl",separator:"wj-separator"};exports.ForeignClsNames={InputClsNames:{input:"wj-input",inputBtnVisible:"wj-input-btn-visible",inputGroup:"wj-input-group",inputGroupBtn:"wj-input-group-btn"},SelectorClsNames:{columnSelector:"wj-column-selector",columnSelectorGroup:"wj-column-selector-group"}};var _agent="undefined"!=typeof navigator?navigator.userAgent:"";function isMobile(){var e=_agent.toLowerCase();return["android","webos","iphone","ipad","ipod","blackberry","windows phone","mobile","mobi","tablet"].some((function(t){return e.includes(t)}))}exports.isMobile=isMobile;function isSupportTouch(){return"ontouchstart"in window||navigator.maxTouchPoints>0}exports.isSupportTouch=isSupportTouch;var _isiOS=null!=_agent.match(/iPad|iPhone|iPod/i);function isiOS(){return _isiOS}exports.isiOS=isiOS;var _isFF=null!=_agent.match(/Firefox\//);function isFirefox(){return _isFF}exports.isFirefox=isFirefox;var _isSafari=null!=_agent.match(/^((?!Chrome|Android).)*safari/i);function isSafari(){return _isSafari}exports.isSafari=isSafari;var _isEdge=null!=_agent.match(/Edge\/|Edg\//);function isEdge(){return _isEdge}exports.isEdge=isEdge;var _isIE=null!=_agent.match(/MSIE |Trident\/|Edge\//);function isIE(){return _isIE}exports.isIE=isIE;var _isIE9=!1;function isIE9(){return _isIE9}exports.isIE9=isIE9;var _isIE10=!1;function isIE10(){return _isIE10}exports.isIE10=isIE10;var _isChromiumBased=null;function isChromiumBased(){if(null!=_isChromiumBased)return _isChromiumBased;_isChromiumBased=!1;var e="undefined"!=typeof navigator?navigator.userAgentData:null;if(e&&e.brands)for(var t=0,r=e.brands;t<r.length;t++){if("Chromium"==r[t].brand){_isChromiumBased=!0;break}}return _isChromiumBased}exports.isChromiumBased=isChromiumBased;var _supportsPassive=!1;"undefined"!=typeof document&&document.addEventListener("test",(function(e){}),{get passive(){_supportsPassive=!0;return!0}});function getEventOptions(e,t){return _supportsPassive?{capture:e,passive:t}:e}exports.getEventOptions=getEventOptions;var _supportsFocusOptions=!1;"undefined"!=typeof document&&document.createElement("div").focus({get preventScroll(){_supportsFocusOptions=!0;return!0}});function supportsFocusOptions(){return _supportsFocusOptions}exports.supportsFocusOptions=supportsFocusOptions;function _startDrag(e,t){e.effectAllowed=t;isFirefox()&&e.setData("text","")}exports._startDrag=_startDrag;if("undefined"!=typeof document&&document.doctype){navigator.appVersion.indexOf("MSIE 10")>-1&&(_isIE10=!0);if(navigator.appVersion.indexOf("MSIE 9")>-1){_isIE9=!0;document.addEventListener("mousemove",(function(e){if(1==e.which){var t=closest(e.target,"."+exports.ControlClsNames.hostElement);if(t&&!t.style.cursor)for(var r=e.target;r;r=r.parentElement)if(r.attributes&&r.attributes.draggable){r.dragDrop();return!1}}}))}}if("undefined"!=typeof window){var raf="requestAnimationFrame",caf="cancelAnimationFrame";if(!window[raf]){var expectedTime_1=0;window[raf]=function(e){var t=Date.now(),r=16-(t-expectedTime_1),n=r>0?r:0;expectedTime_1=t+n;return setTimeout((function(){e(expectedTime_1)}),n)};window[caf]=clearTimeout}if(!window.atob){var keys_1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",keysRe_1=new RegExp("[^"+keys_1+"]");window.atob=function(e){var t,r,n,i,o=[],s=0,a=e.length;if(keysRe_1.test(e)||/=/.test(e)&&(/=[^=]/.test(e)||/={3}/.test(e)))throw new Error("Invalid base64 data");a%4>0&&(a=(e+=Array(4-a%4+1).join("=")).length);for(;s<a;){for(r=[],i=s;s<i+4;)r.push(keys_1.indexOf(e.charAt(s++)));n=[((t=(r[0]<<18)+(r[1]<<12)+((63&r[2])<<6)+(63&r[3]))&255<<16)>>16,64===r[2]?-1:(65280&t)>>8,64===r[3]?-1:255&t];for(i=0;i<3;++i)(n[i]>=0||0===i)&&o.push(String.fromCharCode(n[i]))}return o.join("")};window.btoa=function(e){for(var t,r,n=[],i=0,o=e.length;i<o;){t=((r=[e.charCodeAt(i++),e.charCodeAt(i++),e.charCodeAt(i++)])[0]<<16)+((r[1]||0)<<8)+(r[2]||0);n.push(keys_1.charAt((t&63<<18)>>18),keys_1.charAt((258048&t)>>12),keys_1.charAt(isNaN(r[1])?64:(4032&t)>>6),keys_1.charAt(isNaN(r[2])?64:63&t))}return n.join("")}}}var _FocusService=function(){function _FocusService(){this._hasDoc="undefined"!=typeof Document;this._ae=this._nativeAe();var e=window,t=this._onBlur.bind(this),r=this._onFocus.bind(this);e.addEventListener("focusout",t,!0);e.addEventListener("focusin",r,!0);if(!isIE()){e.addEventListener("blur",t,!0);e.addEventListener("focus",r,!0)}}Object.defineProperty(_FocusService.prototype,"activeElement",{get:function(){var e=this._ae,t=this._nativeAe();e===_FocusService._noAe?e=this._ae=t:e!=t&&(this._isSpecialRoot(e)||document.body.contains(e)||(e=this._ae=t));return e!==_FocusService._noAe?e:null},enumerable:!0,configurable:!0});_FocusService.prototype._onBlur=function(e){if(e.isTrusted){var t=e.relatedTarget;this._ae=this._isSpecialRoot(t)?this._nativeAe():t}};_FocusService.prototype._onFocus=function(e){e.isTrusted&&(this._ae=this._nativeAe())};_FocusService.prototype._isSpecialRoot=function(e){return null==e||e===document.body||this._hasDoc&&e instanceof Document};_FocusService.prototype._nativeAe=function(){var e;try{e="unknown"!=typeof document.activeElement?document.activeElement:_FocusService._noAe}catch(t){e=_FocusService._noAe}return e};_FocusService.prototype.dispose=function(){if(!isIE()){window.removeEventListener("blur",this._onBlur,!0);window.removeEventListener("focus",this._onFocus,!0)}window.removeEventListener("focusout",this._onBlur,!0);window.removeEventListener("focusin",this._onFocus,!0)};_FocusService._noAe={};return _FocusService}();exports._FocusService=_FocusService;var _getProxyTarget="undefined"!=typeof window&&window.Symbol?Symbol("_getProxyTarget"):"\t_get\tProxy\tTarget\t";function _getCalculatedArray(e,t,r){var n=new WeakMap;if(!r){var i={};if(e.length){var o=e[0];for(var s in o){var a=typeof o[s];i[s]="string"==a?"":"number"==a?0:null}r=i}}return new Proxy(e,{get:function(e,i){if(i===_getProxyTarget)return e;if("string"==typeof i||"number"==typeof i){if("indexOf"==i)return function(t,r){var n=e.indexOf(t,r);n<0&&t&&(t=t[_getProxyTarget])&&(n=e.indexOf(t,r));return n};var o=parseInt(i);if(!isNaN(o)){var s=e[o];if(s&&!s[_getProxyTarget]){var a=n.get(s);if(!a){a=_createItemProxy(s,t,r);n.set(s,a)}s=a}return s}}return Reflect.get(e,i)}})}exports._getCalculatedArray=_getCalculatedArray;function _createItemProxy(e,t,r){if(!e[_getProxyTarget]){if(isIE())for(var n in t)e[n]=null;var i={get:function(e,n,i){if(n===_getProxyTarget)return e;if("constructor"===n)return function(){return Object.assign({},r||{})};var o=t[n];if(o)switch(typeof o){case"function":return o(i);case"string":return _eval(o,i)}return e[n]}};if(!isIE()){i.ownKeys=function(e){return Object.keys(e).concat(Object.keys(t))};i.getOwnPropertyDescriptor=function(e,r){return r in t?{enumerable:!0,configurable:!0,writable:!1}:Reflect.getOwnPropertyDescriptor(e,r)}}e=new Proxy(e,i)}return e}function _getTargetObject(e){return(e?e[_getProxyTarget]:null)||e}exports._getTargetObject=_getTargetObject;function _eval(e,t){var r=[t];return(new(Function.bind.apply(Function,[void 0].concat(["$"],["return "+e])))).apply(void 0,r)}var Key,DataType,_VERSION="5.20252.44",_ENV_TOOLS=function(){function _ENV_TOOLS(){}_ENV_TOOLS.isSameInstance=function(e,t){return e==t};_ENV_TOOLS.indexOf=function(e,t){return e.indexOf(t)};return _ENV_TOOLS}();exports._ENV_TOOLS=_ENV_TOOLS;exports._CLS_STATE_DISABLED=exports.ControlStateClsNames.disabled;function getVersion(){return _VERSION}exports.getVersion=getVersion;function setLicenseKey(e){Control._licKey=e}exports.setLicenseKey=setLicenseKey;!function(e){e[e.Back=8]="Back";e[e.Tab=9]="Tab";e[e.Enter=13]="Enter";e[e.Escape=27]="Escape";e[e.Space=32]="Space";e[e.PageUp=33]="PageUp";e[e.PageDown=34]="PageDown";e[e.End=35]="End";e[e.Home=36]="Home";e[e.Left=37]="Left";e[e.Up=38]="Up";e[e.Right=39]="Right";e[e.Down=40]="Down";e[e.Delete=46]="Delete";e[e.X=88]="X";e[e.F1=112]="F1";e[e.F2=113]="F2";e[e.F3=114]="F3";e[e.F4=115]="F4";e[e.F5=116]="F5";e[e.F6=117]="F6";e[e.F7=118]="F7";e[e.F8=119]="F8";e[e.F9=120]="F9";e[e.F10=121]="F10";e[e.F11=122]="F11";e[e.F12=123]="F12";e[e.PlusKey=107]="PlusKey";e[e.EqualPlusKey=187]="EqualPlusKey";e[e.MinusKey=109]="MinusKey";e[e.HyphenMinusKey=189]="HyphenMinusKey";e[e.S=83]="S";e[e.P=80]="P";e[e.F=70]="F"}(Key=exports.Key||(exports.Key={}));!function(e){e[e.Object=0]="Object";e[e.String=1]="String";e[e.Number=2]="Number";e[e.Boolean=3]="Boolean";e[e.Date=4]="Date";e[e.Array=5]="Array"}(DataType=exports.DataType||(exports.DataType={}));function tryCast(e,t){return null==e?null:isString(t)?isFunction(e.implementsInterface)&&e.implementsInterface(t)?e:null:e instanceof t?e:null}exports.tryCast=tryCast;function isPrimitive(e){return isString(e)||isNumber(e)||isBoolean(e)||isDate(e)}exports.isPrimitive=isPrimitive;function isString(e){return"string"==typeof e}exports.isString=isString;function isNullOrWhiteSpace(e){return!e||!/\S/.test(e)}exports.isNullOrWhiteSpace=isNullOrWhiteSpace;function isNumber(e){return"number"==typeof e}exports.isNumber=isNumber;function isInt(e){return isNumber(e)&&e==Math.round(e)}exports.isInt=isInt;function isBoolean(e){return"boolean"==typeof e}exports.isBoolean=isBoolean;function isFunction(e){return"function"==typeof e}exports.isFunction=isFunction;function isUndefined(e){return void 0===e}exports.isUndefined=isUndefined;function isNullOrUndefined(e){return null==e}exports.isNullOrUndefined=isNullOrUndefined;function isDate(e){return(e instanceof Date||"[object Date]"===Object.prototype.toString.call(e))&&!isNaN(e.getTime())}exports.isDate=isDate;function isArray(e){return e instanceof Array||Array.isArray(e)||"[object Array]"===Object.prototype.toString.call(e)}exports.isArray=isArray;function _isPlainArray(e){return Array.isArray(e)}exports._isPlainArray=_isPlainArray;function isObject(e){return null!=e&&"object"==typeof e&&!isDate(e)&&!isArray(e)}exports.isObject=isObject;function isEmpty(e){for(var t in e)return!1;return!0}exports.isEmpty=isEmpty;function _areObjectsEqual(e,t){var r=Object.entries(e),n=Object.entries(t);if(r.length!==n.length)return!1;for(var i=0,o=r;i<o.length;i++){var s=o[i],a=s[0],l=s[1];if(!t.hasOwnProperty(a)||t[a]!==l)return!1}return!0}exports._areObjectsEqual=_areObjectsEqual;function getUniqueId(e){for(var t=e,r=0;null!=document.getElementById(t);r++)t=e+r;return t}exports.getUniqueId=getUniqueId;function getSafeUniqueId(e,t,r){void 0===t&&(t="wj");var n=e;(n=(n=(n=n.trim().toLowerCase()).replace(/[^a-z0-9_-]+/g,"-")).replace(/-+/g,"-").replace(/^-|-$/g,""))?/^[a-z]/.test(n)&&!r||(n=t+"-"+n):n=t+"-"+Date.now();for(var i=0;null!=document.getElementById(n);i++)n+=i;return n}exports.getSafeUniqueId=getSafeUniqueId;function uidGenerator(){for(var e="",t="0123456789abcdef".split(""),r=0;r<32;r++){var n=Math.floor(16*Math.random());switch(r){case 8:e+="-";break;case 12:n=4;e+="-";break;case 16:n=3&n|8;e+="-";break;case 20:e+="-"}e+=t[n]}return e}exports.uidGenerator=uidGenerator;function mouseToPage(e){if(e instanceof Point)return e;e&&e.touches&&e.touches.length>0&&(e=e.touches[0]);if(isNumber(e.clientX)&&isNumber(e.clientY))return new Point(e.clientX+pageXOffset,e.clientY+pageYOffset);throw"Mouse or touch event expected."}exports.mouseToPage=mouseToPage;function getType(e){return isNumber(e)?DataType.Number:isBoolean(e)?DataType.Boolean:isDate(e)?DataType.Date:isString(e)?DataType.String:isArray(e)?DataType.Array:DataType.Object}exports.getType=getType;function getTypes(e,t){void 0===t&&(t=1e3);if(!e)return[];var r=e.length;(t<=0||r<t)&&(t=r);var n=[];if(t){for(var i=Object.keys(e[0]),o={},s=i.slice(),a=0;a<t;a++){for(var l=e[a],u=s.length-1;u>=0;u--){var c=s[u],p=l[c];if(isPrimitive(p)){var h=Object.getOwnPropertyDescriptor(e[a],c);o[c]={binding:c,dataType:getType(p),isReadOnly:h&&!h.writable&&!h.set};s.splice(u,1)}}if(!s.length)break}for(a=0;a<i.length;a++){var d=o[i[a]];d&&n.push(d)}}return n}exports.getTypes=getTypes;function changeType(e,t,r,n){if(null!=e){var i=DataType;if(isString(e))switch(t){case i.Number:var o=Globalize.parseFloat(e,r);return isNaN(o)?e:o;case i.Date:var s=Globalize.parseDate(e,r,isDate(n)?n:null);s||r||!e||(s=new Date(e));return s&&isFinite(s.getTime())?s:e;case i.Boolean:switch(e.toLowerCase()){case"true":return!0;case"false":return!1}return e;case i.Array:try{var a=e.split(",").map((function(e){return(e=e.trim()).match(/^(\+|\-)?\d+\.?\d*$/)?e:'"'+e+'"'}));return JSON.parse("["+a.join(",")+"]")}catch(e){}}if(t==DataType.String)return Globalize.format(e,r)}return e}exports.changeType=changeType;function toFixed(e,t,r){if(r){var n=e.toString(),i=n.indexOf("e"),o=n.indexOf(".");if(i>-1){if("-"===n[i+1]){var s=parseFloat(n.substr(i+2)),a=n.substr(0,i);o>-1&&(a=a.substr(0,o)+a.substr(o+1));n="0."+(Array(s).join("0")+a).substr(0,t);e=parseFloat(n)}}else if(o>-1){n=n.substr(0,o+1+t);e=parseFloat(n)}}else{var l=Math.pow(10,t);e=Math.round(e*l)/l}return e}exports.toFixed=toFixed;function format(e,t,r){if((e=asString(e)).match(/\{.*"count".*:.*"when".*:.*\}/))try{var n=JSON.parse(e);if(isString(n.count)){var i=t[n.count],o=n.when;if(isNumber(i)&&isObject(o)){var s=o[i]||o.other;isString(s)&&(e=s)}}}catch(e){}return e.replace(/\{(.*?)(:(.*?))?\}/g,(function(e,n,i,o){var s=e;if(n&&"{"!=n[0]&&t){s=new Binding(n).getValue(t);o&&(s=Globalize.format(s,o));r&&(s=r(t,n,o,s))}return null==s?"":s}))}exports.format=format;function glbz(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=[],n=-1;e[0].forEach((function(t,i){if(i>0&&i!=n){var o=e[i],s=t.match(/^:([a-z][0-9]*\b)/i)||t.match(/^:'(.+?)'/)||t.match(/^:"(.+?)"/);if(s){o=Globalize.format(o,s[1]);t=t.substr(s[0].length)}else if(":"==t&&i<e.length-1&&(isNumber(o)||isDate(o))){o=Globalize.format(o,e[i+1]);t="";n=i+1}r.push(o)}t&&r.push(t)}));return r.join("")}exports.glbz=glbz;function evalTemplate(e,t){if(isIE()){return(e=e.replace(/:\${([^}]*)}/g,(function(e,r){return":"+_evalExpression(r,t)}))).replace(/\${([^}]*)}(:(([A-Za-z]\d*)|"([^"]+)"|'([^']+)'))?/g,(function(e,r,n,i,o,s,a){var l=_evalExpression(r,t);return i?Globalize.format(l,o||s||a):l}))}return _evalExpression(e,t)}exports.evalTemplate=evalTemplate;function _evalExpression(e,t){(t=t||{}).glbz=glbz;var r=parseTpl(e,t);return isIE()?r:glbz(templateObject_1||(templateObject_1=__makeTemplateObject(["",""],["",""])),r)}function get(e,t,r){void 0===r&&(r="${"+e+"}");return e.split(".").reduce((function(e,t){return null!=e&&null!=e[t]?e[t]:r}),t)}function parseTpl(e,t,r){return e.replace(/\$\{.+?}/g,(function(e){return get(e.substr(2,e.length-3).trim(),t,r)}))}function clamp(e,t,r){if(null!=e){null!=r&&e>r&&(e=r);null!=t&&e<t&&(e=t)}return e}exports.clamp=clamp;function copy(e,t,r,n){void 0===r&&(r=!0);void 0===n&&(n=!1);if(t)for(var i in t)if("_"!=i[0]){assert(i in e,'Unknown property "'+i+'".');var o=t[i];if(!e._copy||!e._copy(i,o)){var s=e[i];e[i]instanceof Event?isFunction(o)&&e[i].addHandler(o):!r||!isObject(o)||"undefined"!=typeof Element&&o instanceof Element||!s||!isObject(s)||Object.getPrototypeOf(s).constructor==Object.prototype.constructor&&isWritable(e,i)||"itemsSource"==i?n&&isObject(o)&&Object.getPrototypeOf(o).isPrototypeOf(Object)&&isObject(s)&&!Object.getPrototypeOf(s).isPrototypeOf(Object)?copy(s,o):e[i]=o:copy(s,o)}}return e}exports.copy=copy;function _isPlainObject(e){return isObject(e)&&Object.getPrototypeOf(e).isPrototypeOf(Object)}exports._isPlainObject=_isPlainObject;function isWritable(e,t){var r=Object.getOwnPropertyDescriptor(e,t)||Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),t)||{};return!!r.writable||isFunction(r.set)}exports.isWritable=isWritable;function deepClone(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e)){return e.map((function(e){return deepClone(e)}))}var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=deepClone(e[r]));return t}exports.deepClone=deepClone;function assert(e,t,r){void 0===r&&(r=!0);if(!e){t="** Assertion failed in Wijmo: "+t;var n=new Error;isString(n.stack)&&r&&(t+=" "+n.stack);throw t}}exports.assert=assert;function _deprecated(e,t){console.error('** WARNING: "'+e+'" has been deprecated; please use "'+t+'" instead.')}exports._deprecated=_deprecated;function _warning(e){console.error('** WARNING: "'+e)}exports._warning=_warning;function asString(e,t){void 0===t&&(t=!0);isUndefined(e)&&(e=null);assert(t&&null==e||isString(e),"String expected.");return e}exports.asString=asString;function asNumber(e,t,r){void 0===t&&(t=!1);void 0===r&&(r=!1);assert(t&&null==e||isNumber(e),"Number expected.");if(r&&e&&e<0)throw"Positive number expected.";return e}exports.asNumber=asNumber;function asInt(e,t,r){void 0===t&&(t=!1);void 0===r&&(r=!1);assert(t&&null==e||isInt(e),"Integer expected.");if(r&&e&&e<0)throw"Positive integer expected.";return e}exports.asInt=asInt;function asBoolean(e,t){void 0===t&&(t=!1);assert(t&&null==e||isBoolean(e),"Boolean expected.");return e}exports.asBoolean=asBoolean;function asDate(e,t){void 0===t&&(t=!1);if(isString(e)){var r=changeType(e,DataType.Date,"r");isDate(r)&&(e=r)}assert(t&&null==e||isDate(e),"Date expected.");return e}exports.asDate=asDate;function asFunction(e,t){void 0===t&&(t=!0);assert(t&&null==e||isFunction(e),"Function expected.");return e}exports.asFunction=asFunction;function asArray(e,t){void 0===t&&(t=!0);assert(t&&null==e||isArray(e),"Array expected.");return e}exports.asArray=asArray;function asType(e,t,r){void 0===r&&(r=!1);e=tryCast(e,t);assert(r||null!=e,t+" expected.");return e}exports.asType=asType;function asEnum(e,t,r){void 0===r&&(r=!1);if(null==e&&r)return null;var n=isString(e)?t[e]:e;assert(null!=n,'Invalid enum value: "'+e+'"');return isNumber(n)?n:e}exports.asEnum=asEnum;function asCollectionView(e,t){void 0===t&&(t=!0);if(null==e&&t)return null;var r=tryCast(e,"ICollectionView");if(null!=r)return r;isArray(e)||assert(!1,"Array or ICollectionView expected.");return new CollectionView(e)}exports.asCollectionView=asCollectionView;function hasItems(e){return null!=e&&null!=e.items&&e.items.length>0}exports.hasItems=hasItems;function toHeaderCase(e){return e&&e.length?e[0].toUpperCase()+e.substr(1).replace(/([a-z])([A-Z])/g,"$1 $2"):""}exports.toHeaderCase=toHeaderCase;function escapeHtml(e){e&&isString(e)&&(e=e.replace(/[&<>]/g,(function(e){return _ENTITYMAP[e]})));return null!=e?e.toString():""}exports.escapeHtml=escapeHtml;var _plainText,_ENTITYMAP={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},_specialCharsRegex=/"(.*?)"|[^\w]|_/g;function getSpecialCharsRegex(){return _specialCharsRegex}exports.getSpecialCharsRegex=getSpecialCharsRegex;function escapeRegExp(e){return e.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}exports.escapeRegExp=escapeRegExp;function toPlainText(e){var t=asString(e);if(isString(t)&&t.indexOf("<")>-1){_plainText||(_plainText=document.createElement("div"));_plainText.innerHTML=t;t=_plainText.textContent}return t}exports.toPlainText=toPlainText;function hasClass(e,t){if(e&&t){if(e instanceof HTMLElement&&e.classList&&!isIE9())return e.classList.contains(t);if(e.getAttribute){var r=new RegExp("(\\s|^)"+t+"(\\s|$)");return e&&r.test(e.getAttribute("class"))}}return!1}exports.hasClass=hasClass;function addClass(e,t){void 0===t&&(t="");if(e&&t){var r=t.trim();if(e instanceof HTMLElement&&e.classList&&!isIE9()){r.indexOf(" ")<0?e.classList.add(r):r.split(" ").forEach((function(t){t.length>0&&e.classList.add(t)}));return}e.setAttribute&&r.split(" ").forEach((function(t){if(t.length>0&&!hasClass(e,t)){var r=e.getAttribute("class");e.setAttribute("class",r?r+" "+t:t)}}))}}exports.addClass=addClass;function removeClass(e,t){if(e&&t){var r=t.trim();if(e instanceof HTMLElement&&e.classList&&!isIE9()){r.indexOf(" ")<0?e.classList.remove(r):r.split(" ").forEach((function(t){t.length>0&&e.classList.remove(t)}));0===e.classList.length&&e.removeAttribute("class");return}e.setAttribute&&r.split(" ").forEach((function(t){if(hasClass(e,t)){var r=new RegExp("((\\s|^)"+t+"(\\s|$))","g"),n=e.getAttribute("class");(n=n.replace(r," ").replace(/ +/g," ").trim())?e.setAttribute("class",n):e.removeAttribute("class")}}))}}exports.removeClass=removeClass;function toggleClass(e,t,r){null==r&&(r=!hasClass(e,t));r?addClass(e,t):removeClass(e,t)}exports.toggleClass=toggleClass;function setAttribute(e,t,r,n){e&&(null!=r?n&&e.getAttribute(t)||("style"===t.toLowerCase()&&(e instanceof HTMLElement||e instanceof SVGElement)?e.style.cssText=r.toString():e.setAttribute(t,r.toString())):e.removeAttribute(t))}exports.setAttribute=setAttribute;function setInnerHTMLSafe(e,t){t=t.replace(/\bstyle\s*=/gi,"data-wj-style=");e.innerHTML=t;for(var r=e.querySelectorAll("[data-wj-style]"),n=0;n<r.length;n++){var i=r[n],o=i.getAttribute("data-wj-style");o&&(i instanceof HTMLElement||i instanceof SVGElement)&&(i.style.cssText=o);i.removeAttribute("data-wj-style")}}exports.setInnerHTMLSafe=setInnerHTMLSafe;function setChecked(e,t){var r=null==t;e.checked=isIE()?t||r:t;e.indeterminate=r}exports.setChecked=setChecked;function setAriaLabel(e,t){setAttribute(e,"aria-label",t)}exports.setAriaLabel=setAriaLabel;function setSelectionRange(e,t,r,n){void 0===r&&(r=t);void 0===n&&(n=!0);assert(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement,"INPUT or TEXTAREA element expected");if(contains(document.body,e)&&!e.disabled&&e.offsetHeight){try{e.setSelectionRange(t,r,"backward")}catch(e){}if(n)try{e.focus();return!0}catch(e){}}return!1}exports.setSelectionRange=setSelectionRange;function disableAutoComplete(e){var t="autocomplete",r=e.getAttribute(t);r&&"on"!=r||e.setAttribute(t,"off");"autocorrect,autocapitalize,spellcheck".split(",").forEach((function(t){e.setAttribute(t,"spellcheck"==t?"false":"off")}))}exports.disableAutoComplete=disableAutoComplete;function removeChild(e){return e&&e.parentNode?e.parentNode.removeChild(e):null}exports.removeChild=removeChild;function getActiveElement(){var e=document.activeElement;if(e){var t=e.shadowRoot;t&&t.activeElement&&(e=t.activeElement)}return e}exports.getActiveElement=getActiveElement;function _getActiveElement(e){var t=e;if(t){var r=t.shadowRoot;r&&r.activeElement&&(t=r.activeElement)}return t}exports._getActiveElement=_getActiveElement;function moveFocus(e,t){var r=_getFocusableElements(e,t<0),n=0;if(t){var i=r.indexOf(getActiveElement());i>-1&&(n=(i+t+r.length)%r.length)}if(n<r.length){var o=r[n];o.focus();o instanceof HTMLInputElement&&o.select();return!0}return!1}exports.moveFocus=moveFocus;function _getFocusableElements(e,t){void 0===t&&(t=!1);var r=[],n=Array.prototype.slice.call(e.querySelectorAll("input,select,textarea,button,a,div,label,[tabindex]")),i={};n=n.filter((function(e){return-1!==e.tabIndex}));var isRb=function(e){return e instanceof HTMLInputElement&&"radio"===e.type};n.forEach((function(e){isRb(e)&&e.checked&&(i[e.name||""]=!0)}));(n=n.filter((function(e){return!isRb(e)||e.checked||!i[e.name||""]}))).sort((function(e,t){return e.tabIndex===t.tabIndex?0:0===e.tabIndex?1:0===t.tabIndex?-1:e.tabIndex-t.tabIndex}));for(var o=0;o<n.length;o++){var s=n[o];if(s.offsetHeight>0&&s.tabIndex>-1&&!s.disabled&&"hidden"!==window.getComputedStyle(s).visibility&&!closest(s,"[disabled],."+exports.ControlStateClsNames.disabled)){if(s instanceof HTMLAnchorElement&&!s.hasAttribute("href"))continue;if(isIE()&&!s.hasAttribute("tabindex")){if(s instanceof HTMLDivElement)continue;var a=Control.getControl(closest(s,".wj-flexgrid"));if(a&&0==a.keyActionTab)continue}if("radio"===s.type&&!s.checked&&r.length>0){var l=r[r.length-1],u=getActiveElement();if("radio"===l.type&&l.name===s.name){t&&l!=u&&(r[r.length-1]=s);continue}}(Control.getControl(s)||!_getFocusableElements(s).length||s.classList.contains("wj-detail"))&&r.push(s)}}return r}exports._getFocusableElements=_getFocusableElements;function saveFile(e,t,r){void 0===r&&(r="text/plain");var n=e instanceof Blob;n||!r.match(/\bcsv\b/i)&&!t.match(/\.csv$/i)||(e="\ufeff"+e);var i=n?e:new Blob([e],{type:r}),o=navigator;if(isFunction(o.msSaveOrOpenBlob))o.msSaveOrOpenBlob(i,t);else{var s=document.createElement("a"),click=function(e){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null);e.dispatchEvent(t)};if("download"in s){var a=window.URL||window.webkitURL,l=a.createObjectURL(i);s.href=l;s.target="_blank";s.download=t;click(s);s=null;window.setTimeout((function(){a.revokeObjectURL(l)}),3e4)}else{var u=new FileReader;u.onloadend=function(){s.href=u.result;s.download=t;click(s);s=null};u.readAsDataURL(i)}}}exports.saveFile=saveFile;function getElement(e){if(e instanceof Element||e&&e.appendChild&&e.appendChild instanceof Function)return e;if(isString(e))try{return document.querySelector(e)}catch(e){}return e&&e.jquery?e[0]:null}exports.getElement=getElement;function processStyleProperty(e){var t=(e=e.replace(";base64,","_wj_")).split(";"),r=[];t.forEach((function(e){var t=[];e.indexOf("_wj_")>-1?2==(t=(e=e.replace("_wj_",";base64,").replace("data:image","_wjimg_")).split(":")).length&&(t[1]=t[1].replace("_wjimg_","data:image")):t=e.split(":");r.push(t)}));return r}function createElement(e,t,r){e=e.replace(/\bstyle\s*=/gi,"_wj-style=");var n=document.createElement("div");n.innerHTML=e;if(e.indexOf("_wj-style")>-1)for(var i=n.querySelectorAll("[_wj-style]"),_loop_1=function(e){var t=i[e],r=t.getAttribute("_wj-style"),n=[];if(r.indexOf(";base64,")>-1)n=processStyleProperty(r);else{r.split(";").forEach((function(e){n.push(e.split(":"))}))}n.forEach((function(e){2==e.length&&(t.style[e[0].trim()]=e[1].trim())}));t.removeAttribute("_wj-style")},o=0;o<i.length;o++)_loop_1(o);1==n.children.length&&(n=n.children[0]);r&&setCss(n,r);t&&(t=getElement(t)).appendChild(n);return n}exports.createElement=createElement;function setText(e,t){e.textContent=t||""}exports.setText=setText;function contains(e,t,r){for(var n=t;n&&e;){if(n===e)return!0;n=(r?n[Control._OWNR_KEY]:null)||n.parentNode||n.host}return!1}exports.contains=contains;function closest(e,t){if(e){if(isFunction(e.closest))return e.closest(t);var r=e.matches||e.webkitMatchesSelector||e.msMatchesSelector||e.mozMatchesSelector;if(r)for(;e&&1===e.nodeType;e=e.parentElement||e.parentNode)if(r.call(e,t))return e}return null}exports.closest=closest;function closestClass(e,t){return closest(e,"."+t)}exports.closestClass=closestClass;function enable(e,t){var r=!t,n="disabled";toggleClass(e,exports.ControlStateClsNames.disabled,r);setAttribute(e,n,r?n:null);for(var i=e.querySelectorAll("input,button"),o=0;o<i.length;o++)setAttribute(i[o],n,r?n:null)}exports.enable=enable;function getElementRect(e){var t=e.getBoundingClientRect();return new Rect(t.left+pageXOffset,t.top+pageYOffset,t.width,t.height)}exports.getElementRect=getElementRect;function setCss(e,t){assert(isObject(t),"css parameter should be an object");if(e instanceof Array)for(var r=0;r<e.length;r++)setCss(e[r],t);else if(e&&e.style){var n=e.style;for(var i in t){var o=t[i];"number"==typeof o&&i.match(/width|height|left|top|right|bottom|size|padding|margin'/i)&&(o+="px");n[i]!==o&&(n[i]=o)}}}exports.setCss=setCss;function animate(e,t,r,n){null==t&&(t=Control._ANIM_DEF_DURATION);null==r&&(r=Control._ANIM_DEF_STEP);e=asFunction(e);t=asNumber(t,!1,!0);r=asNumber(r,!1,!0);var i,o=Date.now(),s=setInterval((function(){var r=Math.min(1,(Date.now()-o)/t);r=Math.sin(r*Math.PI/2);r*=r;i&&cancelAnimationFrame(i);i=requestAnimationFrame((function(){i=null;e(r);r>=1&&n&&n()}));r>=1&&clearInterval(s)}),r);return s}exports.animate=animate;var Point=function(){function Point(e,t){void 0===e&&(e=0);void 0===t&&(t=0);this.x=asNumber(e);this.y=asNumber(t)}Point.prototype.equals=function(e,t,r){void 0===t&&(t=0);void 0===r&&(r=0);return e instanceof Point&&Math.abs(this.x-e.x)<=t&&Math.abs(this.y-e.y)<=r};Point.prototype.clone=function(){return new Point(this.x,this.y)};return Point}();exports.Point=Point;var Size=function(){function Size(e,t){void 0===e&&(e=0);void 0===t&&(t=0);this.width=asNumber(e);this.height=asNumber(t)}Size.prototype.equals=function(e){return e instanceof Size&&this.width==e.width&&this.height==e.height};Size.prototype.clone=function(){return new Size(this.width,this.height)};return Size}();exports.Size=Size;var Rect=function(){function Rect(e,t,r,n){this.left=asNumber(e);this.top=asNumber(t);this.width=asNumber(r);this.height=asNumber(n)}Object.defineProperty(Rect.prototype,"right",{get:function(){return this.left+this.width},enumerable:!0,configurable:!0});Object.defineProperty(Rect.prototype,"bottom",{get:function(){return this.top+this.height},enumerable:!0,configurable:!0});Rect.prototype.equals=function(e){return e instanceof Rect&&this.left==e.l