web-component-wrapper 0.0.601 → 0.0.604

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1,605 @@
1
- "use strict";if("undefined"!=typeof module&&null!==module&&"undefined"!==eval("typeof require")&&null!==eval("require")&&"main"in eval("require")&&"undefined"!==eval("typeof require.main")&&null!==eval("require.main")){var ORIGINAL_MAIN_MODULE=module;module!==eval("require.main")&&"paths"in module&&"paths"in eval("require.main")&&"undefined"!=typeof __dirname&&null!==__dirname&&(module.paths=eval("require.main.paths").concat(module.paths.filter((function(path){return eval("require.main.paths").includes(path)}))))}if(null==window)var window="undefined"==typeof global||null===global?{}:global;!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/helpers/initializerDefineProperty"),require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/inheritsLoose"),require("@babel/runtime/helpers/applyDecoratedDescriptor"),require("@babel/runtime/helpers/initializerWarningHelper"),require("@babel/runtime/regenerator"),require("clientnode"),require("clientnode/property-types"));else if("function"==typeof define&&define.amd)define(["@babel/runtime/helpers/asyncToGenerator","@babel/runtime/helpers/initializerDefineProperty","@babel/runtime/helpers/extends","@babel/runtime/helpers/inheritsLoose","@babel/runtime/helpers/applyDecoratedDescriptor","@babel/runtime/helpers/initializerWarningHelper","@babel/runtime/regenerator","clientnode","clientnode/property-types"],t);else{var r="object"==typeof exports?t(require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/helpers/initializerDefineProperty"),require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/inheritsLoose"),require("@babel/runtime/helpers/applyDecoratedDescriptor"),require("@babel/runtime/helpers/initializerWarningHelper"),require("@babel/runtime/regenerator"),require("clientnode"),require("clientnode/property-types")):t(e["@babel/runtime/helpers/asyncToGenerator"],e["@babel/runtime/helpers/initializerDefineProperty"],e["@babel/runtime/helpers/extends"],e["@babel/runtime/helpers/inheritsLoose"],e["@babel/runtime/helpers/applyDecoratedDescriptor"],e["@babel/runtime/helpers/initializerWarningHelper"],e["@babel/runtime/regenerator"],e.clientnode,e["clientnode/property-types"]);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,(function(e,t,r,n,i,s,o,a,l){return function(){var p=[function(e){e.exports=r},function(e){e.exports=a},function(e){e.exports=l},function(e){e.exports=n},function(t){t.exports=e},function(e){e.exports=o},function(e,t,r){var n=r(0),i=r.n(n),s=r(1),o=r(2);t.default=function(e){return void 0===e&&(e={}),e=i()({readAttribute:!0,type:o.string},e),function(t,r){if("string"==typeof r){var n,o=t.self||t.constructor;if(e.readAttribute){Object.prototype.hasOwnProperty.call(o,"observedAttributes")||(o.observedAttributes=o.observedAttributes?[].concat(o.observedAttributes):[]);var a=(0,s.camelCaseToDelimited)(r);o.observedAttributes&&!o.observedAttributes.includes(a)&&o.observedAttributes.push(a)}if(e.type&&(Object.prototype.hasOwnProperty.call(o,"propertyTypes")||(o.propertyTypes=o.propertyTypes?i()({},o.propertyTypes):{}),!o.propertyTypes||!e.update&&Object.prototype.hasOwnProperty.call(o,r)||(o.propertyTypes[r]=e.type)),e.writeAttribute)if(Object.prototype.hasOwnProperty.call(o,"propertiesToReflectAsAttributes")||(o.propertiesToReflectAsAttributes=o.propertiesToReflectAsAttributes?(0,s.copy)(o.propertiesToReflectAsAttributes):[]),e.update||o.propertiesToReflectAsAttributes instanceof Map&&!o.propertiesToReflectAsAttributes.has(r)||Array.isArray(o.propertiesToReflectAsAttributes)&&!o.propertiesToReflectAsAttributes.includes(r)||"object"==typeof o.propertiesToReflectAsAttributes&&!Object.prototype.hasOwnProperty.call(o.propertiesToReflectAsAttributes,r))"boolean"==typeof e.writeAttribute?e.writeAttribute&&o.propertyTypes&&Object.prototype.hasOwnProperty.call(o.propertyTypes,r)&&(n=o.propertyTypes[r]):n=e.writeAttribute,void 0!==n&&(Array.isArray(o.propertiesToReflectAsAttributes)&&(!0===e.writeAttribute?o.propertiesToReflectAsAttributes.push(r):o.normalizePropertyTypeList&&(o.propertiesToReflectAsAttributes=o.normalizePropertyTypeList(o.propertiesToReflectAsAttributes))),o.propertiesToReflectAsAttributes instanceof Map&&o.propertiesToReflectAsAttributes.set(r,n),"object"==typeof o.propertiesToReflectAsAttributes&&(o.propertiesToReflectAsAttributes[r]=n));e.alias&&(Object.prototype.hasOwnProperty.call(o,"propertyAliases")||(o.propertyAliases=o.propertyAliases?i()({},o.propertyAliases):{}),!o.propertyAliases||!e.update&&Object.prototype.hasOwnProperty.call(o,r)||(o.propertyAliases[r]=e.alias))}}}},,function(e){e.exports=t},function(e){e.exports=i},function(e){e.exports=s}],u={};function c(e){var t=u[e];if(void 0!==t)return t.exports;var r=u[e]={exports:{}};return p[e](r,r.exports,c),r.exports}c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,{a:t}),t},c.d=function(e,t){for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var d={};c.r(d),c.d(d,{GenericHTMLElement:function(){return k},Web:function(){return V},api:function(){return M},log:function(){return D}});var h,f,b,y,m=c(4),v=c.n(m),g=c(8),A=c.n(g),P=c(0),w=c.n(P),T=c(3),O=c.n(T),S=c(9),x=c.n(S),R=(c(10),c(5)),C=c.n(R),E=c(1),N=c(2),I=c(6);function j(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return U(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?U(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function U(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var D=new E.Logger({name:"web-component-wrapper-web"}),k="undefined"==typeof HTMLElement?function(){}:HTMLElement,V=(h=(0,I.default)({type:N.boolean,writeAttribute:!0}),y=function(e){function t(){var r;return(r=e.call(this)||this).renderState={promise:Promise.resolve(""),pending:!1,resolve:E.NOOP},r.childComponentInstances=[],r.batchAttributeUpdates=!0,r.batchPropertyUpdates=!0,r.batchUpdates=!0,r.batchedAttributeUpdateRunning=!0,r.batchedPropertyUpdateRunning=!0,r.batchedUpdateRunning=!0,r.connectionRegistered=!1,r.pendingAttributeUpdates=[],r.parentInstance=null,r.rootInstance=void 0,r.hostDomNode=void 0,r.scope=w()({},E.UTILITY_SCOPE),r.domNodeEventBindings=new Map,r.domNodeTemplateCache=new Map,r.externalProperties={},r.ignoreAttributeUpdateObservations=!1,r.internalProperties={},r.outputEventNames=new Set,r.instance=null,A()(r,"isRoot",b,r),r.runDomConnectionAndRenderingInSameEventQueue=!1,r.self=t,r.slots={},r.prepareNewRenderingPromise(),r.self=r.constructor,r.self._propertiesToReflectAsAttributes||(r.self._propertiesToReflectAsAttributes=r.self.normalizePropertyTypeList(r.self.propertiesToReflectAsAttributes)),r.generateAliasIndex(),r.hostDomNode=r,r.rootInstance=r,r.defineGetterAndSetterInterface(),r}O()(t,e);var r=t.prototype;return r.attributeChangedCallback=function(e,t,r){this.ignoreAttributeUpdateObservations||t===r||this.onUpdateAttribute(e,r)},r.onUpdateAttribute=function(e,t){var r=this,n=new Promise((function(n){return r.pendingAttributeUpdates.push((function(){r.evaluateStringOrNullAndSetAsProperty(e,t),r.batchAttributeUpdates?r.batchedAttributeUpdateRunning||r.batchedUpdateRunning||(r.batchedAttributeUpdateRunning=!0,r.batchedUpdateRunning=!0,(0,E.timeout)((function(){r.batchedAttributeUpdateRunning=!1,r.batchedUpdateRunning=!1,r.render("attributeChanged")}))):r.render("attributeChanged"),n()}))}));if(this.connectionRegistered)for(;this.pendingAttributeUpdates.length;)this.pendingAttributeUpdates.shift()();return n},r.connectedCallback=function(){var e=this;try{this.isConnected=!0}catch(e){}for(this.connectionRegistered=!0,this.parentInstance=this,this.rootInstance=this,this.attachEventHandler(),this.self.determineRootBinding&&(this.determineRootBinding(),this.parentInstance!==this&&this.parentInstance.childComponentInstances&&this.parentInstance.childComponentInstances.push(this)),this.self.applyRootBinding&&this.isRoot&&(this.determineRenderScope(),this.applyBinding(this,this.scope));this.pendingAttributeUpdates.length;)this.pendingAttributeUpdates.shift()();this.batchedAttributeUpdateRunning=!1,this.batchedPropertyUpdateRunning=!1,this.batchedUpdateRunning=!1,this.grabGivenSlots(),this.reflectExternalProperties(this.externalProperties),this.runDomConnectionAndRenderingInSameEventQueue?this.render("connected"):(0,E.timeout)((function(){e.render("connected")}))},r.disconnectedCallback=function(){this.unRender("disconnected"),this.unregisterConnectionState()},r.defineGetterAndSetterInterface=function(){for(var e,t=this,r=function(){var r=e.value;Object.prototype.hasOwnProperty.call(t,r)&&t.setPropertyValue(r,t[r]),Object.defineProperty(t,r,{configurable:!0,get:function(){return t.getPropertyValue(r)},set:function(e){t.setPropertyValue(r,e),t.triggerPropertySpecificRendering(r,e)}})},n=j((0,E.unique)(Object.keys(this.self.propertyTypes).concat(this.self._propertyAliasIndex?Object.keys(this.self._propertyAliasIndex):[])));!(e=n()).done;)r()},r.getPropertyAlias=function(e){return this.self._propertyAliasIndex&&Object.prototype.hasOwnProperty.call(this.self._propertyAliasIndex,e)?this.self._propertyAliasIndex[e]:null},r.getPropertyValue=function(e){var r,n,i,s=null!=(r=this.instance)&&null!=(r=r.current)&&r.properties&&(Object.prototype.hasOwnProperty.call(!t.propertyTypes,e)||Object.prototype.hasOwnProperty.call(this.instance.current.properties,e))?this.instance.current.properties[e]:null!==(n=this.internalProperties[e])&&void 0!==n?n:this.externalProperties[e];return null!=(i=this.instance)&&null!=(i=i.current)&&i.state&&Object.prototype.hasOwnProperty.call(this.instance.current.state,e)?this.instance.current.state[e]:s},r.setExternalPropertyValue=function(e,t){this.externalProperties[e]=t;var r=this.getPropertyAlias(e);r&&(this.externalProperties[r]=t)},r.setInternalPropertyValue=function(e,t){this.internalProperties[e]=t;var r=this.getPropertyAlias(e);r&&(this.internalProperties[r]=t)},r.setPropertyValue=function(e,t){var r;this.reflectProperties(((r={})[e]=t,r)),this.setInternalPropertyValue(e,t)},r.triggerPropertySpecificRendering=function(e,t){var r=this;if(this.batchPropertyUpdates)this.batchedPropertyUpdateRunning||this.batchedUpdateRunning||(this.batchedPropertyUpdateRunning=!0,this.batchedUpdateRunning=!0,(0,E.timeout)((function(){void 0!==t&&r.isStateProperty(e)?(r.render("preStatePropertyChanged"),(0,E.timeout)((function(){r.setInternalPropertyValue(e,void 0),r.batchedPropertyUpdateRunning=!1,r.batchedUpdateRunning=!1,r.render("postStatePropertyChanged"),r.triggerOutputEvents()}))):(r.batchedPropertyUpdateRunning=!1,r.batchedUpdateRunning=!1,r.render("propertyChanged"),r.triggerOutputEvents())})));else{var n=this.isStateProperty(e);this.render(n?"preStatePropertyChanged":"propertyChanged"),void 0!==t&&n&&(this.setInternalPropertyValue(e,void 0),this.render("postStatePropertyChanged")),this.triggerOutputEvents()}},r.unregisterConnectionState=function(){try{this.isConnected=!1}catch(e){}this.connectionRegistered=!1,this.slots={}},r.unregisterDomNodeEventBindings=function(){for(var e,t=j(this.domNodeEventBindings.values());!(e=t()).done;)for(var r,n=j(e.value.values());!(r=n()).done;){(0,r.value)()}},r.applyBinding=function(e,t){var r=this;if(e.getAttributeNames)for(var n,i=function(){var i,s=n.value;if(s.startsWith("data-bind-")?i=s.substring(10):s.startsWith("bind-")&&(i=s.substring(5)),i){var o=e.getAttribute(s);if(null===o)return 0;if(i.startsWith("attribute-")||i.startsWith("property-")){var a=(0,E.evaluate)(o,t,!1,!0,e);if(a.error)return D.warn("Error occurred during processing given",'attribute binding "'+s+'" on node:',e,a.error),0;i.startsWith("attribute-")?e.setAttribute(i.substring(10),a.result):e[(0,E.delimitedToCamelCase)(i.substring(9))]=a.result}else if(i.startsWith("on-")){i=(0,E.delimitedToCamelCase)(i.substring(3)),t=w()({log:D,event:void 0,parameters:void 0},t);var l=(0,E.compile)(o,t,!0,!0,e);l.error?D.warn("Error occurred during compiling given event",'binding "'+s+'" on node:',e,l.error):r.addSecureEventListener(e,i,(function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.event=n[0],t.parameters=n;try{l.templateFunction.apply(l,l.originalScopeNames.map((function(e){return t[e]})))}catch(t){D.warn("Error occurred during processing","given event binding",'"'+s+'" on node:',e,'Given expression "'+o+'" could',"not be evaluated with given scope",'names "'+l.scopeNames.join('", "')+'": '+(0,E.represent)(t))}}))}}},s=j(e.getAttributeNames());!(n=s()).done;)i()},r.applyBindings=function(e,t,r){for(void 0===r&&(r=!0);e;){var n;null==(n=e.attributes)||!n.length||!r&&e.getAttribute("slot")||this.applyBinding(e,t),e.nodeName.toLowerCase().includes("-")||this.applyBindings(e.firstChild,t),e=e.nextSibling}},r.compileDomNodeTemplate=function(e,t,r){void 0===t&&(t=[]),void 0===r&&(r={}),r=w()({ignoreComponents:!0,ignoreNestedComponents:!0,unsafe:this.self.renderUnsafe},r);var n=e.nodeName.toLowerCase();if(r.ignoreComponents&&n.includes("-"))return null;if(r.unsafe){var i=e.innerHTML;if(!i&&e.template&&(i=e.template),this.self.hasCode(i)){var s=(0,E.compile)("`"+i+"`",t);return{domNode:e,children:[],error:s.error,scopeNames:s.scopeNames,template:i,templateFunction:s.templateFunction}}return null}var o=null;if("#text"===n){var a=e.textContent;a&&this.self.hasCode(a)&&(o=a.replace(/&nbsp;/g," ").trim())}var l=[],p={children:l,domNode:e};if(o){var u=(0,E.compile)("`"+o+"`",t);p.error=u.error,p.scopeNames=u.scopeNames,p.template=o,p.templateFunction=u.templateFunction}for(var c=e.firstChild;c;){if(!r.filter||r.filter(c)){var d=this.compileDomNodeTemplate(c,t,w()({},r,{ignoreComponents:r.ignoreNestedComponents}));d&&l.push(d)}c=c.nextSibling}return p},r.evaluateCompiledDomNodeTemplate=function(e,t){var r=e.domNode,n=e.error,i=e.templateFunction,s=e.scopeNames;if(!i||!s)return null;if(n)return D.warn("Error occurred during compiling node content:",n),null;var o=null;try{o=i.apply(void 0,s.map((function(e){return t[e]})))}catch(n){D.warn('Error occurred when "'+this.self._name+'" is running','"'+String(i)+'": with bound','names "'+s.join('", "')+'":','"'+n+'". Rendering node:',r)}return o},r.evaluateDomNodeTemplate=function(e,t,r){var n=this;void 0===t&&(t={}),void 0===r&&(r={});var i=(r=w()({domNodeTemplateCache:this.domNodeTemplateCache,ignoreComponents:!0,ignoreNestedComponents:!0,unsafe:this.self.renderUnsafe},r)).domNodeTemplateCache;if(!i.has(e)){var s={filter:r.filter,ignoreComponents:r.ignoreComponents,ignoreNestedComponents:r.ignoreNestedComponents,unsafe:r.unsafe},o=this.compileDomNodeTemplate(e,t,s);o&&i.set(e,o)}if(i.has(e)){var a=i.get(e),l=this.evaluateCompiledDomNodeTemplate(a,t);if(null!==l&&(r.unsafe&&e.innerHTML?e.innerHTML=l:e.textContent=l),a.children.length){var p=function(e){for(var r,i=j(e);!(r=i()).done;){var s=r.value,o=n.evaluateCompiledDomNodeTemplate(s,t);null!==o&&(s.domNode.textContent=o),s.children.length&&p(s.children)}};p(a.children)}}r.applyBindings&&this.applyBindings(e,t)},r.addSecureEventListener=function(e,t,r,n,i){var s=this;this.domNodeEventBindings.has(e)||this.domNodeEventBindings.set(e,new Map);var o=this.domNodeEventBindings.get(e),a=o.get(t);a&&a!==r&&a();var l=function(){e.removeEventListener(t,r,i),o.delete(t),0===o.size&&s.domNodeEventBindings.delete(e)};return o.set(t,l),e.addEventListener(t,r,n),l},r.determineRootBinding=function(){for(var e=this.parentNode;e;){var r=e instanceof t||e.nodeName.includes("-")&&"#document-fragment"!==e.nodeName,n=null===e.parentNode&&"[object ShadowRoot]"===e.toString();r?(this.rootInstance===this&&(this.parentInstance=e,this.setPropertyValue("isRoot",!1)),this.rootInstance=e):n&&this.setPropertyValue("isRoot",!1),e=e.parentNode}},t.hasCode=function(e){return"string"==typeof e&&e.includes("${")&&e.includes("}")&&/\${[\s\S]+}/.test(e)},t.normalizePropertyTypeList=function(e){if("string"==typeof e&&(e=[e]),Array.isArray(e)){for(var r,n=e,i=new Map,s=j(n);!(r=s()).done;){var o=r.value;Object.prototype.hasOwnProperty.call(t.propertyTypes,o)&&i.set(o,t.propertyTypes[o])}return i}return(0,E.convertPlainObjectToMap)(e)},r.attachEventHandler=function(){if(null!==this.self.eventToPropertyMapping){var e=this.attachExplicitDefinedOutputEventHandler();this.attachImplicitDefinedOutputEventHandler(!e)}},r.attachExplicitDefinedOutputEventHandler=function(){var e=this;if(!this.self.eventToPropertyMapping)return!1;for(var t=!1,r=function(){var r=i[n];Object.prototype.hasOwnProperty.call(e.internalProperties,r)||(t=!0,e.outputEventNames.add(r),e.setInternalPropertyValue(r,v()(C().mark((function t(){var n,i,s,o,a=arguments;return C().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(n=a.length,i=new Array(n),s=0;s<n;s++)i[s]=a[s];return t.next=1,e.reflectEventToProperties(r,i);case 1:(o=t.sent)&&(i[0]=o),e.forwardEvent(r,i);case 2:case"end":return t.stop()}}),t)})))))},n=0,i=Object.keys(this.self.eventToPropertyMapping);n<i.length;n++)r();return t},r.attachImplicitDefinedOutputEventHandler=function(e){var t=this;void 0===e&&(e=!0);for(var r=function(){var r=i[n],s=r[0],o=r[1];Object.prototype.hasOwnProperty.call(t.internalProperties,s)||![N.func,"function"].includes(o)||t.self.renderProperties.includes(s)||(t.outputEventNames.add(s),t.setInternalPropertyValue(s,(function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e&&t.reflectEventToProperties(s,n),t.forwardEvent(s,n)})))},n=0,i=Object.entries(this.self.propertyTypes);n<i.length;n++)r()},r.triggerOutputEvents=function(){for(var e,t=j(this.outputEventNames);!(e=t()).done;){var r=e.value;this.forwardEvent(r,[this.externalProperties])}},r.forwardEvent=function(e,t){return e.length>3&&e.startsWith("on")&&(e=(0,E.lowerCase)(e.substring(2))),this.dispatchEvent(new CustomEvent(e,{detail:{parameters:t}}))},r.applySlots=function(e,r){for(var n=this,i=0,s=Array.from(e.querySelectorAll("slot"));i<s.length;i++){var o=s[i],a=o.getAttribute("name");if(null===a||"default"===a)if(this.slots.default){if(this.self.renderSlots){if(this.self.evaluateSlots)for(var l,p=j(this.slots.default);!(l=p()).done;){var u=l.value;this.evaluateDomNodeTemplate(u,r)}(0,E.replace)(o,this.slots.default,t.trimSlots)}}else this.slots.default=(0,E.unwrap)(o).map((function(e){return n.grabSlotContent(e)}));else this.slots[a]?this.self.renderSlots&&(this.self.evaluateSlots&&this.evaluateDomNodeTemplate(this.slots[a],r),(0,E.replace)(o,this.slots[a],t.trimSlots)):this.slots[a]=this.grabSlotContent((0,E.unwrap)(o).filter((function(e){return"#text"!==e.nodeName.toLowerCase()}))[0])}},r.grabSlotContent=function(e){var t,r=N.node.firstElementChild?e:null;if(r&&"textarea"===(null==(t=r.firstElementChild)?void 0:t.nodeName.toLowerCase())&&(!r.firstElementChild.hasAttribute("data-no-template")||"false"===r.firstElementChild.getAttribute("data-no-template"))){var n=r.firstElementChild.value;r.classList.remove("web-component-template");var i=r.cloneNode();return r.classList.add("web-component-template"),i.innerHTML="",i.template=n,i}return this.self.cloneSlots?e.cloneNode(!0):e},r.grabGivenSlots=function(){var e=this;this.slots={};for(var t=0,r=Array.from(this.querySelectorAll("[slot]"));t<r.length;t++){for(var n,i=r[t],s=i.parentNode,o=!0;s;){if(s.nodeName.includes("-")){s===this&&(o=!1);break}s=s.parentNode}if(!o){var a=null==(n=i.getAttribute("slot"))?void 0:n.trim();this.slots[null!=a?a:i.nodeName.toLowerCase()]=this.grabSlotContent(i)}}this.slots.default?this.slots.default=[].concat(this.slots.default):this.childNodes.length>0?this.slots.default=Array.from(this.childNodes).map((function(t){return e.grabSlotContent(t)})):this.slots.default=[]},r.isStateProperty=function(e){var t;return Boolean((null==(t=this.instance)||null==(t=t.current)?void 0:t.state)&&(Object.prototype.hasOwnProperty.call(this.instance.current.state,e)||this.instance.current.state.modelState&&Object.prototype.hasOwnProperty.call(this.instance.current.state.modelState,e)))},r.generateAliasIndex=function(){if(!this.self._propertyAliasIndex){this.self._propertyAliasIndex=w()({},this.self.propertyAliases);for(var e=0,t=Object.entries(this.self._propertyAliasIndex);e<t.length;e++){var r=t[e],n=r[0],i=r[1];Object.prototype.hasOwnProperty.call(this.self._propertyAliasIndex,i)||(this.self._propertyAliasIndex[i]=n)}}},r.reflectExternalProperties=function(e){this.ignoreAttributeUpdateObservations=!0;for(var t=0,r=Object.entries(e);t<r.length;t++){var n,i=r[t],s=i[0],o=i[1];if(this.setExternalPropertyValue(s,o),this.isConnected){var a=(0,E.camelCaseToDelimited)(s);if(null!=(n=this.self._propertiesToReflectAsAttributes)&&n.has(s))switch(this.self._propertiesToReflectAsAttributes.get(s)){case N.boolean:case"boolean":o?""!==this.getAttribute(a)&&this.setAttribute(a,""):this.hasAttribute(a)&&this.removeAttribute(a);break;case N.func:case"function":break;case"json":if(o){var l=JSON.stringify(o);if(l&&this.getAttribute(a)!==l){this.setAttribute(a,l);break}}this.hasAttribute(a)&&this.removeAttribute(a);break;case N.number:case"number":if("number"!=typeof o||isNaN(o))this.hasAttribute(a)&&this.removeAttribute(a);else{var p=String(o);this.getAttribute(a)!==p&&this.setAttribute(a,p)}break;case N.string:case"string":o?this.getAttribute(a)!==o&&this.setAttribute(a,o):this.hasAttribute(a)&&this.removeAttribute(a);break;case N.any:case N.array:case N.arrayOf:case N.element:case N.elementType:case N.instanceOf:case N.node:case N.object:case"object":case N.objectOf:case N.shape:case N.exact:case N.symbol:default:if(o){var u=(0,E.represent)(o);if(u&&this.getAttribute(a)!==u){this.setAttribute(a,u);break}}this.hasAttribute(a)&&this.removeAttribute(a)}}}this.ignoreAttributeUpdateObservations=!1},r.reflectProperties=function(e){var t,r;if(this.reflectExternalProperties(e),null!=(t=this.instance)&&null!=(t=t.current)&&t.state&&"object"==typeof this.instance.current.state)for(var n,i=j(Object.keys(this.instance.current.state).concat(this.instance.current.state.modelState?Object.keys(this.instance.current.state.modelState):[]));!(n=i()).done;){var s=n.value;Object.prototype.hasOwnProperty.call(this.internalProperties,s)&&this.setInternalPropertyValue(s,void 0)}null!=(r=this.internalProperties.model)&&r.state&&(delete this.internalProperties.model.state,this.setInternalPropertyValue("model",this.internalProperties.model));for(var o,a=j(this.self.controllableProperties);!(o=a()).done;){var l=o.value;Object.prototype.hasOwnProperty.call(e,l)&&this.setInternalPropertyValue(l,e[l])}},r.reflectEventToProperties=function(){var e=v()(C().mark((function e(t,r){var n,i,s,o,a,l,p,u,c,d,h,f,b,y,m,v,g;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.batchUpdates,this.batchUpdates=!1,i=null,s=!1,!(this.self.eventToPropertyMapping&&Object.prototype.hasOwnProperty.call(this.self.eventToPropertyMapping,t)&&(0,E.isFunction)(this.self.eventToPropertyMapping[t]))){e.next=4;break}if(!((a=(o=this.self.eventToPropertyMapping)[t].apply(o,r.concat([this])))&&"then"in a&&(0,E.isFunction)(a.then))){e.next=2;break}return e.next=1,a;case 1:g=e.sent,e.next=3;break;case 2:g=a;case 3:l=g,s=!0,Array.isArray(l)?(i=l[0],this.reflectProperties(i),(0,E.extend)(!0,this.internalProperties,l[1])):null===l?s=!1:"object"==typeof l&&(i=l,this.reflectProperties(l));case 4:if(!s&&r.length>0&&(0,E.isObject)(r[0])){if(u=r[0],"persist"in r[0]&&(0,E.isFunction)(r[0].persist))for(u={},c=0,d=Object.keys(this.self.propertyTypes);c<d.length;c++)for(h=d[c],f=j([h].concat(null!==(y=this.getPropertyAlias(h))&&void 0!==y?y:[]));!(b=f()).done;)m=b.value,(v=r[0].currentTarget&&Object.prototype.hasOwnProperty.call(r[0].currentTarget,m)?r[0].currentTarget[m]:this.getPropertyValue(m))!==this.externalProperties[m]&&(u[m]=v);else[null,void 0].includes(null==(p=u.detail)?void 0:p.value)||(u=w()({},u.detail));i=u,this.reflectProperties(u)}return this.triggerRender("propertyReflected"),this.batchUpdates=n,e.abrupt("return",i);case 5:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}(),r.evaluateStringOrNullAndSetAsProperty=function(e,t){var r=this,n=e.startsWith("-"),i=n?e.substring(1):e,s=(0,E.delimitedToCamelCase)(i),o=this.getPropertyAlias(s);if(o&&Object.prototype.hasOwnProperty.call(this.self.propertyTypes,o)&&(s=o),Object.prototype.hasOwnProperty.call(this.self.propertyTypes,s)){var a=this.self.propertyTypes[s];if(n){if(t){var l=(0,E.evaluate)(t,w()({},E.UTILITY_SCOPE),!1,!0,this);l.error?(D.warn("Failed to process pre-evaluation attribute",'"'+e+'": '+l.error+". Will be",'set to "undefined".'),this.setInternalPropertyValue(s,void 0)):(this.setInternalPropertyValue(s,l.result),this.setExternalPropertyValue(s,l.result))}}else switch(a){case N.boolean:case"boolean":var p=![null,"false"].includes(t);this.setInternalPropertyValue(s,p),this.setExternalPropertyValue(s,p);break;case N.func:case"function":var u,c=null,d=["data","event","firstArgument","firstParameter","options"];if(t){var h=(0,E.compile)(t,d.concat("parameters","scope",E.UTILITY_SCOPE_NAMES),!0,!0,this);c=h.error,u=h.templateFunction,c&&D.warn("Failed to compile given handler",'"'+e+'": '+c+".")}this.setInternalPropertyValue(s,(function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];r.outputEventNames.has(s)&&r.reflectEventToProperties(s,i);var a=void 0;if(!c){for(var l=w()({parameters:i},E.UTILITY_SCOPE),p=0,h=d;p<h.length;p++){var f=h[p];l[f]=i[0]}try{a=null==u?void 0:u.apply(void 0,d.map((function(e){return l[e]})).concat([i,l],E.UTILITY_SCOPE_NAMES.map((function(e){return E.UTILITY_SCOPE[e]}))))}catch(r){D.warn("Failed to evaluate function",'"'+e+'" with expression','"'+t+'" and scope',"variables",'"'+d.join('", "')+'" set to','"'+(0,E.represent)(i)+'":',r+". Set property",'to "undefined".')}}return r.self.renderProperties.includes(s)||r.forwardEvent(s,i),a})),c||this.setExternalPropertyValue(s,u);break;case"json":if(t){var f;try{f=JSON.parse(t)}catch(c){D.warn("Error occurred during parsing given json",'attribute "'+e+'":',(0,E.represent)(c));break}this.setInternalPropertyValue(s,f),this.setExternalPropertyValue(s,(0,E.copy)(f,!1,1))}else this.setInternalPropertyValue(s,null),this.setExternalPropertyValue(s,null);break;case N.number:case"number":if(null===t){this.setInternalPropertyValue(s,t),this.setExternalPropertyValue(s,t);break}var b=parseFloat(t);isNaN(b)&&(b=void 0),this.setInternalPropertyValue(s,b),this.setExternalPropertyValue(s,b);break;case N.string:case"string":this.setInternalPropertyValue(s,t),this.setExternalPropertyValue(s,t);break;case N.any:case N.array:case N.arrayOf:case N.element:case N.elementType:case N.instanceOf:case N.node:case N.object:case"object":case N.objectOf:case N.oneOf:case N.oneOfType:case N.shape:case N.exact:case N.symbol:default:if(t){var y=(0,E.evaluate)(t,{},!1,!0,this);if(y.error){D.warn("Error occurred during processing given",'attribute configuration "'+e+'":',y.error);break}this.setInternalPropertyValue(s,y.result),this.setExternalPropertyValue(s,(0,E.copy)(y.result,!1,1))}else this.hasAttribute(e)?(this.setInternalPropertyValue(s,!0),this.setExternalPropertyValue(s,!0)):(this.setInternalPropertyValue(s,null),this.setExternalPropertyValue(s,null))}}},r.waitForNestedComponentRendering=function(){var e=v()(C().mark((function e(){return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.childComponentInstances){e.next=1;break}return e.abrupt("return");case 1:return e.next=2,Promise.all(this.childComponentInstances.map((function(e){return e.renderState.pending?e.renderState.promise:Promise.resolve()})));case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),r.resolveRenderingPromiseIfSet=function(){var e=v()(C().mark((function e(t,r){return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r){e.next=2;break}return e.next=1,this.waitForNestedComponentRendering();case 1:this.renderState.pending=!1,this.renderState.resolve(t),this.prepareNewRenderingPromise();case 2:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}(),r.prepareNewRenderingPromise=function(){var e=this;this.renderState.pending||(this.renderState.promise=new Promise((function(t){e.renderState.resolve=function(r){e.renderState.pending=!1,t(r)}})))},r.triggerRender=function(e){var t=this;this.batchUpdates?this.batchedUpdateRunning||(this.batchedUpdateRunning=!0,(0,E.timeout)((function(){t.batchedUpdateRunning=!1,t.render(e)}))):this.render(e)},r.applyShadowRootIfNotExisting=function(){this.self.shadowDOM&&this.hostDomNode===this&&(this.hostDomNode=(!("attachShadow"in this)&&"ShadyDOM"in window?window.ShadyDOM.wrap(this):this).attachShadow((0,E.isObject)(this.self.shadowDOM)?this.self.shadowDOM:{mode:"open"}))},r.determineRenderScope=function(e){var t,r;void 0===e&&(e={}),this.scope=w()({},(null==(t=this.parentInstance)?void 0:t.scope)||{},this.scope,this.internalProperties,((r={parentInstance:this.parentInstance,rootInstance:this.rootInstance,self:this})[(0,E.lowerCase)(this.self._name)||"instance"]=this,r),e),this.scope.scope=this.scope},r.render=function(){var e=v()(C().mark((function e(t,r){var n,i,s=this;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===t&&(t="unknown"),void 0===r&&(r=!0),this.unRender("reRender",t),this.childComponentInstances=[],this.renderState.pending=!0,!this.isRoot){e.next=3;break}return e.next=1,this.resolveRenderingPromiseIfSet(t,r);case 1:if(!r){e.next=3;break}return e.next=2,Promise.all(this.self.pendingRenderPromises);case 2:this.self.pendingRenderPromises=[];case 3:if(this.self.pendingRenderPromises.push(this.renderState.promise),this.determineRenderScope(),this.self.doRender&&this.dispatchEvent(new CustomEvent("render",{detail:{reason:t,scope:this.scope}}))){e.next=5;break}return e.next=4,this.resolveRenderingPromiseIfSet(t,r);case 4:return e.abrupt("return");case 5:if(!(n=(0,E.evaluate)("`"+this.self.content+"`",this.scope)).error){e.next=7;break}return D.warn("Failed to process template: "+n.error),this.renderState.resolve(t),e.next=6,Promise.all(this.self.pendingRenderPromises);case 6:return e.abrupt("return");case 7:return this.applyShadowRootIfNotExisting(),(i=document.createElement("div")).innerHTML=n.result,this.applySlots(i,w()({},this.scope,{parentInstance:this})),this.hostDomNode.innerHTML=i.innerHTML,e.next=8,(0,E.timeout)();case 8:return this.waitForNestedComponentRendering().then((function(){s.applyBindings(s.hostDomNode.firstChild,s.scope,s.self.renderSlots)})),e.next=9,this.resolveRenderingPromiseIfSet(t,r);case 9:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}(),r.unRender=function(e,t){void 0===e&&(e="unknown"),this.unregisterDomNodeEventBindings()},t}(k),y.applyRootBinding=!0,y.pendingRenderPromises=[],y.content="<slot>Please provide a template to transclude.</slot>",y.determineRootBinding=!0,y.shadowDOM=null,y.observedAttributes=[],y.controllableProperties=[],y.eventToPropertyMapping={},y.propertyAliases={},y.propertyTypes={onClick:N.func},y.propertiesToReflectAsAttributes=[],y.renderProperties=["children"],y.doRender=!1,y.cloneSlots=!1,y.evaluateSlots=!1,y.renderSlots=!0,y.trimSlots=!0,y.renderUnsafe=!1,y._name="BaseWeb",y._propertyAliasIndex=void 0,y._propertiesToReflectAsAttributes=void 0,f=y,b=x()(f.prototype,"isRoot",[h],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),f),M={component:V,register:function(e){void 0===e&&(e=(0,E.camelCaseToDelimited)(V._name)),customElements.define(e,V)}};return d.default=V,d}()}));
1
+ if(typeof window==='undefined'||window===null)var window=(typeof global==='undefined'||global===null)?{}:global;import * as __WEBPACK_EXTERNAL_MODULE_clientnode__ from "clientnode";
2
+ import * as __WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2__ from "clientnode/property-types";
3
+ /******/ var __webpack_modules__ = ([
4
+ /* 0 */
5
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
6
+
7
+ var x = function(y) {
8
+ var x = {}; __webpack_require__.d(x, y); return x
9
+ }
10
+ var y = function(x) { return function() { return x; }; }
11
+ module.exports = x({ ["Logger"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode__.Logger; }, ["NOOP"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode__.NOOP; }, ["UTILITY_SCOPE"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode__.UTILITY_SCOPE; }, ["UTILITY_SCOPE_NAMES"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode__.UTILITY_SCOPE_NAMES; }, ["camelCaseToDelimited"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode__.camelCaseToDelimited; }, ["compile"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode__.compile; }, ["convertPlainObjectToMap"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode__.convertPlainObjectToMap; }, ["copy"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode__.copy; }, ["delimitedToCamelCase"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode__.delimitedToCamelCase; }, ["evaluate"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode__.evaluate; }, ["extend"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode__.extend; }, ["isFunction"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode__.isFunction; }, ["isObject"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode__.isObject; }, ["lowerCase"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode__.lowerCase; }, ["replace"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode__.replace; }, ["represent"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode__.represent; }, ["timeout"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode__.timeout; }, ["unique"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode__.unique; }, ["unwrap"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode__.unwrap; } });
12
+
13
+ /***/ }),
14
+ /* 1 */
15
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
16
+
17
+ var x = function(y) {
18
+ var x = {}; __webpack_require__.d(x, y); return x
19
+ }
20
+ var y = function(x) { return function() { return x; }; }
21
+ module.exports = x({ ["any"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2__.any; }, ["array"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2__.array; }, ["arrayOf"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2__.arrayOf; }, ["boolean"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2__.boolean; }, ["element"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2__.element; }, ["elementType"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2__.elementType; }, ["exact"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2__.exact; }, ["func"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2__.func; }, ["instanceOf"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2__.instanceOf; }, ["node"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2__.node; }, ["number"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2__.number; }, ["object"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2__.object; }, ["objectOf"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2__.objectOf; }, ["oneOf"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2__.oneOf; }, ["oneOfType"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2__.oneOfType; }, ["shape"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2__.shape; }, ["string"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2__.string; }, ["symbol"]: function() { return __WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2__.symbol; } });
22
+
23
+ /***/ }),
24
+ /* 2 */
25
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
26
+
27
+ /* unused harmony export property */
28
+ /* harmony import */ var clientnode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
29
+ /* harmony import */ var clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
30
+ // #!/usr/bin/env babel-node
31
+ // -*- coding: utf-8 -*-
32
+ /** @module decorator *//* !
33
+ region header
34
+ [Project page](https://torben.website/web-component-wrapper)
35
+
36
+ Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
37
+
38
+ License
39
+ -------
40
+
41
+ This library written by Torben Sickert stands under a creative commons
42
+ naming 3.0 unported license.
43
+ See https://creativecommons.org/licenses/by/3.0/deed.de
44
+ endregion
45
+ */// region imports
46
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread()}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 _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}// endregion
47
+ /**
48
+ * Generates a decorator based on given configuration.
49
+ * @param options - Property configuration to define how to transfer attributes
50
+ * and properties into each other.
51
+ * @param options.alias - Alternate property name.
52
+ * @param options.readAttribute - Indicates whether to read from existing
53
+ * attribute also.
54
+ * @param options.type - Value type to parse value.
55
+ * @param options.update - Indicates whether to overwrite already existing
56
+ * property configurations.
57
+ * @param options.writeAttribute - Indicates whether to sync attribute
58
+ * representation back into dom.
59
+ * @returns Generated decorator.
60
+ */function property(options){if(options===void 0){options={}}options=_objectSpread({readAttribute:true,type:clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.string},options);/**
61
+ * Registers given property to different property / attribute conversion
62
+ * data structures.
63
+ * NOTE: It is important to set static configuration properties on its
64
+ * "own" properties instead of some inherited one. So we have to check via
65
+ * "hasOwnProperty" for existence in this decorator.
66
+ * @param target - Instance to apply given property to.
67
+ * @param name - Field name to apply.
68
+ */return function(target,name){if(typeof name!=="string")return;var self=target.self||target.constructor;if(options.readAttribute){if(!Object.prototype.hasOwnProperty.call(self,"observedAttributes"))self.observedAttributes=self.observedAttributes?_toConsumableArray(self.observedAttributes):[];var attributeName=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.camelCaseToDelimited)(name);if(self.observedAttributes&&!self.observedAttributes.includes(attributeName))self.observedAttributes.push(attributeName)}if(options.type){if(!Object.prototype.hasOwnProperty.call(self,"propertyTypes"))self.propertyTypes=self.propertyTypes?_objectSpread({},self.propertyTypes):{};if(self.propertyTypes&&(options.update||!Object.prototype.hasOwnProperty.call(self,name)))self.propertyTypes[name]=options.type}if(options.writeAttribute){if(!Object.prototype.hasOwnProperty.call(self,"propertiesToReflectAsAttributes"))self.propertiesToReflectAsAttributes=self.propertiesToReflectAsAttributes?(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.copy)(self.propertiesToReflectAsAttributes):[];if(options.update||self.propertiesToReflectAsAttributes instanceof Map&&!self.propertiesToReflectAsAttributes.has(name)||Array.isArray(self.propertiesToReflectAsAttributes)&&!self.propertiesToReflectAsAttributes.includes(name)||_typeof(self.propertiesToReflectAsAttributes)==="object"&&!Object.prototype.hasOwnProperty.call(self.propertiesToReflectAsAttributes,name)){var result;if(typeof options.writeAttribute==="boolean"){if(options.writeAttribute&&self.propertyTypes&&Object.prototype.hasOwnProperty.call(self.propertyTypes,name))result=self.propertyTypes[name]}else result=options.writeAttribute;if(result!==undefined){if(Array.isArray(self.propertiesToReflectAsAttributes))if(options.writeAttribute===true)self.propertiesToReflectAsAttributes.push(name);else if(self.normalizePropertyTypeList)self.propertiesToReflectAsAttributes=self.normalizePropertyTypeList(self.propertiesToReflectAsAttributes);if(self.propertiesToReflectAsAttributes instanceof Map)self.propertiesToReflectAsAttributes.set(name,result);if(_typeof(self.propertiesToReflectAsAttributes)==="object")self.propertiesToReflectAsAttributes[name]=result}}}if(options.alias){if(!Object.prototype.hasOwnProperty.call(self,"propertyAliases"))self.propertyAliases=self.propertyAliases?_objectSpread({},self.propertyAliases):{};if(self.propertyAliases&&(options.update||!Object.prototype.hasOwnProperty.call(self,name)))self.propertyAliases[name]=options.alias}}}/* harmony default export */ __webpack_exports__.A = (property);
69
+
70
+ /***/ })
71
+ /******/ ]);
72
+ /************************************************************************/
73
+ /******/ // The module cache
74
+ /******/ var __webpack_module_cache__ = {};
75
+ /******/
76
+ /******/ // The require function
77
+ /******/ function __webpack_require__(moduleId) {
78
+ /******/ // Check if module is in cache
79
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
80
+ /******/ if (cachedModule !== undefined) {
81
+ /******/ return cachedModule.exports;
82
+ /******/ }
83
+ /******/ // Create a new module (and put it into the cache)
84
+ /******/ var module = __webpack_module_cache__[moduleId] = {
85
+ /******/ // no module.id needed
86
+ /******/ // no module.loaded needed
87
+ /******/ exports: {}
88
+ /******/ };
89
+ /******/
90
+ /******/ // Execute the module function
91
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
92
+ /******/
93
+ /******/ // Return the exports of the module
94
+ /******/ return module.exports;
95
+ /******/ }
96
+ /******/
97
+ /************************************************************************/
98
+ /******/ /* webpack/runtime/define property getters */
99
+ /******/ !function() {
100
+ /******/ // define getter/value functions for harmony exports
101
+ /******/ __webpack_require__.d = function(exports, definition) {
102
+ /******/ if(Array.isArray(definition)) {
103
+ /******/ var i = 0;
104
+ /******/ while(i < definition.length) {
105
+ /******/ var key = definition[i++];
106
+ /******/ var binding = definition[i++];
107
+ /******/ if(!__webpack_require__.o(exports, key)) {
108
+ /******/ if(binding === 0) {
109
+ /******/ Object.defineProperty(exports, key, { enumerable: true, value: definition[i++] });
110
+ /******/ } else {
111
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: binding });
112
+ /******/ }
113
+ /******/ } else if(binding === 0) { i++; }
114
+ /******/ }
115
+ /******/ } else {
116
+ /******/ for(var key in definition) {
117
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
118
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
119
+ /******/ }
120
+ /******/ }
121
+ /******/ }
122
+ /******/ };
123
+ /******/ }();
124
+ /******/
125
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
126
+ /******/ !function() {
127
+ /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
128
+ /******/ }();
129
+ /******/
130
+ /************************************************************************/
131
+ var __webpack_exports__ = {};
132
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
133
+ /* harmony export */ FH: function() { return /* binding */ api; },
134
+ /* harmony export */ Hh: function() { return /* binding */ GenericHTMLElement; },
135
+ /* harmony export */ Nc: function() { return /* binding */ Web; },
136
+ /* harmony export */ Rm: function() { return /* binding */ log; }
137
+ /* harmony export */ });
138
+ /* harmony import */ var clientnode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
139
+ /* harmony import */ var clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
140
+ /* harmony import */ var _decorator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2);
141
+ // #!/usr/bin/env babel-node
142
+ // -*- coding: utf-8 -*-
143
+ /** @module web *//* !
144
+ region header
145
+ [Project page](https://torben.website/web-component-wrapper)
146
+
147
+ Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
148
+
149
+ License
150
+ -------
151
+
152
+ This library written by Torben Sickert stands under a creative commons
153
+ naming 3.0 unported license.
154
+ See https://creativecommons.org/licenses/by/3.0/deed.de
155
+ endregion
156
+ */// region imports
157
+ var _dec,_class,_descriptor,_Web;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}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 _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof Generator?n:Generator,u=Object.create(c.prototype);return _regeneratorDefine2(u,"_invoke",function(r,n,o){var i,c,u,f=0,p=o||[],y=!1,G={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function d(t,r){return i=t,c=0,u=e,G.n=r,a}};function d(r,n){for(c=r,u=n,t=0;!y&&f&&!o&&t<p.length;t++){var o,i=p[t],d=G.p,l=i[2];r>3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,G.v=n,G.n=i[1]):d<l&&(o=r<3||i[0]>n||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0))}if(o||r>1)return a;throw y=!0,n}return function(o,p,l){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break}catch(t){i=e,c=1,u=t}finally{f=1}}return{value:t,done:y}}}(r,o,i),!0),u}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine2(t={},n,function(){return this}),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,_regeneratorDefine2(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine2(u,"constructor",GeneratorFunctionPrototype),_regeneratorDefine2(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine2(GeneratorFunctionPrototype,o,"GeneratorFunction"),_regeneratorDefine2(u),_regeneratorDefine2(u,o,"Generator"),_regeneratorDefine2(u,n,function(){return this}),_regeneratorDefine2(u,"toString",function(){return"[object Generator]"}),(_regenerator=function _regenerator(){return{w:i,m:f}})()}function _regeneratorDefine2(e,r,n,t){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine2=function _regeneratorDefine(e,r,n,t){function o(r,n){_regeneratorDefine2(e,r,function(e){return this._invoke(r,n,e)})}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2))},_regeneratorDefine2(e,r,n,t)}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){return void e(n)}i.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n)}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n)}_next(void 0)})}}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread()}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 _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t.return||t.return()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _initializerDefineProperty(e,i,r,l){r&&Object.defineProperty(e,i,{enumerable:r.enumerable,configurable:r.configurable,writable:r.writable,value:r.initializer?r.initializer.call(l):void 0})}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _applyDecoratedDescriptor(i,e,r,n,l){var a={};return Object.keys(n).forEach(function(i){a[i]=n[i]}),a.enumerable=!!a.enumerable,a.configurable=!!a.configurable,("value"in a||a.initializer)&&(a.writable=!0),a=r.slice().reverse().reduce(function(r,n){return n(i,e,r)||r},a),l&&void 0!==a.initializer&&(a.value=a.initializer?a.initializer.call(l):void 0,a.initializer=void 0),void 0===a.initializer?(Object.defineProperty(i,e,a),null):a}function _initializerWarningHelper(r,e){throw Error("Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}// endregion
158
+ var log=new clientnode__WEBPACK_IMPORTED_MODULE_0__.Logger({name:"web-component-wrapper.web"});/*
159
+ NOTE: We mock HTMLElement to be able to load this class and derived one
160
+ into node environments.
161
+ */var GenericHTMLElement=typeof HTMLElement==="undefined"?/*#__PURE__*/// eslint-disable-next-line @typescript-eslint/no-extraneous-class
162
+ _createClass(function HTMLElement(){_classCallCheck(this,HTMLElement)}):HTMLElement;/**
163
+ * Generic web component to render a content against instance-specific values.
164
+ * @property applyRootBinding - If determined itself as root declarative event
165
+ * and property bindings will be applied to itself.
166
+ * @property content - Content to render when changes happened.
167
+ * @property determineRootBinding - If checked this component determines if it
168
+ * is a root component (not wrapped by another web-component).
169
+ * @property shadowDOM - Configures if a shadow dom should be used during
170
+ * web-component instantiation. Can hold initialize configuration.
171
+ * @property observedAttributes - Attribute names to observe for changes.
172
+ * @property controllableProperties - A list of controllable property names.
173
+ * @property eventToPropertyMapping - Explicitly defined output events (a
174
+ * mapping of event names to a potential parameter to properties-transformer).
175
+ * @property propertyAliases - A mapping of property names to be treated as
176
+ * equal.
177
+ * @property propertyTypes - Configuration defining how to convert attributes
178
+ * into properties and reflect property changes back to attributes.
179
+ * @property propertiesToReflectAsAttributes - An Item, List, or Mapping of
180
+ * properties to reflect as attributes.
181
+ * @property renderProperties - List of known render properties.
182
+ * @property cloneSlots - Indicates whether to clone slot before to transclude
183
+ * content into them. If a slot should be used multiple times (for example,
184
+ * when it works as a template node.) they should be copied to avoid unexpected
185
+ * mutations.
186
+ * @property doRender - Configures whether this component instance should
187
+ * evaluate its given body content.
188
+ * @property evaluateSlots - Indicates whether to evaluate slot content when
189
+ * before rendering them.
190
+ * @property renderSlots - Indicates whether determined slots should be
191
+ * rendered into root node.
192
+ * @property trimSlots - Ignore empty text nodes while applying slots.
193
+ * @property renderUnsafe - Defines default render behavior.
194
+ * @property _name - Name to access instance-evaluated content or used
195
+ * to derive default component name. This is also useful for logging.
196
+ * @property _propertyAliasIndex - Internal alias index to quickly match
197
+ * properties in both directions.
198
+ * @property _propertiesToReflectAsAttributes - A mapping of property names to
199
+ * set as attributes when they are set/updated. Uses a map to hold order and
200
+ * determine if a property exists in constant runtime.
201
+ * @property renderState - Holds data about currently running render state.
202
+ * @property renderState.promise - Promise resolving when next rendering has
203
+ * been finished.
204
+ * @property renderState.pending - Indicates whether a rendering task is
205
+ * performing.
206
+ * @property renderState.resolve - Callback to trigger when rendering has been
207
+ * finished.
208
+ * @property childComponentInstances - List of direct child components (needed
209
+ * to wait for them to finish dom manipulation).
210
+ * @property batchAttributeUpdates - Indicates whether to directly update dom
211
+ * after each attribute mutation or to wait and batch mutations after current
212
+ * queue has been finished.
213
+ * @property batchPropertyUpdates - Indicates whether to directly update dom
214
+ * after each property mutation or to wait and batch mutations after current
215
+ * queue has been finished.
216
+ * @property batchUpdates - Indicates whether to directly perform a
217
+ * re-rendering after changes on properties have been made.
218
+ * @property batchedAttributeUpdateRunning - A boolean indicator to identify if
219
+ * an attribute update is currently batched.
220
+ * @property batchedPropertyUpdateRunning - A boolean indicator to identify if
221
+ * a property update is currently batched.
222
+ * @property batchedUpdateRunning - Indicates whether a batched render update
223
+ * is currently running.
224
+ * @param connectionRegistered - Indicates whether this component is connected
225
+ * to DOM and could run its connectedCallback.
226
+ * @param pendingAttributeUpdates - Holds pending attribute updates which
227
+ * should be performed when the component is connected to DOM.
228
+ * @property parentInstance - Parent component instance.
229
+ * @property rootInstance - Root component instance.
230
+ * @property scope - Render scope.
231
+ * @property domNodeEventBindings - Holds a mapping from nodes with registered
232
+ * event handlers mapped to their deregistration function.
233
+ * @property domNodeTemplateCache - Caches template compilation results.
234
+ * @property externalProperties - Holds currently evaluated or seen properties.
235
+ * @property ignoreAttributeUpdateObservations - Indicates whether attribute
236
+ * updates should be considered (usually only needed internally).
237
+ * @property internalProperties - Holds currently evaluated properties which
238
+ * are owned by this instance and should always be delegated.
239
+ * @property outputEventNames - Set of determined output event names.
240
+ * @property instance - Wrapped component instance.
241
+ * @property isRoot - Indicates whether their exists another web-derived
242
+ * component up the tree or not.
243
+ * @property root - Hosting dom node.
244
+ * @property runDomConnectionAndRenderingInSameEventQueue - Indicates whether
245
+ * we should render initial dom immediately after the component is connected to
246
+ * dom. Deactivating this allows wrapped components to detect their parents
247
+ * since their parent-connected callback will be called before the children's
248
+ * render method.
249
+ * @property self - Back-reference to this class.
250
+ * @property slots - Grabbed slots that where present in the connecting phase.
251
+ */var Web=(_dec=(0,_decorator_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)({type:clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.boolean,writeAttribute:true}),_class=(_Web=/*#__PURE__*/function(_GenericHTMLElement){// endregion
252
+ // region live cycle hooks
253
+ /**
254
+ * Initializes host dom content and properties.
255
+ * @returns Nothing.
256
+ */function Web(){var _this;_classCallCheck(this,Web);_this=_callSuper(this,Web);_defineProperty(_this,"renderState",{promise:Promise.resolve(""),pending:false,resolve:clientnode__WEBPACK_IMPORTED_MODULE_0__.NOOP});// Constructor might be executed when accessed via child components.
257
+ _defineProperty(_this,"childComponentInstances",[]);_defineProperty(_this,"batchAttributeUpdates",true);_defineProperty(_this,"batchPropertyUpdates",true);_defineProperty(_this,"batchUpdates",true);/*
258
+ NOTE: We set these properties to true initially since we want to
259
+ prevent any updates until the component is connected to dom.
260
+ */_defineProperty(_this,"batchedAttributeUpdateRunning",true);_defineProperty(_this,"batchedPropertyUpdateRunning",true);_defineProperty(_this,"batchedUpdateRunning",true);_defineProperty(_this,"connectionRegistered",false);_defineProperty(_this,"pendingAttributeUpdates",[]);_defineProperty(_this,"parentInstance",null);_defineProperty(_this,"rootInstance",void 0);_defineProperty(_this,"hostDomNode",void 0);_defineProperty(_this,"scope",_objectSpread({},clientnode__WEBPACK_IMPORTED_MODULE_0__.UTILITY_SCOPE));_defineProperty(_this,"domNodeEventBindings",new Map);_defineProperty(_this,"domNodeTemplateCache",new Map);_defineProperty(_this,"externalProperties",{});_defineProperty(_this,"ignoreAttributeUpdateObservations",false);_defineProperty(_this,"internalProperties",{});_defineProperty(_this,"outputEventNames",new Set);_defineProperty(_this,"instance",null);_initializerDefineProperty(_this,"isRoot",_descriptor,_this);_defineProperty(_this,"runDomConnectionAndRenderingInSameEventQueue",false);_defineProperty(_this,"self",Web);_defineProperty(_this,"slots",{});_this.prepareNewRenderingPromise();/*
261
+ NOTE: We cannot use something like "this." e.g. "this.self" to
262
+ determine class properties since instance properties like "self"
263
+ may not set properly yet because this method is called during
264
+ constructing this instance itself.
265
+ */_this.self=_this.constructor;if(!_this.self._propertiesToReflectAsAttributes)_this.self._propertiesToReflectAsAttributes=_this.self.normalizePropertyTypeList(_this.self.propertiesToReflectAsAttributes);_this.generateAliasIndex();// NOTE: Shadow root will be applied when rendering the first time.
266
+ _this.hostDomNode=_this;_this.rootInstance=_this;/*
267
+ NOTE: We define getter and setter at the end to avoid shadowing
268
+ existing property names.
269
+ */_this.defineGetterAndSetterInterface();return _this}/**
270
+ * Triggered when ever a given attribute has changed and triggers to update
271
+ * configured dom content.
272
+ * @param name - Attribute name which was updates.
273
+ * @param oldValue - Old attribute value.
274
+ * @param newValue - New updated value.
275
+ */_inherits(Web,_GenericHTMLElement);return _createClass(Web,[{key:"attributeChangedCallback",value:function attributeChangedCallback(name,oldValue,newValue){if(this.ignoreAttributeUpdateObservations||oldValue===newValue)return;void this.onUpdateAttribute(name,newValue)}/**
276
+ * Updates given attribute representation.
277
+ * @param name - Attribute name which was updates.
278
+ * @param newValue - New updated value.
279
+ * @returns Promise resolving when attribute has been updated.
280
+ */},{key:"onUpdateAttribute",value:function onUpdateAttribute(name,newValue){var _this2=this;var promise=new Promise(function(resolve){return _this2.pendingAttributeUpdates.push(function(){_this2.evaluateStringOrNullAndSetAsProperty(name,newValue);if(_this2.batchAttributeUpdates){if(!(_this2.batchedAttributeUpdateRunning||_this2.batchedUpdateRunning)){_this2.batchedAttributeUpdateRunning=true;_this2.batchedUpdateRunning=true;void (0,clientnode__WEBPACK_IMPORTED_MODULE_0__.timeout)(function(){_this2.batchedAttributeUpdateRunning=false;_this2.batchedUpdateRunning=false;void _this2.render("attributeChanged")})}}else void _this2.render("attributeChanged");resolve()})});if(this.connectionRegistered)while(this.pendingAttributeUpdates.length)this.pendingAttributeUpdates.shift()();return promise}/**
281
+ * Triggered when this component is mounted into the document.
282
+ * Attaches event handler, grabs given slots, reflects external properties,
283
+ * and enqueues first rendering.
284
+ */},{key:"connectedCallback",value:function connectedCallback(){var _this3=this;// NOTE: Hack to support IE 11 here.
285
+ try{this.isConnected=true}catch(_unused){// Ignore error.
286
+ }this.connectionRegistered=true;// NOTE: Can be overwritten during optional root determining.
287
+ this.parentInstance=this;this.rootInstance=this;this.attachEventHandler();if(this.self.determineRootBinding){this.determineRootBinding();if(this.parentInstance!==this&&this.parentInstance.childComponentInstances)this.parentInstance.childComponentInstances.push(this)}if(this.self.applyRootBinding&&this.isRoot){this.determineRenderScope();this.applyBinding(this,this.scope)}while(this.pendingAttributeUpdates.length)this.pendingAttributeUpdates.shift()();this.batchedAttributeUpdateRunning=false;this.batchedPropertyUpdateRunning=false;this.batchedUpdateRunning=false;this.grabGivenSlots();this.reflectExternalProperties(this.externalProperties);if(this.runDomConnectionAndRenderingInSameEventQueue)void this.render("connected");else void (0,clientnode__WEBPACK_IMPORTED_MODULE_0__.timeout)(function(){void _this3.render("connected")})}/**
288
+ * Triggered when this component is unmounted from the document. Event
289
+ * handlers will be removed and state updated accordingly.
290
+ */},{key:"disconnectedCallback",value:function disconnectedCallback(){this.unRender("disconnected");this.unregisterConnectionState()}// endregion
291
+ // region getter/setter
292
+ /**
293
+ * Registers needed getter and setter to get notified about changes and
294
+ * reflect them.
295
+ */},{key:"defineGetterAndSetterInterface",value:function defineGetterAndSetterInterface(){var _this4=this;var allPropertyNames=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.unique)(Object.keys(this.self.propertyTypes).concat(this.self._propertyAliasIndex?Object.keys(this.self._propertyAliasIndex):[]));var _iterator=_createForOfIteratorHelper(allPropertyNames),_step;try{var _loop=function _loop(){var propertyName=_step.value;// If there already exists a local value, use them.
296
+ if(Object.prototype.hasOwnProperty.call(_this4,propertyName))_this4.setPropertyValue(/* eslint-disable @typescript-eslint/unbound-method */propertyName,_this4[propertyName]/* eslint-enable @typescript-eslint/unbound-method */);Object.defineProperty(_this4,propertyName,{configurable:true,get:function get(){return _this4.getPropertyValue(propertyName)},set:function set(value){_this4.setPropertyValue(propertyName,value);_this4.triggerPropertySpecificRendering(propertyName,value)}})};for(_iterator.s();!(_step=_iterator.n()).done;){_loop()}}catch(err){_iterator.e(err)}finally{_iterator.f()}}/**
297
+ * Creates an index to match alias source and target against each other on
298
+ * constant runtime.
299
+ * @param name - Name to search an alternate name for.
300
+ * @returns Found alias or "null".
301
+ */},{key:"getPropertyAlias",value:function getPropertyAlias(name){if(this.self._propertyAliasIndex&&Object.prototype.hasOwnProperty.call(this.self._propertyAliasIndex,name))return this.self._propertyAliasIndex[name];return null}/**
302
+ * Generic property getter. Forwards properties from the "properties"
303
+ * field.
304
+ * @param name - Property name to retrieve.
305
+ * @returns Retrieved property value.
306
+ */},{key:"getPropertyValue",value:function getPropertyValue(name){var _this$instance,_name,_this$instance2;var result=(_this$instance=this.instance)!==null&&_this$instance!==void 0&&(_this$instance=_this$instance.current)!==null&&_this$instance!==void 0&&_this$instance.properties&&(// NOTE: Base properties should not be shadowed.
307
+ Object.prototype.hasOwnProperty.call(!Web.propertyTypes,name)||Object.prototype.hasOwnProperty.call(this.instance.current.properties,name))?this.instance.current.properties[name]:(_name=this.internalProperties[name])!==null&&_name!==void 0?_name:this.externalProperties[name];if((_this$instance2=this.instance)!==null&&_this$instance2!==void 0&&(_this$instance2=_this$instance2.current)!==null&&_this$instance2!==void 0&&_this$instance2.state&&Object.prototype.hasOwnProperty.call(this.instance.current.state,name))return this.instance.current.state[name];return result}/**
308
+ * External property setter. Respects configured aliases.
309
+ * @param name - Property name to write.
310
+ * @param value - New value to write.
311
+ */},{key:"setExternalPropertyValue",value:function setExternalPropertyValue(name,value){this.externalProperties[name]=value;var alias=this.getPropertyAlias(name);if(alias)this.externalProperties[alias]=value}/**
312
+ * Internal property setter. Respects configured aliases.
313
+ * @param name - Property name to write.
314
+ * @param value - New value to write.
315
+ */},{key:"setInternalPropertyValue",value:function setInternalPropertyValue(name,value){this.internalProperties[name]=value;var alias=this.getPropertyAlias(name);if(alias)this.internalProperties[alias]=value}/**
316
+ * Generic property setter. Forwards field writes into internal and
317
+ * external property representations.
318
+ * @param name - Property name to write.
319
+ * @param value - New value to write.
320
+ */},{key:"setPropertyValue",value:function setPropertyValue(name,value){this.reflectProperties(_defineProperty({},name,value));this.setInternalPropertyValue(name,value)}/**
321
+ * Triggers a new rendering cycle and respects property-specific state
322
+ * connection.
323
+ * @param name - Property name to write.
324
+ * @param value - New value to write.
325
+ */},{key:"triggerPropertySpecificRendering",value:function triggerPropertySpecificRendering(name,value){var _this5=this;if(this.batchPropertyUpdates){if(!(this.batchedPropertyUpdateRunning||this.batchedUpdateRunning)){this.batchedPropertyUpdateRunning=true;this.batchedUpdateRunning=true;void (0,clientnode__WEBPACK_IMPORTED_MODULE_0__.timeout)(function(){if(value!==undefined&&_this5.isStateProperty(name)){void _this5.render("preStatePropertyChanged");void (0,clientnode__WEBPACK_IMPORTED_MODULE_0__.timeout)(function(){_this5.setInternalPropertyValue(name,undefined);_this5.batchedPropertyUpdateRunning=false;_this5.batchedUpdateRunning=false;void _this5.render("postStatePropertyChanged");_this5.triggerOutputEvents()})}else{_this5.batchedPropertyUpdateRunning=false;_this5.batchedUpdateRunning=false;void _this5.render("propertyChanged");_this5.triggerOutputEvents()}})}}else{var isStateProperty=this.isStateProperty(name);void this.render(isStateProperty?"preStatePropertyChanged":"propertyChanged");if(value!==undefined&&isStateProperty){this.setInternalPropertyValue(name,undefined);void this.render("postStatePropertyChanged")}this.triggerOutputEvents()}}// endregion
326
+ // region helper
327
+ /// region utility
328
+ },{key:"unregisterConnectionState",value:function unregisterConnectionState(){// NOTE: Hack to support IE 11 here.
329
+ try{this.isConnected=false}catch(_unused2){// Ignore error.
330
+ }this.connectionRegistered=false;this.slots={}}},{key:"unregisterDomNodeEventBindings",value:function unregisterDomNodeEventBindings(){var _iterator2=_createForOfIteratorHelper(this.domNodeEventBindings.values()),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var map=_step2.value;var _iterator3=_createForOfIteratorHelper(map.values()),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var deregister=_step3.value;deregister()}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}//// region dom nodes
331
+ /**
332
+ * Binds properties and event handler to the given dom node.
333
+ * @param domNode - Node to start traversing from.
334
+ * @param scope - Scope to render property value again.
335
+ */},{key:"applyBinding",value:function applyBinding(domNode,scope){var _this6=this;if(!domNode.getAttributeNames)return;var _iterator4=_createForOfIteratorHelper(domNode.getAttributeNames()),_step4;try{var _loop2=function _loop2(){var attributeName=_step4.value;var name;if(attributeName.startsWith("data-bind-"))name=attributeName.substring("data-bind-".length);else if(attributeName.startsWith("bind-"))name=attributeName.substring("bind-".length);if(name){var value=domNode.getAttribute(attributeName);if(value===null)return 0;// continue
336
+ if(name.startsWith("attribute-")||name.startsWith("property-")){var evaluated=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.evaluate)(value,scope,false,true,domNode);if(evaluated.error){log.warn("Error occurred during processing given","attribute binding \"".concat(attributeName,"\" on node:"),domNode,evaluated.error);return 0;// continue
337
+ }if(name.startsWith("attribute-"))domNode.setAttribute(name.substring("attribute-".length),evaluated.result);else/*
338
+ NOTE: Cast to "textContent" to have a writable
339
+ property here.
340
+ */domNode[(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.delimitedToCamelCase)(name.substring("property-".length))]=evaluated.result}else if(name.startsWith("on-")){name=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.delimitedToCamelCase)(name.substring("on-".length));scope=_objectSpread({log:log,event:undefined,parameters:undefined},scope);/*
341
+ NOTE: We pre-compile event listener since they should
342
+ usually be called more often than binded.
343
+ */var compilation=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.compile)(value,scope,true,true,domNode);if(compilation.error)log.warn("Error occurred during compiling given event","binding \"".concat(attributeName,"\" on node:"),domNode,compilation.error);else _this6.addSecureEventListener(domNode,name,function(){for(var _len=arguments.length,parameters=new Array(_len),_key=0;_key<_len;_key++){parameters[_key]=arguments[_key]}scope.event=parameters[0];scope.parameters=parameters;try{compilation.templateFunction.apply(compilation,_toConsumableArray(compilation.originalScopeNames.map(function(name){return scope[name]})))}catch(error){log.warn("Error occurred during processing","given event binding","\"".concat(attributeName,"\" on node:"),domNode,"Given expression \"".concat(value,"\" could"),"not be evaluated with given scope","names \""+compilation.scopeNames.join("\", \"")+"\": ".concat((0,clientnode__WEBPACK_IMPORTED_MODULE_0__.represent)(error)))}})}}},_ret;for(_iterator4.s();!(_step4=_iterator4.n()).done;){_ret=_loop2();if(_ret===0)continue}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}}/**
344
+ * Binds properties and event handler to given, sibling, and nested nodes.
345
+ * @param domNode - Node to start traversing from.
346
+ * @param scope - Scope to render property value again.
347
+ * @param renderSlots - Indicates whether to render nested elements of
348
+ * slots (determined by an existing corresponding attribute).
349
+ */},{key:"applyBindings",value:function applyBindings(domNode,scope,renderSlots){if(renderSlots===void 0){renderSlots=true}while(domNode){var _attributes;if((_attributes=domNode.attributes)!==null&&_attributes!==void 0&&_attributes.length&&(renderSlots||!domNode.getAttribute("slot")))this.applyBinding(domNode,scope);/*
350
+ NOTE: Slots of nested custom components (recognized by their
351
+ dash in name) should be rendered by their own.
352
+ */if(!domNode.nodeName.toLowerCase().includes("-"))this.applyBindings(domNode.firstChild,scope);domNode=domNode.nextSibling}}/**
353
+ * Compiles given node content and their children. Provides a corresponding
354
+ * map of compiled template functions connected to their (sub) nodes and
355
+ * expected scope names.
356
+ * @param domNode - Node to compile.
357
+ * @param scope - Scope to extract names from.
358
+ * @param options - Additional compile options.
359
+ * @param options.filter - Callback to exclude some node from being
360
+ * compiled.
361
+ * @param options.ignoreComponents - Indicates if component properties
362
+ * should be traversed or not.
363
+ * @param options.ignoreNestedComponents - Indicates if nested components
364
+ * should be traversed or not.
365
+ * @param options.unsafe - Indicates if full HTML generation should be
366
+ * allowed.
367
+ * @returns Map of compiled templates.
368
+ */},{key:"compileDomNodeTemplate",value:function compileDomNodeTemplate(domNode,scope,options){if(scope===void 0){scope=[]}if(options===void 0){options={}}options=_objectSpread({ignoreComponents:true,ignoreNestedComponents:true,unsafe:this.self.renderUnsafe},options);var nodeName=domNode.nodeName.toLowerCase();/*
369
+ NOTE: Slots of nested custom components (recognized by their dash
370
+ in name) should be rendered / controlled by them on their own.
371
+ */if(options.ignoreComponents&&nodeName.includes("-"))return null;if(options.unsafe){var _template=domNode.innerHTML;if(!_template&&domNode.template)_template=domNode.template;if(this.self.hasCode(_template)){var _result=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.compile)("`".concat(_template,"`"),scope);return{domNode:domNode,children:[],error:_result.error,scopeNames:_result.scopeNames,template:_template,templateFunction:_result.templateFunction}}return null}var template=null;if(nodeName==="#text"){var content=domNode.textContent;if(content&&this.self.hasCode(content))template=content.replace(/&nbsp;/g," ").trim()}var children=[];var result={children:children,domNode:domNode};if(template){var compilationResult=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.compile)("`".concat(template,"`"),scope);result.error=compilationResult.error;result.scopeNames=compilationResult.scopeNames;result.template=template;result.templateFunction=compilationResult.templateFunction}// Compile content of each nested node.
372
+ var currentDomNode=domNode.firstChild;while(currentDomNode){if(!options.filter||options.filter(currentDomNode)){var _result2=this.compileDomNodeTemplate(currentDomNode,scope,_objectSpread(_objectSpread({},options),{},{ignoreComponents:options.ignoreNestedComponents}));if(_result2)children.push(_result2)}currentDomNode=currentDomNode.nextSibling}return result}/**
373
+ * @param options - Evaluation options.
374
+ * @param scope - Scope to evaluate against.
375
+ * @returns Evaluated string result or null.
376
+ */},{key:"evaluateCompiledDomNodeTemplate",value:function evaluateCompiledDomNodeTemplate(options,scope){var domNode=options.domNode,error=options.error,templateFunction=options.templateFunction,scopeNames=options.scopeNames;if(!(templateFunction&&scopeNames))return null;if(error){log.warn("Error occurred during compiling node content:",error);return null}var output=null;try{output=templateFunction.apply(void 0,_toConsumableArray(scopeNames.map(function(name){return scope[name]})))}catch(error){log.warn("Error occurred when \"".concat(this.self._name,"\" is running"),"\"".concat(String(templateFunction),"\": with bound"),"names \"".concat(scopeNames.join("\", \""),"\":"),"\"".concat(error,"\". Rendering node:"),domNode)}return output}/**
377
+ * Compiles and evaluates given node content and their children. Replaces
378
+ * each node content with their evaluated representation.
379
+ * @param domNode - Node to evaluate.
380
+ * @param scope - Scope to render against.
381
+ * @param options - Compile options.
382
+ * @param options.applyBindings - Indicates whether to apply bindings to
383
+ * given dom nodes.
384
+ * @param options.filter - Callback to exclude some node from being
385
+ * compiled.
386
+ * @param options.ignoreComponents - Indicates if component properties
387
+ * should be traversed or not.
388
+ * @param options.ignoreNestedComponents - Indicates if nested components
389
+ * should be traversed or not.
390
+ * @param options.domNodeTemplateCache - Yet compiled dom nodes to just
391
+ * reference instead of recompiling.
392
+ * @param options.unsafe - Indicates if full HTML generation should be
393
+ * allowed.
394
+ */},{key:"evaluateDomNodeTemplate",value:function evaluateDomNodeTemplate(domNode,scope,options){var _this7=this;if(scope===void 0){scope={}}if(options===void 0){options={}}options=_objectSpread({domNodeTemplateCache:this.domNodeTemplateCache,ignoreComponents:true,ignoreNestedComponents:true,unsafe:this.self.renderUnsafe},options);var domNodeTemplateCache=options.domNodeTemplateCache;if(!domNodeTemplateCache.has(domNode)){var compilerOptions={filter:options.filter,ignoreComponents:options.ignoreComponents,ignoreNestedComponents:options.ignoreNestedComponents,unsafe:options.unsafe};var compiledDomNode=this.compileDomNodeTemplate(domNode,scope,compilerOptions);if(compiledDomNode)domNodeTemplateCache.set(domNode,compiledDomNode)}if(domNodeTemplateCache.has(domNode)){var _compiledDomNode=domNodeTemplateCache.get(domNode);var output=this.evaluateCompiledDomNodeTemplate(_compiledDomNode,scope);if(output!==null)if(options.unsafe&&domNode.innerHTML)domNode.innerHTML=output;else domNode.textContent=output;if(_compiledDomNode.children.length){var _evaluateChildDomNode=function evaluateChildDomNode(children){var _iterator5=_createForOfIteratorHelper(children),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var childCompiledDomNode=_step5.value;var _output=_this7.evaluateCompiledDomNodeTemplate(childCompiledDomNode,scope);if(_output!==null)childCompiledDomNode.domNode.textContent=_output;if(childCompiledDomNode.children.length)_evaluateChildDomNode(childCompiledDomNode.children)}}catch(err){_iterator5.e(err)}finally{_iterator5.f()}};_evaluateChildDomNode(_compiledDomNode.children)}}if(options.applyBindings)this.applyBindings(domNode,scope)}/**
395
+ * Adds an event listener to the given dom node so that it will be
396
+ * deregistered when the component instance is destroyed.
397
+ * @param domNode - Node to assign event handler to.
398
+ * @param name - Event name.
399
+ * @param handler - Callback to trigger when given event occurs.
400
+ * @param options - Add event listener options.
401
+ * @param removeOptions - Remove event listener options.
402
+ * @returns Deregister function.
403
+ */},{key:"addSecureEventListener",value:function addSecureEventListener(domNode,name,handler,options,removeOptions){var _this8=this;if(!this.domNodeEventBindings.has(domNode))this.domNodeEventBindings.set(// eslint-disable-next-line func-call-spacing
404
+ domNode,new Map);var eventMap=this.domNodeEventBindings.get(domNode);var oldHandler=eventMap.get(name);if(oldHandler&&oldHandler!==handler)oldHandler();var deregister=function deregister(){domNode.removeEventListener(name,handler,removeOptions);eventMap.delete(name);if(eventMap.size===0)_this8.domNodeEventBindings.delete(domNode)};eventMap.set(name,deregister);domNode.addEventListener(name,handler,options);return deregister}//// endregion
405
+ /**
406
+ * Determines initial root which initializes rendering digest.
407
+ */},{key:"determineRootBinding",value:function determineRootBinding(){/*
408
+ If this component is the root component, we have to trigger
409
+ nested event handler by our own in global context since there is no
410
+ parent doing that for us.
411
+ */var currentElement=this.parentNode;while(currentElement){var isComponent=currentElement instanceof Web||currentElement.nodeName.includes("-")&&currentElement.nodeName!=="#document-fragment";var isInShadowDOM=currentElement.parentNode===null&&/* eslint-disable @typescript-eslint/no-base-to-string */currentElement.toString()==="[object ShadowRoot]";/* eslint-enable @typescript-eslint/no-base-to-string */if(isComponent){// Check whether we found the first parent component.
412
+ if(this.rootInstance===this){this.parentInstance=currentElement;/*
413
+ NOTE: There is at least one parent, so we can set
414
+ "isRoot" to "false".
415
+ */this.setPropertyValue("isRoot",false)}this.rootInstance=currentElement}else if(isInShadowDOM)/*
416
+ NOTE: Assume none root if determined a wrapped closed
417
+ shadow DOM.
418
+ */this.setPropertyValue("isRoot",false);currentElement=currentElement.parentNode}}/**
419
+ * Checks if given content hast code (to compile and render).
420
+ * @param content - Potential string with code inside.
421
+ * @returns A boolean indicating whether given content has code.
422
+ */},{key:"attachEventHandler",value:/// endregion
423
+ /// region events
424
+ /**
425
+ * Attaches event handler to keep in sync with nested components properties
426
+ * states.
427
+ */function attachEventHandler(){if(this.self.eventToPropertyMapping===null)return;/*
428
+ NOTE: We only reflect properties by implicit determined events if
429
+ their where no explicitly defined.
430
+ */var somethingDefined=this.attachExplicitDefinedOutputEventHandler();this.attachImplicitDefinedOutputEventHandler(!somethingDefined)}/**
431
+ * Attach explicitly defined event handler to synchronize internal and
432
+ * external property states.
433
+ * @returns Returns "true" if there are some defined and "false" otherwise.
434
+ */},{key:"attachExplicitDefinedOutputEventHandler",value:function attachExplicitDefinedOutputEventHandler(){var _this9=this;if(!this.self.eventToPropertyMapping)return false;// Grab all existing output to property definitions
435
+ var result=false;var _loop3=function _loop3(){var name=_Object$keys[_i];if(!Object.prototype.hasOwnProperty.call(_this9.internalProperties,name)){result=true;_this9.outputEventNames.add(name);_this9.setInternalPropertyValue(name,/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(){var _len2,parameters,_key2,result,_args=arguments;return _regenerator().w(function(_context){while(1)switch(_context.n){case 0:for(_len2=_args.length,parameters=new Array(_len2),_key2=0;_key2<_len2;_key2++){parameters[_key2]=_args[_key2]}_context.n=1;return _this9.reflectEventToProperties(name,parameters);case 1:result=_context.v;if(result)parameters[0]=result;_this9.forwardEvent(name,parameters);case 2:return _context.a(2)}},_callee)})))}};for(var _i=0,_Object$keys=Object.keys(this.self.eventToPropertyMapping);_i<_Object$keys.length;_i++){_loop3()}return result}/**
436
+ * Attach implicitly defined event handler to synchronize internal and
437
+ * external property states.
438
+ * @param reflectProperties - Indicates whether implicitly determined
439
+ * properties should be reflected.
440
+ */},{key:"attachImplicitDefinedOutputEventHandler",value:function attachImplicitDefinedOutputEventHandler(reflectProperties){var _this0=this;if(reflectProperties===void 0){reflectProperties=true}var _loop4=function _loop4(){var _Object$entries$_i=_slicedToArray(_Object$entries[_i2],2),name=_Object$entries$_i[0],type=_Object$entries$_i[1];if(!Object.prototype.hasOwnProperty.call(_this0.internalProperties,name)&&[clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.func,"function"].includes(type)&&!_this0.self.renderProperties.includes(name)){_this0.outputEventNames.add(name);_this0.setInternalPropertyValue(name,function(){for(var _len3=arguments.length,parameters=new Array(_len3),_key3=0;_key3<_len3;_key3++){parameters[_key3]=arguments[_key3]}if(reflectProperties)void _this0.reflectEventToProperties(name,parameters);_this0.forwardEvent(name,parameters)})}};// Determine all event handlers to inject
441
+ for(var _i2=0,_Object$entries=Object.entries(this.self.propertyTypes);_i2<_Object$entries.length;_i2++){_loop4()}}/**
442
+ * Triggers all identified events to communicate internal property / state
443
+ * changes.
444
+ */},{key:"triggerOutputEvents",value:function triggerOutputEvents(){var _iterator6=_createForOfIteratorHelper(this.outputEventNames),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var name=_step6.value;this.forwardEvent(name,[this.externalProperties])}}catch(err){_iterator6.e(err)}finally{_iterator6.f()}}/**
445
+ * Forwards given event as the native web event.
446
+ * @param name - Event name.
447
+ * @param parameters - Event parameters.
448
+ * @returns False if event is cancelable, and at least one of the event
449
+ * handlers which received event called "Event.preventDefault()",
450
+ * otherwise true will be returned.
451
+ */},{key:"forwardEvent",value:function forwardEvent(name,parameters){if(name.length>"onX".length&&name.startsWith("on"))name=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.lowerCase)(name.substring(2));return this.dispatchEvent(new CustomEvent(name,{detail:{parameters:parameters}}))}/// endregion
452
+ /// region slots
453
+ /**
454
+ * Renders component given slot contents into the given dom node. If
455
+ * expected slots are not given but a fallback is specified, they will be
456
+ * loaded into internal slot mapping.
457
+ * @param targetDomNode - Target dom node to render slots into.
458
+ * @param scope - Environment to render slots again if specified.
459
+ */},{key:"applySlots",value:function applySlots(targetDomNode,scope){var _this1=this;for(var _i3=0,_Array$from=Array.from(targetDomNode.querySelectorAll("slot"));_i3<_Array$from.length;_i3++){var domNode=_Array$from[_i3];var name=domNode.getAttribute("name");if(name===null||name==="default"){if(this.slots.default){if(this.self.renderSlots){if(this.self.evaluateSlots){var _iterator7=_createForOfIteratorHelper(this.slots.default),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _domNode=_step7.value;this.evaluateDomNodeTemplate(_domNode,scope)}}catch(err){_iterator7.e(err)}finally{_iterator7.f()}}(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.replace)(domNode,this.slots.default,Web.trimSlots)}}else this.slots.default=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.unwrap)(domNode).map(function(domNode){return _this1.grabSlotContent(domNode)});}else if(this.slots[name]){if(this.self.renderSlots){if(this.self.evaluateSlots)this.evaluateDomNodeTemplate(this.slots[name],scope);(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.replace)(domNode,this.slots[name],Web.trimSlots)}}else this.slots[name]=this.grabSlotContent((0,clientnode__WEBPACK_IMPORTED_MODULE_0__.unwrap)(domNode).filter(function(domNode){return domNode.nodeName.toLowerCase()!=="#text"})[0])}}/**
460
+ * Determines slot content from the given node.
461
+ * @param slot - Node to grab slot content from.
462
+ * @returns Determined slot.
463
+ */},{key:"grabSlotContent",value:function grabSlotContent(slot){var _element$firstElement;/*
464
+ If real (template) code is wrapped in a "textarea" tag, unwrap it
465
+ now. This extra wrapping can be used to avoid first dom rendering
466
+ before template code has been evaluated.
467
+ */var element=clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.node.firstElementChild?slot:null;if(element&&((_element$firstElement=element.firstElementChild)===null||_element$firstElement===void 0?void 0:_element$firstElement.nodeName.toLowerCase())==="textarea"&&(!element.firstElementChild.hasAttribute("data-no-template")||element.firstElementChild.getAttribute("data-no-template")==="false")){var content=element.firstElementChild.value;/*
468
+ NOTE: These kinds of slots are always used as a template and
469
+ should therefore be copied in every case.
470
+ NOTE: A flat copy should suffice since we will replace nested
471
+ content.
472
+ NOTE: Remove template content in copied node to avoid rendering
473
+ them before being evaluated. We cannot remove template code
474
+ from the source node since this would make it impossible to
475
+ re-instantiate this slot during whole component
476
+ re-instantiation.
477
+ */element.classList.remove("web-component-template");var newSlot=element.cloneNode();element.classList.add("web-component-template");newSlot.innerHTML="";newSlot.template=content;return newSlot}return this.self.cloneSlots?slot.cloneNode(true):slot}/**
478
+ * Saves given slots.
479
+ */},{key:"grabGivenSlots",value:function grabGivenSlots(){var _this10=this;this.slots={};for(var _i4=0,_Array$from2=Array.from(this.querySelectorAll("[slot]"));_i4<_Array$from2.length;_i4++){var _slot$getAttribute;var slot=_Array$from2[_i4];// NOTE: This is how we avoid grabbing slots from nested components.
480
+ var currentElement=slot.parentNode;var skip=true;while(currentElement){if(currentElement.nodeName.includes("-")){if(currentElement===this)skip=false;break}currentElement=currentElement.parentNode}if(skip)continue;var slotValue=(_slot$getAttribute=slot.getAttribute("slot"))===null||_slot$getAttribute===void 0?void 0:_slot$getAttribute.trim();this.slots[slotValue!==null&&slotValue!==void 0?slotValue:slot.nodeName.toLowerCase()]=this.grabSlotContent(slot)}if(this.slots.default)this.slots.default=[].concat(this.slots.default);else if(this.childNodes.length>0)this.slots.default=Array.from(this.childNodes).map(function(domNode){return _this10.grabSlotContent(domNode)});else this.slots.default=[]}/// endregion
481
+ /// region properties
482
+ /**
483
+ * Determines if a given property name exists in wrapped component state.
484
+ * @param name - Property name to check if exists in state.
485
+ * @returns Boolean result.
486
+ */},{key:"isStateProperty",value:function isStateProperty(name){var _this$instance3;return Boolean(((_this$instance3=this.instance)===null||_this$instance3===void 0||(_this$instance3=_this$instance3.current)===null||_this$instance3===void 0?void 0:_this$instance3.state)&&(Object.prototype.hasOwnProperty.call(this.instance.current.state,name)||this.instance.current.state.modelState&&Object.prototype.hasOwnProperty.call(this.instance.current.state.modelState,name)))}/**
487
+ * Generates an alias to name and the other way around mapping if not
488
+ * exists.
489
+ */},{key:"generateAliasIndex",value:function generateAliasIndex(){if(!this.self._propertyAliasIndex){this.self._propertyAliasIndex=_objectSpread({},this.self.propertyAliases);// Align alias mapping for better performance while mapping them.
490
+ for(var _i5=0,_Object$entries2=Object.entries(this.self._propertyAliasIndex);_i5<_Object$entries2.length;_i5++){var _Object$entries2$_i=_slicedToArray(_Object$entries2[_i5],2),name=_Object$entries2$_i[0],value=_Object$entries2$_i[1];if(!Object.prototype.hasOwnProperty.call(this.self._propertyAliasIndex,value))this.self._propertyAliasIndex[value]=name}}}/**
491
+ * Reflects wrapped component state back to web-component's attributes.
492
+ * @param properties - Properties to update in reflected attribute state.
493
+ */},{key:"reflectExternalProperties",value:function reflectExternalProperties(properties){/*
494
+ NOTE: We can avoid an additional attribute parsing for
495
+ reflections.
496
+ */this.ignoreAttributeUpdateObservations=true;for(var _i6=0,_Object$entries3=Object.entries(properties);_i6<_Object$entries3.length;_i6++){var _this$self$_propertie;var _Object$entries3$_i=_slicedToArray(_Object$entries3[_i6],2),name=_Object$entries3$_i[0],value=_Object$entries3$_i[1];this.setExternalPropertyValue(name,value);if(!this.isConnected)continue;var attributeName=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.camelCaseToDelimited)(name);if((_this$self$_propertie=this.self._propertiesToReflectAsAttributes)!==null&&_this$self$_propertie!==void 0&&_this$self$_propertie.has(name))switch(this.self._propertiesToReflectAsAttributes.get(name)){case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.boolean:case"boolean":if(value){if(this.getAttribute(attributeName)!=="")this.setAttribute(attributeName,"")}else if(this.hasAttribute(attributeName))this.removeAttribute(attributeName);break;case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.func:case"function":break;case"json":if(value){var representation=JSON.stringify(value);if(representation&&this.getAttribute(attributeName)!==representation){this.setAttribute(attributeName,representation);break}}if(this.hasAttribute(attributeName))this.removeAttribute(attributeName);break;case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.number:case"number":if(typeof value==="number"&&!isNaN(value)){var valueAsString=String(value);if(this.getAttribute(attributeName)!==valueAsString)this.setAttribute(attributeName,valueAsString)}else if(this.hasAttribute(attributeName))this.removeAttribute(attributeName);break;case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.string:case"string":if(value){if(this.getAttribute(attributeName)!==value)this.setAttribute(attributeName,value)}else if(this.hasAttribute(attributeName))this.removeAttribute(attributeName);break;case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.any:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.array:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.arrayOf:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.element:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.elementType:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.instanceOf:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.node:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.object:case"object":case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.objectOf:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.shape:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.exact:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.symbol:default:if(value){var _representation=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.represent)(value);if(_representation&&this.getAttribute(attributeName)!==_representation){this.setAttribute(attributeName,_representation);break}}if(this.hasAttribute(attributeName))this.removeAttribute(attributeName);break}}this.ignoreAttributeUpdateObservations=false}/**
497
+ * Reflects wrapped component state back to web-component's attributes and
498
+ * properties.
499
+ * @param properties - Properties to update in reflected property state.
500
+ */},{key:"reflectProperties",value:function reflectProperties(properties){var _this$instance4,_this$internalPropert;this.reflectExternalProperties(properties);/*
501
+ NOTE: Do not reflect properties which are hold in state. These
502
+ values are only set once when they are explicitly set
503
+ (see "setPropertyValue").
504
+ */if((_this$instance4=this.instance)!==null&&_this$instance4!==void 0&&(_this$instance4=_this$instance4.current)!==null&&_this$instance4!==void 0&&_this$instance4.state&&_typeof(this.instance.current.state)==="object"){var _iterator8=_createForOfIteratorHelper(Object.keys(this.instance.current.state).concat(this.instance.current.state.modelState?Object.keys(this.instance.current.state.modelState):[])),_step8;try{for(_iterator8.s();!(_step8=_iterator8.n()).done;){var name=_step8.value;if(Object.prototype.hasOwnProperty.call(this.internalProperties,name))/*
505
+ We want to avoid fully deleting this property to know
506
+ which properties exist in the underlying instance.
507
+ */this.setInternalPropertyValue(name,undefined)}}catch(err){_iterator8.e(err)}finally{_iterator8.f()}}if((_this$internalPropert=this.internalProperties.model)!==null&&_this$internalPropert!==void 0&&_this$internalPropert.state){delete this.internalProperties.model.state;this.setInternalPropertyValue("model",this.internalProperties.model)}var _iterator9=_createForOfIteratorHelper(this.self.controllableProperties),_step9;try{for(_iterator9.s();!(_step9=_iterator9.n()).done;){var _name2=_step9.value;if(Object.prototype.hasOwnProperty.call(properties,_name2))this.setInternalPropertyValue(_name2,properties[_name2])}}catch(err){_iterator9.e(err)}finally{_iterator9.f()}}/**
508
+ * Reflect the given event handler call with the given parameter back to
509
+ * current properties state.
510
+ * @param name - Event name.
511
+ * @param parameters - List of parameter to given event handler call.
512
+ * @returns Mapped properties or null if nothing could be mapped.
513
+ */},{key:"reflectEventToProperties",value:(function(){var _reflectEventToProperties=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(name,parameters){var oldBatchUpdatesConfiguration,result,handled,_this$self$eventToPro,wrappedMapping,mapping,_newProperties$detail,newProperties,_i7,_Object$keys2,_this$getPropertyAlia,propertyName,_iterator0,_step0,_name3,currentValue,_t;return _regenerator().w(function(_context2){while(1)switch(_context2.n){case 0:/*
514
+ NOTE: We enforce to update component state immediately after an
515
+ event occurs since batching usually does not make sense here. An
516
+ event runs within its own context.
517
+ On the other hand, it can be necessary to immediately reflect a
518
+ property change to the component internal state to avoid
519
+ contradicting internal render cycles.
520
+ */oldBatchUpdatesConfiguration=this.batchUpdates;this.batchUpdates=false;result=null;handled=false;// region check if there exists an explicit mapper
521
+ if(!(this.self.eventToPropertyMapping&&Object.prototype.hasOwnProperty.call(this.self.eventToPropertyMapping,name)&&(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.isFunction)(this.self.eventToPropertyMapping[name]))){_context2.n=4;break}wrappedMapping=(_this$self$eventToPro=this.self.eventToPropertyMapping)[name].apply(_this$self$eventToPro,_toConsumableArray(parameters).concat([this]));if(!(wrappedMapping&&"then"in wrappedMapping&&(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.isFunction)(wrappedMapping.then))){_context2.n=2;break}_context2.n=1;return wrappedMapping;case 1:_t=_context2.v;_context2.n=3;break;case 2:_t=wrappedMapping;case 3:mapping=_t;handled=true;if(Array.isArray(mapping)){result=mapping[0];this.reflectProperties(result);(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.extend)(true,this.internalProperties,mapping[1])}else if(mapping===null)handled=false;else if(_typeof(mapping)==="object"){result=mapping;this.reflectProperties(mapping)}case 4:// endregion
522
+ if(!handled&&parameters.length>0&&(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.isObject)(parameters[0])){/*
523
+ Identified as somehow throw data back event (no synthetic
524
+ event; derived from a user-triggered one) when following
525
+ condition does not hold.
526
+ */newProperties=parameters[0];if("persist"in parameters[0]&&(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.isFunction)(parameters[0].persist)){newProperties={};for(_i7=0,_Object$keys2=Object.keys(this.self.propertyTypes);_i7<_Object$keys2.length;_i7++){propertyName=_Object$keys2[_i7];_iterator0=_createForOfIteratorHelper([propertyName].concat((_this$getPropertyAlia=this.getPropertyAlias(propertyName))!==null&&_this$getPropertyAlia!==void 0?_this$getPropertyAlia:[]));try{for(_iterator0.s();!(_step0=_iterator0.n()).done;){_name3=_step0.value;currentValue=parameters[0].currentTarget&&Object.prototype.hasOwnProperty.call(parameters[0].currentTarget,_name3)?/*
527
+ Update all known properties from event
528
+ target instance.
529
+ */parameters[0].currentTarget[_name3]:/*
530
+ Update all known properties from adapter
531
+ instance.
532
+ */this.getPropertyValue(_name3);if(currentValue!==this.externalProperties[_name3])newProperties[_name3]=currentValue}}catch(err){_iterator0.e(err)}finally{_iterator0.f()}}}else if(![null,undefined].includes((_newProperties$detail=newProperties.detail)===null||_newProperties$detail===void 0?void 0:_newProperties$detail.value))newProperties=_objectSpread({},newProperties.detail);result=newProperties;this.reflectProperties(newProperties)}this.triggerRender("propertyReflected");this.batchUpdates=oldBatchUpdatesConfiguration;return _context2.a(2,result)}},_callee2,this)}));function reflectEventToProperties(_x,_x2){return _reflectEventToProperties.apply(this,arguments)}return reflectEventToProperties}()/**
533
+ * Evaluates the given property value depending on its property definition
534
+ * and registers in a property mapping object.
535
+ * @param attributeName - Name of given value.
536
+ * @param value - Value to evaluate.
537
+ */)},{key:"evaluateStringOrNullAndSetAsProperty",value:function evaluateStringOrNullAndSetAsProperty(attributeName,value){var _this11=this;var preEvaluate=attributeName.startsWith("-");var effectiveAttributeName=preEvaluate?attributeName.substring(1):attributeName;var name=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.delimitedToCamelCase)(effectiveAttributeName);var alias=this.getPropertyAlias(name);if(alias&&Object.prototype.hasOwnProperty.call(this.self.propertyTypes,alias))name=alias;if(Object.prototype.hasOwnProperty.call(this.self.propertyTypes,name)){var type=this.self.propertyTypes[name];if(preEvaluate){if(value){var result=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.evaluate)(value,_objectSpread({},clientnode__WEBPACK_IMPORTED_MODULE_0__.UTILITY_SCOPE),false,true,this);if(result.error){log.warn("Failed to process pre-evaluation attribute","\"".concat(attributeName,"\": ").concat(result.error,". Will be"),"set to \"undefined\".");this.setInternalPropertyValue(name,undefined)}else{this.setInternalPropertyValue(name,result.result);this.setExternalPropertyValue(name,result.result)}}}else switch(type){case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.boolean:case"boolean":{var booleanValue=![null,"false"].includes(value);this.setInternalPropertyValue(name,booleanValue);this.setExternalPropertyValue(name,booleanValue);break}case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.func:case"function":{var error=null;var templateFunction;var scopeNames=["data","event","firstArgument","firstParameter","options"];if(value){var _result3=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.compile)(value,scopeNames.concat("parameters","scope",clientnode__WEBPACK_IMPORTED_MODULE_0__.UTILITY_SCOPE_NAMES),true,true,this);error=_result3.error;templateFunction=_result3.templateFunction;if(error)log.warn("Failed to compile given handler","\"".concat(attributeName,"\": ").concat(error,"."))}this.setInternalPropertyValue(name,function(){for(var _len4=arguments.length,parameters=new Array(_len4),_key4=0;_key4<_len4;_key4++){parameters[_key4]=arguments[_key4]}if(_this11.outputEventNames.has(name))void _this11.reflectEventToProperties(name,parameters);var result=undefined;if(!error){var scope=_objectSpread({parameters:parameters},clientnode__WEBPACK_IMPORTED_MODULE_0__.UTILITY_SCOPE);for(var _i8=0,_scopeNames=scopeNames;_i8<_scopeNames.length;_i8++){var _name4=_scopeNames[_i8];scope[_name4]=parameters[0]}try{var _templateFunction;result=(_templateFunction=templateFunction)===null||_templateFunction===void 0?void 0:_templateFunction.apply(void 0,_toConsumableArray(scopeNames.map(function(name){return scope[name]})).concat([parameters,scope],_toConsumableArray(clientnode__WEBPACK_IMPORTED_MODULE_0__.UTILITY_SCOPE_NAMES.map(function(name){return clientnode__WEBPACK_IMPORTED_MODULE_0__.UTILITY_SCOPE[name]}))))}catch(error){log.warn("Failed to evaluate function","\"".concat(attributeName,"\" with expression"),"\"".concat(value,"\" and scope"),"variables","\"".concat(scopeNames.join("\", \""),"\" set to"),"\"".concat((0,clientnode__WEBPACK_IMPORTED_MODULE_0__.represent)(parameters),"\":"),"".concat(error,". Set property"),"to \"undefined\".")}}if(!_this11.self.renderProperties.includes(name))_this11.forwardEvent(name,parameters);return result});if(!error)this.setExternalPropertyValue(name,templateFunction);break}case"json":{if(value){var evaluated;try{evaluated=JSON.parse(value)}catch(error){log.warn("Error occurred during parsing given json","attribute \"".concat(attributeName,"\":"),(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.represent)(error));break}// NOTE: That both values do have to be avoided.
538
+ this.setInternalPropertyValue(name,evaluated);this.setExternalPropertyValue(name,(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.copy)(evaluated,false,1))}else{this.setInternalPropertyValue(name,null);this.setExternalPropertyValue(name,null)}break}case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.number:case"number":{if(value===null){this.setInternalPropertyValue(name,value);this.setExternalPropertyValue(name,value);break}/*
539
+ NOTE: You should not name this variable "number" since
540
+ babel gets confused caused by existing module wide
541
+ property type variable "number".
542
+ */var numberValue=parseFloat(value);if(isNaN(numberValue))numberValue=undefined;this.setInternalPropertyValue(name,numberValue);this.setExternalPropertyValue(name,numberValue);break}case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.string:case"string":{this.setInternalPropertyValue(name,value);this.setExternalPropertyValue(name,value);break}case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.any:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.array:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.arrayOf:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.element:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.elementType:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.instanceOf:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.node:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.object:case"object":case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.objectOf:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.oneOf:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.oneOfType:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.shape:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.exact:case clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.symbol:default:{if(value){var _evaluated=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.evaluate)(value,{},false,true,this);if(_evaluated.error){log.warn("Error occurred during processing given","attribute configuration \"".concat(attributeName,"\":"),_evaluated.error);break}// NOTE: That both values do have to be avoided.
543
+ this.setInternalPropertyValue(name,_evaluated.result);this.setExternalPropertyValue(name,(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.copy)(_evaluated.result,false,1))}else if(this.hasAttribute(attributeName)){this.setInternalPropertyValue(name,true);this.setExternalPropertyValue(name,true)}else{this.setInternalPropertyValue(name,null);this.setExternalPropertyValue(name,null)}break}}}}/// endregion
544
+ /// region render
545
+ /**
546
+ * Produces a promise resolving when all nested rendering promises have
547
+ * been resolved. This only waits for registered nested components. That
548
+ * means that nested components which where connected before the parent
549
+ * component got initialized will not be waited for. That might happen
550
+ * when nested component types got registered before the parent ones.
551
+ */},{key:"waitForNestedComponentRendering",value:function(){var _waitForNestedComponentRendering=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(){return _regenerator().w(function(_context3){while(1)switch(_context3.n){case 0:if(this.childComponentInstances){_context3.n=1;break}return _context3.a(2);case 1:_context3.n=2;return Promise.all(this.childComponentInstances.map(function(component){return component.renderState.pending?component.renderState.promise:Promise.resolve()}));case 2:return _context3.a(2)}},_callee3,this)}));function waitForNestedComponentRendering(){return _waitForNestedComponentRendering.apply(this,arguments)}return waitForNestedComponentRendering}()/**
552
+ * Resolves the rendering promise.
553
+ * @param reason - Rendering reason description.
554
+ * @param resolveRendering - Indicates whether to resolve the rendering or
555
+ * just return a resolving promise directly.
556
+ * @returns A promise resolving when all nested render promises have been
557
+ * resolved.
558
+ */},{key:"resolveRenderingPromiseIfSet",value:(function(){var _resolveRenderingPromiseIfSet=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(reason,resolveRendering){return _regenerator().w(function(_context4){while(1)switch(_context4.n){case 0:if(!resolveRendering){_context4.n=2;break}_context4.n=1;return this.waitForNestedComponentRendering();case 1:this.renderState.pending=false;this.renderState.resolve(reason);this.prepareNewRenderingPromise();case 2:return _context4.a(2)}},_callee4,this)}));function resolveRenderingPromiseIfSet(_x3,_x4){return _resolveRenderingPromiseIfSet.apply(this,arguments)}return resolveRenderingPromiseIfSet}()/**
559
+ * Sets up a new rendering cycle representing promise.
560
+ */)},{key:"prepareNewRenderingPromise",value:function prepareNewRenderingPromise(){var _this12=this;if(!this.renderState.pending)this.renderState.promise=new Promise(function(resolve){_this12.renderState.resolve=function(reason){_this12.renderState.pending=false;resolve(reason)}})}/**
561
+ * Triggers a new rendering cycle by respecting batch configuration.
562
+ * @param reason - A description why rendering should be triggered.
563
+ */},{key:"triggerRender",value:function triggerRender(reason){var _this13=this;if(this.batchUpdates){if(!this.batchedUpdateRunning){this.batchedUpdateRunning=true;void (0,clientnode__WEBPACK_IMPORTED_MODULE_0__.timeout)(function(){_this13.batchedUpdateRunning=false;void _this13.render(reason)})}}else void this.render(reason)}/**
564
+ * Creates shadow root if not created yet and assigns to the current root
565
+ * property.
566
+ */},{key:"applyShadowRootIfNotExisting",value:function applyShadowRootIfNotExisting(){if(this.self.shadowDOM&&this.hostDomNode===this)this.hostDomNode=(!("attachShadow"in this)&&"ShadyDOM"in window?window.ShadyDOM.wrap(this):this).attachShadow((0,clientnode__WEBPACK_IMPORTED_MODULE_0__.isObject)(this.self.shadowDOM)?this.self.shadowDOM:{mode:"open"})}/**
567
+ * Determines a new scope object with a useful default set of environment
568
+ * values.
569
+ * @param scope - To apply to generated scope.
570
+ */},{key:"determineRenderScope",value:function determineRenderScope(scope){var _this$parentInstance;if(scope===void 0){scope={}}this.scope=_objectSpread(_objectSpread(_objectSpread(_objectSpread({},((_this$parentInstance=this.parentInstance)===null||_this$parentInstance===void 0?void 0:_this$parentInstance.scope)||{}),this.scope),this.internalProperties),{},_defineProperty({parentInstance:this.parentInstance,rootInstance:this.rootInstance,self:this},(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.lowerCase)(this.self._name)||"instance",this),scope);this.scope.scope=this.scope}/**
571
+ * Does the rendering job. Should be called when ever state changes should
572
+ * be projected to the hosts dom content.
573
+ * @param reason - Description why rendering is necessary.
574
+ * @param resolveRendering - Indicates whether rendering should be resolved
575
+ * finally. Should be set to "false" via super calls in inherited render
576
+ * methods which do further dom manipulations afterward and resolve the
577
+ * rendering process by their own.
578
+ * @returns A promise resolving when rendering has been finished. A promise
579
+ * may be needed for classes inheriting from this class.
580
+ */},{key:"render",value:(function(){var _render=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(reason,resolveRendering){var _this14=this;var evaluated,renderTargetDomNode;return _regenerator().w(function(_context5){while(1)switch(_context5.n){case 0:if(reason===void 0){reason="unknown"}if(resolveRendering===void 0){resolveRendering=true}this.unRender("reRender",reason);this.childComponentInstances=[];this.renderState.pending=true;if(!this.isRoot){_context5.n=3;break}_context5.n=1;return this.resolveRenderingPromiseIfSet(reason,resolveRendering);case 1:if(!resolveRendering){_context5.n=3;break}_context5.n=2;return Promise.all(this.self.pendingRenderPromises);case 2:this.self.pendingRenderPromises=[];case 3:this.self.pendingRenderPromises.push(this.renderState.promise);this.determineRenderScope();if(this.self.doRender&&this.dispatchEvent(new CustomEvent("render",{detail:{reason:reason,scope:this.scope}}))){_context5.n=5;break}_context5.n=4;return this.resolveRenderingPromiseIfSet(reason,resolveRendering);case 4:return _context5.a(2);case 5:evaluated=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.evaluate)("`".concat(this.self.content,"`"),this.scope);if(!evaluated.error){_context5.n=7;break}log.warn("Failed to process template: ".concat(evaluated.error));this.renderState.resolve(reason);_context5.n=6;return Promise.all(this.self.pendingRenderPromises);case 6:return _context5.a(2);case 7:this.applyShadowRootIfNotExisting();/*
581
+ NOTE: We first render into an intermediate render target and apply
582
+ slot content until we finally publish everything to the document.
583
+ This avoids painting twice and internetexplorer bugs with an empty
584
+ node after first overwriting the content of "this.rootInstance".
585
+ */renderTargetDomNode=document.createElement("div");renderTargetDomNode.innerHTML=evaluated.result;this.applySlots(renderTargetDomNode,_objectSpread(_objectSpread({},this.scope),{},{parentInstance:this}));this.hostDomNode.innerHTML=renderTargetDomNode.innerHTML;/*
586
+ NOTE: Wait until nested components have registered themselves to be
587
+ able to wait for their rendering.
588
+ */_context5.n=8;return (0,clientnode__WEBPACK_IMPORTED_MODULE_0__.timeout)();case 8:void this.waitForNestedComponentRendering().then(function(){_this14.applyBindings(_this14.hostDomNode.firstChild,_this14.scope,_this14.self.renderSlots)});_context5.n=9;return this.resolveRenderingPromiseIfSet(reason,resolveRendering);case 9:return _context5.a(2)}},_callee5,this)}));function render(_x5,_x6){return _render.apply(this,arguments)}return render}()/**
589
+ * Should free up memory listeners related to deprecated HTML.
590
+ * @param _reason - Description why rendering is necessary.
591
+ * @param _reRenderReason - Description why a re-rendering is necessary.
592
+ */)},{key:"unRender",value:function unRender(_reason,_reRenderReason){if(_reason===void 0){_reason="unknown"}this.unregisterDomNodeEventBindings()}/// endregion
593
+ // endregion
594
+ }],[{key:"hasCode",value:function hasCode(content){return(// NOTE: First three conditions are only for performance.
595
+ typeof content==="string"&&content.includes("${")&&content.includes("}")&&/\${[\s\S]+}/.test(content))}/**
596
+ * Converts given the list, item, or map to a map (with ordering).
597
+ * @param value - Attribute reflection configuration.
598
+ * @returns Generated map.
599
+ */},{key:"normalizePropertyTypeList",value:function normalizePropertyTypeList(value){if(typeof value==="string")value=[value];if(Array.isArray(value)){var givenValue=value;var newValue=new Map;var _iterator1=_createForOfIteratorHelper(givenValue),_step1;try{for(_iterator1.s();!(_step1=_iterator1.n()).done;){var name=_step1.value;if(Object.prototype.hasOwnProperty.call(Web.propertyTypes,name))newValue.set(name,Web.propertyTypes[name])}}catch(err){_iterator1.e(err)}finally{_iterator1.f()}return newValue}return (0,clientnode__WEBPACK_IMPORTED_MODULE_0__.convertPlainObjectToMap)(value)}}])}(GenericHTMLElement),_defineProperty(_Web,"applyRootBinding",true),_defineProperty(_Web,"pendingRenderPromises",[]),_defineProperty(_Web,"content","<slot>Please provide a template to transclude.</slot>"),_defineProperty(_Web,"determineRootBinding",true),_defineProperty(_Web,"shadowDOM",null),_defineProperty(_Web,"observedAttributes",[]),_defineProperty(_Web,"controllableProperties",[]),_defineProperty(_Web,"eventToPropertyMapping",{}),_defineProperty(_Web,"propertyAliases",{}),_defineProperty(_Web,"propertyTypes",{onClick:clientnode_property_types__WEBPACK_IMPORTED_MODULE_1__.func}),_defineProperty(_Web,"propertiesToReflectAsAttributes",[]),_defineProperty(_Web,"renderProperties",["children"]),_defineProperty(_Web,"doRender",false),_defineProperty(_Web,"cloneSlots",false),_defineProperty(_Web,"evaluateSlots",false),_defineProperty(_Web,"renderSlots",true),_defineProperty(_Web,"trimSlots",true),_defineProperty(_Web,"renderUnsafe",false),_defineProperty(_Web,"_name","BaseWeb"),_defineProperty(_Web,"_propertyAliasIndex",void 0),_defineProperty(_Web,"_propertiesToReflectAsAttributes",void 0),_Web),_descriptor=_applyDecoratedDescriptor(_class.prototype,"isRoot",[_dec],{configurable:true,enumerable:true,writable:true,initializer:function initializer(){return true}}),_class);var api={component:Web,register:function register(tagName){if(tagName===void 0){tagName=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.camelCaseToDelimited)(Web._name)}customElements.define(tagName,Web)}};/* harmony default export */ __webpack_exports__.Ay = (Web);
600
+ var __webpack_exports__GenericHTMLElement = __webpack_exports__.Hh;
601
+ var __webpack_exports__Web = __webpack_exports__.Nc;
602
+ var __webpack_exports__api = __webpack_exports__.FH;
603
+ var __webpack_exports__default = __webpack_exports__.Ay;
604
+ var __webpack_exports__log = __webpack_exports__.Rm;
605
+ export { __webpack_exports__GenericHTMLElement as GenericHTMLElement, __webpack_exports__Web as Web, __webpack_exports__api as api, __webpack_exports__default as default, __webpack_exports__log as log };