PageSourceSearch

https://assets0.simplero.com/packs/vite/assets/application-AWWIFmtR.js

js simplero.com collected 2026-10-01 11:46:41 UTC 41,922 bytes, 6 lines download raw bytes

1var e=class{constructor(e,t,n){this.eventTarget=e,this.eventName=t,this.eventOptions=n,this.unorderedBindings=new Set}connect(){this.eventTarget.addEventListener(this.eventName,this,this.eventOptions)}disconnect(){this.eventTarget.removeEventListener(this.eventName,this,this.eventOptions)}bindingConnected(e){this.unorderedBindings.add(e)}bindingDisconnected(e){this.unorderedBindings.delete(e)}handleEvent(e){let n=t(e);for(let e of this.bindings)if(n.immediatePropagationStopped)break;else e.handleEvent(n)}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort((e,t)=>{let n=e.index,r=t.index;return n<r?-1:+(n>r)})}};function t(e){if(`immediatePropagationStopped`in e)return e;{let{stopImmediatePropagation:t}=e;return Object.assign(e,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,t.call(this)}})}}var n=class{constructor(e){this.application=e,this.eventListenerMaps=new Map,this.started=!1}start(){this.started||(this.started=!0,this.eventListeners.forEach(e=>e.connect()))}stop(){this.started&&(this.started=!1,this.eventListeners.forEach(e=>e.disconnect()))}get eventListeners(){return Array.from(this.eventListenerMaps.values()).reduce((e,t)=>e.concat(Array.from(t.values())),[])}bindingConnected(e){this.fetchEventListenerForBinding(e).bindingConnected(e)}bindingDisconnected(e,t=!1){this.fetchEventListenerForBinding(e).bindingDisconnected(e),t&&this.clearEventListenersForBinding(e)}handleError(e,t,n={}){this.application.handleError(e,`Error ${t}`,n)}clearEventListenersForBinding(e){let t=this.fetchEventListenerForBinding(e);t.hasBindings()||(t.disconnect(),this.removeMappedEventListenerFor(e))}removeMappedEventListenerFor(e){let{eventTarget:t,eventName:n,eventOptions:r}=e,i=this.fetchEventListenerMapForEventTarget(t),a=this.cacheKey(n,r);i.delete(a),i.size==0&&this.eventListenerMaps.delete(t)}fetchEventListenerForBinding(e){let{eventTarget:t,eventName:n,eventOptions:r}=e;return this.fetchEventListener(t,n,r)}fetchEventListener(e,t,n){let r=this.fetchEventListenerMapForEventTarget(e),i=this.cacheKey(t,n),a=r.get(i);return a||(a=this.createEventListener(e,t,n),r.set(i,a)),a}createEventListener(t,n,r){let i=new e(t,n,r);return this.started&&i.connect(),i}fetchEventListenerMapForEventTarget(e){let t=this.eventListenerMaps.get(e);return t||(t=new Map,this.eventListenerMaps.set(e,t)),t}cacheKey(e,t){let n=[e];return Object.keys(t).sort().forEach(e=>{n.push(`${t[e]?``:`!`}${e}`)}),n.join(`:`)}},r={stop({event:e,value:t}){return t&&e.stopPropagation(),!0},prevent({event:e,value:t}){return t&&e.preventDefault(),!0},self({event:e,value:t,element:n}){return t?n===e.target:!0}},i=/^(?:(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function a(e){let t=e.trim().match(i)||[],n=t[1],r=t[2];return r&&![`keydown`,`keyup`,`keypress`].includes(n)&&(n+=`.${r}`,r=``),{eventTarget:o(t[3]),eventName:n,eventOptions:t[6]?s(t[6]):{},identifier:t[4],methodName:t[5],keyFilter:r}}function o(e){if(e==`window`)return window;if(e==`document`)return document}function s(e){return e.split(`:`).reduce((e,t)=>Object.assign(e,{[t.replace(/^!/,``)]:!/^!/.test(t)}),{})}function ee(e){if(e==window)return`window`;if(e==document)return`document`}function c(e){return e.replace(/(?:[_-])([a-z0-9])/g,(e,t)=>t.toUpperCase())}function l(e){return c(e.replace(/--/g,`-`).replace(/__/g,`_`))}function u(e){return e.charAt(0).toUpperCase()+e.slice(1)}function d(e){return e.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`)}function te(e){return e.match(/[^\s]+/g)||[]}var f=class{constructor(e,t,n,r){this.element=e,this.index=t,this.eventTarget=n.eventTarget||e,this.eventName=n.eventName||ne(e)||m(`missing event name`),this.eventOptions=n.eventOptions||{},this.identifier=n.identifier||m(`missing identifier`),this.methodName=n.methodName||m(`missing method name`),this.keyFilter=n.keyFilter||``,this.schema=r}static forToken(e,t){return new this(e.element,e.index,a(e.content),t)}toString(){let e=this.keyFilter?`.${this.keyFilter}`:``,t=this.eventTargetName?`@${this.eventTargetName}`:``;return`${this.eventName}${e}${t}->${this.identifier}#${this.methodName}`}isFilterTarget(e){if(!this.keyFilter)return!1;let t=this.keyFilter.split(`+`),n=[`meta`,`ctrl`,`alt`,`shift`],[r,i,a,o]=n.map(e=>t.includes(e));if(e.metaKey!==r||e.ctrlKey!==i||e.altKey!==a||e.shiftKey!==o)return!0;let s=t.filter(e=>!n.includes(e))[0];return s?(Object.prototype.hasOwnProperty.call(this.keyMappings,s)||m(`contains unknown key filter: ${this.keyFilter}
1`),this.keyMappings[s].toLowerCase()!==e.key.toLowerCase()):!1}get params(){let e={},t=RegExp(`^data-${this.identifier}-(.+)-param$`,`i`);for(let{name:n,value:r}of Array.from(this.element.attributes)){let i=n.match(t),a=i&&i[1];a&&(e[c(a)]=re(r))}return e}get eventTargetName(){return ee(this.eventTarget)}get keyMappings(){return this.schema.keyMappings}},p={a:()=>`click`,button:()=>`click`,form:()=>`submit`,details:()=>`toggle`,input:e=>e.getAttribute(`type`)==`submit`?`click`:`input`,select:()=>`change`,textarea:()=>`input`};function ne(e){let t=e.tagName.toLowerCase();if(t in p)return p[t](e)}function m(e){throw Error(e)}function re(e){try{return JSON.parse(e)}catch{return e}}var h=class{constructor(e,t){this.context=e,this.action=t}get index(){return this.action.index}get eventTarget(){return this.action.eventTarget}get eventOptions(){return this.action.eventOptions}get identifier(){return this.context.identifier}handleEvent(e){this.willBeInvokedByEvent(e)&&this.applyEventModifiers(e)&&this.invokeWithEvent(e)}get eventName(){return this.action.eventName}get method(){let e=this.controller[this.methodName];if(typeof e==`function`)return e;throw Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}applyEventModifiers(e){let{element:t}=this.action,{actionDescriptorFilters:n}=this.context.application,r=!0;for(let[i,a]of Object.entries(this.eventOptions))if(i in n){let o=n[i];r&&=o({name:i,value:a,event:e,element:t})}else continue;return r}invokeWithEvent(e){let{target:t,currentTarget:n}=e;try{let{params:r}=this.action,i=Object.assign(e,{params:r});this.method.call(this.controller,i),this.context.logDebugActivity(this.methodName,{event:e,target:t,currentTarget:n,action:this.methodName})}catch(t){let{identifier:n,controller:r,element:i,index:a}=this,o={identifier:n,controller:r,element:i,index:a,event:e};this.context.handleError(t,`invoking action "${this.action}"`,o)}}willBeInvokedByEvent(e){let t=e.target;return e instanceof KeyboardEvent&&this.action.isFilterTarget(e)?!1:this.element===t?!0:t instanceof Element&&this.element.contains(t)?this.scope.containsElement(t):this.scope.containsElement(this.action.element)}get controller(){return this.context.controller}get methodName(){return this.action.methodName}get element(){return this.scope.element}get scope(){return this.context.scope}},g=class{constructor(e,t){this.mutationObserverInit={attributes:!0,childList:!0,subtree:!0},this.element=e,this.started=!1,this.delegate=t,this.elements=new Set,this.mutationObserver=new MutationObserver(e=>this.processMutations(e))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,this.mutationObserverInit),this.refresh())}pause(e){this.started&&=(this.mutationObserver.disconnect(),!1),e(),this.started||=(this.mutationObserver.observe(this.element,this.mutationObserverInit),!0)}stop(){this.started&&=(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),!1)}refresh(){if(this.started){let e=new Set(this.matchElementsInTree());for(let t of Array.from(this.elements))e.has(t)||this.removeElement(t);for(let t of Array.from(e))this.addElement(t)}}processMutations(e){if(this.started)for(let t of e)this.processMutation(t)}processMutation(e){e.type==`attributes`?this.processAttributeChange(e.target,e.attributeName):e.type==`childList`&&(this.processRemovedNodes(e.removedNodes),this.processAddedNodes(e.addedNodes))}processAttributeChange(e,t){let n=e;this.elements.has(n)?this.delegate.elementAttributeChanged&&this.matchElement(n)?this.delegate.elementAttributeChanged(n,t):this.removeElement(n):this.matchElement(n)&&this.addElement(n)}processRemovedNodes(e){for(let t of Array.from(e)){let e=this.elementFromNode(t);e&&this.processTree(e,this.removeElement)}}processAddedNodes(e){for(let t of Array.from(e)){let e=this.elementFromNode(t);e&&this.elementIsActive(e)&&this.processTree(e,this.addElement)}}matchElement(e){return this.delegate.matchElement(e)}matchElementsInTree(e=this.element){return this.delegate.matchElementsInTree(e)}processTree(e,t){for(let n of this.matchElementsInTree(e))t.call(this,n)}elementFromNode(e){if(e.nodeType==Node.ELEMENT_NODE)return e}elementIsActive(e){return e.isConnected==this.element.isConnected?this.element.contains(e):!1}
1addElement(e){this.elements.has(e)||this.elementIsActive(e)&&(this.elements.add(e),this.delegate.elementMatched&&this.delegate.elementMatched(e))}removeElement(e){this.elements.has(e)&&(this.elements.delete(e),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(e))}},ie=class{constructor(e,t,n){this.attributeName=t,this.delegate=n,this.elementObserver=new g(e,this)}get element(){return this.elementObserver.element}get selector(){return`[${this.attributeName}]`}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get started(){return this.elementObserver.started}matchElement(e){return e.hasAttribute(this.attributeName)}matchElementsInTree(e){let t=this.matchElement(e)?[e]:[],n=Array.from(e.querySelectorAll(this.selector));return t.concat(n)}elementMatched(e){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(e,this.attributeName)}elementUnmatched(e){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(e,this.attributeName)}elementAttributeChanged(e,t){this.delegate.elementAttributeValueChanged&&this.attributeName==t&&this.delegate.elementAttributeValueChanged(e,t)}};function ae(e,t,n){_(e,t).add(n)}function oe(e,t,n){_(e,t).delete(n),se(e,t)}function _(e,t){let n=e.get(t);return n||(n=new Set,e.set(t,n)),n}function se(e,t){let n=e.get(t);n!=null&&n.size==0&&e.delete(t)}var v=class{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce((e,t)=>e.concat(Array.from(t)),[])}get size(){return Array.from(this.valuesByKey.values()).reduce((e,t)=>e+t.size,0)}add(e,t){ae(this.valuesByKey,e,t)}delete(e,t){oe(this.valuesByKey,e,t)}has(e,t){let n=this.valuesByKey.get(e);return n!=null&&n.has(t)}hasKey(e){return this.valuesByKey.has(e)}hasValue(e){return Array.from(this.valuesByKey.values()).some(t=>t.has(e))}getValuesForKey(e){let t=this.valuesByKey.get(e);return t?Array.from(t):[]}getKeysForValue(e){return Array.from(this.valuesByKey).filter(([t,n])=>n.has(e)).map(([e,t])=>e)}},ce=class{constructor(e,t,n,r={}){this.selector=t,this.details=r,this.elementObserver=new g(e,this),this.delegate=n,this.matchesByElement=new v}get started(){return this.elementObserver.started}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get element(){return this.elementObserver.element}matchElement(e){let t=e.matches(this.selector);return this.delegate.selectorMatchElement?t&&this.delegate.selectorMatchElement(e,this.details):t}matchElementsInTree(e){let t=this.matchElement(e)?[e]:[],n=Array.from(e.querySelectorAll(this.selector)).filter(e=>this.matchElement(e));return t.concat(n)}elementMatched(e){this.selectorMatched(e)}elementUnmatched(e){this.selectorUnmatched(e)}elementAttributeChanged(e,t){let n=this.matchElement(e),r=this.matchesByElement.has(this.selector,e);!n&&r&&this.selectorUnmatched(e)}selectorMatched(e){this.delegate.selectorMatched&&(this.delegate.selectorMatched(e,this.selector,this.details),this.matchesByElement.add(this.selector,e))}selectorUnmatched(e){this.delegate.selectorUnmatched(e,this.selector,this.details),this.matchesByElement.delete(this.selector,e)}},le=class{constructor(e,t){this.element=e,this.delegate=t,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver(e=>this.processMutations(e))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,attributeOldValue:!0}),this.refresh())}stop(){this.started&&=(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),!1)}refresh(){if(this.started)for(let e of this.knownAttributeNames)this.refreshAttribute(e,null)}processMutations(e){if(this.started)for(let t of e)this.processMutation(t)}processMutation(e){let t=e.attributeName;t&&this.refreshAttribute(t,e.oldValue)}refreshAttribute(e,t){let n=this.delegate.getStringMapKeyForAttribute(e);if(n!=null){this.stringMap.has(e)||this.stringMapKeyAdded(n,e);let r=this.element.getAttribute(e);
1if(this.stringMap.get(e)!=r&&this.stringMapValueChanged(r,n,t),r==null){let t=this.stringMap.get(e);this.stringMap.delete(e),t&&this.stringMapKeyRemoved(n,e,t)}else this.stringMap.set(e,r)}}stringMapKeyAdded(e,t){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(e,t)}stringMapValueChanged(e,t,n){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(e,t,n)}stringMapKeyRemoved(e,t,n){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(e,t,n)}get knownAttributeNames(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))}get currentAttributeNames(){return Array.from(this.element.attributes).map(e=>e.name)}get recordedAttributeNames(){return Array.from(this.stringMap.keys())}},y=class{constructor(e,t,n){this.attributeObserver=new ie(e,t,this),this.delegate=n,this.tokensByElement=new v}get started(){return this.attributeObserver.started}start(){this.attributeObserver.start()}pause(e){this.attributeObserver.pause(e)}stop(){this.attributeObserver.stop()}refresh(){this.attributeObserver.refresh()}get element(){return this.attributeObserver.element}get attributeName(){return this.attributeObserver.attributeName}elementMatchedAttribute(e){this.tokensMatched(this.readTokensForElement(e))}elementAttributeValueChanged(e){let[t,n]=this.refreshTokensForElement(e);this.tokensUnmatched(t),this.tokensMatched(n)}elementUnmatchedAttribute(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))}tokensMatched(e){e.forEach(e=>this.tokenMatched(e))}tokensUnmatched(e){e.forEach(e=>this.tokenUnmatched(e))}tokenMatched(e){this.delegate.tokenMatched(e),this.tokensByElement.add(e.element,e)}tokenUnmatched(e){this.delegate.tokenUnmatched(e),this.tokensByElement.delete(e.element,e)}refreshTokensForElement(e){let t=this.tokensByElement.getValuesForKey(e),n=this.readTokensForElement(e),r=de(t,n).findIndex(([e,t])=>!fe(e,t));return r==-1?[[],[]]:[t.slice(r),n.slice(r)]}readTokensForElement(e){let t=this.attributeName;return ue(e.getAttribute(t)||``,e,t)}};function ue(e,t,n){return e.trim().split(/\s+/).filter(e=>e.length).map((e,r)=>({element:t,attributeName:n,content:e,index:r}))}function de(e,t){let n=Math.max(e.length,t.length);return Array.from({length:n},(n,r)=>[e[r],t[r]])}function fe(e,t){return e&&t&&e.index==t.index&&e.content==t.content}var b=class{constructor(e,t,n){this.tokenListObserver=new y(e,t,this),this.delegate=n,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}get started(){return this.tokenListObserver.started}start(){this.tokenListObserver.start()}stop(){this.tokenListObserver.stop()}refresh(){this.tokenListObserver.refresh()}get element(){return this.tokenListObserver.element}get attributeName(){return this.tokenListObserver.attributeName}tokenMatched(e){let{element:t}=e,{value:n}=this.fetchParseResultForToken(e);n&&(this.fetchValuesByTokenForElement(t).set(e,n),this.delegate.elementMatchedValue(t,n))}tokenUnmatched(e){let{element:t}=e,{value:n}=this.fetchParseResultForToken(e);n&&(this.fetchValuesByTokenForElement(t).delete(e),this.delegate.elementUnmatchedValue(t,n))}fetchParseResultForToken(e){let t=this.parseResultsByToken.get(e);return t||(t=this.parseToken(e),this.parseResultsByToken.set(e,t)),t}fetchValuesByTokenForElement(e){let t=this.valuesByTokenByElement.get(e);return t||(t=new Map,this.valuesByTokenByElement.set(e,t)),t}parseToken(e){try{return{value:this.delegate.parseValueForToken(e)}}catch(e){return{error:e}}}},x=class{constructor(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new b(this.element,this.actionAttribute,this),this.valueListObserver.start())}stop(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())}get element(){return this.context.element}get identifier(){return this.context.identifier}get actionAttribute(){return this.schema.actionAttribute}get schema(){return this.context.schema}get bindings(){return Array.from(this.bindingsByAction.values())}connectAction(e){let t=new h(this.context,e);this.bindingsByAction.set(e,t),this.delegate.bindingConnected(t)}disconnectAction(e){let t=this.bindingsByAction.get(e);t&&(this.bindingsByAction.delete(e),this.delegate.bindingDisconnected(t))}
1disconnectAllActions(){this.bindings.forEach(e=>this.delegate.bindingDisconnected(e,!0)),this.bindingsByAction.clear()}parseValueForToken(e){let t=f.forToken(e,this.schema);if(t.identifier==this.identifier)return t}elementMatchedValue(e,t){this.connectAction(t)}elementUnmatchedValue(e,t){this.disconnectAction(t)}},S=class{constructor(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new le(this.element,this),this.valueDescriptorMap=this.controller.valueDescriptorMap}start(){this.stringMapObserver.start(),this.invokeChangedCallbacksForDefaultValues()}stop(){this.stringMapObserver.stop()}get element(){return this.context.element}get controller(){return this.context.controller}getStringMapKeyForAttribute(e){if(e in this.valueDescriptorMap)return this.valueDescriptorMap[e].name}stringMapKeyAdded(e,t){let n=this.valueDescriptorMap[t];this.hasValue(e)||this.invokeChangedCallback(e,n.writer(this.receiver[e]),n.writer(n.defaultValue))}stringMapValueChanged(e,t,n){let r=this.valueDescriptorNameMap[t];e!==null&&(n===null&&(n=r.writer(r.defaultValue)),this.invokeChangedCallback(t,e,n))}stringMapKeyRemoved(e,t,n){let r=this.valueDescriptorNameMap[e];this.hasValue(e)?this.invokeChangedCallback(e,r.writer(this.receiver[e]),n):this.invokeChangedCallback(e,r.writer(r.defaultValue),n)}invokeChangedCallbacksForDefaultValues(){for(let{key:e,name:t,defaultValue:n,writer:r}of this.valueDescriptors)n!=null&&!this.controller.data.has(e)&&this.invokeChangedCallback(t,r(n),void 0)}invokeChangedCallback(e,t,n){let r=`${e}Changed`,i=this.receiver[r];if(typeof i==`function`){let r=this.valueDescriptorNameMap[e];try{let e=r.reader(t),a=n;n&&(a=r.reader(n)),i.call(this.receiver,e,a)}catch(e){throw e instanceof TypeError&&(e.message=`Stimulus Value "${this.context.identifier}.${r.name}" - ${e.message}`),e}}}get valueDescriptors(){let{valueDescriptorMap:e}=this;return Object.keys(e).map(t=>e[t])}get valueDescriptorNameMap(){let e={};return Object.keys(this.valueDescriptorMap).forEach(t=>{let n=this.valueDescriptorMap[t];e[n.name]=n}),e}hasValue(e){let t=this.valueDescriptorNameMap[e],n=`has${u(t.name)}`;return this.receiver[n]}},C=class{constructor(e,t){this.context=e,this.delegate=t,this.targetsByName=new v}start(){this.tokenListObserver||(this.tokenListObserver=new y(this.element,this.attributeName,this),this.tokenListObserver.start())}stop(){this.tokenListObserver&&(this.disconnectAllTargets(),this.tokenListObserver.stop(),delete this.tokenListObserver)}tokenMatched({element:e,content:t}){this.scope.containsElement(e)&&this.connectTarget(e,t)}tokenUnmatched({element:e,content:t}){this.disconnectTarget(e,t)}connectTarget(e,t){var n;this.targetsByName.has(t,e)||(this.targetsByName.add(t,e),(n=this.tokenListObserver)==null||n.pause(()=>this.delegate.targetConnected(e,t)))}disconnectTarget(e,t){var n;this.targetsByName.has(t,e)&&(this.targetsByName.delete(t,e),(n=this.tokenListObserver)==null||n.pause(()=>this.delegate.targetDisconnected(e,t)))}disconnectAllTargets(){for(let e of this.targetsByName.keys)for(let t of this.targetsByName.getValuesForKey(e))this.disconnectTarget(t,e)}get attributeName(){return`data-${this.context.identifier}-target`}get element(){return this.context.element}get scope(){return this.context.scope}};function w(e,t){let n=E(e);return Array.from(n.reduce((e,n)=>(D(n,t).forEach(t=>e.add(t)),e),new Set))}function T(e,t){return E(e).reduce((e,n)=>(e.push(...O(n,t)),e),[])}function E(e){let t=[];for(;e;)t.push(e),e=Object.getPrototypeOf(e);return t.reverse()}function D(e,t){let n=e[t];return Array.isArray(n)?n:[]}function O(e,t){let n=e[t];return n?Object.keys(n).map(e=>[e,n[e]]):[]}var k=class{constructor(e,t){this.context=e,this.delegate=t,this.outletsByName=new v,this.outletElementsByName=new v,this.selectorObserverMap=new Map}start(){this.selectorObserverMap.size===0&&(this.outletDefinitions.forEach(e=>{let t=this.selector(e),n={outletName:e};t&&this.selectorObserverMap.set(e,new ce(document.body,t,this,n))}),this.selectorObserverMap.forEach(e=>
1e.start())),this.dependentContexts.forEach(e=>e.refresh())}stop(){this.selectorObserverMap.size>0&&(this.disconnectAllOutlets(),this.selectorObserverMap.forEach(e=>e.stop()),this.selectorObserverMap.clear())}refresh(){this.selectorObserverMap.forEach(e=>e.refresh())}selectorMatched(e,t,{outletName:n}){let r=this.getOutlet(e,n);r&&this.connectOutlet(r,e,n)}selectorUnmatched(e,t,{outletName:n}){let r=this.getOutletFromMap(e,n);r&&this.disconnectOutlet(r,e,n)}selectorMatchElement(e,{outletName:t}){return this.hasOutlet(e,t)&&e.matches(`[${this.context.application.schema.controllerAttribute}~=${t}]`)}connectOutlet(e,t,n){var r;this.outletElementsByName.has(n,t)||(this.outletsByName.add(n,e),this.outletElementsByName.add(n,t),(r=this.selectorObserverMap.get(n))==null||r.pause(()=>this.delegate.outletConnected(e,t,n)))}disconnectOutlet(e,t,n){var r;this.outletElementsByName.has(n,t)&&(this.outletsByName.delete(n,e),this.outletElementsByName.delete(n,t),(r=this.selectorObserverMap.get(n))==null||r.pause(()=>this.delegate.outletDisconnected(e,t,n)))}disconnectAllOutlets(){for(let e of this.outletElementsByName.keys)for(let t of this.outletElementsByName.getValuesForKey(e))for(let n of this.outletsByName.getValuesForKey(e))this.disconnectOutlet(n,t,e)}selector(e){return this.scope.outlets.getSelectorForOutletName(e)}get outletDependencies(){let e=new v;return this.router.modules.forEach(t=>{let n=t.definition.controllerConstructor;w(n,`outlets`).forEach(n=>e.add(n,t.identifier))}),e}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){let e=this.dependentControllerIdentifiers;return this.router.contexts.filter(t=>e.includes(t.identifier))}hasOutlet(e,t){return!!this.getOutlet(e,t)||!!this.getOutletFromMap(e,t)}getOutlet(e,t){return this.application.getControllerForElementAndIdentifier(e,t)}getOutletFromMap(e,t){return this.outletsByName.getValuesForKey(t).find(t=>t.element===e)}get scope(){return this.context.scope}get identifier(){return this.context.identifier}get application(){return this.context.application}get router(){return this.application.router}},A=class{constructor(e,t){this.logDebugActivity=(e,t={})=>{let{identifier:n,controller:r,element:i}=this;t=Object.assign({identifier:n,controller:r,element:i},t),this.application.logDebugActivity(this.identifier,e,t)},this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new x(this,this.dispatcher),this.valueObserver=new S(this,this.controller),this.targetObserver=new C(this,this),this.outletObserver=new k(this,this);try{this.controller.initialize(),this.logDebugActivity(`initialize`)}catch(e){this.handleError(e,`initializing controller`)}}connect(){this.bindingObserver.start(),this.valueObserver.start(),this.targetObserver.start(),this.outletObserver.start();try{this.controller.connect(),this.logDebugActivity(`connect`)}catch(e){this.handleError(e,`connecting controller`)}}refresh(){this.outletObserver.refresh()}disconnect(){try{this.controller.disconnect(),this.logDebugActivity(`disconnect`)}catch(e){this.handleError(e,`disconnecting controller`)}this.outletObserver.stop(),this.targetObserver.stop(),this.valueObserver.stop(),this.bindingObserver.stop()}get application(){return this.module.application}get identifier(){return this.module.identifier}get schema(){return this.application.schema}get dispatcher(){return this.application.dispatcher}get element(){return this.scope.element}get parentElement(){return this.element.parentElement}handleError(e,t,n={}){let{identifier:r,controller:i,element:a}=this;n=Object.assign({identifier:r,controller:i,element:a},n),this.application.handleError(e,`Error ${t}`,n)}targetConnected(e,t){this.invokeControllerMethod(`${t}TargetConnected`,e)}targetDisconnected(e,t){this.invokeControllerMethod(`${t}TargetDisconnected`,e)}outletConnected(e,t,n){this.invokeControllerMethod(`${l(n)}OutletConnected`,e,t)}outletDisconnected(e,t,n){this.invokeControllerMethod(`${l(n)}OutletDisconnected`,e,t)}invokeControllerMethod(e,...t){let n=this.controller;typeof n[e]==`function`&&n[e](...t)}};function j(e){return M(e,N(e))}function M(e,t){let n=L(e),r=P(e.prototype,t);return Object.defineProperties(n.prototype,r),n}function N(e){return w(e,`blessings`).reduce((t,n)=>{let r=n(e);for(let e in r){let n=t[e]||{};t[e]=Object.assign(n,r[e])}return t},{})}function P(e,t){return I(t).reduce((n,r)=>{let i=F(e,t,r);return i&&Object.assign(n,{[r]:i}),n},{})}function F(e,t,n){let r=Object.getOwnPropertyDescriptor(e,n);if(!(r&&`value`in r)){let e=Object.getOwnPropertyDescriptor(t,n).value;return r&&(e.get=r.get||e.get,e.set=r.set||e.set),e}}var I=typeof Object.getOwnPropertySymbols==`function`?e=>[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)]:Object.getOwnPropertyNames,L=(()=>{function e(e){function t(){return Reflect.construct(e,arguments,new.target)}return t.prototype=Object.create(e.prototype,{constructor:{value:t}}),Reflect.setPrototypeOf(t,e),t}function t(){let t=e(function(){this.a.call(this)});return t.prototype.a=function(){},new t}try{return t(),e}catch{return e=>class extends e{}}})();function R(e){return{identifier:e.identifier,controllerConstructor:j(e.controllerConstructor)}}var z=class{constructor(e,t){this.application=e,this.definition=R(t),this.contextsByScope=new WeakMap,this.connectedContexts=new Set}get identifier(){return this.definition.identifier}get controllerConstructor(){return this.definition.controllerConstructor}get contexts(){return Array.from(this.connectedContexts)}connectContextForScope(e){let t=this.fetchContextForScope(e);this.connectedContexts.add(t),t.connect()}disconnectContextForScope(e){let t=this.contextsByScope.get(e);t&&(this.connectedContexts.delete(t),t.disconnect())}fetchContextForScope(e){let t=this.contextsByScope.get(e);return t||(t=new A(this,e),this.contextsByScope.set(e,t)),t}},B=class{constructor(e){this.scope=e}has(e){return this.data.has(this.getDataKey(e))}get(e){return this.getAll(e)[0]}getAll(e){return te(this.data.get(this.getDataKey(e))||``)}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}},V=class{constructor(e){this.scope=e}
1get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(e){let t=this.getAttributeNameForKey(e);return this.element.getAttribute(t)}set(e,t){let n=this.getAttributeNameForKey(e);return this.element.setAttribute(n,t),this.get(e)}has(e){let t=this.getAttributeNameForKey(e);return this.element.hasAttribute(t)}delete(e){if(this.has(e)){let t=this.getAttributeNameForKey(e);return this.element.removeAttribute(t),!0}else return!1}getAttributeNameForKey(e){return`data-${this.identifier}-${d(e)}`}},pe=class{constructor(e){this.warnedKeysByObject=new WeakMap,this.logger=e}warn(e,t,n){let r=this.warnedKeysByObject.get(e);r||(r=new Set,this.warnedKeysByObject.set(e,r)),r.has(t)||(r.add(t),this.logger.warn(n,e))}};function H(e,t){return`[${e}~="${t}"]`}var me=class{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return this.find(e)!=null}find(...e){return e.reduce((e,t)=>e||this.findTarget(t)||this.findLegacyTarget(t),void 0)}findAll(...e){return e.reduce((e,t)=>[...e,...this.findAllTargets(t),...this.findAllLegacyTargets(t)],[])}findTarget(e){let t=this.getSelectorForTargetName(e);return this.scope.findElement(t)}findAllTargets(e){let t=this.getSelectorForTargetName(e);return this.scope.findAllElements(t)}getSelectorForTargetName(e){return H(this.schema.targetAttributeForScope(this.identifier),e)}findLegacyTarget(e){let t=this.getLegacySelectorForTargetName(e);return this.deprecate(this.scope.findElement(t),e)}findAllLegacyTargets(e){let t=this.getLegacySelectorForTargetName(e);return this.scope.findAllElements(t).map(t=>this.deprecate(t,e))}getLegacySelectorForTargetName(e){let t=`${this.identifier}.${e}`;return H(this.schema.targetAttribute,t)}deprecate(e,t){if(e){let{identifier:n}=this,r=this.schema.targetAttribute,i=this.schema.targetAttributeForScope(n);this.guide.warn(e,`target:${t}`,`Please replace ${r}="${n}.${t}" with ${i}="${t}". The ${r} attribute is deprecated and will be removed in a future version of Stimulus.`)}return e}get guide(){return this.scope.guide}},he=class{constructor(e,t){this.scope=e,this.controllerElement=t}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return this.find(e)!=null}find(...e){return e.reduce((e,t)=>e||this.findOutlet(t),void 0)}findAll(...e){return e.reduce((e,t)=>[...e,...this.findAllOutlets(t)],[])}getSelectorForOutletName(e){let t=this.schema.outletAttributeForScope(this.identifier,e);return this.controllerElement.getAttribute(t)}findOutlet(e){let t=this.getSelectorForOutletName(e);if(t)return this.findElement(t,e)}findAllOutlets(e){let t=this.getSelectorForOutletName(e);return t?this.findAllElements(t,e):[]}findElement(e,t){return this.scope.queryElements(e).filter(n=>this.matchesElement(n,e,t))[0]}findAllElements(e,t){return this.scope.queryElements(e).filter(n=>this.matchesElement(n,e,t))}matchesElement(e,t,n){let r=e.getAttribute(this.scope.schema.controllerAttribute)||``;return e.matches(t)&&r.split(` `).includes(n)}},ge=class e{constructor(e,t,n,r){this.targets=new me(this),this.classes=new B(this),this.data=new V(this),this.containsElement=e=>e.closest(this.controllerSelector)===this.element,this.schema=e,this.element=t,this.identifier=n,this.guide=new pe(r),this.outlets=new he(this.documentScope,t)}findElement(e){return this.element.matches(e)?this.element:this.queryElements(e).find(this.containsElement)}findAllElements(e){return[...this.element.matches(e)?[this.element]:[],...this.queryElements(e).filter(this.containsElement)]}queryElements(e){return Array.from(this.element.querySelectorAll(e))}get controllerSelector(){return H(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new e(this.schema,document.documentElement,this.identifier,this.guide.logger)}},_e=class{constructor(e,t,n){this.element=e,this.schema=t,this.delegate=n,this.valueListObserver=new b(this.element,this.controllerAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap}start(){this.valueListObserver.start()}stop(){this.valueListObserver.stop()}get controllerAttribute(){return this.schema.controllerAttribute}parseValueForToken(e){let{element:t,content:n}=e,r=this.fetchScopesByIdentifierForElement(t),i=r.get(n);
1return i||(i=this.delegate.createScopeForElementAndIdentifier(t,n),r.set(n,i)),i}elementMatchedValue(e,t){let n=(this.scopeReferenceCounts.get(t)||0)+1;this.scopeReferenceCounts.set(t,n),n==1&&this.delegate.scopeConnected(t)}elementUnmatchedValue(e,t){let n=this.scopeReferenceCounts.get(t);n&&(this.scopeReferenceCounts.set(t,n-1),n==1&&this.delegate.scopeDisconnected(t))}fetchScopesByIdentifierForElement(e){let t=this.scopesByIdentifierByElement.get(e);return t||(t=new Map,this.scopesByIdentifierByElement.set(e,t)),t}},ve=class{constructor(e){this.application=e,this.scopeObserver=new _e(this.element,this.schema,this),this.scopesByIdentifier=new v,this.modulesByIdentifier=new Map}get element(){return this.application.element}get schema(){return this.application.schema}get logger(){return this.application.logger}get controllerAttribute(){return this.schema.controllerAttribute}get modules(){return Array.from(this.modulesByIdentifier.values())}get contexts(){return this.modules.reduce((e,t)=>e.concat(t.contexts),[])}start(){this.scopeObserver.start()}stop(){this.scopeObserver.stop()}loadDefinition(e){this.unloadIdentifier(e.identifier);let t=new z(this.application,e);this.connectModule(t);let n=e.controllerConstructor.afterLoad;n&&n(e.identifier,this.application)}unloadIdentifier(e){let t=this.modulesByIdentifier.get(e);t&&this.disconnectModule(t)}getContextForElementAndIdentifier(e,t){let n=this.modulesByIdentifier.get(t);if(n)return n.contexts.find(t=>t.element==e)}handleError(e,t,n){this.application.handleError(e,t,n)}createScopeForElementAndIdentifier(e,t){return new ge(this.schema,e,t,this.logger)}scopeConnected(e){this.scopesByIdentifier.add(e.identifier,e);let t=this.modulesByIdentifier.get(e.identifier);t&&t.connectContextForScope(e)}scopeDisconnected(e){this.scopesByIdentifier.delete(e.identifier,e);let t=this.modulesByIdentifier.get(e.identifier);t&&t.disconnectContextForScope(e)}connectModule(e){this.modulesByIdentifier.set(e.identifier,e),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(t=>e.connectContextForScope(t))}disconnectModule(e){this.modulesByIdentifier.delete(e.identifier),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(t=>e.disconnectContextForScope(t))}},U={controllerAttribute:`data-controller`,actionAttribute:`data-action`,targetAttribute:`data-target`,targetAttributeForScope:e=>`data-${e}-target`,outletAttributeForScope:(e,t)=>`data-${e}-${t}-outlet`,keyMappings:Object.assign(Object.assign({enter:`Enter`,tab:`Tab`,esc:`Escape`,space:` `,up:`ArrowUp`,down:`ArrowDown`,left:`ArrowLeft`,right:`ArrowRight`,home:`Home`,end:`End`},W(`abcdefghijklmnopqrstuvwxyz`.split(``).map(e=>[e,e]))),W(`0123456789`.split(``).map(e=>[e,e])))};function W(e){return e.reduce((e,[t,n])=>Object.assign(Object.assign({},e),{[t]:n}),{})}var ye=class{constructor(e=document.documentElement,t=U){this.logger=console,this.debug=!1,this.logDebugActivity=(e,t,n={})=>{this.debug&&this.logFormattedMessage(e,t,n)},this.element=e,this.schema=t,this.dispatcher=new n(this),this.router=new ve(this),this.actionDescriptorFilters=Object.assign({},r)}static start(e,t){let n=new this(e,t);return n.start(),n}async start(){await be(),this.logDebugActivity(`application`,`starting`),this.dispatcher.start(),this.router.start(),this.logDebugActivity(`application`,`start`)}stop(){this.logDebugActivity(`application`,`stopping`),this.dispatcher.stop(),this.router.stop(),this.logDebugActivity(`application`,`stop`)}register(e,t){this.load({identifier:e,controllerConstructor:t})}registerActionOption(e,t){this.actionDescriptorFilters[e]=t}load(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(e=>{e.controllerConstructor.shouldLoad&&this.router.loadDefinition(e)})}unload(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(e=>this.router.unloadIdentifier(e))}get controllers(){return this.router.contexts.map(e=>e.controller)}getControllerForElementAndIdentifier(e,t){let n=this.router.getContextForElementAndIdentifier(e,t);return n?n.controller:null}handleError(e,t,n){var r;this.logger.error(`%s
2
3%o
4
5%o`,t,e,n),(r=window.onerror)==null||r.call(window,t,``,0,0,e)}logFormattedMessage(e,t,n={}){n=Object.assign({application:this},n),this.logger.groupCollapsed(`${e} #${t}`),this.logger.log(`details:`,Object.assign({},n)),this.logger.groupEnd()}};function be(){return new Promise(e=>{document.readyState==`loading`?document.addEventListener(`DOMContentLoaded`,()=>e()):e()})}function xe(e){return w(e,`classes`).reduce((e,t)=>
5Object.assign(e,Se(t)),{})}function Se(e){return{[`${e}Class`]:{get(){let{classes:t}=this;if(t.has(e))return t.get(e);{let n=t.getAttributeName(e);throw Error(`Missing attribute "${n}"`)}}},[`${e}Classes`]:{get(){return this.classes.getAll(e)}},[`has${u(e)}Class`]:{get(){return this.classes.has(e)}}}}function Ce(e){return w(e,`outlets`).reduce((e,t)=>Object.assign(e,we(t)),{})}function we(e){let t=l(e);return{[`${t}Outlet`]:{get(){let t=this.outlets.find(e);if(t){let n=this.application.getControllerForElementAndIdentifier(t,e);if(n)return n;throw Error(`Missing "data-controller=${e}" attribute on outlet element for "${this.identifier}" controller`)}throw Error(`Missing outlet element "${e}" for "${this.identifier}" controller`)}},[`${t}Outlets`]:{get(){let t=this.outlets.findAll(e);return t.length>0?t.map(t=>{let n=this.application.getControllerForElementAndIdentifier(t,e);if(n)return n;console.warn(`The provided outlet element is missing the outlet controller "${e}" for "${this.identifier}"`,t)}).filter(e=>e):[]}},[`${t}OutletElement`]:{get(){let t=this.outlets.find(e);if(t)return t;throw Error(`Missing outlet element "${e}" for "${this.identifier}" controller`)}},[`${t}OutletElements`]:{get(){return this.outlets.findAll(e)}},[`has${u(t)}Outlet`]:{get(){return this.outlets.has(e)}}}}function Te(e){return w(e,`targets`).reduce((e,t)=>Object.assign(e,Ee(t)),{})}function Ee(e){return{[`${e}Target`]:{get(){let t=this.targets.find(e);if(t)return t;throw Error(`Missing target element "${e}" for "${this.identifier}" controller`)}},[`${e}Targets`]:{get(){return this.targets.findAll(e)}},[`has${u(e)}Target`]:{get(){return this.targets.has(e)}}}}function De(e){let t=T(e,`values`);return t.reduce((e,t)=>Object.assign(e,Oe(t)),{valueDescriptorMap:{get(){return t.reduce((e,t)=>{let n=G(t,this.identifier),r=this.data.getAttributeNameForKey(n.key);return Object.assign(e,{[r]:n})},{})}}})}function Oe(e,t){let n=G(e,t),{key:r,name:i,reader:a,writer:o}=n;return{[i]:{get(){let e=this.data.get(r);return e===null?n.defaultValue:a(e)},set(e){e===void 0?this.data.delete(r):this.data.set(r,o(e))}},[`has${u(i)}`]:{get(){return this.data.has(r)||n.hasCustomDefaultValue}}}}function G([e,t],n){return Me({controller:n,token:e,typeDefinition:t})}function K(e){switch(e){case Array:return`array`;case Boolean:return`boolean`;case Number:return`number`;case Object:return`object`;case String:return`string`}}function q(e){switch(typeof e){case`boolean`:return`boolean`;case`number`:return`number`;case`string`:return`string`}if(Array.isArray(e))return`array`;if(Object.prototype.toString.call(e)===`[object Object]`)return`object`}function ke(e){let t=K(e.typeObject.type);if(!t)return;let n=q(e.typeObject.default);if(t!==n){let r=e.controller?`${e.controller}.${e.token}`:e.token;throw Error(`The specified default value for the Stimulus Value "${r}" must match the defined type "${t}". The provided default value of "${e.typeObject.default}" is of type "${n}".`)}return t}function Ae(e){let t=ke({controller:e.controller,token:e.token,typeObject:e.typeDefinition}),n=q(e.typeDefinition),r=K(e.typeDefinition),i=t||n||r;if(i)return i;let a=e.controller?`${e.controller}.${e.typeDefinition}`:e.token;throw Error(`Unknown value type "${a}" for "${e.token}" value`)}function je(e){let t=K(e);if(t)return J[t];let n=e.default;return n===void 0?e:n}function Me(e){let t=`${d(e.token)}-value`,n=Ae(e);return{type:n,key:t,name:c(t),get defaultValue(){return je(e.typeDefinition)},get hasCustomDefaultValue(){return q(e.typeDefinition)!==void 0},reader:Ne[n],writer:Y[n]||Y.default}}var J={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:``},Ne={array(e){let t=JSON.parse(e);if(!Array.isArray(t))throw TypeError(`expected value of type "array" but instead got value "${e}" of type "${q(t)}"`);return t},boolean(e){return!(e==`0`||String(e).toLowerCase()==`false`)},number(e){return Number(e)},object(e){let t=JSON.parse(e);if(typeof t!=`object`||!t||Array.isArray(t))throw TypeError(`expected value of type "object" but instead got value "${e}" of type "${q(t)}"`);return t},string(e){return e}},Y={default:Pe,array:X,object:X};function X(e){return JSON.stringify(e)}function Pe(e){return`${e}`}var Z=class{constructor(e){this.context=e}static get shouldLoad(){return!0}static afterLoad(e,t){}get application(){return this.context.application}get scope(){return this.context.scope}
5get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:t=this.element,detail:n={},prefix:r=this.identifier,bubbles:i=!0,cancelable:a=!0}={}){let o=r?`${r}:${e}`:e,s=new CustomEvent(o,{detail:n,bubbles:i,cancelable:a});return t.dispatchEvent(s),s}};Z.blessings=[xe,Te,De,Ce],Z.targets=[],Z.outlets=[],Z.values={};var Fe={...U,keyMappings:{...U.keyMappings,backspace:`Backspace`}},Q=ye.start(document.documentElement,Fe),$={};function Ie(e,t){$[e]||(Q.register(e,t),$[e]=!0)}export{Ie as n,Z as r,Q as t};
6//# sourceMappingURL=application-AWWIFmtR.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.