sproutjs-core 2.9.1 → 2.9.2

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,2 +1,2 @@
1
- (()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,n(o.key),o)}}function n(e){var n=function(e,n){if("object"!=t(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,n||"default");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==t(n)?n:n+""}function r(e,n,r){return n=l(n),function(e,n){if(n&&("object"==t(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(e)}(e,i()?Reflect.construct(n,r||[],l(e).constructor):n.apply(e,r))}function o(t){var e="function"==typeof Map?new Map:void 0;return o=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(i())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&a(o,n.prototype),o}(t,arguments,l(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),a(n,t)},o(t)}function i(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(i=function(){return!!t})()}function a(t,e){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},a(t,e)}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},l(t)}var u=function(t){function n(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),(e=r(this,n,[t])).add=function(){return n.unavailableMethod("add")},e}return function(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&&a(t,e)}(n,t),o=n,l=[{key:"unavailableMethod",value:function(t){throw Error("Can't use ".concat(t," in ReadonlySet"))}}],(i=[{key:"delete",value:function(){n.unavailableMethod("delete")}},{key:"clear",value:function(){n.unavailableMethod("clear")}}])&&e(o.prototype,i),l&&e(o,l),Object.defineProperty(o,"prototype",{writable:!1}),o;var o,i,l}(o(Set)),c=["ref","hidden"],s=new u(["hidden","checked","disabled","required","selected"]),f=new u(["checked","disabled","selected","src"]),p=new u(["value","checked"]),h=new u(["_global","_gettingDependenciesFor","_localStateManager","_stateManager","_binding","_populate","_isActive","_isStateManager","_isStatefulArray","hasOwnProperty"]),d="getGlobalState",y="Global State Not Set Yet",v=(Object.freeze({NO_DEPENDENCIES_ARRAY_IN_SET_HOOK:function(t){return"State set hook, must include a dependencies array! None was found for ".concat(t)}}),Object.freeze([{class:HTMLAnchorElement,element:"a"},{class:HTMLAreaElement,element:"area"},{class:HTMLAudioElement,element:"audio"},{class:HTMLBodyElement,element:"body"},{class:HTMLBRElement,element:"br"},{class:HTMLButtonElement,element:"button"},{class:HTMLCanvasElement,element:"canvas"},{class:HTMLDataElement,element:"data"},{class:HTMLDataListElement,element:"datalist"},{class:HTMLDetailsElement,element:"details"},{class:HTMLDialogElement,element:"dialog"},{class:HTMLDivElement,element:"div"},{class:HTMLDListElement,element:"dl"},{class:HTMLEmbedElement,element:"embed"},{class:HTMLFieldSetElement,element:"fieldset"},{class:HTMLFormElement,element:"form"},{class:HTMLHRElement,element:"hr"},{class:HTMLHtmlElement,element:"html"},{class:HTMLIFrameElement,element:"iframe"},{class:HTMLImageElement,element:"img"},{class:HTMLLabelElement,element:"label"},{class:HTMLLegendElement,element:"legend"},{class:HTMLLIElement,element:"li"},{class:HTMLLinkElement,element:"link"},{class:HTMLMapElement,element:"map"},{class:HTMLMetaElement,element:"meta"},{class:HTMLMeterElement,element:"meter"},{class:HTMLObjectElement,element:"object"},{class:HTMLOListElement,element:"ol"},{class:HTMLOptGroupElement,element:"optgroup"},{class:HTMLOptionElement,element:"option"},{class:HTMLParagraphElement,element:"p"},{class:HTMLPictureElement,element:"picture"},{class:HTMLPreElement,element:"pre"},{class:HTMLProgressElement,element:"progress"},{class:HTMLQuoteElement,element:"blockquote"},{class:HTMLQuoteElement,element:"q"},{class:HTMLSelectElement,element:"select"},{class:HTMLSourceElement,element:"source"},{class:HTMLSpanElement,element:"span"},{class:HTMLTableElement,element:"table"},{class:HTMLTableCellElement,element:"td"},{class:HTMLTableCellElement,element:"th"},{class:HTMLTableRowElement,element:"tr"},{class:HTMLTableSectionElement,element:"thead"},{class:HTMLTableSectionElement,element:"tbody"},{class:HTMLTableSectionElement,element:"tfoot"},{class:HTMLTextAreaElement,element:"textarea"},{class:HTMLTimeElement,element:"time"},{class:HTMLTitleElement,element:"title"},{class:HTMLTrackElement,element:"track"},{class:HTMLUListElement,element:"ul"},{class:HTMLVideoElement,element:"video"},{class:HTMLSlotElement,element:"slot"}])),b=document.createElement("div"),m={nodeActionsMap:new Map,pendingPaintNodeManagers:new Set,eventBindingFunctions:new Map,conditionalRenders:new Map,stateChangeHandlers:new Map,paintRafId:null},g=(new u(["==","===","!=","!==","<","<=",">",">="]),new u(["shift","unshift","pop","push","reverse","sort","splice","copyWithin","fill"])),w=new u(["reverse","sort","copyWithin","fill"]),S=new u(["slice","map","filter","reduce","reduceRight","some","every","forEach","find","findIndex","findLast","findLastIndex","indexOf","lastIndexOf","includes","entries","keys","values","at","join","toString","toLocaleString"]),O=new u(["every","some","filter","forEach","map","reduce","reduceRight","slice"]),E={STATE_NOT_FOUND:"SPROUT_STATE_NOT_FOUND"},A=new u(["checked","value"]),M="sprout-frozen",T="\n .".concat(M," {\n clip-path: inset(100%);\n pointer-events: none;\n opacity: 0;\n }\n"),j=Object.freeze({HIDE_UNHIDE:1,CLONE:2}),P=100,_={ATTRIBUTE_ACTIONS:600,TEXT_ACTIONS:300,ELEMENT_ACTIONS:100,PROPERTY_ACTIONS:50,REATTACH_ACTIONS:10},k=8;function N(t){return"OL"===t.tagName||"UL"===t.tagName}function C(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,e)||R(t,e)||function(){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 L(t){return function(t){if(Array.isArray(t))return I(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||R(t)||function(){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 R(t,e){if(t){if("string"==typeof t)return I(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?I(t,e):void 0}}function I(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var D=m.pendingPaintNodeManagers,x=new Map;function $(t,e,n){var r;if(x.has(e)&&(r=x.get(e),cancelAnimationFrame(r)),t.length<P)r=requestAnimationFrame((function(){x.delete(e),t.forEach((function(t){return t()})),n&&n()})),x.set(e,r);else{x.delete(e);var o=L(t),i=0;requestAnimationFrame((function t(){o.slice(i,i+P).forEach((function(t){return t()})),(i+=P)<o.length&&requestAnimationFrame(t)}))}}var H=m.paintRafId,F=m.conditionalRenders;function K(t,e){F.set(t,e),$(Array.from(F.values()),"CONDITIONAL_RENDER",(function(){return F.clear()}))}function G(){H&&cancelAnimationFrame(H),H=requestAnimationFrame((function(){H=null,q()}))}function U(t){t.forEach((function(t){return t()}))}function q(t){var e,n=performance.now(),r=0,o=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=R(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}(D);try{for(o.s();!(e=o.n()).done;){var i=e.value,a=C(i.resolveToDOMActions(),5),l=a[0],u=a[1],c=a[2],s=a[3],f=a[4];if(U(f.slice(0,_.REATTACH_ACTIONS)),(r=performance.now()-n)>k)return requestAnimationFrame((function(){return q()}));if(U(s.slice(0,_.ELEMENT_ACTIONS)),(r=performance.now()-n)>k)return requestAnimationFrame((function(){return q()}));if(U(l.slice(0,_.ATTRIBUTE_ACTIONS)),(r=performance.now()-n)>k)return requestAnimationFrame((function(){return q()}));if(U(u.slice(0,_.TEXT_ACTIONS)),(r=performance.now()-n)>k)return requestAnimationFrame((function(){return q()}));if(U(c.slice(0,_.PROPERTY_ACTIONS)),(r=performance.now()-n)>k)return requestAnimationFrame((function(){return q()}));if(l.length||u.length||c.length||s.length||f.length)return requestAnimationFrame((function(){return q()}));i.paintStatus=null,D.delete(i)}}catch(t){o.e(t)}finally{o.f()}if(r>k)return requestAnimationFrame((function(){return q()}))}function z(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=V(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function B(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,e)||V(t,e)||function(){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 W(t){return function(t){if(Array.isArray(t))return X(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||V(t)||function(){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 V(t,e){if(t){if("string"==typeof t)return X(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?X(t,e):void 0}}function X(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}"undefined"!=typeof window&&(window.SproutWaitIdle=function(){return new Promise((function(t){requestAnimationFrame((function e(){if(!m.pendingPaintNodeManagers.size)return t();requestAnimationFrame(e)}))}))});function Y(t){switch(t){case Node.ATTRIBUTE_NODE:return{setAttribute:void 0};case Node.TEXT_NODE:return{textContent:void 0};case Node.ELEMENT_NODE:return{append:new Set,reattach:!1,setProperty:new Map,get hasPendingActions(){return this.append.size||this.reattach||this.setProperty.size}}}}function Q(t,e,n){var r=this,o=n;"todosFiltered"===e&&performance.mark("todo-generate-node-actions");var i=t.nodeManager.stateNodes[e],a=t.stateArrayMaps[e],l=t.nodeManager.conditionallyRenderingElements[e];if(i&&i.forEach((function(e){!function(t,e,n){e.nodeType===Node.ATTRIBUTE_NODE?t.addNodeAction(e,{actionType:"setAttribute",actionValue:n}):e.nodeType===Node.TEXT_NODE&&t.addNodeAction(e,{actionType:"textContent",actionValue:n})}(t.nodeManager,e,o)})),a){var u=o;a.forEach((function(e,n){!function(t,e,n,r){var o=null,i=!1,a=N(n),l=new Map,u=(n.getAttribute&&n.getAttribute("ref")||n.refName||n.tagName,t.map((function(t){return Object.hasOwn(t,"state")?t.state:t})));if(t.isNewArray){if(t.length){var c;i=!0;var s=pt(t,e,a?"li":void 0,o=n.detach());o.innerHTML="",(c=o).append.apply(c,W(s))}}else if(t.lastOperation){i=!0,o||(o=n.detach());var f=o.children,p=B(t.lastOperation,2),h=p[0],d=p[1];switch(h){case"shift":o.removeChild(o.firstElementChild);break;case"unshift":for(var y=d[0]-1;y>=0;y--){var v,b=t[y],m=null===(v=o.keyMap)||void 0===v?void 0:v.get(b.key);if(m){var g=o.firstElementChild;m!==g&&o.insertBefore(m,g)}else{var w=ft(b,e,a?"li":void 0,o);w.stateKey=b.key,o.prepend(w)}}break;case"pop":o.removeChild(o.lastElementChild);break;case"push":for(var S=f.length,O=t.length;S<O;S++){var E=t[S],A=ft(E,e,a?"li":void 0,o);A.stateKey=E.key,o.appendChild(A)}break;case"splice":var M,T,j=f.length,P=null!==(M=d[0])&&void 0!==M?M:0,_=d[1],k=P<0?Math.max(j+P,0):Math.min(P,j);T=void 0===_||_===1/0?j-k:_<0?0:Math.min(_,j-k);var C=d[2]||[],L=t.length;if(0===C.length&&j===L)break;if(0===k&&T>=j&&C.length===L&&j===L)break;for(var R=0;R<T;R++)o.removeChild(f[k]);var I,D=z(C);try{for(D.s();!(I=D.n()).done;){var x,$=ft(I.value,e,a?"li":void 0,o),H=null!==(x=f[k])&&void 0!==x?x:null;o.insertBefore($,H),k++}}catch(t){D.e(t)}finally{D.f()}}}else{for(var F,K=null==n?void 0:n.keyMap,G=null!==(F=o)&&void 0!==F?F:n,U=0;U<u.length;U++){var q,V,X=u[U],Y=null==X?void 0:X.key,Q=G.children[U];if(!Q)break;var J=a?null===(q=Q.firstElementChild)||void 0===q?void 0:q.state:Q.state,Z=J?J.key:Q.stateKey;if(Z!==Y){i=!0,o||(o=n.detach());var tt=null!==(V=l.get(Y))&&void 0!==V?V:K.get(Y);if(tt){var et,nt=o.replaceChildWith(Q,tt);if(l.set(Z,nt),(a?null===(et=tt.firstElementChild)||void 0===et?void 0:et.state:tt.state)!==X){var rt=ft(X,e,a?"li":void 0,o);rt.stateKey=Y,o.replaceChildWith(tt,rt)}}else{var ot=ft(X,e,a?"li":void 0,o);ot.stateKey=Y,o.replaceChildWith(Q,ot)}}else if(J!==X){i=!0,o||(o=n.detach());var it=ft(X,e,a?"li":void 0,o);it.stateKey=Y,o.replaceChildWith(Q,it)}}for(;(null!==(at=o)&&void 0!==at?at:n).children.length>u.length;){var at,lt;i=!0,o||(o=n.detach()),o.removeChild((null!==(lt=o)&&void 0!==lt?lt:n).lastElementChild)}}var ut=o?o.children.length:n.children.length;if(t.length>ut){i=!0,o||(o=n.detach());for(var ct=o.children.length;ct<t.length;ct++){var st,ht=t[ct];if(null===(st=o.keyMap)||void 0===st||!st.has(ht.key)){var dt=void 0;(dt=l.has(ht.key)?l.get(ht.key):ft(ht,e,a?"li":void 0,o)).stateKey=ht.key,o.appendChild(dt)}}}i&&r.nodeManager.addNodeAction(o,{actionType:"reattach",actionValue:!0})}(u,e,n,t)}))}l&&l.forEach((function(t){K(r,t.render.bind(r))})),"pending"===t.nodeManager.paintStatus&&t.nodeManager.queuePaint()}function J(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];Object.defineProperty(t,e,{value:n,configurable:!1,writable:!0,enumerable:r})}function Z(t,e,n){var r=e.substring(1),o=this.getAttributeNode(t);o.nodeValue=n.getAttribute(r),o.isPropAttribute=!0,n.propAttributes.has(r)||n.propAttributes.set(r,new Set),n.propAttributes.get(r).add(o)}function tt(t){if(0===t.indexOf("@"))return["property",[t.substring(1)]];if(0===t.indexOf("!"))return["negation",[t.substring(1)]];for(var e,n=0,r=t[n];n++<t.length;){if(e=t[n],3==n&&"is_"==r)return["equality",t.substring(3).split(":")];if("?"===e)return["ternary",r,t.substring(n+1).split(":")];r+=e}return["literal",[t]]}function et(t){return""===t||null!==t&&t}function nt(t,e){return lt(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,e)||it(t,e)||ot()}function rt(t){return lt(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||it(t)||ot()}function ot(){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 it(t,e){if(t){if("string"==typeof t)return at(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?at(t,e):void 0}}function at(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function lt(t){if(Array.isArray(t))return t}"undefined"==typeof HTMLElement||Object.defineProperty(globalThis,"elementSetAttribute",{value:HTMLElement.prototype.setAttribute,writable:!1,configurable:!1});var ut=function(t,e){var n;n=t,s.has(n)?"false"===e?this.removeAttribute(t):elementSetAttribute.call(this,t,""):elementSetAttribute.call(this,t,e)},ct=function(t,e){var n=rt(tt(e)),r=n[0],o=n.slice(1),i=o[0],a=nt(this.getState(i,!0),2),l=a[0],u=a[1];var c=u._stateManager,s="literal"===r?l:c.bindStatePropExpression(e,r,o);this.removeAttribute(t);var f=document.createAttribute(t);f.nodeValue=s,J(f,"isStateAttribute",!0),J(f,"originalOwnerElement",this),"boolean"==typeof s&&(f.nodeValue=""),c.addStateNode(e,f),!1!==s&&this.setAttributeNode(f),this.addEventListener("disconnected",(function(){u._stateManager.removeStateNode(e,f)}),{once:!0})},st=function(t){var e=rt(tt(t)),n=e[0],r=e.slice(1),o=r[0],i=nt(this.getState(o,!0),2),a=i[0],l=i[1];var u=l._stateManager,c="literal"===n?a:u.bindStatePropExpression(t,n,r),s=document.createTextNode(c);J(s,"isStateAttribute",!0),l._stateManager.addStateNode(t,s),this.appendChild(s),this.addEventListener("disconnected",(function(){l._stateManager.removeStateNode(t,s)}),{once:!0})};function ft(t,e,n,r){var o,i=document.createElement(e);return i.setInitialState(t),i.ownerMapElement=r,n?(o=document.createElement(n)).appendChild(i):o=i,t.hasOwnProperty("key")&&!o.hasOwnProperty("stateKey")&&(o.stateKey=t.key),o}function pt(t,e,n,r){return t.map((function(t,o){Object.hasOwn(t,"state")&&(t=t.state);var i=ft(t,e,n,r);return i.stateKey=t.key,i}))}function ht(t,e,n){var r;if(!dt(e)){var o=null!=n?n:t.state[e],i=Object.getOwnPropertyDescriptor(t.state,e);null==i||null===(r=i.get)||void 0===r||r.isStateGetter;!function(t,e,n){var r=new CustomEvent("stateChange",{bubbles:!1,composed:!1,detail:{property:e,newValue:n}});t.dispatchEvent(r)}(t.state,e,o),Q(t,e,o),e.startsWith("!")||Q(t,"!".concat(e),!o)}}function dt(t){return h.has(t)}function yt(t){return 0===t.indexOf("set_")}function vt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,e)||mt(t,e)||function(){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 bt(t){return function(t){if(Array.isArray(t))return gt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||mt(t)||function(){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 mt(t,e){if(t){if("string"==typeof t)return gt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gt(t,e):void 0}}function gt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function wt(t){return wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wt(t)}function St(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,_t(r.key),r)}}function Ot(t,e){if(e&&("object"==wt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Et(){return Et="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=jt(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Et.apply(null,arguments)}function At(t){var e="function"==typeof Map?new Map:void 0;return At=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(Mt())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&Tt(o,n.prototype),o}(t,arguments,jt(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Tt(n,t)},At(t)}function Mt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Mt=function(){return!!t})()}function Tt(t,e){return Tt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Tt(t,e)}function jt(t){return jt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},jt(t)}function Pt(t,e,n){return(e=_t(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _t(t){var e=function(t,e){if("object"!=wt(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=wt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==wt(e)?e:e+""}var kt=function(t){function e(t,n,r){var o,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:window,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);i.SPROUT_CONFIG.stateManagerClass;if(!Array.isArray(t))throw Error("Argument for StateFulArray constructor must be an array!");var l,u,c,s=t,f=s.map((function(t,e){var o=t;return Object.hasOwn(t,"state")||Object.hasOwn(t,"_stateManager")||Array.isArray(t)||"object"===wt(t)&&(o=zt(t,r,n._stateManager,ht,!1,i)),o}));return l=this,u=e,c=bt(f),u=jt(u),Pt(o=Ot(l,Mt()?Reflect.construct(u,c||[],jt(l).constructor):u.apply(l,c)),"arrayMaps",{}),o.parentStateObject=n,o.arrayStateProp=r,o.appScope=i,o.rawArray=s,a&&o.makeStateMap(),J(f=new Proxy(o,Dt(null==n?void 0:n._stateManager,r,i)),"_isStatefulArray",!0),o.statefulArray=f,Ot(o,f)}return function(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&&Tt(t,e)}(e,t),n=e,r=[{key:Symbol.iterator,value:function(){return Et(jt(e.prototype),Symbol.iterator,this).call(this)}},{key:"runArrayOperation",value:function(t,e,n){switch(t){case"shift":return this.lastOperation=["shift"],[e.apply(this,n),!1];case"unshift":return this.lastOperation=["unshift",[n.length]],[e.apply(this,n),!1];case"pop":return this.lastOperation=["pop"],[e.apply(this),!1];case"push":return this.lastOperation=["push",[n.length]],[e.apply(this,n),!1];case"splice":var r=vt(n,2),o=r[0],i=r[1],a=n.slice(2);return this.lastOperation=["splice",[o,i,a]],[e.apply(this,n),!1];default:this.lastOperation=void 0;var l=e.apply(this,n);return[l,Array.isArray(l)]}}},{key:"doArrayOperation",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.$$operation=t;var o,i=this.length,a=!1;if(O.has(t)){var l=n[0];if(this.length&&Object.hasOwn(this.arrayMaps,t)&&this.arrayMaps[t].has(l)){var u=this.arrayMaps[t].get(l);if(this.lastDirtyTimestamp>u.timestamp){var c=vt(this.runArrayOperation(t,Et(jt(e.prototype),t,this),n),2);o=c[0],a=c[1],this.arrayMaps[t].set(l,{lastResult:o,timestamp:(new Date).getTime()})}else o=u.lastResult}else{var s=vt(this.runArrayOperation(t,Et(jt(e.prototype),t,this),n),2);o=s[0],a=s[1],Object.hasOwn(this.arrayMaps,t)||(this.arrayMaps[t]=new Map,this.arrayMaps[t].set(l,{lastResult:o,timestamp:(new Date).getTime()}))}}else{var f=vt(this.runArrayOperation(t,Et(jt(e.prototype),t,this),n),2);o=f[0],a=f[1]}var p=this.length,h=w.has(t)||"splice"===t&&p===i;return r&&h&&this.parentStateObject._stateManager.setDirtyProp("".concat(this.arrayStateProp,".length"),!0),delete this.$$operation,r&&this.parentStateObject._stateManager.setDirtyProp(this.arrayStateProp),[o,a]}},{key:"mapStateKeys",value:function(){var t=this;this.forEach((function(e){var n=Object.hasOwn(e,"state")?e.state:e;t.keyMap.set(n.key,n)}))}},{key:"makeStateMap",value:function(){this._isStateMap=!0,this.keyMap=new Map,this.mapStateKeys()}}],o=[{key:Symbol.species,get:function(){return Array}}],r&&St(n.prototype,r),o&&St(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(At(Array));function Nt(t){return Nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nt(t)}function Ct(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Lt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lt(t,e):void 0}}(t,e)||function(){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 Lt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}Pt(kt,"functions",new u(["constructor","statifyArray","addDirtyIndex","doArrayOperation","runArrayOperation","makeStateMap","mapStateKeys","toArray"]));var Rt=function(){return{get:function(t,e,n){var r;if(dt(e)||0===e.indexOf("$$"))return Reflect.get.apply(Reflect,arguments);var o=Object.getOwnPropertyDescriptor(t,e);return null!=o&&null!==(r=o.get)&&void 0!==r&&r.isStateGetter||(Object.hasOwn(t.$$accessCount,e)?t.$$accessCount[e]++:t.$$accessCount[e]=1),Reflect.get.apply(Reflect,arguments)}}},It=function(t,e){arguments.length>2&&void 0!==arguments[2]||window,t.state;return{apply:function(n,r,o){t.clearStateDependencies(e);var i=r._global,a=Ct(Yt(n,r),3),l=a[0],u=a[1],c=a[2];return l.forEach((function(n){t.addStateDependency(n,e)})),null==u||u.forEach((function(n){i._stateManager.addGlobalStateDependency(n,e,t)})),c}}},Dt=function(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window,o=function(){var n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&t.setDirtyProp(e,!0),n&&t.setDirtyProp("".concat(e,".length"),!0)},i=function(t){var e;if(t)return Object.hasOwn(t,"state")?null===(e=t.state)||void 0===e?void 0:e.key:t.key};return{set:function(a,l,u){if(0===l.indexOf("$$"))return Reflect.set(a,l,u);if("length"===l)return n=Reflect.set(a,l,u),a.hasDirtyItems=!0,a.hasOwnProperty("$$operation")?o(!0,!1):o(!0,!0),n;if(a[l]===u)return!0;var c;Number(l);if(!isNaN(l)){var s=Number(l),f=a[s],p=i(f);if(u=Bt(u,e,t,r),Object.hasOwn(u,"_stateManager")&&(u=u._stateManager),!a.hasOwnProperty("$$operation")){var h=!1;if(s<a.length&&(h=!0),(n=Reflect.set(a,l,u))&&a._isStateMap){void 0!==p&&a.keyMap.delete(p);var d=i(u);void 0!==d&&a.keyMap.set(d,(c=u,Object.hasOwn(c,"state")?c.state:c))}return h&&o(),n}}return Reflect.set(a,l,u)},get:function(e,n,r){if("symbol"===Nt(n))return Reflect.get.apply(Reflect,arguments);if("length"===n&&Object.hasOwn(e.parentStateObject,"$$accessCount")&&!Object.hasOwn(e,"$$operation")){var o=e.arrayStateProp;Object.hasOwn(e.parentStateObject.$$accessCount,"".concat(o,".length"))?e.parentStateObject.$$accessCount["".concat(o,".length")]++:e.parentStateObject.$$accessCount["".concat(o,".length")]=1}if(n.indexOf&&0===n.indexOf("__")){var i=n.substring(2);return Reflect.get(e,i,r)}if("function"==typeof e[n]&&!kt.functions.has(n)){var a=e.parentStateObject;if(a&&Object.hasOwn(a,"$$accessCount")){var l=String(n);if(S.has(l)){var u=e.arrayStateProp;a.$$accessCount[u]=(a.$$accessCount[u]||0)+1}}}if(!t.isInitializing&&"function"==typeof e[n]&&!kt.functions.has(n))return function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=Ct(e.doArrayOperation.call(e.statefulArray,n,r,g.has(n)),2),a=i[0];i[1];return a};var c=Number(n);if(!isNaN(c)){var s=e[c];if(void 0===s)return;return s&&Object.hasOwn(s,"state")?s.state:s}return Reflect.get.apply(Reflect,arguments)},deleteProperty:function(t,e){if(isNaN(Number(e)))return Reflect.deleteProperty(t,e);var n=t[Number(e)],r=i(n),o=Reflect.deleteProperty(t,e);return o&&t._isStateMap&&void 0!==r&&t.keyMap.delete(r),o}}};function xt(){this.conditionallyRenderingElements={},this.addConditionallyRenderingElements=function(t,e){this.nodeManager.addConditionallyRenderingElements(t,e)}}function $t(){this.stateArrayMaps={},this.addStateMap=function(t,e,n){this.stateArrayMaps.hasOwnProperty(t)||(this.stateArrayMaps[t]=new Map),this.stateArrayMaps[t].set(n,e)},this.clearStateMapsLastOperation=function(){for(var t=0,e=Object.keys(this.stateArrayMaps);t<e.length;t++){var n=e[t];delete this.state[n].lastOperation}}}function Ht(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Ft(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ft(t,e):void 0}}(t,e)||function(){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 Ft(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Kt(t){return Kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kt(t)}function Gt(t,e,n){if(qt())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&Ut(o,n.prototype),o}function Ut(t,e){return Ut=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ut(t,e)}function qt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(qt=function(){return!!t})()}function zt(t,e,n){var r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:window,o=new Ne(t,e,n,arguments.length>3&&void 0!==arguments[3]?arguments[3]:ht,arguments.length>4&&void 0!==arguments[4]&&arguments[4],r);return o.use(xt,"conditional-element"),o.use($t,"map"),o}function Bt(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:window,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return dt(e)||(Array.isArray(t)?t=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:window,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Object.hasOwn(t,"_isStatefulArray"))return t;var i=Gt(kt,[t,n,e,r,o]);return n.hasOwnProperty("".concat(e,".length"))||Object.defineProperty(n,"".concat(e,".length"),{get:function(){return this[e].length}}),i}(t,e,n.state,r,o):"object"!==Kt(t)||null===t||t.hasOwnProperty("_stateManager")||(t=zt(t,e,n,ht,!1,r).state)),t}function Wt(t,e,n){var r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:window,i="set_".concat(e),a=Ht(t,2),l=a[0],u=a[1];if("function"!=typeof l)throw Error("Setter hooks must define a function as the first item!");var c,s=n.state;if(u.deps=null!==(r=u.deps)&&void 0!==r?r:"auto",!u.init||!u.once)if("auto"===u.deps)if(u.reevaluate){var f=It(n,i,o);l=new Proxy(l,f),t[0]=l}else{var p,h,d,y=Ht(Yt(l,s),3);h=y[0],d=y[1],c=y[2],h.forEach((function(t){n.addStateDependency(t,i)})),null===(p=d)||void 0===p||p.forEach((function(t){n.addStateDependency(t,i),s._global._stateManager.addGlobalStateDependency(t,i,n)}))}else u.deps.forEach((function(t){if(0===t.indexOf("global")){var e=t.substring(t.indexOf("global.")+7);s._global.addGlobalStateDependency(i,e,n)}else n.addStateDependency(t,i)}));Object.defineProperty(s,e,{get:function(){return Object.hasOwn(s,"$$accessCount")&&(Object.hasOwn(s.$$accessCount,e)?s.$$accessCount[e]++:s.$$accessCount[e]=1),n.privateState[e]},set:function(){throw Error("Cannot directly set the state value of a result of a setter hook function!")}}),u.init&&(c||(c=l.call(s)),(u.statify||u.stateMap)&&(c=Bt(c,e,n,o,u.stateMap)),n.privateState[e]=c,n.setDirtyProp(e))}function Vt(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:window,o=n.state,i=n.privateState[e];void 0===i&&Wt(t,e,n,r);var a=Ht(t,2),l=a[0],u=a[1];if("function"!=typeof l)throw Error("Setter hooks must define a function as the first item!");var c=l.call(o),s=!1;if(void 0===c)throw Error("State Set Hook functions MUST return a value");return(u.statify||u.stateMap)&&(c=Bt(c,e,n,r,u.stateMap)),c!==i&&(n.privateState[e]=c,s=!0),u.once&&delete o["set_".concat(e)],s}function Xt(t){var e;for(var n in t)-1!==(e=n.indexOf(".length"))&&t[n.substring(0,e)]--;return new Set(Object.keys(t).filter((function(e){return t[e]>0})))}function Yt(t,e){var n=!1,r=new Proxy(e,Rt());r.$$accessCount={},Object.hasOwn(r,"_global")&&r._global!==y&&(n=!0,r._global=new Proxy(r._global,Rt),r._global.$$accessCount={});var o=t.call(r),i=Xt(r.$$accessCount);delete r.$$accessCount;var a=null;return n&&(a=Xt(r._global.$$accessCount),delete r._global.$$accessCount),[i,a,o]}function Qt(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window,r=t.state,o=Object.getOwnPropertyDescriptors(e),i=function(e){var i=o[e];if(dt(e))return Object.defineProperty(r,e,i),1;var a=function(t,e){if(t.get&&"function"==typeof t.get)return{nativeGetter:!0,func:t.get,deps:"auto",reevaluate:!1,init:!1,isSetter:!1};if(t.value){var n=t.value;if(0===e.indexOf("set_")){if(!Array.isArray(n))throw Error("State setter hooks must be arrays!");var r=n[1]||{};return{nativeGetter:!1,func:n[0],deps:r.deps&&Array.isArray(r.deps)?r.deps:"auto",reevaluate:!!r.reevaluate,init:!!r.init,once:!!r.once,stateMap:!!r.stateMap,statify:!!r.statify,isSetter:0===e.indexOf("set_")}}}}(i,e);if(a){var l=a.isSetter?e.substring(4):e;if(a.func.bind(r),a.isSetter&&!a.nativeGetter)Wt(i.value,l,t,n),a.once&&(i.configurable=!0),Object.defineProperty(r,e,i);else if(a.nativeGetter){i.get.isStateGetter=!0;var u=Ht(Yt(i.get,r),2),c=u[0],s=u[1];c.forEach((function(n){t.addStateDependency(n,e)})),null==s||s.forEach((function(n){t.addStateDependency(n,e),r._global._stateManager.addGlobalStateDependency(n,e,t)})),i.get.bind(r),Object.defineProperty(r,l,i)}}else if(i.hasOwnProperty("value")){var f=e,p=Bt(i.value,f,t,n);t.privateState.hasOwnProperty(f)||(t.privateState[f]=p),Object.defineProperty(r,f,{set:function(e){e!==t.privateState[f]&&(e=Bt(e,f,t,n),t.privateState[f]=e,t.setDirtyProp(f),t.setDirtyProp("".concat(f,".length")))},get:function(){return t.privateState[f]}})}};for(var a in o)i(a)}function Jt(t,e,n,r){Object.defineProperty(e,t,{get:n,set:function(){throw Error("Cannot directly set a State property expression")},enumerable:!0}),e._stateManager.addStateDependency(r,t)}function Zt(t){var e=new Set,n=new Set;return t.forEach((function(t){yt(t)?n.add(t):e.add(t)})),[e,n]}function te(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,e)||oe(t,e)||function(){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 ee(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=oe(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function ne(t){return ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ne(t)}function re(t){return function(t){if(Array.isArray(t))return ie(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||oe(t)||function(){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 oe(t,e){if(t){if("string"==typeof t)return ie(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ie(t,e):void 0}}function ie(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function ae(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ce(r.key),r)}}function le(t,e,n){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,n)}function ue(t,e,n){return(e=ce(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ce(t){var e=function(t,e){if("object"!=ne(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=ne(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ne(e)?e:e+""}function se(t,e){return t.get(function(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}(t,e))}var fe=m.pendingPaintNodeManagers,pe=new WeakMap,he=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ue(this,"stateNodes",{}),ue(this,"conditionallyRenderingElements",{}),ue(this,"bindableAttributesStateNodes",new Map(re(A).map((function(t){return[t,new Map]})))),le(this,pe,new Map),ue(this,"paintStatus",null)},(e=[{key:"addStateNode",value:function(t,e){this.stateNodes.hasOwnProperty(t)||(this.stateNodes[t]=new Set),this.stateNodes[t].add(e),p.has(e.nodeName)&&this.bindableAttributesStateNodes.get(e.nodeName).set(e.originalOwnerElement,e)}},{key:"removeStateNode",value:function(t,e){var n;null===(n=this.stateNodes)||void 0===n||n[t].delete(e)}},{key:"addConditionallyRenderingElements",value:function(t,e){var n;this.conditionallyRenderingElements.hasOwnProperty(t)||(this.conditionallyRenderingElements[t]=new Set),e.originalParentElement=e.parentElement||(null===(n=e.host)||void 0===n?void 0:n.shadowRoot),this.conditionallyRenderingElements[t].add(e)}},{key:"addNodeAction",value:function(t,e){se(pe,this).has(t)||se(pe,this).set(t,Y(t.nodeType));var n=se(pe,this).get(t),r=e.actionType,o=e.actionValue;if(t.nodeType===Node.ELEMENT_NODE)switch(r){case"append":n.append.add(o);break;case"setProperty":n.setProperty(o.property,o.value);break;case"reattach":n.reattach=!0}else n[r]=o;this.paintStatus||(this.paintStatus="pending")}},{key:"queuePaint",value:function(){"pending"===this.paintStatus&&(fe.add(this),G(),this.paintStatus="queued")}},{key:"resolveToDOMActions",value:function(){var t=[],e=[],n=[],r=[],o=[];return se(pe,this).forEach((function(i,a){switch(a.nodeType){case Node.ATTRIBUTE_NODE:var l=i.setAttribute,u=ne(l);if("undefined"!==u)if("boolean"===u){if(!a.hasOwnProperty("originalOwnerElement"))throw Error("originalOwnerElement not found on boolean attribute node! Should never happen!");!1===l?a.originalOwnerElement.hasAttribute(a.name)&&t.push((function(){a.originalOwnerElement.removeAttributeNode(a)})):a.originalOwnerElement.hasAttribute(a.name)||t.push((function(){a.originalOwnerElement.setAttributeNode(a)}))}else"string"===u&&a.nodeValue!==l&&t.push((function(){return a.nodeValue=l}));break;case Node.TEXT_NODE:if(void 0!==i.textContent){var c=String(i.textContent);a.nodeValue!==c&&e.push((function(){return a.nodeValue=c}))}break;case Node.ELEMENT_NODE:var s,f=ee(i.append.values());try{var p=function(){var t=s.value;n.push((function(){return a.appendChild(t)}))};for(f.s();!(s=f.n()).done;)p()}catch(t){f.e(t)}finally{f.f()}var h,d,y=ee(i.setProperty);try{var v=function(){var t=te(h.value,2),e=t[0],n=t[1];a[e]!==n&&o.push((function(){return a[e]=n}))};for(y.s();!(h=y.n()).done;)v()}catch(t){y.e(t)}finally{y.f()}i.reattach&&(r.push((function(){return a.reattach()})),null!=a&&null!==(d=a.pendingKeyMapActions)&&void 0!==d&&d.size&&r.push((function(){var t,e=ee(a.pendingKeyMapActions);try{for(e.s();!(t=e.n()).done;)(0,t.value)()}catch(t){e.e(t)}finally{e.f()}a.pendingKeyMapActions.clear()})),i.reattach=!1)}})),se(pe,this).clear(),[t,e,o,n,r]}}])&&ae(t.prototype,e),n&&ae(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function de(t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window;return new Proxy(t,function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window;return{set:function(n,r,o){if(dt(r))return Reflect.set.apply(Reflect,arguments);var i,a=Reflect.set.apply(Reflect,arguments),l=t._stateManager;return l.parentStateManager&&(performance.mark("todo-array-set-dirty-prop"),null===(i=l.parentStateManager)||void 0===i||i.setDirtyProp(e)),a},defineProperty:function(e,r,o){return dt(r)?Reflect.defineProperty.apply(Reflect,arguments):(void 0!==(null==o?void 0:o.value)&&(o.value=Bt(o.value,r,t._stateManager,n)),Reflect.defineProperty(e,r,o))},get:function(t,e,n){var r=Reflect.get.apply(Reflect,arguments);return"function"==typeof r?r.bind(t):r}}}(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,e))}function ye(t){return ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ye(t)}function ve(t){return function(t){if(Array.isArray(t))return Se(t)}(t)||be(t)||we(t)||function(){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 be(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function me(t,e){return Oe(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,e)||we(t,e)||ge()}function ge(){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 we(t,e){if(t){if("string"==typeof t)return Se(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Se(t,e):void 0}}function Se(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Oe(t){if(Array.isArray(t))return t}function Ee(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Te(r.key),r)}}function Ae(t,e,n){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,n)}function Me(t,e,n){return(e=Te(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Te(t){var e=function(t,e){if("object"!=ye(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=ye(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ye(e)?e:e+""}function je(t,e){return t.get(function(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}(t,e))}var Pe=new Map;var _e=new WeakMap,ke=function(){return t=function t(e,n,r){var o=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ht,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:window;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Me(this,"isInitializing",!1),Me(this,"privateState",{}),Me(this,"state",new EventTarget),Me(this,"stateDependencies",new Map),Me(this,"parentStateProp",void 0),Me(this,"parentStateManager",void 0),Me(this,"dirtyProps",new Set),Me(this,"nodeManager",new he),Ae(this,_e,new Set),this.isInitializing=!0,this.parentStateProp=n,this.parentStateManager=r,this.handleStateChange=i,this.appScope=l,J(this.state,"_stateManager",this,!0),this.state.$$isInitializing=!0,this.state.populate=function(t){for(var e in t)this.hasOwnProperty(e)&&(this[e]=t[e])},n&&r&&(this.state=de(this.state,n,l)),a)this.globalStateDependencies=new Map,this.addGlobalStateDependency=function(t,e,n){o.globalStateDependencies.has(t)||o.globalStateDependencies.set(t,new Map);var r=o.globalStateDependencies.get(t);r.has(n)||r.set(n,new Set),r.get(n).add(e)};else{var u=l[d]();J(this.state,"_global",u,!0)}!function(t,e){Qt(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:window)}(this,e,l),delete this.state.$$isInitializing,J(this.state,"_isStateManager",!0),J(this.state,"_isActive",!0,!1),this.isInitializing=!1},e=[{key:"setDirtyProp",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!this.state.$$isInitializing){var n,r,o=t.indexOf(".length"),i=o>0?t.substring(0,o):t;if(!Object.hasOwn(this.state,i))throw Error("Error in setDirtyProp. State has no property: '".concat(t,"'. This should never happen"));this.dirtyProps.add(t),Array.isArray(this.state[i])&&(this.state[i].lastDirtyTimestamp=(new Date).getTime()),e&&(n=this,r=this.handleStateChanges.bind(this),Pe.set(n,r),$(Array.from(Pe.values()),"STATE_CHANGE",(function(){return Pe.clear()})))}}},{key:"handleStatePropDependencies",value:function(t){var e=this,n=this.stateDependencies,r=null==this?void 0:this.globalStateDependencies;t.forEach((function(t){!function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window,r=t.state;if(yt(e)){var o=r[e],i=e.substring(4);Vt(o,i,t,n)&&ht(t,i,null,n.offscreenContainer)}else if(e.indexOf(".length")>0){var a=e.split(".")[0];ht(t,e,t.state[a].length,n.offscreenContainer)}else ht(t,e,null,n.offscreenContainer)}(e,t,e.appScope);var o=yt(t)?t.substring(4):t;if(null!=n&&n.has(o)){var i=me(Zt(n.get(o)),2),a=i[0],l=i[1];l.size&&e.handleStatePropDependencies(l),a.size&&e.handleStatePropDependencies(a)}null!=r&&r.has(o)&&r.get(o).forEach((function(t,e){var n=me(Zt(t),2),r=n[0],o=n[1];o.size&&e.handleStatePropDependencies(o),r.size&&e.handleStatePropDependencies(r)}))}))}},{key:"isGlobalState",value:function(){return!this.state.hasOwnProperty("_global")}},{key:"topologicalSortStateProps",value:function(t){var e=this;return ve(t).toSorted((function(t,n){var r,o;return t.startsWith(n+".")?1:n.startsWith(t+".")?-1:((null===(r=e.stateDependencies[t])||void 0===r?void 0:r.size)||0)-(null===(o=e.stateDependencies[n])||void 0===o?void 0:o.size)||0}))}},{key:"handleStateChanges",value:function(){var t=this;if(this.dirtyProps.size){performance.mark("todo-topological-sort");var e=this.topologicalSortStateProps(this.dirtyProps);this.dirtyProps.clear(),this.isGlobalState();var n=new Set,r=new Set,o=new Set,i=this,a=i.state;e.forEach((function(e){var l;if(yt(e)){e=e.substring(4);var u=a[e];performance.mark("todo-call-setter-hook"),Vt(u,e,i,t.appScope)&&t.handleStateChange(i,e,null)}else t.handleStateChange(i,e,null);i.stateDependencies.has(e)&&i.stateDependencies.get(e).forEach((function(t){yt(t)?r.add(t):n.add(t)}));var c=null===(l=i.state)||void 0===l?void 0:l._global;if(c===y&&(c=t.appScope[d]()),c!==y){var s,f=(null===(s=c)||void 0===s?void 0:s._stateManager)||i;f.globalStateDependencies.has(e)&&o.add(f.globalStateDependencies.get(e))}})),r.size&&this.handleStatePropDependencies(r),n.size&&this.handleStatePropDependencies(n),o.size&&o.forEach((function(t,e){e.handleStatePropDependencies(t)})),i.clearStateMapsLastOperation(),this.parentStateManager&&this.parentStateManager.setDirtyProp(this.parentStateProp)}}},{key:"addStateDependency",value:function(t,e){this.stateDependencies.has(t)||this.stateDependencies.set(t,new Set),this.stateDependencies.get(t).add(e),Array.isArray(this.state[t])&&this.addStateDependency("".concat(t,".length"),e)}},{key:"clearStateDependencies",value:function(t){this.stateDependencies.has(t)&&this.stateDependencies.set(t,new Set)}},{key:"addStateNode",value:function(t,e){this.nodeManager.addStateNode(t,e)}},{key:"removeStateNode",value:function(t,e){this.nodeManager.removeStateNode(t,e)}},{key:"bindStatePropExpression",value:function(t,e,n){if(!e||!n){var r=tt(t),o=Oe(i=r)||be(i)||we(i)||ge();e=o[0],n=o.slice(1)}var i,a=n[0];if(!a)throw Error("Must specify state property name for State expression: ".concat(t));var l=this.state,u=Object.getOwnPropertyDescriptor(l,a);if(u||(l=l._global,u=Object.getOwnPropertyDescriptor(l,a)),!u)throw Error("Could not bind state property ".concat(a,". State property ").concat(a," not defined!"));if(Object.hasOwn(l,t))return l[t];var c=u.hasOwnProperty("value"),s=this;switch(e){case"negation":var f=c?s.privateState:s.state;Jt(t,l,(function(){return!f[a]}),a);break;case"equality":var p=n[1];if(!p)throw Error("Must specify equality value for equality expression (is_something:equalToThis)");var h=c?s.privateState:s.state;Jt(t,l,(function(){return h[a]===p}),a);break;case"ternary":var d=n[1];if(!d)throw Error("Ternary state expression (prop?truthy:falsy) must include at least a truthy value!");var y=n[2],v=c?s.privateState:s.state;Jt(t,l,y?function(){return v[a]?d:y}:function(){return v[a]?d:void 0},a)}return l[t]}},{key:"getStateDependencies",value:function(){return this.stateDependencies}},{key:"use",value:function(t,e){t.call(this),je(_e,this).add(e)}},{key:"isUsing",value:function(t){return je(_e,this).has(t)}}],e&&Ee(t.prototype,e),n&&Ee(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();const Ne=ke;function Ce(t){return Object.hasOwn(t,"state")?t:t.firstElementChild}var Le={replaceChildWith:function(t,e){var n,r,o,i=Ce(t),a=null!==(n=null==i||null===(r=i.state)||void 0===r?void 0:r.key)&&void 0!==n?n:t.stateKey,l=Ce(e),u=null!==(o=e.stateKey)&&void 0!==o?o:l.stateKey,c=this.replaceChild(e,t);return this.keyMap.delete(a),this.keyMap.set(u,e),c},swapChildWith:function(t,e){if(t!==e){var n=t.nextSiblingElement,r=e.nextSiblingElement;this.insertBefore(t,r),this.insertBefore(e,n)}},removeChild:function(t){var e,n=Ce(t),r=null!==(e=t.stateKey)&&void 0!==e?e:n.stateKey;HTMLElement.prototype.removeChild.call(this,t),this.keyMap.delete(r)},insertBefore:function(t,e){var n;HTMLElement.prototype.insertBefore.call(this,t,e);var r=Ce(t),o=null!==(n=t.stateKey)&&void 0!==n?n:r.stateKey;this.keyMap.set(o,t)},append:function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];(t=HTMLElement.prototype.append).call.apply(t,[this].concat(n));for(var o=0,i=n;o<i.length;o++){var a,l=i[o],u=Ce(l),c=null!==(a=l.stateKey)&&void 0!==a?a:u.stateKey;this.keyMap.set(c,l)}},appendChild:function(t){var e;HTMLElement.prototype.appendChild.call(this,t);var n=Ce(t),r=null!==(e=t.stateKey)&&void 0!==e?e:n.stateKey;this.keyMap.set(r,t)},prepend:function(t){var e;HTMLElement.prototype.prepend.call(this,t);var n=Ce(t),r=null!==(e=t.stateKey)&&void 0!==e?e:n.stateKey;this.keyMap.set(r,t)},detach:function(){var t;if(arguments.length>0&&void 0!==arguments[0]&&arguments[0]){var e=this.cloneNode(!0);e.$$originalElement=this,e.$$detached=j.CLONE,t=e}else this.setAttribute("inert",""),this.classList.add(M),this.$$detached=j.HIDE_UNHIDE,t=this;return t},reattach:function(){this.$$detached===j.HIDE_UNHIDE?(this.removeAttribute("inert",""),this.classList.remove(M)):this.$$detached===j.CLONE&&this.$$originalElement.replaceWith(this),this.$$detached=void 0},initialAppend:function(){for(var t,e=this,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];(t=HTMLElement.prototype.append).call.apply(t,[this].concat(r));for(var i=function(){var t=l[a];e.pendingKeyMapActions.add((function(){var n=Ce(t);if(n.isActive){var r,o,i=null!==(r=null==n||null===(o=n.state)||void 0===o?void 0:o.key)&&void 0!==r?r:t.stateKey;e.keyMap.set(i,t)}else n.addEventListener("active",(function(){var r,o,i=null!==(r=null==n||null===(o=n.state)||void 0===o?void 0:o.key)&&void 0!==r?r:t.stateKey;e.keyMap.set(i,t)}),{once:!0})}))},a=0,l=r;a<l.length;a++)i()}};function Re(t){return function(t){if(Array.isArray(t))return xe(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||De(t)||function(){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 Ie(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,e)||De(t,e)||function(){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 De(t,e){if(t){if("string"==typeof t)return xe(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xe(t,e):void 0}}function xe(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var $e={map:function(t){var e,n=Ie(t.split(":"),2),r=n[0],o=n[1],i=this;e=i,Object.assign(e,Le),e.keyMap=new Map,e.pendingKeyMapActions=new Set,e.style.willChange="opacity",this.onAfterPaint((function(){var t=function(t,e,n){var r=Ie(n.getState(t,!0),2),o=r[0],i=r[1];o.makeStateMap();var a=pt(o,e,N(n)?"li":void 0,n);return n.innerHTML="",a.length&&n.append.apply(n,Re(a)),i}(r,o,i);if(!t)throw new Error("Mapping ".concat(r," to ").concat(o," failed!"));var e=t[r];if(!e||!e.hasOwnProperty("_isStatefulArray"))throw new Error("State array ".concat(r," for State Map must be stateful!"));t._stateManager.addStateMap(r,o,i)}))},bind:function(t){var e=Ie(t.split(":"),2),n=e[0],r=e[1];this.bindAttributeToState(n,r)},bindprop:function(t){var e=Ie(t.split(":"),2),n=e[0],r=e[1],o=Ie(this.getState(n,!0),2),i=(o[0],o[1]);this[r]=i[n]}};function He(t){return He="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},He(t)}function Fe(t){return function(t){if(Array.isArray(t))return qe(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Ue(t)||function(){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 Ke(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,e)||Ue(t,e)||function(){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 Ge(){return Ge="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Ye(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Ge.apply(null,arguments)}function Ue(t,e){if(t){if("string"==typeof t)return qe(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qe(t,e):void 0}}function qe(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function ze(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Be(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,nn(r.key),r)}}function We(t,e,n){return e&&Be(t.prototype,e),n&&Be(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ve(t,e,n){return e=Ye(e),function(t,e){if(e&&("object"==He(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Xe()?Reflect.construct(e,n||[],Ye(t).constructor):e.apply(t,n))}function Xe(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Xe=function(){return!!t})()}function Ye(t){return Ye=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ye(t)}function Qe(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&&Je(t,e)}function Je(t,e){return Je=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Je(t,e)}function Ze(t,e,n){tn(t,e),e.set(t,n)}function tn(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function en(t,e,n){return(e=nn(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function nn(t){var e=function(t,e){if("object"!=He(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=He(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==He(e)?e:e+""}function rn(t,e,n){return t.set(an(t,e),n),n}function on(t,e){return t.get(an(t,e))}function an(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}function ln(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=new WeakMap,o=new WeakSet,i=new WeakMap,a=function(t){function n(){var t,e,a;return ze(this,n),t=Ve(this,n),tn(e=t,a=o),a.add(e),en(t,"host",null),Ze(t,r,!1),en(t,"refName",void 0),Ze(t,i,[]),t.isReactiveElement=!0,t.isNativeElement=!0,t}return Qe(n,t),We(n,[{key:"activate",value:function(){var t,n=this,r=[],o=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Ue(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}(this.getAttributeNames());try{for(o.s();!(t=o.n()).done;){var a=t.value,l=this.getAttribute(a);if(this.initialSetAttribute(a,l),0===a.indexOf("_")){var u=a.substring(1);r.push({command:u,args:l})}}}catch(t){o.e(t)}finally{o.f()}r.forEach((function(t){var r,o,i,a,l=t.command,u=t.args;null===(r=$e[l])||void 0===r||r.call(n,u),null===(o=e.appCommands)||void 0===o||null===(o=o[l])||void 0===o||o.call(n,u);var c=(null===(i=n.host)||void 0===i?void 0:i.commands)||n.commands;null==c||null===(a=c[l])||void 0===a||a.call(n,u)})),on(i,this).forEach((function(t){return t.call(n)})),on(i,this).length=0,this.isActive=!0}},{key:"getHost",value:function(){var t;return this.host||this.parentNode||(null==this||null===(t=this.getRootNode())||void 0===t?void 0:t.host)}},{key:"connectedCallback",value:function(){var t=this;if(!on(r,this)){var e,n=this.getRootNode();n!==document?this.host=n.host:(e=this.parentElement)&&e.isReactiveElement&&!e.isNativeElement?this.host=this.parentElement:roost.host=null,this.host?this.host.isActive?this.activate():this.host.addEventListener("active",(function(){return t.activate()}),{once:!0}):this.activate(),rn(r,this,!0)}}},{key:"disconnectedCallback",value:function(){var t,e=null!==(t=this.host)&&void 0!==t?t:this;e.ref&&delete e.ref[this.refName]}},{key:"attributeChangedCallback",value:function(t,e,n){var r=this;e!==n&&(this.isConnected?an(o,this,l).call(this,t,e,n):on(i,this).push((function(){return an(o,r,l).call(r,t,e,n)})))}},{key:"getState",value:function(t){var n,r,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.isNativeElement&&this.host?this.host:this,a=!1;if(i&&i.state&&Object.hasOwn(i.state,t)&&(a=!0,r=(n=i.state)[t]),!a)for(;!a&&i.host;)(i=i.host)&&i.state&&Object.hasOwn(i.state,t)&&(a=!0,r=(n=i.state)[t]);if(!a){var l=e[d]();l&&Object.hasOwn(l,t)&&(a=!0,r=(n=l)[t])}return a||(r=void 0),o?[r,n]:r}},{key:"findElement",value:function(t){var n=this.host||this,r=n;return e.SPROUT_CONFIG.useShadow&&(r=n.shadowRoot),Object.hasOwn(n.ref,t)?n.ref[t]:r.querySelector('[ref="'.concat(t,'"]'))}},{key:"initialSetText",value:function(t){st.call(this,t)}},{key:"initialSetAttribute",value:function(t,e){e=String(e);var n=0===e.indexOf("@"),r=function(t){return 0===t.indexOf(":")}(t),o=e;if(r){0;var i=e,a=t.substring(1);"textcontent"===a?this.initialSetText(i):ct.call(this,a,i)}else{if(n){var l=this.getHost();0;var u=e.substring(1);o=l.getAttribute(u)}"textcontent"===t?this.textContent=o:ut.call(this,t,o)}}},{key:"onAfterPaint",value:function(t){requestAnimationFrame((function(){return requestAnimationFrame(t)}))}}])}(t);function l(t,e,n){var r=this.isNativeElement?this.host||this.getRootNode().host:this;if("ref"===t){var o=n;r.ref[o]=this,this.refName=o}}if(en(a,"observedAttributes",c),n){var u=new WeakMap,s=function(t){function e(){var t;ze(this,e);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return en(t=Ve(this,e,[].concat(r)),"boundAttributesToState",new Map),Ze(t,u,void 0),t}return Qe(e,t),We(e,[{key:"bindAttributeToState",value:function(t,e){this.boundAttributesToState.set(t,e)}},{key:"updateStateFromAttribute",value:function(t){var e=et(this.getAttribute(t)),n=this.boundAttributesToState.get(t),r=Ke(this.getState(n,!0),2),o=r[0],i=r[1];if(o===Symbol.for(E.STATE_NOT_FOUND))throw Error("updateStateFromAttribute: State property ".concat(n," not found"));o!==e&&(i[n]=e)}},{key:"activate",value:function(){Ge(Ye(e.prototype),"activate",this).call(this),rn(u,this,(function(){var t=new Event("inputChange",{bubbles:!0,composed:!0});if("checkbox"===this.type){var e=this.host.state._stateManager.nodeManager.bindableAttributesStateNodes.get("checked"),n=null;e.has(this)&&(n=e.get(this)),this.checked?(n||(n=document.createAttribute("checked")),this.setAttributeNode(n)):(n||(n=this.getAttributeNode("checked")),n&&this.removeAttributeNode(n))}this.dispatchEvent(t)})),this.addEventListener("change",on(u,this),!1)}},{key:"disconnectedCallback",value:function(){Ge(Ye(e.prototype),"disconnectedCallback",this).call(this),on(u,this)&&this.removeEventListener("change",on(u,this)),this.boundAttributesToState.clear()}},{key:"attributeChangedCallback",value:function(t,n,r){if(Ge(Ye(e.prototype),"attributeChangedCallback",this).apply(this,arguments),f.has(t)){var o=et(r);this[t]!==o&&(this[t]=o)}this.boundAttributesToState.has(t)&&this.updateStateFromAttribute(t)}}])}(a);return en(s,"observedAttributes",a.observedAttributes.concat(Fe(p))),s}return a}function un(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return cn(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function cn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function sn(t){return sn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sn(t)}function fn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,wn(r.key),r)}}function pn(t,e){if(e&&("object"==sn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function hn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(hn=function(){return!!t})()}function dn(){return dn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=yn(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},dn.apply(null,arguments)}function yn(t){return yn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},yn(t)}function vn(t,e){return vn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},vn(t,e)}function bn(t,e,n){mn(t,e),e.set(t,n)}function mn(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gn(t,e,n){return(e=wn(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wn(t){var e=function(t,e){if("object"!=sn(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=sn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==sn(e)?e:e+""}function Sn(t,e){return t.get(En(t,e))}function On(t,e,n){return t.set(En(t,e),n),n}function En(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var An=new CSSStyleSheet;function Mn(t){return Mn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mn(t)}function Tn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,e)||Pn(t,e)||function(){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 jn(t){return function(t){if(Array.isArray(t))return _n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Pn(t)||function(){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 Pn(t,e){if(t){if("string"==typeof t)return _n(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_n(t,e):void 0}}function _n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function kn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,In(r.key),r)}}function Nn(t,e,n){return e=Ln(e),function(t,e){if(e&&("object"==Mn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Cn()?Reflect.construct(e,n||[],Ln(t).constructor):e.apply(t,n))}function Cn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Cn=function(){return!!t})()}function Ln(t){return Ln=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ln(t)}function Rn(t,e){return Rn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Rn(t,e)}function In(t){var e=function(t,e){if("object"!=Mn(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Mn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Mn(e)?e:e+""}function Dn(t,e,n){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,n)}function xn(t,e,n){return t.set(Hn(t,e),n),n}function $n(t,e){return t.get(Hn(t,e))}function Hn(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}function Fn(t){return Fn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fn(t)}function Kn(){Kn=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),l=new k(r||[]);return o(a,"_invoke",{value:T(t,n,l)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",h="suspendedYield",d="executing",y="completed",v={};function b(){}function m(){}function g(){}var w={};c(w,a,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(N([])));O&&O!==n&&r.call(O,a)&&(w=O);var E=g.prototype=b.prototype=Object.create(w);function A(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function M(t,e){function n(o,i,a,l){var u=f(t[o],t,i);if("throw"!==u.type){var c=u.arg,s=c.value;return s&&"object"==Fn(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,l)}),(function(t){n("throw",t,a,l)})):e.resolve(s).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,l)}))}l(u.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function T(e,n,r){var o=p;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var l=r.delegate;if(l){var u=j(l,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=d;var c=f(e,n,r);if("normal"===c.type){if(o=r.done?y:h,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=y,r.method="throw",r.arg=c.arg)}}}function j(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,j(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function N(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Fn(e)+" is not iterable")}return m.prototype=g,o(E,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=c(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,u,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},A(M.prototype),c(M.prototype,l,(function(){return this})),e.AsyncIterator=M,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new M(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},A(E),c(E,u,"Generator"),c(E,a,(function(){return this})),c(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=N,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(_),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return l.type="throw",l.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),_(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;_(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:N(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function Gn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,qn(r.key),r)}}function Un(t,e,n){return e&&Gn(t.prototype,e),n&&Gn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function qn(t){var e=function(t,e){if("object"!=Fn(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Fn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Fn(e)?e:e+""}function zn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Bn(t,e,n){return e=Vn(e),function(t,e){if(e&&("object"==Fn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Wn()?Reflect.construct(e,n||[],Vn(t).constructor):e.apply(t,n))}function Wn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Wn=function(){return!!t})()}function Vn(t){return Vn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Vn(t)}function Xn(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&&Yn(t,e)}function Yn(t,e){return Yn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Yn(t,e)}function Qn(t,e,n,r,o,i,a){try{var l=t[i](a),u=l.value}catch(t){return void n(t)}l.done?e(u):Promise.resolve(u).then(r,o)}function Jn(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Qn(i,r,o,a,l,"next",t)}function l(t){Qn(i,r,o,a,l,"throw",t)}a(void 0)}))}}function Zn(t){return Zn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zn(t)}function tr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,er(r.key),r)}}function er(t){var e=function(t,e){if("object"!=Zn(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Zn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Zn(e)?e:e+""}function nr(t,e,n){return e=or(e),function(t,e){if(e&&("object"==Zn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,rr()?Reflect.construct(e,n||[],or(t).constructor):e.apply(t,n))}function rr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(rr=function(){return!!t})()}function or(t){return or=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},or(t)}function ir(t,e){return ir=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ir(t,e)}function ar(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}An.replaceSync(":host { contain: layout paint; }");var lr=document.currentScript,ur=(null==lr?void 0:lr.hasAttribute("strict"))||!1,cr=Ne,sr={useShadow:!0,allowAppScopeAccess:!0,useDSD:!1,strict:ur,appName:(null==lr?void 0:lr.getAttribute("app"))||"sprout-app",stateManagerClass:cr};sr.allowAppScopeAccess&&Object.defineProperty(globalThis,"sproutApps",{value:{},writable:!1});var fr,pr=new CSSStyleSheet;pr.replaceSync(T),document.adoptedStyleSheets=[].concat(function(t){if(Array.isArray(t))return ar(t)}(fr=document.adoptedStyleSheets)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(fr)||function(t,e){if(t){if("string"==typeof t)return ar(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ar(t,e):void 0}}(fr)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[pr]);var hr,dr=(window,{window,document:null===(hr=window)||void 0===hr?void 0:hr.document});sr.allowAppScopeAccess&&Object.defineProperty(globalThis.sproutApps,sr.appName,{value:dr,writable:!1}),dr.SPROUT_CONFIG=Object.seal(sr);var yr=Object.prototype.hasOwnProperty;J(Object.prototype,"hasOwnProperty",yr),dr[d]=function(){return y},dr.setGlobalState=function(){var t=zt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},void 0,void 0,ht,!0,dr).state,e="SproutGlobalState";return Object.defineProperty(dr,e,{value:t,writable:!1,configurable:!1}),Object.defineProperty(dr,d,{value:function(){return dr[e]}}),dr[e]},dr.setCommands=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.defineProperty(dr,"appCommands",{value:t,writable:!1,configurable:!1})};var vr={};v.forEach((function(t){return vr[t.element]=ln(t.class,dr,!0)})),dr.ReactiveCustomElement=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window,e=ln(HTMLElement,t),n=(t.SPROUT_CONFIG.stateManagerClass,new WeakMap),r=new WeakMap,o=new WeakMap,i=new WeakMap,a=new WeakMap,l=new WeakMap,u=new WeakMap,c=new WeakMap,s=new WeakSet,f=function(e){function f(){var t,e,h,d,v=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,m=arguments.length>1?arguments[1]:void 0,g=arguments.length>2?arguments[2]:void 0,w=arguments.length>3?arguments[3]:void 0,S=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,f),e=this,h=yn(h=f),function(t,e){mn(t,e),e.add(t)}(t=pn(e,hn()?Reflect.construct(h,d||[],yn(e).constructor):h.apply(e,d)),s),gn(t,"ownerMapElement",void 0),gn(t,"state",void 0),gn(t,"stateKey",void 0),bn(t,n,!1),bn(t,r,{init:null,mount:null,stateful:null,active:null,unmount:null}),bn(t,o,void 0),bn(t,i,void 0),bn(t,a,void 0),gn(t,"events",void 0),gn(t,"eventsMap",new Map),bn(t,l,void 0),gn(t,"propAttributes",new Map),bn(t,u,!1),bn(t,c,void 0),gn(t,"commands",void 0),gn(t,"ref",{}),gn(t,"canonicalTagName",void 0),"CONDITIONAL-ELEMENT"===t.tagName)return pn(t);if(t.isNativeElement=!1,On(u,t,S),w&&On(a,t,w),t.canonicalTagName=t.localName,Sn(u,t))t.canonicalTagName=t.localName.substring(0,t.localName.indexOf("-dsd"));else{if(g){var O=new CSSStyleSheet;O.replaceSync(g),On(i,t,O)}On(o,t,v?document.importNode(v,!0):document.importNode(b,!0)),En(s,t,y).call(t)}return m&&En(s,t,p).call(t,m),Sn(r,t).init&&Sn(r,t).init.call(t),t}return function(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&&vn(t,e)}(f,e),d=f,(g=[{key:"setInitialState",value:function(t){this.initialState?Object.assign(this.initialState,t):this.initialState=t,t.hasOwnProperty("key")&&(this.stateKey=t.key)}},{key:"disconnectedCallback",value:function(){En(s,this,v).call(this),this.state=void 0,this.isActive=!1,Sn(r,this).unmount&&Sn(r,this).unmount.call(this)}},{key:"activate",value:function(){dn(yn(f.prototype),"activate",this).call(this),En(s,this,m).call(this),Sn(r,this).active&&Sn(r,this).active.call(this)}},{key:"findElement",value:function(e){var n,r,o=this,i=this;return t.SPROUT_CONFIG.useShadow&&(i=o.shadowRoot),Object.hasOwn(o.ref,e)?o.ref[e]:(null===(n=i)||void 0===n||null===(r=n.querySelector)||void 0===r?void 0:r.call(n,'[ref="'.concat(e,'"]')))||null}},{key:"connectedCallback",value:function(){var t=this;if(this.setAttribute("tagName",this.canonicalTagName),!Sn(n,this)){var e=this.getRootNode().host;Sn(r,this).mount&&Sn(r,this).mount.call(this);var o=function(){En(s,t,h).call(t),t.isActive=!0,t.dispatchEvent(new CustomEvent("active")),Sn(r,t).stateful&&Sn(r,t).stateful.call(t),t.activate()};e?e.isActive?o():e.addEventListener("active",o,{once:!0}):setTimeout(o,0),On(n,this,!0)}}},{key:"attributeChangedCallback",value:function(t,e,n){e!==n&&("hidden"===t&&(null===n?this.dispatchEvent(new CustomEvent("unhide",{bubbles:!0})):this.dispatchEvent(new CustomEvent("hide",{bubbles:!0}))),this.propAttributes.has(t)&&this.propAttributes.get(t).forEach((function(t){t.nodeValue=n,"CONDITIONAL-RENDER"===t.ownerElement.tagName&&t.ownerElement.render()})))}}])&&fn(d.prototype,g),w&&fn(d,w),Object.defineProperty(d,"prototype",{writable:!1}),d;var d,g,w}(e);function p(t){var e=this;if(On(c,this,t.settings),this.commands=t.commands,t.events){var o,i,a=function(t,n,r){e.eventsMap.has(t)||e.eventsMap.set(t,new Map),e.eventsMap.get(t).set(n,r)};for(var l in t.events)if("function"===(i=sn(o=t.events[l])))a("click",l,o);else if("object"===i)for(var u in o)a(u,l,o[u]);this.isConnected&&En(s,this,m).call(this)}for(var f in t.state&&(this.setInitialState(t.state),this.isConnected&&Sn(n,this)&&!this.state&&En(s,this,h).call(this)),Sn(r,this))t.hasOwnProperty(f)&&(Sn(r,this)[f]=t[f])}function h(){var e;if(this.initialState&&(null===(e=this.state)||void 0===e||!e._isActive)){var n=this.initialState;if(n._stateManager)this.state=n._stateManager.state;else{var r=zt(n,void 0,void 0,ht,!1,t);this.state=r.state,this.state.$host=this}this.state._isActive=!0}}function y(){if(t.SPROUT_CONFIG.useShadow)this.attachShadow({mode:"open",delegatesFocus:!0}),this.shadowRoot.adoptedStyleSheets=[An],Sn(a,this)&&this.shadowRoot.adoptedStyleSheets.push(Sn(a,this)),Sn(i,this)&&this.shadowRoot.adoptedStyleSheets.push(Sn(i,this)),this.shadowRoot.appendChild(Sn(o,this));else{var e=new DocumentFragment;e.appendChild(Sn(o,this)),this.appendChild(e)}}function v(){if(this.eventsMap.size){var t,e=un(this.eventsMap.keys());try{for(e.s();!(t=e.n()).done;){var n=t.value;this.shadowRoot.removeEventListener(n,Sn(l,this),!1)}}catch(t){e.e(t)}finally{e.f()}}}function m(){if(!Sn(l,this)&&this.eventsMap.size){var e=t[d]();On(l,this,(function(t){var n=this.host,r=n.eventsMap.get(t.type);if(!r)return!1;var o,i=un(t.composedPath());try{for(i.s();!(o=i.n()).done;){var a=o.value;if(a&&a.refName&&r.has(a.refName)){var l=a,u=l.refName;r.get(u).call(l,t,n,e)}}}catch(t){i.e(t)}finally{i.f()}t.stopPropagation()}));var n,r=un(this.eventsMap.keys());try{for(r.s();!(n=r.n()).done;){var o=n.value;this.shadowRoot.addEventListener(o,Sn(l,this),{capture:!0})}}catch(t){r.e(t)}finally{r.f()}}}return f}(dr),function(t,e){function n(){return(n=Jn(Kn().mark((function e(n,r,o){var i,a,l,u,c;return Kn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=n.content,(a=i.querySelector("style"))&&i.removeChild(a),(u=i.querySelector("script"))&&(c=u.textContent,i.removeChild(u),c&&0!==c.trim().length))try{l=Function(c)()}catch(t){}customElements.define(r,function(t){function e(){var t;return zn(this,e),Bn(this,e,[i,l,null===(t=a)||void 0===t?void 0:t.textContent,o])}return Xn(e,t),Un(e)}(t.ReactiveCustomElement)),customElements.define("".concat(r,"-dsd"),function(t){function e(){return zn(this,e),Bn(this,e,[i,l,null,o,!0])}return Xn(e,t),Un(e)}(t.ReactiveCustomElement));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var r,o;r=new CSSStyleSheet,(o=document.querySelector('head > style[app="'.concat(e,'"]')))?r.replaceSync(o.textContent):r.replaceSync(""),r.insertRule(T),"function"==typeof globalThis["".concat(e,"_runtime")]&&globalThis["".concat(e,"_runtime")].call(t),Array.prototype.forEach.call(document.querySelectorAll('template[app="'.concat(e,'"]')),(function(t){var e=t.getAttribute("for");e&&function(t,e,r){n.apply(this,arguments)}(t,e,r)}))}(dr,sr.appName),v.forEach((function(t){customElements.define("reactive-".concat(t.element),vr[t.element],{extends:t.element})}));var br=ln(HTMLHeadingElement,dr);["h1","h2","h3","h4","h5","h6"].forEach((function(t){customElements.define("reactive-".concat(t),function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),nr(this,e,arguments)}return function(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&&ir(t,e)}(e,t),function(t,e,n){return e&&tr(t.prototype,e),n&&tr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(e)}(br),{extends:t})}));var mr=ln(HTMLInputElement,dr,!0);customElements.define("reactive-input",mr,{extends:"input"});var gr=function(t){var e,n,r,o=new WeakMap,i=new WeakMap,a=new WeakMap,l=function(t){function e(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var n=arguments.length,r=new Array(n),l=0;l<n;l++)r[l]=arguments[l];return Dn(t=Nn(this,e,[].concat(r)),o,void 0),Dn(t,i,void 0),Dn(t,a,void 0),t}return function(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&&Rn(t,e)}(e,t),n=e,r=[{key:"render",value:function(){var t,e=this,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if($n(o,this)){if(void 0===(t=this.getState($n(i,this))))throw Error("State value for ".concat($n(i,this)," not found while rendering conditional-render element:"),this)}else if(void 0===(t=this.getAttribute("_condition")))throw Error("_condition value not found while rendering conditional-render element:",this);var r=[];$n(a,this).forEach((function(e){var n=e.condition,o=e.elements;(function(t,e,n){if("always"===t)return!0;switch(t){case"==":default:return n==e;case"===":return n===e;case"!=":return n!=e;case"!==":return n!==e;case"<":return n<e;case"<=":return n<=e;case">":return n>e;case">=":return n>=e}})(n.operator,n.value,t)&&r.push.apply(r,jn(o))})),n?(this.innerHTML="",this.append.apply(this,r)):r.length&&K(this,(function(){e.innerHTML="",e.append.apply(e,r)}))}},{key:"generateRenderMap",value:function(){var t=new Map;t.set("always",[]),jn(this.children).forEach((function(e){var n,r,o=e.getAttribute("_if").replaceAll(" ","");if(o)if(t.has(o))t.get(o).elements.push(e);else{var i=Tn(cond.trim().split(CONDITIONAL_OPERATORS_REGEX),3),a=i[1],l=i[2],u={operator:a,value:(r=n=l,"true"===n?r=!0:"false"===n?r=!1:isNaN(Number(n))||(r=Number(n)),r)};t.set(o,{condition:u,elements:[e]})}else t.get("always").elements.push(e)})),xn(a,this,t)}},{key:"activate",value:function(){var t=this.getAttribute("_condition");if(!t)throw Error("conditional-render elements must have a _condition attribute!");if(0===t.indexOf("@")?(Z.call(this,"_condition",t),xn(o,this,!1),xn(i,this,t.substring(1))):(xn(o,this,!0),xn(i,this,t)),$n(o,this)){var e=$n(i,this),n=Tn(this.getState(e,!0),2),r=n[0],a=n[1];if(void 0===Mn(r))throw Error("State property ".concat(e," not defined for _condition command!"));var l=a._stateManager;l.has("conditional-element")||l.use(xt,"conditional-element"),l.addConditionallyRenderingElements(e,this),this.generateRenderMap(),this.render(!0)}else this.render(!0)}}],r&&kn(n.prototype,r),l&&kn(n,l),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,l}(t);return e=l,r=["_condition"],(n=In(n="observedAttributes"))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,l}(ln(HTMLElement,dr));customElements.define("conditional-render",gr)})();
1
+ (()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,n(o.key),o)}}function n(e){var n=function(e,n){if("object"!=t(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,n||"default");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==t(n)?n:n+""}function r(e,n,r){return n=l(n),function(e,n){if(n&&("object"==t(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(e)}(e,i()?Reflect.construct(n,r||[],l(e).constructor):n.apply(e,r))}function o(t){var e="function"==typeof Map?new Map:void 0;return o=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(i())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&a(o,n.prototype),o}(t,arguments,l(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),a(n,t)},o(t)}function i(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(i=function(){return!!t})()}function a(t,e){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},a(t,e)}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},l(t)}var u=function(t){function n(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),(e=r(this,n,[t])).add=function(){return n.unavailableMethod("add")},e}return function(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&&a(t,e)}(n,t),o=n,l=[{key:"unavailableMethod",value:function(t){throw Error("Can't use ".concat(t," in ReadonlySet"))}}],(i=[{key:"delete",value:function(){n.unavailableMethod("delete")}},{key:"clear",value:function(){n.unavailableMethod("clear")}}])&&e(o.prototype,i),l&&e(o,l),Object.defineProperty(o,"prototype",{writable:!1}),o;var o,i,l}(o(Set)),s=["ref","hidden"],c=new u(["hidden","checked","disabled","required","selected"]),f=new u(["checked","disabled","selected","src"]),p=new u(["value","checked"]),h=new u(["$host","_global","_stateManager","_isActive","_isStateManager","populate","hasOwnProperty"]),d="getGlobalState",y="Global State Not Set Yet",v=(Object.freeze({NO_DEPENDENCIES_ARRAY_IN_SET_HOOK:function(t){return"State set hook, must include a dependencies array! None was found for ".concat(t)}}),Object.freeze([{class:HTMLAnchorElement,element:"a"},{class:HTMLAreaElement,element:"area"},{class:HTMLAudioElement,element:"audio"},{class:HTMLBodyElement,element:"body"},{class:HTMLBRElement,element:"br"},{class:HTMLButtonElement,element:"button"},{class:HTMLCanvasElement,element:"canvas"},{class:HTMLDataElement,element:"data"},{class:HTMLDataListElement,element:"datalist"},{class:HTMLDetailsElement,element:"details"},{class:HTMLDialogElement,element:"dialog"},{class:HTMLDivElement,element:"div"},{class:HTMLDListElement,element:"dl"},{class:HTMLEmbedElement,element:"embed"},{class:HTMLFieldSetElement,element:"fieldset"},{class:HTMLFormElement,element:"form"},{class:HTMLHRElement,element:"hr"},{class:HTMLHtmlElement,element:"html"},{class:HTMLIFrameElement,element:"iframe"},{class:HTMLImageElement,element:"img"},{class:HTMLLabelElement,element:"label"},{class:HTMLLegendElement,element:"legend"},{class:HTMLLIElement,element:"li"},{class:HTMLLinkElement,element:"link"},{class:HTMLMapElement,element:"map"},{class:HTMLMetaElement,element:"meta"},{class:HTMLMeterElement,element:"meter"},{class:HTMLObjectElement,element:"object"},{class:HTMLOListElement,element:"ol"},{class:HTMLOptGroupElement,element:"optgroup"},{class:HTMLOptionElement,element:"option"},{class:HTMLParagraphElement,element:"p"},{class:HTMLPictureElement,element:"picture"},{class:HTMLPreElement,element:"pre"},{class:HTMLProgressElement,element:"progress"},{class:HTMLQuoteElement,element:"blockquote"},{class:HTMLQuoteElement,element:"q"},{class:HTMLSelectElement,element:"select"},{class:HTMLSourceElement,element:"source"},{class:HTMLSpanElement,element:"span"},{class:HTMLTableElement,element:"table"},{class:HTMLTableCellElement,element:"td"},{class:HTMLTableCellElement,element:"th"},{class:HTMLTableRowElement,element:"tr"},{class:HTMLTableSectionElement,element:"thead"},{class:HTMLTableSectionElement,element:"tbody"},{class:HTMLTableSectionElement,element:"tfoot"},{class:HTMLTextAreaElement,element:"textarea"},{class:HTMLTimeElement,element:"time"},{class:HTMLTitleElement,element:"title"},{class:HTMLTrackElement,element:"track"},{class:HTMLUListElement,element:"ul"},{class:HTMLVideoElement,element:"video"},{class:HTMLSlotElement,element:"slot"}])),b=document.createElement("div"),m={nodeActionsMap:new Map,pendingPaintNodeManagers:new Set,eventBindingFunctions:new Map,conditionalRenders:new Map,stateChangeHandlers:new Map,paintRafId:null},g=(new u(["==","===","!=","!==","<","<=",">",">="]),new u(["shift","unshift","pop","push","reverse","sort","splice","copyWithin","fill"])),w=new u(["reverse","sort","copyWithin","fill"]),S=new u(["slice","map","filter","reduce","reduceRight","some","every","forEach","find","findIndex","findLast","findLastIndex","indexOf","lastIndexOf","includes","entries","keys","values","at","join","toString","toLocaleString"]),O=new u(["every","some","filter","forEach","map","reduce","reduceRight","slice"]),E={STATE_NOT_FOUND:"SPROUT_STATE_NOT_FOUND"},A=new u(["checked","value"]),M="sprout-frozen",T="\n .".concat(M," {\n clip-path: inset(100%);\n pointer-events: none;\n opacity: 0;\n }\n"),j=Object.freeze({HIDE_UNHIDE:1,CLONE:2}),P=100,k={ATTRIBUTE_ACTIONS:600,TEXT_ACTIONS:300,ELEMENT_ACTIONS:100,PROPERTY_ACTIONS:50,REATTACH_ACTIONS:10},_=8;new CustomElementRegistry;function N(t){return"OL"===t.tagName||"UL"===t.tagName}function C(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,s=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(t,e)||R(t,e)||function(){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 L(t){return function(t){if(Array.isArray(t))return I(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||R(t)||function(){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 R(t,e){if(t){if("string"==typeof t)return I(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?I(t,e):void 0}}function I(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var D=m.pendingPaintNodeManagers,x=new Map;function $(t,e,n){var r;if(x.has(e)&&(r=x.get(e),cancelAnimationFrame(r)),t.length<P)r=requestAnimationFrame((function(){x.delete(e),t.forEach((function(t){return t()})),n&&n()})),x.set(e,r);else{x.delete(e);var o=L(t),i=0;requestAnimationFrame((function t(){o.slice(i,i+P).forEach((function(t){return t()})),(i+=P)<o.length&&requestAnimationFrame(t)}))}}var H=m.paintRafId,F=m.conditionalRenders;function K(t,e){F.set(t,e),$(Array.from(F.values()),"CONDITIONAL_RENDER",(function(){return F.clear()}))}function U(){H&&cancelAnimationFrame(H),H=requestAnimationFrame((function(){H=null,q()}))}function G(t){t.forEach((function(t){return t()}))}function q(t){var e,n=performance.now(),r=0,o=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=R(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}(D);try{for(o.s();!(e=o.n()).done;){var i=e.value,a=C(i.resolveToDOMActions(),5),l=a[0],u=a[1],s=a[2],c=a[3],f=a[4];if(G(f.slice(0,k.REATTACH_ACTIONS)),(r=performance.now()-n)>_)return requestAnimationFrame((function(){return q()}));if(G(c.slice(0,k.ELEMENT_ACTIONS)),(r=performance.now()-n)>_)return requestAnimationFrame((function(){return q()}));if(G(l.slice(0,k.ATTRIBUTE_ACTIONS)),(r=performance.now()-n)>_)return requestAnimationFrame((function(){return q()}));if(G(u.slice(0,k.TEXT_ACTIONS)),(r=performance.now()-n)>_)return requestAnimationFrame((function(){return q()}));if(G(s.slice(0,k.PROPERTY_ACTIONS)),(r=performance.now()-n)>_)return requestAnimationFrame((function(){return q()}));if(l.length||u.length||s.length||c.length||f.length)return requestAnimationFrame((function(){return q()}));i.paintStatus=null,D.delete(i)}}catch(t){o.e(t)}finally{o.f()}if(r>_)return requestAnimationFrame((function(){return q()}))}function z(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=V(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function B(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,s=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(t,e)||V(t,e)||function(){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 W(t){return function(t){if(Array.isArray(t))return X(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||V(t)||function(){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 V(t,e){if(t){if("string"==typeof t)return X(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?X(t,e):void 0}}function X(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}"undefined"!=typeof window&&(window.SproutWaitIdle=function(){return new Promise((function(t){requestAnimationFrame((function e(){if(!m.pendingPaintNodeManagers.size)return t();requestAnimationFrame(e)}))}))});function Y(t){switch(t){case Node.ATTRIBUTE_NODE:return{setAttribute:void 0};case Node.TEXT_NODE:return{textContent:void 0};case Node.ELEMENT_NODE:return{append:new Set,reattach:!1,setProperty:new Map,get hasPendingActions(){return this.append.size||this.reattach||this.setProperty.size}}}}function Q(t,e,n){var r=this,o=n;"todosFiltered"===e&&performance.mark("todo-generate-node-actions");var i=t.nodeManager.stateNodes[e],a=t.stateArrayMaps[e],l=t.nodeManager.conditionallyRenderingElements[e];if(i&&i.forEach((function(e){!function(t,e,n){e.nodeType===Node.ATTRIBUTE_NODE?t.addNodeAction(e,{actionType:"setAttribute",actionValue:n}):e.nodeType===Node.TEXT_NODE&&t.addNodeAction(e,{actionType:"textContent",actionValue:n})}(t.nodeManager,e,o)})),a){var u=o;a.forEach((function(e,n){!function(t,e,n,r){var o=null,i=!1,a=N(n),l=new Map,u=(n.getAttribute&&n.getAttribute("ref")||n.refName||n.tagName,t.map((function(t){return Object.hasOwn(t,"state")?t.state:t})));if(t.isNewArray){if(t.length){var s;i=!0;var c=ct(t,e,a?"li":void 0,o=n.detach());o.innerHTML="",(s=o).append.apply(s,W(c))}}else if(t.lastOperation){i=!0,o||(o=n.detach());var f=o.children,p=B(t.lastOperation,2),h=p[0],d=p[1];switch(h){case"shift":o.removeChild(o.firstElementChild);break;case"unshift":for(var y=d[0]-1;y>=0;y--){var v,b=t[y],m=null===(v=o.keyMap)||void 0===v?void 0:v.get(b.key);if(m){var g=o.firstElementChild;m!==g&&o.insertBefore(m,g)}else{var w=st(b,e,a?"li":void 0,o);w.stateKey=b.key,o.prepend(w)}}break;case"pop":o.removeChild(o.lastElementChild);break;case"push":for(var S=f.length,O=t.length;S<O;S++){var E=t[S],A=st(E,e,a?"li":void 0,o);A.stateKey=E.key,o.appendChild(A)}break;case"splice":var M,T,j=f.length,P=null!==(M=d[0])&&void 0!==M?M:0,k=d[1],_=P<0?Math.max(j+P,0):Math.min(P,j);T=void 0===k||k===1/0?j-_:k<0?0:Math.min(k,j-_);var C=d[2]||[],L=t.length;if(0===C.length&&j===L)break;if(0===_&&T>=j&&C.length===L&&j===L)break;for(var R=0;R<T;R++)o.removeChild(f[_]);var I,D=z(C);try{for(D.s();!(I=D.n()).done;){var x,$=st(I.value,e,a?"li":void 0,o),H=null!==(x=f[_])&&void 0!==x?x:null;o.insertBefore($,H),_++}}catch(t){D.e(t)}finally{D.f()}}}else{for(var F,K=null==n?void 0:n.keyMap,U=null!==(F=o)&&void 0!==F?F:n,G=0;G<u.length;G++){var q,V,X=u[G],Y=null==X?void 0:X.key,Q=U.children[G];if(!Q)break;var J=a?null===(q=Q.firstElementChild)||void 0===q?void 0:q.state:Q.state,Z=J?J.key:Q.stateKey;if(Z!==Y){i=!0,o||(o=n.detach());var tt=null!==(V=l.get(Y))&&void 0!==V?V:K.get(Y);if(tt){var et,nt=o.replaceChildWith(Q,tt);if(l.set(Z,nt),(a?null===(et=tt.firstElementChild)||void 0===et?void 0:et.state:tt.state)!==X){var rt=st(X,e,a?"li":void 0,o);rt.stateKey=Y,o.replaceChildWith(tt,rt)}}else{var ot=st(X,e,a?"li":void 0,o);ot.stateKey=Y,o.replaceChildWith(Q,ot)}}else if(J!==X){i=!0,o||(o=n.detach());var it=st(X,e,a?"li":void 0,o);it.stateKey=Y,o.replaceChildWith(Q,it)}}for(;(null!==(at=o)&&void 0!==at?at:n).children.length>u.length;){var at,lt;i=!0,o||(o=n.detach()),o.removeChild((null!==(lt=o)&&void 0!==lt?lt:n).lastElementChild)}}var ut=o?o.children.length:n.children.length;if(t.length>ut){i=!0,o||(o=n.detach());for(var ft=o.children.length;ft<t.length;ft++){var pt,ht=t[ft];if(null===(pt=o.keyMap)||void 0===pt||!pt.has(ht.key)){var dt=void 0;(dt=l.has(ht.key)?l.get(ht.key):st(ht,e,a?"li":void 0,o)).stateKey=ht.key,o.appendChild(dt)}}}i&&r.nodeManager.addNodeAction(o,{actionType:"reattach",actionValue:!0})}(u,e,n,t)}))}l&&l.forEach((function(t){K(r,t.render.bind(r))})),"pending"===t.nodeManager.paintStatus&&t.nodeManager.queuePaint()}function J(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];Object.defineProperty(t,e,{value:n,configurable:!1,writable:!0,enumerable:r})}function Z(t,e,n){var r=e.substring(1),o=this.getAttributeNode(t);o.nodeValue=n.getAttribute(r),o.isPropAttribute=!0,n.propAttributes.has(r)||n.propAttributes.set(r,new Set),n.propAttributes.get(r).add(o)}function tt(t){return function(t){if(Array.isArray(t))return et(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return et(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?et(t,e):void 0}}(t)||function(){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 et(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function nt(t){if(0===t.indexOf("@"))return["property",[t.substring(1)]];if(0===t.indexOf("!"))return["negation",[t.substring(1)]];for(var e,n=0,r=t[n];n++<t.length;){if(e=t[n],3==n&&"is_"==r)return["equality",t.substring(3).split(":")];if("?"===e)return["ternary",[r].concat(tt(t.substring(n+1).split(":")))];r+=e}return["literal",[t]]}function rt(t){return""===t||null!==t&&t}function ot(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,s=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return it(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?it(t,e):void 0}}(t,e)||function(){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 it(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}"undefined"==typeof HTMLElement||Object.defineProperty(globalThis,"elementSetAttribute",{value:HTMLElement.prototype.setAttribute,writable:!1,configurable:!1});var at=function(t,e){var n;n=t,c.has(n)?"false"===e?this.removeAttribute(t):elementSetAttribute.call(this,t,""):elementSetAttribute.call(this,t,e)},lt=function(t,e){var n=ot(nt(e),2),r=n[0],o=n[1],i=o[0],a=ot(this.getState(i,!0),2),l=a[0],u=a[1];var s=u._stateManager,c="literal"===r?l:s.bindStatePropExpression(e,r,o);this.removeAttribute(t);var f=document.createAttribute(t);f.nodeValue=c,J(f,"isStateAttribute",!0),J(f,"originalOwnerElement",this),"boolean"==typeof c&&(f.nodeValue=""),s.addStateNode(e,f),!1!==c&&this.setAttributeNode(f),this.addEventListener("disconnected",(function(){u._stateManager.removeStateNode(e,f)}),{once:!0})},ut=function(t){var e=ot(nt(t),2),n=e[0],r=e[1],o=r[0],i=ot(this.getState(o,!0),2),a=i[0],l=i[1];var u=l._stateManager,s="literal"===n?a:u.bindStatePropExpression(t,n,r),c=document.createTextNode(s);J(c,"isStateAttribute",!0),l._stateManager.addStateNode(t,c),this.appendChild(c),this.addEventListener("disconnected",(function(){l._stateManager.removeStateNode(t,c)}),{once:!0})};function st(t,e,n,r){var o,i=document.createElement(e);return i.setInitialState(t),i.ownerMapElement=r,n?(o=document.createElement(n)).appendChild(i):o=i,t.hasOwnProperty("key")&&!o.hasOwnProperty("stateKey")&&(o.stateKey=t.key),o}function ct(t,e,n,r){return t.map((function(t,o){Object.hasOwn(t,"state")&&(t=t.state);var i=st(t,e,n,r);return i.stateKey=t.key,i}))}function ft(t,e,n){var r,o,i;if(!pt(e)){var a=null!=n?n:t.state[e],l=Object.getOwnPropertyDescriptor(t.state,e);null==l||null===(r=l.get)||void 0===r||r.isStateGetter;!function(t,e,n){var r=new CustomEvent("stateChange",{bubbles:!1,composed:!1,detail:{property:e,newValue:n}});t.dispatchEvent(r)}(t.state,e,a),Q(t,e,a),e.startsWith("!")||Q(t,"!".concat(e),!a),null===(o=t.stateHooks.get(e))||void 0===o||o.forEach((function(t){t(e,a)})),null===(i=t.stateHooks.get("$$ALL"))||void 0===i||i.forEach((function(t){t(e,a)}))}}function pt(t){return"string"==typeof t&&(0===t.indexOf("$$")||h.has(t))}function ht(t){return 0===t.indexOf("set_")}function dt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,s=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(t,e)||vt(t,e)||function(){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 yt(t){return function(t){if(Array.isArray(t))return bt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||vt(t)||function(){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 vt(t,e){if(t){if("string"==typeof t)return bt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bt(t,e):void 0}}function bt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function mt(t){return mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mt(t)}function gt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,jt(r.key),r)}}function wt(t,e){if(e&&("object"==mt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function St(){return St="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Mt(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},St.apply(null,arguments)}function Ot(t){var e="function"==typeof Map?new Map:void 0;return Ot=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(Et())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&At(o,n.prototype),o}(t,arguments,Mt(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),At(n,t)},Ot(t)}function Et(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Et=function(){return!!t})()}function At(t,e){return At=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},At(t,e)}function Mt(t){return Mt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mt(t)}function Tt(t,e,n){return(e=jt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jt(t){var e=function(t,e){if("object"!=mt(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=mt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==mt(e)?e:e+""}var Pt=function(t){function e(t,n,r){var o,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:window,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);i.SPROUT_CONFIG.stateManagerClass;if(!Array.isArray(t))throw Error("Argument for StateFulArray constructor must be an array!");var l,u,s,c=t,f=c.map((function(t,e){var o=t;return Object.hasOwn(t,"state")||Object.hasOwn(t,"_stateManager")||Array.isArray(t)||"object"===mt(t)&&(o=Gt(t,r,n._stateManager,ft,!1,i)),o}));return l=this,u=e,s=yt(f),u=Mt(u),Tt(o=wt(l,Et()?Reflect.construct(u,s||[],Mt(l).constructor):u.apply(l,s)),"arrayMaps",{}),o.parentStateObject=n,o.arrayStateProp=r,o.appScope=i,o.rawArray=c,a&&o.makeStateMap(),J(f=new Proxy(o,Rt(null==n?void 0:n._stateManager,r,i)),"_isStatefulArray",!0),o.statefulArray=f,wt(o,f)}return function(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&&At(t,e)}(e,t),n=e,r=[{key:Symbol.iterator,value:function(){return St(Mt(e.prototype),Symbol.iterator,this).call(this)}},{key:"runArrayOperation",value:function(t,e,n){switch(t){case"shift":return this.lastOperation=["shift"],[e.apply(this,n),!1];case"unshift":return this.lastOperation=["unshift",[n.length]],[e.apply(this,n),!1];case"pop":return this.lastOperation=["pop"],[e.apply(this),!1];case"push":return this.lastOperation=["push",[n.length]],[e.apply(this,n),!1];case"splice":var r=dt(n,2),o=r[0],i=r[1],a=n.slice(2);return this.lastOperation=["splice",[o,i,a]],[e.apply(this,n),!1];default:this.lastOperation=void 0;var l=e.apply(this,n);return[l,Array.isArray(l)]}}},{key:"doArrayOperation",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.$$operation=t;var o,i=this.length,a=!1;if(O.has(t)){var l=n[0];if(this.length&&Object.hasOwn(this.arrayMaps,t)&&this.arrayMaps[t].has(l)){var u=this.arrayMaps[t].get(l);if(this.lastDirtyTimestamp>u.timestamp){var s=dt(this.runArrayOperation(t,St(Mt(e.prototype),t,this),n),2);o=s[0],a=s[1],this.arrayMaps[t].set(l,{lastResult:o,timestamp:(new Date).getTime()})}else o=u.lastResult}else{var c=dt(this.runArrayOperation(t,St(Mt(e.prototype),t,this),n),2);o=c[0],a=c[1],Object.hasOwn(this.arrayMaps,t)||(this.arrayMaps[t]=new Map,this.arrayMaps[t].set(l,{lastResult:o,timestamp:(new Date).getTime()}))}}else{var f=dt(this.runArrayOperation(t,St(Mt(e.prototype),t,this),n),2);o=f[0],a=f[1]}var p=this.length,h=w.has(t)||"splice"===t&&p===i;return r&&h&&this.parentStateObject._stateManager.setDirtyProp("".concat(this.arrayStateProp,".length"),!0),delete this.$$operation,r&&this.parentStateObject._stateManager.setDirtyProp(this.arrayStateProp),[o,a]}},{key:"mapStateKeys",value:function(){var t=this;this.forEach((function(e){var n=Object.hasOwn(e,"state")?e.state:e;t.keyMap.set(n.key,n)}))}},{key:"makeStateMap",value:function(){this._isStateMap=!0,this.keyMap=new Map,this.mapStateKeys()}}],o=[{key:Symbol.species,get:function(){return Array}}],r&&gt(n.prototype,r),o&&gt(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(Ot(Array));function kt(t){return kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kt(t)}function _t(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,s=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Nt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nt(t,e):void 0}}(t,e)||function(){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 Nt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}Tt(Pt,"functions",new u(["constructor","statifyArray","addDirtyIndex","doArrayOperation","runArrayOperation","makeStateMap","mapStateKeys","toArray"]));var Ct=function(){return{get:function(t,e,n){var r;if(pt(e)||0===e.indexOf("$$"))return Reflect.get.apply(Reflect,arguments);var o=Object.getOwnPropertyDescriptor(t,e);return null!=o&&null!==(r=o.get)&&void 0!==r&&r.isStateGetter||(Object.hasOwn(t.$$accessCount,e)?t.$$accessCount[e]++:t.$$accessCount[e]=1),Reflect.get.apply(Reflect,arguments)}}},Lt=function(t,e){arguments.length>2&&void 0!==arguments[2]||window,t.state;return{apply:function(n,r,o){t.clearStateDependencies(e);var i=r._global,a=_t(Vt(n,r),3),l=a[0],u=a[1],s=a[2];return l.forEach((function(n){t.addStateDependency(n,e)})),null==u||u.forEach((function(n){i._stateManager.addGlobalStateDependency(n,e,t)})),s}}},Rt=function(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window,o=function(){var n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&t.setDirtyProp(e,!0),n&&t.setDirtyProp("".concat(e,".length"),!0)},i=function(t){var e;if(t)return Object.hasOwn(t,"state")?null===(e=t.state)||void 0===e?void 0:e.key:t.key};return{set:function(a,l,u){if(0===l.indexOf("$$"))return Reflect.set(a,l,u);if("length"===l)return n=Reflect.set(a,l,u),a.hasDirtyItems=!0,a.hasOwnProperty("$$operation")?o(!0,!1):o(!0,!0),n;if(a[l]===u)return!0;var s;Number(l);if(!isNaN(l)){var c=Number(l),f=a[c],p=i(f);if(u=qt(u,e,t,r),Object.hasOwn(u,"_stateManager")&&(u=u._stateManager),!a.hasOwnProperty("$$operation")){var h=!1;if(c<a.length&&(h=!0),(n=Reflect.set(a,l,u))&&a._isStateMap){void 0!==p&&a.keyMap.delete(p);var d=i(u);void 0!==d&&a.keyMap.set(d,(s=u,Object.hasOwn(s,"state")?s.state:s))}return h&&o(),n}}return Reflect.set(a,l,u)},get:function(e,n,r){if("symbol"===kt(n))return Reflect.get.apply(Reflect,arguments);if("length"===n&&Object.hasOwn(e.parentStateObject,"$$accessCount")&&!Object.hasOwn(e,"$$operation")){var o=e.arrayStateProp;Object.hasOwn(e.parentStateObject.$$accessCount,"".concat(o,".length"))?e.parentStateObject.$$accessCount["".concat(o,".length")]++:e.parentStateObject.$$accessCount["".concat(o,".length")]=1}if(n.indexOf&&0===n.indexOf("__")){var i=n.substring(2);return Reflect.get(e,i,r)}if("function"==typeof e[n]&&!Pt.functions.has(n)){var a=e.parentStateObject;if(a&&Object.hasOwn(a,"$$accessCount")){var l=String(n);if(S.has(l)){var u=e.arrayStateProp;a.$$accessCount[u]=(a.$$accessCount[u]||0)+1}}}if(!t.isInitializing&&"function"==typeof e[n]&&!Pt.functions.has(n))return function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=_t(e.doArrayOperation.call(e.statefulArray,n,r,g.has(n)),2),a=i[0];i[1];return a};var s=Number(n);if(!isNaN(s)){var c=e[s];if(void 0===c)return;return c&&Object.hasOwn(c,"state")?c.state:c}return Reflect.get.apply(Reflect,arguments)},deleteProperty:function(t,e){if(isNaN(Number(e)))return Reflect.deleteProperty(t,e);var n=t[Number(e)],r=i(n),o=Reflect.deleteProperty(t,e);return o&&t._isStateMap&&void 0!==r&&t.keyMap.delete(r),o}}};function It(){this.conditionallyRenderingElements={},this.addConditionallyRenderingElements=function(t,e){this.nodeManager.addConditionallyRenderingElements(t,e)}}function Dt(){this.stateArrayMaps={},this.addStateMap=function(t,e,n){this.stateArrayMaps.hasOwnProperty(t)||(this.stateArrayMaps[t]=new Map),this.stateArrayMaps[t].set(n,e)},this.clearStateMapsLastOperation=function(){for(var t=0,e=Object.keys(this.stateArrayMaps);t<e.length;t++){var n=e[t];delete this.state[n].lastOperation}}}function xt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,s=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return $t(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$t(t,e):void 0}}(t,e)||function(){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 $t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Ht(t){return Ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ht(t)}function Ft(t,e,n){if(Ut())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&Kt(o,n.prototype),o}function Kt(t,e){return Kt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Kt(t,e)}function Ut(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ut=function(){return!!t})()}function Gt(t,e,n){var r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:window,o=new Te(t,e,n,arguments.length>3&&void 0!==arguments[3]?arguments[3]:ft,arguments.length>4&&void 0!==arguments[4]&&arguments[4],r);return o.use(It,"conditional-element"),o.use(Dt,"map"),o}function qt(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:window,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return pt(e)||(Array.isArray(t)?t=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:window,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Object.hasOwn(t,"_isStatefulArray"))return t;var i=Ft(Pt,[t,n,e,r,o]);return n.hasOwnProperty("".concat(e,".length"))||Object.defineProperty(n,"".concat(e,".length"),{get:function(){return this[e].length}}),i}(t,e,n.state,r,o):"object"!==Ht(t)||null===t||t.hasOwnProperty("_stateManager")||(t=Gt(t,e,n,ft,!1,r).state)),t}function zt(t,e,n){var r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:window,i="set_".concat(e),a=xt(t,2),l=a[0],u=a[1];if("function"!=typeof l)throw Error("Setter hooks must define a function as the first item!");var s,c=n.state;if(u.deps=null!==(r=u.deps)&&void 0!==r?r:"auto",!u.init||!u.once)if("auto"===u.deps)if(u.reevaluate){var f=Lt(n,i,o);l=new Proxy(l,f),t[0]=l}else{var p,h,d,y=xt(Vt(l,c),3);h=y[0],d=y[1],s=y[2],h.forEach((function(t){n.addStateDependency(t,i)})),null===(p=d)||void 0===p||p.forEach((function(t){n.addStateDependency(t,i),c._global._stateManager.addGlobalStateDependency(t,i,n)}))}else u.deps.forEach((function(t){if(0===t.indexOf("global")){var e=t.substring(t.indexOf("global.")+7);c._global.addGlobalStateDependency(i,e,n)}else n.addStateDependency(t,i)}));Object.defineProperty(c,e,{get:function(){return Object.hasOwn(c,"$$accessCount")&&(Object.hasOwn(c.$$accessCount,e)?c.$$accessCount[e]++:c.$$accessCount[e]=1),n.privateState[e]},set:function(){throw Error("Cannot directly set the state value of a result of a setter hook function!")}}),u.init&&(s||(s=l.call(c)),(u.statify||u.stateMap)&&(s=qt(s,e,n,o,u.stateMap)),n.privateState[e]=s,n.setDirtyProp(e))}function Bt(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:window,o=n.state,i=n.privateState[e];void 0===i&&zt(t,e,n,r);var a=xt(t,2),l=a[0],u=a[1];if("function"!=typeof l)throw Error("Setter hooks must define a function as the first item!");var s=l.call(o),c=!1;if(void 0===s)throw Error("State Set Hook functions MUST return a value");return(u.statify||u.stateMap)&&(s=qt(s,e,n,r,u.stateMap)),s!==i&&(n.privateState[e]=s,c=!0),u.once&&delete o["set_".concat(e)],c}function Wt(t){var e;for(var n in t)-1!==(e=n.indexOf(".length"))&&t[n.substring(0,e)]--;return new Set(Object.keys(t).filter((function(e){return t[e]>0})))}function Vt(t,e){var n=!1,r=new Proxy(e,Ct());r.$$accessCount={},Object.hasOwn(r,"_global")&&r._global!==y&&(n=!0,r._global=new Proxy(r._global,Ct),r._global.$$accessCount={});var o=t.call(r),i=Wt(r.$$accessCount);delete r.$$accessCount;var a=null;return n&&(a=Wt(r._global.$$accessCount),delete r._global.$$accessCount),[i,a,o]}function Xt(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window,r=t.state,o=Object.getOwnPropertyDescriptors(e),i=function(e){var i=o[e];if(pt(e))return Object.defineProperty(r,e,i),1;var a=function(t,e){if(t.get&&"function"==typeof t.get)return{nativeGetter:!0,func:t.get,deps:"auto",reevaluate:!1,init:!1,isSetter:!1};if(t.value){var n=t.value;if(0===e.indexOf("set_")){if(!Array.isArray(n))throw Error("State setter hooks must be arrays!");var r=n[1]||{};return{nativeGetter:!1,func:n[0],deps:r.deps&&Array.isArray(r.deps)?r.deps:"auto",reevaluate:!!r.reevaluate,init:!!r.init,once:!!r.once,stateMap:!!r.stateMap,statify:!!r.statify,isSetter:0===e.indexOf("set_")}}}}(i,e);if(a){var l=a.isSetter?e.substring(4):e;if(a.func.bind(r),a.isSetter&&!a.nativeGetter)zt(i.value,l,t,n),a.once&&(i.configurable=!0),Object.defineProperty(r,e,i);else if(a.nativeGetter){i.get.isStateGetter=!0;var u=xt(Vt(i.get,r),2),s=u[0],c=u[1];s.forEach((function(n){t.addStateDependency(n,e)})),null==c||c.forEach((function(n){t.addStateDependency(n,e),r._global._stateManager.addGlobalStateDependency(n,e,t)})),i.get.bind(r),Object.defineProperty(r,l,i)}}else if(i.hasOwnProperty("value")){var f=e,p=qt(i.value,f,t,n);t.privateState.hasOwnProperty(f)||(t.privateState[f]=p),Object.defineProperty(r,f,{set:function(e){e!==t.privateState[f]&&(e=qt(e,f,t,n),t.privateState[f]=e,t.setDirtyProp(f),Array.isArray(e)&&t.setDirtyProp("".concat(f,".length")))},get:function(){return t.privateState[f]}})}};for(var a in o)i(a)}function Yt(t,e,n,r){Object.defineProperty(e,t,{get:n,set:function(){throw Error("Cannot directly set a State property expression")},enumerable:!0}),e._stateManager.addStateDependency(r,t)}function Qt(t){var e=new Set,n=new Set;return t.forEach((function(t){ht(t)?n.add(t):e.add(t)})),[e,n]}function Jt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,s=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(t,e)||ne(t,e)||function(){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 Zt(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=ne(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function te(t){return te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},te(t)}function ee(t){return function(t){if(Array.isArray(t))return re(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ne(t)||function(){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 ne(t,e){if(t){if("string"==typeof t)return re(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?re(t,e):void 0}}function re(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function oe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,le(r.key),r)}}function ie(t,e,n){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,n)}function ae(t,e,n){return(e=le(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function le(t){var e=function(t,e){if("object"!=te(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=te(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==te(e)?e:e+""}function ue(t,e){return t.get(function(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}(t,e))}var se=m.pendingPaintNodeManagers,ce=new WeakMap,fe=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ae(this,"stateNodes",{}),ae(this,"conditionallyRenderingElements",{}),ae(this,"bindableAttributesStateNodes",new Map(ee(A).map((function(t){return[t,new Map]})))),ie(this,ce,new Map),ae(this,"paintStatus",null)},(e=[{key:"addStateNode",value:function(t,e){this.stateNodes.hasOwnProperty(t)||(this.stateNodes[t]=new Set),this.stateNodes[t].add(e),p.has(e.nodeName)&&this.bindableAttributesStateNodes.get(e.nodeName).set(e.originalOwnerElement,e)}},{key:"removeStateNode",value:function(t,e){var n;null===(n=this.stateNodes)||void 0===n||n[t].delete(e)}},{key:"addConditionallyRenderingElements",value:function(t,e){var n;this.conditionallyRenderingElements.hasOwnProperty(t)||(this.conditionallyRenderingElements[t]=new Set),e.originalParentElement=e.parentElement||(null===(n=e.host)||void 0===n?void 0:n.shadowRoot),this.conditionallyRenderingElements[t].add(e)}},{key:"addNodeAction",value:function(t,e){ue(ce,this).has(t)||ue(ce,this).set(t,Y(t.nodeType));var n=ue(ce,this).get(t),r=e.actionType,o=e.actionValue;if(t.nodeType===Node.ELEMENT_NODE)switch(r){case"append":n.append.add(o);break;case"setProperty":n.setProperty(o.property,o.value);break;case"reattach":n.reattach=!0}else n[r]=o;this.paintStatus||(this.paintStatus="pending")}},{key:"queuePaint",value:function(){"pending"===this.paintStatus&&(se.add(this),U(),this.paintStatus="queued")}},{key:"resolveToDOMActions",value:function(){var t=[],e=[],n=[],r=[],o=[];return ue(ce,this).forEach((function(i,a){switch(a.nodeType){case Node.ATTRIBUTE_NODE:var l=i.setAttribute,u=te(l);if("undefined"!==u)if("boolean"===u){if(!a.hasOwnProperty("originalOwnerElement"))throw Error("originalOwnerElement not found on boolean attribute node! Should never happen!");!1===l?a.originalOwnerElement.hasAttribute(a.name)&&t.push((function(){a.originalOwnerElement.removeAttributeNode(a)})):a.originalOwnerElement.hasAttribute(a.name)||t.push((function(){a.originalOwnerElement.setAttributeNode(a)}))}else"string"===u&&a.nodeValue!==l&&t.push((function(){return a.nodeValue=l}));break;case Node.TEXT_NODE:if(void 0!==i.textContent){var s=String(i.textContent);a.nodeValue!==s&&e.push((function(){return a.nodeValue=s}))}break;case Node.ELEMENT_NODE:var c,f=Zt(i.append.values());try{var p=function(){var t=c.value;n.push((function(){return a.appendChild(t)}))};for(f.s();!(c=f.n()).done;)p()}catch(t){f.e(t)}finally{f.f()}var h,d,y=Zt(i.setProperty);try{var v=function(){var t=Jt(h.value,2),e=t[0],n=t[1];a[e]!==n&&o.push((function(){return a[e]=n}))};for(y.s();!(h=y.n()).done;)v()}catch(t){y.e(t)}finally{y.f()}i.reattach&&(r.push((function(){return a.reattach()})),null!=a&&null!==(d=a.pendingKeyMapActions)&&void 0!==d&&d.size&&r.push((function(){var t,e=Zt(a.pendingKeyMapActions);try{for(e.s();!(t=e.n()).done;)(0,t.value)()}catch(t){e.e(t)}finally{e.f()}a.pendingKeyMapActions.clear()})),i.reattach=!1)}})),ue(ce,this).clear(),[t,e,o,n,r]}}])&&oe(t.prototype,e),n&&oe(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function pe(t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window;return new Proxy(t,function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window;return{set:function(n,r,o){if(pt(r))return Reflect.set.apply(Reflect,arguments);var i,a=Reflect.set.apply(Reflect,arguments),l=t._stateManager;return l.parentStateManager&&(performance.mark("todo-array-set-dirty-prop"),null===(i=l.parentStateManager)||void 0===i||i.setDirtyProp(e)),a},defineProperty:function(e,r,o){return pt(r)?Reflect.defineProperty.apply(Reflect,arguments):(void 0!==(null==o?void 0:o.value)&&(o.value=qt(o.value,r,t._stateManager,n)),Reflect.defineProperty(e,r,o))},get:function(t,e,n){var r=Reflect.get.apply(Reflect,arguments);return"function"==typeof r?r.bind(t):r}}}(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,e))}function he(t){return he="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},he(t)}function de(t){return function(t){if(Array.isArray(t))return be(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ve(t)||function(){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 ye(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,s=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(t,e)||ve(t,e)||function(){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 ve(t,e){if(t){if("string"==typeof t)return be(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?be(t,e):void 0}}function be(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function me(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Se(r.key),r)}}function ge(t,e,n){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,n)}function we(t,e,n){return(e=Se(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Se(t){var e=function(t,e){if("object"!=he(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=he(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==he(e)?e:e+""}function Oe(t,e){return t.get(function(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}(t,e))}var Ee=new Map;var Ae=new WeakMap,Me=function(){return t=function t(e,n,r){var o=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ft,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:window;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),we(this,"isInitializing",!1),we(this,"privateState",{}),we(this,"state",new EventTarget),we(this,"stateDependencies",new Map),we(this,"parentStateProp",void 0),we(this,"parentStateManager",void 0),we(this,"dirtyProps",new Set),we(this,"nodeManager",new fe),we(this,"stateHooks",new Map),ge(this,Ae,new Set),this.isInitializing=!0,this.parentStateProp=n,this.parentStateManager=r,this.handleStateChange=i,this.appScope=l,J(this.state,"_stateManager",this,!0),this.state.$$isInitializing=!0,this.state.populate=function(t){for(var e in t)if(this.hasOwnProperty(e)){if(pt(e))continue;this[e]=t[e]}},n&&r&&(this.state=pe(this.state,n,l)),a)this.globalStateDependencies=new Map,this.addGlobalStateDependency=function(t,e,n){o.globalStateDependencies.has(t)||o.globalStateDependencies.set(t,new Map);var r=o.globalStateDependencies.get(t);r.has(n)||r.set(n,new Set),r.get(n).add(e)};else{var u=l[d]();J(this.state,"_global",u,!0)}!function(t,e){Xt(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:window)}(this,e,l),delete this.state.$$isInitializing,J(this.state,"_isStateManager",!0),J(this.state,"_isActive",!0,!1),this.isInitializing=!1},e=[{key:"setDirtyProp",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!this.state.$$isInitializing){var n,r,o=t.indexOf(".length"),i=o>0?t.substring(0,o):t;if(!Object.hasOwn(this.state,i))throw Error("Error in setDirtyProp. State has no property: '".concat(t,"'. This should never happen"));this.dirtyProps.add(t),Array.isArray(this.state[i])&&(this.state[i].lastDirtyTimestamp=(new Date).getTime()),e&&(n=this,r=this.handleStateChanges.bind(this),Ee.set(n,r),$(Array.from(Ee.values()),"STATE_CHANGE",(function(){return Ee.clear()})))}}},{key:"handleStatePropDependencies",value:function(t){var e=this,n=this.stateDependencies,r=null==this?void 0:this.globalStateDependencies;t.forEach((function(t){!function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window,r=t.state;if(ht(e)){var o=r[e],i=e.substring(4);Bt(o,i,t,n)&&ft(t,i,null,n.offscreenContainer)}else if(e.indexOf(".length")>0){var a=e.split(".")[0];ft(t,e,t.state[a].length,n.offscreenContainer)}else ft(t,e,null,n.offscreenContainer)}(e,t,e.appScope);var o=ht(t)?t.substring(4):t;if(null!=n&&n.has(o)){var i=ye(Qt(n.get(o)),2),a=i[0],l=i[1];l.size&&e.handleStatePropDependencies(l),a.size&&e.handleStatePropDependencies(a)}null!=r&&r.has(o)&&r.get(o).forEach((function(t,e){var n=ye(Qt(t),2),r=n[0],o=n[1];o.size&&e.handleStatePropDependencies(o),r.size&&e.handleStatePropDependencies(r)}))}))}},{key:"isGlobalState",value:function(){return!this.state.hasOwnProperty("_global")}},{key:"topologicalSortStateProps",value:function(t){var e=this;return de(t).toSorted((function(t,n){var r,o;return t.startsWith(n+".")?1:n.startsWith(t+".")?-1:((null===(r=e.stateDependencies[t])||void 0===r?void 0:r.size)||0)-(null===(o=e.stateDependencies[n])||void 0===o?void 0:o.size)||0}))}},{key:"handleStateChanges",value:function(){var t=this;if(this.dirtyProps.size){performance.mark("todo-topological-sort");var e=this.topologicalSortStateProps(this.dirtyProps);this.dirtyProps.clear(),this.isGlobalState();var n=new Set,r=new Set,o=new Set,i=this,a=i.state;e.forEach((function(e){var l;if(ht(e)){e=e.substring(4);var u=a[e];performance.mark("todo-call-setter-hook"),Bt(u,e,i,t.appScope)&&t.handleStateChange(i,e,null)}else t.handleStateChange(i,e,null);i.stateDependencies.has(e)&&i.stateDependencies.get(e).forEach((function(t){ht(t)?r.add(t):n.add(t)}));var s=null===(l=i.state)||void 0===l?void 0:l._global;if(s===y&&(s=t.appScope[d]()),s!==y){var c,f=(null===(c=s)||void 0===c?void 0:c._stateManager)||i;f.globalStateDependencies.has(e)&&o.add(f.globalStateDependencies.get(e))}})),r.size&&this.handleStatePropDependencies(r),n.size&&this.handleStatePropDependencies(n),o.size&&o.forEach((function(t,e){e.handleStatePropDependencies(t)})),i.clearStateMapsLastOperation(),this.parentStateManager&&this.parentStateManager.setDirtyProp(this.parentStateProp)}}},{key:"addStateDependency",value:function(t,e){this.stateDependencies.has(t)||this.stateDependencies.set(t,new Set),this.stateDependencies.get(t).add(e),Array.isArray(this.state[t])&&this.addStateDependency("".concat(t,".length"),e)}},{key:"clearStateDependencies",value:function(t){this.stateDependencies.has(t)&&this.stateDependencies.set(t,new Set)}},{key:"addStateNode",value:function(t,e){this.nodeManager.addStateNode(t,e)}},{key:"removeStateNode",value:function(t,e){this.nodeManager.removeStateNode(t,e)}},{key:"bindStatePropExpression",value:function(t,e,n){var r=n[0];if(!e||!n){var o=ye(nt(t),2);e=o[0],n=o[1],r=n[0]}if(!r)throw Error("Must specify state property name for State expression: ".concat(t));var i=this.state,a=Object.getOwnPropertyDescriptor(i,r);if(a||(i=i._global,a=Object.getOwnPropertyDescriptor(i,r)),!a)throw Error("Could not bind state property ".concat(r,". State property ").concat(r," not defined!"));if(Object.hasOwn(i,t))return i[t];var l=a.hasOwnProperty("value"),u=this;switch(e){case"negation":var s=l?u.privateState:u.state;Yt(t,i,(function(){return!s[r]}),r);break;case"equality":var c=n[1];if(!c)throw Error("Must specify equality value for equality expression (is_something:equalToThis)");var f=l?u.privateState:u.state;Yt(t,i,(function(){return f[r]===c}),r);break;case"ternary":var p=n[1];if(!p)throw Error("Ternary state expression (prop?truthy:falsy) must include at least a truthy value!");var h=n[2],d=l?u.privateState:u.state;Yt(t,i,h?function(){return d[r]?p:h}:function(){return d[r]?p:void 0},r)}return i[t]}},{key:"getStateDependencies",value:function(){return this.stateDependencies}},{key:"use",value:function(t,e){t.call(this),Oe(Ae,this).add(e)}},{key:"isUsing",value:function(t){return Oe(Ae,this).has(t)}},{key:"addStateHook",value:function(t){var e,n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];r.length?r.forEach((function(e){var r;(null!==(r=n.stateHooks.get(e))&&void 0!==r?r:(n.stateHooks.set(e,new Set),n.stateHooks.get(e))).add(t)})):(null!==(e=this.stateHooks.get("$$ALL"))&&void 0!==e?e:(this.stateHooks.set("$$ALL",new Set),this.stateHooks.get("$$ALL"))).add(t)}}],e&&me(t.prototype,e),n&&me(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();const Te=Me;function je(t){return Object.hasOwn(t,"state")?t:t.firstElementChild}var Pe={replaceChildWith:function(t,e){var n,r,o,i=je(t),a=null!==(n=null==i||null===(r=i.state)||void 0===r?void 0:r.key)&&void 0!==n?n:t.stateKey,l=je(e),u=null!==(o=e.stateKey)&&void 0!==o?o:l.stateKey,s=this.replaceChild(e,t);return this.keyMap.delete(a),this.keyMap.set(u,e),s},swapChildWith:function(t,e){if(t!==e){var n=t.nextSiblingElement,r=e.nextSiblingElement;this.insertBefore(t,r),this.insertBefore(e,n)}},removeChild:function(t){var e,n=je(t),r=null!==(e=t.stateKey)&&void 0!==e?e:n.stateKey;HTMLElement.prototype.removeChild.call(this,t),this.keyMap.delete(r)},insertBefore:function(t,e){var n;HTMLElement.prototype.insertBefore.call(this,t,e);var r=je(t),o=null!==(n=t.stateKey)&&void 0!==n?n:r.stateKey;this.keyMap.set(o,t)},append:function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];(t=HTMLElement.prototype.append).call.apply(t,[this].concat(n));for(var o=0,i=n;o<i.length;o++){var a,l=i[o],u=je(l),s=null!==(a=l.stateKey)&&void 0!==a?a:u.stateKey;this.keyMap.set(s,l)}},appendChild:function(t){var e;HTMLElement.prototype.appendChild.call(this,t);var n=je(t),r=null!==(e=t.stateKey)&&void 0!==e?e:n.stateKey;this.keyMap.set(r,t)},prepend:function(t){var e;HTMLElement.prototype.prepend.call(this,t);var n=je(t),r=null!==(e=t.stateKey)&&void 0!==e?e:n.stateKey;this.keyMap.set(r,t)},detach:function(){var t;if(arguments.length>0&&void 0!==arguments[0]&&arguments[0]){var e=this.cloneNode(!0);e.$$originalElement=this,e.$$detached=j.CLONE,t=e}else this.setAttribute("inert",""),this.classList.add(M),this.$$detached=j.HIDE_UNHIDE,t=this;return t},reattach:function(){this.$$detached===j.HIDE_UNHIDE?(this.removeAttribute("inert",""),this.classList.remove(M)):this.$$detached===j.CLONE&&this.$$originalElement.replaceWith(this),this.$$detached=void 0},initialAppend:function(){for(var t,e=this,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];(t=HTMLElement.prototype.append).call.apply(t,[this].concat(r));for(var i=function(){var t=l[a];e.pendingKeyMapActions.add((function(){var n=je(t);if(n.isActive){var r,o,i=null!==(r=null==n||null===(o=n.state)||void 0===o?void 0:o.key)&&void 0!==r?r:t.stateKey;e.keyMap.set(i,t)}else n.addEventListener("active",(function(){var r,o,i=null!==(r=null==n||null===(o=n.state)||void 0===o?void 0:o.key)&&void 0!==r?r:t.stateKey;e.keyMap.set(i,t)}),{once:!0})}))},a=0,l=r;a<l.length;a++)i()}};function ke(t){return function(t){if(Array.isArray(t))return Ce(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Ne(t)||function(){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 _e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,s=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(t,e)||Ne(t,e)||function(){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 Ne(t,e){if(t){if("string"==typeof t)return Ce(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ce(t,e):void 0}}function Ce(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var Le={map:function(t){var e,n=_e(t.split(":"),2),r=n[0],o=n[1],i=this;e=i,Object.assign(e,Pe),e.keyMap=new Map,e.pendingKeyMapActions=new Set,e.style.willChange="opacity",this.onAfterPaint((function(){var t=function(t,e,n){var r=_e(n.getState(t,!0),2),o=r[0],i=r[1];o.makeStateMap();var a=ct(o,e,N(n)?"li":void 0,n);return n.innerHTML="",a.length&&n.append.apply(n,ke(a)),i}(r,o,i);if(!t)throw new Error("Mapping ".concat(r," to ").concat(o," failed!"));var e=t[r];if(!e||!e.hasOwnProperty("_isStatefulArray"))throw new Error("State array ".concat(r," for State Map must be stateful!"));t._stateManager.addStateMap(r,o,i)}))},bind:function(t){var e=_e(t.split(":"),2),n=e[0],r=e[1];this.bindAttributeToState(n,r)},bindprop:function(t){var e=this,n=_e(t.split(":"),2),r=n[0],o=n[1],i=_e(this.getState(r,!0),2),a=i[0],l=i[1];this[o]=a,l._stateManager.addStateHook((function(t,n){e[o]=n}),[r])}};function Re(t){return Re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Re(t)}function Ie(t){return function(t){if(Array.isArray(t))return He(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||$e(t)||function(){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 De(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,s=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(t,e)||$e(t,e)||function(){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 xe(){return xe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ze(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},xe.apply(null,arguments)}function $e(t,e){if(t){if("string"==typeof t)return He(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?He(t,e):void 0}}function He(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Fe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ke(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Qe(r.key),r)}}function Ue(t,e,n){return e&&Ke(t.prototype,e),n&&Ke(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ge(t,e,n){return e=ze(e),function(t,e){if(e&&("object"==Re(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,qe()?Reflect.construct(e,n||[],ze(t).constructor):e.apply(t,n))}function qe(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(qe=function(){return!!t})()}function ze(t){return ze=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ze(t)}function Be(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&&We(t,e)}function We(t,e){return We=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},We(t,e)}function Ve(t,e,n){Xe(t,e),e.set(t,n)}function Xe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ye(t,e,n){return(e=Qe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Qe(t){var e=function(t,e){if("object"!=Re(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Re(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Re(e)?e:e+""}function Je(t,e,n){return t.set(tn(t,e),n),n}function Ze(t,e){return t.get(tn(t,e))}function tn(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}function en(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=new WeakMap,o=new WeakSet,i=new WeakMap,a=function(t){function n(){var t,e,a;return Fe(this,n),t=Ge(this,n),Xe(e=t,a=o),a.add(e),Ye(t,"host",null),Ve(t,r,!1),Ye(t,"refName",void 0),Ye(t,"boundStateToProperties",new Map),Ve(t,i,[]),t.isReactiveElement=!0,t.isNativeElement=!0,t}return Be(n,t),Ue(n,[{key:"bindStateToProperty",value:function(t,e){this.boundStateToProperties.set(t,e)}},{key:"activate",value:function(){var t,n=this,r=[],o=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=$e(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}(this.getAttributeNames());try{for(o.s();!(t=o.n()).done;){var a=t.value,l=this.getAttribute(a);if(this.initialSetAttribute(a,l),0===a.indexOf("_")){var u=a.substring(1);r.push({command:u,args:l})}}}catch(t){o.e(t)}finally{o.f()}r.forEach((function(t){var r,o,i,a,l=t.command,u=t.args;null===(r=Le[l])||void 0===r||r.call(n,u),null===(o=e.appCommands)||void 0===o||null===(o=o[l])||void 0===o||o.call(n,u);var s=(null===(i=n.host)||void 0===i?void 0:i.commands)||n.commands;null==s||null===(a=s[l])||void 0===a||a.call(n,u)})),Ze(i,this).forEach((function(t){return t.call(n)})),Ze(i,this).length=0,this.isActive=!0}},{key:"getHost",value:function(){var t;return this.host||this.parentNode||(null==this||null===(t=this.getRootNode())||void 0===t?void 0:t.host)}},{key:"connectedCallback",value:function(){var t=this;if(!Ze(r,this)){var e,n=this.getRootNode();n!==document?this.host=n.host:(e=this.parentElement)&&e.isReactiveElement&&!e.isNativeElement?this.host=this.parentElement:roost.host=null,this.host?this.host.isActive?this.activate():this.host.addEventListener("active",(function(){return t.activate()}),{once:!0}):this.activate(),Je(r,this,!0)}}},{key:"disconnectedCallback",value:function(){var t,e=null!==(t=this.host)&&void 0!==t?t:this;e.ref&&delete e.ref[this.refName]}},{key:"connectedMoveCallback",value:function(){}},{key:"attributeChangedCallback",value:function(t,e,n){var r=this;e!==n&&(this.isConnected?tn(o,this,l).call(this,t,e,n):Ze(i,this).push((function(){return tn(o,r,l).call(r,t,e,n)})))}},{key:"getState",value:function(t){var n,r,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.isNativeElement&&this.host?this.host:this,a=!1;if(i&&i.state&&Object.hasOwn(i.state,t)&&(a=!0,r=(n=i.state)[t]),!a)for(;!a&&i.host;)(i=i.host)&&i.state&&Object.hasOwn(i.state,t)&&(a=!0,r=(n=i.state)[t]);if(!a){var l=e[d]();l&&Object.hasOwn(l,t)&&(a=!0,r=(n=l)[t])}return a||(r=void 0),o?[r,n]:r}},{key:"findElement",value:function(t){var n=this.host||this,r=n;return e.SPROUT_CONFIG.useShadow&&(r=n.shadowRoot),Object.hasOwn(n.ref,t)?n.ref[t]:r.querySelector('[ref="'.concat(t,'"]'))}},{key:"initialSetText",value:function(t){ut.call(this,t)}},{key:"initialSetAttribute",value:function(t,e){e=String(e);var n=0===e.indexOf("@"),r=function(t){return 0===t.indexOf(":")}(t),o=e;if(r){0;var i=e,a=t.substring(1);"textcontent"===a?this.initialSetText(i):lt.call(this,a,i)}else{if(n){var l=this.getHost();0;var u=e.substring(1);o=l.getAttribute(u)}"textcontent"===t?this.textContent=o:at.call(this,t,o)}}},{key:"onAfterPaint",value:function(t){requestAnimationFrame((function(){return requestAnimationFrame(t)}))}}])}(t);function l(t,e,n){var r=this.isNativeElement?this.host||this.getRootNode().host:this;if("ref"===t){var o=n;r.ref[o]=this,this.refName=o}}if(Ye(a,"observedAttributes",s),n){var u=new WeakMap,c=function(t){function e(){var t;Fe(this,e);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return Ye(t=Ge(this,e,[].concat(r)),"boundAttributesToState",new Map),Ve(t,u,void 0),t}return Be(e,t),Ue(e,[{key:"bindAttributeToState",value:function(t,e){this.boundAttributesToState.set(t,e)}},{key:"updateStateFromAttribute",value:function(t){var e=rt(this.getAttribute(t)),n=this.boundAttributesToState.get(t),r=De(this.getState(n,!0),2),o=r[0],i=r[1];if(o===Symbol.for(E.STATE_NOT_FOUND))throw Error("updateStateFromAttribute: State property ".concat(n," not found"));o!==e&&(i[n]=e)}},{key:"activate",value:function(){xe(ze(e.prototype),"activate",this).call(this),Je(u,this,(function(){var t=new Event("inputChange",{bubbles:!0,composed:!0});if("checkbox"===this.type){var e=this.host.state._stateManager.nodeManager.bindableAttributesStateNodes.get("checked"),n=null;e.has(this)&&(n=e.get(this)),this.checked?(n||(n=document.createAttribute("checked")),this.setAttributeNode(n)):(n||(n=this.getAttributeNode("checked")),n&&this.removeAttributeNode(n))}this.dispatchEvent(t)})),this.addEventListener("change",Ze(u,this),!1)}},{key:"disconnectedCallback",value:function(){xe(ze(e.prototype),"disconnectedCallback",this).call(this),Ze(u,this)&&this.removeEventListener("change",Ze(u,this)),this.boundAttributesToState.clear()}},{key:"attributeChangedCallback",value:function(t,n,r){if(xe(ze(e.prototype),"attributeChangedCallback",this).apply(this,arguments),f.has(t)){var o=rt(r);this[t]!==o&&(this[t]=o)}this.boundAttributesToState.has(t)&&this.updateStateFromAttribute(t)}}])}(a);return Ye(c,"observedAttributes",a.observedAttributes.concat(Ie(p))),c}return a}function nn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return rn(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function rn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function on(t){return on="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},on(t)}function an(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,yn(r.key),r)}}function ln(t,e){if(e&&("object"==on(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function un(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(un=function(){return!!t})()}function sn(){return sn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=cn(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},sn.apply(null,arguments)}function cn(t){return cn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},cn(t)}function fn(t,e){return fn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},fn(t,e)}function pn(t,e,n){hn(t,e),e.set(t,n)}function hn(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function dn(t,e,n){return(e=yn(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yn(t){var e=function(t,e){if("object"!=on(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=on(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==on(e)?e:e+""}function vn(t,e){return t.get(mn(t,e))}function bn(t,e,n){return t.set(mn(t,e),n),n}function mn(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var gn=new CSSStyleSheet;function wn(t){return wn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wn(t)}function Sn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,s=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(t,e)||En(t,e)||function(){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 On(t){return function(t){if(Array.isArray(t))return An(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||En(t)||function(){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 En(t,e){if(t){if("string"==typeof t)return An(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?An(t,e):void 0}}function An(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Mn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,_n(r.key),r)}}function Tn(t,e,n){return e=Pn(e),function(t,e){if(e&&("object"==wn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,jn()?Reflect.construct(e,n||[],Pn(t).constructor):e.apply(t,n))}function jn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(jn=function(){return!!t})()}function Pn(t){return Pn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Pn(t)}function kn(t,e){return kn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},kn(t,e)}function _n(t){var e=function(t,e){if("object"!=wn(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=wn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==wn(e)?e:e+""}function Nn(t,e,n){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,n)}function Cn(t,e,n){return t.set(Rn(t,e),n),n}function Ln(t,e){return t.get(Rn(t,e))}function Rn(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}function In(t){return In="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},In(t)}function Dn(){Dn=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),l=new _(r||[]);return o(a,"_invoke",{value:T(t,n,l)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var p="suspendedStart",h="suspendedYield",d="executing",y="completed",v={};function b(){}function m(){}function g(){}var w={};s(w,a,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(N([])));O&&O!==n&&r.call(O,a)&&(w=O);var E=g.prototype=b.prototype=Object.create(w);function A(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function M(t,e){function n(o,i,a,l){var u=f(t[o],t,i);if("throw"!==u.type){var s=u.arg,c=s.value;return c&&"object"==In(c)&&r.call(c,"__await")?e.resolve(c.__await).then((function(t){n("next",t,a,l)}),(function(t){n("throw",t,a,l)})):e.resolve(c).then((function(t){s.value=t,a(s)}),(function(t){return n("throw",t,a,l)}))}l(u.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function T(e,n,r){var o=p;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var l=r.delegate;if(l){var u=j(l,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=d;var s=f(e,n,r);if("normal"===s.type){if(o=r.done?y:h,s.arg===v)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=y,r.method="throw",r.arg=s.arg)}}}function j(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,j(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function N(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(In(e)+" is not iterable")}return m.prototype=g,o(E,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=s(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,s(t,u,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},A(M.prototype),s(M.prototype,l,(function(){return this})),e.AsyncIterator=M,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new M(c(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},A(E),s(E,u,"Generator"),s(E,a,(function(){return this})),s(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=N,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return l.type="throw",l.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:N(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function xn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Hn(r.key),r)}}function $n(t,e,n){return e&&xn(t.prototype,e),n&&xn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Hn(t){var e=function(t,e){if("object"!=In(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=In(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==In(e)?e:e+""}function Fn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Kn(t,e,n){return e=Gn(e),function(t,e){if(e&&("object"==In(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Un()?Reflect.construct(e,n||[],Gn(t).constructor):e.apply(t,n))}function Un(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Un=function(){return!!t})()}function Gn(t){return Gn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Gn(t)}function qn(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&&zn(t,e)}function zn(t,e){return zn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},zn(t,e)}function Bn(t,e,n,r,o,i,a){try{var l=t[i](a),u=l.value}catch(t){return void n(t)}l.done?e(u):Promise.resolve(u).then(r,o)}function Wn(t){return Wn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wn(t)}function Vn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Xn(r.key),r)}}function Xn(t){var e=function(t,e){if("object"!=Wn(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Wn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Wn(e)?e:e+""}function Yn(t,e,n){return e=Jn(e),function(t,e){if(e&&("object"==Wn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Qn()?Reflect.construct(e,n||[],Jn(t).constructor):e.apply(t,n))}function Qn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Qn=function(){return!!t})()}function Jn(t){return Jn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Jn(t)}function Zn(t,e){return Zn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Zn(t,e)}function tr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}gn.replaceSync(":host { contain: layout paint; }");var er=document.currentScript,nr=(null==er?void 0:er.hasAttribute("strict"))||!1,rr=Te,or={useShadow:!0,allowAppScopeAccess:!0,useDSD:!1,strict:nr,appName:(null==er?void 0:er.getAttribute("app"))||"sprout-app",stateManagerClass:rr};or.allowAppScopeAccess&&Object.defineProperty(globalThis,"sproutApps",{value:{},writable:!1});var ir,ar=new CSSStyleSheet;ar.replaceSync(T),document.adoptedStyleSheets=[].concat(function(t){if(Array.isArray(t))return tr(t)}(ir=document.adoptedStyleSheets)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(ir)||function(t,e){if(t){if("string"==typeof t)return tr(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?tr(t,e):void 0}}(ir)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[ar]);var lr,ur=(window,{window,document:null===(lr=window)||void 0===lr?void 0:lr.document});or.allowAppScopeAccess&&Object.defineProperty(globalThis.sproutApps,or.appName,{value:ur,writable:!1}),ur.SPROUT_CONFIG=Object.seal(or);var sr=Object.prototype.hasOwnProperty;J(Object.prototype,"hasOwnProperty",sr),ur[d]=function(){return y},ur.setGlobalState=function(){var t=Gt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},void 0,void 0,ft,!0,ur).state,e="SproutGlobalState";return Object.defineProperty(ur,e,{value:t,writable:!1,configurable:!1}),Object.defineProperty(ur,d,{value:function(){return ur[e]}}),ur[e]},ur.setCommands=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.defineProperty(ur,"appCommands",{value:t,writable:!1,configurable:!1})};var cr={};v.forEach((function(t){return cr[t.element]=en(t.class,ur,!0)})),ur.ReactiveCustomElement=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window,e=en(HTMLElement,t),n=(t.SPROUT_CONFIG.stateManagerClass,new WeakMap),r=new WeakMap,o=new WeakMap,i=new WeakMap,a=new WeakMap,l=new WeakMap,u=new WeakMap,s=new WeakMap,c=new WeakSet,f=function(e){function f(){var t,e,h,d,v=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,m=arguments.length>1?arguments[1]:void 0,g=arguments.length>2?arguments[2]:void 0,w=arguments.length>3?arguments[3]:void 0,S=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,f),e=this,h=cn(h=f),function(t,e){hn(t,e),e.add(t)}(t=ln(e,un()?Reflect.construct(h,d||[],cn(e).constructor):h.apply(e,d)),c),dn(t,"ownerMapElement",void 0),dn(t,"state",void 0),dn(t,"stateKey",void 0),pn(t,n,!1),pn(t,r,{init:null,mount:null,stateful:null,active:null,unmount:null}),pn(t,o,void 0),pn(t,i,void 0),pn(t,a,void 0),dn(t,"events",void 0),dn(t,"eventsMap",new Map),pn(t,l,void 0),dn(t,"propAttributes",new Map),pn(t,u,!1),pn(t,s,void 0),dn(t,"commands",void 0),dn(t,"ref",{}),dn(t,"canonicalTagName",void 0),"CONDITIONAL-ELEMENT"===t.tagName)return ln(t);if(t.isNativeElement=!1,bn(u,t,S),w&&bn(a,t,w),t.canonicalTagName=t.localName,vn(u,t))t.canonicalTagName=t.localName.substring(0,t.localName.indexOf("-dsd"));else{if(g){var O=new CSSStyleSheet;O.replaceSync(g),bn(i,t,O)}bn(o,t,v?document.importNode(v,!0):document.importNode(b,!0)),mn(c,t,y).call(t)}return m&&mn(c,t,p).call(t,m),vn(r,t).init&&vn(r,t).init.call(t),t}return function(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&&fn(t,e)}(f,e),d=f,(g=[{key:"setInitialState",value:function(t){this.initialState?Object.assign(this.initialState,t):this.initialState=t,t.hasOwnProperty("key")&&(this.stateKey=t.key)}},{key:"disconnectedCallback",value:function(){mn(c,this,v).call(this),this.state=void 0,this.isActive=!1,vn(r,this).unmount&&vn(r,this).unmount.call(this)}},{key:"activate",value:function(){sn(cn(f.prototype),"activate",this).call(this),mn(c,this,m).call(this),vn(r,this).active&&vn(r,this).active.call(this)}},{key:"findElement",value:function(e){var n,r,o=this,i=this;return t.SPROUT_CONFIG.useShadow&&(i=o.shadowRoot),Object.hasOwn(o.ref,e)?o.ref[e]:(null===(n=i)||void 0===n||null===(r=n.querySelector)||void 0===r?void 0:r.call(n,'[ref="'.concat(e,'"]')))||null}},{key:"connectedCallback",value:function(){var t=this;if(this.setAttribute("tagName",this.canonicalTagName),!vn(n,this)){var e=this.getRootNode().host;vn(r,this).mount&&vn(r,this).mount.call(this);var o=function(){mn(c,t,h).call(t),t.isActive=!0,t.dispatchEvent(new CustomEvent("active")),vn(r,t).stateful&&vn(r,t).stateful.call(t),t.activate()};e?e.isActive?o():e.addEventListener("active",o,{once:!0}):setTimeout(o,0),bn(n,this,!0)}}},{key:"attributeChangedCallback",value:function(t,e,n){e!==n&&("hidden"===t&&(null===n?this.dispatchEvent(new CustomEvent("unhide",{bubbles:!0})):this.dispatchEvent(new CustomEvent("hide",{bubbles:!0}))),this.propAttributes.has(t)&&this.propAttributes.get(t).forEach((function(t){t.nodeValue=n,"CONDITIONAL-RENDER"===t.ownerElement.tagName&&t.ownerElement.render()})))}}])&&an(d.prototype,g),w&&an(d,w),Object.defineProperty(d,"prototype",{writable:!1}),d;var d,g,w}(e);function p(t){var e=this;if(bn(s,this,t.settings),this.commands=t.commands,t.events){var o,i,a=function(t,n,r){e.eventsMap.has(t)||e.eventsMap.set(t,new Map),e.eventsMap.get(t).set(n,r)};for(var l in t.events)if("function"===(i=on(o=t.events[l])))a("click",l,o);else if("object"===i)for(var u in o)a(u,l,o[u]);this.isConnected&&mn(c,this,m).call(this)}for(var f in t.state&&(this.setInitialState(t.state),this.isConnected&&vn(n,this)&&!this.state&&mn(c,this,h).call(this)),vn(r,this))t.hasOwnProperty(f)&&(vn(r,this)[f]=t[f])}function h(){var e;if(this.initialState&&(null===(e=this.state)||void 0===e||!e._isActive)){var n=this.initialState;if(n._stateManager)this.state=n._stateManager.state;else{var r=Gt(n,void 0,void 0,ft,!1,t);this.state=r.state,this.state.$host=this}this.state._isActive=!0}}function y(){if(t.SPROUT_CONFIG.useShadow)this.attachShadow({mode:"open",delegatesFocus:!0}),this.shadowRoot.adoptedStyleSheets=[gn],vn(a,this)&&this.shadowRoot.adoptedStyleSheets.push(vn(a,this)),vn(i,this)&&this.shadowRoot.adoptedStyleSheets.push(vn(i,this)),this.shadowRoot.appendChild(vn(o,this));else{var e=new DocumentFragment;e.appendChild(vn(o,this)),this.appendChild(e)}}function v(){if(this.eventsMap.size){var t,e=nn(this.eventsMap.keys());try{for(e.s();!(t=e.n()).done;){var n=t.value;this.shadowRoot.removeEventListener(n,vn(l,this),!1)}}catch(t){e.e(t)}finally{e.f()}}}function m(){if(!vn(l,this)&&this.eventsMap.size){var e=t[d]();bn(l,this,(function(t){var n=this.host,r=n.eventsMap.get(t.type);if(!r)return!1;var o,i=nn(t.composedPath());try{for(i.s();!(o=i.n()).done;){var a=o.value;if(a&&a.refName&&r.has(a.refName)){var l=a,u=l.refName;r.get(u).call(l,t,n,e)}}}catch(t){i.e(t)}finally{i.f()}t.stopPropagation()}));var n,r=nn(this.eventsMap.keys());try{for(r.s();!(n=r.n()).done;){var o=n.value;this.shadowRoot.addEventListener(o,vn(l,this),{capture:!0})}}catch(t){r.e(t)}finally{r.f()}}}return f}(ur),function(t,e){var n,r;function o(){var e;return e=Dn().mark((function e(n,r,o){var i,a,l,u,s;return Dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=n.content,(a=i.querySelector("style"))&&i.removeChild(a),(u=i.querySelector("script"))&&(s=u.textContent,i.removeChild(u),s&&0!==s.trim().length))try{l=Function(s)()}catch(t){}customElements.define(r,function(t){function e(){var t;return Fn(this,e),Kn(this,e,[i,l,null===(t=a)||void 0===t?void 0:t.textContent,o])}return qn(e,t),$n(e)}(t.ReactiveCustomElement)),customElements.define("".concat(r,"-dsd"),function(t){function e(){return Fn(this,e),Kn(this,e,[i,l,null,o,!0])}return qn(e,t),$n(e)}(t.ReactiveCustomElement));case 7:case"end":return e.stop()}}),e)})),o=function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(t){Bn(i,r,o,a,l,"next",t)}function l(t){Bn(i,r,o,a,l,"throw",t)}a(void 0)}))},o.apply(this,arguments)}t.scopedCustomElementRegistry,n=new CSSStyleSheet,(r=document.querySelector('head > style[app="'.concat(e,'"]')))?n.replaceSync(r.textContent):n.replaceSync(""),n.insertRule(T),"function"==typeof globalThis["".concat(e,"_runtime")]&&globalThis["".concat(e,"_runtime")].call(t),Array.prototype.forEach.call(document.querySelectorAll('template[app="'.concat(e,'"]')),(function(t){var e=t.getAttribute("for");e&&function(t,e,n){o.apply(this,arguments)}(t,e,n)}))}(ur,or.appName),v.forEach((function(t){customElements.define("reactive-".concat(t.element),cr[t.element],{extends:t.element})}));var fr=en(HTMLHeadingElement,ur);["h1","h2","h3","h4","h5","h6"].forEach((function(t){customElements.define("reactive-".concat(t),function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Yn(this,e,arguments)}return function(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&&Zn(t,e)}(e,t),function(t,e,n){return e&&Vn(t.prototype,e),n&&Vn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(e)}(fr),{extends:t})}));var pr=en(HTMLInputElement,ur,!0);customElements.define("reactive-input",pr,{extends:"input"});var hr=function(t){var e,n,r,o=new WeakMap,i=new WeakMap,a=new WeakMap,l=function(t){function e(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var n=arguments.length,r=new Array(n),l=0;l<n;l++)r[l]=arguments[l];return Nn(t=Tn(this,e,[].concat(r)),o,void 0),Nn(t,i,void 0),Nn(t,a,void 0),t}return function(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&&kn(t,e)}(e,t),n=e,r=[{key:"render",value:function(){var t,e=this,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(Ln(o,this)){if(void 0===(t=this.getState(Ln(i,this))))throw Error("State value for ".concat(Ln(i,this)," not found while rendering conditional-render element:"),this)}else if(void 0===(t=this.getAttribute("_condition")))throw Error("_condition value not found while rendering conditional-render element:",this);var r=[];Ln(a,this).forEach((function(e){var n=e.condition,o=e.elements;(function(t,e,n){if("always"===t)return!0;switch(t){case"==":default:return n==e;case"===":return n===e;case"!=":return n!=e;case"!==":return n!==e;case"<":return n<e;case"<=":return n<=e;case">":return n>e;case">=":return n>=e}})(n.operator,n.value,t)&&r.push.apply(r,On(o))})),n?(this.innerHTML="",this.append.apply(this,r)):r.length&&K(this,(function(){e.innerHTML="",e.append.apply(e,r)}))}},{key:"generateRenderMap",value:function(){var t=new Map;t.set("always",[]),On(this.children).forEach((function(e){var n,r,o=e.getAttribute("_if").replaceAll(" ","");if(o)if(t.has(o))t.get(o).elements.push(e);else{var i=Sn(cond.trim().split(CONDITIONAL_OPERATORS_REGEX),3),a=i[1],l=i[2],u={operator:a,value:(r=n=l,"true"===n?r=!0:"false"===n?r=!1:isNaN(Number(n))||(r=Number(n)),r)};t.set(o,{condition:u,elements:[e]})}else t.get("always").elements.push(e)})),Cn(a,this,t)}},{key:"activate",value:function(){var t=this.getAttribute("_condition");if(!t)throw Error("conditional-render elements must have a _condition attribute!");if(0===t.indexOf("@")?(Z.call(this,"_condition",t),Cn(o,this,!1),Cn(i,this,t.substring(1))):(Cn(o,this,!0),Cn(i,this,t)),Ln(o,this)){var e=Ln(i,this),n=Sn(this.getState(e,!0),2),r=n[0],a=n[1];if(void 0===wn(r))throw Error("State property ".concat(e," not defined for _condition command!"));var l=a._stateManager;l.has("conditional-element")||l.use(It,"conditional-element"),l.addConditionallyRenderingElements(e,this),this.generateRenderMap(),this.render(!0)}else this.render(!0)}}],r&&Mn(n.prototype,r),l&&Mn(n,l),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,l}(t);return e=l,r=["_condition"],(n=_n(n="observedAttributes"))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,l}(en(HTMLElement,ur));customElements.define("conditional-render",hr)})();
2
2
  //# sourceMappingURL=sprout-core.strict.min.js.map