@schukai/monster 1.29.0 → 1.29.1

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.
Files changed (187) hide show
  1. package/CHANGELOG +7 -2
  2. package/README.md +3 -3
  3. package/dist/modules/constants.js +1 -1
  4. package/dist/modules/constraints/abstract.js +1 -1
  5. package/dist/modules/constraints/abstractoperator.js +1 -1
  6. package/dist/modules/constraints/andoperator.js +1 -1
  7. package/dist/modules/constraints/invalid.js +1 -1
  8. package/dist/modules/constraints/isarray.js +1 -1
  9. package/dist/modules/constraints/isobject.js +1 -1
  10. package/dist/modules/constraints/namespace.js +1 -1
  11. package/dist/modules/constraints/oroperator.js +1 -1
  12. package/dist/modules/constraints/valid.js +1 -1
  13. package/dist/modules/data/buildmap.js +1 -1
  14. package/dist/modules/data/buildtree.js +1 -1
  15. package/dist/modules/data/datasource/namespace.js +1 -1
  16. package/dist/modules/data/datasource/restapi/writeerror.js +1 -1
  17. package/dist/modules/data/datasource/restapi.js +1 -1
  18. package/dist/modules/data/datasource/storage/localstorage.js +1 -1
  19. package/dist/modules/data/datasource/storage/namespace.js +1 -1
  20. package/dist/modules/data/datasource/storage/sessionstorage.js +1 -1
  21. package/dist/modules/data/datasource/storage.js +1 -1
  22. package/dist/modules/data/datasource.js +1 -1
  23. package/dist/modules/data/diff.js +1 -1
  24. package/dist/modules/data/extend.js +1 -1
  25. package/dist/modules/data/namespace.js +1 -1
  26. package/dist/modules/data/pathfinder.js +1 -1
  27. package/dist/modules/data/pipe.js +1 -1
  28. package/dist/modules/data/transformer.js +1 -1
  29. package/dist/modules/dom/assembler.js +1 -1
  30. package/dist/modules/dom/attributes.js +1 -1
  31. package/dist/modules/dom/constants.js +1 -1
  32. package/dist/modules/dom/customcontrol.js +1 -1
  33. package/dist/modules/dom/customelement.js +1 -1
  34. package/dist/modules/dom/events.js +1 -1
  35. package/dist/modules/dom/focusmanager.js +1 -1
  36. package/dist/modules/dom/locale.js +1 -1
  37. package/dist/modules/dom/namespace.js +1 -1
  38. package/dist/modules/dom/resource/data.js +1 -1
  39. package/dist/modules/dom/resource/link/stylesheet.js +1 -1
  40. package/dist/modules/dom/resource/link.js +1 -1
  41. package/dist/modules/dom/resource/script.js +1 -1
  42. package/dist/modules/dom/resource.js +1 -1
  43. package/dist/modules/dom/resourcemanager.js +1 -1
  44. package/dist/modules/dom/template.js +1 -1
  45. package/dist/modules/dom/theme.js +1 -1
  46. package/dist/modules/dom/updater.js +2 -2
  47. package/dist/modules/dom/util.js +1 -1
  48. package/dist/modules/dom/worker/factory.js +1 -1
  49. package/dist/modules/i18n/formatter.js +1 -1
  50. package/dist/modules/i18n/locale.js +1 -1
  51. package/dist/modules/i18n/namespace.js +1 -1
  52. package/dist/modules/i18n/provider.js +1 -1
  53. package/dist/modules/i18n/providers/fetch.js +1 -1
  54. package/dist/modules/i18n/providers/namespace.js +1 -1
  55. package/dist/modules/i18n/translations.js +1 -1
  56. package/dist/modules/logging/handler/console.js +1 -1
  57. package/dist/modules/logging/handler/namespace.js +1 -1
  58. package/dist/modules/logging/handler.js +1 -1
  59. package/dist/modules/logging/logentry.js +1 -1
  60. package/dist/modules/logging/logger.js +1 -1
  61. package/dist/modules/logging/namespace.js +1 -1
  62. package/dist/modules/math/namespace.js +1 -1
  63. package/dist/modules/math/random.js +1 -1
  64. package/dist/modules/monster.js +1 -1
  65. package/dist/modules/namespace.js +1 -1
  66. package/dist/modules/text/formatter.js +1 -1
  67. package/dist/modules/text/namespace.js +1 -1
  68. package/dist/modules/types/base.js +1 -1
  69. package/dist/modules/types/basewithoptions.js +1 -1
  70. package/dist/modules/types/binary.js +1 -1
  71. package/dist/modules/types/dataurl.js +1 -1
  72. package/dist/modules/types/global.js +1 -1
  73. package/dist/modules/types/id.js +1 -1
  74. package/dist/modules/types/is.js +1 -1
  75. package/dist/modules/types/mediatype.js +1 -1
  76. package/dist/modules/types/namespace.js +1 -1
  77. package/dist/modules/types/node.js +1 -1
  78. package/dist/modules/types/nodelist.js +1 -1
  79. package/dist/modules/types/noderecursiveiterator.js +1 -1
  80. package/dist/modules/types/observer.js +1 -1
  81. package/dist/modules/types/observerlist.js +1 -1
  82. package/dist/modules/types/proxyobserver.js +1 -1
  83. package/dist/modules/types/queue.js +1 -1
  84. package/dist/modules/types/randomid.js +1 -1
  85. package/dist/modules/types/regex.js +1 -1
  86. package/dist/modules/types/stack.js +1 -1
  87. package/dist/modules/types/tokenlist.js +1 -1
  88. package/dist/modules/types/typeof.js +1 -1
  89. package/dist/modules/types/uniquequeue.js +1 -1
  90. package/dist/modules/types/uuid.js +1 -1
  91. package/dist/modules/types/validate.js +1 -1
  92. package/dist/modules/types/version.js +2 -2
  93. package/dist/modules/util/clone.js +1 -1
  94. package/dist/modules/util/comparator.js +1 -1
  95. package/dist/modules/util/deadmansswitch.js +1 -1
  96. package/dist/modules/util/freeze.js +1 -1
  97. package/dist/modules/util/namespace.js +1 -1
  98. package/dist/modules/util/processing.js +1 -1
  99. package/dist/modules/util/trimspaces.js +1 -1
  100. package/dist/monster.dev.js +356 -280
  101. package/dist/monster.dev.js.map +1 -1
  102. package/dist/monster.js +2 -2
  103. package/package.json +1 -1
  104. package/source/constraints/andoperator.js +5 -5
  105. package/source/constraints/invalid.js +3 -3
  106. package/source/constraints/isarray.js +3 -3
  107. package/source/constraints/isobject.js +3 -3
  108. package/source/constraints/oroperator.js +5 -5
  109. package/source/constraints/valid.js +3 -3
  110. package/source/data/buildmap.js +4 -4
  111. package/source/data/buildtree.js +2 -2
  112. package/source/data/datasource/restapi.js +3 -3
  113. package/source/data/datasource/storage/localstorage.js +2 -2
  114. package/source/data/datasource/storage/sessionstorage.js +2 -2
  115. package/source/data/datasource/storage.js +3 -3
  116. package/source/data/datasource.js +3 -3
  117. package/source/data/diff.js +3 -3
  118. package/source/data/extend.js +2 -2
  119. package/source/data/pathfinder.js +4 -4
  120. package/source/data/pipe.js +3 -3
  121. package/source/data/transformer.js +3 -3
  122. package/source/dom/assembler.js +2 -2
  123. package/source/dom/attributes.js +26 -26
  124. package/source/dom/customcontrol.js +1 -1
  125. package/source/dom/customelement.js +1 -1
  126. package/source/dom/events.js +6 -6
  127. package/source/dom/focusmanager.js +2 -2
  128. package/source/dom/locale.js +2 -2
  129. package/source/dom/resource/data.js +2 -2
  130. package/source/dom/resource/link/stylesheet.js +2 -2
  131. package/source/dom/resource/link.js +2 -2
  132. package/source/dom/resource/script.js +2 -2
  133. package/source/dom/resource.js +2 -2
  134. package/source/dom/resourcemanager.js +2 -2
  135. package/source/dom/template.js +5 -5
  136. package/source/dom/theme.js +3 -3
  137. package/source/dom/updater.js +25 -17
  138. package/source/dom/util.js +6 -6
  139. package/source/dom/worker/factory.js +2 -2
  140. package/source/i18n/formatter.js +4 -4
  141. package/source/i18n/locale.js +4 -4
  142. package/source/i18n/provider.js +2 -2
  143. package/source/i18n/providers/fetch.js +3 -3
  144. package/source/i18n/translations.js +4 -4
  145. package/source/logging/handler/console.js +2 -2
  146. package/source/logging/handler.js +2 -2
  147. package/source/logging/logentry.js +2 -2
  148. package/source/logging/logger.js +2 -2
  149. package/source/math/random.js +2 -2
  150. package/source/namespace.js +1 -1
  151. package/source/text/formatter.js +3 -3
  152. package/source/types/base.js +2 -2
  153. package/source/types/basewithoptions.js +32 -6
  154. package/source/types/binary.js +4 -4
  155. package/source/types/dataurl.js +4 -4
  156. package/source/types/global.js +4 -4
  157. package/source/types/id.js +2 -2
  158. package/source/types/is.js +20 -20
  159. package/source/types/mediatype.js +4 -4
  160. package/source/types/node.js +2 -2
  161. package/source/types/nodelist.js +2 -2
  162. package/source/types/noderecursiveiterator.js +4 -4
  163. package/source/types/observer.js +3 -3
  164. package/source/types/observerlist.js +2 -2
  165. package/source/types/proxyobserver.js +5 -5
  166. package/source/types/queue.js +3 -3
  167. package/source/types/randomid.js +2 -2
  168. package/source/types/regex.js +2 -2
  169. package/source/types/stack.js +2 -2
  170. package/source/types/tokenlist.js +2 -2
  171. package/source/types/typeof.js +3 -3
  172. package/source/types/uniquequeue.js +2 -2
  173. package/source/types/uuid.js +2 -2
  174. package/source/types/validate.js +20 -20
  175. package/source/types/version.js +6 -6
  176. package/source/util/clone.js +2 -2
  177. package/source/util/comparator.js +3 -3
  178. package/source/util/deadmansswitch.js +3 -3
  179. package/source/util/freeze.js +2 -2
  180. package/source/util/processing.js +3 -3
  181. package/source/util/trimspaces.js +2 -2
  182. package/test/cases/dom/updater.js +76 -3
  183. package/test/cases/monster.js +1 -1
  184. package/test/web/monster-dev.html +3 -3
  185. package/test/web/monster.html +2 -2
  186. package/test/web/test.html +2 -2
  187. package/test/web/tests.js +2 -2
package/dist/monster.js CHANGED
@@ -1,2 +1,2 @@
1
- /** Monster 1.29.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- !function webpackUniversalModuleDefinition(root,factory){"object"==typeof exports&&"object"==typeof module?module.exports=factory():"function"==typeof define&&define.amd?define([],factory):"object"==typeof exports?exports.window=factory():root.window=factory()}(self,(function(){return function(){var __webpack_require__={d:function(exports,definition){for(var key in definition)__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports,key)&&Object.defineProperty(exports,key,{enumerable:!0,get:definition[key]})},o:function(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)},r:function(exports){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})}},__webpack_exports__={};function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Monster:function(){return Monster}});var Namespace=function(){function Namespace(namespace){if(function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Namespace),void 0===namespace||"string"!=typeof namespace)throw new Error("namespace is not a string");this.namespace=namespace}return function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Constructor}(Namespace,[{key:"getNamespace",value:function getNamespace(){return this.namespace}},{key:"toString",value:function toString(){return this.getNamespace()}}]),Namespace}(),Monster=new Namespace("Monster");function assignToNamespace(ns){var current=namespaceFor(ns.split("."));if(0==(arguments.length<=1?0:arguments.length-1))throw new Error("no functions have been passed.");for(var i=0,l=arguments.length<=1?0:arguments.length-1;i<l;i++)current[objectName(i+1<1||arguments.length<=i+1?void 0:arguments[i+1])]=i+1<1||arguments.length<=i+1?void 0:arguments[i+1];return current}function objectName(fn){try{if("function"!=typeof fn)throw new Error("the first argument is not a function or class.");if(fn.hasOwnProperty("name"))return fn.name;if("function"==typeof fn.toString){var s=fn.toString(),f=s.match(/^\s*function\s+([^\s(]+)/);if(Array.isArray(f)&&"string"==typeof f[1])return f[1];var c=s.match(/^\s*class\s+([^\s(]+)/);if(Array.isArray(c)&&"string"==typeof c[1])return c[1]}}catch(e){throw new Error("exception "+e)}throw new Error("the name of the class or function cannot be resolved.")}function namespaceFor(parts){for(var space=Monster,ns="Monster",i=0;i<parts.length;i++)"Monster"!==parts[i]&&(ns+="."+parts[i],space.hasOwnProperty(parts[i])||(space[parts[i]]=new Namespace(ns)),space=space[parts[i]]);return space}assignToNamespace("Monster",assignToNamespace,Namespace);var internalSymbol=Symbol("internalData");Symbol("state");function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function base_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function base_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _possibleConstructorReturn(self,call){if(call&&("object"===_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function _wrapNativeSuper(Class){var _cache="function"==typeof Map?new Map:void 0;return(_wrapNativeSuper=function _wrapNativeSuper(Class){if(null===Class||!function _isNativeFunction(fn){return-1!==Function.toString.call(fn).indexOf("[native code]")}(Class))return Class;if("function"!=typeof Class)throw new TypeError("Super expression must either be null or a function");if(void 0!==_cache){if(_cache.has(Class))return _cache.get(Class);_cache.set(Class,Wrapper)}function Wrapper(){return _construct(Class,arguments,_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(Class.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,Class)})(Class)}function _construct(Parent,args,Class){return(_construct=_isNativeReflectConstruct()?Reflect.construct:function _construct(Parent,args,Class){var a=[null];a.push.apply(a,args);var instance=new(Function.bind.apply(Parent,a));return Class&&_setPrototypeOf(instance,Class.prototype),instance}).apply(null,arguments)}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}var Base=function(_Object){!function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_setPrototypeOf(subClass,superClass)}(Base,_Object);var _super=function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var result,Super=_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return _possibleConstructorReturn(this,result)}}(Base);function Base(){return base_classCallCheck(this,Base),_super.apply(this,arguments)}return function base_createClass(Constructor,protoProps,staticProps){return protoProps&&base_defineProperties(Constructor.prototype,protoProps),staticProps&&base_defineProperties(Constructor,staticProps),Constructor}(Base,[{key:"toString",value:function toString(){return JSON.stringify(this)}}]),Base}(_wrapNativeSuper(Object));function abstract_typeof(obj){return(abstract_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function abstract_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function abstract_setPrototypeOf(o,p){return(abstract_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function abstract_createSuper(Derived){var hasNativeReflectConstruct=function abstract_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=abstract_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=abstract_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return abstract_possibleConstructorReturn(this,result)}}function abstract_possibleConstructorReturn(self,call){if(call&&("object"===abstract_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function abstract_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function abstract_getPrototypeOf(o){return(abstract_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",Base);var AbstractConstraint=function(_Base){!function abstract_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&abstract_setPrototypeOf(subClass,superClass)}(AbstractConstraint,_Base);var _super=abstract_createSuper(AbstractConstraint);function AbstractConstraint(){return function abstract_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,AbstractConstraint),_super.call(this)}return function abstract_createClass(Constructor,protoProps,staticProps){return protoProps&&abstract_defineProperties(Constructor.prototype,protoProps),staticProps&&abstract_defineProperties(Constructor,staticProps),Constructor}(AbstractConstraint,[{key:"isValid",value:function isValid(value){return Promise.reject(value)}}]),AbstractConstraint}(Base);function abstractoperator_typeof(obj){return(abstractoperator_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function abstractoperator_setPrototypeOf(o,p){return(abstractoperator_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function abstractoperator_createSuper(Derived){var hasNativeReflectConstruct=function abstractoperator_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=abstractoperator_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=abstractoperator_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return abstractoperator_possibleConstructorReturn(this,result)}}function abstractoperator_possibleConstructorReturn(self,call){if(call&&("object"===abstractoperator_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function abstractoperator_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function abstractoperator_getPrototypeOf(o){return(abstractoperator_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Constraints",AbstractConstraint);var globalReference,AbstractOperator=function(_AbstractConstraint){!function abstractoperator_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&abstractoperator_setPrototypeOf(subClass,superClass)}(AbstractOperator,_AbstractConstraint);var _super=abstractoperator_createSuper(AbstractOperator);function AbstractOperator(operantA,operantB){var _this;if(function abstractoperator_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,AbstractOperator),_this=_super.call(this),!(operantA instanceof AbstractConstraint&&operantB instanceof AbstractConstraint))throw new TypeError("parameters must be from type AbstractConstraint");return _this.operantA=operantA,_this.operantB=operantB,_this}return AbstractOperator}(AbstractConstraint);function andoperator_typeof(obj){return(andoperator_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function andoperator_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function andoperator_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function andoperator_setPrototypeOf(o,p){return(andoperator_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function andoperator_createSuper(Derived){var hasNativeReflectConstruct=function andoperator_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=andoperator_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=andoperator_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return andoperator_possibleConstructorReturn(this,result)}}function andoperator_possibleConstructorReturn(self,call){if(call&&("object"===andoperator_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function andoperator_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function andoperator_getPrototypeOf(o){return(andoperator_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function invalid_typeof(obj){return(invalid_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function invalid_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function invalid_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function invalid_setPrototypeOf(o,p){return(invalid_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function invalid_createSuper(Derived){var hasNativeReflectConstruct=function invalid_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=invalid_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=invalid_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return invalid_possibleConstructorReturn(this,result)}}function invalid_possibleConstructorReturn(self,call){if(call&&("object"===invalid_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function invalid_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function invalid_getPrototypeOf(o){return(invalid_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function is_typeof(obj){return(is_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function isIterable(value){return void 0!==value&&(null!==value&&"function"==typeof(null==value?void 0:value[Symbol.iterator]))}function isPrimitive(value){var type;return null==value||("string"===(type=is_typeof(value))||"number"===type||"boolean"===type||"symbol"===type)}function isSymbol(value){return"symbol"===is_typeof(value)}function isBoolean(value){return!0===value||!1===value}function isString(value){return void 0!==value&&"string"==typeof value}function isObject(value){return!isArray(value)&&(!isPrimitive(value)&&"object"===is_typeof(value))}function isInstance(value,instance){return!!isObject(value)&&(!!isFunction(instance)&&(!!instance.hasOwnProperty("prototype")&&value instanceof instance))}function isArray(value){return Array.isArray(value)}function isFunction(value){return!isArray(value)&&(!isPrimitive(value)&&"function"==typeof value)}function isInteger(value){return Number.isInteger(value)}function isarray_typeof(obj){return(isarray_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function isarray_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function isarray_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function isarray_setPrototypeOf(o,p){return(isarray_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function isarray_createSuper(Derived){var hasNativeReflectConstruct=function isarray_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=isarray_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=isarray_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return isarray_possibleConstructorReturn(this,result)}}function isarray_possibleConstructorReturn(self,call){if(call&&("object"===isarray_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function isarray_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function isarray_getPrototypeOf(o){return(isarray_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function isobject_typeof(obj){return(isobject_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function isobject_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function isobject_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function isobject_setPrototypeOf(o,p){return(isobject_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function isobject_createSuper(Derived){var hasNativeReflectConstruct=function isobject_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=isobject_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=isobject_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return isobject_possibleConstructorReturn(this,result)}}function isobject_possibleConstructorReturn(self,call){if(call&&("object"===isobject_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function isobject_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function isobject_getPrototypeOf(o){return(isobject_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function oroperator_typeof(obj){return(oroperator_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function oroperator_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function oroperator_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function oroperator_setPrototypeOf(o,p){return(oroperator_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function oroperator_createSuper(Derived){var hasNativeReflectConstruct=function oroperator_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=oroperator_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=oroperator_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return oroperator_possibleConstructorReturn(this,result)}}function oroperator_possibleConstructorReturn(self,call){if(call&&("object"===oroperator_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function oroperator_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function oroperator_getPrototypeOf(o){return(oroperator_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function valid_typeof(obj){return(valid_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function valid_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function valid_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function valid_setPrototypeOf(o,p){return(valid_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function valid_createSuper(Derived){var hasNativeReflectConstruct=function valid_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=valid_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=valid_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return valid_possibleConstructorReturn(this,result)}}function valid_possibleConstructorReturn(self,call){if(call&&("object"===valid_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function valid_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function valid_getPrototypeOf(o){return(valid_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function validatePrimitive(value){if(!isPrimitive(value))throw new TypeError("value is not a primitive");return value}function validateBoolean(value){if(!isBoolean(value))throw new TypeError("value is not a boolean");return value}function validateString(value){if(!isString(value))throw new TypeError("value is not a string");return value}function validateObject(value){if(!isObject(value))throw new TypeError("value is not a object");return value}function validateInstance(value,instance){if(!isInstance(value,instance)){var n="";throw(isObject(instance)||isFunction(instance))&&(n=null==instance?void 0:instance.name),n&&(n=" "+n),new TypeError("value is not an instance of"+n)}return value}function validateArray(value){if(!isArray(value))throw new TypeError("value is not an array");return value}function validateSymbol(value){if(!isSymbol(value))throw new TypeError("value is not an symbol");return value}function validateFunction(value){if(!isFunction(value))throw new TypeError("value is not a function");return value}function validateInteger(value){if(!isInteger(value))throw new TypeError("value is not an integer");return value}function global_typeof(obj){return(global_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function getGlobal(){return globalReference}function getGlobalObject(name){var _globalReference;validateString(name);var o=null===(_globalReference=globalReference)||void 0===_globalReference?void 0:_globalReference[name];if(void 0===o)throw new Error("the object "+name+" is not defined");return validateObject(o),o}function getGlobalFunction(name){var _globalReference2;validateString(name);var f=null===(_globalReference2=globalReference)||void 0===_globalReference2?void 0:_globalReference2[name];if(void 0===f)throw new Error("the function "+name+" is not defined");return validateFunction(f),f}function typeOf(value){var type={}.toString.call(value).match(/\s([a-zA-Z]+)/)[1];if("Object"===type){var results=/^(class|function)\s+(\w+)/.exec(value.constructor.toString());type=results&&results.length>2?results[2]:""}return type.toLowerCase()}function clone_typeof(obj){return(clone_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function clone(obj){if(null===obj)return obj;if(isPrimitive(obj))return obj;if(isFunction(obj))return obj;if(isArray(obj)){for(var copy=[],i=0,len=obj.length;i<len;i++)copy[i]=clone(obj[i]);return copy}if(isObject(obj)){if(obj instanceof Date){var _copy=new Date;return _copy.setTime(obj.getTime()),_copy}if("undefined"!=typeof Element&&obj instanceof Element)return obj;if("undefined"!=typeof HTMLDocument&&obj instanceof HTMLDocument)return obj;if("undefined"!=typeof DocumentFragment&&obj instanceof DocumentFragment)return obj;if(obj===getGlobal())return obj;if("undefined"!=typeof globalContext&&obj===globalContext)return obj;if("undefined"!=typeof window&&obj===window)return obj;if("undefined"!=typeof document&&obj===document)return obj;if("undefined"!=typeof navigator&&obj===navigator)return obj;if("undefined"!=typeof JSON&&obj===JSON)return obj;try{if(obj instanceof Proxy)return obj}catch(e){}return function cloneObject(obj){validateObject(obj);var constructor=null==obj?void 0:obj.constructor;if("function"===typeOf(constructor)){var prototype=null==constructor?void 0:constructor.prototype;if("object"===clone_typeof(prototype)&&prototype.hasOwnProperty("getClone")&&"function"===typeOf(obj.getClone))return obj.getClone()}var copy={};"function"==typeof obj.constructor&&"function"==typeof obj.constructor.call&&(copy=new obj.constructor);for(var key in obj)obj.hasOwnProperty(key)&&(isPrimitive(obj[key])?copy[key]=obj[key]:copy[key]=clone(obj[key]));return copy}(obj)}throw new Error("unable to clone obj! its type isn't supported.")}function stack_typeof(obj){return(stack_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function stack_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function stack_setPrototypeOf(o,p){return(stack_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function stack_createSuper(Derived){var hasNativeReflectConstruct=function stack_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=stack_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=stack_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return stack_possibleConstructorReturn(this,result)}}function stack_possibleConstructorReturn(self,call){if(call&&("object"===stack_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function stack_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function stack_getPrototypeOf(o){return(stack_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Constraints",AbstractOperator),assignToNamespace("Monster.Constraints",function(_AbstractOperator){!function andoperator_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&andoperator_setPrototypeOf(subClass,superClass)}(AndOperator,_AbstractOperator);var _super=andoperator_createSuper(AndOperator);function AndOperator(){return andoperator_classCallCheck(this,AndOperator),_super.apply(this,arguments)}return function andoperator_createClass(Constructor,protoProps,staticProps){return protoProps&&andoperator_defineProperties(Constructor.prototype,protoProps),staticProps&&andoperator_defineProperties(Constructor,staticProps),Constructor}(AndOperator,[{key:"isValid",value:function isValid(value){return Promise.all([this.operantA.isValid(value),this.operantB.isValid(value)])}}]),AndOperator}(AbstractOperator)),assignToNamespace("Monster.Constraints",function(_AbstractConstraint){!function invalid_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&invalid_setPrototypeOf(subClass,superClass)}(Invalid,_AbstractConstraint);var _super=invalid_createSuper(Invalid);function Invalid(){return invalid_classCallCheck(this,Invalid),_super.apply(this,arguments)}return function invalid_createClass(Constructor,protoProps,staticProps){return protoProps&&invalid_defineProperties(Constructor.prototype,protoProps),staticProps&&invalid_defineProperties(Constructor,staticProps),Constructor}(Invalid,[{key:"isValid",value:function isValid(value){return Promise.reject(value)}}]),Invalid}(AbstractConstraint)),assignToNamespace("Monster.Types",isPrimitive,isBoolean,isString,isObject,isArray,isFunction,isIterable,isInteger,isSymbol),assignToNamespace("Monster.Constraints",function(_AbstractConstraint){!function isarray_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&isarray_setPrototypeOf(subClass,superClass)}(IsArray,_AbstractConstraint);var _super=isarray_createSuper(IsArray);function IsArray(){return isarray_classCallCheck(this,IsArray),_super.apply(this,arguments)}return function isarray_createClass(Constructor,protoProps,staticProps){return protoProps&&isarray_defineProperties(Constructor.prototype,protoProps),staticProps&&isarray_defineProperties(Constructor,staticProps),Constructor}(IsArray,[{key:"isValid",value:function isValid(value){return isArray(value)?Promise.resolve(value):Promise.reject(value)}}]),IsArray}(AbstractConstraint)),assignToNamespace("Monster.Constraints",function(_AbstractConstraint){!function isobject_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&isobject_setPrototypeOf(subClass,superClass)}(IsObject,_AbstractConstraint);var _super=isobject_createSuper(IsObject);function IsObject(){return isobject_classCallCheck(this,IsObject),_super.apply(this,arguments)}return function isobject_createClass(Constructor,protoProps,staticProps){return protoProps&&isobject_defineProperties(Constructor.prototype,protoProps),staticProps&&isobject_defineProperties(Constructor,staticProps),Constructor}(IsObject,[{key:"isValid",value:function isValid(value){return isObject(value)?Promise.resolve(value):Promise.reject(value)}}]),IsObject}(AbstractConstraint)),assignToNamespace("Monster.Constraints",function(_AbstractOperator){!function oroperator_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&oroperator_setPrototypeOf(subClass,superClass)}(OrOperator,_AbstractOperator);var _super=oroperator_createSuper(OrOperator);function OrOperator(){return oroperator_classCallCheck(this,OrOperator),_super.apply(this,arguments)}return function oroperator_createClass(Constructor,protoProps,staticProps){return protoProps&&oroperator_defineProperties(Constructor.prototype,protoProps),staticProps&&oroperator_defineProperties(Constructor,staticProps),Constructor}(OrOperator,[{key:"isValid",value:function isValid(value){var self=this;return new Promise((function(resolve,reject){var a,b;self.operantA.isValid(value).then((function(){resolve()})).catch((function(){a=!1,!1===b&&reject()})),self.operantB.isValid(value).then((function(){resolve()})).catch((function(){b=!1,!1===a&&reject()}))}))}}]),OrOperator}(AbstractOperator)),assignToNamespace("Monster.Constraints",function(_AbstractConstraint){!function valid_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&valid_setPrototypeOf(subClass,superClass)}(Valid,_AbstractConstraint);var _super=valid_createSuper(Valid);function Valid(){return valid_classCallCheck(this,Valid),_super.apply(this,arguments)}return function valid_createClass(Constructor,protoProps,staticProps){return protoProps&&valid_defineProperties(Constructor.prototype,protoProps),staticProps&&valid_defineProperties(Constructor,staticProps),Constructor}(Valid,[{key:"isValid",value:function isValid(value){return Promise.resolve(value)}}]),Valid}(AbstractConstraint)),assignToNamespace("Monster.Types",validatePrimitive,validateBoolean,validateString,validateObject,validateArray,validateFunction,(function validateIterable(value){if(!isIterable(value))throw new TypeError("value is not iterable");return value}),validateInteger),function(){if("object"!==("undefined"==typeof globalThis?"undefined":global_typeof(globalThis)))if("undefined"==typeof self){if("undefined"==typeof window){if(Object.defineProperty(Object.prototype,"__monster__",{get:function get(){return this},configurable:!0}),"object"===("undefined"==typeof __monster__?"undefined":global_typeof(__monster__)))return __monster__.globalThis=__monster__,delete Object.prototype.__monster__,void(globalReference=globalThis);try{globalReference=Function("return this")()}catch(e){}throw new Error("unsupported environment.")}globalReference=window}else globalReference=self;else globalReference=globalThis}(),assignToNamespace("Monster.Types",getGlobal,getGlobalObject,getGlobalFunction),assignToNamespace("Monster.Types",typeOf),assignToNamespace("Monster.Util",clone);var Stack=function(_Base){!function stack_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&stack_setPrototypeOf(subClass,superClass)}(Stack,_Base);var _super=stack_createSuper(Stack);function Stack(){var _this;return function stack_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Stack),(_this=_super.call(this)).data=[],_this}return function stack_createClass(Constructor,protoProps,staticProps){return protoProps&&stack_defineProperties(Constructor.prototype,protoProps),staticProps&&stack_defineProperties(Constructor,staticProps),Constructor}(Stack,[{key:"isEmpty",value:function isEmpty(){return 0===this.data.length}},{key:"peek",value:function peek(){var _this$data;if(!this.isEmpty())return null===(_this$data=this.data)||void 0===_this$data?void 0:_this$data[this.data.length-1]}},{key:"push",value:function push(value){return this.data.push(value),this}},{key:"clear",value:function clear(){return this.data=[],this}},{key:"pop",value:function pop(){if(!this.isEmpty())return this.data.pop()}}]),Stack}(Base);function pathfinder_typeof(obj){return(pathfinder_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function _toConsumableArray(arr){return function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}(arr)||function _iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||_unsupportedIterableToArray(arr)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _slicedToArray(arr,i){return function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function _iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||_unsupportedIterableToArray(arr,i)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(o,minLen):void 0}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function pathfinder_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function pathfinder_setPrototypeOf(o,p){return(pathfinder_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function pathfinder_createSuper(Derived){var hasNativeReflectConstruct=function pathfinder_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=pathfinder_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=pathfinder_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return pathfinder_possibleConstructorReturn(this,result)}}function pathfinder_possibleConstructorReturn(self,call){if(call&&("object"===pathfinder_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function pathfinder_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function pathfinder_getPrototypeOf(o){return(pathfinder_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",Stack);var Pathfinder=function(_Base){!function pathfinder_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&pathfinder_setPrototypeOf(subClass,superClass)}(Pathfinder,_Base);var _super=pathfinder_createSuper(Pathfinder);function Pathfinder(object){var _this;if(function pathfinder_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Pathfinder),_this=_super.call(this),isPrimitive(object))throw new Error("the parameter must not be a simple type");return _this.object=object,_this.wildCard="*",_this}return function pathfinder_createClass(Constructor,protoProps,staticProps){return protoProps&&pathfinder_defineProperties(Constructor.prototype,protoProps),staticProps&&pathfinder_defineProperties(Constructor,staticProps),Constructor}(Pathfinder,[{key:"setWildCard",value:function setWildCard(wildcard){return validateString(wildcard),this.wildCard=wildcard,this}},{key:"getVia",value:function getVia(path){return getValueViaPath.call(this,this.object,validateString(path))}},{key:"setVia",value:function setVia(path,value){return validateString(path),setValueViaPath.call(this,this.object,path,value),this}},{key:"deleteVia",value:function deleteVia(path){return validateString(path),deleteValueViaPath.call(this,this.object,path),this}},{key:"exists",value:function exists(path){validateString(path);try{return getValueViaPath.call(this,this.object,path,!0),!0}catch(e){}return!1}}]),Pathfinder}(Base);function iterate(subject,path,check){var result=new Map;if(isObject(subject)||isArray(subject))for(var _i=0,_Object$entries=Object.entries(subject);_i<_Object$entries.length;_i++){var _Object$entries$_i=_slicedToArray(_Object$entries[_i],2),key=_Object$entries$_i[0],value=_Object$entries$_i[1];result.set(key,getValueViaPath.call(this,value,path,check))}else{var _key=path.split(".").shift();result.set(_key,getValueViaPath.call(this,subject,path,check))}return result}function getValueViaPath(subject,path,check){if(""===path)return subject;var parts=path.split("."),current=parts.shift();if(current===this.wildCard)return iterate.call(this,subject,parts.join("."),check);if(isObject(subject)||isArray(subject)){var anchor;if(subject instanceof Map||subject instanceof WeakMap)anchor=subject.get(current);else if(subject instanceof Set||subject instanceof WeakSet){var _ref;validateInteger(current=parseInt(current)),anchor=null===(_ref=_toConsumableArray(subject))||void 0===_ref?void 0:_ref[current]}else{if("function"==typeof WeakRef&&subject instanceof WeakRef)throw Error("unsupported action for this data type");isArray(subject)?(validateInteger(current=parseInt(current)),anchor=null==subject?void 0:subject[current]):anchor=null==subject?void 0:subject[current]}if(isObject(anchor)||isArray(anchor))return getValueViaPath.call(this,anchor,parts.join("."),check);if(parts.length>0)throw Error("the journey is not at its end ("+parts.join(".")+")");if(!0===check){var descriptor=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(subject),current);if(!subject.hasOwnProperty(current)&&void 0===descriptor)throw Error("unknown value")}return anchor}throw TypeError("unsupported type "+pathfinder_typeof(subject))}function setValueViaPath(object,path,value){validateString(path);for(var parts=path.split("."),last=parts.pop(),subpath=parts.join("."),stack=new Stack,current=subpath;;){try{getValueViaPath.call(this,object,current,!0);break}catch(e){}if(stack.push(current),parts.pop(),""===(current=parts.join(".")))break}for(;!stack.isEmpty();){current=stack.pop();var obj={};if(!stack.isEmpty()){var n=stack.peek().split(".").pop();isInteger(parseInt(n))&&(obj=[])}setValueViaPath.call(this,object,current,obj)}var anchor=getValueViaPath.call(this,object,subpath);if(!isObject(object)&&!isArray(object))throw TypeError("unsupported type: "+pathfinder_typeof(object));if(anchor instanceof Map||anchor instanceof WeakMap)anchor.set(last,value);else if(anchor instanceof Set||anchor instanceof WeakSet)anchor.append(value);else{if("function"==typeof WeakRef&&anchor instanceof WeakRef)throw Error("unsupported action for this data type");isArray(anchor)?(validateInteger(last=parseInt(last)),assignProperty(anchor,last,value)):assignProperty(anchor,last,value)}}function assignProperty(object,key,value){object.hasOwnProperty(key)?(void 0===value&&delete object[key],object[key]=value):object[key]=value}function deleteValueViaPath(object,path){var parts=path.split("."),last=parts.pop(),subpath=parts.join("."),anchor=getValueViaPath.call(this,object,subpath);if(anchor instanceof Map)anchor.delete(last);else{if(anchor instanceof Set||anchor instanceof WeakMap||anchor instanceof WeakSet||"function"==typeof WeakRef&&anchor instanceof WeakRef)throw Error("unsupported action for this data type");isArray(anchor)?(validateInteger(last=parseInt(last)),delete anchor[last]):delete anchor[last]}}function buildmap_typeof(obj){return(buildmap_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function buildmap_toConsumableArray(arr){return function buildmap_arrayWithoutHoles(arr){if(Array.isArray(arr))return buildmap_arrayLikeToArray(arr)}(arr)||function buildmap_iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||buildmap_unsupportedIterableToArray(arr)||function buildmap_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _wrapRegExp(){_wrapRegExp=function _wrapRegExp(re,groups){return new BabelRegExp(re,void 0,groups)};var _super=RegExp.prototype,_groups=new WeakMap;function BabelRegExp(re,flags,groups){var _this=new RegExp(re,flags);return _groups.set(_this,groups||_groups.get(re)),buildmap_setPrototypeOf(_this,BabelRegExp.prototype)}function buildGroups(result,re){var g=_groups.get(re);return Object.keys(g).reduce((function(groups,name){return groups[name]=result[g[name]],groups}),Object.create(null))}return buildmap_inherits(BabelRegExp,RegExp),BabelRegExp.prototype.exec=function(str){var result=_super.exec.call(this,str);return result&&(result.groups=buildGroups(result,this)),result},BabelRegExp.prototype[Symbol.replace]=function(str,substitution){if("string"==typeof substitution){var groups=_groups.get(this);return _super[Symbol.replace].call(this,str,substitution.replace(/\$<([^>]+)>/g,(function(_,name){return"$"+groups[name]})))}if("function"==typeof substitution){var _this=this;return _super[Symbol.replace].call(this,str,(function(){var args=arguments;return"object"!==buildmap_typeof(args[args.length-1])&&(args=[].slice.call(args)).push(buildGroups(args,_this)),substitution.apply(this,args)}))}return _super[Symbol.replace].call(this,str,substitution)},_wrapRegExp.apply(this,arguments)}function buildmap_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&buildmap_setPrototypeOf(subClass,superClass)}function buildmap_setPrototypeOf(o,p){return(buildmap_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function buildmap_slicedToArray(arr,i){return function buildmap_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function buildmap_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||buildmap_unsupportedIterableToArray(arr,i)||function buildmap_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=buildmap_unsupportedIterableToArray(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e2){throw _e2},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e3){didErr=!0,err=_e3},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function buildmap_unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return buildmap_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?buildmap_arrayLikeToArray(o,minLen):void 0}}function buildmap_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function buildFlatMap(subject,selector,key,parentMap){var result=this,currentMap=new Map,resultLength=result.size;void 0===key&&(key=[]);var parts=selector.split("."),current="",currentPath=[];do{if(current=parts.shift(),currentPath.push(current),"*"===current){var finder=new Pathfinder(subject),map=void 0;try{map=finder.getVia(currentPath.join("."))}catch(e){map=new Map}var _step,_iterator=_createForOfIteratorHelper(map);try{var _loop=function _loop(){var _step$value=buildmap_slicedToArray(_step.value,2),k=_step$value[0],o=_step$value[1],copyKey=clone(key);currentPath.map((function(a){copyKey.push("*"===a?k:a)}));var kk=copyKey.join("."),sub=buildFlatMap.call(result,o,parts.join("."),copyKey,o);isObject(sub)&&void 0!==parentMap&&(sub["^"]=parentMap),currentMap.set(kk,sub)};for(_iterator.s();!(_step=_iterator.n()).done;)_loop()}catch(err){_iterator.e(err)}finally{_iterator.f()}}}while(parts.length>0);if(resultLength===result.size){var _step2,_iterator2=_createForOfIteratorHelper(currentMap);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _step2$value=buildmap_slicedToArray(_step2.value,2),k=_step2$value[0],o=_step2$value[1];result.set(k,o)}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}return subject}function build(subject,definition,defaultValue){if(void 0===definition)return defaultValue||subject;validateString(definition);var regexp=_wrapRegExp(/(\$\{([\x2D\.0-9A-Z\^_a-z]*)\})/gm,{placeholder:1,path:2}),array=buildmap_toConsumableArray(definition.matchAll(regexp)),finder=new Pathfinder(subject);return 0===array.length?finder.getVia(definition):(array.forEach((function(a){var groups=null==a?void 0:a.groups,placeholder=null==groups?void 0:groups.placeholder;if(void 0!==placeholder){var path=null==groups?void 0:groups.path,v=finder.getVia(path);void 0===v&&(v=defaultValue),definition=definition.replaceAll(placeholder,v)}})),definition)}function diff_typeof(obj){return(diff_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function diff(first,second){return doDiff(first,second)}function doDiff(a,b,path,diff){var typeA=typeOf(a),typeB=typeOf(b),currPath=path||[],currDiff=diff||[];if(typeA!==typeB||"object"!==typeA&&"array"!==typeA){var o=function getOperator(a,b){var operator,typeA=diff_typeof(a),typeB=diff_typeof(b);"undefined"===typeA&&"undefined"!==typeB?operator="add":"undefined"!==typeA&&"undefined"===typeB?operator="delete":function isNotEqual(a,b){if(diff_typeof(a)!==diff_typeof(b))return!0;if(a instanceof Date&&b instanceof Date)return a.getTime()!==b.getTime();return a!==b}(a,b)&&(operator="update");return operator}(a,b);void 0!==o&&currDiff.push(buildResult(a,b,o,path))}else(function getKeys(a,b,type){if(isArray(type)){var keys=a.length>b.length?new Array(a.length):new Array(b.length);return keys.fill(0),new Set(keys.map((function(_,i){return i})))}return new Set(Object.keys(a).concat(Object.keys(b)))})(a,b,typeA).forEach((function(v){Object.prototype.hasOwnProperty.call(a,v)?Object.prototype.hasOwnProperty.call(b,v)?doDiff(a[v],b[v],currPath.concat(v),currDiff):currDiff.push(buildResult(a[v],b[v],"delete",currPath.concat(v))):currDiff.push(buildResult(a[v],b[v],"add",currPath.concat(v)))}));return currDiff}function buildResult(a,b,operator,path){var result={operator:operator,path:path};if("add"!==operator&&(result.first={value:a,type:diff_typeof(a)},isObject(a))){var _Object$getPrototypeO,_Object$getPrototypeO2,name=null===(_Object$getPrototypeO=Object.getPrototypeOf(a))||void 0===_Object$getPrototypeO||null===(_Object$getPrototypeO2=_Object$getPrototypeO.constructor)||void 0===_Object$getPrototypeO2?void 0:_Object$getPrototypeO2.name;void 0!==name&&(result.first.instance=name)}if(("add"===operator||"update"===operator)&&(result.second={value:b,type:diff_typeof(b)},isObject(b))){var _Object$getPrototypeO3,_Object$getPrototypeO4,_name=null===(_Object$getPrototypeO3=Object.getPrototypeOf(b))||void 0===_Object$getPrototypeO3||null===(_Object$getPrototypeO4=_Object$getPrototypeO3.constructor)||void 0===_Object$getPrototypeO4?void 0:_Object$getPrototypeO4.name;void 0!==_name&&(result.second.instance=_name)}return result}function extend(){var o,i;for(i=0;i<arguments.length;i++){var a=arguments[i];if(!isObject(a)&&!isArray(a))throw new Error("unsupported argument "+JSON.stringify(a));if(void 0!==o)for(var k in a){var _o,v=null==a?void 0:a[k];if(v!==(null===(_o=o)||void 0===_o?void 0:_o[k]))if(isObject(v)&&"object"===typeOf(v)||isArray(v)){if(void 0===o[k])isArray(v)?o[k]=[]:o[k]={};else if(typeOf(o[k])!==typeOf(v))throw new Error("type mismatch: "+JSON.stringify(o[k])+"("+typeOf(o[k])+") != "+JSON.stringify(v)+"("+typeOf(v)+")");o[k]=extend(o[k],v)}else o[k]=v}else o=a}return o}function id_typeof(obj){return(id_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function id_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function id_setPrototypeOf(o,p){return(id_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function id_createSuper(Derived){var hasNativeReflectConstruct=function id_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=id_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=id_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return id_possibleConstructorReturn(this,result)}}function id_possibleConstructorReturn(self,call){if(call&&("object"===id_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function id_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function id_getPrototypeOf(o){return(id_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Data",Pathfinder),assignToNamespace("Monster.Data",(function buildMap(subject,selector,valueTemplate,keyTemplate,filter){return function assembleParts(subject,selector,filter,callback){var map,result=new Map;if(isFunction(selector)){if(!((map=selector(subject))instanceof Map))throw new TypeError("the selector callback must return a map")}else{if(!isString(selector))throw new TypeError("selector is neither a string nor a function");map=new Map,buildFlatMap.call(map,subject,selector)}if(!(map instanceof Map))return result;return map.forEach((function(v,k,m){isFunction(filter)&&!0!==filter.call(m,v,k)||callback.call(result,v,k,m)})),result}(subject,selector,filter,(function(v,k,m){k=build(v,keyTemplate,k),v=build(v,valueTemplate),this.set(k,v)}))})),assignToNamespace("Monster.Data",diff),assignToNamespace("Monster.Data",extend);var internalCounter=new Map,ID=function(_Base){!function id_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&id_setPrototypeOf(subClass,superClass)}(ID,_Base);var _super=id_createSuper(ID);function ID(prefix){var _this;!function id_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ID),_this=_super.call(this),void 0===prefix&&(prefix="id"),validateString(prefix),internalCounter.has(prefix)||internalCounter.set(prefix,1);var count=internalCounter.get(prefix);return _this.id=prefix+count,internalCounter.set(prefix,++count),_this}return function id_createClass(Constructor,protoProps,staticProps){return protoProps&&id_defineProperties(Constructor.prototype,protoProps),staticProps&&id_defineProperties(Constructor,staticProps),Constructor}(ID,[{key:"toString",value:function toString(){return this.id}}]),ID}(Base);function transformer_toConsumableArray(arr){return function transformer_arrayWithoutHoles(arr){if(Array.isArray(arr))return transformer_arrayLikeToArray(arr)}(arr)||function transformer_iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||transformer_unsupportedIterableToArray(arr)||function transformer_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function transformer_typeof(obj){return(transformer_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function transformer_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=transformer_unsupportedIterableToArray(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function transformer_unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return transformer_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?transformer_arrayLikeToArray(o,minLen):void 0}}function transformer_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function transformer_wrapRegExp(){transformer_wrapRegExp=function _wrapRegExp(re,groups){return new BabelRegExp(re,void 0,groups)};var _super=RegExp.prototype,_groups=new WeakMap;function BabelRegExp(re,flags,groups){var _this=new RegExp(re,flags);return _groups.set(_this,groups||_groups.get(re)),transformer_setPrototypeOf(_this,BabelRegExp.prototype)}function buildGroups(result,re){var g=_groups.get(re);return Object.keys(g).reduce((function(groups,name){return groups[name]=result[g[name]],groups}),Object.create(null))}return transformer_inherits(BabelRegExp,RegExp),BabelRegExp.prototype.exec=function(str){var result=_super.exec.call(this,str);return result&&(result.groups=buildGroups(result,this)),result},BabelRegExp.prototype[Symbol.replace]=function(str,substitution){if("string"==typeof substitution){var groups=_groups.get(this);return _super[Symbol.replace].call(this,str,substitution.replace(/\$<([^>]+)>/g,(function(_,name){return"$"+groups[name]})))}if("function"==typeof substitution){var _this=this;return _super[Symbol.replace].call(this,str,(function(){var args=arguments;return"object"!==transformer_typeof(args[args.length-1])&&(args=[].slice.call(args)).push(buildGroups(args,_this)),substitution.apply(this,args)}))}return _super[Symbol.replace].call(this,str,substitution)},transformer_wrapRegExp.apply(this,arguments)}function transformer_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function transformer_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&transformer_setPrototypeOf(subClass,superClass)}function transformer_setPrototypeOf(o,p){return(transformer_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function transformer_createSuper(Derived){var hasNativeReflectConstruct=function transformer_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=transformer_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=transformer_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return transformer_possibleConstructorReturn(this,result)}}function transformer_possibleConstructorReturn(self,call){if(call&&("object"===transformer_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function transformer_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function transformer_getPrototypeOf(o){return(transformer_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",ID);var Transformer=function(_Base){transformer_inherits(Transformer,_Base);var _super=transformer_createSuper(Transformer);function Transformer(definition){var _this;return function transformer_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Transformer),(_this=_super.call(this)).args=function disassemble(command){validateString(command);var _step,placeholder=new Map,regex=transformer_wrapRegExp(/((\\(.)){1})/gim,{pattern:2,char:3}),_iterator=transformer_createForOfIteratorHelper(command.matchAll(regex));try{for(_iterator.s();!(_step=_iterator.n()).done;){var m=_step.value,g=null==m?void 0:m.groups;if(isObject(g)){var p=null==g?void 0:g.pattern,c=null==g?void 0:g.char;if(p&&c){var r="__"+(new ID).toString()+"__";placeholder.set(r,c),command=command.replace(p,r)}}}}catch(err){_iterator.e(err)}finally{_iterator.f()}var parts=command.split(":");return parts=parts.map((function(value){var _step2,v=value.trim(),_iterator2=transformer_createForOfIteratorHelper(placeholder);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var k=_step2.value;v=v.replace(k[0],k[1])}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}return v}))}(definition),_this.command=_this.args.shift(),_this.callbacks=new Map,_this}return function transformer_createClass(Constructor,protoProps,staticProps){return protoProps&&transformer_defineProperties(Constructor.prototype,protoProps),staticProps&&transformer_defineProperties(Constructor,staticProps),Constructor}(Transformer,[{key:"setCallback",value:function setCallback(name,callback,context){return validateString(name),validateFunction(callback),void 0!==context&&validateObject(context),this.callbacks.set(name,{callback:callback,context:context}),this}},{key:"run",value:function run(value){return transform.apply(this,[value])}}]),Transformer}(Base);function convertToString(value){return isObject(value)&&value.hasOwnProperty("toString")&&(value=value.toString()),validateString(value),value}function transform(value){var _callback,key,defaultValue,console=getGlobalObject("console"),args=clone(this.args);switch(this.command){case"static":return this.args.join(":");case"tolower":case"strtolower":case"tolowercase":return validateString(value),value.toLowerCase();case"toupper":case"strtoupper":case"touppercase":return validateString(value),value.toUpperCase();case"tostring":return""+value;case"tointeger":var n=parseInt(value);return validateInteger(n),n;case"tojson":return JSON.stringify(value);case"fromjson":return JSON.parse(value);case"trim":return validateString(value),value.trim();case"rawurlencode":return validateString(value),encodeURIComponent(value).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A");case"call":var callback,callbackName=args.shift(),context=getGlobal();if(isObject(value)&&value.hasOwnProperty(callbackName))callback=value[callbackName];else if(this.callbacks.has(callbackName)){var s=this.callbacks.get(callbackName);callback=null==s?void 0:s.callback,context=null==s?void 0:s.context}else"object"===("undefined"==typeof window?"undefined":transformer_typeof(window))&&window.hasOwnProperty(callbackName)&&(callback=window[callbackName]);return validateFunction(callback),args.unshift(value),(_callback=callback).call.apply(_callback,[context].concat(transformer_toConsumableArray(args)));case"plain":case"plaintext":return validateString(value),(new DOMParser).parseFromString(value,"text/html").body.textContent||"";case"if":case"?":validatePrimitive(value);var trueStatement=args.shift()||void 0,falseStatement=args.shift()||void 0;return"value"===trueStatement&&(trueStatement=value),"\\value"===trueStatement&&(trueStatement="value"),"value"===falseStatement&&(falseStatement=value),"\\value"===falseStatement&&(falseStatement="value"),void 0!==value&&""!==value&&"off"!==value&&"false"!==value&&!1!==value||"on"===value||"true"===value||!0===value?trueStatement:falseStatement;case"ucfirst":return validateString(value),value.charAt(0).toUpperCase()+value.substr(1);case"ucwords":return validateString(value),value.replace(/^([a-z\u00E0-\u00FC])|\s+([a-z\u00E0-\u00FC])/g,(function(v){return v.toUpperCase()}));case"count":case"length":if((isString(value)||isObject(value)||isArray(value))&&value.hasOwnProperty("length"))return value.length;throw new TypeError("unsupported type "+transformer_typeof(value));case"to-base64":case"btoa":case"base64":return btoa(convertToString(value));case"atob":case"from-base64":return atob(convertToString(value));case"empty":return"";case"undefined":return;case"debug":return isObject(console)&&console.log(value),value;case"prefix":return validateString(value),(null==args?void 0:args[0])+value;case"suffix":return validateString(value),value+(null==args?void 0:args[0]);case"uniqid":return(new ID).toString();case"first-key":case"last-key":case"nth-last-key":case"nth-key":if(!isObject(value))throw new Error("type not supported");var keys=Object.keys(value).sort();"first-key"===this.command?key=0:"last-key"===this.command?key=keys.length-1:(key=validateInteger(parseInt(args.shift())),"nth-last-key"===this.command&&(key=keys.length-key-1)),defaultValue=args.shift()||"";var useKey=null==keys?void 0:keys[key];return null!=value&&value[useKey]?null==value?void 0:value[useKey]:defaultValue;case"key":case"property":case"index":if(void 0===(key=args.shift()||void 0))throw new Error("missing key parameter");if(defaultValue=args.shift()||void 0,value instanceof Map)return value.has(key)?value.get(key):defaultValue;if(isObject(value)||isArray(value))return null!=value&&value[key]?null==value?void 0:value[key]:defaultValue;throw new Error("type not supported");case"path-exists":if(void 0===(key=args.shift()))throw new Error("missing key parameter");return new Pathfinder(value).exists(key);case"path":if(void 0===(key=args.shift()))throw new Error("missing key parameter");var pf=new Pathfinder(value);if(!pf.exists(key))return;return pf.getVia(key);case"substring":validateString(value);var start=parseInt(args[0])||0,end=(parseInt(args[1])||0)+start;return value.substring(start,end);case"nop":return value;case"??":case"default":if(null!=value)return value;defaultValue=args.shift();var defaultType=args.shift();switch(void 0===defaultType&&(defaultType="string"),defaultType){case"int":case"integer":return parseInt(defaultValue);case"float":return parseFloat(defaultValue);case"undefined":return;case"bool":case"boolean":return"undefined"!==(defaultValue=defaultValue.toLowerCase())&&""!==defaultValue&&"off"!==defaultValue&&"false"!==defaultValue&&"false"!==defaultValue||"on"===defaultValue||"true"===defaultValue||"true"===defaultValue;case"string":return""+defaultValue;case"object":return JSON.parse(atob(defaultValue))}throw new Error("type not supported");default:throw new Error("unknown command "+this.command)}return value}function pipe_typeof(obj){return(pipe_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function pipe_slicedToArray(arr,i){return function pipe_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function pipe_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function pipe_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return pipe_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pipe_arrayLikeToArray(o,minLen)}(arr,i)||function pipe_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pipe_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function pipe_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function pipe_setPrototypeOf(o,p){return(pipe_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function pipe_createSuper(Derived){var hasNativeReflectConstruct=function pipe_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=pipe_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=pipe_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return pipe_possibleConstructorReturn(this,result)}}function pipe_possibleConstructorReturn(self,call){if(call&&("object"===pipe_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function pipe_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function pipe_getPrototypeOf(o){return(pipe_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Data",Transformer);var Pipe=function(_Base){!function pipe_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&pipe_setPrototypeOf(subClass,superClass)}(Pipe,_Base);var _super=pipe_createSuper(Pipe);function Pipe(pipe){var _this;return function pipe_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Pipe),_this=_super.call(this),validateString(pipe),_this.pipe=pipe.split("|").map((function(v){return new Transformer(v)})),_this}return function pipe_createClass(Constructor,protoProps,staticProps){return protoProps&&pipe_defineProperties(Constructor.prototype,protoProps),staticProps&&pipe_defineProperties(Constructor,staticProps),Constructor}(Pipe,[{key:"setCallback",value:function setCallback(name,callback,context){for(var _i=0,_Object$entries=Object.entries(this.pipe);_i<_Object$entries.length;_i++){pipe_slicedToArray(_Object$entries[_i],2)[1].setCallback(name,callback,context)}return this}},{key:"run",value:function run(value){return this.pipe.reduce((function(accumulator,transformer,currentIndex,array){return transformer.run(accumulator)}),value)}}]),Pipe}(Base);function tokenlist_typeof(obj){return(tokenlist_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function tokenlist_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function tokenlist_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return tokenlist_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tokenlist_arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function tokenlist_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function tokenlist_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function tokenlist_setPrototypeOf(o,p){return(tokenlist_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function tokenlist_createSuper(Derived){var hasNativeReflectConstruct=function tokenlist_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=tokenlist_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=tokenlist_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return tokenlist_possibleConstructorReturn(this,result)}}function tokenlist_possibleConstructorReturn(self,call){if(call&&("object"===tokenlist_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function tokenlist_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function tokenlist_getPrototypeOf(o){return(tokenlist_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Data",Pipe);var TokenList=function(_Base,_Symbol$iterator){!function tokenlist_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&tokenlist_setPrototypeOf(subClass,superClass)}(TokenList,_Base);var _super=tokenlist_createSuper(TokenList);function TokenList(init){var _this;return function tokenlist_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,TokenList),(_this=_super.call(this)).tokens=new Set,void 0!==init&&_this.add(init),_this}return function tokenlist_createClass(Constructor,protoProps,staticProps){return protoProps&&tokenlist_defineProperties(Constructor.prototype,protoProps),staticProps&&tokenlist_defineProperties(Constructor,staticProps),Constructor}(TokenList,[{key:"getIterator",value:function getIterator(){return this[Symbol.iterator]()}},{key:_Symbol$iterator,value:function value(){var index=0,entries=this.entries();return{next:function next(){return index<entries.length?{value:null==entries?void 0:entries[index++],done:!1}:{done:!0}}}}},{key:"contains",value:function contains(value){var _this2=this;if(isString(value)){value=value.trim();var counter=0;return value.split(" ").forEach((function(token){if(!1===_this2.tokens.has(token.trim()))return!1;counter++})),counter>0}if(isIterable(value)){var _step,_counter=0,_iterator=tokenlist_createForOfIteratorHelper(value);try{for(_iterator.s();!(_step=_iterator.n()).done;){var token=_step.value;if(validateString(token),!1===this.tokens.has(token.trim()))return!1;_counter++}}catch(err){_iterator.e(err)}finally{_iterator.f()}return _counter>0}return!1}},{key:"add",value:function add(value){var _this3=this;if(isString(value))value.split(" ").forEach((function(token){_this3.tokens.add(token.trim())}));else if(isIterable(value)){var _step2,_iterator2=tokenlist_createForOfIteratorHelper(value);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var token=_step2.value;validateString(token),this.tokens.add(token.trim())}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}else if(void 0!==value)throw new TypeError("unsupported value");return this}},{key:"clear",value:function clear(){return this.tokens.clear(),this}},{key:"remove",value:function remove(value){var _this4=this;if(isString(value))value.split(" ").forEach((function(token){_this4.tokens.delete(token.trim())}));else if(isIterable(value)){var _step3,_iterator3=tokenlist_createForOfIteratorHelper(value);try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var token=_step3.value;validateString(token),this.tokens.delete(token.trim())}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}}else if(void 0!==value)throw new TypeError("unsupported value","types/tokenlist.js");return this}},{key:"replace",value:function replace(token,newToken){if(validateString(token),validateString(newToken),!this.contains(token))return this;var a=Array.from(this.tokens),i=a.indexOf(token);return-1===i||(a.splice(i,1,newToken),this.tokens=new Set,this.add(a)),this}},{key:"toggle",value:function toggle(value){var _this5=this;if(isString(value))value.split(" ").forEach((function(token){toggleValue.call(_this5,token)}));else if(isIterable(value)){var _step4,_iterator4=tokenlist_createForOfIteratorHelper(value);try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var token=_step4.value;toggleValue.call(this,token)}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}}else if(void 0!==value)throw new TypeError("unsupported value","types/tokenlist.js");return this}},{key:"entries",value:function entries(){return Array.from(this.tokens)}},{key:"forEach",value:function forEach(callback){return validateFunction(callback),this.tokens.forEach(callback),this}},{key:"toString",value:function toString(){return this.entries().join(" ")}}]),TokenList}(Base,Symbol.iterator);function toggleValue(token){if(!(this instanceof TokenList))throw Error("must be called with TokenList.call");return validateString(token),token=token.trim(),this.contains(token)?(this.remove(token),this):(this.add(token),this)}function queue_typeof(obj){return(queue_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function queue_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function queue_setPrototypeOf(o,p){return(queue_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function queue_createSuper(Derived){var hasNativeReflectConstruct=function queue_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=queue_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=queue_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return queue_possibleConstructorReturn(this,result)}}function queue_possibleConstructorReturn(self,call){if(call&&("object"===queue_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function queue_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function queue_getPrototypeOf(o){return(queue_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",TokenList);var Queue=function(_Base){!function queue_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&queue_setPrototypeOf(subClass,superClass)}(Queue,_Base);var _super=queue_createSuper(Queue);function Queue(){var _this;return function queue_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Queue),(_this=_super.call(this)).data=[],_this}return function queue_createClass(Constructor,protoProps,staticProps){return protoProps&&queue_defineProperties(Constructor.prototype,protoProps),staticProps&&queue_defineProperties(Constructor,staticProps),Constructor}(Queue,[{key:"isEmpty",value:function isEmpty(){return 0===this.data.length}},{key:"peek",value:function peek(){if(!this.isEmpty())return this.data[0]}},{key:"add",value:function add(value){return this.data.push(value),this}},{key:"clear",value:function clear(){return this.data=[],this}},{key:"poll",value:function poll(){if(!this.isEmpty())return this.data.shift()}}]),Queue}(Base);function uniquequeue_typeof(obj){return(uniquequeue_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function uniquequeue_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _get(target,property,receiver){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(target,property,receiver){var base=function _superPropBase(object,property){for(;!Object.prototype.hasOwnProperty.call(object,property)&&null!==(object=uniquequeue_getPrototypeOf(object)););return object}(target,property);if(base){var desc=Object.getOwnPropertyDescriptor(base,property);return desc.get?desc.get.call(receiver):desc.value}})(target,property,receiver||target)}function uniquequeue_setPrototypeOf(o,p){return(uniquequeue_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function uniquequeue_createSuper(Derived){var hasNativeReflectConstruct=function uniquequeue_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=uniquequeue_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=uniquequeue_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return uniquequeue_possibleConstructorReturn(this,result)}}function uniquequeue_possibleConstructorReturn(self,call){if(call&&("object"===uniquequeue_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function uniquequeue_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function uniquequeue_getPrototypeOf(o){return(uniquequeue_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",Queue);var UniqueQueue=function(_Queue){!function uniquequeue_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&uniquequeue_setPrototypeOf(subClass,superClass)}(UniqueQueue,_Queue);var _super=uniquequeue_createSuper(UniqueQueue);function UniqueQueue(){var _this;return function uniquequeue_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,UniqueQueue),(_this=_super.call(this)).unique=new WeakSet,_this}return function uniquequeue_createClass(Constructor,protoProps,staticProps){return protoProps&&uniquequeue_defineProperties(Constructor.prototype,protoProps),staticProps&&uniquequeue_defineProperties(Constructor,staticProps),Constructor}(UniqueQueue,[{key:"add",value:function add(value){return validateObject(value),this.unique.has(value)||(this.unique.add(value),_get(uniquequeue_getPrototypeOf(UniqueQueue.prototype),"add",this).call(this,value)),this}},{key:"clear",value:function clear(){return _get(uniquequeue_getPrototypeOf(UniqueQueue.prototype),"clear",this).call(this),this.unique=new WeakSet,this}},{key:"poll",value:function poll(){if(!this.isEmpty()){var value=this.data.shift();return this.unique.delete(value),value}}}]),UniqueQueue}(Queue);function observer_typeof(obj){return(observer_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function observer_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function observer_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function observer_setPrototypeOf(o,p){return(observer_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function observer_createSuper(Derived){var hasNativeReflectConstruct=function observer_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=observer_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=observer_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return observer_possibleConstructorReturn(this,result)}}function observer_possibleConstructorReturn(self,call){if(call&&("object"===observer_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function observer_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function observer_getPrototypeOf(o){return(observer_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",UniqueQueue);var Observer=function(_Base){!function observer_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&observer_setPrototypeOf(subClass,superClass)}(Observer,_Base);var _super=observer_createSuper(Observer);function Observer(callback){var _this;if(observer_classCallCheck(this,Observer),_this=_super.call(this),"function"!=typeof callback)throw new Error("observer callback must be a function");_this.callback=callback;for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];return _this.arguments=args,_this.tags=new TokenList,_this.queue=new UniqueQueue,_this}return function observer_createClass(Constructor,protoProps,staticProps){return protoProps&&observer_defineProperties(Constructor.prototype,protoProps),staticProps&&observer_defineProperties(Constructor,staticProps),Constructor}(Observer,[{key:"addTag",value:function addTag(tag){return this.tags.add(tag),this}},{key:"removeTag",value:function removeTag(tag){return this.tags.remove(tag),this}},{key:"getTags",value:function getTags(){return this.tags.entries()}},{key:"hasTag",value:function hasTag(tag){return this.tags.contains(tag)}},{key:"update",value:function update(subject){var self=this;return new Promise((function(resolve,reject){isObject(subject)?(self.queue.add(subject),setTimeout((function(){try{if(self.queue.isEmpty())return void resolve();var s=self.queue.poll(),result=self.callback.apply(s,self.arguments);if(isObject(result)&&result instanceof Promise)return void result.then(resolve).catch(reject);resolve(result)}catch(e){reject(e)}}),0)):reject("subject must be an object")}))}}]),Observer}(Base);function observerlist_typeof(obj){return(observerlist_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function observerlist_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function observerlist_setPrototypeOf(o,p){return(observerlist_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function observerlist_createSuper(Derived){var hasNativeReflectConstruct=function observerlist_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=observerlist_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=observerlist_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return observerlist_possibleConstructorReturn(this,result)}}function observerlist_possibleConstructorReturn(self,call){if(call&&("object"===observerlist_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function observerlist_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function observerlist_getPrototypeOf(o){return(observerlist_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",Observer);var ObserverList=function(_Base){!function observerlist_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&observerlist_setPrototypeOf(subClass,superClass)}(ObserverList,_Base);var _super=observerlist_createSuper(ObserverList);function ObserverList(){var _this;return function observerlist_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ObserverList),(_this=_super.call(this)).observers=[],_this}return function observerlist_createClass(Constructor,protoProps,staticProps){return protoProps&&observerlist_defineProperties(Constructor.prototype,protoProps),staticProps&&observerlist_defineProperties(Constructor,staticProps),Constructor}(ObserverList,[{key:"attach",value:function attach(observer){return validateInstance(observer,Observer),this.observers.push(observer),this}},{key:"detach",value:function detach(observer){validateInstance(observer,Observer);for(var i=0,l=this.observers.length;i<l;i++)this.observers[i]===observer&&this.observers.splice(i,1);return this}},{key:"contains",value:function contains(observer){validateInstance(observer,Observer);for(var i=0,l=this.observers.length;i<l;i++)if(this.observers[i]===observer)return!0;return!1}},{key:"notify",value:function notify(subject){for(var pomises=[],i=0,l=this.observers.length;i<l;i++)pomises.push(this.observers[i].update(subject));return Promise.all(pomises)}}]),ObserverList}(Base);function proxyobserver_typeof(obj){return(proxyobserver_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function proxyobserver_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function proxyobserver_setPrototypeOf(o,p){return(proxyobserver_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function proxyobserver_createSuper(Derived){var hasNativeReflectConstruct=function proxyobserver_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=proxyobserver_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=proxyobserver_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return proxyobserver_possibleConstructorReturn(this,result)}}function proxyobserver_possibleConstructorReturn(self,call){if(call&&("object"===proxyobserver_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return proxyobserver_assertThisInitialized(self)}function proxyobserver_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function proxyobserver_getPrototypeOf(o){return(proxyobserver_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",ObserverList);var ProxyObserver=function(_Base){!function proxyobserver_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&proxyobserver_setPrototypeOf(subClass,superClass)}(ProxyObserver,_Base);var _super=proxyobserver_createSuper(ProxyObserver);function ProxyObserver(object){var _this;return function proxyobserver_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ProxyObserver),(_this=_super.call(this)).realSubject=validateObject(object),_this.subject=new Proxy(object,getHandler.call(proxyobserver_assertThisInitialized(_this))),_this.objectMap=new WeakMap,_this.objectMap.set(_this.realSubject,_this.subject),_this.proxyMap=new WeakMap,_this.proxyMap.set(_this.subject,_this.realSubject),_this.observers=new ObserverList,_this}return function proxyobserver_createClass(Constructor,protoProps,staticProps){return protoProps&&proxyobserver_defineProperties(Constructor.prototype,protoProps),staticProps&&proxyobserver_defineProperties(Constructor,staticProps),Constructor}(ProxyObserver,[{key:"getSubject",value:function getSubject(){return this.subject}},{key:"setSubject",value:function setSubject(obj){var i,k=Object.keys(this.subject);for(i=0;i<k.length;i++)delete this.subject[k[i]];return this.subject=extend(this.subject,obj),this}},{key:"getRealSubject",value:function getRealSubject(){return this.realSubject}},{key:"attachObserver",value:function attachObserver(observer){return this.observers.attach(observer),this}},{key:"detachObserver",value:function detachObserver(observer){return this.observers.detach(observer),this}},{key:"notifyObservers",value:function notifyObservers(){return this.observers.notify(this)}},{key:"containsObserver",value:function containsObserver(observer){return this.observers.contains(observer)}}]),ProxyObserver}(Base);function getHandler(){var proxy=this,handler={get:function get(target,key,receiver){var value=Reflect.get(target,key,receiver);if("symbol"===proxyobserver_typeof(key))return value;if(isPrimitive(value))return value;if(isArray(value)||isObject(value)){if(proxy.objectMap.has(value))return proxy.objectMap.get(value);if(proxy.proxyMap.has(value))return value;var p=new Proxy(value,handler);return proxy.objectMap.set(value,p),proxy.proxyMap.set(p,value),p}return value},set:function set(target,key,value,receiver){proxy.proxyMap.has(value)&&(value=proxy.proxyMap.get(value)),proxy.proxyMap.has(target)&&(target=proxy.proxyMap.get(target));var result,current=Reflect.get(target,key,receiver);if(proxy.proxyMap.has(current)&&(current=proxy.proxyMap.get(current)),current===value)return!0;var descriptor=Reflect.getOwnPropertyDescriptor(target,key);return void 0===descriptor&&(descriptor={writable:!0,enumerable:!0,configurable:!0}),descriptor.value=value,result=Reflect.defineProperty(target,key,descriptor),"symbol"!==proxyobserver_typeof(key)&&proxy.observers.notify(proxy),result},deleteProperty:function deleteProperty(target,key){return key in target&&(delete target[key],"symbol"!==proxyobserver_typeof(key)&&proxy.observers.notify(proxy),!0)},defineProperty:function defineProperty(target,key,descriptor){var result=Reflect.defineProperty(target,key,descriptor);return"symbol"!==proxyobserver_typeof(key)&&proxy.observers.notify(proxy),result},setPrototypeOf:function setPrototypeOf(target,key){var result=Reflect.setPrototypeOf(object1,key);return"symbol"!==proxyobserver_typeof(key)&&proxy.observers.notify(proxy),result}};return handler}function assembler_typeof(obj){return(assembler_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function assembler_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function assembler_setPrototypeOf(o,p){return(assembler_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function assembler_createSuper(Derived){var hasNativeReflectConstruct=function assembler_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=assembler_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=assembler_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return assembler_possibleConstructorReturn(this,result)}}function assembler_possibleConstructorReturn(self,call){if(call&&("object"===assembler_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function assembler_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function assembler_getPrototypeOf(o){return(assembler_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",ProxyObserver);assignToNamespace("Monster.DOM",function(_Base){!function assembler_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&assembler_setPrototypeOf(subClass,superClass)}(Assembler,_Base);var _super=assembler_createSuper(Assembler);function Assembler(fragment){var _this;return function assembler_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Assembler),(_this=_super.call(this)).attributePrefix="data-monster-",validateInstance(fragment,getGlobalFunction("DocumentFragment")),_this.fragment=fragment,_this}return function assembler_createClass(Constructor,protoProps,staticProps){return protoProps&&assembler_defineProperties(Constructor.prototype,protoProps),staticProps&&assembler_defineProperties(Constructor,staticProps),Constructor}(Assembler,[{key:"setAttributePrefix",value:function setAttributePrefix(prefix){return validateString(prefix),this.attributePrefix=prefix,this}},{key:"getAttributePrefix",value:function getAttributePrefix(){return this.attributePrefix}},{key:"createDocumentFragment",value:function createDocumentFragment(data){return void 0===data&&(data=new ProxyObserver({})),validateInstance(data,ProxyObserver),this.fragment.cloneNode(!0)}}]),Assembler}(Base));var objectUpdaterLinkSymbol=Symbol("monsterUpdater");function addToObjectLink(element,symbol,object){return validateInstance(element,HTMLElement),validateSymbol(symbol),void 0===(null==element?void 0:element[symbol])&&(element[symbol]=new Set),addAttributeToken(element,"data-monster-objectlink",symbol.toString()),element[symbol].add(object),element}function hasObjectLink(element,symbol){return validateInstance(element,HTMLElement),validateSymbol(symbol),void 0!==(null==element?void 0:element[symbol])&&containsAttributeToken(element,"data-monster-objectlink",symbol.toString())}function getLinkedObjects(element,symbol){if(validateInstance(element,HTMLElement),validateSymbol(symbol),void 0===(null==element?void 0:element[symbol]))throw new Error("there is no object link for "+symbol.toString());return null==element?void 0:element[symbol][Symbol.iterator]()}function addAttributeToken(element,key,token){return validateInstance(element,HTMLElement),validateString(token),validateString(key),element.hasAttribute(key)?(element.setAttribute(key,new TokenList(element.getAttribute(key)).add(token).toString()),element):(element.setAttribute(key,token),element)}function removeAttributeToken(element,key,token){return validateInstance(element,HTMLElement),validateString(token),validateString(key),element.hasAttribute(key)?(element.setAttribute(key,new TokenList(element.getAttribute(key)).remove(token).toString()),element):element}function containsAttributeToken(element,key,token){return validateInstance(element,HTMLElement),validateString(token),validateString(key),!!element.hasAttribute(key)&&new TokenList(element.getAttribute(key)).contains(token)}function findClosestByAttribute(element,key,value){if(validateInstance(element,getGlobalFunction("HTMLElement")),element.hasAttribute(key)){if(void 0===value)return element;if(element.getAttribute(key)===value)return element}var selector=validateString(key);void 0!==value&&(selector+="="+validateString(value));var result=element.closest("["+selector+"]");if(result instanceof HTMLElement)return result}function mediatype_typeof(obj){return(mediatype_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function mediatype_wrapRegExp(){mediatype_wrapRegExp=function _wrapRegExp(re,groups){return new BabelRegExp(re,void 0,groups)};var _super=RegExp.prototype,_groups=new WeakMap;function BabelRegExp(re,flags,groups){var _this=new RegExp(re,flags);return _groups.set(_this,groups||_groups.get(re)),mediatype_setPrototypeOf(_this,BabelRegExp.prototype)}function buildGroups(result,re){var g=_groups.get(re);return Object.keys(g).reduce((function(groups,name){return groups[name]=result[g[name]],groups}),Object.create(null))}return mediatype_inherits(BabelRegExp,RegExp),BabelRegExp.prototype.exec=function(str){var result=_super.exec.call(this,str);return result&&(result.groups=buildGroups(result,this)),result},BabelRegExp.prototype[Symbol.replace]=function(str,substitution){if("string"==typeof substitution){var groups=_groups.get(this);return _super[Symbol.replace].call(this,str,substitution.replace(/\$<([^>]+)>/g,(function(_,name){return"$"+groups[name]})))}if("function"==typeof substitution){var _this=this;return _super[Symbol.replace].call(this,str,(function(){var args=arguments;return"object"!==mediatype_typeof(args[args.length-1])&&(args=[].slice.call(args)).push(buildGroups(args,_this)),substitution.apply(this,args)}))}return _super[Symbol.replace].call(this,str,substitution)},mediatype_wrapRegExp.apply(this,arguments)}function mediatype_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function mediatype_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return mediatype_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mediatype_arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function mediatype_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function mediatype_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function mediatype_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&mediatype_setPrototypeOf(subClass,superClass)}function mediatype_setPrototypeOf(o,p){return(mediatype_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function mediatype_createSuper(Derived){var hasNativeReflectConstruct=function mediatype_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=mediatype_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=mediatype_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return mediatype_possibleConstructorReturn(this,result)}}function mediatype_possibleConstructorReturn(self,call){if(call&&("object"===mediatype_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function mediatype_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function mediatype_getPrototypeOf(o){return(mediatype_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",(function findClosestByClass(element,className){var _element$classList;if(validateInstance(element,getGlobalFunction("HTMLElement")),null!=element&&null!==(_element$classList=element.classList)&&void 0!==_element$classList&&_element$classList.contains(validateString(className)))return element;var result=element.closest("."+className);return result instanceof HTMLElement?result:void 0}),getLinkedObjects,addToObjectLink,(function removeObjectLink(element,symbol){return validateInstance(element,HTMLElement),validateSymbol(symbol),void 0===(null==element?void 0:element[symbol])||(removeAttributeToken(element,"data-monster-objectlink",symbol.toString()),delete element[symbol]),element}),findClosestByAttribute,hasObjectLink,(function clearAttributeTokens(element,key){return validateInstance(element,HTMLElement),validateString(key),element.hasAttribute(key)?(element.setAttribute(key,""),element):element}),(function replaceAttributeToken(element,key,from,to){return validateInstance(element,HTMLElement),validateString(from),validateString(to),validateString(key),element.hasAttribute(key)?(element.setAttribute(key,new TokenList(element.getAttribute(key)).replace(from,to).toString()),element):element}),containsAttributeToken,removeAttributeToken,addAttributeToken,(function toggleAttributeToken(element,key,token){return validateInstance(element,HTMLElement),validateString(token),validateString(key),element.hasAttribute(key)?(element.setAttribute(key,new TokenList(element.getAttribute(key)).toggle(token).toString()),element):(element.setAttribute(key,token),element)}));var internal=Symbol("internal"),MediaType=function(_Base){mediatype_inherits(MediaType,_Base);var _super=mediatype_createSuper(MediaType);function MediaType(type,subtype,parameter){var _this;return function mediatype_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,MediaType),(_this=_super.call(this))[internal]={type:validateString(type).toLowerCase(),subtype:validateString(subtype).toLowerCase(),parameter:[]},void 0!==parameter&&(_this[internal].parameter=validateArray(parameter)),_this}return function mediatype_createClass(Constructor,protoProps,staticProps){return protoProps&&mediatype_defineProperties(Constructor.prototype,protoProps),staticProps&&mediatype_defineProperties(Constructor,staticProps),Constructor}(MediaType,[{key:"type",get:function get(){return this[internal].type}},{key:"subtype",get:function get(){return this[internal].subtype}},{key:"parameter",get:function get(){var result=new Map;return this[internal].parameter.forEach((function(p){var value=p.value;value.startsWith('"')&&value.endsWith('"')&&(value=value.substring(1,value.length-1)),result.set(p.key,value)})),result}},{key:"toString",value:function toString(){var _step,parameter=[],_iterator=mediatype_createForOfIteratorHelper(this[internal].parameter);try{for(_iterator.s();!(_step=_iterator.n()).done;){var a=_step.value;parameter.push(a.key+"="+a.value)}}catch(err){_iterator.e(err)}finally{_iterator.f()}return this[internal].type+"/"+this[internal].subtype+(parameter.length>0?";"+parameter.join(";"):"")}}]),MediaType}(Base);function parseMediaType(mediatype){var result=mediatype_wrapRegExp(/([A-Za-z]+|\*)\/(([\+\x2D\.0-9A-Z_a-z]+)|\*|)([\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*([0-9A-Za-z]+)[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(=[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*("?[\x2D0-9A-Z_a-z]+"?))?)*/g,{type:1,subtype:2,parameter:4}).exec(validateString(mediatype)),groups=null==result?void 0:result.groups;if(void 0===groups)throw new TypeError("the mimetype can not be parsed");var type=null==groups?void 0:groups.type,subtype=null==groups?void 0:groups.subtype,parameter=null==groups?void 0:groups.parameter;if(""===subtype||""===type)throw new TypeError("blank value is not allowed");return new MediaType(type,subtype,function parseParameter(parameter){if(!isString(parameter))return;var result=[];return parameter.split(";").forEach((function(entry){if(""!==(entry=entry.trim())){var kv=entry.split("="),key=validateString(null==kv?void 0:kv[0]).trim(),value=validateString(null==kv?void 0:kv[1]).trim();result.push({key:key,value:value})}})),result}(parameter))}function dataurl_typeof(obj){return(dataurl_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function dataurl_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function dataurl_setPrototypeOf(o,p){return(dataurl_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function dataurl_createSuper(Derived){var hasNativeReflectConstruct=function dataurl_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=dataurl_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=dataurl_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return dataurl_possibleConstructorReturn(this,result)}}function dataurl_possibleConstructorReturn(self,call){if(call&&("object"===dataurl_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function dataurl_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function dataurl_getPrototypeOf(o){return(dataurl_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",parseMediaType,MediaType);var dataurl_internal=Symbol("internal"),DataUrl=function(_Base){!function dataurl_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&dataurl_setPrototypeOf(subClass,superClass)}(DataUrl,_Base);var _super=dataurl_createSuper(DataUrl);function DataUrl(content,mediatype,base64){var _this;return function dataurl_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,DataUrl),_this=_super.call(this),isString(mediatype)&&(mediatype=parseMediaType(mediatype)),_this[dataurl_internal]={content:validateString(content),mediatype:validateInstance(mediatype,MediaType),base64:validateBoolean(void 0===base64||base64)},_this}return function dataurl_createClass(Constructor,protoProps,staticProps){return protoProps&&dataurl_defineProperties(Constructor.prototype,protoProps),staticProps&&dataurl_defineProperties(Constructor,staticProps),Constructor}(DataUrl,[{key:"content",get:function get(){return this[dataurl_internal].base64?atob(this[dataurl_internal].content):this[dataurl_internal].content}},{key:"mediatype",get:function get(){return this[dataurl_internal].mediatype}},{key:"toString",value:function toString(){var content=this[dataurl_internal].content;return content=!0===this[dataurl_internal].base64?";base64,"+content:","+encodeURIComponent(content),"data:"+this[dataurl_internal].mediatype.toString()+content}}]),DataUrl}(Base);function parseDataURL(dataurl){if(validateString(dataurl),"data:"!==(dataurl=dataurl.trim()).substring(0,5))throw new TypeError("incorrect or missing data protocol");var p=(dataurl=dataurl.substring(5)).indexOf(",");if(-1===p)throw new TypeError("malformed data url");var content=dataurl.substring(p+1),mediatypeAndBase64=dataurl.substring(0,p).trim(),mediatype="text/plain;charset=US-ASCII",base64Flag=!1;if(""!==mediatypeAndBase64){if(mediatype=mediatypeAndBase64,mediatypeAndBase64.endsWith("base64")){var i=mediatypeAndBase64.lastIndexOf(";");mediatype=mediatypeAndBase64.substring(0,i),base64Flag=!0}else content=decodeURIComponent(content);mediatype=parseMediaType(mediatype)}else content=decodeURIComponent(content);return new DataUrl(content,mediatype,base64Flag)}function theme_typeof(obj){return(theme_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function theme_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function theme_setPrototypeOf(o,p){return(theme_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function theme_createSuper(Derived){var hasNativeReflectConstruct=function theme_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=theme_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=theme_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return theme_possibleConstructorReturn(this,result)}}function theme_possibleConstructorReturn(self,call){if(call&&("object"===theme_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function theme_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function theme_getPrototypeOf(o){return(theme_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",parseDataURL,DataUrl);var Theme=function(_Base){!function theme_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&theme_setPrototypeOf(subClass,superClass)}(Theme,_Base);var _super=theme_createSuper(Theme);function Theme(name){var _this;return function theme_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Theme),_this=_super.call(this),validateString(name),_this.name=name,_this}return function theme_createClass(Constructor,protoProps,staticProps){return protoProps&&theme_defineProperties(Constructor.prototype,protoProps),staticProps&&theme_defineProperties(Constructor,staticProps),Constructor}(Theme,[{key:"getName",value:function getName(){return this.name}}]),Theme}(Base);function getDocumentTheme(){var name="monster",element=getGlobalObject("document").querySelector("html");if(element instanceof HTMLElement){var theme=element.getAttribute("data-monster-theme-name");theme&&(name=theme)}return new Theme(name)}function template_typeof(obj){return(template_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function template_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function template_setPrototypeOf(o,p){return(template_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function template_createSuper(Derived){var hasNativeReflectConstruct=function template_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=template_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=template_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return template_possibleConstructorReturn(this,result)}}function template_possibleConstructorReturn(self,call){if(call&&("object"===template_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function template_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function template_getPrototypeOf(o){return(template_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",Theme,getDocumentTheme);var Template=function(_Base){!function template_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&template_setPrototypeOf(subClass,superClass)}(Template,_Base);var _super=template_createSuper(Template);function Template(template){var _this;return function template_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Template),_this=_super.call(this),validateInstance(template,getGlobalFunction("HTMLTemplateElement")),_this.template=template,_this}return function template_createClass(Constructor,protoProps,staticProps){return protoProps&&template_defineProperties(Constructor.prototype,protoProps),staticProps&&template_defineProperties(Constructor,staticProps),Constructor}(Template,[{key:"getTemplateElement",value:function getTemplateElement(){return this.template}},{key:"createDocumentFragment",value:function createDocumentFragment(){return this.template.content.cloneNode(!0)}}]),Template}(Base);function findDocumentTemplate(id,currentNode){validateString(id);var prefixID,template,document=getGlobalObject("document"),HTMLTemplateElement=getGlobalFunction("HTMLTemplateElement"),DocumentFragment=getGlobalFunction("DocumentFragment"),Document=getGlobalFunction("Document");currentNode instanceof Document||currentNode instanceof DocumentFragment||(currentNode instanceof Node&&(currentNode.hasAttribute("data-monster-template-prefix")&&(prefixID=currentNode.getAttribute("data-monster-template-prefix")),(currentNode=currentNode.getRootNode())instanceof Document||currentNode instanceof DocumentFragment||(currentNode=currentNode.ownerDocument)),currentNode instanceof Document||currentNode instanceof DocumentFragment||(currentNode=document));var theme=getDocumentTheme();if(prefixID){var themedPrefixID=prefixID+"-"+id+"-"+theme.getName();if((template=currentNode.getElementById(themedPrefixID))instanceof HTMLTemplateElement)return new Template(template);if((template=document.getElementById(themedPrefixID))instanceof HTMLTemplateElement)return new Template(template)}var themedID=id+"-"+theme.getName();if((template=currentNode.getElementById(themedID))instanceof HTMLTemplateElement)return new Template(template);if((template=document.getElementById(themedID))instanceof HTMLTemplateElement)return new Template(template);if((template=currentNode.getElementById(id))instanceof HTMLTemplateElement)return new Template(template);if((template=document.getElementById(id))instanceof HTMLTemplateElement)return new Template(template);throw new Error("template "+id+" not found.")}function trimspaces_typeof(obj){return(trimspaces_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function trimspaces_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function trimspaces_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return trimspaces_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return trimspaces_arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function trimspaces_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function trimspaces_wrapRegExp(){trimspaces_wrapRegExp=function _wrapRegExp(re,groups){return new BabelRegExp(re,void 0,groups)};var _super=RegExp.prototype,_groups=new WeakMap;function BabelRegExp(re,flags,groups){var _this=new RegExp(re,flags);return _groups.set(_this,groups||_groups.get(re)),trimspaces_setPrototypeOf(_this,BabelRegExp.prototype)}function buildGroups(result,re){var g=_groups.get(re);return Object.keys(g).reduce((function(groups,name){return groups[name]=result[g[name]],groups}),Object.create(null))}return trimspaces_inherits(BabelRegExp,RegExp),BabelRegExp.prototype.exec=function(str){var result=_super.exec.call(this,str);return result&&(result.groups=buildGroups(result,this)),result},BabelRegExp.prototype[Symbol.replace]=function(str,substitution){if("string"==typeof substitution){var groups=_groups.get(this);return _super[Symbol.replace].call(this,str,substitution.replace(/\$<([^>]+)>/g,(function(_,name){return"$"+groups[name]})))}if("function"==typeof substitution){var _this=this;return _super[Symbol.replace].call(this,str,(function(){var args=arguments;return"object"!==trimspaces_typeof(args[args.length-1])&&(args=[].slice.call(args)).push(buildGroups(args,_this)),substitution.apply(this,args)}))}return _super[Symbol.replace].call(this,str,substitution)},trimspaces_wrapRegExp.apply(this,arguments)}function trimspaces_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&trimspaces_setPrototypeOf(subClass,superClass)}function trimspaces_setPrototypeOf(o,p){return(trimspaces_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function trimSpaces(value){validateString(value);var _step,placeholder=new Map,regex=trimspaces_wrapRegExp(/((\\(.)){1})/gim,{pattern:2,char:3}),_iterator=trimspaces_createForOfIteratorHelper(value.matchAll(regex));try{for(_iterator.s();!(_step=_iterator.n()).done;){var m=_step.value,g=null==m?void 0:m.groups;if(isObject(g)){var p=null==g?void 0:g.pattern,c=null==g?void 0:g.char;if(p&&c){var r="__"+(new ID).toString()+"__";placeholder.set(r,c),value=value.replace(p,r)}}}}catch(err){_iterator.e(err)}finally{_iterator.f()}return value=value.trim(),placeholder.forEach((function(v,k){value=value.replace(k,"\\"+v)})),value}function util_typeof(obj){return(util_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function getDocument(){var _getGlobal,document=null===(_getGlobal=getGlobal())||void 0===_getGlobal?void 0:_getGlobal.document;if("object"!==util_typeof(document))throw new Error("not supported environment");return document}function events_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function events_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return events_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return events_arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function events_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function findTargetElementFromEvent(event,attributeName,attributeValue){if(validateInstance(event,Event),"function"!=typeof event.composedPath)throw new Error("unsupported event");var path=event.composedPath();if(isArray(path))for(var i=0;i<path.length;i++){var o=path[i];if(o instanceof HTMLElement&&o.hasAttribute(attributeName)&&(void 0===attributeValue||o.getAttribute(attributeName)===attributeValue))return o}}function updater_typeof(obj){return(updater_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function updater_toConsumableArray(arr){return function updater_arrayWithoutHoles(arr){if(Array.isArray(arr))return updater_arrayLikeToArray(arr)}(arr)||function updater_iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||updater_unsupportedIterableToArray(arr)||function updater_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function updater_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=updater_unsupportedIterableToArray(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e2){throw _e2},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e3){didErr=!0,err=_e3},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function updater_slicedToArray(arr,i){return function updater_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function updater_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||updater_unsupportedIterableToArray(arr,i)||function updater_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function updater_unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return updater_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?updater_arrayLikeToArray(o,minLen):void 0}}function updater_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function updater_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function updater_setPrototypeOf(o,p){return(updater_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function updater_createSuper(Derived){var hasNativeReflectConstruct=function updater_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=updater_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=updater_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return updater_possibleConstructorReturn(this,result)}}function updater_possibleConstructorReturn(self,call){if(call&&("object"===updater_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return updater_assertThisInitialized(self)}function updater_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function updater_getPrototypeOf(o){return(updater_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",Template,findDocumentTemplate),assignToNamespace("Monster.Util",trimSpaces),assignToNamespace("Monster.DOM",(function getWindow(){var _getGlobal2,window=null===(_getGlobal2=getGlobal())||void 0===_getGlobal2?void 0:_getGlobal2.window;if("object"!==util_typeof(window))throw new Error("not supported environment");return window}),getDocument,(function getDocumentFragmentFromString(html){validateString(html);var template=getDocument().createElement("template");return template.innerHTML=html,template.content})),assignToNamespace("Monster.DOM",findTargetElementFromEvent,(function fireEvent(element,type){if(getDocument(),element instanceof HTMLElement){if("click"===type)return void element.click();var event=new Event(validateString(type),{bubbles:!0,cancelable:!0});element.dispatchEvent(event)}else{if(!(element instanceof HTMLCollection||element instanceof NodeList))throw new TypeError("value is not an instance of HTMLElement or HTMLCollection");var _step,_iterator=events_createForOfIteratorHelper(element);try{for(_iterator.s();!(_step=_iterator.n()).done;){fireEvent(_step.value,type)}}catch(err){_iterator.e(err)}finally{_iterator.f()}}}),(function fireCustomEvent(element,type,detail){if(getDocument(),element instanceof HTMLElement){isObject(detail)||(detail={detail:detail});var event=new CustomEvent(validateString(type),{bubbles:!0,cancelable:!0,detail:detail});element.dispatchEvent(event)}else{if(!(element instanceof HTMLCollection||element instanceof NodeList))throw new TypeError("value is not an instance of HTMLElement or HTMLCollection");var _step2,_iterator2=events_createForOfIteratorHelper(element);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){fireCustomEvent(_step2.value,type,detail)}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}}));var Updater=function(_Base){!function updater_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&updater_setPrototypeOf(subClass,superClass)}(Updater,_Base);var _super=updater_createSuper(Updater);function Updater(element,subject){var _this;return function updater_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Updater),_this=_super.call(this),void 0===subject&&(subject={}),isInstance(subject,ProxyObserver)||(subject=new ProxyObserver(subject)),_this[internalSymbol]={element:validateInstance(element,HTMLElement),last:{},callbacks:new Map,eventTypes:["keyup","click","change","drop","touchend","input"],subject:subject},_this[internalSymbol].callbacks.set("checkstate",getCheckStateCallback.call(updater_assertThisInitialized(_this))),_this[internalSymbol].subject.attachObserver(new Observer((function(){var s=_this[internalSymbol].subject.getRealSubject(),diffResult=diff(_this[internalSymbol].last,s);_this[internalSymbol].last=clone(s);for(var _i=0,_Object$entries=Object.entries(diffResult);_i<_Object$entries.length;_i++){var change=updater_slicedToArray(_Object$entries[_i],2)[1];removeElement.call(updater_assertThisInitialized(_this),change),insertElement.call(updater_assertThisInitialized(_this),change),updateContent.call(updater_assertThisInitialized(_this),change),updateAttributes.call(updater_assertThisInitialized(_this),change)}}))),_this}return function updater_createClass(Constructor,protoProps,staticProps){return protoProps&&updater_defineProperties(Constructor.prototype,protoProps),staticProps&&updater_defineProperties(Constructor,staticProps),Constructor}(Updater,[{key:"setEventTypes",value:function setEventTypes(types){return this[internalSymbol].eventTypes=validateArray(types),this}},{key:"enableEventProcessing",value:function enableEventProcessing(){this.disableEventProcessing();var _step,_iterator=updater_createForOfIteratorHelper(this[internalSymbol].eventTypes);try{for(_iterator.s();!(_step=_iterator.n()).done;){var type=_step.value;this[internalSymbol].element.addEventListener(type,getControlEventHandler.call(this),{capture:!0,passive:!0})}}catch(err){_iterator.e(err)}finally{_iterator.f()}return this}},{key:"disableEventProcessing",value:function disableEventProcessing(){var _step2,_iterator2=updater_createForOfIteratorHelper(this[internalSymbol].eventTypes);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var type=_step2.value;this[internalSymbol].element.removeEventListener(type,getControlEventHandler.call(this))}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}return this}},{key:"run",value:function run(){return this[internalSymbol].last={__init__:!0},this[internalSymbol].subject.notifyObservers()}},{key:"retrieve",value:function retrieve(){return retrieveFromBindings.call(this),this}},{key:"getSubject",value:function getSubject(){return this[internalSymbol].subject.getSubject()}},{key:"setCallback",value:function setCallback(name,callback){return this[internalSymbol].callbacks.set(name,callback),this}}]),Updater}(Base);function getCheckStateCallback(){return function(current){if(this instanceof HTMLInputElement){if(-1!==["radio","checkbox"].indexOf(this.type))return this.value+""==current+""?"true":void 0}else if(this instanceof HTMLOptionElement)return isArray(current)&&-1!==current.indexOf(this.value)?"true":void 0}}var symbol=Symbol("EventHandler");function getControlEventHandler(){var self=this;return self[symbol]||(self[symbol]=function(event){var element=findTargetElementFromEvent(event,"data-monster-bind");void 0!==element&&retrieveAndSetValue.call(self,element)}),self[symbol]}function retrieveAndSetValue(element){var _element$constructor,_Object$getOwnPropert,value,pathfinder=new Pathfinder(this[internalSymbol].subject.getSubject()),path=element.getAttribute("data-monster-bind");if(0!==path.indexOf("path:"))throw new Error("the bind argument must start as a value with a path");if(path=path.substr(5),element instanceof HTMLInputElement)switch(element.type){case"checkbox":value=element.checked?element.value:void 0;break;default:value=element.value}else if(element instanceof HTMLTextAreaElement)value=element.value;else if(element instanceof HTMLSelectElement)switch(element.type){case"select-one":value=element.value;break;case"select-multiple":value=element.value;var options=null==element?void 0:element.selectedOptions;void 0===options&&(options=element.querySelectorAll(":scope option:checked")),value=Array.from(options).map((function(_ref){return _ref.value}))}else{if(!(null!=element&&null!==(_element$constructor=element.constructor)&&void 0!==_element$constructor&&_element$constructor.prototype&&null!==(_Object$getOwnPropert=Object.getOwnPropertyDescriptor(element.constructor.prototype,"value"))&&void 0!==_Object$getOwnPropert&&_Object$getOwnPropert.get||element.hasOwnProperty("value")))throw new Error("unsupported object");value=null==element?void 0:element.value}var copy=clone(this[internalSymbol].subject.getRealSubject());new Pathfinder(copy).setVia(path,value),diff(copy,this[internalSymbol].subject.getRealSubject()).length>0&&pathfinder.setVia(path,value)}function retrieveFromBindings(){this[internalSymbol].element.matches("[data-monster-bind]")&&retrieveAndSetValue.call(this,element);var _step3,_iterator3=updater_createForOfIteratorHelper(this[internalSymbol].element.querySelectorAll("[data-monster-bind]").entries());try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _element=updater_slicedToArray(_step3.value,2)[1];retrieveAndSetValue.call(this,_element)}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}}function removeElement(change){var _step4,_iterator4=updater_createForOfIteratorHelper(this[internalSymbol].element.querySelectorAll(":scope [data-monster-remove]").entries());try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _element2=updater_slicedToArray(_step4.value,2)[1];_element2.parentNode.removeChild(_element2)}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}}function insertElement(change){for(var self=this,subject=self[internalSymbol].subject.getRealSubject(),mem=(getDocument(),new WeakSet),wd=0,container=self[internalSymbol].element;;){var found=!1;wd++;var p=clone(null==change?void 0:change.path);if(!isArray(p))return self;for(;p.length>0;){var current=p.join("."),iterator=new Set,query='[data-monster-insert*="path:'+current+'"]',e=container.querySelectorAll(query);e.length>0&&(iterator=new Set(updater_toConsumableArray(e))),container.matches(query)&&iterator.add(container);var _step5,_iterator5=updater_createForOfIteratorHelper(iterator.entries());try{var _loop=function _loop(){var containerElement=updater_slicedToArray(_step5.value,2)[1];if(mem.has(containerElement))return"continue";mem.add(containerElement),found=!0;var def=trimSpaces(containerElement.getAttribute("data-monster-insert")),i=def.indexOf(" "),key=trimSpaces(def.substr(0,i)),refPrefix=key+"-",cmd=trimSpaces(def.substr(i));if(cmd.indexOf("|")>0)throw new Error("pipes are not allowed when cloning a node.");var pipe=new Pipe(cmd);self[internalSymbol].callbacks.forEach((function(f,n){pipe.setCallback(n,f)}));var value=void 0;try{containerElement.removeAttribute("data-monster-error"),value=pipe.run(subject)}catch(e){containerElement.setAttribute("data-monster-error",e.message)}var dataPath=cmd.split(":").pop();if(containerElement.hasChildNodes()&&containerElement.lastChild,!isIterable(value))throw new Error("the value is not iterable");for(var available=new Set,_i2=0,_Object$entries2=Object.entries(value);_i2<_Object$entries2.length;_i2++){var _Object$entries2$_i=updater_slicedToArray(_Object$entries2[_i2],2),_i3=_Object$entries2$_i[0],ref=(_Object$entries2$_i[1],refPrefix+_i3),currentPath=dataPath+"."+_i3;available.add(ref);var refElement=containerElement.querySelector('[data-monster-insert-reference="'+ref+'"]');refElement instanceof HTMLElement?refElement:appendNewDocumentFragment(containerElement,key,ref,currentPath)}for(var nodes=containerElement.querySelectorAll('[data-monster-insert-reference*="'+refPrefix+'"]'),_i4=0,_Object$entries3=Object.entries(nodes);_i4<_Object$entries3.length;_i4++){var node=updater_slicedToArray(_Object$entries3[_i4],2)[1];if(!available.has(node.getAttribute("data-monster-insert-reference")))try{containerElement.removeChild(node)}catch(e){}}};for(_iterator5.s();!(_step5=_iterator5.n()).done;)_loop()}catch(err){_iterator5.e(err)}finally{_iterator5.f()}p.pop()}if(!1===found)break;if(wd++>200)throw new Error("the maximum depth for the recursion is reached.")}}function appendNewDocumentFragment(container,key,ref,path){for(var nodes=findDocumentTemplate(key,container).createDocumentFragment(),_i5=0,_Object$entries4=Object.entries(nodes.childNodes);_i5<_Object$entries4.length;_i5++){var node=updater_slicedToArray(_Object$entries4[_i5],2)[1];node instanceof HTMLElement&&(applyRecursive(node,key,path),node.setAttribute("data-monster-insert-reference",ref)),container.appendChild(node)}}function applyRecursive(node,key,path){if(node instanceof HTMLElement){if(node.hasAttribute("data-monster-replace")){var value=node.getAttribute("data-monster-replace");node.setAttribute("data-monster-replace",value.replaceAll("path:"+key,"path:"+path))}if(node.hasAttribute("data-monster-attributes")){var _value=node.getAttribute("data-monster-attributes");node.setAttribute("data-monster-attributes",_value.replaceAll("path:"+key,"path:"+path))}for(var _i6=0,_Object$entries5=Object.entries(node.childNodes);_i6<_Object$entries5.length;_i6++){applyRecursive(updater_slicedToArray(_Object$entries5[_i6],2)[1],key,path)}}}function updateContent(change){var subject=this[internalSymbol].subject.getRealSubject(),p=clone(null==change?void 0:change.path);runUpdateContent.call(this,this[internalSymbol].element,p,subject);var slots=this[internalSymbol].element.querySelectorAll("slot");if(slots.length>0)for(var _i7=0,_Object$entries6=Object.entries(slots);_i7<_Object$entries6.length;_i7++)for(var slot=updater_slicedToArray(_Object$entries6[_i7],2)[1],_i8=0,_Object$entries7=Object.entries(slot.assignedNodes());_i8<_Object$entries7.length;_i8++){var _element3=updater_slicedToArray(_Object$entries7[_i8],2)[1];runUpdateContent.call(this,_element3,p,subject)}}function runUpdateContent(container,parts,subject){var _this2=this;if(isArray(parts)&&container instanceof HTMLElement){parts=clone(parts);for(var mem=new WeakSet;parts.length>0;){var current=parts.join(".");parts.pop();var query='[data-monster-replace^="path:'+current+'"], [data-monster-replace^="static:"]',e=container.querySelectorAll(""+query),iterator=new Set(updater_toConsumableArray(e));container.matches(query)&&iterator.add(container),iterator.forEach((function(key,element){if(!mem.has(element)){mem.add(element);var value,cmd=trimSpaces(element.getAttribute("data-monster-replace")),pipe=new Pipe(cmd);_this2[internalSymbol].callbacks.forEach((function(f,n){pipe.setCallback(n,f)}));try{element.removeAttribute("data-monster-error"),value=pipe.run(subject)}catch(e){element.setAttribute("data-monster-error",e.message)}if(value instanceof HTMLElement){for(;element.firstChild;)element.removeChild(element.firstChild);element.addNode(value)}else element.innerHTML=value}}))}}}function updateAttributes(change){var subject=this[internalSymbol].subject.getRealSubject(),p=clone(null==change?void 0:change.path);runUpdateAttributes.call(this,this[internalSymbol].element,p,subject)}function runUpdateAttributes(container,parts,subject){var _this3=this,self=this;if(isArray(parts)){parts=clone(parts);for(var mem=new WeakSet;parts.length>0;){var current=parts.join(".");parts.pop();var iterator=new Set,query='[data-monster-select-this], [data-monster-attributes*="path:'+current+'"], [data-monster-attributes^="static:"]',e=container.querySelectorAll(query);e.length>0&&(iterator=new Set(updater_toConsumableArray(e))),container.matches(query)&&iterator.add(container),iterator.forEach((function(key,element){if(!mem.has(element)){mem.add(element);for(var attributes=element.getAttribute("data-monster-attributes"),_loop2=function _loop2(){var def=updater_slicedToArray(_Object$entries8[_i9],2)[1],i=(def=trimSpaces(def)).indexOf(" "),name=trimSpaces(def.substr(0,i)),cmd=trimSpaces(def.substr(i)),pipe=new Pipe(cmd);self[internalSymbol].callbacks.forEach((function(f,n){pipe.setCallback(n,f,element)}));var value=void 0;try{element.removeAttribute("data-monster-error"),value=pipe.run(subject)}catch(e){element.setAttribute("data-monster-error",e.message)}void 0===value?element.removeAttribute(name):element.getAttribute(name)!==value&&element.setAttribute(name,value),handleInputControlAttributeUpdate.call(_this3,element,name,value)},_i9=0,_Object$entries8=Object.entries(attributes.split(","));_i9<_Object$entries8.length;_i9++)_loop2()}}))}}}function handleInputControlAttributeUpdate(element,name,value){if(element instanceof HTMLSelectElement)switch(element.type){case"select-multiple":for(var _i10=0,_Object$entries9=Object.entries(element.options);_i10<_Object$entries9.length;_i10++){var _Object$entries9$_i=updater_slicedToArray(_Object$entries9[_i10],2),opt=(_Object$entries9$_i[0],_Object$entries9$_i[1]);-1!==value.indexOf(opt.value)?opt.selected=!0:opt.selected=!1}break;case"select-one":for(var _i11=0,_Object$entries10=Object.entries(element.options);_i11<_Object$entries10.length;_i11++){var _Object$entries10$_i=updater_slicedToArray(_Object$entries10[_i11],2),_index=_Object$entries10$_i[0];if(_Object$entries10$_i[1].value===value){element.selectedIndex=_index;break}}}else if(element instanceof HTMLInputElement)switch(element.type){case"radio":case"checkbox":"checked"===name&&(element.checked=void 0!==value);break;case"text":default:"value"===name&&(element.value=void 0===value?"":value)}else element instanceof HTMLTextAreaElement&&"value"===name&&(element.value=void 0===value?"":value)}function customelement_typeof(obj){return(customelement_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function customelement_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=customelement_unsupportedIterableToArray(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e2){throw _e2},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e3){didErr=!0,err=_e3},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function customelement_slicedToArray(arr,i){return function customelement_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function customelement_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||customelement_unsupportedIterableToArray(arr,i)||function customelement_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function customelement_toConsumableArray(arr){return function customelement_arrayWithoutHoles(arr){if(Array.isArray(arr))return customelement_arrayLikeToArray(arr)}(arr)||function customelement_iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||customelement_unsupportedIterableToArray(arr)||function customelement_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function customelement_unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return customelement_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?customelement_arrayLikeToArray(o,minLen):void 0}}function customelement_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function customelement_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function customelement_possibleConstructorReturn(self,call){if(call&&("object"===customelement_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return customelement_assertThisInitialized(self)}function customelement_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function customelement_wrapNativeSuper(Class){var _cache="function"==typeof Map?new Map:void 0;return(customelement_wrapNativeSuper=function _wrapNativeSuper(Class){if(null===Class||!function customelement_isNativeFunction(fn){return-1!==Function.toString.call(fn).indexOf("[native code]")}(Class))return Class;if("function"!=typeof Class)throw new TypeError("Super expression must either be null or a function");if(void 0!==_cache){if(_cache.has(Class))return _cache.get(Class);_cache.set(Class,Wrapper)}function Wrapper(){return customelement_construct(Class,arguments,customelement_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(Class.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),customelement_setPrototypeOf(Wrapper,Class)})(Class)}function customelement_construct(Parent,args,Class){return(customelement_construct=customelement_isNativeReflectConstruct()?Reflect.construct:function _construct(Parent,args,Class){var a=[null];a.push.apply(a,args);var instance=new(Function.bind.apply(Parent,a));return Class&&customelement_setPrototypeOf(instance,Class.prototype),instance}).apply(null,arguments)}function customelement_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function customelement_setPrototypeOf(o,p){return(customelement_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function customelement_getPrototypeOf(o){return(customelement_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",Updater);var initMethodSymbol=Symbol("initMethodSymbol"),assembleMethodSymbol=Symbol("assembleMethodSymbol"),attributeObserverSymbol=Symbol("attributeObserver"),CustomElement=function(_HTMLElement){!function customelement_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&customelement_setPrototypeOf(subClass,superClass)}(CustomElement,_HTMLElement);var _super=function customelement_createSuper(Derived){var hasNativeReflectConstruct=customelement_isNativeReflectConstruct();return function _createSuperInternal(){var result,Super=customelement_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=customelement_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return customelement_possibleConstructorReturn(this,result)}}(CustomElement);function CustomElement(){var _this;return function customelement_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,CustomElement),(_this=_super.call(this))[internalSymbol]=new ProxyObserver({options:extend({},_this.defaults,getOptionsFromAttributes.call(customelement_assertThisInitialized(_this)))}),_this[attributeObserverSymbol]={},initOptionObserver.call(customelement_assertThisInitialized(_this)),_this[initMethodSymbol](),_this}return function customelement_createClass(Constructor,protoProps,staticProps){return protoProps&&customelement_defineProperties(Constructor.prototype,protoProps),staticProps&&customelement_defineProperties(Constructor,staticProps),Constructor}(CustomElement,[{key:"defaults",get:function get(){return{ATTRIBUTE_DISABLED:this.getAttribute("disabled"),shadowMode:"open",delegatesFocus:!0,templates:{main:void 0}}}},{key:"attachObserver",value:function attachObserver(observer){return this[internalSymbol].attachObserver(observer),this}},{key:"detachObserver",value:function detachObserver(observer){return this[internalSymbol].detachObserver(observer),this}},{key:"containsObserver",value:function containsObserver(observer){return this[internalSymbol].containsObserver(observer)}},{key:"getOption",value:function getOption(path,defaultValue){var value;try{value=new Pathfinder(this[internalSymbol].getRealSubject().options).getVia(path)}catch(e){}return void 0===value?defaultValue:value}},{key:"setOption",value:function setOption(path,value){return new Pathfinder(this[internalSymbol].getSubject().options).setVia(path,value),this}},{key:"setOptions",value:function setOptions(options){isString(options)&&(options=parseOptionsJSON(options));return extend(this[internalSymbol].getSubject().options,this.defaults,options),this}},{key:initMethodSymbol,value:function value(){return this}},{key:assembleMethodSymbol,value:function value(){var elements,nodeList;if(!1!==this.getOption("shadowMode",!1)){try{initShadowRoot.call(this),elements=this.shadowRoot.childNodes}catch(e){}try{initCSSStylesheet.call(this)}catch(e){}}elements instanceof NodeList||elements instanceof NodeList||(initHtmlContent.call(this),elements=this.childNodes);try{nodeList=new Set([].concat(customelement_toConsumableArray(elements),customelement_toConsumableArray(getSlottedElements.call(this))))}catch(e){nodeList=elements}return assignUpdaterToElement.call(this,nodeList,clone(this[internalSymbol].getRealSubject().options)),this}},{key:"connectedCallback",value:function connectedCallback(){hasObjectLink(this,objectUpdaterLinkSymbol)||this[assembleMethodSymbol]()}},{key:"disconnectedCallback",value:function disconnectedCallback(){}},{key:"adoptedCallback",value:function adoptedCallback(){}},{key:"attributeChangedCallback",value:function attributeChangedCallback(attrName,oldVal,newVal){var _self$attributeObserv,callback=null===(_self$attributeObserv=this[attributeObserverSymbol])||void 0===_self$attributeObserv?void 0:_self$attributeObserv[attrName];isFunction(callback)&&callback.call(this,newVal,oldVal)}},{key:"hasNode",value:function hasNode(node){return!!containChildNode.call(this,validateInstance(node,Node))||this.shadowRoot instanceof ShadowRoot&&containChildNode.call(this.shadowRoot,node)}}],[{key:"observedAttributes",get:function get(){return["data-monster-options","disabled"]}},{key:"getTag",value:function getTag(){throw new Error("the method getTag must be overwritten by the derived class.")}},{key:"getCSSStyleSheet",value:function getCSSStyleSheet(){}}]),CustomElement}(customelement_wrapNativeSuper(HTMLElement));function getSlottedElements(query,name){var result=new Set;if(!(this.shadowRoot instanceof ShadowRoot))return result;var selector="slot";void 0!==name&&(selector+=null===name?":not([name])":"[name="+validateString(name)+"]");for(var slots=this.shadowRoot.querySelectorAll(selector),_i=0,_Object$entries=Object.entries(slots);_i<_Object$entries.length;_i++){customelement_slicedToArray(_Object$entries[_i],2)[1].assignedElements().forEach((function(node){if(node instanceof HTMLElement)if(isString(query))node.querySelectorAll(query).forEach((function(n){result.add(n)})),node.matches(query)&&result.add(node);else{if(void 0!==query)throw new Error("query must be a string");result.add(node)}}))}return result}function containChildNode(node){if(this.contains(node))return!0;for(var _i2=0,_Object$entries2=Object.entries(this.childNodes);_i2<_Object$entries2.length;_i2++){var e=customelement_slicedToArray(_Object$entries2[_i2],2)[1];if(e.contains(node))return!0;containChildNode.call(e,node)}return!1}function initOptionObserver(){var self=this,lastDisabledValue=void 0;self.attachObserver(new Observer((function(){var flag=self.getOption("disabled");if(flag!==lastDisabledValue&&(lastDisabledValue=flag,self.shadowRoot instanceof ShadowRoot)){var nodeList,query="button, command, fieldset, keygen, optgroup, option, select, textarea, input, [data-monster-objectlink]",elements=self.shadowRoot.querySelectorAll(query);try{nodeList=new Set([].concat(customelement_toConsumableArray(elements),customelement_toConsumableArray(getSlottedElements.call(self,query))))}catch(e){nodeList=elements}for(var _i3=0,_arr2=customelement_toConsumableArray(nodeList);_i3<_arr2.length;_i3++){var element=_arr2[_i3];!0===flag?element.setAttribute("disabled",""):element.removeAttribute("disabled")}}}))),self.attachObserver(new Observer((function(){if(hasObjectLink(self,objectUpdaterLinkSymbol)){var _step,_iterator=customelement_createForOfIteratorHelper(getLinkedObjects(self,objectUpdaterLinkSymbol));try{for(_iterator.s();!(_step=_iterator.n()).done;){var _step2,_iterator2=customelement_createForOfIteratorHelper(_step.value);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var updater=_step2.value,d=clone(self[internalSymbol].getRealSubject().options);Object.assign(updater.getSubject(),d)}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}}catch(err){_iterator.e(err)}finally{_iterator.f()}}}))),self[attributeObserverSymbol].disabled=function(newVal){self.hasAttribute("disabled")?self.setOption("disabled",!0):self.setOption("disabled",void 0)},self[attributeObserverSymbol]["data-monster-options"]=function(){var options=getOptionsFromAttributes.call(self);isObject(options)&&self.setOptions(options)}}function getOptionsFromAttributes(){if(this.hasAttribute("data-monster-options"))try{return parseOptionsJSON(this.getAttribute("data-monster-options"))}catch(e){throw new Error("the options attribute data-monster-options does not contain a valid json definition (actual: "+this.getAttribute("data-monster-options")+").")}return{}}function parseOptionsJSON(data){if(isString(data)){try{data=parseDataURL(data).content}catch(e){}try{var obj=JSON.parse(data);return validateObject(obj),obj}catch(e){throw new Error("the options does not contain a valid json definition (actual: "+data+").")}}return{}}function initHtmlContent(){try{var template=findDocumentTemplate(this.constructor.getTag());this.appendChild(template.createDocumentFragment())}catch(e){var html=this.getOption("templates.main","");isString(html)&&html.length>0&&(this.innerHTML=html)}return this}function initCSSStylesheet(){if(!(this.shadowRoot instanceof ShadowRoot))return this;var styleSheet=this.constructor.getCSSStyleSheet();if(styleSheet instanceof CSSStyleSheet)this.shadowRoot.adoptedStyleSheets=[styleSheet];else if(isArray(styleSheet))this.shadowRoot.adoptedStyleSheets=styleSheet;else if(isString(styleSheet)){this.shadowRoot.createElement("<style>").innerText=styleSheet,this.shadowRoot.adoptedStyleSheets=styleSheet}return this}function initShadowRoot(){var template,html;try{template=findDocumentTemplate(this.constructor.getTag())}catch(e){if(!isString(html=this.getOption("templates.main",""))||void 0===html||""===html)throw new Error("html is not set.")}return this.attachShadow({mode:this.getOption("shadowMode","open"),delegatesFocus:this.getOption("delegatesFocus",!0)}),template instanceof Template?(this.shadowRoot.appendChild(template.createDocumentFragment()),this):(this.shadowRoot.innerHTML=html,this)}function assignUpdaterToElement(elements,object){var updaters=new Set;elements instanceof NodeList&&(elements=new Set(customelement_toConsumableArray(elements)));var result=[];return elements.forEach((function(element){if(element instanceof HTMLElement&&!(element instanceof HTMLTemplateElement)){var u=new Updater(element,object);updaters.add(u),result.push(u.run().then((function(){return u.enableEventProcessing()})))}})),updaters.size>0&&addToObjectLink(this,objectUpdaterLinkSymbol,updaters),result}function customcontrol_typeof(obj){return(customcontrol_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function customcontrol_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function customcontrol_get(target,property,receiver){return(customcontrol_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(target,property,receiver){var base=function customcontrol_superPropBase(object,property){for(;!Object.prototype.hasOwnProperty.call(object,property)&&null!==(object=customcontrol_getPrototypeOf(object)););return object}(target,property);if(base){var desc=Object.getOwnPropertyDescriptor(base,property);return desc.get?desc.get.call(receiver):desc.value}})(target,property,receiver||target)}function customcontrol_setPrototypeOf(o,p){return(customcontrol_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function customcontrol_createSuper(Derived){var hasNativeReflectConstruct=function customcontrol_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=customcontrol_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=customcontrol_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return customcontrol_possibleConstructorReturn(this,result)}}function customcontrol_possibleConstructorReturn(self,call){if(call&&("object"===customcontrol_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return customcontrol_assertThisInitialized(self)}function customcontrol_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function customcontrol_getPrototypeOf(o){return(customcontrol_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",CustomElement,(function registerCustomElement(element){validateFunction(element),getGlobalObject("customElements").define(element.getTag(),element)}),assignUpdaterToElement);var attachedInternalSymbol=Symbol("attachedInternal");function getInternal(){if(!(attachedInternalSymbol in this))throw new Error("ElementInternals is not supported and a polyfill is necessary");return this[attachedInternalSymbol]}function initObserver(){var self=this;self[attributeObserverSymbol].value=function(){self.setOption("value",self.getAttribute("value"))}}function locale_typeof(obj){return(locale_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function locale_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function locale_setPrototypeOf(o,p){return(locale_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function locale_createSuper(Derived){var hasNativeReflectConstruct=function locale_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=locale_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=locale_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return locale_possibleConstructorReturn(this,result)}}function locale_possibleConstructorReturn(self,call){if(call&&("object"===locale_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function locale_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function locale_getPrototypeOf(o){return(locale_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",function(_CustomElement){!function customcontrol_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&customcontrol_setPrototypeOf(subClass,superClass)}(CustomControl,_CustomElement);var _super=customcontrol_createSuper(CustomControl);function CustomControl(){var _this;return function customcontrol_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,CustomControl),"function"==typeof(_this=_super.call(this)).attachInternals&&(_this[attachedInternalSymbol]=_this.attachInternals()),initObserver.call(customcontrol_assertThisInitialized(_this)),_this}return function customcontrol_createClass(Constructor,protoProps,staticProps){return protoProps&&customcontrol_defineProperties(Constructor.prototype,protoProps),staticProps&&customcontrol_defineProperties(Constructor,staticProps),Constructor}(CustomControl,[{key:"defaults",get:function get(){return extend({},customcontrol_get(customcontrol_getPrototypeOf(CustomControl.prototype),"defaults",this))}},{key:"value",get:function get(){throw Error("the value getter must be overwritten by the derived class")},set:function set(value){throw Error("the value setter must be overwritten by the derived class")}},{key:"labels",get:function get(){var _getInternal$call;return null===(_getInternal$call=getInternal.call(this))||void 0===_getInternal$call?void 0:_getInternal$call.labels}},{key:"name",get:function get(){return this.getAttribute("name")}},{key:"type",get:function get(){return this.constructor.getTag()}},{key:"validity",get:function get(){var _getInternal$call2;return null===(_getInternal$call2=getInternal.call(this))||void 0===_getInternal$call2?void 0:_getInternal$call2.validity}},{key:"validationMessage",get:function get(){var _getInternal$call3;return null===(_getInternal$call3=getInternal.call(this))||void 0===_getInternal$call3?void 0:_getInternal$call3.validationMessage}},{key:"willValidate",get:function get(){var _getInternal$call4;return null===(_getInternal$call4=getInternal.call(this))||void 0===_getInternal$call4?void 0:_getInternal$call4.willValidate}},{key:"states",get:function get(){var _getInternal$call5;return null===(_getInternal$call5=getInternal.call(this))||void 0===_getInternal$call5?void 0:_getInternal$call5.states}},{key:"form",get:function get(){var _getInternal$call6;return null===(_getInternal$call6=getInternal.call(this))||void 0===_getInternal$call6?void 0:_getInternal$call6.form}},{key:"setFormValue",value:function setFormValue(value,state){getInternal.call(this).setFormValue(value,state)}},{key:"setValidity",value:function setValidity(flags,message,anchor){getInternal.call(this).setValidity(flags,message,anchor)}},{key:"checkValidity",value:function checkValidity(){var _getInternal$call7;return null===(_getInternal$call7=getInternal.call(this))||void 0===_getInternal$call7?void 0:_getInternal$call7.checkValidity()}},{key:"reportValidity",value:function reportValidity(){var _getInternal$call8;return null===(_getInternal$call8=getInternal.call(this))||void 0===_getInternal$call8?void 0:_getInternal$call8.reportValidity()}}],[{key:"observedAttributes",get:function get(){var list=customcontrol_get(customcontrol_getPrototypeOf(CustomControl),"observedAttributes",this);return list.push("value"),list}},{key:"formAssociated",get:function get(){return!0}}]),CustomControl}(CustomElement));var propertiesSymbol=Symbol("properties"),localeStringSymbol=Symbol("localeString"),Locale=function(_Base){!function locale_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&locale_setPrototypeOf(subClass,superClass)}(Locale,_Base);var _super=locale_createSuper(Locale);function Locale(language,region,script,variants,extlang,privateUse){var _this;!function locale_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Locale),(_this=_super.call(this))[propertiesSymbol]={language:void 0===language?void 0:validateString(language),script:void 0===script?void 0:validateString(script),region:void 0===region?void 0:validateString(region),variants:void 0===variants?void 0:validateString(variants),extlang:void 0===extlang?void 0:validateString(extlang),privateUse:void 0===privateUse?void 0:validateString(privateUse)};var s=[];if(void 0!==language&&s.push(language),void 0!==script&&s.push(script),void 0!==region&&s.push(region),void 0!==variants&&s.push(variants),void 0!==extlang&&s.push(extlang),void 0!==privateUse&&s.push(privateUse),0===s.length)throw new Error("unsupported locale");return _this[localeStringSymbol]=s.join("-"),_this}return function locale_createClass(Constructor,protoProps,staticProps){return protoProps&&locale_defineProperties(Constructor.prototype,protoProps),staticProps&&locale_defineProperties(Constructor,staticProps),Constructor}(Locale,[{key:"localeString",get:function get(){return this[localeStringSymbol]}},{key:"language",get:function get(){return this[propertiesSymbol].language}},{key:"region",get:function get(){return this[propertiesSymbol].region}},{key:"script",get:function get(){return this[propertiesSymbol].script}},{key:"variants",get:function get(){return this[propertiesSymbol].variants}},{key:"extlang",get:function get(){return this[propertiesSymbol].extlang}},{key:"privateUse",get:function get(){return this[propertiesSymbol].privateValue}},{key:"toString",value:function toString(){return""+this.localeString}},{key:"getMap",value:function getMap(){return clone(this[propertiesSymbol])}}]),Locale}(Base);function parseLocale(locale){locale=validateString(locale).replace(/_/g,"-");var language,region,variants,parts,script,extlang,match,regex=new RegExp("^(((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((([A-Za-z]{2,3}(-([A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-([A-Za-z]{4}))?(-([A-Za-z]{2}|[0-9]{3}))?(-([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-([0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(x(-[A-Za-z0-9]{1,8})+))?)|(x(-[A-Za-z0-9]{1,8})+))$");if(null!==(match=regex.exec(locale))&&match.index===regex.lastIndex&&regex.lastIndex++,null==match)throw new Error("unsupported locale");return void 0!==match[6]&&(parts=(language=match[6]).split("-")).length>1&&(language=parts[0],extlang=parts[1]),void 0!==match[14]&&(region=match[14]),void 0!==match[12]&&(script=match[12]),void 0!==match[16]&&(variants=match[16]),new Locale(language,region,script,variants,extlang)}assignToNamespace("Monster.I18n",Locale,parseLocale);function basewithoptions_typeof(obj){return(basewithoptions_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function basewithoptions_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function basewithoptions_setPrototypeOf(o,p){return(basewithoptions_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function basewithoptions_createSuper(Derived){var hasNativeReflectConstruct=function basewithoptions_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=basewithoptions_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=basewithoptions_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return basewithoptions_possibleConstructorReturn(this,result)}}function basewithoptions_possibleConstructorReturn(self,call){if(call&&("object"===basewithoptions_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function basewithoptions_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function basewithoptions_getPrototypeOf(o){return(basewithoptions_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",(function getLocaleOfDocument(){var html=getDocument().querySelector("html");if(html instanceof HTMLElement&&html.hasAttribute("lang")){var locale=html.getAttribute("lang");if(locale)return new parseLocale(locale)}return parseLocale("en")}));var BaseWithOptions=function(_Base){!function basewithoptions_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&basewithoptions_setPrototypeOf(subClass,superClass)}(BaseWithOptions,_Base);var _super=basewithoptions_createSuper(BaseWithOptions);function BaseWithOptions(options){var _this;return function basewithoptions_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,BaseWithOptions),void 0===options&&(options={}),(_this=_super.call(this))[internalSymbol]=extend({},_this.defaults,validateObject(options)),_this}return function basewithoptions_createClass(Constructor,protoProps,staticProps){return protoProps&&basewithoptions_defineProperties(Constructor.prototype,protoProps),staticProps&&basewithoptions_defineProperties(Constructor,staticProps),Constructor}(BaseWithOptions,[{key:"defaults",get:function get(){return{}}},{key:"getOption",value:function getOption(path,defaultValue){var value;try{value=new Pathfinder(this[internalSymbol]).getVia(path)}catch(e){}return void 0===value?defaultValue:value}}]),BaseWithOptions}(Base);function translations_typeof(obj){return(translations_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function translations_slicedToArray(arr,i){return function translations_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function translations_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function translations_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return translations_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return translations_arrayLikeToArray(o,minLen)}(arr,i)||function translations_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function translations_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function translations_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function translations_setPrototypeOf(o,p){return(translations_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function translations_createSuper(Derived){var hasNativeReflectConstruct=function translations_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=translations_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=translations_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return translations_possibleConstructorReturn(this,result)}}function translations_possibleConstructorReturn(self,call){if(call&&("object"===translations_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function translations_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function translations_getPrototypeOf(o){return(translations_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",BaseWithOptions);var Translations=function(_Base){!function translations_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&translations_setPrototypeOf(subClass,superClass)}(Translations,_Base);var _super=translations_createSuper(Translations);function Translations(locale){var _this;return function translations_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Translations),_this=_super.call(this),isString(locale)&&(locale=parseLocale(locale)),_this.locale=validateInstance(locale,Locale),_this.storage=new Map,_this}return function translations_createClass(Constructor,protoProps,staticProps){return protoProps&&translations_defineProperties(Constructor.prototype,protoProps),staticProps&&translations_defineProperties(Constructor,staticProps),Constructor}(Translations,[{key:"getText",value:function getText(key,defaultText){if(!this.storage.has(key)){if(void 0===defaultText)throw new Error("key "+key+" not found");return validateString(defaultText)}return isObject(this.storage.get(key))?this.getPluralRuleText(key,"other",defaultText):this.storage.get(key)}},{key:"getPluralRuleText",value:function getPluralRuleText(key,count,defaultText){if(!this.storage.has(key))return validateString(defaultText);var keyword,r=validateObject(this.storage.get(key));if(isString(count))keyword=count.toLocaleString();else{if(0===(count=validateInteger(count))&&r.hasOwnProperty("zero"))return validateString(r.zero);keyword=new Intl.PluralRules(this.locale.toString()).select(validateInteger(count))}return r.hasOwnProperty(keyword)?validateString(r[keyword]):r.hasOwnProperty(DEFAULT_KEY)?validateString(r[DEFAULT_KEY]):validateString(defaultText)}},{key:"setText",value:function setText(key,text){if(isString(text)||isObject(text))return this.storage.set(validateString(key),text),this;throw new TypeError("value is not a string or object")}},{key:"assignTranslations",value:function assignTranslations(translations){validateObject(translations);for(var _i=0,_Object$entries=Object.entries(translations);_i<_Object$entries.length;_i++){var _Object$entries$_i=translations_slicedToArray(_Object$entries[_i],2),k=_Object$entries$_i[0],v=_Object$entries$_i[1];this.setText(k,v)}return this}}]),Translations}(Base);function provider_typeof(obj){return(provider_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function provider_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function provider_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function provider_setPrototypeOf(o,p){return(provider_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function provider_createSuper(Derived){var hasNativeReflectConstruct=function provider_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=provider_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=provider_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return provider_possibleConstructorReturn(this,result)}}function provider_possibleConstructorReturn(self,call){if(call&&("object"===provider_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function provider_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function provider_getPrototypeOf(o){return(provider_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.I18n",Translations);var Provider=function(_BaseWithOptions){!function provider_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&provider_setPrototypeOf(subClass,superClass)}(Provider,_BaseWithOptions);var _super=provider_createSuper(Provider);function Provider(){return provider_classCallCheck(this,Provider),_super.apply(this,arguments)}return function provider_createClass(Constructor,protoProps,staticProps){return protoProps&&provider_defineProperties(Constructor.prototype,protoProps),staticProps&&provider_defineProperties(Constructor,staticProps),Constructor}(Provider,[{key:"getTranslations",value:function getTranslations(locale){return new Promise((function(resolve,reject){try{resolve(new Translations(locale))}catch(e){reject(e)}}))}}]),Provider}(BaseWithOptions);function formatter_typeof(obj){return(formatter_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function formatter_slicedToArray(arr,i){return function formatter_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function formatter_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||formatter_unsupportedIterableToArray(arr,i)||function formatter_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function formatter_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=formatter_unsupportedIterableToArray(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e2){throw _e2},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e3){didErr=!0,err=_e3},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function formatter_unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return formatter_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?formatter_arrayLikeToArray(o,minLen):void 0}}function formatter_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function formatter_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function formatter_get(target,property,receiver){return(formatter_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(target,property,receiver){var base=function formatter_superPropBase(object,property){for(;!Object.prototype.hasOwnProperty.call(object,property)&&null!==(object=formatter_getPrototypeOf(object)););return object}(target,property);if(base){var desc=Object.getOwnPropertyDescriptor(base,property);return desc.get?desc.get.call(receiver):desc.value}})(target,property,receiver||target)}function formatter_setPrototypeOf(o,p){return(formatter_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function formatter_createSuper(Derived){var hasNativeReflectConstruct=function formatter_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=formatter_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=formatter_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return formatter_possibleConstructorReturn(this,result)}}function formatter_possibleConstructorReturn(self,call){if(call&&("object"===formatter_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function formatter_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function formatter_getPrototypeOf(o){return(formatter_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.I18n",Provider);var internalObjectSymbol=Symbol("internalObject"),watchdogSymbol=Symbol("watchdog"),markerOpenIndexSymbol=Symbol("markerOpenIndex"),markerCloseIndexSymbol=Symbol("markercloseIndex"),workingDataSymbol=Symbol("workingData"),Formatter=function(_BaseWithOptions){!function formatter_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&formatter_setPrototypeOf(subClass,superClass)}(Formatter,_BaseWithOptions);var _super=formatter_createSuper(Formatter);function Formatter(object,options){var _this;return function formatter_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Formatter),(_this=_super.call(this,options))[internalObjectSymbol]=object||{},_this[markerOpenIndexSymbol]=0,_this[markerCloseIndexSymbol]=0,_this}return function formatter_createClass(Constructor,protoProps,staticProps){return protoProps&&formatter_defineProperties(Constructor.prototype,protoProps),staticProps&&formatter_defineProperties(Constructor,staticProps),Constructor}(Formatter,[{key:"defaults",get:function get(){return extend({},formatter_get(formatter_getPrototypeOf(Formatter.prototype),"defaults",this),{marker:{open:["${"],close:["}"]},parameter:{delimiter:"::",assignment:"="},callbacks:{}})}},{key:"setParameterChars",value:function setParameterChars(delimiter,assignment){return void 0!==delimiter&&(this[internalSymbol].parameter.delimiter=validateString(delimiter)),void 0!==assignment&&(this[internalSymbol].parameter.assignment=validateString(assignment)),this}},{key:"setMarker",value:function setMarker(open,close){return void 0===close&&(close=open),isString(open)&&(open=[open]),isString(close)&&(close=[close]),this[internalSymbol].marker.open=validateArray(open),this[internalSymbol].marker.close=validateArray(close),this}},{key:"format",value:function format(text){return this[watchdogSymbol]=0,this[markerOpenIndexSymbol]=0,this[markerCloseIndexSymbol]=0,this[workingDataSymbol]={},_format.call(this,text)}}]),Formatter}(BaseWithOptions);function _format(text){var _self$internalSymbol$,_self$internalSymbol$2,_self$internalSymbol$3,_self$internalSymbol$4;if(this[watchdogSymbol]++,this[watchdogSymbol]>20)throw new Error("too deep nesting");var openMarker=null===(_self$internalSymbol$=this[internalSymbol].marker.open)||void 0===_self$internalSymbol$?void 0:_self$internalSymbol$[this[markerOpenIndexSymbol]],closeMarker=null===(_self$internalSymbol$2=this[internalSymbol].marker.close)||void 0===_self$internalSymbol$2?void 0:_self$internalSymbol$2[this[markerCloseIndexSymbol]];if(-1===text.indexOf(openMarker)||-1===text.indexOf(closeMarker))return text;var result=tokenize.call(this,validateString(text),openMarker,closeMarker);return null!==(_self$internalSymbol$3=this[internalSymbol].marker.open)&&void 0!==_self$internalSymbol$3&&_self$internalSymbol$3[this[markerOpenIndexSymbol]+1]&&this[markerOpenIndexSymbol]++,null!==(_self$internalSymbol$4=this[internalSymbol].marker.close)&&void 0!==_self$internalSymbol$4&&_self$internalSymbol$4[this[markerCloseIndexSymbol]+1]&&this[markerCloseIndexSymbol]++,result=_format.call(this,result)}function tokenize(text,openMarker,closeMarker){for(var formatted=[],parameterAssignment=this[internalSymbol].parameter.assignment,parameterDelimiter=this[internalSymbol].parameter.delimiter,callbacks=this[internalSymbol].callbacks;;){var _self$workingDataSymb,startIndex=text.indexOf(openMarker);if(-1===startIndex){formatted.push(text);break}startIndex>0&&(formatted.push(text.substring(0,startIndex)),text=text.substring(startIndex));var endIndex=text.substring(openMarker.length).indexOf(closeMarker);-1!==endIndex&&(endIndex+=openMarker.length);var insideStartIndex=text.substring(openMarker.length).indexOf(openMarker);if(-1!==insideStartIndex&&(insideStartIndex+=openMarker.length)<endIndex){var result=tokenize.call(this,text.substring(insideStartIndex),openMarker,closeMarker);-1!==(endIndex=(text=text.substring(0,insideStartIndex)+result).substring(openMarker.length).indexOf(closeMarker))&&(endIndex+=openMarker.length)}if(-1===endIndex)throw new Error("syntax error in formatter template");var key=text.substring(openMarker.length,endIndex),parts=key.split(parameterDelimiter),currentPipe=parts.shift();this[workingDataSymbol]=extend({},this[internalObjectSymbol],this[workingDataSymbol]);var _step,_iterator=formatter_createForOfIteratorHelper(parts);try{for(_iterator.s();!(_step=_iterator.n()).done;){var _kv$split2=formatter_slicedToArray(_step.value.split(parameterAssignment),2),k=_kv$split2[0],v=_kv$split2[1];this[workingDataSymbol][k]=v}}catch(err){_iterator.e(err)}finally{_iterator.f()}var t3=key.split("|").shift().trim().split("::").shift().trim().split(".").shift().trim(),prefix=null!==(_self$workingDataSymb=this[workingDataSymbol])&&void 0!==_self$workingDataSymb&&_self$workingDataSymb[t3]?"path:":"static:",command="";prefix&&0!==key.indexOf(prefix)&&0!==key.indexOf("path:")&&0!==key.indexOf("static:")&&(command=prefix);var pipe=new Pipe(command+=currentPipe);if(isObject(callbacks))for(var _i=0,_Object$entries=Object.entries(callbacks);_i<_Object$entries.length;_i++){var _Object$entries$_i=formatter_slicedToArray(_Object$entries[_i],2),name=_Object$entries$_i[0],callback=_Object$entries$_i[1];pipe.setCallback(name,callback)}formatted.push(validateString(pipe.run(this[workingDataSymbol]))),text=text.substring(endIndex+closeMarker.length)}return formatted.join("")}function fetch_typeof(obj){return(fetch_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function fetch_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function fetch_setPrototypeOf(o,p){return(fetch_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function fetch_createSuper(Derived){var hasNativeReflectConstruct=function fetch_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=fetch_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=fetch_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return fetch_possibleConstructorReturn(this,result)}}function fetch_possibleConstructorReturn(self,call){if(call&&("object"===fetch_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return fetch_assertThisInitialized(self)}function fetch_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function fetch_get(target,property,receiver){return(fetch_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(target,property,receiver){var base=function fetch_superPropBase(object,property){for(;!Object.prototype.hasOwnProperty.call(object,property)&&null!==(object=fetch_getPrototypeOf(object)););return object}(target,property);if(base){var desc=Object.getOwnPropertyDescriptor(base,property);return desc.get?desc.get.call(receiver):desc.value}})(target,property,receiver||target)}function fetch_getPrototypeOf(o){return(fetch_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function logentry_typeof(obj){return(logentry_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function logentry_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function logentry_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function logentry_setPrototypeOf(o,p){return(logentry_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function logentry_createSuper(Derived){var hasNativeReflectConstruct=function logentry_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=logentry_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=logentry_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return logentry_possibleConstructorReturn(this,result)}}function logentry_possibleConstructorReturn(self,call){if(call&&("object"===logentry_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function logentry_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function logentry_getPrototypeOf(o){return(logentry_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Text",Formatter),assignToNamespace("Monster.I18n.Providers",function(_Provider){!function fetch_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&fetch_setPrototypeOf(subClass,superClass)}(Fetch,_Provider);var _super=fetch_createSuper(Fetch);function Fetch(url,options){var _thisSuper,_this;return function fetch_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Fetch),_this=_super.call(this,options),isInstance(url,URL)&&(url=url.toString()),void 0===options&&(options={}),validateString(url),_this.url=url,_this[internalSymbol]=extend({},fetch_get((_thisSuper=fetch_assertThisInitialized(_this),fetch_getPrototypeOf(Fetch.prototype)),"defaults",_thisSuper),_this.defaults,validateObject(options)),_this}return function fetch_createClass(Constructor,protoProps,staticProps){return protoProps&&fetch_defineProperties(Constructor.prototype,protoProps),staticProps&&fetch_defineProperties(Constructor,staticProps),Constructor}(Fetch,[{key:"defaults",get:function get(){return{fetch:{method:"GET",mode:"cors",cache:"no-cache",credentials:"omit",redirect:"follow",referrerPolicy:"no-referrer"}}}},{key:"getTranslations",value:function getTranslations(locale){isString(locale)&&(locale=parseLocale(locale));var formatter=new Formatter(locale.getMap());return getGlobalFunction("fetch")(formatter.format(this.url),this.getOption("fetch",{})).then((function(response){return response.json()})).then((function(data){return new Translations(locale).assignTranslations(data)}))}}]),Fetch}(Provider));var LogEntry=function(_Base){!function logentry_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&logentry_setPrototypeOf(subClass,superClass)}(LogEntry,_Base);var _super=logentry_createSuper(LogEntry);function LogEntry(loglevel){var _this;logentry_classCallCheck(this,LogEntry),_this=_super.call(this),validateInteger(loglevel),_this.loglevel=loglevel;for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];return _this.arguments=args,_this}return function logentry_createClass(Constructor,protoProps,staticProps){return protoProps&&logentry_defineProperties(Constructor.prototype,protoProps),staticProps&&logentry_defineProperties(Constructor,staticProps),Constructor}(LogEntry,[{key:"getLogLevel",value:function getLogLevel(){return this.loglevel}},{key:"getArguments",value:function getArguments(){return this.arguments}}]),LogEntry}(Base);function logger_typeof(obj){return(logger_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function logger_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function logger_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return logger_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return logger_arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function logger_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function logger_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function logger_setPrototypeOf(o,p){return(logger_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function logger_createSuper(Derived){var hasNativeReflectConstruct=function logger_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=logger_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=logger_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return logger_possibleConstructorReturn(this,result)}}function logger_possibleConstructorReturn(self,call){if(call&&("object"===logger_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function logger_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function logger_getPrototypeOf(o){return(logger_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Logging",LogEntry);var TRACE=64,DEBUG=32,INFO=16,WARN=8,ERROR=4,FATAL=2;function triggerLog(loglevel){for(var logger=this,_len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];var _step,_iterator=logger_createForOfIteratorHelper(logger.handler);try{for(_iterator.s();!(_step=_iterator.n()).done;){var handler=_step.value;handler.log(new LogEntry(loglevel,args))}}catch(err){_iterator.e(err)}finally{_iterator.f()}return logger}function handler_typeof(obj){return(handler_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function handler_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function handler_setPrototypeOf(o,p){return(handler_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function handler_createSuper(Derived){var hasNativeReflectConstruct=function handler_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=handler_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=handler_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return handler_possibleConstructorReturn(this,result)}}function handler_possibleConstructorReturn(self,call){if(call&&("object"===handler_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function handler_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function handler_getPrototypeOf(o){return(handler_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Logging",function(_Base){!function logger_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&logger_setPrototypeOf(subClass,superClass)}(Logger,_Base);var _super=logger_createSuper(Logger);function Logger(){var _this;return function logger_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Logger),(_this=_super.call(this)).handler=new Set,_this}return function logger_createClass(Constructor,protoProps,staticProps){return protoProps&&logger_defineProperties(Constructor.prototype,protoProps),staticProps&&logger_defineProperties(Constructor,staticProps),Constructor}(Logger,[{key:"addHandler",value:function addHandler(handler){if(validateObject(handler),!(handler instanceof Handler))throw new Error("the handler must be an instance of Handler");return this.handler.add(handler),this}},{key:"removeHandler",value:function removeHandler(handler){if(validateObject(handler),!(handler instanceof Handler))throw new Error("the handler must be an instance of Handler");return this.handler.delete(handler),this}},{key:"logTrace",value:function logTrace(){return triggerLog.apply(this,[TRACE].concat(Array.prototype.slice.call(arguments))),this}},{key:"logDebug",value:function logDebug(){return triggerLog.apply(this,[DEBUG].concat(Array.prototype.slice.call(arguments))),this}},{key:"logInfo",value:function logInfo(){return triggerLog.apply(this,[INFO].concat(Array.prototype.slice.call(arguments))),this}},{key:"logWarn",value:function logWarn(){return triggerLog.apply(this,[WARN].concat(Array.prototype.slice.call(arguments))),this}},{key:"logError",value:function logError(){return triggerLog.apply(this,[ERROR].concat(Array.prototype.slice.call(arguments))),this}},{key:"logFatal",value:function logFatal(){return triggerLog.apply(this,[FATAL].concat(Array.prototype.slice.call(arguments))),this}},{key:"getLabel",value:function getLabel(level){return validateInteger(level),255===level?"ALL":level===TRACE?"TRACE":level===DEBUG?"DEBUG":level===INFO?"INFO":level===WARN?"WARN":level===ERROR?"ERROR":level===FATAL?"FATAL":0===level?"OFF":"unknown"}},{key:"getLevel",value:function getLevel(label){return validateString(label),"ALL"===label?255:"TRACE"===label?TRACE:"DEBUG"===label?DEBUG:"INFO"===label?INFO:"WARN"===label?WARN:"ERROR"===label?ERROR:"FATAL"===label?FATAL:0}}]),Logger}(Base));var Handler=function(_Base){!function handler_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&handler_setPrototypeOf(subClass,superClass)}(Handler,_Base);var _super=handler_createSuper(Handler);function Handler(){var _this;return function handler_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Handler),(_this=_super.call(this)).loglevel=0,_this}return function handler_createClass(Constructor,protoProps,staticProps){return protoProps&&handler_defineProperties(Constructor.prototype,protoProps),staticProps&&handler_defineProperties(Constructor,staticProps),Constructor}(Handler,[{key:"log",value:function log(entry){return validateInstance(entry,LogEntry),!(this.loglevel<entry.getLogLevel())}},{key:"setLogLevel",value:function setLogLevel(loglevel){return validateInteger(loglevel),this.loglevel=loglevel,this}},{key:"getLogLevel",value:function getLogLevel(){return this.loglevel}},{key:"setAll",value:function setAll(){return this.setLogLevel(255),this}},{key:"setTrace",value:function setTrace(){return this.setLogLevel(TRACE),this}},{key:"setDebug",value:function setDebug(){return this.setLogLevel(DEBUG),this}},{key:"setInfo",value:function setInfo(){return this.setLogLevel(INFO),this}},{key:"setWarn",value:function setWarn(){return this.setLogLevel(WARN),this}},{key:"setError",value:function setError(){return this.setLogLevel(ERROR),this}},{key:"setFatal",value:function setFatal(){return this.setLogLevel(FATAL),this}},{key:"setOff",value:function setOff(){return this.setLogLevel(0),this}}]),Handler}(Base);function console_typeof(obj){return(console_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function console_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function console_get(target,property,receiver){return(console_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(target,property,receiver){var base=function console_superPropBase(object,property){for(;!Object.prototype.hasOwnProperty.call(object,property)&&null!==(object=console_getPrototypeOf(object)););return object}(target,property);if(base){var desc=Object.getOwnPropertyDescriptor(base,property);return desc.get?desc.get.call(receiver):desc.value}})(target,property,receiver||target)}function console_setPrototypeOf(o,p){return(console_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function console_createSuper(Derived){var hasNativeReflectConstruct=function console_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=console_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=console_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return console_possibleConstructorReturn(this,result)}}function console_possibleConstructorReturn(self,call){if(call&&("object"===console_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function console_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function console_getPrototypeOf(o){return(console_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function random(min,max){if(void 0===min&&(min=0),void 0===max&&(max=MAX),max<min)throw new Error("max must be greater than min");return Math.round(create(min,max))}assignToNamespace("Monster.Logging",Handler),assignToNamespace("Monster.Logging.Handler",function(_Handler){!function console_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&console_setPrototypeOf(subClass,superClass)}(ConsoleHandler,_Handler);var _super=console_createSuper(ConsoleHandler);function ConsoleHandler(){return function console_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ConsoleHandler),_super.call(this)}return function console_createClass(Constructor,protoProps,staticProps){return protoProps&&console_defineProperties(Constructor.prototype,protoProps),staticProps&&console_defineProperties(Constructor,staticProps),Constructor}(ConsoleHandler,[{key:"log",value:function log(entry){if(console_get(console_getPrototypeOf(ConsoleHandler.prototype),"log",this).call(this,entry)){var console=getGlobalObject("console");return!!console&&(console.log(entry.toString()),!0)}return!1}}]),ConsoleHandler}(Handler));var MAX=1e9;function create(min,max){var crypt,globalReference=getGlobal();if(void 0===(crypt=(null==globalReference?void 0:globalReference.crypto)||(null==globalReference?void 0:globalReference.msCrypto)||(null==globalReference?void 0:globalReference.crypto)||void 0))throw new Error("missing crypt");var rval=0,range=max-min;if(range<2)throw new Error("the distance is too small to create a random number.");var bitsNeeded=Math.ceil(Math.log2(range));if(bitsNeeded>53)throw new Error("we cannot generate numbers larger than 53 bits.");var bytesNeeded=Math.ceil(bitsNeeded/8),mask=Math.pow(2,bitsNeeded)-1,byteArray=new Uint8Array(bytesNeeded);crypt.getRandomValues(byteArray);for(var p=8*(bytesNeeded-1),i=0;i<bytesNeeded;i++)rval+=byteArray[i]*Math.pow(2,p),p-=8;return(rval&=mask)>=range?create(min,max):(rval<min&&(rval+=min),rval)}function randomid_typeof(obj){return(randomid_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function randomid_setPrototypeOf(o,p){return(randomid_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function randomid_createSuper(Derived){var hasNativeReflectConstruct=function randomid_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=randomid_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=randomid_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return randomid_possibleConstructorReturn(this,result)}}function randomid_possibleConstructorReturn(self,call){if(call&&("object"===randomid_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function randomid_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function randomid_getPrototypeOf(o){return(randomid_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Math.log2=Math.log2||function(n){return Math.log(n)/Math.log(2)},assignToNamespace("Monster.Math",random);var randomid_internalCounter=0;function version_typeof(obj){return(version_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function version_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function version_setPrototypeOf(o,p){return(version_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function version_createSuper(Derived){var hasNativeReflectConstruct=function version_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=version_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=version_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return version_possibleConstructorReturn(this,result)}}function version_possibleConstructorReturn(self,call){if(call&&("object"===version_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function version_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function version_getPrototypeOf(o){return(version_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",function(_ID){!function randomid_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&randomid_setPrototypeOf(subClass,superClass)}(RandomID,_ID);var _super=randomid_createSuper(RandomID);function RandomID(){var _this;return function randomid_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,RandomID),_this=_super.call(this),randomid_internalCounter+=1,_this.id=getGlobal().btoa(random(1,1e4)).replace(/=/g,"").replace(/^[0-9]+/,"X")+randomid_internalCounter,_this}return RandomID}(ID));var monsterVersion,rootName,Version=function(_Base){!function version_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&version_setPrototypeOf(subClass,superClass)}(Version,_Base);var _super=version_createSuper(Version);function Version(major,minor,patch){var _this;if(function version_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Version),_this=_super.call(this),"string"==typeof major&&void 0===minor&&void 0===patch){var parts=major.toString().split(".");major=parseInt(parts[0]||0),minor=parseInt(parts[1]||0),patch=parseInt(parts[2]||0)}if(void 0===major)throw new Error("major version is undefined");if(void 0===minor&&(minor=0),void 0===patch&&(patch=0),_this.major=parseInt(major),_this.minor=parseInt(minor),_this.patch=parseInt(patch),isNaN(_this.major))throw new Error("major is not a number");if(isNaN(_this.minor))throw new Error("minor is not a number");if(isNaN(_this.patch))throw new Error("patch is not a number");return _this}return function version_createClass(Constructor,protoProps,staticProps){return protoProps&&version_defineProperties(Constructor.prototype,protoProps),staticProps&&version_defineProperties(Constructor,staticProps),Constructor}(Version,[{key:"toString",value:function toString(){return this.major+"."+this.minor+"."+this.patch}},{key:"compareTo",value:function compareTo(version){if(version instanceof Version&&(version=version.toString()),"string"!=typeof version)throw new Error("type exception");if(version===this.toString())return 0;for(var a=[this.major,this.minor,this.patch],b=version.split("."),len=Math.max(a.length,b.length),i=0;i<len;i+=1){if(a[i]&&!b[i]&&parseInt(a[i])>0||parseInt(a[i])>parseInt(b[i]))return 1;if(b[i]&&!a[i]&&parseInt(b[i])>0||parseInt(a[i])<parseInt(b[i]))return-1}return 0}}]),Version}(Base);function comparator_typeof(obj){return(comparator_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function comparator_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function comparator_setPrototypeOf(o,p){return(comparator_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function comparator_createSuper(Derived){var hasNativeReflectConstruct=function comparator_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=comparator_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=comparator_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return comparator_possibleConstructorReturn(this,result)}}function comparator_possibleConstructorReturn(self,call){if(call&&("object"===comparator_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function comparator_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function comparator_getPrototypeOf(o){return(comparator_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function freeze_typeof(obj){return(freeze_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function freeze_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function freeze_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return freeze_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return freeze_arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function freeze_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}assignToNamespace("Monster.Types",Version),assignToNamespace("Monster",(function getVersion(){return monsterVersion instanceof Version?monsterVersion:monsterVersion=new Version("1.29.0")})),assignToNamespace("Monster.Util",function(_Base){!function comparator_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&comparator_setPrototypeOf(subClass,superClass)}(Comparator,_Base);var _super=comparator_createSuper(Comparator);function Comparator(callback){var _this;if(function comparator_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Comparator),_this=_super.call(this),isFunction(callback))_this.compare=callback;else{if(void 0!==callback)throw new TypeError("unsupported type");_this.compare=function(a,b){if(comparator_typeof(a)!==comparator_typeof(b))throw new TypeError("impractical comparison","types/comparator.js");return a===b?0:a<b?-1:1}}return _this}return function comparator_createClass(Constructor,protoProps,staticProps){return protoProps&&comparator_defineProperties(Constructor.prototype,protoProps),staticProps&&comparator_defineProperties(Constructor,staticProps),Constructor}(Comparator,[{key:"reverse",value:function reverse(){var original=this.compare;return this.compare=function(a,b){return original(b,a)},this}},{key:"equal",value:function equal(a,b){return 0===this.compare(a,b)}},{key:"greaterThan",value:function greaterThan(a,b){return this.compare(a,b)>0}},{key:"greaterThanOrEqual",value:function greaterThanOrEqual(a,b){return this.greaterThan(a,b)||this.equal(a,b)}},{key:"lessThanOrEqual",value:function lessThanOrEqual(a,b){return this.lessThan(a,b)||this.equal(a,b)}},{key:"lessThan",value:function lessThan(a,b){return this.compare(a,b)<0}}]),Comparator}(Base)),assignToNamespace("Monster.Util",(function deepFreeze(object){validateObject(object);var _step,_iterator=freeze_createForOfIteratorHelper(Object.getOwnPropertyNames(object));try{for(_iterator.s();!(_step=_iterator.n()).done;){var name=_step.value,value=object[name];object[name]=value&&"object"===freeze_typeof(value)?deepFreeze(value):value}}catch(err){_iterator.e(err)}finally{_iterator.f()}return Object.freeze(object)}));try{rootName=Monster.Types.getGlobalObject("__MonsterRootName__")}catch(e){}return rootName||(rootName="Monster"),Monster.Types.getGlobal()[rootName]=Monster,__webpack_exports__}()}));
1
+ /** Monster 1.29.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ !function webpackUniversalModuleDefinition(root,factory){"object"==typeof exports&&"object"==typeof module?module.exports=factory():"function"==typeof define&&define.amd?define([],factory):"object"==typeof exports?exports.window=factory():root.window=factory()}(self,(function(){return function(){var __webpack_require__={d:function(exports,definition){for(var key in definition)__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports,key)&&Object.defineProperty(exports,key,{enumerable:!0,get:definition[key]})},o:function(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)},r:function(exports){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})}},__webpack_exports__={};function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Monster:function(){return Monster}});var Namespace=function(){function Namespace(namespace){if(function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Namespace),void 0===namespace||"string"!=typeof namespace)throw new Error("namespace is not a string");this.namespace=namespace}return function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Constructor}(Namespace,[{key:"getNamespace",value:function getNamespace(){return this.namespace}},{key:"toString",value:function toString(){return this.getNamespace()}}]),Namespace}(),Monster=new Namespace("Monster");function assignToNamespace(ns){var current=namespaceFor(ns.split("."));if(0==(arguments.length<=1?0:arguments.length-1))throw new Error("no functions have been passed.");for(var i=0,l=arguments.length<=1?0:arguments.length-1;i<l;i++)current[objectName(i+1<1||arguments.length<=i+1?void 0:arguments[i+1])]=i+1<1||arguments.length<=i+1?void 0:arguments[i+1];return current}function objectName(fn){try{if("function"!=typeof fn)throw new Error("the first argument is not a function or class.");if(fn.hasOwnProperty("name"))return fn.name;if("function"==typeof fn.toString){var s=fn.toString(),f=s.match(/^\s*function\s+([^\s(]+)/);if(Array.isArray(f)&&"string"==typeof f[1])return f[1];var c=s.match(/^\s*class\s+([^\s(]+)/);if(Array.isArray(c)&&"string"==typeof c[1])return c[1]}}catch(e){throw new Error("exception "+e)}throw new Error("the name of the class or function cannot be resolved.")}function namespaceFor(parts){for(var space=Monster,ns="Monster",i=0;i<parts.length;i++)"Monster"!==parts[i]&&(ns+="."+parts[i],space.hasOwnProperty(parts[i])||(space[parts[i]]=new Namespace(ns)),space=space[parts[i]]);return space}assignToNamespace("Monster",assignToNamespace,Namespace);var internalSymbol=Symbol("internalData");Symbol("state");function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function base_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function base_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _possibleConstructorReturn(self,call){if(call&&("object"===_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function _wrapNativeSuper(Class){var _cache="function"==typeof Map?new Map:void 0;return(_wrapNativeSuper=function _wrapNativeSuper(Class){if(null===Class||!function _isNativeFunction(fn){return-1!==Function.toString.call(fn).indexOf("[native code]")}(Class))return Class;if("function"!=typeof Class)throw new TypeError("Super expression must either be null or a function");if(void 0!==_cache){if(_cache.has(Class))return _cache.get(Class);_cache.set(Class,Wrapper)}function Wrapper(){return _construct(Class,arguments,_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(Class.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,Class)})(Class)}function _construct(Parent,args,Class){return(_construct=_isNativeReflectConstruct()?Reflect.construct:function _construct(Parent,args,Class){var a=[null];a.push.apply(a,args);var instance=new(Function.bind.apply(Parent,a));return Class&&_setPrototypeOf(instance,Class.prototype),instance}).apply(null,arguments)}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}var Base=function(_Object){!function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_setPrototypeOf(subClass,superClass)}(Base,_Object);var _super=function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var result,Super=_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return _possibleConstructorReturn(this,result)}}(Base);function Base(){return base_classCallCheck(this,Base),_super.apply(this,arguments)}return function base_createClass(Constructor,protoProps,staticProps){return protoProps&&base_defineProperties(Constructor.prototype,protoProps),staticProps&&base_defineProperties(Constructor,staticProps),Constructor}(Base,[{key:"toString",value:function toString(){return JSON.stringify(this)}}]),Base}(_wrapNativeSuper(Object));function abstract_typeof(obj){return(abstract_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function abstract_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function abstract_setPrototypeOf(o,p){return(abstract_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function abstract_createSuper(Derived){var hasNativeReflectConstruct=function abstract_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=abstract_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=abstract_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return abstract_possibleConstructorReturn(this,result)}}function abstract_possibleConstructorReturn(self,call){if(call&&("object"===abstract_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function abstract_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function abstract_getPrototypeOf(o){return(abstract_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",Base);var AbstractConstraint=function(_Base){!function abstract_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&abstract_setPrototypeOf(subClass,superClass)}(AbstractConstraint,_Base);var _super=abstract_createSuper(AbstractConstraint);function AbstractConstraint(){return function abstract_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,AbstractConstraint),_super.call(this)}return function abstract_createClass(Constructor,protoProps,staticProps){return protoProps&&abstract_defineProperties(Constructor.prototype,protoProps),staticProps&&abstract_defineProperties(Constructor,staticProps),Constructor}(AbstractConstraint,[{key:"isValid",value:function isValid(value){return Promise.reject(value)}}]),AbstractConstraint}(Base);function abstractoperator_typeof(obj){return(abstractoperator_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function abstractoperator_setPrototypeOf(o,p){return(abstractoperator_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function abstractoperator_createSuper(Derived){var hasNativeReflectConstruct=function abstractoperator_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=abstractoperator_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=abstractoperator_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return abstractoperator_possibleConstructorReturn(this,result)}}function abstractoperator_possibleConstructorReturn(self,call){if(call&&("object"===abstractoperator_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function abstractoperator_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function abstractoperator_getPrototypeOf(o){return(abstractoperator_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Constraints",AbstractConstraint);var globalReference,AbstractOperator=function(_AbstractConstraint){!function abstractoperator_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&abstractoperator_setPrototypeOf(subClass,superClass)}(AbstractOperator,_AbstractConstraint);var _super=abstractoperator_createSuper(AbstractOperator);function AbstractOperator(operantA,operantB){var _this;if(function abstractoperator_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,AbstractOperator),_this=_super.call(this),!(operantA instanceof AbstractConstraint&&operantB instanceof AbstractConstraint))throw new TypeError("parameters must be from type AbstractConstraint");return _this.operantA=operantA,_this.operantB=operantB,_this}return AbstractOperator}(AbstractConstraint);function andoperator_typeof(obj){return(andoperator_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function andoperator_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function andoperator_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function andoperator_setPrototypeOf(o,p){return(andoperator_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function andoperator_createSuper(Derived){var hasNativeReflectConstruct=function andoperator_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=andoperator_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=andoperator_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return andoperator_possibleConstructorReturn(this,result)}}function andoperator_possibleConstructorReturn(self,call){if(call&&("object"===andoperator_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function andoperator_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function andoperator_getPrototypeOf(o){return(andoperator_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function invalid_typeof(obj){return(invalid_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function invalid_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function invalid_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function invalid_setPrototypeOf(o,p){return(invalid_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function invalid_createSuper(Derived){var hasNativeReflectConstruct=function invalid_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=invalid_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=invalid_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return invalid_possibleConstructorReturn(this,result)}}function invalid_possibleConstructorReturn(self,call){if(call&&("object"===invalid_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function invalid_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function invalid_getPrototypeOf(o){return(invalid_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function is_typeof(obj){return(is_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function isIterable(value){return void 0!==value&&(null!==value&&"function"==typeof(null==value?void 0:value[Symbol.iterator]))}function isPrimitive(value){var type;return null==value||("string"===(type=is_typeof(value))||"number"===type||"boolean"===type||"symbol"===type)}function isSymbol(value){return"symbol"===is_typeof(value)}function isBoolean(value){return!0===value||!1===value}function isString(value){return void 0!==value&&"string"==typeof value}function isObject(value){return!isArray(value)&&(!isPrimitive(value)&&"object"===is_typeof(value))}function isInstance(value,instance){return!!isObject(value)&&(!!isFunction(instance)&&(!!instance.hasOwnProperty("prototype")&&value instanceof instance))}function isArray(value){return Array.isArray(value)}function isFunction(value){return!isArray(value)&&(!isPrimitive(value)&&"function"==typeof value)}function isInteger(value){return Number.isInteger(value)}function isarray_typeof(obj){return(isarray_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function isarray_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function isarray_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function isarray_setPrototypeOf(o,p){return(isarray_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function isarray_createSuper(Derived){var hasNativeReflectConstruct=function isarray_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=isarray_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=isarray_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return isarray_possibleConstructorReturn(this,result)}}function isarray_possibleConstructorReturn(self,call){if(call&&("object"===isarray_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function isarray_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function isarray_getPrototypeOf(o){return(isarray_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function isobject_typeof(obj){return(isobject_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function isobject_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function isobject_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function isobject_setPrototypeOf(o,p){return(isobject_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function isobject_createSuper(Derived){var hasNativeReflectConstruct=function isobject_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=isobject_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=isobject_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return isobject_possibleConstructorReturn(this,result)}}function isobject_possibleConstructorReturn(self,call){if(call&&("object"===isobject_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function isobject_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function isobject_getPrototypeOf(o){return(isobject_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function oroperator_typeof(obj){return(oroperator_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function oroperator_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function oroperator_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function oroperator_setPrototypeOf(o,p){return(oroperator_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function oroperator_createSuper(Derived){var hasNativeReflectConstruct=function oroperator_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=oroperator_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=oroperator_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return oroperator_possibleConstructorReturn(this,result)}}function oroperator_possibleConstructorReturn(self,call){if(call&&("object"===oroperator_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function oroperator_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function oroperator_getPrototypeOf(o){return(oroperator_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function valid_typeof(obj){return(valid_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function valid_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function valid_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function valid_setPrototypeOf(o,p){return(valid_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function valid_createSuper(Derived){var hasNativeReflectConstruct=function valid_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=valid_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=valid_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return valid_possibleConstructorReturn(this,result)}}function valid_possibleConstructorReturn(self,call){if(call&&("object"===valid_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function valid_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function valid_getPrototypeOf(o){return(valid_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function validatePrimitive(value){if(!isPrimitive(value))throw new TypeError("value is not a primitive");return value}function validateBoolean(value){if(!isBoolean(value))throw new TypeError("value is not a boolean");return value}function validateString(value){if(!isString(value))throw new TypeError("value is not a string");return value}function validateObject(value){if(!isObject(value))throw new TypeError("value is not a object");return value}function validateInstance(value,instance){if(!isInstance(value,instance)){var n="";throw(isObject(instance)||isFunction(instance))&&(n=null==instance?void 0:instance.name),n&&(n=" "+n),new TypeError("value is not an instance of"+n)}return value}function validateArray(value){if(!isArray(value))throw new TypeError("value is not an array");return value}function validateSymbol(value){if(!isSymbol(value))throw new TypeError("value is not an symbol");return value}function validateFunction(value){if(!isFunction(value))throw new TypeError("value is not a function");return value}function validateInteger(value){if(!isInteger(value))throw new TypeError("value is not an integer");return value}function global_typeof(obj){return(global_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function getGlobal(){return globalReference}function getGlobalObject(name){var _globalReference;validateString(name);var o=null===(_globalReference=globalReference)||void 0===_globalReference?void 0:_globalReference[name];if(void 0===o)throw new Error("the object "+name+" is not defined");return validateObject(o),o}function getGlobalFunction(name){var _globalReference2;validateString(name);var f=null===(_globalReference2=globalReference)||void 0===_globalReference2?void 0:_globalReference2[name];if(void 0===f)throw new Error("the function "+name+" is not defined");return validateFunction(f),f}function typeOf(value){var type={}.toString.call(value).match(/\s([a-zA-Z]+)/)[1];if("Object"===type){var results=/^(class|function)\s+(\w+)/.exec(value.constructor.toString());type=results&&results.length>2?results[2]:""}return type.toLowerCase()}function clone_typeof(obj){return(clone_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function clone(obj){if(null===obj)return obj;if(isPrimitive(obj))return obj;if(isFunction(obj))return obj;if(isArray(obj)){for(var copy=[],i=0,len=obj.length;i<len;i++)copy[i]=clone(obj[i]);return copy}if(isObject(obj)){if(obj instanceof Date){var _copy=new Date;return _copy.setTime(obj.getTime()),_copy}if("undefined"!=typeof Element&&obj instanceof Element)return obj;if("undefined"!=typeof HTMLDocument&&obj instanceof HTMLDocument)return obj;if("undefined"!=typeof DocumentFragment&&obj instanceof DocumentFragment)return obj;if(obj===getGlobal())return obj;if("undefined"!=typeof globalContext&&obj===globalContext)return obj;if("undefined"!=typeof window&&obj===window)return obj;if("undefined"!=typeof document&&obj===document)return obj;if("undefined"!=typeof navigator&&obj===navigator)return obj;if("undefined"!=typeof JSON&&obj===JSON)return obj;try{if(obj instanceof Proxy)return obj}catch(e){}return function cloneObject(obj){validateObject(obj);var constructor=null==obj?void 0:obj.constructor;if("function"===typeOf(constructor)){var prototype=null==constructor?void 0:constructor.prototype;if("object"===clone_typeof(prototype)&&prototype.hasOwnProperty("getClone")&&"function"===typeOf(obj.getClone))return obj.getClone()}var copy={};"function"==typeof obj.constructor&&"function"==typeof obj.constructor.call&&(copy=new obj.constructor);for(var key in obj)obj.hasOwnProperty(key)&&(isPrimitive(obj[key])?copy[key]=obj[key]:copy[key]=clone(obj[key]));return copy}(obj)}throw new Error("unable to clone obj! its type isn't supported.")}function stack_typeof(obj){return(stack_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function stack_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function stack_setPrototypeOf(o,p){return(stack_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function stack_createSuper(Derived){var hasNativeReflectConstruct=function stack_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=stack_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=stack_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return stack_possibleConstructorReturn(this,result)}}function stack_possibleConstructorReturn(self,call){if(call&&("object"===stack_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function stack_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function stack_getPrototypeOf(o){return(stack_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Constraints",AbstractOperator),assignToNamespace("Monster.Constraints",function(_AbstractOperator){!function andoperator_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&andoperator_setPrototypeOf(subClass,superClass)}(AndOperator,_AbstractOperator);var _super=andoperator_createSuper(AndOperator);function AndOperator(){return andoperator_classCallCheck(this,AndOperator),_super.apply(this,arguments)}return function andoperator_createClass(Constructor,protoProps,staticProps){return protoProps&&andoperator_defineProperties(Constructor.prototype,protoProps),staticProps&&andoperator_defineProperties(Constructor,staticProps),Constructor}(AndOperator,[{key:"isValid",value:function isValid(value){return Promise.all([this.operantA.isValid(value),this.operantB.isValid(value)])}}]),AndOperator}(AbstractOperator)),assignToNamespace("Monster.Constraints",function(_AbstractConstraint){!function invalid_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&invalid_setPrototypeOf(subClass,superClass)}(Invalid,_AbstractConstraint);var _super=invalid_createSuper(Invalid);function Invalid(){return invalid_classCallCheck(this,Invalid),_super.apply(this,arguments)}return function invalid_createClass(Constructor,protoProps,staticProps){return protoProps&&invalid_defineProperties(Constructor.prototype,protoProps),staticProps&&invalid_defineProperties(Constructor,staticProps),Constructor}(Invalid,[{key:"isValid",value:function isValid(value){return Promise.reject(value)}}]),Invalid}(AbstractConstraint)),assignToNamespace("Monster.Types",isPrimitive,isBoolean,isString,isObject,isArray,isFunction,isIterable,isInteger,isSymbol),assignToNamespace("Monster.Constraints",function(_AbstractConstraint){!function isarray_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&isarray_setPrototypeOf(subClass,superClass)}(IsArray,_AbstractConstraint);var _super=isarray_createSuper(IsArray);function IsArray(){return isarray_classCallCheck(this,IsArray),_super.apply(this,arguments)}return function isarray_createClass(Constructor,protoProps,staticProps){return protoProps&&isarray_defineProperties(Constructor.prototype,protoProps),staticProps&&isarray_defineProperties(Constructor,staticProps),Constructor}(IsArray,[{key:"isValid",value:function isValid(value){return isArray(value)?Promise.resolve(value):Promise.reject(value)}}]),IsArray}(AbstractConstraint)),assignToNamespace("Monster.Constraints",function(_AbstractConstraint){!function isobject_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&isobject_setPrototypeOf(subClass,superClass)}(IsObject,_AbstractConstraint);var _super=isobject_createSuper(IsObject);function IsObject(){return isobject_classCallCheck(this,IsObject),_super.apply(this,arguments)}return function isobject_createClass(Constructor,protoProps,staticProps){return protoProps&&isobject_defineProperties(Constructor.prototype,protoProps),staticProps&&isobject_defineProperties(Constructor,staticProps),Constructor}(IsObject,[{key:"isValid",value:function isValid(value){return isObject(value)?Promise.resolve(value):Promise.reject(value)}}]),IsObject}(AbstractConstraint)),assignToNamespace("Monster.Constraints",function(_AbstractOperator){!function oroperator_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&oroperator_setPrototypeOf(subClass,superClass)}(OrOperator,_AbstractOperator);var _super=oroperator_createSuper(OrOperator);function OrOperator(){return oroperator_classCallCheck(this,OrOperator),_super.apply(this,arguments)}return function oroperator_createClass(Constructor,protoProps,staticProps){return protoProps&&oroperator_defineProperties(Constructor.prototype,protoProps),staticProps&&oroperator_defineProperties(Constructor,staticProps),Constructor}(OrOperator,[{key:"isValid",value:function isValid(value){var self=this;return new Promise((function(resolve,reject){var a,b;self.operantA.isValid(value).then((function(){resolve()})).catch((function(){a=!1,!1===b&&reject()})),self.operantB.isValid(value).then((function(){resolve()})).catch((function(){b=!1,!1===a&&reject()}))}))}}]),OrOperator}(AbstractOperator)),assignToNamespace("Monster.Constraints",function(_AbstractConstraint){!function valid_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&valid_setPrototypeOf(subClass,superClass)}(Valid,_AbstractConstraint);var _super=valid_createSuper(Valid);function Valid(){return valid_classCallCheck(this,Valid),_super.apply(this,arguments)}return function valid_createClass(Constructor,protoProps,staticProps){return protoProps&&valid_defineProperties(Constructor.prototype,protoProps),staticProps&&valid_defineProperties(Constructor,staticProps),Constructor}(Valid,[{key:"isValid",value:function isValid(value){return Promise.resolve(value)}}]),Valid}(AbstractConstraint)),assignToNamespace("Monster.Types",validatePrimitive,validateBoolean,validateString,validateObject,validateArray,validateFunction,(function validateIterable(value){if(!isIterable(value))throw new TypeError("value is not iterable");return value}),validateInteger),function(){if("object"!==("undefined"==typeof globalThis?"undefined":global_typeof(globalThis)))if("undefined"==typeof self){if("undefined"==typeof window){if(Object.defineProperty(Object.prototype,"__monster__",{get:function get(){return this},configurable:!0}),"object"===("undefined"==typeof __monster__?"undefined":global_typeof(__monster__)))return __monster__.globalThis=__monster__,delete Object.prototype.__monster__,void(globalReference=globalThis);try{globalReference=Function("return this")()}catch(e){}throw new Error("unsupported environment.")}globalReference=window}else globalReference=self;else globalReference=globalThis}(),assignToNamespace("Monster.Types",getGlobal,getGlobalObject,getGlobalFunction),assignToNamespace("Monster.Types",typeOf),assignToNamespace("Monster.Util",clone);var Stack=function(_Base){!function stack_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&stack_setPrototypeOf(subClass,superClass)}(Stack,_Base);var _super=stack_createSuper(Stack);function Stack(){var _this;return function stack_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Stack),(_this=_super.call(this)).data=[],_this}return function stack_createClass(Constructor,protoProps,staticProps){return protoProps&&stack_defineProperties(Constructor.prototype,protoProps),staticProps&&stack_defineProperties(Constructor,staticProps),Constructor}(Stack,[{key:"isEmpty",value:function isEmpty(){return 0===this.data.length}},{key:"peek",value:function peek(){var _this$data;if(!this.isEmpty())return null===(_this$data=this.data)||void 0===_this$data?void 0:_this$data[this.data.length-1]}},{key:"push",value:function push(value){return this.data.push(value),this}},{key:"clear",value:function clear(){return this.data=[],this}},{key:"pop",value:function pop(){if(!this.isEmpty())return this.data.pop()}}]),Stack}(Base);function pathfinder_typeof(obj){return(pathfinder_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function _toConsumableArray(arr){return function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}(arr)||function _iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||_unsupportedIterableToArray(arr)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _slicedToArray(arr,i){return function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function _iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||_unsupportedIterableToArray(arr,i)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(o,minLen):void 0}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function pathfinder_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function pathfinder_setPrototypeOf(o,p){return(pathfinder_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function pathfinder_createSuper(Derived){var hasNativeReflectConstruct=function pathfinder_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=pathfinder_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=pathfinder_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return pathfinder_possibleConstructorReturn(this,result)}}function pathfinder_possibleConstructorReturn(self,call){if(call&&("object"===pathfinder_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function pathfinder_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function pathfinder_getPrototypeOf(o){return(pathfinder_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",Stack);var Pathfinder=function(_Base){!function pathfinder_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&pathfinder_setPrototypeOf(subClass,superClass)}(Pathfinder,_Base);var _super=pathfinder_createSuper(Pathfinder);function Pathfinder(object){var _this;if(function pathfinder_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Pathfinder),_this=_super.call(this),isPrimitive(object))throw new Error("the parameter must not be a simple type");return _this.object=object,_this.wildCard="*",_this}return function pathfinder_createClass(Constructor,protoProps,staticProps){return protoProps&&pathfinder_defineProperties(Constructor.prototype,protoProps),staticProps&&pathfinder_defineProperties(Constructor,staticProps),Constructor}(Pathfinder,[{key:"setWildCard",value:function setWildCard(wildcard){return validateString(wildcard),this.wildCard=wildcard,this}},{key:"getVia",value:function getVia(path){return getValueViaPath.call(this,this.object,validateString(path))}},{key:"setVia",value:function setVia(path,value){return validateString(path),setValueViaPath.call(this,this.object,path,value),this}},{key:"deleteVia",value:function deleteVia(path){return validateString(path),deleteValueViaPath.call(this,this.object,path),this}},{key:"exists",value:function exists(path){validateString(path);try{return getValueViaPath.call(this,this.object,path,!0),!0}catch(e){}return!1}}]),Pathfinder}(Base);function iterate(subject,path,check){var result=new Map;if(isObject(subject)||isArray(subject))for(var _i=0,_Object$entries=Object.entries(subject);_i<_Object$entries.length;_i++){var _Object$entries$_i=_slicedToArray(_Object$entries[_i],2),key=_Object$entries$_i[0],value=_Object$entries$_i[1];result.set(key,getValueViaPath.call(this,value,path,check))}else{var _key=path.split(".").shift();result.set(_key,getValueViaPath.call(this,subject,path,check))}return result}function getValueViaPath(subject,path,check){if(""===path)return subject;var parts=path.split("."),current=parts.shift();if(current===this.wildCard)return iterate.call(this,subject,parts.join("."),check);if(isObject(subject)||isArray(subject)){var anchor;if(subject instanceof Map||subject instanceof WeakMap)anchor=subject.get(current);else if(subject instanceof Set||subject instanceof WeakSet){var _ref;validateInteger(current=parseInt(current)),anchor=null===(_ref=_toConsumableArray(subject))||void 0===_ref?void 0:_ref[current]}else{if("function"==typeof WeakRef&&subject instanceof WeakRef)throw Error("unsupported action for this data type");isArray(subject)?(validateInteger(current=parseInt(current)),anchor=null==subject?void 0:subject[current]):anchor=null==subject?void 0:subject[current]}if(isObject(anchor)||isArray(anchor))return getValueViaPath.call(this,anchor,parts.join("."),check);if(parts.length>0)throw Error("the journey is not at its end ("+parts.join(".")+")");if(!0===check){var descriptor=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(subject),current);if(!subject.hasOwnProperty(current)&&void 0===descriptor)throw Error("unknown value")}return anchor}throw TypeError("unsupported type "+pathfinder_typeof(subject))}function setValueViaPath(object,path,value){validateString(path);for(var parts=path.split("."),last=parts.pop(),subpath=parts.join("."),stack=new Stack,current=subpath;;){try{getValueViaPath.call(this,object,current,!0);break}catch(e){}if(stack.push(current),parts.pop(),""===(current=parts.join(".")))break}for(;!stack.isEmpty();){current=stack.pop();var obj={};if(!stack.isEmpty()){var n=stack.peek().split(".").pop();isInteger(parseInt(n))&&(obj=[])}setValueViaPath.call(this,object,current,obj)}var anchor=getValueViaPath.call(this,object,subpath);if(!isObject(object)&&!isArray(object))throw TypeError("unsupported type: "+pathfinder_typeof(object));if(anchor instanceof Map||anchor instanceof WeakMap)anchor.set(last,value);else if(anchor instanceof Set||anchor instanceof WeakSet)anchor.append(value);else{if("function"==typeof WeakRef&&anchor instanceof WeakRef)throw Error("unsupported action for this data type");isArray(anchor)?(validateInteger(last=parseInt(last)),assignProperty(anchor,last,value)):assignProperty(anchor,last,value)}}function assignProperty(object,key,value){object.hasOwnProperty(key)?(void 0===value&&delete object[key],object[key]=value):object[key]=value}function deleteValueViaPath(object,path){var parts=path.split("."),last=parts.pop(),subpath=parts.join("."),anchor=getValueViaPath.call(this,object,subpath);if(anchor instanceof Map)anchor.delete(last);else{if(anchor instanceof Set||anchor instanceof WeakMap||anchor instanceof WeakSet||"function"==typeof WeakRef&&anchor instanceof WeakRef)throw Error("unsupported action for this data type");isArray(anchor)?(validateInteger(last=parseInt(last)),delete anchor[last]):delete anchor[last]}}function buildmap_typeof(obj){return(buildmap_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function buildmap_toConsumableArray(arr){return function buildmap_arrayWithoutHoles(arr){if(Array.isArray(arr))return buildmap_arrayLikeToArray(arr)}(arr)||function buildmap_iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||buildmap_unsupportedIterableToArray(arr)||function buildmap_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _wrapRegExp(){_wrapRegExp=function _wrapRegExp(re,groups){return new BabelRegExp(re,void 0,groups)};var _super=RegExp.prototype,_groups=new WeakMap;function BabelRegExp(re,flags,groups){var _this=new RegExp(re,flags);return _groups.set(_this,groups||_groups.get(re)),buildmap_setPrototypeOf(_this,BabelRegExp.prototype)}function buildGroups(result,re){var g=_groups.get(re);return Object.keys(g).reduce((function(groups,name){return groups[name]=result[g[name]],groups}),Object.create(null))}return buildmap_inherits(BabelRegExp,RegExp),BabelRegExp.prototype.exec=function(str){var result=_super.exec.call(this,str);return result&&(result.groups=buildGroups(result,this)),result},BabelRegExp.prototype[Symbol.replace]=function(str,substitution){if("string"==typeof substitution){var groups=_groups.get(this);return _super[Symbol.replace].call(this,str,substitution.replace(/\$<([^>]+)>/g,(function(_,name){return"$"+groups[name]})))}if("function"==typeof substitution){var _this=this;return _super[Symbol.replace].call(this,str,(function(){var args=arguments;return"object"!==buildmap_typeof(args[args.length-1])&&(args=[].slice.call(args)).push(buildGroups(args,_this)),substitution.apply(this,args)}))}return _super[Symbol.replace].call(this,str,substitution)},_wrapRegExp.apply(this,arguments)}function buildmap_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&buildmap_setPrototypeOf(subClass,superClass)}function buildmap_setPrototypeOf(o,p){return(buildmap_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function buildmap_slicedToArray(arr,i){return function buildmap_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function buildmap_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||buildmap_unsupportedIterableToArray(arr,i)||function buildmap_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=buildmap_unsupportedIterableToArray(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e2){throw _e2},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e3){didErr=!0,err=_e3},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function buildmap_unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return buildmap_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?buildmap_arrayLikeToArray(o,minLen):void 0}}function buildmap_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function buildFlatMap(subject,selector,key,parentMap){var result=this,currentMap=new Map,resultLength=result.size;void 0===key&&(key=[]);var parts=selector.split("."),current="",currentPath=[];do{if(current=parts.shift(),currentPath.push(current),"*"===current){var finder=new Pathfinder(subject),map=void 0;try{map=finder.getVia(currentPath.join("."))}catch(e){map=new Map}var _step,_iterator=_createForOfIteratorHelper(map);try{var _loop=function _loop(){var _step$value=buildmap_slicedToArray(_step.value,2),k=_step$value[0],o=_step$value[1],copyKey=clone(key);currentPath.map((function(a){copyKey.push("*"===a?k:a)}));var kk=copyKey.join("."),sub=buildFlatMap.call(result,o,parts.join("."),copyKey,o);isObject(sub)&&void 0!==parentMap&&(sub["^"]=parentMap),currentMap.set(kk,sub)};for(_iterator.s();!(_step=_iterator.n()).done;)_loop()}catch(err){_iterator.e(err)}finally{_iterator.f()}}}while(parts.length>0);if(resultLength===result.size){var _step2,_iterator2=_createForOfIteratorHelper(currentMap);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _step2$value=buildmap_slicedToArray(_step2.value,2),k=_step2$value[0],o=_step2$value[1];result.set(k,o)}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}return subject}function build(subject,definition,defaultValue){if(void 0===definition)return defaultValue||subject;validateString(definition);var regexp=_wrapRegExp(/(\$\{([\x2D\.0-9A-Z\^_a-z]*)\})/gm,{placeholder:1,path:2}),array=buildmap_toConsumableArray(definition.matchAll(regexp)),finder=new Pathfinder(subject);return 0===array.length?finder.getVia(definition):(array.forEach((function(a){var groups=null==a?void 0:a.groups,placeholder=null==groups?void 0:groups.placeholder;if(void 0!==placeholder){var path=null==groups?void 0:groups.path,v=finder.getVia(path);void 0===v&&(v=defaultValue),definition=definition.replaceAll(placeholder,v)}})),definition)}function diff_typeof(obj){return(diff_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function diff(first,second){return doDiff(first,second)}function doDiff(a,b,path,diff){var typeA=typeOf(a),typeB=typeOf(b),currPath=path||[],currDiff=diff||[];if(typeA!==typeB||"object"!==typeA&&"array"!==typeA){var o=function getOperator(a,b){var operator,typeA=diff_typeof(a),typeB=diff_typeof(b);"undefined"===typeA&&"undefined"!==typeB?operator="add":"undefined"!==typeA&&"undefined"===typeB?operator="delete":function isNotEqual(a,b){if(diff_typeof(a)!==diff_typeof(b))return!0;if(a instanceof Date&&b instanceof Date)return a.getTime()!==b.getTime();return a!==b}(a,b)&&(operator="update");return operator}(a,b);void 0!==o&&currDiff.push(buildResult(a,b,o,path))}else(function getKeys(a,b,type){if(isArray(type)){var keys=a.length>b.length?new Array(a.length):new Array(b.length);return keys.fill(0),new Set(keys.map((function(_,i){return i})))}return new Set(Object.keys(a).concat(Object.keys(b)))})(a,b,typeA).forEach((function(v){Object.prototype.hasOwnProperty.call(a,v)?Object.prototype.hasOwnProperty.call(b,v)?doDiff(a[v],b[v],currPath.concat(v),currDiff):currDiff.push(buildResult(a[v],b[v],"delete",currPath.concat(v))):currDiff.push(buildResult(a[v],b[v],"add",currPath.concat(v)))}));return currDiff}function buildResult(a,b,operator,path){var result={operator:operator,path:path};if("add"!==operator&&(result.first={value:a,type:diff_typeof(a)},isObject(a))){var _Object$getPrototypeO,_Object$getPrototypeO2,name=null===(_Object$getPrototypeO=Object.getPrototypeOf(a))||void 0===_Object$getPrototypeO||null===(_Object$getPrototypeO2=_Object$getPrototypeO.constructor)||void 0===_Object$getPrototypeO2?void 0:_Object$getPrototypeO2.name;void 0!==name&&(result.first.instance=name)}if(("add"===operator||"update"===operator)&&(result.second={value:b,type:diff_typeof(b)},isObject(b))){var _Object$getPrototypeO3,_Object$getPrototypeO4,_name=null===(_Object$getPrototypeO3=Object.getPrototypeOf(b))||void 0===_Object$getPrototypeO3||null===(_Object$getPrototypeO4=_Object$getPrototypeO3.constructor)||void 0===_Object$getPrototypeO4?void 0:_Object$getPrototypeO4.name;void 0!==_name&&(result.second.instance=_name)}return result}function extend(){var o,i;for(i=0;i<arguments.length;i++){var a=arguments[i];if(!isObject(a)&&!isArray(a))throw new Error("unsupported argument "+JSON.stringify(a));if(void 0!==o)for(var k in a){var _o,v=null==a?void 0:a[k];if(v!==(null===(_o=o)||void 0===_o?void 0:_o[k]))if(isObject(v)&&"object"===typeOf(v)||isArray(v)){if(void 0===o[k])isArray(v)?o[k]=[]:o[k]={};else if(typeOf(o[k])!==typeOf(v))throw new Error("type mismatch: "+JSON.stringify(o[k])+"("+typeOf(o[k])+") != "+JSON.stringify(v)+"("+typeOf(v)+")");o[k]=extend(o[k],v)}else o[k]=v}else o=a}return o}function id_typeof(obj){return(id_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function id_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function id_setPrototypeOf(o,p){return(id_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function id_createSuper(Derived){var hasNativeReflectConstruct=function id_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=id_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=id_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return id_possibleConstructorReturn(this,result)}}function id_possibleConstructorReturn(self,call){if(call&&("object"===id_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function id_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function id_getPrototypeOf(o){return(id_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Data",Pathfinder),assignToNamespace("Monster.Data",(function buildMap(subject,selector,valueTemplate,keyTemplate,filter){return function assembleParts(subject,selector,filter,callback){var map,result=new Map;if(isFunction(selector)){if(!((map=selector(subject))instanceof Map))throw new TypeError("the selector callback must return a map")}else{if(!isString(selector))throw new TypeError("selector is neither a string nor a function");map=new Map,buildFlatMap.call(map,subject,selector)}if(!(map instanceof Map))return result;return map.forEach((function(v,k,m){isFunction(filter)&&!0!==filter.call(m,v,k)||callback.call(result,v,k,m)})),result}(subject,selector,filter,(function(v,k,m){k=build(v,keyTemplate,k),v=build(v,valueTemplate),this.set(k,v)}))})),assignToNamespace("Monster.Data",diff),assignToNamespace("Monster.Data",extend);var internalCounter=new Map,ID=function(_Base){!function id_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&id_setPrototypeOf(subClass,superClass)}(ID,_Base);var _super=id_createSuper(ID);function ID(prefix){var _this;!function id_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ID),_this=_super.call(this),void 0===prefix&&(prefix="id"),validateString(prefix),internalCounter.has(prefix)||internalCounter.set(prefix,1);var count=internalCounter.get(prefix);return _this.id=prefix+count,internalCounter.set(prefix,++count),_this}return function id_createClass(Constructor,protoProps,staticProps){return protoProps&&id_defineProperties(Constructor.prototype,protoProps),staticProps&&id_defineProperties(Constructor,staticProps),Constructor}(ID,[{key:"toString",value:function toString(){return this.id}}]),ID}(Base);function transformer_toConsumableArray(arr){return function transformer_arrayWithoutHoles(arr){if(Array.isArray(arr))return transformer_arrayLikeToArray(arr)}(arr)||function transformer_iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||transformer_unsupportedIterableToArray(arr)||function transformer_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function transformer_typeof(obj){return(transformer_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function transformer_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=transformer_unsupportedIterableToArray(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function transformer_unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return transformer_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?transformer_arrayLikeToArray(o,minLen):void 0}}function transformer_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function transformer_wrapRegExp(){transformer_wrapRegExp=function _wrapRegExp(re,groups){return new BabelRegExp(re,void 0,groups)};var _super=RegExp.prototype,_groups=new WeakMap;function BabelRegExp(re,flags,groups){var _this=new RegExp(re,flags);return _groups.set(_this,groups||_groups.get(re)),transformer_setPrototypeOf(_this,BabelRegExp.prototype)}function buildGroups(result,re){var g=_groups.get(re);return Object.keys(g).reduce((function(groups,name){return groups[name]=result[g[name]],groups}),Object.create(null))}return transformer_inherits(BabelRegExp,RegExp),BabelRegExp.prototype.exec=function(str){var result=_super.exec.call(this,str);return result&&(result.groups=buildGroups(result,this)),result},BabelRegExp.prototype[Symbol.replace]=function(str,substitution){if("string"==typeof substitution){var groups=_groups.get(this);return _super[Symbol.replace].call(this,str,substitution.replace(/\$<([^>]+)>/g,(function(_,name){return"$"+groups[name]})))}if("function"==typeof substitution){var _this=this;return _super[Symbol.replace].call(this,str,(function(){var args=arguments;return"object"!==transformer_typeof(args[args.length-1])&&(args=[].slice.call(args)).push(buildGroups(args,_this)),substitution.apply(this,args)}))}return _super[Symbol.replace].call(this,str,substitution)},transformer_wrapRegExp.apply(this,arguments)}function transformer_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function transformer_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&transformer_setPrototypeOf(subClass,superClass)}function transformer_setPrototypeOf(o,p){return(transformer_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function transformer_createSuper(Derived){var hasNativeReflectConstruct=function transformer_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=transformer_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=transformer_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return transformer_possibleConstructorReturn(this,result)}}function transformer_possibleConstructorReturn(self,call){if(call&&("object"===transformer_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function transformer_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function transformer_getPrototypeOf(o){return(transformer_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",ID);var Transformer=function(_Base){transformer_inherits(Transformer,_Base);var _super=transformer_createSuper(Transformer);function Transformer(definition){var _this;return function transformer_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Transformer),(_this=_super.call(this)).args=function disassemble(command){validateString(command);var _step,placeholder=new Map,regex=transformer_wrapRegExp(/((\\(.)){1})/gim,{pattern:2,char:3}),_iterator=transformer_createForOfIteratorHelper(command.matchAll(regex));try{for(_iterator.s();!(_step=_iterator.n()).done;){var m=_step.value,g=null==m?void 0:m.groups;if(isObject(g)){var p=null==g?void 0:g.pattern,c=null==g?void 0:g.char;if(p&&c){var r="__"+(new ID).toString()+"__";placeholder.set(r,c),command=command.replace(p,r)}}}}catch(err){_iterator.e(err)}finally{_iterator.f()}var parts=command.split(":");return parts=parts.map((function(value){var _step2,v=value.trim(),_iterator2=transformer_createForOfIteratorHelper(placeholder);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var k=_step2.value;v=v.replace(k[0],k[1])}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}return v}))}(definition),_this.command=_this.args.shift(),_this.callbacks=new Map,_this}return function transformer_createClass(Constructor,protoProps,staticProps){return protoProps&&transformer_defineProperties(Constructor.prototype,protoProps),staticProps&&transformer_defineProperties(Constructor,staticProps),Constructor}(Transformer,[{key:"setCallback",value:function setCallback(name,callback,context){return validateString(name),validateFunction(callback),void 0!==context&&validateObject(context),this.callbacks.set(name,{callback:callback,context:context}),this}},{key:"run",value:function run(value){return transform.apply(this,[value])}}]),Transformer}(Base);function convertToString(value){return isObject(value)&&value.hasOwnProperty("toString")&&(value=value.toString()),validateString(value),value}function transform(value){var _callback,key,defaultValue,console=getGlobalObject("console"),args=clone(this.args);switch(this.command){case"static":return this.args.join(":");case"tolower":case"strtolower":case"tolowercase":return validateString(value),value.toLowerCase();case"toupper":case"strtoupper":case"touppercase":return validateString(value),value.toUpperCase();case"tostring":return""+value;case"tointeger":var n=parseInt(value);return validateInteger(n),n;case"tojson":return JSON.stringify(value);case"fromjson":return JSON.parse(value);case"trim":return validateString(value),value.trim();case"rawurlencode":return validateString(value),encodeURIComponent(value).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A");case"call":var callback,callbackName=args.shift(),context=getGlobal();if(isObject(value)&&value.hasOwnProperty(callbackName))callback=value[callbackName];else if(this.callbacks.has(callbackName)){var s=this.callbacks.get(callbackName);callback=null==s?void 0:s.callback,context=null==s?void 0:s.context}else"object"===("undefined"==typeof window?"undefined":transformer_typeof(window))&&window.hasOwnProperty(callbackName)&&(callback=window[callbackName]);return validateFunction(callback),args.unshift(value),(_callback=callback).call.apply(_callback,[context].concat(transformer_toConsumableArray(args)));case"plain":case"plaintext":return validateString(value),(new DOMParser).parseFromString(value,"text/html").body.textContent||"";case"if":case"?":validatePrimitive(value);var trueStatement=args.shift()||void 0,falseStatement=args.shift()||void 0;return"value"===trueStatement&&(trueStatement=value),"\\value"===trueStatement&&(trueStatement="value"),"value"===falseStatement&&(falseStatement=value),"\\value"===falseStatement&&(falseStatement="value"),void 0!==value&&""!==value&&"off"!==value&&"false"!==value&&!1!==value||"on"===value||"true"===value||!0===value?trueStatement:falseStatement;case"ucfirst":return validateString(value),value.charAt(0).toUpperCase()+value.substr(1);case"ucwords":return validateString(value),value.replace(/^([a-z\u00E0-\u00FC])|\s+([a-z\u00E0-\u00FC])/g,(function(v){return v.toUpperCase()}));case"count":case"length":if((isString(value)||isObject(value)||isArray(value))&&value.hasOwnProperty("length"))return value.length;throw new TypeError("unsupported type "+transformer_typeof(value));case"to-base64":case"btoa":case"base64":return btoa(convertToString(value));case"atob":case"from-base64":return atob(convertToString(value));case"empty":return"";case"undefined":return;case"debug":return isObject(console)&&console.log(value),value;case"prefix":return validateString(value),(null==args?void 0:args[0])+value;case"suffix":return validateString(value),value+(null==args?void 0:args[0]);case"uniqid":return(new ID).toString();case"first-key":case"last-key":case"nth-last-key":case"nth-key":if(!isObject(value))throw new Error("type not supported");var keys=Object.keys(value).sort();"first-key"===this.command?key=0:"last-key"===this.command?key=keys.length-1:(key=validateInteger(parseInt(args.shift())),"nth-last-key"===this.command&&(key=keys.length-key-1)),defaultValue=args.shift()||"";var useKey=null==keys?void 0:keys[key];return null!=value&&value[useKey]?null==value?void 0:value[useKey]:defaultValue;case"key":case"property":case"index":if(void 0===(key=args.shift()||void 0))throw new Error("missing key parameter");if(defaultValue=args.shift()||void 0,value instanceof Map)return value.has(key)?value.get(key):defaultValue;if(isObject(value)||isArray(value))return null!=value&&value[key]?null==value?void 0:value[key]:defaultValue;throw new Error("type not supported");case"path-exists":if(void 0===(key=args.shift()))throw new Error("missing key parameter");return new Pathfinder(value).exists(key);case"path":if(void 0===(key=args.shift()))throw new Error("missing key parameter");var pf=new Pathfinder(value);if(!pf.exists(key))return;return pf.getVia(key);case"substring":validateString(value);var start=parseInt(args[0])||0,end=(parseInt(args[1])||0)+start;return value.substring(start,end);case"nop":return value;case"??":case"default":if(null!=value)return value;defaultValue=args.shift();var defaultType=args.shift();switch(void 0===defaultType&&(defaultType="string"),defaultType){case"int":case"integer":return parseInt(defaultValue);case"float":return parseFloat(defaultValue);case"undefined":return;case"bool":case"boolean":return"undefined"!==(defaultValue=defaultValue.toLowerCase())&&""!==defaultValue&&"off"!==defaultValue&&"false"!==defaultValue&&"false"!==defaultValue||"on"===defaultValue||"true"===defaultValue||"true"===defaultValue;case"string":return""+defaultValue;case"object":return JSON.parse(atob(defaultValue))}throw new Error("type not supported");default:throw new Error("unknown command "+this.command)}return value}function pipe_typeof(obj){return(pipe_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function pipe_slicedToArray(arr,i){return function pipe_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function pipe_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function pipe_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return pipe_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pipe_arrayLikeToArray(o,minLen)}(arr,i)||function pipe_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pipe_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function pipe_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function pipe_setPrototypeOf(o,p){return(pipe_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function pipe_createSuper(Derived){var hasNativeReflectConstruct=function pipe_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=pipe_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=pipe_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return pipe_possibleConstructorReturn(this,result)}}function pipe_possibleConstructorReturn(self,call){if(call&&("object"===pipe_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function pipe_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function pipe_getPrototypeOf(o){return(pipe_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Data",Transformer);var Pipe=function(_Base){!function pipe_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&pipe_setPrototypeOf(subClass,superClass)}(Pipe,_Base);var _super=pipe_createSuper(Pipe);function Pipe(pipe){var _this;return function pipe_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Pipe),_this=_super.call(this),validateString(pipe),_this.pipe=pipe.split("|").map((function(v){return new Transformer(v)})),_this}return function pipe_createClass(Constructor,protoProps,staticProps){return protoProps&&pipe_defineProperties(Constructor.prototype,protoProps),staticProps&&pipe_defineProperties(Constructor,staticProps),Constructor}(Pipe,[{key:"setCallback",value:function setCallback(name,callback,context){for(var _i=0,_Object$entries=Object.entries(this.pipe);_i<_Object$entries.length;_i++){pipe_slicedToArray(_Object$entries[_i],2)[1].setCallback(name,callback,context)}return this}},{key:"run",value:function run(value){return this.pipe.reduce((function(accumulator,transformer,currentIndex,array){return transformer.run(accumulator)}),value)}}]),Pipe}(Base);function tokenlist_typeof(obj){return(tokenlist_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function tokenlist_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function tokenlist_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return tokenlist_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tokenlist_arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function tokenlist_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function tokenlist_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function tokenlist_setPrototypeOf(o,p){return(tokenlist_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function tokenlist_createSuper(Derived){var hasNativeReflectConstruct=function tokenlist_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=tokenlist_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=tokenlist_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return tokenlist_possibleConstructorReturn(this,result)}}function tokenlist_possibleConstructorReturn(self,call){if(call&&("object"===tokenlist_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function tokenlist_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function tokenlist_getPrototypeOf(o){return(tokenlist_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Data",Pipe);var TokenList=function(_Base,_Symbol$iterator){!function tokenlist_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&tokenlist_setPrototypeOf(subClass,superClass)}(TokenList,_Base);var _super=tokenlist_createSuper(TokenList);function TokenList(init){var _this;return function tokenlist_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,TokenList),(_this=_super.call(this)).tokens=new Set,void 0!==init&&_this.add(init),_this}return function tokenlist_createClass(Constructor,protoProps,staticProps){return protoProps&&tokenlist_defineProperties(Constructor.prototype,protoProps),staticProps&&tokenlist_defineProperties(Constructor,staticProps),Constructor}(TokenList,[{key:"getIterator",value:function getIterator(){return this[Symbol.iterator]()}},{key:_Symbol$iterator,value:function value(){var index=0,entries=this.entries();return{next:function next(){return index<entries.length?{value:null==entries?void 0:entries[index++],done:!1}:{done:!0}}}}},{key:"contains",value:function contains(value){var _this2=this;if(isString(value)){value=value.trim();var counter=0;return value.split(" ").forEach((function(token){if(!1===_this2.tokens.has(token.trim()))return!1;counter++})),counter>0}if(isIterable(value)){var _step,_counter=0,_iterator=tokenlist_createForOfIteratorHelper(value);try{for(_iterator.s();!(_step=_iterator.n()).done;){var token=_step.value;if(validateString(token),!1===this.tokens.has(token.trim()))return!1;_counter++}}catch(err){_iterator.e(err)}finally{_iterator.f()}return _counter>0}return!1}},{key:"add",value:function add(value){var _this3=this;if(isString(value))value.split(" ").forEach((function(token){_this3.tokens.add(token.trim())}));else if(isIterable(value)){var _step2,_iterator2=tokenlist_createForOfIteratorHelper(value);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var token=_step2.value;validateString(token),this.tokens.add(token.trim())}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}else if(void 0!==value)throw new TypeError("unsupported value");return this}},{key:"clear",value:function clear(){return this.tokens.clear(),this}},{key:"remove",value:function remove(value){var _this4=this;if(isString(value))value.split(" ").forEach((function(token){_this4.tokens.delete(token.trim())}));else if(isIterable(value)){var _step3,_iterator3=tokenlist_createForOfIteratorHelper(value);try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var token=_step3.value;validateString(token),this.tokens.delete(token.trim())}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}}else if(void 0!==value)throw new TypeError("unsupported value","types/tokenlist.js");return this}},{key:"replace",value:function replace(token,newToken){if(validateString(token),validateString(newToken),!this.contains(token))return this;var a=Array.from(this.tokens),i=a.indexOf(token);return-1===i||(a.splice(i,1,newToken),this.tokens=new Set,this.add(a)),this}},{key:"toggle",value:function toggle(value){var _this5=this;if(isString(value))value.split(" ").forEach((function(token){toggleValue.call(_this5,token)}));else if(isIterable(value)){var _step4,_iterator4=tokenlist_createForOfIteratorHelper(value);try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var token=_step4.value;toggleValue.call(this,token)}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}}else if(void 0!==value)throw new TypeError("unsupported value","types/tokenlist.js");return this}},{key:"entries",value:function entries(){return Array.from(this.tokens)}},{key:"forEach",value:function forEach(callback){return validateFunction(callback),this.tokens.forEach(callback),this}},{key:"toString",value:function toString(){return this.entries().join(" ")}}]),TokenList}(Base,Symbol.iterator);function toggleValue(token){if(!(this instanceof TokenList))throw Error("must be called with TokenList.call");return validateString(token),token=token.trim(),this.contains(token)?(this.remove(token),this):(this.add(token),this)}function queue_typeof(obj){return(queue_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function queue_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function queue_setPrototypeOf(o,p){return(queue_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function queue_createSuper(Derived){var hasNativeReflectConstruct=function queue_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=queue_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=queue_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return queue_possibleConstructorReturn(this,result)}}function queue_possibleConstructorReturn(self,call){if(call&&("object"===queue_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function queue_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function queue_getPrototypeOf(o){return(queue_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",TokenList);var Queue=function(_Base){!function queue_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&queue_setPrototypeOf(subClass,superClass)}(Queue,_Base);var _super=queue_createSuper(Queue);function Queue(){var _this;return function queue_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Queue),(_this=_super.call(this)).data=[],_this}return function queue_createClass(Constructor,protoProps,staticProps){return protoProps&&queue_defineProperties(Constructor.prototype,protoProps),staticProps&&queue_defineProperties(Constructor,staticProps),Constructor}(Queue,[{key:"isEmpty",value:function isEmpty(){return 0===this.data.length}},{key:"peek",value:function peek(){if(!this.isEmpty())return this.data[0]}},{key:"add",value:function add(value){return this.data.push(value),this}},{key:"clear",value:function clear(){return this.data=[],this}},{key:"poll",value:function poll(){if(!this.isEmpty())return this.data.shift()}}]),Queue}(Base);function uniquequeue_typeof(obj){return(uniquequeue_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function uniquequeue_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _get(target,property,receiver){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(target,property,receiver){var base=function _superPropBase(object,property){for(;!Object.prototype.hasOwnProperty.call(object,property)&&null!==(object=uniquequeue_getPrototypeOf(object)););return object}(target,property);if(base){var desc=Object.getOwnPropertyDescriptor(base,property);return desc.get?desc.get.call(receiver):desc.value}})(target,property,receiver||target)}function uniquequeue_setPrototypeOf(o,p){return(uniquequeue_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function uniquequeue_createSuper(Derived){var hasNativeReflectConstruct=function uniquequeue_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=uniquequeue_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=uniquequeue_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return uniquequeue_possibleConstructorReturn(this,result)}}function uniquequeue_possibleConstructorReturn(self,call){if(call&&("object"===uniquequeue_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function uniquequeue_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function uniquequeue_getPrototypeOf(o){return(uniquequeue_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",Queue);var UniqueQueue=function(_Queue){!function uniquequeue_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&uniquequeue_setPrototypeOf(subClass,superClass)}(UniqueQueue,_Queue);var _super=uniquequeue_createSuper(UniqueQueue);function UniqueQueue(){var _this;return function uniquequeue_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,UniqueQueue),(_this=_super.call(this)).unique=new WeakSet,_this}return function uniquequeue_createClass(Constructor,protoProps,staticProps){return protoProps&&uniquequeue_defineProperties(Constructor.prototype,protoProps),staticProps&&uniquequeue_defineProperties(Constructor,staticProps),Constructor}(UniqueQueue,[{key:"add",value:function add(value){return validateObject(value),this.unique.has(value)||(this.unique.add(value),_get(uniquequeue_getPrototypeOf(UniqueQueue.prototype),"add",this).call(this,value)),this}},{key:"clear",value:function clear(){return _get(uniquequeue_getPrototypeOf(UniqueQueue.prototype),"clear",this).call(this),this.unique=new WeakSet,this}},{key:"poll",value:function poll(){if(!this.isEmpty()){var value=this.data.shift();return this.unique.delete(value),value}}}]),UniqueQueue}(Queue);function observer_typeof(obj){return(observer_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function observer_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function observer_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function observer_setPrototypeOf(o,p){return(observer_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function observer_createSuper(Derived){var hasNativeReflectConstruct=function observer_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=observer_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=observer_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return observer_possibleConstructorReturn(this,result)}}function observer_possibleConstructorReturn(self,call){if(call&&("object"===observer_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function observer_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function observer_getPrototypeOf(o){return(observer_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",UniqueQueue);var Observer=function(_Base){!function observer_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&observer_setPrototypeOf(subClass,superClass)}(Observer,_Base);var _super=observer_createSuper(Observer);function Observer(callback){var _this;if(observer_classCallCheck(this,Observer),_this=_super.call(this),"function"!=typeof callback)throw new Error("observer callback must be a function");_this.callback=callback;for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];return _this.arguments=args,_this.tags=new TokenList,_this.queue=new UniqueQueue,_this}return function observer_createClass(Constructor,protoProps,staticProps){return protoProps&&observer_defineProperties(Constructor.prototype,protoProps),staticProps&&observer_defineProperties(Constructor,staticProps),Constructor}(Observer,[{key:"addTag",value:function addTag(tag){return this.tags.add(tag),this}},{key:"removeTag",value:function removeTag(tag){return this.tags.remove(tag),this}},{key:"getTags",value:function getTags(){return this.tags.entries()}},{key:"hasTag",value:function hasTag(tag){return this.tags.contains(tag)}},{key:"update",value:function update(subject){var self=this;return new Promise((function(resolve,reject){isObject(subject)?(self.queue.add(subject),setTimeout((function(){try{if(self.queue.isEmpty())return void resolve();var s=self.queue.poll(),result=self.callback.apply(s,self.arguments);if(isObject(result)&&result instanceof Promise)return void result.then(resolve).catch(reject);resolve(result)}catch(e){reject(e)}}),0)):reject("subject must be an object")}))}}]),Observer}(Base);function observerlist_typeof(obj){return(observerlist_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function observerlist_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function observerlist_setPrototypeOf(o,p){return(observerlist_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function observerlist_createSuper(Derived){var hasNativeReflectConstruct=function observerlist_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=observerlist_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=observerlist_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return observerlist_possibleConstructorReturn(this,result)}}function observerlist_possibleConstructorReturn(self,call){if(call&&("object"===observerlist_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function observerlist_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function observerlist_getPrototypeOf(o){return(observerlist_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",Observer);var ObserverList=function(_Base){!function observerlist_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&observerlist_setPrototypeOf(subClass,superClass)}(ObserverList,_Base);var _super=observerlist_createSuper(ObserverList);function ObserverList(){var _this;return function observerlist_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ObserverList),(_this=_super.call(this)).observers=[],_this}return function observerlist_createClass(Constructor,protoProps,staticProps){return protoProps&&observerlist_defineProperties(Constructor.prototype,protoProps),staticProps&&observerlist_defineProperties(Constructor,staticProps),Constructor}(ObserverList,[{key:"attach",value:function attach(observer){return validateInstance(observer,Observer),this.observers.push(observer),this}},{key:"detach",value:function detach(observer){validateInstance(observer,Observer);for(var i=0,l=this.observers.length;i<l;i++)this.observers[i]===observer&&this.observers.splice(i,1);return this}},{key:"contains",value:function contains(observer){validateInstance(observer,Observer);for(var i=0,l=this.observers.length;i<l;i++)if(this.observers[i]===observer)return!0;return!1}},{key:"notify",value:function notify(subject){for(var pomises=[],i=0,l=this.observers.length;i<l;i++)pomises.push(this.observers[i].update(subject));return Promise.all(pomises)}}]),ObserverList}(Base);function proxyobserver_typeof(obj){return(proxyobserver_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function proxyobserver_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function proxyobserver_setPrototypeOf(o,p){return(proxyobserver_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function proxyobserver_createSuper(Derived){var hasNativeReflectConstruct=function proxyobserver_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=proxyobserver_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=proxyobserver_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return proxyobserver_possibleConstructorReturn(this,result)}}function proxyobserver_possibleConstructorReturn(self,call){if(call&&("object"===proxyobserver_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return proxyobserver_assertThisInitialized(self)}function proxyobserver_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function proxyobserver_getPrototypeOf(o){return(proxyobserver_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",ObserverList);var ProxyObserver=function(_Base){!function proxyobserver_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&proxyobserver_setPrototypeOf(subClass,superClass)}(ProxyObserver,_Base);var _super=proxyobserver_createSuper(ProxyObserver);function ProxyObserver(object){var _this;return function proxyobserver_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ProxyObserver),(_this=_super.call(this)).realSubject=validateObject(object),_this.subject=new Proxy(object,getHandler.call(proxyobserver_assertThisInitialized(_this))),_this.objectMap=new WeakMap,_this.objectMap.set(_this.realSubject,_this.subject),_this.proxyMap=new WeakMap,_this.proxyMap.set(_this.subject,_this.realSubject),_this.observers=new ObserverList,_this}return function proxyobserver_createClass(Constructor,protoProps,staticProps){return protoProps&&proxyobserver_defineProperties(Constructor.prototype,protoProps),staticProps&&proxyobserver_defineProperties(Constructor,staticProps),Constructor}(ProxyObserver,[{key:"getSubject",value:function getSubject(){return this.subject}},{key:"setSubject",value:function setSubject(obj){var i,k=Object.keys(this.subject);for(i=0;i<k.length;i++)delete this.subject[k[i]];return this.subject=extend(this.subject,obj),this}},{key:"getRealSubject",value:function getRealSubject(){return this.realSubject}},{key:"attachObserver",value:function attachObserver(observer){return this.observers.attach(observer),this}},{key:"detachObserver",value:function detachObserver(observer){return this.observers.detach(observer),this}},{key:"notifyObservers",value:function notifyObservers(){return this.observers.notify(this)}},{key:"containsObserver",value:function containsObserver(observer){return this.observers.contains(observer)}}]),ProxyObserver}(Base);function getHandler(){var proxy=this,handler={get:function get(target,key,receiver){var value=Reflect.get(target,key,receiver);if("symbol"===proxyobserver_typeof(key))return value;if(isPrimitive(value))return value;if(isArray(value)||isObject(value)){if(proxy.objectMap.has(value))return proxy.objectMap.get(value);if(proxy.proxyMap.has(value))return value;var p=new Proxy(value,handler);return proxy.objectMap.set(value,p),proxy.proxyMap.set(p,value),p}return value},set:function set(target,key,value,receiver){proxy.proxyMap.has(value)&&(value=proxy.proxyMap.get(value)),proxy.proxyMap.has(target)&&(target=proxy.proxyMap.get(target));var result,current=Reflect.get(target,key,receiver);if(proxy.proxyMap.has(current)&&(current=proxy.proxyMap.get(current)),current===value)return!0;var descriptor=Reflect.getOwnPropertyDescriptor(target,key);return void 0===descriptor&&(descriptor={writable:!0,enumerable:!0,configurable:!0}),descriptor.value=value,result=Reflect.defineProperty(target,key,descriptor),"symbol"!==proxyobserver_typeof(key)&&proxy.observers.notify(proxy),result},deleteProperty:function deleteProperty(target,key){return key in target&&(delete target[key],"symbol"!==proxyobserver_typeof(key)&&proxy.observers.notify(proxy),!0)},defineProperty:function defineProperty(target,key,descriptor){var result=Reflect.defineProperty(target,key,descriptor);return"symbol"!==proxyobserver_typeof(key)&&proxy.observers.notify(proxy),result},setPrototypeOf:function setPrototypeOf(target,key){var result=Reflect.setPrototypeOf(object1,key);return"symbol"!==proxyobserver_typeof(key)&&proxy.observers.notify(proxy),result}};return handler}function assembler_typeof(obj){return(assembler_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function assembler_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function assembler_setPrototypeOf(o,p){return(assembler_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function assembler_createSuper(Derived){var hasNativeReflectConstruct=function assembler_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=assembler_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=assembler_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return assembler_possibleConstructorReturn(this,result)}}function assembler_possibleConstructorReturn(self,call){if(call&&("object"===assembler_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function assembler_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function assembler_getPrototypeOf(o){return(assembler_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",ProxyObserver);assignToNamespace("Monster.DOM",function(_Base){!function assembler_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&assembler_setPrototypeOf(subClass,superClass)}(Assembler,_Base);var _super=assembler_createSuper(Assembler);function Assembler(fragment){var _this;return function assembler_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Assembler),(_this=_super.call(this)).attributePrefix="data-monster-",validateInstance(fragment,getGlobalFunction("DocumentFragment")),_this.fragment=fragment,_this}return function assembler_createClass(Constructor,protoProps,staticProps){return protoProps&&assembler_defineProperties(Constructor.prototype,protoProps),staticProps&&assembler_defineProperties(Constructor,staticProps),Constructor}(Assembler,[{key:"setAttributePrefix",value:function setAttributePrefix(prefix){return validateString(prefix),this.attributePrefix=prefix,this}},{key:"getAttributePrefix",value:function getAttributePrefix(){return this.attributePrefix}},{key:"createDocumentFragment",value:function createDocumentFragment(data){return void 0===data&&(data=new ProxyObserver({})),validateInstance(data,ProxyObserver),this.fragment.cloneNode(!0)}}]),Assembler}(Base));var objectUpdaterLinkSymbol=Symbol("monsterUpdater");function addToObjectLink(element,symbol,object){return validateInstance(element,HTMLElement),validateSymbol(symbol),void 0===(null==element?void 0:element[symbol])&&(element[symbol]=new Set),addAttributeToken(element,"data-monster-objectlink",symbol.toString()),element[symbol].add(object),element}function hasObjectLink(element,symbol){return validateInstance(element,HTMLElement),validateSymbol(symbol),void 0!==(null==element?void 0:element[symbol])&&containsAttributeToken(element,"data-monster-objectlink",symbol.toString())}function getLinkedObjects(element,symbol){if(validateInstance(element,HTMLElement),validateSymbol(symbol),void 0===(null==element?void 0:element[symbol]))throw new Error("there is no object link for "+symbol.toString());return null==element?void 0:element[symbol][Symbol.iterator]()}function addAttributeToken(element,key,token){return validateInstance(element,HTMLElement),validateString(token),validateString(key),element.hasAttribute(key)?(element.setAttribute(key,new TokenList(element.getAttribute(key)).add(token).toString()),element):(element.setAttribute(key,token),element)}function removeAttributeToken(element,key,token){return validateInstance(element,HTMLElement),validateString(token),validateString(key),element.hasAttribute(key)?(element.setAttribute(key,new TokenList(element.getAttribute(key)).remove(token).toString()),element):element}function containsAttributeToken(element,key,token){return validateInstance(element,HTMLElement),validateString(token),validateString(key),!!element.hasAttribute(key)&&new TokenList(element.getAttribute(key)).contains(token)}function findClosestByAttribute(element,key,value){if(validateInstance(element,getGlobalFunction("HTMLElement")),element.hasAttribute(key)){if(void 0===value)return element;if(element.getAttribute(key)===value)return element}var selector=validateString(key);void 0!==value&&(selector+="="+validateString(value));var result=element.closest("["+selector+"]");if(result instanceof HTMLElement)return result}function mediatype_typeof(obj){return(mediatype_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function mediatype_wrapRegExp(){mediatype_wrapRegExp=function _wrapRegExp(re,groups){return new BabelRegExp(re,void 0,groups)};var _super=RegExp.prototype,_groups=new WeakMap;function BabelRegExp(re,flags,groups){var _this=new RegExp(re,flags);return _groups.set(_this,groups||_groups.get(re)),mediatype_setPrototypeOf(_this,BabelRegExp.prototype)}function buildGroups(result,re){var g=_groups.get(re);return Object.keys(g).reduce((function(groups,name){return groups[name]=result[g[name]],groups}),Object.create(null))}return mediatype_inherits(BabelRegExp,RegExp),BabelRegExp.prototype.exec=function(str){var result=_super.exec.call(this,str);return result&&(result.groups=buildGroups(result,this)),result},BabelRegExp.prototype[Symbol.replace]=function(str,substitution){if("string"==typeof substitution){var groups=_groups.get(this);return _super[Symbol.replace].call(this,str,substitution.replace(/\$<([^>]+)>/g,(function(_,name){return"$"+groups[name]})))}if("function"==typeof substitution){var _this=this;return _super[Symbol.replace].call(this,str,(function(){var args=arguments;return"object"!==mediatype_typeof(args[args.length-1])&&(args=[].slice.call(args)).push(buildGroups(args,_this)),substitution.apply(this,args)}))}return _super[Symbol.replace].call(this,str,substitution)},mediatype_wrapRegExp.apply(this,arguments)}function mediatype_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function mediatype_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return mediatype_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mediatype_arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function mediatype_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function mediatype_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function mediatype_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&mediatype_setPrototypeOf(subClass,superClass)}function mediatype_setPrototypeOf(o,p){return(mediatype_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function mediatype_createSuper(Derived){var hasNativeReflectConstruct=function mediatype_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=mediatype_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=mediatype_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return mediatype_possibleConstructorReturn(this,result)}}function mediatype_possibleConstructorReturn(self,call){if(call&&("object"===mediatype_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function mediatype_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function mediatype_getPrototypeOf(o){return(mediatype_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",(function findClosestByClass(element,className){var _element$classList;if(validateInstance(element,getGlobalFunction("HTMLElement")),null!=element&&null!==(_element$classList=element.classList)&&void 0!==_element$classList&&_element$classList.contains(validateString(className)))return element;var result=element.closest("."+className);return result instanceof HTMLElement?result:void 0}),getLinkedObjects,addToObjectLink,(function removeObjectLink(element,symbol){return validateInstance(element,HTMLElement),validateSymbol(symbol),void 0===(null==element?void 0:element[symbol])||(removeAttributeToken(element,"data-monster-objectlink",symbol.toString()),delete element[symbol]),element}),findClosestByAttribute,hasObjectLink,(function clearAttributeTokens(element,key){return validateInstance(element,HTMLElement),validateString(key),element.hasAttribute(key)?(element.setAttribute(key,""),element):element}),(function replaceAttributeToken(element,key,from,to){return validateInstance(element,HTMLElement),validateString(from),validateString(to),validateString(key),element.hasAttribute(key)?(element.setAttribute(key,new TokenList(element.getAttribute(key)).replace(from,to).toString()),element):element}),containsAttributeToken,removeAttributeToken,addAttributeToken,(function toggleAttributeToken(element,key,token){return validateInstance(element,HTMLElement),validateString(token),validateString(key),element.hasAttribute(key)?(element.setAttribute(key,new TokenList(element.getAttribute(key)).toggle(token).toString()),element):(element.setAttribute(key,token),element)}));var internal=Symbol("internal"),MediaType=function(_Base){mediatype_inherits(MediaType,_Base);var _super=mediatype_createSuper(MediaType);function MediaType(type,subtype,parameter){var _this;return function mediatype_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,MediaType),(_this=_super.call(this))[internal]={type:validateString(type).toLowerCase(),subtype:validateString(subtype).toLowerCase(),parameter:[]},void 0!==parameter&&(_this[internal].parameter=validateArray(parameter)),_this}return function mediatype_createClass(Constructor,protoProps,staticProps){return protoProps&&mediatype_defineProperties(Constructor.prototype,protoProps),staticProps&&mediatype_defineProperties(Constructor,staticProps),Constructor}(MediaType,[{key:"type",get:function get(){return this[internal].type}},{key:"subtype",get:function get(){return this[internal].subtype}},{key:"parameter",get:function get(){var result=new Map;return this[internal].parameter.forEach((function(p){var value=p.value;value.startsWith('"')&&value.endsWith('"')&&(value=value.substring(1,value.length-1)),result.set(p.key,value)})),result}},{key:"toString",value:function toString(){var _step,parameter=[],_iterator=mediatype_createForOfIteratorHelper(this[internal].parameter);try{for(_iterator.s();!(_step=_iterator.n()).done;){var a=_step.value;parameter.push(a.key+"="+a.value)}}catch(err){_iterator.e(err)}finally{_iterator.f()}return this[internal].type+"/"+this[internal].subtype+(parameter.length>0?";"+parameter.join(";"):"")}}]),MediaType}(Base);function parseMediaType(mediatype){var result=mediatype_wrapRegExp(/([A-Za-z]+|\*)\/(([\+\x2D\.0-9A-Z_a-z]+)|\*|)([\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*([0-9A-Za-z]+)[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(=[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*("?[\x2D0-9A-Z_a-z]+"?))?)*/g,{type:1,subtype:2,parameter:4}).exec(validateString(mediatype)),groups=null==result?void 0:result.groups;if(void 0===groups)throw new TypeError("the mimetype can not be parsed");var type=null==groups?void 0:groups.type,subtype=null==groups?void 0:groups.subtype,parameter=null==groups?void 0:groups.parameter;if(""===subtype||""===type)throw new TypeError("blank value is not allowed");return new MediaType(type,subtype,function parseParameter(parameter){if(!isString(parameter))return;var result=[];return parameter.split(";").forEach((function(entry){if(""!==(entry=entry.trim())){var kv=entry.split("="),key=validateString(null==kv?void 0:kv[0]).trim(),value=validateString(null==kv?void 0:kv[1]).trim();result.push({key:key,value:value})}})),result}(parameter))}function dataurl_typeof(obj){return(dataurl_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function dataurl_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function dataurl_setPrototypeOf(o,p){return(dataurl_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function dataurl_createSuper(Derived){var hasNativeReflectConstruct=function dataurl_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=dataurl_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=dataurl_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return dataurl_possibleConstructorReturn(this,result)}}function dataurl_possibleConstructorReturn(self,call){if(call&&("object"===dataurl_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function dataurl_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function dataurl_getPrototypeOf(o){return(dataurl_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",parseMediaType,MediaType);var dataurl_internal=Symbol("internal"),DataUrl=function(_Base){!function dataurl_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&dataurl_setPrototypeOf(subClass,superClass)}(DataUrl,_Base);var _super=dataurl_createSuper(DataUrl);function DataUrl(content,mediatype,base64){var _this;return function dataurl_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,DataUrl),_this=_super.call(this),isString(mediatype)&&(mediatype=parseMediaType(mediatype)),_this[dataurl_internal]={content:validateString(content),mediatype:validateInstance(mediatype,MediaType),base64:validateBoolean(void 0===base64||base64)},_this}return function dataurl_createClass(Constructor,protoProps,staticProps){return protoProps&&dataurl_defineProperties(Constructor.prototype,protoProps),staticProps&&dataurl_defineProperties(Constructor,staticProps),Constructor}(DataUrl,[{key:"content",get:function get(){return this[dataurl_internal].base64?atob(this[dataurl_internal].content):this[dataurl_internal].content}},{key:"mediatype",get:function get(){return this[dataurl_internal].mediatype}},{key:"toString",value:function toString(){var content=this[dataurl_internal].content;return content=!0===this[dataurl_internal].base64?";base64,"+content:","+encodeURIComponent(content),"data:"+this[dataurl_internal].mediatype.toString()+content}}]),DataUrl}(Base);function parseDataURL(dataurl){if(validateString(dataurl),"data:"!==(dataurl=dataurl.trim()).substring(0,5))throw new TypeError("incorrect or missing data protocol");var p=(dataurl=dataurl.substring(5)).indexOf(",");if(-1===p)throw new TypeError("malformed data url");var content=dataurl.substring(p+1),mediatypeAndBase64=dataurl.substring(0,p).trim(),mediatype="text/plain;charset=US-ASCII",base64Flag=!1;if(""!==mediatypeAndBase64){if(mediatype=mediatypeAndBase64,mediatypeAndBase64.endsWith("base64")){var i=mediatypeAndBase64.lastIndexOf(";");mediatype=mediatypeAndBase64.substring(0,i),base64Flag=!0}else content=decodeURIComponent(content);mediatype=parseMediaType(mediatype)}else content=decodeURIComponent(content);return new DataUrl(content,mediatype,base64Flag)}function theme_typeof(obj){return(theme_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function theme_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function theme_setPrototypeOf(o,p){return(theme_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function theme_createSuper(Derived){var hasNativeReflectConstruct=function theme_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=theme_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=theme_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return theme_possibleConstructorReturn(this,result)}}function theme_possibleConstructorReturn(self,call){if(call&&("object"===theme_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function theme_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function theme_getPrototypeOf(o){return(theme_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",parseDataURL,DataUrl);var Theme=function(_Base){!function theme_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&theme_setPrototypeOf(subClass,superClass)}(Theme,_Base);var _super=theme_createSuper(Theme);function Theme(name){var _this;return function theme_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Theme),_this=_super.call(this),validateString(name),_this.name=name,_this}return function theme_createClass(Constructor,protoProps,staticProps){return protoProps&&theme_defineProperties(Constructor.prototype,protoProps),staticProps&&theme_defineProperties(Constructor,staticProps),Constructor}(Theme,[{key:"getName",value:function getName(){return this.name}}]),Theme}(Base);function getDocumentTheme(){var name="monster",element=getGlobalObject("document").querySelector("html");if(element instanceof HTMLElement){var theme=element.getAttribute("data-monster-theme-name");theme&&(name=theme)}return new Theme(name)}function template_typeof(obj){return(template_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function template_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function template_setPrototypeOf(o,p){return(template_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function template_createSuper(Derived){var hasNativeReflectConstruct=function template_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=template_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=template_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return template_possibleConstructorReturn(this,result)}}function template_possibleConstructorReturn(self,call){if(call&&("object"===template_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function template_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function template_getPrototypeOf(o){return(template_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",Theme,getDocumentTheme);var Template=function(_Base){!function template_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&template_setPrototypeOf(subClass,superClass)}(Template,_Base);var _super=template_createSuper(Template);function Template(template){var _this;return function template_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Template),_this=_super.call(this),validateInstance(template,getGlobalFunction("HTMLTemplateElement")),_this.template=template,_this}return function template_createClass(Constructor,protoProps,staticProps){return protoProps&&template_defineProperties(Constructor.prototype,protoProps),staticProps&&template_defineProperties(Constructor,staticProps),Constructor}(Template,[{key:"getTemplateElement",value:function getTemplateElement(){return this.template}},{key:"createDocumentFragment",value:function createDocumentFragment(){return this.template.content.cloneNode(!0)}}]),Template}(Base);function findDocumentTemplate(id,currentNode){validateString(id);var prefixID,template,document=getGlobalObject("document"),HTMLTemplateElement=getGlobalFunction("HTMLTemplateElement"),DocumentFragment=getGlobalFunction("DocumentFragment"),Document=getGlobalFunction("Document");currentNode instanceof Document||currentNode instanceof DocumentFragment||(currentNode instanceof Node&&(currentNode.hasAttribute("data-monster-template-prefix")&&(prefixID=currentNode.getAttribute("data-monster-template-prefix")),(currentNode=currentNode.getRootNode())instanceof Document||currentNode instanceof DocumentFragment||(currentNode=currentNode.ownerDocument)),currentNode instanceof Document||currentNode instanceof DocumentFragment||(currentNode=document));var theme=getDocumentTheme();if(prefixID){var themedPrefixID=prefixID+"-"+id+"-"+theme.getName();if((template=currentNode.getElementById(themedPrefixID))instanceof HTMLTemplateElement)return new Template(template);if((template=document.getElementById(themedPrefixID))instanceof HTMLTemplateElement)return new Template(template)}var themedID=id+"-"+theme.getName();if((template=currentNode.getElementById(themedID))instanceof HTMLTemplateElement)return new Template(template);if((template=document.getElementById(themedID))instanceof HTMLTemplateElement)return new Template(template);if((template=currentNode.getElementById(id))instanceof HTMLTemplateElement)return new Template(template);if((template=document.getElementById(id))instanceof HTMLTemplateElement)return new Template(template);throw new Error("template "+id+" not found.")}function trimspaces_typeof(obj){return(trimspaces_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function trimspaces_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function trimspaces_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return trimspaces_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return trimspaces_arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function trimspaces_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function trimspaces_wrapRegExp(){trimspaces_wrapRegExp=function _wrapRegExp(re,groups){return new BabelRegExp(re,void 0,groups)};var _super=RegExp.prototype,_groups=new WeakMap;function BabelRegExp(re,flags,groups){var _this=new RegExp(re,flags);return _groups.set(_this,groups||_groups.get(re)),trimspaces_setPrototypeOf(_this,BabelRegExp.prototype)}function buildGroups(result,re){var g=_groups.get(re);return Object.keys(g).reduce((function(groups,name){return groups[name]=result[g[name]],groups}),Object.create(null))}return trimspaces_inherits(BabelRegExp,RegExp),BabelRegExp.prototype.exec=function(str){var result=_super.exec.call(this,str);return result&&(result.groups=buildGroups(result,this)),result},BabelRegExp.prototype[Symbol.replace]=function(str,substitution){if("string"==typeof substitution){var groups=_groups.get(this);return _super[Symbol.replace].call(this,str,substitution.replace(/\$<([^>]+)>/g,(function(_,name){return"$"+groups[name]})))}if("function"==typeof substitution){var _this=this;return _super[Symbol.replace].call(this,str,(function(){var args=arguments;return"object"!==trimspaces_typeof(args[args.length-1])&&(args=[].slice.call(args)).push(buildGroups(args,_this)),substitution.apply(this,args)}))}return _super[Symbol.replace].call(this,str,substitution)},trimspaces_wrapRegExp.apply(this,arguments)}function trimspaces_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&trimspaces_setPrototypeOf(subClass,superClass)}function trimspaces_setPrototypeOf(o,p){return(trimspaces_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function trimSpaces(value){validateString(value);var _step,placeholder=new Map,regex=trimspaces_wrapRegExp(/((\\(.)){1})/gim,{pattern:2,char:3}),_iterator=trimspaces_createForOfIteratorHelper(value.matchAll(regex));try{for(_iterator.s();!(_step=_iterator.n()).done;){var m=_step.value,g=null==m?void 0:m.groups;if(isObject(g)){var p=null==g?void 0:g.pattern,c=null==g?void 0:g.char;if(p&&c){var r="__"+(new ID).toString()+"__";placeholder.set(r,c),value=value.replace(p,r)}}}}catch(err){_iterator.e(err)}finally{_iterator.f()}return value=value.trim(),placeholder.forEach((function(v,k){value=value.replace(k,"\\"+v)})),value}function util_typeof(obj){return(util_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function getDocument(){var _getGlobal,document=null===(_getGlobal=getGlobal())||void 0===_getGlobal?void 0:_getGlobal.document;if("object"!==util_typeof(document))throw new Error("not supported environment");return document}function events_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function events_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return events_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return events_arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function events_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function findTargetElementFromEvent(event,attributeName,attributeValue){if(validateInstance(event,Event),"function"!=typeof event.composedPath)throw new Error("unsupported event");var path=event.composedPath();if(isArray(path))for(var i=0;i<path.length;i++){var o=path[i];if(o instanceof HTMLElement&&o.hasAttribute(attributeName)&&(void 0===attributeValue||o.getAttribute(attributeName)===attributeValue))return o}}function updater_typeof(obj){return(updater_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function updater_toConsumableArray(arr){return function updater_arrayWithoutHoles(arr){if(Array.isArray(arr))return updater_arrayLikeToArray(arr)}(arr)||function updater_iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||updater_unsupportedIterableToArray(arr)||function updater_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function updater_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=updater_unsupportedIterableToArray(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e2){throw _e2},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e3){didErr=!0,err=_e3},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function updater_slicedToArray(arr,i){return function updater_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function updater_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||updater_unsupportedIterableToArray(arr,i)||function updater_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function updater_unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return updater_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?updater_arrayLikeToArray(o,minLen):void 0}}function updater_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function updater_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function updater_setPrototypeOf(o,p){return(updater_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function updater_createSuper(Derived){var hasNativeReflectConstruct=function updater_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=updater_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=updater_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return updater_possibleConstructorReturn(this,result)}}function updater_possibleConstructorReturn(self,call){if(call&&("object"===updater_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return updater_assertThisInitialized(self)}function updater_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function updater_getPrototypeOf(o){return(updater_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",Template,findDocumentTemplate),assignToNamespace("Monster.Util",trimSpaces),assignToNamespace("Monster.DOM",(function getWindow(){var _getGlobal2,window=null===(_getGlobal2=getGlobal())||void 0===_getGlobal2?void 0:_getGlobal2.window;if("object"!==util_typeof(window))throw new Error("not supported environment");return window}),getDocument,(function getDocumentFragmentFromString(html){validateString(html);var template=getDocument().createElement("template");return template.innerHTML=html,template.content})),assignToNamespace("Monster.DOM",findTargetElementFromEvent,(function fireEvent(element,type){if(getDocument(),element instanceof HTMLElement){if("click"===type)return void element.click();var event=new Event(validateString(type),{bubbles:!0,cancelable:!0});element.dispatchEvent(event)}else{if(!(element instanceof HTMLCollection||element instanceof NodeList))throw new TypeError("value is not an instance of HTMLElement or HTMLCollection");var _step,_iterator=events_createForOfIteratorHelper(element);try{for(_iterator.s();!(_step=_iterator.n()).done;){fireEvent(_step.value,type)}}catch(err){_iterator.e(err)}finally{_iterator.f()}}}),(function fireCustomEvent(element,type,detail){if(getDocument(),element instanceof HTMLElement){isObject(detail)||(detail={detail:detail});var event=new CustomEvent(validateString(type),{bubbles:!0,cancelable:!0,detail:detail});element.dispatchEvent(event)}else{if(!(element instanceof HTMLCollection||element instanceof NodeList))throw new TypeError("value is not an instance of HTMLElement or HTMLCollection");var _step2,_iterator2=events_createForOfIteratorHelper(element);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){fireCustomEvent(_step2.value,type,detail)}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}}));var Updater=function(_Base){!function updater_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&updater_setPrototypeOf(subClass,superClass)}(Updater,_Base);var _super=updater_createSuper(Updater);function Updater(element,subject){var _this;return function updater_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Updater),_this=_super.call(this),void 0===subject&&(subject={}),isInstance(subject,ProxyObserver)||(subject=new ProxyObserver(subject)),_this[internalSymbol]={element:validateInstance(element,HTMLElement),last:{},callbacks:new Map,eventTypes:["keyup","click","change","drop","touchend","input"],subject:subject},_this[internalSymbol].callbacks.set("checkstate",getCheckStateCallback.call(updater_assertThisInitialized(_this))),_this[internalSymbol].subject.attachObserver(new Observer((function(){var s=_this[internalSymbol].subject.getRealSubject(),diffResult=diff(_this[internalSymbol].last,s);_this[internalSymbol].last=clone(s);for(var _i=0,_Object$entries=Object.entries(diffResult);_i<_Object$entries.length;_i++){var change=updater_slicedToArray(_Object$entries[_i],2)[1];removeElement.call(updater_assertThisInitialized(_this),change),insertElement.call(updater_assertThisInitialized(_this),change),updateContent.call(updater_assertThisInitialized(_this),change),updateAttributes.call(updater_assertThisInitialized(_this),change)}}))),_this}return function updater_createClass(Constructor,protoProps,staticProps){return protoProps&&updater_defineProperties(Constructor.prototype,protoProps),staticProps&&updater_defineProperties(Constructor,staticProps),Constructor}(Updater,[{key:"setEventTypes",value:function setEventTypes(types){return this[internalSymbol].eventTypes=validateArray(types),this}},{key:"enableEventProcessing",value:function enableEventProcessing(){this.disableEventProcessing();var _step,_iterator=updater_createForOfIteratorHelper(this[internalSymbol].eventTypes);try{for(_iterator.s();!(_step=_iterator.n()).done;){var type=_step.value;this[internalSymbol].element.addEventListener(type,getControlEventHandler.call(this),{capture:!0,passive:!0})}}catch(err){_iterator.e(err)}finally{_iterator.f()}return this}},{key:"disableEventProcessing",value:function disableEventProcessing(){var _step2,_iterator2=updater_createForOfIteratorHelper(this[internalSymbol].eventTypes);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var type=_step2.value;this[internalSymbol].element.removeEventListener(type,getControlEventHandler.call(this))}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}return this}},{key:"run",value:function run(){return this[internalSymbol].last={__init__:!0},this[internalSymbol].subject.notifyObservers()}},{key:"retrieve",value:function retrieve(){return retrieveFromBindings.call(this),this}},{key:"getSubject",value:function getSubject(){return this[internalSymbol].subject.getSubject()}},{key:"setCallback",value:function setCallback(name,callback){return this[internalSymbol].callbacks.set(name,callback),this}}]),Updater}(Base);function getCheckStateCallback(){return function(current){if(this instanceof HTMLInputElement){if(-1!==["radio","checkbox"].indexOf(this.type))return this.value+""==current+""?"true":void 0}else if(this instanceof HTMLOptionElement)return isArray(current)&&-1!==current.indexOf(this.value)?"true":void 0}}var symbol=Symbol("EventHandler");function getControlEventHandler(){var self=this;return self[symbol]||(self[symbol]=function(event){var element=findTargetElementFromEvent(event,"data-monster-bind");void 0!==element&&retrieveAndSetValue.call(self,element)}),self[symbol]}function retrieveAndSetValue(element){var _element$constructor,_Object$getOwnPropert,value,pathfinder=new Pathfinder(this[internalSymbol].subject.getSubject()),path=element.getAttribute("data-monster-bind");if(0!==path.indexOf("path:"))throw new Error("the bind argument must start as a value with a path");if(path=path.substr(5),element instanceof HTMLInputElement)switch(element.type){case"checkbox":value=element.checked?element.value:void 0;break;default:value=element.value}else if(element instanceof HTMLTextAreaElement)value=element.value;else if(element instanceof HTMLSelectElement)switch(element.type){case"select-one":value=element.value;break;case"select-multiple":value=element.value;var options=null==element?void 0:element.selectedOptions;void 0===options&&(options=element.querySelectorAll(":scope option:checked")),value=Array.from(options).map((function(_ref){return _ref.value}))}else{if(!(null!=element&&null!==(_element$constructor=element.constructor)&&void 0!==_element$constructor&&_element$constructor.prototype&&null!==(_Object$getOwnPropert=Object.getOwnPropertyDescriptor(element.constructor.prototype,"value"))&&void 0!==_Object$getOwnPropert&&_Object$getOwnPropert.get||element.hasOwnProperty("value")))throw new Error("unsupported object");value=null==element?void 0:element.value}var copy=clone(this[internalSymbol].subject.getRealSubject());new Pathfinder(copy).setVia(path,value),diff(copy,this[internalSymbol].subject.getRealSubject()).length>0&&pathfinder.setVia(path,value)}function retrieveFromBindings(){this[internalSymbol].element.matches("[data-monster-bind]")&&retrieveAndSetValue.call(this,element);var _step3,_iterator3=updater_createForOfIteratorHelper(this[internalSymbol].element.querySelectorAll("[data-monster-bind]").entries());try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _element=updater_slicedToArray(_step3.value,2)[1];retrieveAndSetValue.call(this,_element)}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}}function removeElement(change){var _step4,_iterator4=updater_createForOfIteratorHelper(this[internalSymbol].element.querySelectorAll(":scope [data-monster-remove]").entries());try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _element2=updater_slicedToArray(_step4.value,2)[1];_element2.parentNode.removeChild(_element2)}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}}function insertElement(change){for(var self=this,subject=self[internalSymbol].subject.getRealSubject(),mem=(getDocument(),new WeakSet),wd=0,container=self[internalSymbol].element;;){var found=!1;wd++;var p=clone(null==change?void 0:change.path);if(!isArray(p))return self;for(;p.length>0;){var current=p.join("."),iterator=new Set,query='[data-monster-insert*="path:'+current+'"]',e=container.querySelectorAll(query);e.length>0&&(iterator=new Set(updater_toConsumableArray(e))),container.matches(query)&&iterator.add(container);var _step5,_iterator5=updater_createForOfIteratorHelper(iterator.entries());try{var _loop=function _loop(){var containerElement=updater_slicedToArray(_step5.value,2)[1];if(mem.has(containerElement))return"continue";mem.add(containerElement),found=!0;var def=trimSpaces(containerElement.getAttribute("data-monster-insert")),i=def.indexOf(" "),key=trimSpaces(def.substr(0,i)),refPrefix=key+"-",cmd=trimSpaces(def.substr(i));if(cmd.indexOf("|")>0)throw new Error("pipes are not allowed when cloning a node.");var pipe=new Pipe(cmd);self[internalSymbol].callbacks.forEach((function(f,n){pipe.setCallback(n,f)}));var value=void 0;try{containerElement.removeAttribute("data-monster-error"),value=pipe.run(subject)}catch(e){containerElement.setAttribute("data-monster-error",e.message)}var dataPath=cmd.split(":").pop();if(containerElement.hasChildNodes()&&containerElement.lastChild,!isIterable(value))throw new Error("the value is not iterable");for(var available=new Set,_i2=0,_Object$entries2=Object.entries(value);_i2<_Object$entries2.length;_i2++){var _Object$entries2$_i=updater_slicedToArray(_Object$entries2[_i2],2),_i3=_Object$entries2$_i[0],ref=(_Object$entries2$_i[1],refPrefix+_i3),currentPath=dataPath+"."+_i3;available.add(ref);var refElement=containerElement.querySelector('[data-monster-insert-reference="'+ref+'"]');refElement instanceof HTMLElement?refElement:appendNewDocumentFragment(containerElement,key,ref,currentPath)}for(var nodes=containerElement.querySelectorAll('[data-monster-insert-reference*="'+refPrefix+'"]'),_i4=0,_Object$entries3=Object.entries(nodes);_i4<_Object$entries3.length;_i4++){var node=updater_slicedToArray(_Object$entries3[_i4],2)[1];if(!available.has(node.getAttribute("data-monster-insert-reference")))try{containerElement.removeChild(node)}catch(e){containerElement.setAttribute("data-monster-error",(containerElement.getAttribute("data-monster-error")+", "+e.message).trim())}}};for(_iterator5.s();!(_step5=_iterator5.n()).done;)_loop()}catch(err){_iterator5.e(err)}finally{_iterator5.f()}p.pop()}if(!1===found)break;if(wd++>200)throw new Error("the maximum depth for the recursion is reached.")}}function appendNewDocumentFragment(container,key,ref,path){for(var nodes=findDocumentTemplate(key,container).createDocumentFragment(),_i5=0,_Object$entries4=Object.entries(nodes.childNodes);_i5<_Object$entries4.length;_i5++){var node=updater_slicedToArray(_Object$entries4[_i5],2)[1];node instanceof HTMLElement&&(applyRecursive(node,key,path),node.setAttribute("data-monster-insert-reference",ref)),container.appendChild(node)}}function applyRecursive(node,key,path){if(node instanceof HTMLElement){if(node.hasAttribute("data-monster-replace")){var value=node.getAttribute("data-monster-replace");node.setAttribute("data-monster-replace",value.replaceAll("path:"+key,"path:"+path))}if(node.hasAttribute("data-monster-attributes")){var _value=node.getAttribute("data-monster-attributes");node.setAttribute("data-monster-attributes",_value.replaceAll("path:"+key,"path:"+path))}for(var _i6=0,_Object$entries5=Object.entries(node.childNodes);_i6<_Object$entries5.length;_i6++){applyRecursive(updater_slicedToArray(_Object$entries5[_i6],2)[1],key,path)}}}function updateContent(change){var subject=this[internalSymbol].subject.getRealSubject(),p=clone(null==change?void 0:change.path);runUpdateContent.call(this,this[internalSymbol].element,p,subject);var slots=this[internalSymbol].element.querySelectorAll("slot");if(slots.length>0)for(var _i7=0,_Object$entries6=Object.entries(slots);_i7<_Object$entries6.length;_i7++)for(var slot=updater_slicedToArray(_Object$entries6[_i7],2)[1],_i8=0,_Object$entries7=Object.entries(slot.assignedNodes());_i8<_Object$entries7.length;_i8++){var _element3=updater_slicedToArray(_Object$entries7[_i8],2)[1];runUpdateContent.call(this,_element3,p,subject)}}function runUpdateContent(container,parts,subject){var _this2=this;if(isArray(parts)&&container instanceof HTMLElement){parts=clone(parts);for(var mem=new WeakSet;parts.length>0;){var current=parts.join(".");parts.pop();var query='[data-monster-replace^="path:'+current+'"], [data-monster-replace^="static:"]',e=container.querySelectorAll(""+query),iterator=new Set(updater_toConsumableArray(e));container.matches(query)&&iterator.add(container);var _step6,_iterator6=updater_createForOfIteratorHelper(iterator.entries());try{var _loop2=function _loop2(){var element=updater_slicedToArray(_step6.value,1)[0];if(mem.has(element))return{v:void 0};mem.add(element);var cmd=trimSpaces(element.getAttribute("data-monster-replace")),pipe=new Pipe(cmd);_this2[internalSymbol].callbacks.forEach((function(f,n){pipe.setCallback(n,f)}));var value=void 0;try{element.removeAttribute("data-monster-error"),value=pipe.run(subject)}catch(e){element.setAttribute("data-monster-error",e.message)}if(value instanceof HTMLElement){for(;element.firstChild;)element.removeChild(element.firstChild);try{element.appendChild(value)}catch(e){element.setAttribute("data-monster-error",(element.getAttribute("data-monster-error")+", "+e.message).trim())}}else element.innerHTML=value};for(_iterator6.s();!(_step6=_iterator6.n()).done;){var _ret2=_loop2();if("object"===updater_typeof(_ret2))return _ret2.v}}catch(err){_iterator6.e(err)}finally{_iterator6.f()}}}}function updateAttributes(change){var subject=this[internalSymbol].subject.getRealSubject(),p=clone(null==change?void 0:change.path);runUpdateAttributes.call(this,this[internalSymbol].element,p,subject)}function runUpdateAttributes(container,parts,subject){var _this3=this,self=this;if(isArray(parts)){parts=clone(parts);for(var mem=new WeakSet;parts.length>0;){var current=parts.join(".");parts.pop();var iterator=new Set,query='[data-monster-select-this], [data-monster-attributes*="path:'+current+'"], [data-monster-attributes^="static:"]',e=container.querySelectorAll(query);e.length>0&&(iterator=new Set(updater_toConsumableArray(e))),container.matches(query)&&iterator.add(container);var _step7,_iterator7=updater_createForOfIteratorHelper(iterator.entries());try{var _loop3=function _loop3(){var element=updater_slicedToArray(_step7.value,1)[0];if(mem.has(element))return{v:void 0};mem.add(element);for(var attributes=element.getAttribute("data-monster-attributes"),_loop4=function _loop4(){var def=updater_slicedToArray(_Object$entries8[_i9],2)[1],i=(def=trimSpaces(def)).indexOf(" "),name=trimSpaces(def.substr(0,i)),cmd=trimSpaces(def.substr(i)),pipe=new Pipe(cmd);self[internalSymbol].callbacks.forEach((function(f,n){pipe.setCallback(n,f,element)}));var value=void 0;try{element.removeAttribute("data-monster-error"),value=pipe.run(subject)}catch(e){element.setAttribute("data-monster-error",e.message)}void 0===value?element.removeAttribute(name):element.getAttribute(name)!==value&&element.setAttribute(name,value),handleInputControlAttributeUpdate.call(_this3,element,name,value)},_i9=0,_Object$entries8=Object.entries(attributes.split(","));_i9<_Object$entries8.length;_i9++)_loop4()};for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _ret3=_loop3();if("object"===updater_typeof(_ret3))return _ret3.v}}catch(err){_iterator7.e(err)}finally{_iterator7.f()}}}}function handleInputControlAttributeUpdate(element,name,value){if(element instanceof HTMLSelectElement)switch(element.type){case"select-multiple":for(var _i10=0,_Object$entries9=Object.entries(element.options);_i10<_Object$entries9.length;_i10++){var _Object$entries9$_i=updater_slicedToArray(_Object$entries9[_i10],2),opt=(_Object$entries9$_i[0],_Object$entries9$_i[1]);-1!==value.indexOf(opt.value)?opt.selected=!0:opt.selected=!1}break;case"select-one":for(var _i11=0,_Object$entries10=Object.entries(element.options);_i11<_Object$entries10.length;_i11++){var _Object$entries10$_i=updater_slicedToArray(_Object$entries10[_i11],2),_index=_Object$entries10$_i[0];if(_Object$entries10$_i[1].value===value){element.selectedIndex=_index;break}}}else if(element instanceof HTMLInputElement)switch(element.type){case"radio":case"checkbox":"checked"===name&&(element.checked=void 0!==value);break;case"text":default:"value"===name&&(element.value=void 0===value?"":value)}else element instanceof HTMLTextAreaElement&&"value"===name&&(element.value=void 0===value?"":value)}function customelement_typeof(obj){return(customelement_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function customelement_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=customelement_unsupportedIterableToArray(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e2){throw _e2},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e3){didErr=!0,err=_e3},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function customelement_slicedToArray(arr,i){return function customelement_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function customelement_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||customelement_unsupportedIterableToArray(arr,i)||function customelement_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function customelement_toConsumableArray(arr){return function customelement_arrayWithoutHoles(arr){if(Array.isArray(arr))return customelement_arrayLikeToArray(arr)}(arr)||function customelement_iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||customelement_unsupportedIterableToArray(arr)||function customelement_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function customelement_unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return customelement_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?customelement_arrayLikeToArray(o,minLen):void 0}}function customelement_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function customelement_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function customelement_possibleConstructorReturn(self,call){if(call&&("object"===customelement_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return customelement_assertThisInitialized(self)}function customelement_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function customelement_wrapNativeSuper(Class){var _cache="function"==typeof Map?new Map:void 0;return(customelement_wrapNativeSuper=function _wrapNativeSuper(Class){if(null===Class||!function customelement_isNativeFunction(fn){return-1!==Function.toString.call(fn).indexOf("[native code]")}(Class))return Class;if("function"!=typeof Class)throw new TypeError("Super expression must either be null or a function");if(void 0!==_cache){if(_cache.has(Class))return _cache.get(Class);_cache.set(Class,Wrapper)}function Wrapper(){return customelement_construct(Class,arguments,customelement_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(Class.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),customelement_setPrototypeOf(Wrapper,Class)})(Class)}function customelement_construct(Parent,args,Class){return(customelement_construct=customelement_isNativeReflectConstruct()?Reflect.construct:function _construct(Parent,args,Class){var a=[null];a.push.apply(a,args);var instance=new(Function.bind.apply(Parent,a));return Class&&customelement_setPrototypeOf(instance,Class.prototype),instance}).apply(null,arguments)}function customelement_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function customelement_setPrototypeOf(o,p){return(customelement_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function customelement_getPrototypeOf(o){return(customelement_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",Updater);var initMethodSymbol=Symbol("initMethodSymbol"),assembleMethodSymbol=Symbol("assembleMethodSymbol"),attributeObserverSymbol=Symbol("attributeObserver"),CustomElement=function(_HTMLElement){!function customelement_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&customelement_setPrototypeOf(subClass,superClass)}(CustomElement,_HTMLElement);var _super=function customelement_createSuper(Derived){var hasNativeReflectConstruct=customelement_isNativeReflectConstruct();return function _createSuperInternal(){var result,Super=customelement_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=customelement_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return customelement_possibleConstructorReturn(this,result)}}(CustomElement);function CustomElement(){var _this;return function customelement_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,CustomElement),(_this=_super.call(this))[internalSymbol]=new ProxyObserver({options:extend({},_this.defaults,getOptionsFromAttributes.call(customelement_assertThisInitialized(_this)))}),_this[attributeObserverSymbol]={},initOptionObserver.call(customelement_assertThisInitialized(_this)),_this[initMethodSymbol](),_this}return function customelement_createClass(Constructor,protoProps,staticProps){return protoProps&&customelement_defineProperties(Constructor.prototype,protoProps),staticProps&&customelement_defineProperties(Constructor,staticProps),Constructor}(CustomElement,[{key:"defaults",get:function get(){return{ATTRIBUTE_DISABLED:this.getAttribute("disabled"),shadowMode:"open",delegatesFocus:!0,templates:{main:void 0}}}},{key:"attachObserver",value:function attachObserver(observer){return this[internalSymbol].attachObserver(observer),this}},{key:"detachObserver",value:function detachObserver(observer){return this[internalSymbol].detachObserver(observer),this}},{key:"containsObserver",value:function containsObserver(observer){return this[internalSymbol].containsObserver(observer)}},{key:"getOption",value:function getOption(path,defaultValue){var value;try{value=new Pathfinder(this[internalSymbol].getRealSubject().options).getVia(path)}catch(e){}return void 0===value?defaultValue:value}},{key:"setOption",value:function setOption(path,value){return new Pathfinder(this[internalSymbol].getSubject().options).setVia(path,value),this}},{key:"setOptions",value:function setOptions(options){isString(options)&&(options=parseOptionsJSON(options));return extend(this[internalSymbol].getSubject().options,this.defaults,options),this}},{key:initMethodSymbol,value:function value(){return this}},{key:assembleMethodSymbol,value:function value(){var elements,nodeList;if(!1!==this.getOption("shadowMode",!1)){try{initShadowRoot.call(this),elements=this.shadowRoot.childNodes}catch(e){}try{initCSSStylesheet.call(this)}catch(e){}}elements instanceof NodeList||elements instanceof NodeList||(initHtmlContent.call(this),elements=this.childNodes);try{nodeList=new Set([].concat(customelement_toConsumableArray(elements),customelement_toConsumableArray(getSlottedElements.call(this))))}catch(e){nodeList=elements}return assignUpdaterToElement.call(this,nodeList,clone(this[internalSymbol].getRealSubject().options)),this}},{key:"connectedCallback",value:function connectedCallback(){hasObjectLink(this,objectUpdaterLinkSymbol)||this[assembleMethodSymbol]()}},{key:"disconnectedCallback",value:function disconnectedCallback(){}},{key:"adoptedCallback",value:function adoptedCallback(){}},{key:"attributeChangedCallback",value:function attributeChangedCallback(attrName,oldVal,newVal){var _self$attributeObserv,callback=null===(_self$attributeObserv=this[attributeObserverSymbol])||void 0===_self$attributeObserv?void 0:_self$attributeObserv[attrName];isFunction(callback)&&callback.call(this,newVal,oldVal)}},{key:"hasNode",value:function hasNode(node){return!!containChildNode.call(this,validateInstance(node,Node))||this.shadowRoot instanceof ShadowRoot&&containChildNode.call(this.shadowRoot,node)}}],[{key:"observedAttributes",get:function get(){return["data-monster-options","disabled"]}},{key:"getTag",value:function getTag(){throw new Error("the method getTag must be overwritten by the derived class.")}},{key:"getCSSStyleSheet",value:function getCSSStyleSheet(){}}]),CustomElement}(customelement_wrapNativeSuper(HTMLElement));function getSlottedElements(query,name){var result=new Set;if(!(this.shadowRoot instanceof ShadowRoot))return result;var selector="slot";void 0!==name&&(selector+=null===name?":not([name])":"[name="+validateString(name)+"]");for(var slots=this.shadowRoot.querySelectorAll(selector),_i=0,_Object$entries=Object.entries(slots);_i<_Object$entries.length;_i++){customelement_slicedToArray(_Object$entries[_i],2)[1].assignedElements().forEach((function(node){if(node instanceof HTMLElement)if(isString(query))node.querySelectorAll(query).forEach((function(n){result.add(n)})),node.matches(query)&&result.add(node);else{if(void 0!==query)throw new Error("query must be a string");result.add(node)}}))}return result}function containChildNode(node){if(this.contains(node))return!0;for(var _i2=0,_Object$entries2=Object.entries(this.childNodes);_i2<_Object$entries2.length;_i2++){var e=customelement_slicedToArray(_Object$entries2[_i2],2)[1];if(e.contains(node))return!0;containChildNode.call(e,node)}return!1}function initOptionObserver(){var self=this,lastDisabledValue=void 0;self.attachObserver(new Observer((function(){var flag=self.getOption("disabled");if(flag!==lastDisabledValue&&(lastDisabledValue=flag,self.shadowRoot instanceof ShadowRoot)){var nodeList,query="button, command, fieldset, keygen, optgroup, option, select, textarea, input, [data-monster-objectlink]",elements=self.shadowRoot.querySelectorAll(query);try{nodeList=new Set([].concat(customelement_toConsumableArray(elements),customelement_toConsumableArray(getSlottedElements.call(self,query))))}catch(e){nodeList=elements}for(var _i3=0,_arr2=customelement_toConsumableArray(nodeList);_i3<_arr2.length;_i3++){var element=_arr2[_i3];!0===flag?element.setAttribute("disabled",""):element.removeAttribute("disabled")}}}))),self.attachObserver(new Observer((function(){if(hasObjectLink(self,objectUpdaterLinkSymbol)){var _step,_iterator=customelement_createForOfIteratorHelper(getLinkedObjects(self,objectUpdaterLinkSymbol));try{for(_iterator.s();!(_step=_iterator.n()).done;){var _step2,_iterator2=customelement_createForOfIteratorHelper(_step.value);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var updater=_step2.value,d=clone(self[internalSymbol].getRealSubject().options);Object.assign(updater.getSubject(),d)}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}}catch(err){_iterator.e(err)}finally{_iterator.f()}}}))),self[attributeObserverSymbol].disabled=function(newVal){self.hasAttribute("disabled")?self.setOption("disabled",!0):self.setOption("disabled",void 0)},self[attributeObserverSymbol]["data-monster-options"]=function(){var options=getOptionsFromAttributes.call(self);isObject(options)&&self.setOptions(options)}}function getOptionsFromAttributes(){if(this.hasAttribute("data-monster-options"))try{return parseOptionsJSON(this.getAttribute("data-monster-options"))}catch(e){throw new Error("the options attribute data-monster-options does not contain a valid json definition (actual: "+this.getAttribute("data-monster-options")+").")}return{}}function parseOptionsJSON(data){if(isString(data)){try{data=parseDataURL(data).content}catch(e){}try{var obj=JSON.parse(data);return validateObject(obj),obj}catch(e){throw new Error("the options does not contain a valid json definition (actual: "+data+").")}}return{}}function initHtmlContent(){try{var template=findDocumentTemplate(this.constructor.getTag());this.appendChild(template.createDocumentFragment())}catch(e){var html=this.getOption("templates.main","");isString(html)&&html.length>0&&(this.innerHTML=html)}return this}function initCSSStylesheet(){if(!(this.shadowRoot instanceof ShadowRoot))return this;var styleSheet=this.constructor.getCSSStyleSheet();if(styleSheet instanceof CSSStyleSheet)this.shadowRoot.adoptedStyleSheets=[styleSheet];else if(isArray(styleSheet))this.shadowRoot.adoptedStyleSheets=styleSheet;else if(isString(styleSheet)){this.shadowRoot.createElement("<style>").innerText=styleSheet,this.shadowRoot.adoptedStyleSheets=styleSheet}return this}function initShadowRoot(){var template,html;try{template=findDocumentTemplate(this.constructor.getTag())}catch(e){if(!isString(html=this.getOption("templates.main",""))||void 0===html||""===html)throw new Error("html is not set.")}return this.attachShadow({mode:this.getOption("shadowMode","open"),delegatesFocus:this.getOption("delegatesFocus",!0)}),template instanceof Template?(this.shadowRoot.appendChild(template.createDocumentFragment()),this):(this.shadowRoot.innerHTML=html,this)}function assignUpdaterToElement(elements,object){var updaters=new Set;elements instanceof NodeList&&(elements=new Set(customelement_toConsumableArray(elements)));var result=[];return elements.forEach((function(element){if(element instanceof HTMLElement&&!(element instanceof HTMLTemplateElement)){var u=new Updater(element,object);updaters.add(u),result.push(u.run().then((function(){return u.enableEventProcessing()})))}})),updaters.size>0&&addToObjectLink(this,objectUpdaterLinkSymbol,updaters),result}function customcontrol_typeof(obj){return(customcontrol_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function customcontrol_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function customcontrol_get(target,property,receiver){return(customcontrol_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(target,property,receiver){var base=function customcontrol_superPropBase(object,property){for(;!Object.prototype.hasOwnProperty.call(object,property)&&null!==(object=customcontrol_getPrototypeOf(object)););return object}(target,property);if(base){var desc=Object.getOwnPropertyDescriptor(base,property);return desc.get?desc.get.call(receiver):desc.value}})(target,property,receiver||target)}function customcontrol_setPrototypeOf(o,p){return(customcontrol_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function customcontrol_createSuper(Derived){var hasNativeReflectConstruct=function customcontrol_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=customcontrol_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=customcontrol_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return customcontrol_possibleConstructorReturn(this,result)}}function customcontrol_possibleConstructorReturn(self,call){if(call&&("object"===customcontrol_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return customcontrol_assertThisInitialized(self)}function customcontrol_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function customcontrol_getPrototypeOf(o){return(customcontrol_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",CustomElement,(function registerCustomElement(element){validateFunction(element),getGlobalObject("customElements").define(element.getTag(),element)}),assignUpdaterToElement);var attachedInternalSymbol=Symbol("attachedInternal");function getInternal(){if(!(attachedInternalSymbol in this))throw new Error("ElementInternals is not supported and a polyfill is necessary");return this[attachedInternalSymbol]}function initObserver(){var self=this;self[attributeObserverSymbol].value=function(){self.setOption("value",self.getAttribute("value"))}}function locale_typeof(obj){return(locale_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function locale_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function locale_setPrototypeOf(o,p){return(locale_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function locale_createSuper(Derived){var hasNativeReflectConstruct=function locale_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=locale_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=locale_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return locale_possibleConstructorReturn(this,result)}}function locale_possibleConstructorReturn(self,call){if(call&&("object"===locale_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function locale_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function locale_getPrototypeOf(o){return(locale_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",function(_CustomElement){!function customcontrol_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&customcontrol_setPrototypeOf(subClass,superClass)}(CustomControl,_CustomElement);var _super=customcontrol_createSuper(CustomControl);function CustomControl(){var _this;return function customcontrol_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,CustomControl),"function"==typeof(_this=_super.call(this)).attachInternals&&(_this[attachedInternalSymbol]=_this.attachInternals()),initObserver.call(customcontrol_assertThisInitialized(_this)),_this}return function customcontrol_createClass(Constructor,protoProps,staticProps){return protoProps&&customcontrol_defineProperties(Constructor.prototype,protoProps),staticProps&&customcontrol_defineProperties(Constructor,staticProps),Constructor}(CustomControl,[{key:"defaults",get:function get(){return extend({},customcontrol_get(customcontrol_getPrototypeOf(CustomControl.prototype),"defaults",this))}},{key:"value",get:function get(){throw Error("the value getter must be overwritten by the derived class")},set:function set(value){throw Error("the value setter must be overwritten by the derived class")}},{key:"labels",get:function get(){var _getInternal$call;return null===(_getInternal$call=getInternal.call(this))||void 0===_getInternal$call?void 0:_getInternal$call.labels}},{key:"name",get:function get(){return this.getAttribute("name")}},{key:"type",get:function get(){return this.constructor.getTag()}},{key:"validity",get:function get(){var _getInternal$call2;return null===(_getInternal$call2=getInternal.call(this))||void 0===_getInternal$call2?void 0:_getInternal$call2.validity}},{key:"validationMessage",get:function get(){var _getInternal$call3;return null===(_getInternal$call3=getInternal.call(this))||void 0===_getInternal$call3?void 0:_getInternal$call3.validationMessage}},{key:"willValidate",get:function get(){var _getInternal$call4;return null===(_getInternal$call4=getInternal.call(this))||void 0===_getInternal$call4?void 0:_getInternal$call4.willValidate}},{key:"states",get:function get(){var _getInternal$call5;return null===(_getInternal$call5=getInternal.call(this))||void 0===_getInternal$call5?void 0:_getInternal$call5.states}},{key:"form",get:function get(){var _getInternal$call6;return null===(_getInternal$call6=getInternal.call(this))||void 0===_getInternal$call6?void 0:_getInternal$call6.form}},{key:"setFormValue",value:function setFormValue(value,state){getInternal.call(this).setFormValue(value,state)}},{key:"setValidity",value:function setValidity(flags,message,anchor){getInternal.call(this).setValidity(flags,message,anchor)}},{key:"checkValidity",value:function checkValidity(){var _getInternal$call7;return null===(_getInternal$call7=getInternal.call(this))||void 0===_getInternal$call7?void 0:_getInternal$call7.checkValidity()}},{key:"reportValidity",value:function reportValidity(){var _getInternal$call8;return null===(_getInternal$call8=getInternal.call(this))||void 0===_getInternal$call8?void 0:_getInternal$call8.reportValidity()}}],[{key:"observedAttributes",get:function get(){var list=customcontrol_get(customcontrol_getPrototypeOf(CustomControl),"observedAttributes",this);return list.push("value"),list}},{key:"formAssociated",get:function get(){return!0}}]),CustomControl}(CustomElement));var propertiesSymbol=Symbol("properties"),localeStringSymbol=Symbol("localeString"),Locale=function(_Base){!function locale_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&locale_setPrototypeOf(subClass,superClass)}(Locale,_Base);var _super=locale_createSuper(Locale);function Locale(language,region,script,variants,extlang,privateUse){var _this;!function locale_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Locale),(_this=_super.call(this))[propertiesSymbol]={language:void 0===language?void 0:validateString(language),script:void 0===script?void 0:validateString(script),region:void 0===region?void 0:validateString(region),variants:void 0===variants?void 0:validateString(variants),extlang:void 0===extlang?void 0:validateString(extlang),privateUse:void 0===privateUse?void 0:validateString(privateUse)};var s=[];if(void 0!==language&&s.push(language),void 0!==script&&s.push(script),void 0!==region&&s.push(region),void 0!==variants&&s.push(variants),void 0!==extlang&&s.push(extlang),void 0!==privateUse&&s.push(privateUse),0===s.length)throw new Error("unsupported locale");return _this[localeStringSymbol]=s.join("-"),_this}return function locale_createClass(Constructor,protoProps,staticProps){return protoProps&&locale_defineProperties(Constructor.prototype,protoProps),staticProps&&locale_defineProperties(Constructor,staticProps),Constructor}(Locale,[{key:"localeString",get:function get(){return this[localeStringSymbol]}},{key:"language",get:function get(){return this[propertiesSymbol].language}},{key:"region",get:function get(){return this[propertiesSymbol].region}},{key:"script",get:function get(){return this[propertiesSymbol].script}},{key:"variants",get:function get(){return this[propertiesSymbol].variants}},{key:"extlang",get:function get(){return this[propertiesSymbol].extlang}},{key:"privateUse",get:function get(){return this[propertiesSymbol].privateValue}},{key:"toString",value:function toString(){return""+this.localeString}},{key:"getMap",value:function getMap(){return clone(this[propertiesSymbol])}}]),Locale}(Base);function parseLocale(locale){locale=validateString(locale).replace(/_/g,"-");var language,region,variants,parts,script,extlang,match,regex=new RegExp("^(((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((([A-Za-z]{2,3}(-([A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-([A-Za-z]{4}))?(-([A-Za-z]{2}|[0-9]{3}))?(-([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-([0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(x(-[A-Za-z0-9]{1,8})+))?)|(x(-[A-Za-z0-9]{1,8})+))$");if(null!==(match=regex.exec(locale))&&match.index===regex.lastIndex&&regex.lastIndex++,null==match)throw new Error("unsupported locale");return void 0!==match[6]&&(parts=(language=match[6]).split("-")).length>1&&(language=parts[0],extlang=parts[1]),void 0!==match[14]&&(region=match[14]),void 0!==match[12]&&(script=match[12]),void 0!==match[16]&&(variants=match[16]),new Locale(language,region,script,variants,extlang)}assignToNamespace("Monster.I18n",Locale,parseLocale);function basewithoptions_typeof(obj){return(basewithoptions_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function basewithoptions_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function basewithoptions_setPrototypeOf(o,p){return(basewithoptions_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function basewithoptions_createSuper(Derived){var hasNativeReflectConstruct=function basewithoptions_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=basewithoptions_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=basewithoptions_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return basewithoptions_possibleConstructorReturn(this,result)}}function basewithoptions_possibleConstructorReturn(self,call){if(call&&("object"===basewithoptions_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function basewithoptions_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function basewithoptions_getPrototypeOf(o){return(basewithoptions_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",(function getLocaleOfDocument(){var html=getDocument().querySelector("html");if(html instanceof HTMLElement&&html.hasAttribute("lang")){var locale=html.getAttribute("lang");if(locale)return new parseLocale(locale)}return parseLocale("en")}));var BaseWithOptions=function(_Base){!function basewithoptions_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&basewithoptions_setPrototypeOf(subClass,superClass)}(BaseWithOptions,_Base);var _super=basewithoptions_createSuper(BaseWithOptions);function BaseWithOptions(options){var _this;return function basewithoptions_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,BaseWithOptions),void 0===options&&(options={}),(_this=_super.call(this))[internalSymbol]=extend({},_this.defaults,validateObject(options)),_this}return function basewithoptions_createClass(Constructor,protoProps,staticProps){return protoProps&&basewithoptions_defineProperties(Constructor.prototype,protoProps),staticProps&&basewithoptions_defineProperties(Constructor,staticProps),Constructor}(BaseWithOptions,[{key:"defaults",get:function get(){return{}}},{key:"getOption",value:function getOption(path,defaultValue){var value;try{value=new Pathfinder(this[internalSymbol]).getVia(path)}catch(e){}return void 0===value?defaultValue:value}}]),BaseWithOptions}(Base);function translations_typeof(obj){return(translations_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function translations_slicedToArray(arr,i){return function translations_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function translations_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function translations_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return translations_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return translations_arrayLikeToArray(o,minLen)}(arr,i)||function translations_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function translations_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function translations_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function translations_setPrototypeOf(o,p){return(translations_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function translations_createSuper(Derived){var hasNativeReflectConstruct=function translations_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=translations_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=translations_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return translations_possibleConstructorReturn(this,result)}}function translations_possibleConstructorReturn(self,call){if(call&&("object"===translations_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function translations_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function translations_getPrototypeOf(o){return(translations_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",BaseWithOptions);var Translations=function(_Base){!function translations_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&translations_setPrototypeOf(subClass,superClass)}(Translations,_Base);var _super=translations_createSuper(Translations);function Translations(locale){var _this;return function translations_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Translations),_this=_super.call(this),isString(locale)&&(locale=parseLocale(locale)),_this.locale=validateInstance(locale,Locale),_this.storage=new Map,_this}return function translations_createClass(Constructor,protoProps,staticProps){return protoProps&&translations_defineProperties(Constructor.prototype,protoProps),staticProps&&translations_defineProperties(Constructor,staticProps),Constructor}(Translations,[{key:"getText",value:function getText(key,defaultText){if(!this.storage.has(key)){if(void 0===defaultText)throw new Error("key "+key+" not found");return validateString(defaultText)}return isObject(this.storage.get(key))?this.getPluralRuleText(key,"other",defaultText):this.storage.get(key)}},{key:"getPluralRuleText",value:function getPluralRuleText(key,count,defaultText){if(!this.storage.has(key))return validateString(defaultText);var keyword,r=validateObject(this.storage.get(key));if(isString(count))keyword=count.toLocaleString();else{if(0===(count=validateInteger(count))&&r.hasOwnProperty("zero"))return validateString(r.zero);keyword=new Intl.PluralRules(this.locale.toString()).select(validateInteger(count))}return r.hasOwnProperty(keyword)?validateString(r[keyword]):r.hasOwnProperty(DEFAULT_KEY)?validateString(r[DEFAULT_KEY]):validateString(defaultText)}},{key:"setText",value:function setText(key,text){if(isString(text)||isObject(text))return this.storage.set(validateString(key),text),this;throw new TypeError("value is not a string or object")}},{key:"assignTranslations",value:function assignTranslations(translations){validateObject(translations);for(var _i=0,_Object$entries=Object.entries(translations);_i<_Object$entries.length;_i++){var _Object$entries$_i=translations_slicedToArray(_Object$entries[_i],2),k=_Object$entries$_i[0],v=_Object$entries$_i[1];this.setText(k,v)}return this}}]),Translations}(Base);function provider_typeof(obj){return(provider_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function provider_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function provider_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function provider_setPrototypeOf(o,p){return(provider_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function provider_createSuper(Derived){var hasNativeReflectConstruct=function provider_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=provider_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=provider_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return provider_possibleConstructorReturn(this,result)}}function provider_possibleConstructorReturn(self,call){if(call&&("object"===provider_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function provider_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function provider_getPrototypeOf(o){return(provider_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.I18n",Translations);var Provider=function(_BaseWithOptions){!function provider_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&provider_setPrototypeOf(subClass,superClass)}(Provider,_BaseWithOptions);var _super=provider_createSuper(Provider);function Provider(){return provider_classCallCheck(this,Provider),_super.apply(this,arguments)}return function provider_createClass(Constructor,protoProps,staticProps){return protoProps&&provider_defineProperties(Constructor.prototype,protoProps),staticProps&&provider_defineProperties(Constructor,staticProps),Constructor}(Provider,[{key:"getTranslations",value:function getTranslations(locale){return new Promise((function(resolve,reject){try{resolve(new Translations(locale))}catch(e){reject(e)}}))}}]),Provider}(BaseWithOptions);function formatter_typeof(obj){return(formatter_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function formatter_slicedToArray(arr,i){return function formatter_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function formatter_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||formatter_unsupportedIterableToArray(arr,i)||function formatter_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function formatter_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=formatter_unsupportedIterableToArray(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e2){throw _e2},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e3){didErr=!0,err=_e3},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function formatter_unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return formatter_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?formatter_arrayLikeToArray(o,minLen):void 0}}function formatter_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function formatter_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function formatter_get(target,property,receiver){return(formatter_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(target,property,receiver){var base=function formatter_superPropBase(object,property){for(;!Object.prototype.hasOwnProperty.call(object,property)&&null!==(object=formatter_getPrototypeOf(object)););return object}(target,property);if(base){var desc=Object.getOwnPropertyDescriptor(base,property);return desc.get?desc.get.call(receiver):desc.value}})(target,property,receiver||target)}function formatter_setPrototypeOf(o,p){return(formatter_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function formatter_createSuper(Derived){var hasNativeReflectConstruct=function formatter_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=formatter_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=formatter_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return formatter_possibleConstructorReturn(this,result)}}function formatter_possibleConstructorReturn(self,call){if(call&&("object"===formatter_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function formatter_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function formatter_getPrototypeOf(o){return(formatter_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.I18n",Provider);var internalObjectSymbol=Symbol("internalObject"),watchdogSymbol=Symbol("watchdog"),markerOpenIndexSymbol=Symbol("markerOpenIndex"),markerCloseIndexSymbol=Symbol("markercloseIndex"),workingDataSymbol=Symbol("workingData"),Formatter=function(_BaseWithOptions){!function formatter_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&formatter_setPrototypeOf(subClass,superClass)}(Formatter,_BaseWithOptions);var _super=formatter_createSuper(Formatter);function Formatter(object,options){var _this;return function formatter_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Formatter),(_this=_super.call(this,options))[internalObjectSymbol]=object||{},_this[markerOpenIndexSymbol]=0,_this[markerCloseIndexSymbol]=0,_this}return function formatter_createClass(Constructor,protoProps,staticProps){return protoProps&&formatter_defineProperties(Constructor.prototype,protoProps),staticProps&&formatter_defineProperties(Constructor,staticProps),Constructor}(Formatter,[{key:"defaults",get:function get(){return extend({},formatter_get(formatter_getPrototypeOf(Formatter.prototype),"defaults",this),{marker:{open:["${"],close:["}"]},parameter:{delimiter:"::",assignment:"="},callbacks:{}})}},{key:"setParameterChars",value:function setParameterChars(delimiter,assignment){return void 0!==delimiter&&(this[internalSymbol].parameter.delimiter=validateString(delimiter)),void 0!==assignment&&(this[internalSymbol].parameter.assignment=validateString(assignment)),this}},{key:"setMarker",value:function setMarker(open,close){return void 0===close&&(close=open),isString(open)&&(open=[open]),isString(close)&&(close=[close]),this[internalSymbol].marker.open=validateArray(open),this[internalSymbol].marker.close=validateArray(close),this}},{key:"format",value:function format(text){return this[watchdogSymbol]=0,this[markerOpenIndexSymbol]=0,this[markerCloseIndexSymbol]=0,this[workingDataSymbol]={},_format.call(this,text)}}]),Formatter}(BaseWithOptions);function _format(text){var _self$internalSymbol$,_self$internalSymbol$2,_self$internalSymbol$3,_self$internalSymbol$4;if(this[watchdogSymbol]++,this[watchdogSymbol]>20)throw new Error("too deep nesting");var openMarker=null===(_self$internalSymbol$=this[internalSymbol].marker.open)||void 0===_self$internalSymbol$?void 0:_self$internalSymbol$[this[markerOpenIndexSymbol]],closeMarker=null===(_self$internalSymbol$2=this[internalSymbol].marker.close)||void 0===_self$internalSymbol$2?void 0:_self$internalSymbol$2[this[markerCloseIndexSymbol]];if(-1===text.indexOf(openMarker)||-1===text.indexOf(closeMarker))return text;var result=tokenize.call(this,validateString(text),openMarker,closeMarker);return null!==(_self$internalSymbol$3=this[internalSymbol].marker.open)&&void 0!==_self$internalSymbol$3&&_self$internalSymbol$3[this[markerOpenIndexSymbol]+1]&&this[markerOpenIndexSymbol]++,null!==(_self$internalSymbol$4=this[internalSymbol].marker.close)&&void 0!==_self$internalSymbol$4&&_self$internalSymbol$4[this[markerCloseIndexSymbol]+1]&&this[markerCloseIndexSymbol]++,result=_format.call(this,result)}function tokenize(text,openMarker,closeMarker){for(var formatted=[],parameterAssignment=this[internalSymbol].parameter.assignment,parameterDelimiter=this[internalSymbol].parameter.delimiter,callbacks=this[internalSymbol].callbacks;;){var _self$workingDataSymb,startIndex=text.indexOf(openMarker);if(-1===startIndex){formatted.push(text);break}startIndex>0&&(formatted.push(text.substring(0,startIndex)),text=text.substring(startIndex));var endIndex=text.substring(openMarker.length).indexOf(closeMarker);-1!==endIndex&&(endIndex+=openMarker.length);var insideStartIndex=text.substring(openMarker.length).indexOf(openMarker);if(-1!==insideStartIndex&&(insideStartIndex+=openMarker.length)<endIndex){var result=tokenize.call(this,text.substring(insideStartIndex),openMarker,closeMarker);-1!==(endIndex=(text=text.substring(0,insideStartIndex)+result).substring(openMarker.length).indexOf(closeMarker))&&(endIndex+=openMarker.length)}if(-1===endIndex)throw new Error("syntax error in formatter template");var key=text.substring(openMarker.length,endIndex),parts=key.split(parameterDelimiter),currentPipe=parts.shift();this[workingDataSymbol]=extend({},this[internalObjectSymbol],this[workingDataSymbol]);var _step,_iterator=formatter_createForOfIteratorHelper(parts);try{for(_iterator.s();!(_step=_iterator.n()).done;){var _kv$split2=formatter_slicedToArray(_step.value.split(parameterAssignment),2),k=_kv$split2[0],v=_kv$split2[1];this[workingDataSymbol][k]=v}}catch(err){_iterator.e(err)}finally{_iterator.f()}var t3=key.split("|").shift().trim().split("::").shift().trim().split(".").shift().trim(),prefix=null!==(_self$workingDataSymb=this[workingDataSymbol])&&void 0!==_self$workingDataSymb&&_self$workingDataSymb[t3]?"path:":"static:",command="";prefix&&0!==key.indexOf(prefix)&&0!==key.indexOf("path:")&&0!==key.indexOf("static:")&&(command=prefix);var pipe=new Pipe(command+=currentPipe);if(isObject(callbacks))for(var _i=0,_Object$entries=Object.entries(callbacks);_i<_Object$entries.length;_i++){var _Object$entries$_i=formatter_slicedToArray(_Object$entries[_i],2),name=_Object$entries$_i[0],callback=_Object$entries$_i[1];pipe.setCallback(name,callback)}formatted.push(validateString(pipe.run(this[workingDataSymbol]))),text=text.substring(endIndex+closeMarker.length)}return formatted.join("")}function fetch_typeof(obj){return(fetch_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function fetch_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function fetch_setPrototypeOf(o,p){return(fetch_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function fetch_createSuper(Derived){var hasNativeReflectConstruct=function fetch_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=fetch_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=fetch_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return fetch_possibleConstructorReturn(this,result)}}function fetch_possibleConstructorReturn(self,call){if(call&&("object"===fetch_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return fetch_assertThisInitialized(self)}function fetch_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function fetch_get(target,property,receiver){return(fetch_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(target,property,receiver){var base=function fetch_superPropBase(object,property){for(;!Object.prototype.hasOwnProperty.call(object,property)&&null!==(object=fetch_getPrototypeOf(object)););return object}(target,property);if(base){var desc=Object.getOwnPropertyDescriptor(base,property);return desc.get?desc.get.call(receiver):desc.value}})(target,property,receiver||target)}function fetch_getPrototypeOf(o){return(fetch_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function logentry_typeof(obj){return(logentry_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function logentry_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function logentry_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function logentry_setPrototypeOf(o,p){return(logentry_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function logentry_createSuper(Derived){var hasNativeReflectConstruct=function logentry_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=logentry_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=logentry_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return logentry_possibleConstructorReturn(this,result)}}function logentry_possibleConstructorReturn(self,call){if(call&&("object"===logentry_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function logentry_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function logentry_getPrototypeOf(o){return(logentry_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Text",Formatter),assignToNamespace("Monster.I18n.Providers",function(_Provider){!function fetch_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&fetch_setPrototypeOf(subClass,superClass)}(Fetch,_Provider);var _super=fetch_createSuper(Fetch);function Fetch(url,options){var _thisSuper,_this;return function fetch_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Fetch),_this=_super.call(this,options),isInstance(url,URL)&&(url=url.toString()),void 0===options&&(options={}),validateString(url),_this.url=url,_this[internalSymbol]=extend({},fetch_get((_thisSuper=fetch_assertThisInitialized(_this),fetch_getPrototypeOf(Fetch.prototype)),"defaults",_thisSuper),_this.defaults,validateObject(options)),_this}return function fetch_createClass(Constructor,protoProps,staticProps){return protoProps&&fetch_defineProperties(Constructor.prototype,protoProps),staticProps&&fetch_defineProperties(Constructor,staticProps),Constructor}(Fetch,[{key:"defaults",get:function get(){return{fetch:{method:"GET",mode:"cors",cache:"no-cache",credentials:"omit",redirect:"follow",referrerPolicy:"no-referrer"}}}},{key:"getTranslations",value:function getTranslations(locale){isString(locale)&&(locale=parseLocale(locale));var formatter=new Formatter(locale.getMap());return getGlobalFunction("fetch")(formatter.format(this.url),this.getOption("fetch",{})).then((function(response){return response.json()})).then((function(data){return new Translations(locale).assignTranslations(data)}))}}]),Fetch}(Provider));var LogEntry=function(_Base){!function logentry_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&logentry_setPrototypeOf(subClass,superClass)}(LogEntry,_Base);var _super=logentry_createSuper(LogEntry);function LogEntry(loglevel){var _this;logentry_classCallCheck(this,LogEntry),_this=_super.call(this),validateInteger(loglevel),_this.loglevel=loglevel;for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];return _this.arguments=args,_this}return function logentry_createClass(Constructor,protoProps,staticProps){return protoProps&&logentry_defineProperties(Constructor.prototype,protoProps),staticProps&&logentry_defineProperties(Constructor,staticProps),Constructor}(LogEntry,[{key:"getLogLevel",value:function getLogLevel(){return this.loglevel}},{key:"getArguments",value:function getArguments(){return this.arguments}}]),LogEntry}(Base);function logger_typeof(obj){return(logger_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function logger_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function logger_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return logger_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return logger_arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function logger_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function logger_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function logger_setPrototypeOf(o,p){return(logger_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function logger_createSuper(Derived){var hasNativeReflectConstruct=function logger_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=logger_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=logger_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return logger_possibleConstructorReturn(this,result)}}function logger_possibleConstructorReturn(self,call){if(call&&("object"===logger_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function logger_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function logger_getPrototypeOf(o){return(logger_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Logging",LogEntry);var TRACE=64,DEBUG=32,INFO=16,WARN=8,ERROR=4,FATAL=2;function triggerLog(loglevel){for(var logger=this,_len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];var _step,_iterator=logger_createForOfIteratorHelper(logger.handler);try{for(_iterator.s();!(_step=_iterator.n()).done;){var handler=_step.value;handler.log(new LogEntry(loglevel,args))}}catch(err){_iterator.e(err)}finally{_iterator.f()}return logger}function handler_typeof(obj){return(handler_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function handler_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function handler_setPrototypeOf(o,p){return(handler_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function handler_createSuper(Derived){var hasNativeReflectConstruct=function handler_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=handler_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=handler_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return handler_possibleConstructorReturn(this,result)}}function handler_possibleConstructorReturn(self,call){if(call&&("object"===handler_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function handler_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function handler_getPrototypeOf(o){return(handler_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Logging",function(_Base){!function logger_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&logger_setPrototypeOf(subClass,superClass)}(Logger,_Base);var _super=logger_createSuper(Logger);function Logger(){var _this;return function logger_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Logger),(_this=_super.call(this)).handler=new Set,_this}return function logger_createClass(Constructor,protoProps,staticProps){return protoProps&&logger_defineProperties(Constructor.prototype,protoProps),staticProps&&logger_defineProperties(Constructor,staticProps),Constructor}(Logger,[{key:"addHandler",value:function addHandler(handler){if(validateObject(handler),!(handler instanceof Handler))throw new Error("the handler must be an instance of Handler");return this.handler.add(handler),this}},{key:"removeHandler",value:function removeHandler(handler){if(validateObject(handler),!(handler instanceof Handler))throw new Error("the handler must be an instance of Handler");return this.handler.delete(handler),this}},{key:"logTrace",value:function logTrace(){return triggerLog.apply(this,[TRACE].concat(Array.prototype.slice.call(arguments))),this}},{key:"logDebug",value:function logDebug(){return triggerLog.apply(this,[DEBUG].concat(Array.prototype.slice.call(arguments))),this}},{key:"logInfo",value:function logInfo(){return triggerLog.apply(this,[INFO].concat(Array.prototype.slice.call(arguments))),this}},{key:"logWarn",value:function logWarn(){return triggerLog.apply(this,[WARN].concat(Array.prototype.slice.call(arguments))),this}},{key:"logError",value:function logError(){return triggerLog.apply(this,[ERROR].concat(Array.prototype.slice.call(arguments))),this}},{key:"logFatal",value:function logFatal(){return triggerLog.apply(this,[FATAL].concat(Array.prototype.slice.call(arguments))),this}},{key:"getLabel",value:function getLabel(level){return validateInteger(level),255===level?"ALL":level===TRACE?"TRACE":level===DEBUG?"DEBUG":level===INFO?"INFO":level===WARN?"WARN":level===ERROR?"ERROR":level===FATAL?"FATAL":0===level?"OFF":"unknown"}},{key:"getLevel",value:function getLevel(label){return validateString(label),"ALL"===label?255:"TRACE"===label?TRACE:"DEBUG"===label?DEBUG:"INFO"===label?INFO:"WARN"===label?WARN:"ERROR"===label?ERROR:"FATAL"===label?FATAL:0}}]),Logger}(Base));var Handler=function(_Base){!function handler_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&handler_setPrototypeOf(subClass,superClass)}(Handler,_Base);var _super=handler_createSuper(Handler);function Handler(){var _this;return function handler_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Handler),(_this=_super.call(this)).loglevel=0,_this}return function handler_createClass(Constructor,protoProps,staticProps){return protoProps&&handler_defineProperties(Constructor.prototype,protoProps),staticProps&&handler_defineProperties(Constructor,staticProps),Constructor}(Handler,[{key:"log",value:function log(entry){return validateInstance(entry,LogEntry),!(this.loglevel<entry.getLogLevel())}},{key:"setLogLevel",value:function setLogLevel(loglevel){return validateInteger(loglevel),this.loglevel=loglevel,this}},{key:"getLogLevel",value:function getLogLevel(){return this.loglevel}},{key:"setAll",value:function setAll(){return this.setLogLevel(255),this}},{key:"setTrace",value:function setTrace(){return this.setLogLevel(TRACE),this}},{key:"setDebug",value:function setDebug(){return this.setLogLevel(DEBUG),this}},{key:"setInfo",value:function setInfo(){return this.setLogLevel(INFO),this}},{key:"setWarn",value:function setWarn(){return this.setLogLevel(WARN),this}},{key:"setError",value:function setError(){return this.setLogLevel(ERROR),this}},{key:"setFatal",value:function setFatal(){return this.setLogLevel(FATAL),this}},{key:"setOff",value:function setOff(){return this.setLogLevel(0),this}}]),Handler}(Base);function console_typeof(obj){return(console_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function console_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function console_get(target,property,receiver){return(console_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(target,property,receiver){var base=function console_superPropBase(object,property){for(;!Object.prototype.hasOwnProperty.call(object,property)&&null!==(object=console_getPrototypeOf(object)););return object}(target,property);if(base){var desc=Object.getOwnPropertyDescriptor(base,property);return desc.get?desc.get.call(receiver):desc.value}})(target,property,receiver||target)}function console_setPrototypeOf(o,p){return(console_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function console_createSuper(Derived){var hasNativeReflectConstruct=function console_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=console_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=console_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return console_possibleConstructorReturn(this,result)}}function console_possibleConstructorReturn(self,call){if(call&&("object"===console_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function console_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function console_getPrototypeOf(o){return(console_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function random(min,max){if(void 0===min&&(min=0),void 0===max&&(max=MAX),max<min)throw new Error("max must be greater than min");return Math.round(create(min,max))}assignToNamespace("Monster.Logging",Handler),assignToNamespace("Monster.Logging.Handler",function(_Handler){!function console_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&console_setPrototypeOf(subClass,superClass)}(ConsoleHandler,_Handler);var _super=console_createSuper(ConsoleHandler);function ConsoleHandler(){return function console_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ConsoleHandler),_super.call(this)}return function console_createClass(Constructor,protoProps,staticProps){return protoProps&&console_defineProperties(Constructor.prototype,protoProps),staticProps&&console_defineProperties(Constructor,staticProps),Constructor}(ConsoleHandler,[{key:"log",value:function log(entry){if(console_get(console_getPrototypeOf(ConsoleHandler.prototype),"log",this).call(this,entry)){var console=getGlobalObject("console");return!!console&&(console.log(entry.toString()),!0)}return!1}}]),ConsoleHandler}(Handler));var MAX=1e9;function create(min,max){var crypt,globalReference=getGlobal();if(void 0===(crypt=(null==globalReference?void 0:globalReference.crypto)||(null==globalReference?void 0:globalReference.msCrypto)||(null==globalReference?void 0:globalReference.crypto)||void 0))throw new Error("missing crypt");var rval=0,range=max-min;if(range<2)throw new Error("the distance is too small to create a random number.");var bitsNeeded=Math.ceil(Math.log2(range));if(bitsNeeded>53)throw new Error("we cannot generate numbers larger than 53 bits.");var bytesNeeded=Math.ceil(bitsNeeded/8),mask=Math.pow(2,bitsNeeded)-1,byteArray=new Uint8Array(bytesNeeded);crypt.getRandomValues(byteArray);for(var p=8*(bytesNeeded-1),i=0;i<bytesNeeded;i++)rval+=byteArray[i]*Math.pow(2,p),p-=8;return(rval&=mask)>=range?create(min,max):(rval<min&&(rval+=min),rval)}function randomid_typeof(obj){return(randomid_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function randomid_setPrototypeOf(o,p){return(randomid_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function randomid_createSuper(Derived){var hasNativeReflectConstruct=function randomid_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=randomid_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=randomid_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return randomid_possibleConstructorReturn(this,result)}}function randomid_possibleConstructorReturn(self,call){if(call&&("object"===randomid_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function randomid_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function randomid_getPrototypeOf(o){return(randomid_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Math.log2=Math.log2||function(n){return Math.log(n)/Math.log(2)},assignToNamespace("Monster.Math",random);var randomid_internalCounter=0;function version_typeof(obj){return(version_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function version_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function version_setPrototypeOf(o,p){return(version_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function version_createSuper(Derived){var hasNativeReflectConstruct=function version_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=version_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=version_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return version_possibleConstructorReturn(this,result)}}function version_possibleConstructorReturn(self,call){if(call&&("object"===version_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function version_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function version_getPrototypeOf(o){return(version_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",function(_ID){!function randomid_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&randomid_setPrototypeOf(subClass,superClass)}(RandomID,_ID);var _super=randomid_createSuper(RandomID);function RandomID(){var _this;return function randomid_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,RandomID),_this=_super.call(this),randomid_internalCounter+=1,_this.id=getGlobal().btoa(random(1,1e4)).replace(/=/g,"").replace(/^[0-9]+/,"X")+randomid_internalCounter,_this}return RandomID}(ID));var monsterVersion,rootName,Version=function(_Base){!function version_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&version_setPrototypeOf(subClass,superClass)}(Version,_Base);var _super=version_createSuper(Version);function Version(major,minor,patch){var _this;if(function version_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Version),_this=_super.call(this),"string"==typeof major&&void 0===minor&&void 0===patch){var parts=major.toString().split(".");major=parseInt(parts[0]||0),minor=parseInt(parts[1]||0),patch=parseInt(parts[2]||0)}if(void 0===major)throw new Error("major version is undefined");if(void 0===minor&&(minor=0),void 0===patch&&(patch=0),_this.major=parseInt(major),_this.minor=parseInt(minor),_this.patch=parseInt(patch),isNaN(_this.major))throw new Error("major is not a number");if(isNaN(_this.minor))throw new Error("minor is not a number");if(isNaN(_this.patch))throw new Error("patch is not a number");return _this}return function version_createClass(Constructor,protoProps,staticProps){return protoProps&&version_defineProperties(Constructor.prototype,protoProps),staticProps&&version_defineProperties(Constructor,staticProps),Constructor}(Version,[{key:"toString",value:function toString(){return this.major+"."+this.minor+"."+this.patch}},{key:"compareTo",value:function compareTo(version){if(version instanceof Version&&(version=version.toString()),"string"!=typeof version)throw new Error("type exception");if(version===this.toString())return 0;for(var a=[this.major,this.minor,this.patch],b=version.split("."),len=Math.max(a.length,b.length),i=0;i<len;i+=1){if(a[i]&&!b[i]&&parseInt(a[i])>0||parseInt(a[i])>parseInt(b[i]))return 1;if(b[i]&&!a[i]&&parseInt(b[i])>0||parseInt(a[i])<parseInt(b[i]))return-1}return 0}}]),Version}(Base);function comparator_typeof(obj){return(comparator_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function comparator_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function comparator_setPrototypeOf(o,p){return(comparator_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function comparator_createSuper(Derived){var hasNativeReflectConstruct=function comparator_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=comparator_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=comparator_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return comparator_possibleConstructorReturn(this,result)}}function comparator_possibleConstructorReturn(self,call){if(call&&("object"===comparator_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function comparator_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function comparator_getPrototypeOf(o){return(comparator_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function freeze_typeof(obj){return(freeze_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function freeze_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function freeze_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return freeze_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return freeze_arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function freeze_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}assignToNamespace("Monster.Types",Version),assignToNamespace("Monster",(function getVersion(){return monsterVersion instanceof Version?monsterVersion:monsterVersion=new Version("1.29.1")})),assignToNamespace("Monster.Util",function(_Base){!function comparator_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&comparator_setPrototypeOf(subClass,superClass)}(Comparator,_Base);var _super=comparator_createSuper(Comparator);function Comparator(callback){var _this;if(function comparator_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Comparator),_this=_super.call(this),isFunction(callback))_this.compare=callback;else{if(void 0!==callback)throw new TypeError("unsupported type");_this.compare=function(a,b){if(comparator_typeof(a)!==comparator_typeof(b))throw new TypeError("impractical comparison","types/comparator.js");return a===b?0:a<b?-1:1}}return _this}return function comparator_createClass(Constructor,protoProps,staticProps){return protoProps&&comparator_defineProperties(Constructor.prototype,protoProps),staticProps&&comparator_defineProperties(Constructor,staticProps),Constructor}(Comparator,[{key:"reverse",value:function reverse(){var original=this.compare;return this.compare=function(a,b){return original(b,a)},this}},{key:"equal",value:function equal(a,b){return 0===this.compare(a,b)}},{key:"greaterThan",value:function greaterThan(a,b){return this.compare(a,b)>0}},{key:"greaterThanOrEqual",value:function greaterThanOrEqual(a,b){return this.greaterThan(a,b)||this.equal(a,b)}},{key:"lessThanOrEqual",value:function lessThanOrEqual(a,b){return this.lessThan(a,b)||this.equal(a,b)}},{key:"lessThan",value:function lessThan(a,b){return this.compare(a,b)<0}}]),Comparator}(Base)),assignToNamespace("Monster.Util",(function deepFreeze(object){validateObject(object);var _step,_iterator=freeze_createForOfIteratorHelper(Object.getOwnPropertyNames(object));try{for(_iterator.s();!(_step=_iterator.n()).done;){var name=_step.value,value=object[name];object[name]=value&&"object"===freeze_typeof(value)?deepFreeze(value):value}}catch(err){_iterator.e(err)}finally{_iterator.f()}return Object.freeze(object)}));try{rootName=Monster.Types.getGlobalObject("__MonsterRootName__")}catch(e){}return rootName||(rootName="Monster"),Monster.Types.getGlobal()[rootName]=Monster,__webpack_exports__}()}));