@benbraide/inlinejs-stripe 2.0.3 → 2.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- (()=>{"use strict";var e={16:(e,t,n)=>{n.r(t),n.d(t,{CustomElement:()=>u,GetGlobalPropertyScope:()=>o,GetProperties:()=>l,GetPropertyScope:()=>a,InlineJSElement:()=>g,NativeElement:()=>h,NativeElementCompact:()=>d,Property:()=>c,Register:()=>y,RegisterCustomElement:()=>s,ResourceElement:()=>m,ResourceElementCompact:()=>_,ResourceTargetElement:()=>b,ResourceTargetElementCompact:()=>v});var i=n(617);function s(e,t){let n=(0,i.ToSnakeCase)(t||e.name);n=n&&(0,i.GetGlobal)().GetConfig().GetElementName(n),n&&!customElements.get(n)&&customElements.define(n,e)}const r=(0,i.RandomString)();function o(){return r}function l(){return(0,i.GetGlobalScope)(`customProperties.${r}`)}function a(e,t){return t||("constructor"in e?t=e.constructor.name:("function"==typeof e||"object"==typeof e&&"name"in e)&&(t=e.name)),t||""}function c(e){return function(t,n,s){let r="",o=null;(void 0!==(null==e?void 0:e.initial)||!s&&(null==e?void 0:e.update))&&(e.initial=e.initial||t[n],o="boolean"===e.type?(e,t)=>{e&&"false"!==e?t.setAttribute(r,r):t.hasAttribute(r)&&t.removeAttribute(r)}:(e,t)=>{t.setAttribute(r,e)});let c=null,u={name:"",type:(null==e?void 0:e.type)||"string",spread:(null==e?void 0:e.spread)||"",update:(null==e?void 0:e.update)||!1,initial:(null==e?void 0:e.initial)||void 0,checkStoredObject:(null==e?void 0:e.checkStoredObject)||!1,delimiter:(null==e?void 0:e.delimiter)||",",handler:null,setInitial:o};if(s){if("function"==typeof s.value&&!s.get&&!s.set&&((null==e?void 0:e.name)||/^Update.+Property/.test(s.value.name))){const t=s.value;r=(0,i.ToSnakeCase)((null==e?void 0:e.name)||s.value.name.replace(/^Update(.+)Property/,"$1")),c=(e,n)=>t.call(n,e)}}else r=(0,i.ToSnakeCase)((null==e?void 0:e.name)||n),c=(e,t)=>t[n]=e;if(r&&c){u.name=r,u.handler=c;const e=a(t);let n=l();n[e]=n[e]||new Array,n[e].push(u)}}}class u extends HTMLElement{constructor(e={}){if(super(),this.options_=e,this.componentId_="",this.resources_=new Array,this.loadedResources_=null,this.loadingResources_=!1,this.queuedResourceHandlers_=new Array,this.nativeElement_=null,this.nativeElements_=new Array,this.nativeAttributesBlacklist_=new Array,this.nativeAttributesWhitelist_=new Array,this.propertyScopes_=new Array,this.instanceProperties_=new Array,this.instancePropertyNames_=new Array,this.attributeChangeHandlers_={},this.spreads_={},this.storedObjects_={},this.booleanAttributes_=new Array,this.nonBooleanAttributes_=new Array,(this.options_.isTemplate||this.options_.isHidden)&&(this.style.display="none"),!(this.options_.disableImplicitData||"InlineJS"in globalThis&&(0,i.IsObject)(globalThis.InlineJS)&&globalThis.InlineJS.disableImplicitData)){const e=(0,i.GetGlobal)().GetConfig().GetDirectiveName("data",!1),t=(0,i.GetGlobal)().GetConfig().GetDirectiveName("data",!0);let n=null;for(let i=this;i;i=i.parentNode)if(i instanceof Element&&(i.hasAttribute(e)||i.hasAttribute(t))){n=i;break}!n&&this.setAttribute(e,"")}}UpdateComponentProperty(e){var t,n;null===(n=null===(t=(0,i.FindComponentById)(this.componentId_))||void 0===t?void 0:t.FindScopeByRoot(this))||void 0===n||n.SetName(e.trim())}AddResource(e){this.resources_.push(e)}RemoveResource(e){this.resources_=this.resources_.filter((t=>t!==e))}LoadResources(){return this.loadingResources_?new Promise(((e,t)=>{this.queuedResourceHandlers_.push((()=>{this.loadedResources_?e(this.loadedResources_):t()}))})):this.loadedResources_?Promise.resolve(this.loadedResources_):(this.loadingResources_=!0,new Promise(((e,t)=>{const n=new Array,s=new Array,r=t=>{this.loadingResources_=!1,this.loadedResources_=t,this.queuedResourceHandlers_.forEach((e=>e())),this.queuedResourceHandlers_=[],e(t)};if(this.resources_.forEach((e=>{"string"==typeof e?s.push(e):"LoadTargetResources"in e?n.push(e.LoadTargetResources()):"GetResource"in e?s.push(e.GetResource()):s.push(e)})),s.length>0){const e=(0,i.GetGlobal)().GetConcept("resource");if(e){const t=e.Get({items:s,attributes:this.GetResourceLoadAttributes_(),concurrent:this.IsConcurrentResourceLoad_()});n.push(t)}}0==n.length?r([]):Promise.all(n).then(r).catch(t)})))}AddNativeElement(e){this.nativeElements_.push(e),this.CopyNativeElements_(e)}RemoveNativeElement(e){this.nativeElements_=this.nativeElements_.filter((t=>t!==e))}AddBooleanAttribute(e){Array.isArray(e)?this.booleanAttributes_.push(...e):this.booleanAttributes_.push(e)}RemoveBooleanAttribute(e){this.booleanAttributes_=Array.isArray(e)?this.booleanAttributes_.filter((t=>!e.includes(t))):this.booleanAttributes_.filter((t=>t!==e))}AddNonBooleanAttribute(e){Array.isArray(e)?this.nonBooleanAttributes_.push(...e):this.nonBooleanAttributes_.push(e)}RemoveNonBooleanAttribute(e){this.nonBooleanAttributes_=Array.isArray(e)?this.nonBooleanAttributes_.filter((t=>!e.includes(t))):this.nonBooleanAttributes_.filter((t=>t!==e))}IsBooleanAttribute(e){return!this.nonBooleanAttributes_.includes(e)&&(!!this.booleanAttributes_.includes(e)||null)}IsTemplate(){return this.options_.isTemplate}OnElementScopeCreated(e){this.HandleElementScopeCreated_(e)}AddPropertyScope_(e){this.propertyScopes_.push(a(u,e))}FindProperty_(e){return this.instanceProperties_.find((t=>t.name===e))}GetAllProperties_(){let e=new Array,t=l();for(let n of this.propertyScopes_)t.hasOwnProperty(n)&&e.push(...Object.values(t[n]));return e}HandleElementScopeCreated_({scope:e,componentId:t},n){this.componentId_=t,this.propertyScopes_=this.ComputePropertyScopes_(),(this.instanceProperties_=this.GetAllProperties_()).forEach((e=>{"boolean"===e.type&&this.booleanAttributes_.push(e.name);const t=e.spread&&(0,i.ToSnakeCase)(e.spread);t&&this.spreads_.hasOwnProperty(t)?this.spreads_[t].push(e.name):t&&(this.spreads_[t]=[e.name])})),this.instancePropertyNames_=this.instanceProperties_.map((e=>e.name)),e.AddPostAttributesProcessCallback((()=>{this.instanceProperties_.forEach((e=>{e.initial&&e.setInitial&&e.setInitial(this.EncodeValue_(e.initial,e.type),this)})),this.InitializeStateFromAttributes_(),n&&n()})),e.AddPostProcessCallback((()=>this.ShouldLoadResources_()&&this.LoadResources())),e.AddAttributeChangeCallback((e=>e&&this.AttributeChanged_(e))),e.AddUninitCallback((()=>this.nativeElement_=null))}InitializeStateFromAttributes_(e){let t=Array.from(this.attributes);e&&(t=t.filter((({name:t})=>e.includes(t)))),t.forEach((({name:e})=>this.AttributeChanged_(e)))}EncodeValue_(e,t){return"boolean"===t?e?"true":"false":"json"===t?JSON.stringify(e):"array"===t?(e||[]).join(","):t.startsWith("array:")?(e||[]).map((e=>this.EncodeValue_(e,t.substring(6)))).join(","):"date"===t?(e||new Date).toString():(0,i.ToString)(e)}DecodeValue_(e,t,n){if("string"===t)return e||"";if("boolean"===t)return null!=e&&"0"!==e&&"false"!==e;if("number"===t)return null===e?NaN:parseFloat(e||"0")||0;if("json"===t){try{return JSON.parse(e||"")}catch(e){}return null}return"array"===t?(e||"").split(n||",").map((e=>e.trim()))||[]:t.startsWith("array:")?(e||"").split(n||",").map((e=>this.DecodeValue_(e,t.substring(6),n)))||[]:"date"===t?new Date(e||""):e}SpreadValue_(e,t){let n=e.split(" ");t.forEach(((e,t)=>{if(t>=n.length){let i=t%4-2;this.DispatchAttributeChange_(e,i<0||i>=n.length?n[0]:n[i])}else this.DispatchAttributeChange_(e,n[t])}))}DispatchAttributeChange_(e,t){let n=!1;this.spreads_.hasOwnProperty(e)&&(this.SpreadValue_(t||"",this.spreads_[e]),n=!0);const s=this.FindProperty_(e),r=this.storedObjects_.hasOwnProperty(e)&&this.storedObjects_[e];if(s){let o=null;if(s.checkStoredObject&&t){if(t===r)return;const n=(0,i.RetrieveStoredObject)({key:t,componentId:this.componentId_,contextElement:this});n!==t&&(this.storedObjects_[e]=t,o=e=>(0,i.JournalTry)((()=>e(n,this))))}o?o(s.handler):(0,i.JournalTry)((()=>s.handler(this.DecodeValue_(t,s.type||"string",s.delimiter),this))),n=!0}return n}AttributeChanged_(e){let t="";this.nativeElement_&&(e.startsWith("data-native-")?t=e.substring(12):e.startsWith("native-")?t=e.substring(7):e.startsWith("-")&&(t=e.substring(1))),t?this.hasAttribute(e)?this.nativeElement_.setAttribute(t,this.getAttribute(e)||""):this.nativeElement_.hasAttribute(t)&&this.nativeElement_.removeAttribute(t):this.DispatchAttributeChange_(e,this.getAttribute(e))||!this.nativeAttributesWhitelist_.includes(e)&&this.nativeAttributesBlacklist_.includes(e)||!this.nativeElement_||e.startsWith("data-")||u.GlobalAttributes.includes(e)||(this.hasAttribute(e)?this.nativeElement_.setAttribute(e,this.getAttribute(e)||""):this.nativeElement_.hasAttribute(e)&&this.nativeElement_.removeAttribute(e))}ComputePropertyScopes_(){let e=new Array;for(let t=Object.getPrototypeOf(this);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t))e.push(t.constructor.name);return e}SetNativeElement_(e){e!==this.nativeElement_&&(this.nativeElement_=e,this.CopyNativeElements_())}CopyNativeElements_(e){this.nativeElement_&&0!=this.nativeElements_.length&&((e?[e]:this.nativeElements_).forEach((e=>{e.GetAttributes().forEach((({name:e,value:t})=>this.nativeElement_.setAttribute(e,t)));for(let t=e.firstChild;t;t=e.firstChild)t.remove(),this.nativeElement_.appendChild(t)})),(0,i.ProcessDirectives)({component:this.componentId_,element:this.nativeElement_}))}GetResourceLoadAttributes_(){}IsConcurrentResourceLoad_(){return!0}ShouldLoadResources_(){return!0}}u.GlobalAttributes=["id","class","style","title","lang","dir","tabindex","accesskey","hidden","draggable","spellcheck","translate","contenteditable"],function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);r>3&&o&&Object.defineProperty(t,n,o)}([c({type:"string"})],u.prototype,"UpdateComponentProperty",null);class h extends u{constructor(){super(),this.attributes_=new Array,Array.from(this.attributes).forEach((({name:e,value:t})=>{this.attributes_.push({name:e,value:t}),this.removeAttribute(e)})),this.options_.isTemplate=!0,this.options_.isHidden=!0,this.style.display="none"}GetAttributes(){return this.attributes_}HandleElementScopeCreated_(e,t){var n;null===(n=(0,i.FindAncestor)(this,(e=>"AddNativeElement"in e)))||void 0===n||n.AddNativeElement(this),super.HandleElementScopeCreated_(e,t)}}function d(){s(h)}var p=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};class m extends u{constructor(){super({isTemplate:!0,isHidden:!0}),this.src="",this.type=""}GetResource(){return"link"===this.type||"script"===this.type||"data"===this.type?{type:this.type,path:this.src}:this.src}HandleElementScopeCreated_(e,t){super.HandleElementScopeCreated_(e,(()=>{var e;null===(e=(0,i.FindAncestor)(this,(e=>"AddResource"in e)))||void 0===e||e.AddResource(this),t&&t()}))}ShouldLoadResources_(){return!1}}function _(){s(m,"resource")}p([c({type:"string"})],m.prototype,"src",void 0),p([c({type:"string"})],m.prototype,"type",void 0);var f=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};class b extends u{constructor(){super({isHidden:!0}),this.attributes_=null,this.sequential=!1,this.defer=!1}UpdateAttributesProperty(e){this.attributes_=e}LoadTargetResources(){return this.LoadResources()}HandleElementScopeCreated_(e,t){super.HandleElementScopeCreated_(e,(()=>{var e;null===(e=(0,i.FindAncestor)(this,(e=>"AddResource"in e)))||void 0===e||e.AddResource(this),t&&t()}))}GetResourceLoadAttributes_(){return this.attributes_||void 0}IsConcurrentResourceLoad_(){return!this.sequential}ShouldLoadResources_(){return!this.defer}}function v(){s(b,"resource-target")}function y(e){return function(t){let n=(0,i.ToSnakeCase)(e||t.name);n=n&&(0,i.GetGlobal)().GetConfig().GetElementName(n),n&&!customElements.get(n)&&customElements.define(n,t)}}function g(){(0,i.WaitForGlobal)().then((()=>{d(),_(),v()}))}f([c({type:"object",checkStoredObject:!0})],b.prototype,"UpdateAttributesProperty",null),f([c({type:"boolean"})],b.prototype,"sequential",void 0),f([c({type:"boolean"})],b.prototype,"defer",void 0)},617:(e,t,n)=>{n.r(t),n.d(t,{AddChanges:()=>N,AddDirectiveExpansionRule:()=>g,AddDirectiveHandler:()=>un,AddMagicHandler:()=>En,AddOutsideEventExcept:()=>ve,AddOutsideEventListener:()=>fe,ApplyDirectiveExpansionRules:()=>A,AreObjects:()=>$,AttributeInterpolator:()=>on,AutoBootstrap:()=>cn,BaseComponent:()=>Ae,BaseGlobal:()=>Oe,BeginsWith:()=>c,BindDirectiveExpansionRule:()=>xn,BindEvent:()=>mn,BootstrapAndAttach:()=>an,BuildGetterProxyOptions:()=>Et,BuildIntersectionOptions:()=>vn,BuildProxyOptions:()=>At,CallIfFunction:()=>wt,Changes:()=>oe,ChildProxy:()=>Pe,ClassDirectiveExpansionRule:()=>Pn,Config:()=>ke,Context:()=>le,ContextKeys:()=>_,CreateAnimationLoop:()=>ut,CreateChildProxy:()=>H,CreateDirective:()=>S,CreateDirectiveExpansionRule:()=>y,CreateDirectiveHandlerCallback:()=>hn,CreateGlobal:()=>we,CreateInplaceProxy:()=>yt,CreateLoop:()=>ct,CreateMagicHandlerCallback:()=>Sn,CreateReadonlyProxy:()=>gt,DecodeAttribute:()=>Ke,DecodeValue:()=>qe,DeepCopy:()=>te,DefaultTransitionDelay:()=>Jt,DefaultTransitionDuration:()=>Bt,DefaultTransitionRepeats:()=>zt,DeleteProxyProp:()=>F,DirectiveManager:()=>ue,DisableProxyAction:()=>Ct,DispatchDirective:()=>I,ElementScope:()=>ge,ElementScopeKey:()=>f,EncodeAttribute:()=>Ye,EncodeValue:()=>Ve,EndsWith:()=>Ze,EvaluateLater:()=>Ft,EvaluateMagicProperty:()=>w,ExtractDuration:()=>gn,FindAncestor:()=>Qe,FindAncestorByAttribute:()=>et,FindAncestorByAttributeValue:()=>tt,FindAncestorByClass:()=>Xe,FindAncestorByTagName:()=>nt,FindCacheValue:()=>p,FindComponentById:()=>Me,FindComponentByName:()=>$e,FindComponentByRoot:()=>He,FindFirstAttribute:()=>V,FindFirstAttributeValue:()=>Y,FlattenDirective:()=>P,ForwardEvent:()=>dn,Future:()=>s,GenerateFunctionFromString:()=>Nt,GenerateUniqueId:()=>ee,GenerateValueReturningFunction:()=>Ot,GenerateVoidFunction:()=>Rt,GenericProxy:()=>z,GetAttribute:()=>K,GetCache:()=>h,GetConfig:()=>v,GetDefaultUniqueMarkers:()=>Z,GetDirectiveValue:()=>_n,GetElementContent:()=>tn,GetElementScopeId:()=>b,GetGlobal:()=>Le,GetGlobalScope:()=>it,GetLocal:()=>Mt,GetOrCreateGlobal:()=>Ne,GetProxyProp:()=>B,GetTarget:()=>j,GetTargets:()=>T,GlobalCreatedEvent:()=>Fe,IncrementUniqueMarkers:()=>Q,InferComponent:()=>Be,InitCache:()=>u,InitComponentCache:()=>De,InitJITProxy:()=>xt,InitializeDev:()=>Gn,InitializeGlobal:()=>On,InitializeGlobalScope:()=>st,InitializeUtilities:()=>Rn,InitializeValues:()=>wn,InitializeVersion:()=>Nn,InlineJS:()=>Fn,InlineJSGlobalKey:()=>Re,InsertHtml:()=>Ut,Interpolate:()=>rn,InterpolateText:()=>sn,IntersectionObserver:()=>yn,IsBooleanAttribute:()=>rt,IsEqual:()=>ot,IsInsideTemplate:()=>O,IsObject:()=>M,IsTemplate:()=>G,JoinPath:()=>_t,JoinUniqueMarkers:()=>X,JournalError:()=>r,JournalLog:()=>kn,JournalTry:()=>o,JournalWarn:()=>x,LazyCheck:()=>An,Loop:()=>l,MagicManager:()=>Ee,MeasureCallback:()=>ht,MutationObserver:()=>Se,NativeFetchConcept:()=>Ge,NextIdle:()=>Vt,NextNonIdle:()=>Yt,NextTick:()=>Zt,Nothing:()=>a,OnDirectiveExpansionRule:()=>In,PathToRelative:()=>pt,PeekCurrentComponent:()=>re,PeekCurrentScope:()=>pe,PeekStoredObject:()=>We,PopCurrentComponent:()=>se,PopCurrentScope:()=>de,ProcessDirectives:()=>R,ProxyKeys:()=>L,PushCurrentComponent:()=>ie,PushCurrentScope:()=>he,QueryGlobalComponent:()=>Ht,RandomString:()=>Ie,RemoveDirectiveExpansionRule:()=>C,RemoveOutsideEventListener:()=>be,ReplaceText:()=>nn,ResizeObserver:()=>xe,ResolveKeyValue:()=>fn,ResolveOptions:()=>Cn,ResolveTransition:()=>Wt,RetrieveStoredObject:()=>ze,RootProxy:()=>W,Scope:()=>Ce,SetAttributeUtil:()=>ft,SetCacheValue:()=>d,SetProxyProp:()=>J,SplitPath:()=>mt,Stack:()=>i,StreamData:()=>Lt,SubscribeToChanges:()=>Tt,SupportsAttributes:()=>q,TextContentInterpolator:()=>ln,TidyPath:()=>dt,ToCamelCase:()=>m,ToSnakeCase:()=>bt,ToString:()=>Ue,TraverseDirectives:()=>k,UnbindOutsideEvent:()=>ye,UseEffect:()=>Dt,WaitForGlobal:()=>je,WaitPromise:()=>Pt,WaitTransition:()=>qt,WaitWhile:()=>jt});class i{constructor(e){this.list_=new Array,e&&(this.list_=e.list_.map((e=>e)))}Push(e){this.list_.push(e)}Pop(){return 0==this.list_.length?null:this.list_.pop()}Peek(){return 0==this.list_.length?null:this.list_[this.list_.length-1]}IsEmpty(){return 0==this.list_.length}GetHistory(){return this.list_.map((e=>e))}}class s{constructor(e){this.callback_=e}Get(){return this.callback_()}}function r(e,t,n){console.error({message:e,context:t||"N/A",contextElement:n||"N/A"})}function o(e,t,n){try{return e()}catch(e){r(e,t,n)}}class l{constructor(e){this.whileCallbacks_=new Array,this.finalCallbacks_=new Array,e((e=>{this.whileCallbacks_.slice(0).forEach(((t,n)=>{!1===o((()=>t(e)),"InlineJS.Loop.While")&&this.whileCallbacks_.splice(n,1)}))}),(e=>{this.whileCallbacks_.splice(0),this.finalCallbacks_.splice(0).forEach((t=>o((()=>t(e)),"InlineJS.Loop.Final")))}),(()=>{this.whileCallbacks_.splice(0),this.finalCallbacks_.splice(0)}))}While(e){return this.whileCallbacks_.push(e),this}Final(e){return this.finalCallbacks_.push(e),this}}class a{}function c(e,t=!1){return new RegExp(`^${e}`,t?"i":void 0)}function u(e,t){return globalThis[e]=t}function h(e,t){return globalThis[e]=globalThis[e]||u(e,t)}function d(e,t,n,i){let s=h(e,i);"object"==typeof s&&(s[t]=n)}function p(e,t){let n=e in globalThis&&globalThis[e]||null;if(n&&"object"==typeof n&&t in n)return n[t]}function m(e,t,n){let[i="",...s]=e.trim().split(n||"-"),r=e=>e.charAt(0).toUpperCase()+e.substring(1);return i&&(t?r(i):i)+(s||[]).map((e=>r(e))).join("")}const _={self:"self",event:"event",scope:"scope"},f="__InlineJS_ELSCOPE_KEY__";function b(e){let t="";for(;e;){if(t=f in(n=e)&&"string"==typeof n[f]?n[f]:"",t||e===document.body)return t||"";e=e.parentElement}var n;return""}function v(){return Le().GetConfig()}function y(e,t){return n=>-1==n.search(e)?null:n.replace(e,t)}function g(e){return Le().GetDirectiveManager().AddExpansionRule(e)}function C(e){Le().GetDirectiveManager().RemoveExpansionRule(e)}function A(e){return Le().GetDirectiveManager().Expand(e)}let E={};function S(e,t){if(!e||!(e=e.trim()))return null;if((t=(t||"").trim())===e&&(t=""),e in E)return{meta:E[e],value:t};let n=A(e),i=n.match(v().GetDirectiveRegex());if(!i||3!=i.length||!i[2])return null;let s=i[2].indexOf(":"),r=-1==s?[i[2]]:[i[2].substring(0,s),i[2].substring(s+1)],o="",l="";r.length>1?[o,l]=r:[l]=r;let a=l.split("."),c="";o?c=a[0]:o=a[0],a.splice(0,1);let u=o.split("-"),h={view:{original:e,expanded:n},name:{value:o,joined:u.join("."),parts:u},arg:{key:c,options:a||[]}};return E[e]=h,{meta:h,value:t}}function x(e,t,n){console.warn({message:e,context:t||"N/A",contextElement:n||"N/A"})}function P(e){return{originalView:e.meta.view.original,expandedView:e.meta.view.expanded,nameValue:e.meta.name.value,nameJoined:e.meta.name.joined,nameParts:e.meta.name.parts,argKey:e.meta.arg.key,argOptions:e.meta.arg.options,expression:e.value}}function I(e,t,n,i=0){let s="string"==typeof e?Me(e):e;if(!s)return r(`Failed to find component for '${n.meta.view.original}'`,"InlineJS.DispatchDirective",t),!1;let l=null,a=s.FindElementScope(t);if(a&&(l=a.GetDirectiveManager().FindHandler(n.meta.name.joined),++i),l=l||Le().GetDirectiveManager().FindHandler(n.meta.name.joined),!l){let e=`${n.meta.name.parts.reduce(((e,t)=>e?`${e}${t.substring(0,1).toUpperCase()}${t.substring(1)}`:t),"")}DirectiveHandler`;e in globalThis&&"function"==typeof globalThis[e]&&(l=globalThis[e])}return l?(0!=i||a||s.CreateElementScope(t),o((()=>{l(Object.assign(Object.assign({},P(n)),{componentId:s.GetId(),component:s,contextElement:t}))}),"InlineJS.DispatchDirective",t),!0):(x(`No handler found '${n.meta.view.original}'`,"InlineJS.DispatchDirective",t),!1)}function k({element:e,callback:t,attributeCallback:n}){Array.from(e.attributes||[]).forEach((i=>{try{n&&n(i.name,i.value||"");let e=S(i.name,i.value||"");e&&t(e)}catch(t){r(t,"InlineJS.TraverseDirectives",e)}}))}function G(e){return e instanceof HTMLTemplateElement||"IsTemplate"in e&&"function"==typeof e.IsTemplate&&!!e.IsTemplate()}function O(e){for(let t=e.parentNode;t;t=t.parentNode)if(t instanceof Element&&G(t))return!0;return!1}function R({component:e,element:t,options:n={}}){if(!function(e,{checkTemplate:t=!0,checkDocument:n=!0}){return 1===(null==e?void 0:e.nodeType)&&(!n||document.contains(e))&&(!t||!O(e))}(t,n))return;let i="string"==typeof e?Me(e):e;if(!i)return r("Failed to find component.","InlineJS.ProcessDirectives",t),!1;let s=0;k({element:t,callback:n=>{I(e,t,n,s)&&(t.removeAttribute(n.meta.view.original),++s)},attributeCallback:(e,n)=>Le().DispatchAttributeProcessing({name:e,value:n,componentId:i.GetId(),component:i,contextElement:t})}),Le().DispatchTextContentProcessing({componentId:i.GetId(),component:i,contextElement:t}),"OnElementScopeCreated"in t&&"function"==typeof t.OnElementScopeCreated&&i.CreateElementScope(t);let o=i.FindElementScope(t);if(null==o||o.ExecutePostAttributesProcessCallbacks(),!n.ignoreChildren&&!G(t)){i.PushSelectionScope();let n={checkTemplate:!1,checkDocument:!1},s=(t,i)=>R({component:e,options:Object.assign(Object.assign({},n),{ignoreChildren:i}),element:t});"TraverseChildren"in t&&"function"==typeof t.TraverseChildren?t.TraverseChildren((e=>s(e,e.contains(t)))):Array.from(t.children).forEach((e=>s(e,e.contains(t)))),i.PopSelectionScope()}null==o||o.ExecutePostProcessCallbacks()}function w(e,t,n,i="",s=!0){let l="string"==typeof e?Me(e):e;if(!l)return r(`Failed to find component for '$${n}'`,"InlineJS.EvaluateMagicProperty",t),Le().CreateNothing();let a=i&&n.startsWith(i)?n.substring(i.length):n,c=Le().GetMagicManager().FindHandler(a,{contextElement:t,componentId:l.GetId(),component:l});if(!c){if(!s)return Le().CreateNothing();let e=i&&n.startsWith(`${i}${i}`)||!1;a=e?a.substring(i.length):a;let t=l.FindScopeByName(a);if(t)return e?t.GetRoot():t.GetProxy().GetNative();let r=$e(a);if(r)return e?r.GetRoot():r.GetRootProxy().GetNative();if(e){let e=l.GetId();return t=>{let s=Be(t)||Me(e);if(!s)return null;let r=s.FindElementScope(t),o=r&&r.GetLocal(n.substring(i.length));return r&&!Le().IsNothing(o)?o:w(s.GetId(),t,n,`${i}${i}`,!1)}}return Le().CreateNothing()}return o((()=>c({componentId:l.GetId(),component:l,contextElement:t})),"InlineJS.EvaluateMagicProperty",t)}function N(e,t,n,i,s=!0){if(!i)return;let r={componentId:i.GetComponentId(),type:e,path:t,prop:n,origin:i.PeekOrigin()};if(i.Add(r),!s)return;let o=t.split(".");for(;o.length>2;)o.pop(),i.Add({original:r,path:o.join(".")})}function F(e,t,n,i){var s;if(!(i in t))return!1;let r=Me(e);return null===(s=null==r?void 0:r.FindProxy(n))||void 0===s||s.RemoveChild(i),delete t[i],null==r||r.RemoveProxy(`${n}.${i}`),N("delete",n,i,null==r?void 0:r.GetBackend().changes),!0}const L={componentId:"__InlineJS_CompnentId__",name:"__InlineJS_Name__",path:"__InlineJS_Path__",parentPath:"__InlineJS_ParentPath__",target:"__InlineJS_Target__"};function j(e){return(Array.isArray(e)||e&&"object"==typeof e)&&L.target in e?j(e[L.target]):e}function T(e){return e.map((e=>j(e)))}function D(e){return(e=j(e))&&"object"==typeof e&&(L.target in e||"__proto__"in e&&"Object"===e.__proto__.constructor.name)}function M(e){return!!D(e)}function $(e){return-1==e.findIndex((e=>!D(e)))}function H(e,t,n,i){if(!e)return null;let s=e.FindChild(t);if(s)return s;if(!Array.isArray(n)&&!M(n))return null;let r=Le().CreateChildProxy(e,t,n);return i&&i.AddProxy(r),r}function B(e,t,n,i,s){var r;if(i===L.target)return t;if(i===L.componentId)return e;if(i===L.name)return n.split(".").at(-1);if(i===L.path)return n;if(i===L.parentPath)return n.split(".").slice(0,-1).join(".")||"";let o=i in t;if(!o&&s){let t=s(Me(e)||void 0,i);if(!Le().IsNothing(t))return Le().IsFuture(t)?t.Get():t}if(o&&!t.hasOwnProperty(i))return t[i];let l=o?t[i]:null;if(Le().IsFuture(l))return l.Get();let a=Me(e);return null==a||a.GetBackend().changes.AddGetAccess(`${n}.${i}`),(null===(r=H((null==a?void 0:a.FindProxy(n))||null,i,l,a||void 0))||void 0===r?void 0:r.GetNative())||l}function J(e,t,n,i,s){var r;if(i in t&&s===t[i])return!0;let o=Me(e);return null===(r=null==o?void 0:o.FindProxy(n))||void 0===r||r.RemoveChild(i),t[i]=s,null==o||o.RemoveProxy(`${n}.${i}`),N("set",`${n}.${i}`,i,null==o?void 0:o.GetBackend().changes),!0}class z{constructor(e,t,n,i,s=!1){this.componentId_=e,this.target_=t,this.name_=n,this.native_=null,this.children_={},this.parentPath_=(null==i?void 0:i.GetPath())||"",null==i||i.AddChild(this);let r=this.componentId_,o=this.GetPath(),l=(e,t)=>{let{context:n}=null==e?void 0:e.GetBackend(),i=null==t?void 0:t.startsWith("$");if(i){let e=n.Peek(t.substring(1),Le().CreateNothing());if(!Le().IsNothing(e))return e}let s=n.Peek(_.self),r=null==e?void 0:e.FindElementLocalValue(s||e.GetRoot(),t,!0);if(!Le().IsNothing(r))return r;let o=i?w(e,s,t,"$"):Le().CreateNothing();return Le().IsNothing(o)&&t&&t in globalThis&&(o=globalThis[t]),o},a=!s&&!this.parentPath_,c={get:(e,t)=>"symbol"==typeof t||"prototype"===t?Reflect.get(e,t):B(r,e,o,t.toString(),a?l:void 0),set:(e,t,n)=>"symbol"==typeof t||"prototype"===t?Reflect.set(e,t,n):J(r,e,o,t.toString(),n),deleteProperty:(e,t)=>"symbol"==typeof t||"prototype"===t?Reflect.get(e,t):F(r,e,o,t.toString()),has:(e,t)=>"symbol"!=typeof t||Reflect.has(e,t)};this.native_=new window.Proxy(this.target_,c)}IsRoot(){return!this.parentPath_}GetComponentId(){return this.componentId_}GetTarget(){return this.target_}GetNative(){return this.native_}GetName(){return this.name_}GetPath(){return this.parentPath_?`${this.parentPath_}.${this.name_}`:this.name_}GetParentPath(){return this.parentPath_}AddChild(e){this.children_[e.GetName()]=e}RemoveChild(e){delete this.children_["string"==typeof e?e:e.GetName()]}FindChild(e){return this.children_.hasOwnProperty(e)?this.children_[e]:null}}class W extends z{constructor(e,t,n){super(e,t,`Proxy<${n||e}>`,void 0,!!n)}}function q(e){return(e=j(e))&&"getAttribute"in e&&"setAttribute"in e}function U(e,t){return t&&q(e)?e.getAttribute(t):null}function K(e,t){for(let n of Array.isArray(t)?t:[t]){let t=U(e,n);if(t)return t}return null}function V(e,t){if(!q(e))return null;for(let n of t)if(e.hasAttribute(n))return{name:n,value:e.getAttribute(n)};return null}function Y(e,t){let n=V(e,t);return n?n.value:null}function Z(){return{level0:0,level1:0,level2:0}}function Q(e,t="level0",n="level1"){e[t]==(Number.MAX_SAFE_INTEGER||9007199254740991)?("level0"===t?Q(e,"level1","level2"):++e[n],e[t]=0):++e[t]}function X(e){return`${e.level2}_${e.level1}_${e.level0}`}function ee(e,t,n,i){return Q(e),`${t||""}${n||""}${X(e)}${i||""}`}function te(e){if(e=j(e),!Array.isArray(e)&&!M(e))return e;if(Array.isArray(e))return e.map((e=>te(e)));let t={};return Object.entries(e).forEach((([e,n])=>t[e]=te(n))),t}class ne{constructor(){this.listeners_=new Array}AddChangesMonitor(e){this.listeners_.push(e),this.listeners_.forEach((e=>o((()=>e({target:"changes-monitor",object:()=>Object.assign({},this.listeners_)})))))}RemoveChangesMonitor(e){let t=this.listeners_.length;this.listeners_=this.listeners_.filter((t=>t!==e)),t!=this.listeners_.length&&this.listeners_.forEach((e=>o((()=>e({target:"changes-monitor",object:()=>Object.assign({},this.listeners_)})))))}NotifyListeners_(e,t){this.listeners_.forEach((n=>o((()=>n({target:e,object:()=>te(t)})))))}}function ie(e){Le().PushCurrentComponent(e)}function se(){return Le().PopCurrentComponent()}function re(){return Le().PeekCurrentComponent()}class oe extends ne{constructor(e){super(),this.componentId_=e,this.nextTickHandlers_=new Array,this.nextIdleHandlers_=new Array,this.nextNonIdleHandlers_=new Array,this.isScheduled_=!1,this.isIdle_=!0,this.list_=new Array,this.subscribers_={},this.lastAccessContext_="",this.getAccessStorages_=new i,this.origins_=new i}GetComponentId(){return this.componentId_}AddNextTickHandler(e){this.nextTickHandlers_.push(e),this.Schedule(),this.NotifyListeners_("next-tick-handlers",this.nextTickHandlers_)}AddNextIdleHandler(e){this.nextIdleHandlers_.push(e),this.Schedule(),this.NotifyListeners_("next-idle-handlers",this.nextIdleHandlers_)}AddNextNonIdleHandler(e){this.nextNonIdleHandlers_.push(e),this.Schedule(),this.NotifyListeners_("next-non-idle-handlers",this.nextNonIdleHandlers_)}Schedule(){this.isScheduled_||(this.isScheduled_=!0,queueMicrotask((()=>{this.isScheduled_=!1,this.isIdle_&&(this.isIdle_=!1,this.nextNonIdleHandlers_.splice(0).forEach((e=>o(e,`InlineJs.Region<${this.componentId_}>.NextNonIdle`))));let e=new Array;this.list_.splice(0).forEach((t=>{Object.values(this.subscribers_).filter((e=>e.path===t.path&&e.callback!==(e=>"original"in e?e.original.origin:e.origin)(t))).forEach((n=>((t,n)=>{let i=e.find((e=>e.callback===n));i?i.changes.push(t):e.push({callback:n,changes:new Array(t)})})(t,n.callback)))})),e.forEach((e=>e.callback(e.changes))),this.nextTickHandlers_.splice(0).forEach((e=>o(e,`InlineJs.Region<${this.componentId_}>.NextTick`))),this.isScheduled_||(this.isIdle_=!0,this.nextIdleHandlers_.splice(0).forEach((e=>o(e,`InlineJs.Region<${this.componentId_}>.NextIdle`))))})),this.NotifyListeners_("scheduled",this.isScheduled_))}Add(e){this.list_.push(e),this.Schedule(),this.NotifyListeners_("list",this.list_)}AddComposed(e,t,n){let i={componentId:this.componentId_,type:"set",path:t?`${t}.${e}`:e,prop:e,origin:this.origins_.Peek()};n?this.Add({original:i,path:n}):this.Add(i)}GetLastChange(e=0){return te(this.list_.at(-(e+1))||null)}AddGetAccess(e){var t,n,i,s;let r=(null===(t=Me(re()||""))||void 0===t?void 0:t.GetBackend().changes)||this,o=e.lastIndexOf(".");r.lastAccessContext_=-1==o?"":e.substring(0,o);let l=r.getAccessStorages_.Peek();(null==l?void 0:l.details)&&(null===(n=l.details.raw)||void 0===n||n.entries.push({compnentId:this.componentId_,path:e}),l.details.optimized&&l.details.optimized.entries!==(null===(i=l.details.raw)||void 0===i?void 0:i.entries)&&0!=l.details.optimized.entries.length&&l.lastAccessPath&&l.lastAccessPath.length<e.length&&0==e.indexOf(`${l.lastAccessPath}.`)?l.details.optimized.entries.at(-1).path=e:l.details.optimized&&l.details.optimized.entries!==(null===(s=l.details.raw)||void 0===s?void 0:s.entries)&&l.details.optimized.entries.push({compnentId:this.componentId_,path:e}),l.lastAccessPath=e,this.NotifyListeners_("last-access-context",this.list_),r.NotifyListeners_("get-access-storages",this.getAccessStorages_))}GetLastAccessContext(){return this.lastAccessContext_}ResetLastAccessContext(){this.lastAccessContext_="",this.NotifyListeners_("last-access-context",this.lastAccessContext_)}PushGetAccessStorage(e){var t;this.getAccessStorages_.Push({details:e||{optimized:"optimized"===(null===(t=Me(this.componentId_))||void 0===t?void 0:t.GetReactiveState())?{entries:new Array,snapshots:new i}:void 0,raw:{entries:new Array,snapshots:new i}},lastAccessPath:""}),this.NotifyListeners_("get-access-storages",this.getAccessStorages_)}PopGetAccessStorage(){var e;let t=(null===(e=this.getAccessStorages_.Pop())||void 0===e?void 0:e.details)||null;return this.NotifyListeners_("get-access-storages",this.getAccessStorages_),t}SwapOptimizedGetAccessStorage(){let e=this.getAccessStorages_.Peek();(null==e?void 0:e.details.optimized)&&e.details.raw&&(e.details.optimized.entries=e.details.raw.entries,this.NotifyListeners_("get-access-storages",this.getAccessStorages_))}RestoreOptimizedGetAccessStorage(){var e;let t=this.getAccessStorages_.Peek();(null==t?void 0:t.details.optimized)&&t.details.optimized.entries===(null===(e=t.details.raw)||void 0===e?void 0:e.entries)&&(t.details.optimized.entries=t.details.raw.entries.slice(0),this.NotifyListeners_("get-access-storages",this.getAccessStorages_))}FlushRawGetAccessStorage(){var e,t;null===(t=null===(e=this.getAccessStorages_.Peek())||void 0===e?void 0:e.details.raw)||void 0===t||t.entries.splice(0),this.NotifyListeners_("get-access-storages",this.getAccessStorages_)}PushGetAccessStorageSnapshot(){var e,t;let n=this.getAccessStorages_.Peek();null===(e=null==n?void 0:n.details.optimized)||void 0===e||e.snapshots.Push(n.details.optimized.entries.slice(0).map((e=>Object.assign({},e)))),null===(t=null==n?void 0:n.details.raw)||void 0===t||t.snapshots.Push(n.details.raw.entries.slice(0).map((e=>Object.assign({},e)))),this.NotifyListeners_("get-access-storages",this.getAccessStorages_)}PopGetAccessStorageSnapshot(e){var t,n,i,s;let r=this.getAccessStorages_.Peek(),o=null===(t=null==r?void 0:r.details.optimized)||void 0===t?void 0:t.snapshots.Pop();!e&&o&&(null===(n=null==r?void 0:r.details.optimized)||void 0===n?void 0:n.entries)&&(r.details.optimized.entries=o);let l=null===(i=null==r?void 0:r.details.raw)||void 0===i?void 0:i.snapshots.Pop();!e&&l&&(null===(s=null==r?void 0:r.details.raw)||void 0===s?void 0:s.entries)&&(r.details.raw.entries=l),this.NotifyListeners_("get-access-storages",this.getAccessStorages_)}PopAllGetAccessStorageSnapshots(e){var t,n,i,s,r,o;let l=this.getAccessStorages_.Peek(),a=null===(t=null==l?void 0:l.details.optimized)||void 0===t?void 0:t.snapshots.Pop();for(;(null===(n=null==l?void 0:l.details.optimized)||void 0===n?void 0:n.snapshots)&&!l.details.optimized.snapshots.IsEmpty();)a=l.details.optimized.snapshots.Pop();!e&&a&&(null===(i=null==l?void 0:l.details.optimized)||void 0===i?void 0:i.entries)&&(l.details.optimized.entries=a);let c=null===(s=null==l?void 0:l.details.raw)||void 0===s?void 0:s.snapshots.Pop();for(;(null===(r=null==l?void 0:l.details.raw)||void 0===r?void 0:r.snapshots)&&!l.details.raw.snapshots.IsEmpty();)c=l.details.raw.snapshots.Pop();!e&&c&&(null===(o=null==l?void 0:l.details.raw)||void 0===o?void 0:o.entries)&&(l.details.raw.entries=c),this.NotifyListeners_("get-access-storages",this.getAccessStorages_)}PushOrigin(e){this.origins_.Push(e),this.NotifyListeners_("origins",this.origins_)}PeekOrigin(){return this.origins_.Peek()}PopOrigin(){let e=this.origins_.Pop();return this.NotifyListeners_("origins",this.origins_),e}Subscribe(e,t){var n;let i=null===(n=Me(this.componentId_))||void 0===n?void 0:n.GenerateUniqueId("sub_");return i&&(this.subscribers_[i]={path:e,callback:t},this.NotifyListeners_("subscribers",this.subscribers_)),i||""}Unsubscribe(e,t){"string"!=typeof e?Object.entries(this.subscribers_).filter((([n,i])=>e===i.callback&&(!t||t===i.path))).map((([e])=>e)).forEach((e=>{this.Unsubscribe_(e)})):e in this.subscribers_&&this.Unsubscribe_(e),this.NotifyListeners_("subscribers",this.subscribers_)}Unsubscribe_(e){delete this.subscribers_[e]}}class le{constructor(){this.record_={}}Push(e,t){(this.record_[e]=this.record_[e]||new i).Push(t)}Pop(e,t){return this.record_.hasOwnProperty(e)?this.record_[e].Pop():t||null}Peek(e,t){return this.record_.hasOwnProperty(e)?this.record_[e].Peek():t||null}Get(e){return this.record_.hasOwnProperty(e)?this.record_[e]:null}GetHistory(e){return this.record_.hasOwnProperty(e)?this.record_[e].GetHistory():[]}GetRecordKeys(){return Object.keys(this.record_)}}function ae(e,t,n){let i="function"==typeof e?function(e){return{handler(t){var{argKey:n}=t,i=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(n[i[s]]=e[i[s]])}return n}(t,["argKey"]);this.extensions.hasOwnProperty(n)?this.extensions[n](Object.assign({argKey:n},i)):e(Object.assign({argKey:n},i))},extensions:{}}}(e):e;return i.extensions[t]=n,i}function ce(e,t){let n="",i=null;return"function"==typeof e?(n=t||"",i=e):(n=e.GetName(),i=t=>e.Handle(t)),{computedName:n,callback:i}}class ue{constructor(){this.expansionRules_={},this.handlers_={}}AddExpansionRule(e){let t=Le().GenerateUniqueId("exrule_");return this.expansionRules_[t]=e,t}RemoveExpansionRule(e){e in this.expansionRules_&&delete this.expansionRules_[e]}Expand(e){if(!(e=e.trim()))return e;for(let t in this.expansionRules_){let n=this.expansionRules_[t](e);if(n)return n}return e}AddHandler(e,t){let{computedName:n,callback:i}=ce(e,t);n&&i&&(this.handlers_[n]=i)}RemoveHandler(e){e in this.handlers_&&delete this.handlers_[e]}FindHandler(e){if(!this.handlers_.hasOwnProperty(e))return null;let t=this.handlers_[e];return"function"==typeof t?t:t.handler.bind(t)}AddHandlerExtension(e,t,n){let i=this.handlers_.hasOwnProperty(e)?this.handlers_[e]:null;if(!i)return;let{computedName:s,callback:r}=ce(t,n);s&&r&&(this.handlers_[e]=ae(i,s,r))}RemoveHandlerExtension(e,t){let n=this.handlers_.hasOwnProperty(e)?this.handlers_[e]:null;n&&function(e,t){"function"!=typeof e&&e.extensions.hasOwnProperty(t)&&delete e.extensions[t]}(n,t)}}function he(e,t){var n;null===(n="string"==typeof e?Me(e):e)||void 0===n||n.PushCurrentScope(t)}function de(e){var t;return(null===(t="string"==typeof e?Me(e):e)||void 0===t?void 0:t.PopCurrentScope())||null}function pe(e){var t;return(null===(t="string"==typeof e?Me(e):e)||void 0===t?void 0:t.PeekCurrentScope())||null}const me="InlineJS_OutsideEvent";function _e(){return globalThis[me]=globalThis[me]||{targetScopes:new Array,eventCallbacks:{}}}function fe(e,t,n){let i=_e(),s=i.targetScopes.find((t=>t.target===e));s||(s={target:e,listeners:{}},i.targetScopes.push(s)),(Array.isArray(t)?t:[t]).forEach((e=>{e in s.listeners||(s.listeners[e]={handlers:new Array,excepts:null}),s.listeners[e].handlers.push({callback:n,excepts:null}),e in i.eventCallbacks||(i.eventCallbacks[e]=e=>{i.targetScopes.forEach((t=>{e.type in t.listeners&&t.target!==e.target&&!t.target.contains(e.target)&&-1==(t.listeners[e.type].excepts||[]).findIndex((t=>t===e.target||t.contains(e.target)))&&t.listeners[e.type].handlers.filter((t=>-1==(t.excepts||[]).findIndex((t=>t===e.target||t.contains(e.target))))).forEach((t=>o((()=>t.callback(e)),"InlineJS.OutsideEventListener")))}))},window.addEventListener(e,i.eventCallbacks[e]))}))}function be(e,t,n){let i=_e().targetScopes.find((t=>t.target===e));i&&(Array.isArray(t)?t:[t]).forEach((e=>{e in i.listeners&&(n?i.listeners[e].handlers=i.listeners[e].handlers.filter((e=>e.callback!==n)):delete i.listeners[e])}))}function ve(e,t,n){let i=_e().targetScopes.find((t=>t.target===e));i&&Object.keys(t).forEach((e=>{if(e in i.listeners)if(n){let s=i.listeners[e].handlers.find((e=>e.callback===n));s&&(s.excepts=s.excepts||new Array,(Array.isArray(t[e])?t[e]:[t[e]]).forEach((e=>{s.excepts.push(e)})))}else i.listeners[e].excepts=i.listeners[e].excepts||new Array,(Array.isArray(t[e])?t[e]:[t[e]]).forEach((t=>{i.listeners[e].excepts.push(t)}))}))}function ye(e){_e().targetScopes=_e().targetScopes.filter((t=>t.target!==e&&!e.contains(t.target)))}class ge extends ne{constructor(e,t,n,i){super(),this.componentId_=e,this.id_=t,this.element_=n,this.isRoot_=i,this.isInitialized_=!1,this.scopeId_="",this.key_="",this.locals_={},this.data_={},this.queuedAttributeChanges_=null,this.managers_={directive:null},this.callbacks_={post:new Array,postAttributes:new Array,uninit:new Array,treeChange:new Array,attributeChange:new Array},this.state_={isMarked:!1,isDestroyed:!1},this.scopeId_=pe(this.componentId_)||""}SetInitialized(){this.isInitialized_=!0}IsInitialized(){return this.isInitialized_}GetComponentId(){return this.componentId_}GetScopeId(){return this.scopeId_}GetId(){return this.id_}SetKey(e){this.NotifyListeners_("key",this.key_=e)}GetKey(){return this.key_}GetElement(){return this.element_}IsRoot(){return this.isRoot_}SetLocal(e,t){this.state_.isMarked||(this.locals_[e]=t,this.NotifyListeners_("locals",this.locals_))}DeleteLocal(e){delete this.locals_[e],this.NotifyListeners_("locals",this.locals_)}HasLocal(e){return e in this.locals_}GetLocal(e){return e in this.locals_?this.locals_[e]:Le().CreateNothing()}GetLocals(){return this.locals_}SetData(e,t){this.state_.isMarked||(this.data_[e]=t,this.NotifyListeners_("data",this.data_))}GetData(e){return e in this.data_?this.data_[e]:Le().CreateNothing()}AddPostProcessCallback(e){this.state_.isMarked||(this.callbacks_.post.push(e),this.NotifyListeners_("post-process-callbacks",this.callbacks_.post))}ExecutePostProcessCallbacks(){(this.callbacks_.post||[]).splice(0).forEach((e=>o(e,"ElementScope.ExecutePostProcessCallbacks")))}AddPostAttributesProcessCallback(e){this.state_.isMarked||(this.callbacks_.postAttributes.push(e),this.NotifyListeners_("post-attributes-process-callbacks",this.callbacks_.postAttributes))}ExecutePostAttributesProcessCallbacks(){(this.callbacks_.postAttributes||[]).splice(0).forEach((e=>o(e,"ElementScope.ExecutePostAttributesProcessCallbacks")))}AddUninitCallback(e){this.state_.isMarked||(this.callbacks_.uninit.push(e),this.NotifyListeners_("uninit-callbacks",this.callbacks_.uninit))}RemoveUninitCallback(e){this.callbacks_.uninit=this.callbacks_.uninit.filter((t=>t!==e)),this.NotifyListeners_("uninit-callbacks",this.callbacks_.uninit)}AddTreeChangeCallback(e){this.callbacks_.treeChange.push(e),this.NotifyListeners_("tree-change-callbacks",this.callbacks_.treeChange)}RemoveTreeChangeCallback(e){this.callbacks_.treeChange=this.callbacks_.treeChange.filter((t=>t!==e)),this.NotifyListeners_("tree-change-callbacks",this.callbacks_.treeChange)}ExecuteTreeChangeCallbacks(e,t){this.callbacks_.treeChange.forEach((n=>o((()=>n({added:e,removed:t})))))}AddAttributeChangeCallback(e,t){if(this.state_.isMarked)return;let n=this.callbacks_.attributeChange.find((t=>t.callback===e));n?n.whitelist.push(...t||[]):this.callbacks_.attributeChange.push({callback:e,whitelist:"string"==typeof t?[t]:t||[]}),this.NotifyListeners_("attribute-change-callbacks",this.callbacks_.attributeChange)}RemoveAttributeChangeCallback(e,t){let n=this.callbacks_.attributeChange.findIndex((t=>t.callback===e));if(-1==n)return;let i="string"==typeof t?[t]:t||[];0!=i.length&&0!=this.callbacks_.attributeChange[n].whitelist.length?i.forEach((e=>{this.callbacks_.attributeChange[n].whitelist=this.callbacks_.attributeChange[n].whitelist.filter((t=>t!==e))})):this.callbacks_.attributeChange[n].whitelist.splice(0),0==this.callbacks_.attributeChange[n].whitelist.length&&this.callbacks_.attributeChange.splice(n,1),this.NotifyListeners_("attribute-change-callbacks",this.callbacks_.attributeChange)}ExecuteAttributeChangeCallbacks(e){this.queuedAttributeChanges_?this.queuedAttributeChanges_.push(e):(this.queuedAttributeChanges_=[e],queueMicrotask((()=>{if(!this.queuedAttributeChanges_)return;const e=this.queuedAttributeChanges_;this.queuedAttributeChanges_=null,e.forEach((e=>{(this.callbacks_.attributeChange||[]).filter((t=>0==(t.whitelist||[]).length||t.whitelist.includes(e))).forEach((t=>o((()=>t.callback(e)))))}))})))}Destroy(e){if(this.state_.isDestroyed)return;if(this.state_.isMarked=!0,!(this.element_ instanceof HTMLTemplateElement)){let t=Me(this.componentId_);t&&this.DestroyChildren_(t,this.element_,e||!1)}if(e)return;this.callbacks_.uninit.splice(0).forEach((e=>{try{e()}catch(e){}})),this.callbacks_.post.splice(0),this.callbacks_.treeChange.splice(0),this.callbacks_.attributeChange.splice(0),this.data_={},this.locals_={},this.state_.isDestroyed=!0,ye(this.element_),Le().GetMutationObserver().Unobserve(this.element_);let t=Me(this.componentId_);if(null==t||t.RemoveElementScope(this.id_),delete this.element_[f],this.isRoot_){let e=this.componentId_;null==t||t.GetBackend().changes.AddNextTickHandler((()=>Le().RemoveComponent(e)))}}IsMarked(){return this.state_.isMarked}IsDestroyed(){return this.state_.isDestroyed}GetDirectiveManager(){return this.managers_.directive=this.managers_.directive||new ue}DestroyChildren_(e,t,n){Array.from(t.children).filter((e=>!e.contains(t))).forEach((t=>{let i=e.FindElementScope(t);i?i.Destroy(n):this.DestroyChildren_(e,t,n)}))}}class Ce{constructor(e,t,n){this.componentId_=e,this.id_=t,this.root_=n,this.name_="",this.proxy_=new W(this.componentId_,{},this.id_)}GetComponentId(){return this.componentId_}GetId(){return this.id_}SetName(e){this.name_=e}GetName(){return this.name_}GetRoot(){return this.root_}GetProxy(){return this.proxy_}FindElement(e,t){if(e===this.root_||!this.root_.contains(e))return null;do{e=e.parentElement;try{if(t(e))return e}catch(e){}}while(e!==this.root_);return null}FindAncestor(e,t){let n=t||0;return this.FindElement(e,(()=>0==n--))}}class Ae extends ne{constructor(e,t){super(),this.id_=e,this.root_=t,this.reactiveState_="default",this.name_="",this.context_=new le,this.scopes_={},this.elementScopes_={},this.proxies_={},this.refs_={},this.currentScope_=new i,this.selectionScopes_=new i,this.uniqueMarkers_={level0:0,level1:0,level2:0},this.attributeObservers_=new Array,this.observers_={intersections:{}},this.changes_=new oe(this.id_),this.rootProxy_=new W(this.id_,{}),this.proxies_[this.rootProxy_.GetPath()]=this.rootProxy_,Le().GetMutationObserver().Observe(this.root_,(({added:t,removed:n,attributes:i})=>{let s=Me(e);if(!s)return;let r=new Array,l=Le().GetConfig().GetDirectiveRegex(),a=null==i?void 0:i.filter((e=>e.target instanceof HTMLElement));null==a||a.forEach((e=>{var t;l.test(e.name)?e.target.hasAttribute(e.name)&&!r.includes(e.target)&&r.push(e.target):null===(t=null==s?void 0:s.FindElementScope(e.target))||void 0===t||t.ExecuteAttributeChangeCallbacks(e.name)})),a&&this.attributeObservers_.forEach((e=>{let t=a.filter((t=>t.target===e.element||e.element.contains(t.target)));0!=t.length&&o((()=>e.callback(t)))})),r.forEach((e=>R({element:e,component:s,options:{checkTemplate:!0,checkDocument:!1,ignoreChildren:!1}})));let c=[...t||[]];null==t||t.filter((e=>!(null==n?void 0:n.includes(e)))).forEach((e=>{var t;if(e instanceof HTMLElement){R({component:s,element:e,options:{checkTemplate:!0,checkDocument:!1,ignoreChildren:!1}});for(let n=e.parentElement;n&&(null===(t=null==s?void 0:s.FindElementScope(n))||void 0===t||t.ExecuteTreeChangeCallbacks([e],[]),n!==this.root_);n=n.parentElement);}})),null==n||n.filter((e=>!c.includes(e))).forEach((e=>{var t;e instanceof HTMLElement&&(null===(t=s.FindElementScope(e))||void 0===t||t.Destroy())}))}),["add","remove","attribute"])}SetReactiveState(e){this.NotifyListeners_("reactive-state",this.reactiveState_=e)}GetReactiveState(){return"default"===this.reactiveState_?v().GetReactiveState():this.reactiveState_}GetId(){return this.id_}GenerateUniqueId(e,t){const n=ee(this.uniqueMarkers_,`Cmpnt<${this.id_}>.`,e,t);return this.NotifyListeners_("unique-markers",this.uniqueMarkers_),n}SetName(e){this.NotifyListeners_("name",this.name_=e)}GetName(){return this.name_}CreateScope(e){let t=Object.values(this.scopes_).find((t=>t.GetRoot()===e));if(t)return t;if(e===this.root_||!this.root_.contains(e))return null;let n=new Ce(this.id_,this.GenerateUniqueId("scope_"),e);return this.scopes_[n.GetId()]=n,this.AddProxy(n.GetProxy()),this.NotifyListeners_("scopes",this.scopes_),n}RemoveScope(e){let t="string"==typeof e?e:e.GetId();this.scopes_.hasOwnProperty(t)&&(this.RemoveProxy(this.scopes_[t].GetProxy()),delete this.scopes_[t],this.NotifyListeners_("scopes",this.scopes_))}FindScopeById(e){return this.scopes_.hasOwnProperty(e)?this.scopes_[e]:null}FindScopeByName(e){return Object.values(this.scopes_).find((t=>t.GetName()===e))||null}FindScopeByRoot(e){return Object.values(this.scopes_).find((t=>t.GetRoot()===e))||null}PushCurrentScope(e){this.currentScope_.Push(e),this.NotifyListeners_("current-scope",this.currentScope_)}PopCurrentScope(){let e=this.currentScope_.IsEmpty(),t=this.currentScope_.Pop();return!e&&this.NotifyListeners_("current-scope",this.currentScope_),t}PeekCurrentScope(){return this.currentScope_.Peek()}InferScopeFrom(e){var t;return this.FindScopeById((null===(t=this.FindElementScope(b(e)))||void 0===t?void 0:t.GetScopeId())||"")||null}PushSelectionScope(){let e={set:!1};return this.selectionScopes_.Push(e),this.NotifyListeners_("selection-scopes",this.selectionScopes_),e}PopSelectionScope(){let e=this.selectionScopes_.IsEmpty(),t=this.selectionScopes_.Pop();return!e&&this.NotifyListeners_("selection-scopes",this.selectionScopes_),t}PeekSelectionScope(){return this.selectionScopes_.Peek()}GetRoot(){return this.root_}FindElement(e,t){if(e===this.root_||!this.root_.contains(e))return null;for(let n=e.parentNode;n;n=n.parentNode)try{if(n instanceof HTMLElement&&t(n))return n;if(n===this.root_)break}catch(e){break}return null}FindAncestor(e,t){let n=t||0;return this.FindElement(e,(()=>0==n--))}CreateElementScope(e){let t=Object.values(this.elementScopes_).find((t=>t.GetElement()===e));if(t)return t;if(e!==this.root_&&!this.root_.contains(e))return null;let n=new ge(this.id_,this.GenerateUniqueId("elscope_"),e,e===this.root_);this.elementScopes_[n.GetId()]=n,e[f]=n.GetId();let i=t=>{let n=V(e,[v().GetDirectiveName(t,!1),v().GetDirectiveName(t,!0)]);if(n){let t=S(n.name,n.value);t&&I(this,e,t)}};return["data","component","ref","locals","init"].forEach((e=>i(e))),n.SetInitialized(),"OnElementScopeCreated"in e&&"function"==typeof e.OnElementScopeCreated&&o((()=>e.OnElementScopeCreated({componentId:this.id_,component:this,scope:n}))),this.NotifyListeners_("element-scopes",this.elementScopes_),n}RemoveElementScope(e){delete this.elementScopes_[e],this.NotifyListeners_("element-scopes",this.elementScopes_)}FindElementScope(e){if("string"==typeof e)return e in this.elementScopes_?this.elementScopes_[e]:null;let t=!0===e?this.context_.Peek(_.self):e instanceof Node?e:this.root_;return t&&f in t&&"string"==typeof t[f]&&t[f]in this.elementScopes_?this.elementScopes_[t[f]]:null}FindElementLocal(e,t,n){let i=this.FindElementScope(e);if(null==i?void 0:i.HasLocal(t))return i;if(!n||!i&&"string"==typeof e)return null;let s=(null==i?void 0:i.GetElement())||(!0===e?this.context_.Peek(_.self):e instanceof Node?e:this.root_);if(!s)return null;let r=this.FindAncestor(s);return r?this.FindElementLocal(r,t,!0):null}FindElementLocalValue(e,t,n){let i=this.FindElementScope(e),s=i?i.GetLocal(t):Le().CreateNothing();if(!Le().IsNothing(s)||!n||!i&&"string"==typeof e)return s;let r=(null==i?void 0:i.GetElement())||(!0===e?this.context_.Peek(_.self):e instanceof Node?e:this.root_);if(!r)return s;let o=this.FindAncestor(r);return o?this.FindElementLocalValue(o,t,!0):s}SetElementLocalValue(e,t,n){var i;null===(i=this.FindElementScope(e))||void 0===i||i.SetLocal(t,n)}DeleteElementLocalValue(e,t){var n;null===(n=this.FindElementScope(e))||void 0===n||n.DeleteLocal(t)}AddProxy(e){this.proxies_[e.GetPath()]=e,this.NotifyListeners_("proxies",this.proxies_)}RemoveProxy(e){let t="string"==typeof e?e:e.GetPath();this.proxies_.hasOwnProperty(t)&&(delete this.proxies_[t],this.NotifyListeners_("proxies",this.proxies_))}GetRootProxy(){return this.rootProxy_}FindProxy(e){return e in this.proxies_?this.proxies_[e]:null}AddRefElement(e,t){this.refs_[e]=t,this.NotifyListeners_("refs",this.refs_)}FindRefElement(e){return e in this.refs_?this.refs_[e]:null}GetRefElements(){return this.refs_}AddAttributeChangeCallback(e,t){this.attributeObservers_.push({element:e,callback:t}),this.NotifyListeners_("attribute-observers",this.attributeObservers_)}RemoveAttributeChangeCallback(e,t){this.attributeObservers_=this.attributeObservers_.filter((n=>n.element!==e&&n.callback!==t)),this.NotifyListeners_("attribute-observers",this.attributeObservers_)}AddIntersectionObserver(e){this.observers_.intersections[e.GetId()]=e,this.NotifyListeners_("intersection-observers",this.observers_.intersections)}FindIntersectionObserver(e){return e in this.observers_.intersections?this.observers_.intersections[e]:null}RemoveIntersectionObserver(e){e in this.observers_.intersections&&(delete this.observers_.intersections[e],this.NotifyListeners_("intersection-observers",this.observers_.intersections))}GetBackend(){return{context:this.context_,changes:this.changes_}}GetGlobal(){return Le()}}class Ee{constructor(){this.handlers_={}}AddHandler(e,t,n){let i="",s=null;"function"==typeof e?(i=t||"",s=e):(i=e.GetName(),s=t=>e.Handle(t)),i&&(this.handlers_[i]={callback:s,onAccess:n})}RemoveHandler(e){e in this.handlers_&&delete this.handlers_[e]}FindHandler(e,t){return e in this.handlers_?(t&&this.handlers_[e].onAccess&&this.handlers_[e].onAccess(t),this.handlers_[e].callback):null}}class Se{constructor(){if(this.uniqueMarkers_={level0:0,level1:0,level2:0},this.observer_=null,this.handlers_={},globalThis.MutationObserver)try{this.observer_=new globalThis.MutationObserver((e=>{let t={},n=e=>t[e]=t[e]||{added:new Array,removed:new Array,attributes:new Array};e.forEach((e=>{var t,i;if("childList"===(null==e?void 0:e.type)){let i=e=>{var t;let s=b((null===(t=Be(e))||void 0===t?void 0:t.GetRoot())||null);s?n(s).removed.push(e):Array.from(e.childNodes).filter((t=>!t.contains(e))).forEach(i)};e.removedNodes.forEach(i);let s=e.target instanceof HTMLElement?b((null===(t=Be(e.target))||void 0===t?void 0:t.GetRoot())||null):"";s&&n(s).added.push(...Array.from(e.addedNodes))}else if("attributes"===(null==e?void 0:e.type)&&e.attributeName){let t=e.target instanceof HTMLElement?b((null===(i=Be(e.target))||void 0===i?void 0:i.GetRoot())||null):"";t&&n(t).attributes.push({name:e.attributeName,target:e.target})}})),0!=Object.keys(t).length&&Object.entries(this.handlers_).forEach((([e,n])=>{let i=n.target instanceof HTMLElement?b(n.target):"";if(!i||!(i in t))return;let s=(e,t,n)=>!t.whitelist||t.whitelist.includes(e)?n:void 0,r=s("add",n,t[i].added),l=s("remove",n,t[i].removed),a=s("attribute",n,t[i].attributes);(r||l||a)&&o((()=>n.handler({id:e,added:r,removed:l,attributes:a})),"InlineJS.MutationObserver")}))})),this.observer_.observe(document,{childList:!0,subtree:!0,attributes:!0,characterData:!1})}catch(e){this.observer_=null}}GetNative(){return this.observer_}Observe(e,t,n){let i=ee(this.uniqueMarkers_);return this.handlers_[i]={target:e,handler:t,whitelist:n},i}Unobserve(e){"string"!=typeof e?Object.entries(this.handlers_).filter((([t,n])=>n.target===e)).forEach((([e])=>delete this.handlers_[e])):delete this.handlers_[e]}}class xe{constructor(){if(this.observer_=null,this.handlers_=new Array,globalThis.MutationObserver)try{this.observer_=new globalThis.ResizeObserver(((e,t)=>{e.forEach((e=>{this.handlers_.filter((({target:t})=>t===e.target)).forEach((n=>{o((()=>n.handler({entry:e,observer:t})),"InlineJS.ResizeObserver")}))}))}))}catch(e){this.observer_=null}}GetNative(){return this.observer_}Observe(e,t,n){var i;this.handlers_.push({target:e,handler:t}),null===(i=this.observer_)||void 0===i||i.observe(e,n||{box:"border-box"})}Unobserve(e){var t;this.handlers_=this.handlers_.filter((t=>t.target===e)),null===(t=this.observer_)||void 0===t||t.unobserve(e)}}class Pe extends z{constructor(e,t,n){super(e.GetComponentId(),n,t,e)}}function Ie(e,t){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";return Array.from({length:e||11},(()=>(t||n).charAt(Math.floor(Math.random()*(t||n).length)))).join("")}class ke{constructor({appName:e="",reactiveState:t="unoptimized",directivePrefix:n="x",elementPrefix:i,directiveRegex:s,directiveNameBuilder:r}={}){this.keyMap_={return:"enter",ctrl:"control",esc:"escape",space:" ",menu:"contextmenu",del:"delete",ins:"insert",plus:"+",minus:"-",star:"*",slash:"/",alpha:Array.from({length:26}).map(((e,t)=>String.fromCharCode(t+97))),digit:Array.from({length:10}).map(((e,t)=>t.toString()))},this.booleanAttributes_=new Array("allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"),globalThis.InlineJS=globalThis.InlineJS||{};let o=globalThis.InlineJS.config||{};o=M(o)?o:{},this.appName_=o.appName||e,this.reactiveState_=o.reactiveState||t,this.directivePrefix_=o.directivePrefix||n,this.elementPrefix_=o.elementPrefix||i||n,this.directiveRegex_=s||new RegExp(`^(data-)?${n||"x"}-(.+)$`),this.directiveNameBuilder_=r||((e,t=!1)=>t?`data-${this.directivePrefix_||"x"}-${e}`:`${this.directivePrefix_||"x"}-${e}`)}GetAppName(){return this.appName_}SetDirectivePrefix(e){this.directivePrefix_=e,this.directiveRegex_=new RegExp(`^(data-)?${e||"x"}-(.+)$`)}GetDirectivePrefix(){return this.directivePrefix_}SetElementPrefix(e){this.elementPrefix_=e}GetElementPrefix(){return this.elementPrefix_}GetDirectiveRegex(){return this.directiveRegex_}GetDirectiveName(e,t){return this.directiveNameBuilder_(e,t)}GetElementName(e){return`${this.elementPrefix_||this.directivePrefix_||"x"}-${e}`}AddKeyEventMap(e,t){this.keyMap_[e]=t}RemoveKeyEventMap(e){delete this.keyMap_[e]}MapKeyEvent(e){return e in this.keyMap_?this.keyMap_[e]:e}AddBooleanAttribute(e){this.booleanAttributes_.push(e)}RemoveBooleanAttribute(e){this.booleanAttributes_=this.booleanAttributes_.filter((t=>t!==e))}IsBooleanAttribute(e){return this.booleanAttributes_.includes(e)}SetReactiveState(e){this.reactiveState_=e}GetReactiveState(){return this.reactiveState_}}class Ge{Get(e,t){return fetch(e,t)}}class Oe extends ne{constructor(e,t=0){super(),this.nothing_=new a,this.storedObjects_={},this.lastStoredObjectKey_="",this.componentsMonitorList_=new Array,this.components_={},this.currentComponent_=new i,this.attributeProcessors_=new Array,this.textContentProcessors_=new Array,this.customElements_={},this.managers_={directive:new ue,magic:new Ee},this.uniqueMarkers_={level0:0,level1:0,level2:0},this.mutationObserver_=new Se,this.resizeObserver_=new xe,this.nativeFetch_=new Ge,this.fetchConcept_=null,this.concepts_={},this.config_=new ke(e||{}),this.uniqueMarkers_.level0=t||0}SwapConfig(e){this.NotifyListeners_("config",this.config_=e)}GetConfig(){return this.config_}GenerateUniqueId(e,t){const n=ee(this.uniqueMarkers_,"",e,t);return this.NotifyListeners_("unique-markers",this.uniqueMarkers_),n}StoreObject({object:e,componentId:t,contextElement:n}){var i;if(this.lastStoredObjectKey_=`@!@${Ie(18)}@!@`,n){let s=null===(i=this.FindComponentById(t||"")||this.InferComponentFrom(n))||void 0===i?void 0:i.FindElementScope(n);if(s)return s.SetLocal(this.lastStoredObjectKey_,e),this.lastStoredObjectKey_}return this.storedObjects_[this.lastStoredObjectKey_]=e,this.NotifyListeners_("stored-objects",this.storedObjects_),this.lastStoredObjectKey_}RetrieveObject(e){return this.RetrieveObject_(e,!0)}PeekObject(e){return this.RetrieveObject_(e,!1)}GetLastObjectKey(){return this.lastStoredObjectKey_}AddComponentMonitor(e){this.componentsMonitorList_.push(e),this.NotifyListeners_("components-monitors",this.componentsMonitorList_)}RemoveComponentMonitor(e){let t=this.componentsMonitorList_.length;this.componentsMonitorList_=this.componentsMonitorList_.filter((t=>t!==e)),t!=this.componentsMonitorList_.length&&this.NotifyListeners_("components-monitors",this.componentsMonitorList_)}CreateComponent(e){let t=this.InferComponentFrom(e);if(t)return t;let n=new Ae(this.GenerateUniqueId(),e);return this.components_[n.GetId()]=n,this.componentsMonitorList_.forEach((e=>o((()=>e({action:"add",component:n})),"InlineJS.Global.CreateComponent"))),this.NotifyListeners_("components",this.components_),n}RemoveComponent(e){let t="string"==typeof e?e:e.GetId();if(this.components_.hasOwnProperty(t)){let e=this.components_[t];delete this.components_[t],this.componentsMonitorList_.slice(0).forEach((t=>o((()=>t({action:"remove",component:e})),"InlineJS.Global.RemoveComponent"))),this.NotifyListeners_("components",this.components_)}}TraverseComponents(e){Object.values(this.components_).some((t=>!1===e(t)))}FindComponentById(e){return e&&e in this.components_?this.components_[e]:null}FindComponentByName(e){return e&&Object.values(this.components_).find((t=>t.GetName()===e))||null}FindComponentByRoot(e){return e&&Object.values(this.components_).find((t=>t.GetRoot()===e))||null}PushCurrentComponent(e){this.currentComponent_.Push(e),this.NotifyListeners_("current-component",this.currentComponent_)}PopCurrentComponent(){let e=this.currentComponent_.IsEmpty(),t=this.currentComponent_.Pop();return!e&&this.NotifyListeners_("current-component",this.currentComponent_),t}PeekCurrentComponent(){return this.currentComponent_.Peek()}GetCurrentComponent(){return this.FindComponentById(this.PeekCurrentComponent()||"")}InferComponentFrom(e){return e&&Object.values(this.components_).find((t=>t.GetRoot()===e||t.GetRoot().contains(e)))||null}GetDirectiveManager(){return this.managers_.directive}GetMagicManager(){return this.managers_.magic}AddAttributeProcessor(e){this.attributeProcessors_.push(e),this.NotifyListeners_("attribute-processors",this.attributeProcessors_)}DispatchAttributeProcessing(e){this.attributeProcessors_.forEach((t=>o((()=>t(e)),"InlineJS.Global.DispatchAttribute",e.contextElement)))}AddTextContentProcessor(e){this.textContentProcessors_.push(e),this.NotifyListeners_("text-content-processors",this.textContentProcessors_)}DispatchTextContentProcessing(e){this.textContentProcessors_.forEach((t=>o((()=>t(e)),"InlineJS.Global.DispatchTextContent",e.contextElement)))}GetMutationObserver(){return this.mutationObserver_}GetResizeObserver(){return this.resizeObserver_}SetFetchConcept(e){this.fetchConcept_=e,this.NotifyListeners_("fetch-concept",this.fetchConcept_)}GetFetchConcept(){return this.fetchConcept_||this.nativeFetch_}SetConcept(e,t){this.concepts_[e]=t,this.NotifyListeners_("concepts",this.concepts_)}RemoveConcept(e){delete this.concepts_[e],this.NotifyListeners_("concepts",this.concepts_)}GetConcept(e){return this.concepts_.hasOwnProperty(e)?this.concepts_[e]:null}AddCustomElement(e,t){this.customElements_.hasOwnProperty(e)||(this.customElements_[e]=t,customElements.define(this.config_.GetElementName(e),t),this.NotifyListeners_("custom-elements",this.customElements_))}FindCustomElement(e){return this.customElements_.hasOwnProperty(e)?this.customElements_[e]:null}CreateChildProxy(e,t,n){return new Pe(e,t,n)}CreateFuture(e){return new s(e)}IsFuture(e){return e instanceof s}CreateNothing(){return this.nothing_}IsNothing(e){return e instanceof a}RetrieveObject_({key:e,componentId:t,contextElement:n},i){if(n){let s=this.FindComponentById(t||"")||this.InferComponentFrom(n);if(s){let t=s.FindElementLocal(n,e,!0);if(t){const n=t.GetLocal(e);return i&&(t.DeleteLocal(e),e===this.lastStoredObjectKey_&&(this.lastStoredObjectKey_="")),n}}}if(this.storedObjects_.hasOwnProperty(e)){const t=this.storedObjects_[e];return i&&(e===this.lastStoredObjectKey_&&(this.lastStoredObjectKey_=""),delete this.storedObjects_[e],this.NotifyListeners_("stored-objects",this.storedObjects_)),t}return this.CreateNothing()}}const Re="__InlineJS_GLOBAL_KEY__";function we(e,t=0){return De(),globalThis[Re]=new Oe(e,t),(globalThis.InlineJS=globalThis.InlineJS||{}).global=globalThis[Re],window.dispatchEvent(new CustomEvent(Fe)),globalThis[Re]}function Ne(e,t=0){return Le()||we(e,t)}const Fe="inlinejs.global.created";function Le(){return globalThis[Re]}function je(){return Le()?Promise.resolve():new Promise((e=>window.addEventListener(Fe,e)))}const Te="InlineJS_Comp_Cache";function De(){u(Te,{id:"",component:null})}function Me(e){let t=h(Te,{id:"",component:null});return e===t.id||(t.component=Le().FindComponentById(e),t.id=t.component?e:""),t.component}function $e(e){return Le().FindComponentByName(e)}function He(e){return Le().FindComponentByRoot(e)}function Be(e){let t=b(e).match(/^Cmpnt\<([0-9_]+)\>/);return t?Me(t[1]):null}var Je=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(n[i[s]]=e[i[s]])}return n};function ze(e){var{key:t}=e,n=Je(e,["key"]);let i=Le().RetrieveObject(Object.assign({key:t},n));return Le().IsNothing(i)?t:i}function We(e){var{key:t}=e,n=Je(e,["key"]);let i=Le().PeekObject(Object.assign({key:t},n));return Le().IsNothing(i)?t:i}function qe(e,t,n){var i;return ze({key:e,componentId:t||(n?null===(i=Be(n))||void 0===i?void 0:i.GetId():void 0),contextElement:n})}function Ue(e){return e=j(e),Le().IsFuture(e)?Ue(e.Get()):!e&&!1!==e&&0!==e||Le().IsNothing(e)?"":"boolean"==typeof e||"number"==typeof e||"string"==typeof e?e.toString():JSON.stringify(e)}function Ke(e,t,n){const i=t&&q(e)?e.getAttribute(t):null;return i?qe(i,n,e):Ue(i)}function Ve(e,t,n){var i;return null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e?Ue(e):Le().StoreObject({object:e,componentId:t||(n?null===(i=Be(n))||void 0===i?void 0:i.GetId():void 0),contextElement:n})}function Ye(e,t,n,i){(!t||!q(e))&&e.setAttribute(t,Ve(n,i,e))}function Ze(e,t=!1){return new RegExp(`${e}$`,t?"i":void 0)}function Qe(e,t){for(let n=e.parentNode;n;n=n.parentNode)try{if(n instanceof HTMLElement&&t(n))return n}catch(e){break}return null}function Xe(e,t){return Qe(e,(e=>e.classList.contains(t)))}function et(e,t){return Qe(e,(e=>e.hasAttribute(t)))}function tt(e,t,n){return Qe(e,(e=>e.getAttribute(t)===n))}function nt(e,t){return Qe(e,(e=>e.tagName.toLowerCase()===t.toLowerCase()))}function it(e){let t=globalThis.InlineJS=globalThis.InlineJS||{};return(e=e.trim())&&e.split(".").forEach((e=>{t=t[e]=t[e]||{}})),t}function st(e,t){let n=it(e);Object.entries(t).forEach((([e,t])=>n[e]=t))}function rt(e,t){if(e.hasOwnProperty("IsBooleanAttribute")&&"function"==typeof e.IsBooleanAttribute){let n=e.IsBooleanAttribute(t);if(!1===n||!0===n)return n}return Le().GetConfig().IsBooleanAttribute(t)}function ot(e,t,n=!0){let[i,s]=n?T([e,t]):[e,t];if(i===s)return!0;if(Array.isArray(i)&&Array.isArray(s))return i.length==s.length&&-1==i.findIndex(((e,t)=>!ot(e,s[t],n)));if($([i,s])){let e=Object.keys(i),t=Object.keys(s);return e.length==t.length&&-1==e.findIndex((e=>!t.includes(e)||!ot(i[e],s[e],n)))}return i==s}function lt(e,t,n,i,s){let r=!1,a=()=>r=!0,c=0,u=e=>t?Math.floor(e/t):e,h=performance.now(),d=h,p=(l,m,_)=>{if(r)return;let f=_-h;if(s&&f>=s)if(n&&(n<0||c<n)){let t=f-s;i>0&&t<i?setTimeout((()=>{h=performance.now(),e(p.bind(null,l,m))}),i-t):e(p.bind(null,l,m)),c+=1,h=_,d=_}else o((()=>m({repeats:c,steps:s?u(s):-1,elapsed:f,duration:s})));else{e(p.bind(null,l,m));let n=_-d;n>=t&&(d=_+(t?n%t:n),o((()=>l({repeats:c,steps:u(f),elapsed:f,duration:s,abort:a}))))}};return new l(((t,n)=>{e(p.bind(null,t,n))}))}const at=[50,40,30,25,20,15,10,5,4,3,2,1,0];function ct(e,t=1e3,n=0,i=0,s=!0){let r=0,o=Math.floor(t/2.2);for(let e of at)if(e<=o){r=e;break}return lt((e=>setTimeout((()=>{s?requestAnimationFrame(e):e(performance.now())}),r)),t,n,i,e)}function ut(e,t=1e3,n=0,i=0){return lt(requestAnimationFrame,t,n,i,e)}function ht(e){let t=performance.now();return e(),performance.now()-t}function dt(e){return(e=e?e.trim():"")?(!(e=e.replace(/[?][?&=\/]+/g,"?").replace(/[&][?&=\/]+/g,"&").replace(/[=][?=\/]+/g,"=").replace(/[\/][\/=]+/g,"/").replace(/[:]{2,}/g,":").replace(/[:][\/]([^\/])/g,"://$1").replace(/[\/?&=]+$/,"")).startsWith("/?")&&(e=e.replace(/^[\/?&=]+/,"")),e.split(/[?&]/).reduce(((e,t,n)=>e?`${e}${n<2?"?":"&"}${t}`:t),"")):""}function pt(e,t,n){return(e=dt(e))===t?(e=n&&n||"/").startsWith("/")?e:`/${e}`:(e.startsWith(`${t}/`)&&(e=e.substring(t.length)),/^[a-zA-Z0-9_]+:\/\//.test(e)?e:(n&&(e=e.startsWith("/")?`${n}${e}`:`${n}/${e}`),e.startsWith("/")?e:`/${e}`))}function mt(e,t,n){let i=(e=t?pt(e,t,n):e).indexOf("?");return{base:-1==i?e:e.substring(0,i),query:-1==i?"":e.substring(i+1)}}function _t({base:e,query:t},n,i,s){let r=`${dt(e)}?${t}`;return r=n?pt(r,n,i):dt(r),r=s?dt(`${n}/${r}`):r.startsWith("/")||/^[a-zA-Z0-9_]+:\/\//.test(r)?r:`/${r}`,r}function ft(e,t,n){t&&q(e)&&e.setAttribute(t,n)}function bt(e,t="-"){t=t||"-";let n=e.replace(/([A-Z]+)/g,(e=>`${t}${e.toLowerCase()}`));return n.startsWith(t)?n.substring(1):n}var vt=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(n[i[s]]=e[i[s]])}return n};function yt({target:e,getter:t,setter:n,deleter:i,lookup:s,alert:r}){let o={get(e,n){var i;if("symbol"==typeof n||"string"==typeof n&&"prototype"===n)return Reflect.get(e,n);let s=t?t(n.toString(),e):e[n];return Le().IsNothing(s)?Reflect.get(e,n):(!r||r.list&&!(n in r.list)||null===(i=Me(r.componentId))||void 0===i||i.GetBackend().changes.AddGetAccess(`${r.id}.${n}`),s)},set:(e,t,i)=>"symbol"==typeof t||"string"==typeof t&&"prototype"===t?Reflect.set(e,t,i):n?!1!==n(t.toString(),i,e):!!e[t]||!0,deleteProperty:(e,t)=>"symbol"==typeof t||"string"==typeof t&&"prototype"===t?Reflect.deleteProperty(e,t):i?!1!==i(t.toString(),e):!!delete e[t]||!0,has:(e,t)=>!!Reflect.has(e,t)||(Array.isArray(s)?s.includes(t.toString()):s?s(t.toString(),e):t in e)};return new window.Proxy(e||{},o)}function gt(e){return yt(Et({getter:t=>t&&t in e&&e[t]||null,lookup:[...Object.keys(e)]}))}function Ct(){return!1}function At(e){var{setter:t,deleter:n,lookup:i}=e,s=vt(e,["setter","deleter","lookup"]);return Object.assign(Object.assign({},s),{setter:t||Ct,deleter:n||Ct,lookup:i||Ct})}function Et(e){return At(e)}const St="InlineJS_ProxyGlobal";function xt(e,t,n){let i=null==t?void 0:t.FindElementScope(n),s=null==i?void 0:i.GetId();if(!s)return["",null,null];let r=globalThis[St]=globalThis[St]||{},o=r[e]=r[e]||{};return s in o?[s,o[s],o]:(null==i||i.AddUninitCallback((()=>delete o[s])),[s,null,o])}function Pt(e,t,n){if(!(e instanceof Promise))return t(e);n?e.then((e=>Pt(e,t,!0))):e.then(t)}const It="__InlineJS_Context__",kt="InlineJS_Func_Cache";function Gt(e,t,n,i=!1){let s=p(kt,t);if(s)return s;try{let n=new Function(It,`\n with (${It}){\n ${e(t)};\n };\n `);return d(kt,t,n,{}),n}catch(e){if(i||!(e instanceof SyntaxError))return void r(e,`InlineJs.Region<${n||"NIL"}>.GenerateFunction`)}return null}function Ot(e,t,n=!1){return Gt((e=>`return (${e})`),e,t,n)}function Rt(e,t,n=!1){return Gt((e=>e),e,t,n)}function wt(e,t,n,i=[]){var s;if("function"==typeof e){let r=Me(n||""),o=null==r?void 0:r.FindProxy(null==r?void 0:r.GetBackend().changes.GetLastAccessContext()),l=e.apply((null===(s=o||(null==r?void 0:r.GetRootProxy()))||void 0===s?void 0:s.GetNative())||null,i||[]);return t?t(l):l}return t?t(e):e}function Nt({componentId:e,contextElement:t,expression:n,disableFunctionCall:i=!1,waitPromise:s="recursive",voidOnly:o}){let l=e=>(e&&e(null),null);if(!(n=n.trim()))return l;let a=o?null:Ot(n,e),c=!1;if(void 0===a)return l;if(!a&&(c=!0),!a&&!(a=Rt(n,e,!0)))return l;let u=(o,l,a,c,u=!0,h)=>{var d;let p=Me(e),m=null==p?void 0:p.GetRootProxy().GetNative();if(!m||(null===(d=null==p?void 0:p.FindElementScope(t))||void 0===d?void 0:d.IsDestroyed()))return;let{context:f=null,changes:b=null}=(null==p?void 0:p.GetBackend())||{};null==f||f.Push(_.self,t),null==b||b.ResetLastAccessContext(),ie(e),Object.entries(c||{}).forEach((([e,t])=>null==f?void 0:f.Push(e,t)));try{let t=l(m);if(Le().IsFuture(t)&&(t=t.Get()),!o)return i?t:wt(t,o,e,a);let n=e=>{if(e&&"none"!==s)return Pt(e,o,"recursive"===s),h||"Loading data...";o(e)};i?n(t):wt(t,n,e,a)}catch(t){if(u&&t instanceof SyntaxError)throw t;r(t,`InlineJs.Region<${e}>.RunFunction('${n}')`)}finally{Object.entries(c||{}).forEach((([e,t])=>null==f?void 0:f.Pop(e,t))),se(),null==f||f.Pop(_.self)}};return(i,s=[],o,h)=>{try{return u(i,a.bind(t),s||[],o||{},void 0,h)}catch(h){if(h instanceof SyntaxError&&!c)return c=!0,a=Rt(n,e,!0),a?u(i,a.bind(t),s||[],o||{},!1):l(i);r(h,`InlineJs.Region<${e}>.RunFunction('${n}')`)}return l(i)}}function Ft(e){return Nt(e)}function Lt(e,t){let n=(e,t)=>Pt(e,t,!0);return e instanceof l?new l(((i,s)=>{e.While((e=>{n(e,(e=>{n(t(e),(e=>i(e)))}))})),e.Final((e=>{n(e,(e=>{n(t(e),(e=>s(e)))}))}))})):e instanceof Promise?new Promise((i=>{n(e,(e=>{n(t(e),(e=>i(e)))}))})):t(e)}function jt(e,t,n){e instanceof l?e.While(t).Final(!1===n?()=>{}:n||t):t(e)}function Tt({componentId:e,changes:t,callback:n,subscriptionsCallback:i,contextElement:s}){var o,l,a,c;t.PopAllGetAccessStorageSnapshots(!1),t.RestoreOptimizedGetAccessStorage();let{optimized:u,raw:h}=t.PopGetAccessStorage();if(0==((null===(o=u||h)||void 0===o?void 0:o.entries.length)||0))return i&&i({}),null;let d={},p=()=>{Object.keys(d).map((e=>Me(e))).filter((e=>!!e)).forEach((e=>{let{changes:t}=e.GetBackend();d[e.GetId()].forEach((e=>t.Unsubscribe(e)))})),d={}},m=!1,_=()=>{m=!0},f=t=>{let i=Me(e);if(!i||m)return void p();let{changes:s}=i.GetBackend();s.PushOrigin(f);try{n({changes:t||[],cancel:_})}catch(t){r(t,`InlineJS.Component<${e}>.SubscribeToChanges.OnChange`)}s.PopOrigin(),m&&p()},b={};return null===(l=u||h)||void 0===l||l.entries.forEach((e=>(b[e.path]=b[e.path]||{})[e.compnentId]=!0)),Object.entries(b).forEach((([e,t])=>{Object.keys(t).map((e=>Me(e))).filter((e=>!!e)).forEach((t=>{(d[t.GetId()]=d[t.GetId()]||[]).push(t.GetBackend().changes.Subscribe(e,f))}))})),s&&(null===(c=null===(a=Me(e))||void 0===a?void 0:a.FindElementScope(s))||void 0===c||c.AddUninitCallback((()=>{_(),p()}))),i&&i(d),p}function Dt({componentId:e,callback:t,contextElement:n,options:i,subscriptionsCallback:s}){var o;let l=()=>{let i=Me(e);if(!i)return;let{changes:o}=i.GetBackend(),l=!1,a=n?i.FindElementScope(n):null,c=()=>{l=!0},u=null==a?void 0:a.GetElement();try{o.PushGetAccessStorage(),t({changes:[],cancel:c})}catch(t){r(t,`InlineJS.Component<${e}>.UseEffect`,u)}if(l)return o.PopAllGetAccessStorageSnapshots(!1),o.RestoreOptimizedGetAccessStorage(),void o.PopGetAccessStorage();Tt({componentId:e,changes:o,callback:t,subscriptionsCallback:s,contextElement:u})};(null==i?void 0:i.nextTick)?null===(o=Me(e))||void 0===o||o.GetBackend().changes.AddNextTickHandler(l):l()}function Mt(e,t,n,i={}){var s;let r=null;if(r=e instanceof HTMLElement?(null===(s="string"==typeof n?Me(n):n)||void 0===s?void 0:s.FindElementScope(e))||null:e,!r)return i;let o=r.GetLocal(t);return Le().IsNothing(o)&&r.SetLocal(t,o=i),o}const $t="__InlineJS_GLOBAL_COMPONENT_KEY__";function Ht(e){let t=globalThis[$t];if(t||!1===e)return t.component;let n=document.createElement("template");return globalThis[$t]={root:n,component:Le().CreateComponent(n)},globalThis[$t]}const Bt=300,Jt=0,zt=0;function Wt(e,t){if(!e||Le().IsNothing(e)||e.allowed&&"both"!==e.allowed&&e.allowed!==(t?"reversed":"normal"))return null;let n=Le().GetConcept("animation");return{ease:e.ease||(null==n?void 0:n.GetEaseCollection().Find("default"))||null,actor:e.actor||(null==n?void 0:n.GetActorCollection().Find("default"))||null,duration:e.duration||Bt,delay:e.delay||Jt,repeats:e.repeats||zt,allowed:e.allowed||"both"}}function qt({componentId:e,contextElement:t,target:n,callback:i,onAbort:s,onPass:r,reverse:l,allowRepeats:a,restore:c}){var u,h,d,p;let m=n||t;if("WaitTransition"in m&&"function"==typeof m.WaitTransition)return m.WaitTransition({componentId:e,contextElement:t,target:n,callback:i,onAbort:s,reverse:l,allowRepeats:a});let _=Wt((null===(h=null===(u=Me(e))||void 0===u?void 0:u.FindElementScope(t))||void 0===h?void 0:h.GetData("transition"))||null,l||!1);if(!_||!_.actor||!_.ease||"number"!=typeof _.duration||_.duration<=0)return i(!1),null;let f=e=>{var t;return"function"==typeof(null==_?void 0:_.actor)?null==_?void 0:_.actor(e):_&&(null===(t=_.actor)||void 0===t?void 0:t.Handle(e))},b=e=>{var t;return"function"==typeof _.ease?_.ease(e):_&&(null===(t=_.ease)||void 0===t?void 0:t.Handle(e))||0},v=!1,y=()=>v=!0,g=0,C=e=>l?1-e:e,A=()=>{var n,i;return null===(i=null===(n=Me(e))||void 0===n?void 0:n.FindElementScope(t))||void 0===i||i.RemoveUninitCallback(y),m.dispatchEvent(new CustomEvent("transition.canceled")),s&&o((()=>s())),!1},E=(e,t,n)=>{r&&o((()=>r({duration:_.duration,elapsed:t,fraction:n,target:m,stage:e})))};null===(p=null===(d=Me(e))||void 0===d?void 0:d.FindElementScope(t))||void 0===p||p.AddUninitCallback(y);const S=_.duration,x=e=>{const t=C(e/S),n=b({duration:S,elapsed:e,fraction:t}),i=0==g++?"start":"middle";f({duration:S,elapsed:e,fraction:n,elapsedFraction:t,stage:i,restore:c,target:m,reverse:!!l}),E(i,e,n)};return x(0),ut(S,0,a?_.repeats:0,_.delay).While((({elapsed:e})=>{if(v)return A();0==g&&(m.style.transform="",m.style.transformOrigin="50% 50%",m.dispatchEvent(new CustomEvent("transition.enter"))),x(e)})).Final((()=>{if(v)A();else{const e=C(1);f({duration:S,elapsedFraction:e,elapsed:S,target:m,stage:"end",fraction:b({duration:_.duration,elapsed:_.duration,fraction:e}),reverse:!!l}),E("end",_.duration,e),m.dispatchEvent(new CustomEvent("transition.leave")),o((()=>i(!0)))}})),y}function Ut({element:e,html:t,type:n="replace",component:i,processDirectives:s=!0,afterRemove:r,afterInsert:l,afterTransitionCallback:a,transitionScope:c}){let u="string"==typeof i?i:(null==i?void 0:i.GetId())||"",h=()=>{let i=document.createElement("template");i.innerHTML=t,"replace"===n||"append"===n?e.append(...Array.from(i.content.childNodes)):"prepend"===n&&e.prepend(...Array.from(i.content.childNodes)),l&&o(l,"InlineJS.InsertHtml",e);let r=Me(u);s&&r&&Array.from(e.children).forEach((e=>R({component:r,element:e,options:{checkTemplate:!0,checkDocument:!0,ignoreChildren:!1}}))),a&&((c||e).dispatchEvent(new CustomEvent("html.transition.begin",{detail:{insert:!0}})),qt({componentId:u,contextElement:c||e,target:e,callback:()=>{(c||e).dispatchEvent(new CustomEvent("html.transition.end",{detail:{insert:!0}})),a()}}))};if("replace"===n&&0!=e.childNodes.length){let t=e=>{let n=Me(u),i=Le();Array.from(e.children).forEach((e=>{var s;let r=null==n?void 0:n.FindElementScope(e);r||(r=null===(s=i.InferComponentFrom(e))||void 0===s?void 0:s.FindElementScope(e))?r.Destroy():t(e)}))},n=()=>{t(e),Array.from(e.childNodes).forEach((e=>e.remove())),r&&o(r,"InlineJS.InsertHtml",e)};a?((c||e).dispatchEvent(new CustomEvent("html.transition.begin",{detail:{insert:!1}})),qt({componentId:u,contextElement:c||e,target:e,reverse:!0,callback:()=>{(c||e).dispatchEvent(new CustomEvent("html.transition.end",{detail:{insert:!1}})),n(),h()}})):(n(),h())}else h()}class Kt{constructor(e,t,n=!1){this.componentId_=e,this.callback_=t,this.initialized_=n,this.queued_=!1,this.setCallback_=null}Queue(e){var t;let n=()=>(this.setCallback_||e||this.callback_)&&(this.setCallback_||e||this.callback_)();!this.queued_&&this.initialized_?(this.queued_=!0,this.ListenNext_(null===(t=Me(this.componentId_))||void 0===t?void 0:t.GetBackend().changes,(()=>{this.queued_=!1,n()}))):this.initialized_?this.setCallback_=e||null:(this.initialized_=!0,n())}ListenNext_(e,t){}}class Vt extends Kt{constructor(e,t,n=!1){super(e,t,n)}ListenNext_(e,t){null==e||e.AddNextIdleHandler(t)}}class Yt extends Kt{constructor(e,t,n=!1){super(e,t,n)}ListenNext_(e,t){null==e||e.AddNextNonIdleHandler(t)}}class Zt extends Kt{constructor(e,t,n=!1){super(e,t,n)}ListenNext_(e,t){null==e||e.AddNextTickHandler(t)}}var Qt=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(n[i[s]]=e[i[s]])}return n};const Xt=/\{\{\s*(.+?)\s*\}\}/g,en=/\{\{.+?\}\}/;function tn(e){let t=e=>[...e.childNodes].reduce(((e,t)=>`${e}${3!=t.nodeType?n(t):t.textContent||""}`),""),n=e=>`${[...e.attributes].reduce(((e,t)=>`${e} ${t.name}="${t.value}"`),`<${e.tagName.toLowerCase()}`)+">"}${t(e)}</${e.tagName.toLowerCase()}>`;return t(e)}function nn({componentId:e,contextElement:t,text:n,handler:i,testRegex:s,matchRegex:r,storeObject:o}){var l;let a=null,c=null;if(o){const o=n.trim();let l=(o.match(s||en)||[])[0];l&&l===o&&(l=l.replace(r||Xt,"$1").trim(),a=l?Ft({componentId:e,contextElement:t,expression:`return (${l});`,voidOnly:!0}):e=>e&&e(""),c=n=>i(Ve(n,e,t)))}a||(n=JSON.stringify(n).replace(r||Xt,'"+($1)+"').replace(/"\+\(\s*\)\+"/g,""),a=Ft({componentId:e,contextElement:t,expression:`let output = ${n}; return output;`})),null===(l=Me(e))||void 0===l||l.CreateElementScope(t),Dt({componentId:e,contextElement:t,callback:()=>a(c||i)})}function sn(e){var{text:t,testRegex:n,matchRegex:i}=e,s=Qt(e,["text","testRegex","matchRegex"]);(n||i||en).test(t)&&nn(Object.assign({text:t,testRegex:n,matchRegex:i},s))}function rn({componentId:e,contextElement:t,text:n,handler:i,testRegex:s,matchRegex:r}){if("string"==typeof n)return i&&sn({componentId:e,contextElement:t,text:n,handler:i,testRegex:s,matchRegex:r});if(!(s||r||en).test(t.textContent||""))return;let l=new Array,a=new Array,c=!1;[...t.childNodes].forEach((n=>{if(3==n.nodeType&&n.textContent&&en.test(n.textContent)){let i={text:n.textContent||"",evaluated:n.textContent||""};l.push(i),a.push((()=>nn({componentId:e,contextElement:t,text:i.text,handler:e=>{i.evaluated=e,c||(c=!0,queueMicrotask((()=>{c=!1,o((()=>(()=>{for(;t.firstChild;)t.firstChild.remove();let e=null;l.forEach((n=>{let i=n instanceof Element?n:document.createTextNode("string"==typeof n?n:n.evaluated);e?t.insertBefore(i,e):t.append(i),e=i}))})()),"InlineJS.Interpolate",t)})))},testRegex:s,matchRegex:r})))}else 3==n.nodeType?l.push(n.textContent||""):l.push(n)})),l.reverse(),a.forEach((e=>o(e,"InlineJS.Interpolate",t)))}function on({componentId:e,contextElement:t,name:n,value:i}){sn({componentId:e,contextElement:t,text:i,handler:e=>t.setAttribute(n,e),storeObject:!0})}function ln({componentId:e,contextElement:t}){rn({componentId:e,contextElement:t})}function an(e){const t=e&&Be(e);if(t)return void R({component:t,element:e});const n=Le(),i=n.GetConfig();[i.GetDirectiveName("data",!0),i.GetDirectiveName("data",!1)].forEach((t=>{(e||document).querySelectorAll(`[${t}]`).forEach((e=>{e.hasAttribute(t)&&document.contains(e)&&R({component:n.CreateComponent(e),element:e,options:{checkTemplate:!0,checkDocument:!1,ignoreChildren:!1}})}))}))}function cn(e){Ne(),globalThis.InlineJS=globalThis.InlineJS||{},globalThis.InlineJS.hasOwnProperty("disableAutoBootstrap")&&globalThis.InlineJS.disableAutoBootstrap||setTimeout((()=>{"loading"==document.readyState?document.addEventListener("DOMContentLoaded",(()=>{an(e)})):an(e)}),0)}function un(e,t){let n="",i=null;if("function"==typeof e){let t=e();t?({name:n,callback:i}=t):(n=e("name"),i=e("callback"))}else M(e)?({name:n,callback:i}=e):Le().GetDirectiveManager().AddHandler(e);n&&i&&(t?Le().GetDirectiveManager().AddHandlerExtension(t,i,n):Le().GetDirectiveManager().AddHandler(i,n))}function hn(e,t){return{name:e,callback:t}}function dn(e,t,n,i,s){let r=Le().GetConfig().GetDirectiveName("on"),o=(s||[]).join("."),l=S(o?`${r}:${n}.${o}`:`${r}:${n}`,i||"");return!!l&&I(e,t,l)}const pn=["bind","event","on"];function mn({component:e,contextElement:t,key:n,event:i,expression:s,options:r,defaultEvent:o,eventWhitelist:l=[],optionBlacklist:a}){let c=()=>a?null==r?void 0:r.filter((e=>!a.includes(e))):r,u=e=>n?`${n}-${e}.join`:e;return l.includes(i)?dn(e,t,u(i),s,c()):!(!o||i!==o&&!pn.includes(i))&&dn(e,t,u(o),s,c())}function _n(e,t,n){let i=Le().GetConfig().GetDirectiveName(t,!1),s=Le().GetConfig().GetDirectiveName(t,!0);return e.getAttribute(i)||e.getAttribute(s)||n&&e.getAttribute(n)||null}function fn({componentId:e,contextElement:t,key:n,expression:i,callback:s,arrayCallback:r,useEffect:o=!0}){let l=0,a=Ft({componentId:e,contextElement:t,expression:i}),c=(e,t)=>{Lt(e,(e=>{t==l&&(n?s([n,e]):M(e)?Object.entries(e).forEach(s):r&&("string"==typeof e||Array.isArray(e))&&r("string"==typeof e?e.trim().split(" ").filter((e=>!!e)):e))}))};o?Dt({componentId:e,contextElement:t,callback:()=>a((e=>c(e,++l)))}):a((e=>c(e,l)))}const bn=Array.from(Array(100).keys()).map((e=>e/100));function vn(e){let t={root:null,rootMargin:"0px",threshold:0};return M(e)&&Object.entries(t).forEach((([n,i])=>t[n]=n in e&&e[n]||i)),e.spread&&(t.threshold=bn),t}class yn{constructor(e,t){this.id_=e,this.observer_=null,this.handlers_=new Array;let n=this.id_;this.observer_=new globalThis.IntersectionObserver(((e,t)=>{e.forEach((e=>{this.handlers_.filter((({target:t})=>t===e.target)).forEach((i=>{o((()=>i.handler({entry:e,id:n,observer:t})),"InlineJS.IntersectionObserver")}))}))}),vn(t))}GetId(){return this.id_}GetNative(){return this.observer_}Observe(e,t){var n;this.handlers_.push({target:e,handler:t}),null===(n=this.observer_)||void 0===n||n.observe(e)}Unobserve(e){var t;this.handlers_=this.handlers_.filter((t=>t.target===e)),null===(t=this.observer_)||void 0===t||t.unobserve(e)}}function gn(e,t=0){return e&&e.match(/^[0-9]+(s|ms)?$/)?-1==e.indexOf("m")&&-1!=e.indexOf("s")?1e3*parseInt(e):parseInt(e):t}function Cn({options:e,list:t,defaultNumber:n,callback:i,unknownCallback:s}){let r=Array.isArray(e)?e:[e],o=e=>("number"==typeof n?n:n&&n(e))||0;return t.forEach(((n,l)=>{let a=r.find((e=>e&&n in e));if(!a)return s&&s({options:e,list:t,option:n,index:l});i&&!0===i({options:e,list:t,option:n,index:l})||("number"==typeof a[n]?l<t.length-1?a[n]=gn(t[l+1].trim(),o(n)):a[n]=o(n):"boolean"==typeof a[n]&&(a[n]=!0))})),e}function An({componentId:e,component:t,contextElement:n,expression:i,argOptions:s,callback:r,options:o,defaultOptionValue:l,useEffect:a}){let c=Ft({componentId:e,contextElement:n,expression:i}),u=Cn({options:o||{lazy:!1,ancestor:-1,threshold:-1},list:s,defaultNumber:0===l?0:l||-1}),h=()=>c((e=>Pt(e,r))),d=()=>!1===a?h():Dt({componentId:e,contextElement:n,callback:h});if(u.lazy){let i=t||Me(e),s={root:u.ancestor<0?null:null==i?void 0:i.FindAncestor(n,u.ancestor),threshold:u.threshold<0?0:u.threshold},r=i?new yn(i.GenerateUniqueId("intob_"),s):null;r?(null==i||i.AddIntersectionObserver(r),r.Observe(n,(({id:t,entry:n}={})=>{var i;(null==n?void 0:n.isIntersecting)&&(null===(i=Me(e))||void 0===i||i.RemoveIntersectionObserver(t),d())}))):d()}else d()}function En(e){let t,n="",i=null;if("function"==typeof e){let s=e();s?({name:n,callback:i,onAccess:t}=s):(n=e("name"),i=e("callback"),t=e("access"))}else M(e)?({name:n,callback:i,onAccess:t}=e):Le().GetMagicManager().AddHandler(e);n&&i&&Le().GetMagicManager().AddHandler(i,n,t)}function Sn(e,t,n){return{name:e,callback:t,onAccess:n}}function xn(e){return e.startsWith(":")?Le().GetConfig().GetDirectiveName("bind")+e:null}function Pn(e){return e.startsWith(".")?e.replace(".",Le().GetConfig().GetDirectiveName("class:")):null}function In(e){return e.startsWith("@")?e.replace("@",Le().GetConfig().GetDirectiveName("on:")):null}function kn(e,t,n){console.log({message:e,context:t||"N/A",contextElement:n||"N/A"})}function Gn(e=!0){e&&cn(),Le().AddAttributeProcessor(on),Le().AddTextContentProcessor(ln)}function On(){st("",{waitForGlobal:je,bootstrap:an})}function Rn(){st("utilities",{beginsWith:c,endsWith:Ze,toCamelCase:m,toSnakeCase:bt,insertHtml:Ut,findAncestor:Qe,getAttribute:K,findFirstAttribute:V,findFirstAttributeValue:Y,setAttribute:ft,isBooleanAttribute:rt,supportsAttributes:q,getTarget:j,getTargets:T,isEqual:ot,isObject:M,toString:Ue,deepCopy:te,tidyPath:dt,pathToRelative:pt,splitPath:mt,joinPath:_t,getRandomString:Ie,measureCallback:ht,encodeAttribute:Ye,decodeAttribute:Ke,encodeValue:Ve,decodeValue:qe})}function wn(){st("values",{future:s,loop:l,nothing:a,stack:i})}function Nn(){st("version",{major:1,minor:1,patch:2,get value(){return`${this.major}.${this.minor}.${this.patch}`},toString(){return this.value}})}function Fn(){Gn(),On(),Rn(),wn(),Nn()}},409:function(e,t,n){var i=this&&this.__decorate||function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};Object.defineProperty(t,"__esModule",{value:!0}),t.StripeDetailElementCompact=t.StripeDetailElement=void 0;const s=n(16);class r extends s.CustomElement{constructor(){super(),this.input=null,this.name="",this.value=""}WaitReady(){return Promise.resolve()}AddChangeListener(e){}RemoveChangeListener(e){}ToggleFocus(e){const t=this.GetInput_();t&&(e?t.focus():t.blur())}Reset(){const e=this.GetInput_();e&&(e.value="")}AddDetails(e){const t=this.GetInput_();this.name&&((null==t?void 0:t.value)||this.value)&&(e.billingDetails=e.billingDetails||{},"address"===this.name?(e.billingDetails.address=e.billingDetails.address||{},e.billingDetails.address.line1=(null==t?void 0:t.value)||this.value):e.billingDetails[this.name]=(null==t?void 0:t.value)||this.value)}GetInput_(){return this.input||this.querySelector("input")}}i([(0,s.Property)({type:"object",checkStoredObject:!0})],r.prototype,"input",void 0),i([(0,s.Property)({type:"string"})],r.prototype,"name",void 0),i([(0,s.Property)({type:"string"})],r.prototype,"value",void 0),t.StripeDetailElement=r,t.StripeDetailElementCompact=function(){(0,s.RegisterCustomElement)(r,"stripe-detail")}},538:function(e,t,n){var i=this&&this.__decorate||function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o},s=this&&this.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(n[i[s]]=e[i[s]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.StripeFieldElementCompact=t.StripeFieldElement=void 0;const r=n(617),o=n(16);class l extends o.CustomElement{constructor(){super(),this.stripeField_=null,this.isReady_=!1,this.isComplete_=!1,this.lastError_=null,this.readyWaiters_=new Array,this.changeListeners=new Array,this.stripe=null,this.options=null,this.type="",this.onready="",this.oncomplete="",this.onerrors=""}WaitReady(){return new Promise((e=>{this.isReady_?e():this.readyWaiters_.push((()=>e()))}))}AddChangeListener(e){this.changeListeners.push(e)}RemoveChangeListener(e){const t=this.changeListeners.indexOf(e);t>=0&&this.changeListeners.splice(t,1)}ToggleFocus(e){var t,n;this.stripeField_&&(e?null===(t=this.stripeField_)||void 0===t||t.focus():null===(n=this.stripeField_)||void 0===n||n.blur())}Reset(){var e;this.stripeField_&&(null===(e=this.stripeField_)||void 0===e||e.clear())}AddDetails(e){this.stripeField_&&("card"===this.type||"number"===this.type||"cardNumber"===this.type)&&(e.method=this.stripeField_)}HandleElementScopeCreated_(e,t){var{scope:n}=e,i=s(e,["scope"]);super.HandleElementScopeCreated_(Object.assign({scope:n},i),(()=>{var e;null===(e=this.GetStripe_())||void 0===e||e.AddStripeField(this),t&&t()})),n.AddPostProcessCallback((()=>{var e;null===(e=this.GetStripe_())||void 0===e||e.WaitInstance().then((e=>{var t;if(!e)return;let n="";["number","expiry","cvc"].includes(this.type)?n=`card${this.type.substring(0,1).toUpperCase()}${this.type.substring(1)}`:["card","cardNumber","cardExpiry","cardCvc","postalCode","paymentRequestButton","iban","idealBank"].includes(this.type)&&(n=this.type),n&&(this.stripeField_=e.elements().create(n,this.options||(null===(t=this.GetStripe_())||void 0===t?void 0:t.options)||void 0),this.stripeField_.on("ready",(()=>{this.isReady_=!0,this.onready&&(0,r.EvaluateLater)({componentId:this.componentId_,contextElement:this,expression:this.onready,disableFunctionCall:!1})(),this.readyWaiters_.splice(0).forEach((e=>(0,r.JournalTry)(e)))})),this.stripeField_.on("change",(e=>{((null==e?void 0:e.error)||null)!==this.lastError_&&(this.lastError_=(null==e?void 0:e.error)||null,(0,r.EvaluateLater)({componentId:this.componentId_,contextElement:this,expression:this.onerrors,disableFunctionCall:!1})(void 0,[this.lastError_],{error:this.lastError_}),this.changeListeners.forEach((e=>(0,r.JournalTry)((()=>e("error",this.lastError_)))))),((null==e?void 0:e.complete)||!1)!=this.isComplete_&&(this.isComplete_=(null==e?void 0:e.complete)||!1,(0,r.EvaluateLater)({componentId:this.componentId_,contextElement:this,expression:this.oncomplete,disableFunctionCall:!1})(void 0,[this.isComplete_],{complete:this.isComplete_}),this.changeListeners.forEach((e=>(0,r.JournalTry)((()=>e("complete",this.isComplete_))))))})),this.stripeField_.mount(this))}))})),n.AddUninitCallback((()=>{var e;null===(e=this.GetStripe_())||void 0===e||e.RemoveStripeField(this),this.stripeField_=null}))}GetStripe_(){return this.stripe||(0,r.FindAncestor)(this,(e=>"AddStripeField"in e))}}i([(0,o.Property)({type:"object",checkStoredObject:!0})],l.prototype,"stripe",void 0),i([(0,o.Property)({type:"object",checkStoredObject:!0})],l.prototype,"options",void 0),i([(0,o.Property)({type:"string"})],l.prototype,"type",void 0),i([(0,o.Property)({type:"string"})],l.prototype,"onready",void 0),i([(0,o.Property)({type:"string"})],l.prototype,"oncomplete",void 0),i([(0,o.Property)({type:"string"})],l.prototype,"onerrors",void 0),t.StripeFieldElement=l,t.StripeFieldElementCompact=function(){(0,o.RegisterCustomElement)(l,"stripe-field")}},380:function(e,t,n){var i=this&&this.__decorate||function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};Object.defineProperty(t,"__esModule",{value:!0}),t.StripePaymentMenthodElementCompact=t.StripePaymentMenthodElement=void 0;const s=n(16);class r extends s.CustomElement{constructor(){super({isTemplate:!0,isHidden:!0}),this.value=""}WaitReady(){return Promise.resolve()}AddChangeListener(e){}RemoveChangeListener(e){}ToggleFocus(e){}Reset(){}AddDetails(e){this.value&&(e.method=this.value)}}i([(0,s.Property)({type:"object",checkStoredObject:!0})],r.prototype,"value",void 0),t.StripePaymentMenthodElement=r,t.StripePaymentMenthodElementCompact=function(){(0,s.RegisterCustomElement)(r,"stripe-payment-method")}},645:function(e,t,n){var i=this&&this.__decorate||function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o},s=this&&this.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(n[i[s]]=e[i[s]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.StripeElementCompact=t.StripeElement=void 0;const r=n(617),o=n(16);class l extends o.CustomElement{constructor(){super(),this.stripe_=null,this.mounting_=!1,this.mounted_=!1,this.isReady_=!1,this.readyWaiters_=new Array,this.fields_=null,this.readyFields_=null,this.instanceWaiters_=new Array,this.completeFields_=null,this.errorFields_=null,this.options=null,this.publicKey="",this.onready="",this.oncomplete="",this.onerrors="",this.defer=!1,this.focusnext=!1}AddStripeField(e){this.fields_=this.fields_||[],this.fields_.push(e),e.WaitReady().then((()=>{this.readyFields_=this.readyFields_||[],this.readyFields_.push(e),this.fields_&&this.readyFields_&&this.fields_.length<=this.readyFields_.length&&(0,r.JournalTry)((()=>{this.isReady_=!0,this.onready&&(0,r.EvaluateLater)({componentId:this.componentId_,contextElement:this,expression:this.onready,disableFunctionCall:!1})(),this.readyWaiters_.splice(0).forEach((e=>(0,r.JournalTry)(e)))}))})),e.AddChangeListener(((t,n)=>{if("complete"===t){let t=!1;this.completeFields_=this.completeFields_||[],n&&!this.completeFields_.includes(e)?(this.completeFields_.push(e),t=!(!this.readyFields_||this.completeFields_.length!=this.readyFields_.length)):!n&&this.completeFields_.includes(e)&&(this.completeFields_=this.completeFields_.filter((t=>t!==e)),t=0==this.completeFields_.length),t&&this.oncomplete&&(0,r.EvaluateLater)({componentId:this.componentId_,contextElement:this,expression:this.oncomplete,disableFunctionCall:!1})(void 0,[!!n],{complete:!!n}),n&&this.focusnext&&this.FocusNextField(e)}else if("error"===t){let t=!1;this.errorFields_=this.errorFields_||[],this.errorFields_.push(e),this.errorFields_=this.errorFields_||[],n&&!this.errorFields_.includes(e)?(this.errorFields_.push(e),t=1==this.errorFields_.length):!n&&this.errorFields_.includes(e)&&(this.errorFields_=this.errorFields_.filter((t=>t!==e)),t=0==this.errorFields_.length),t&&this.onerrors&&(0,r.EvaluateLater)({componentId:this.componentId_,contextElement:this,expression:this.onerrors,disableFunctionCall:!1})(void 0,[n],{error:n})}}))}RemoveStripeField(e){this.fields_&&(this.fields_=this.fields_.filter((t=>t!==e))),this.readyFields_&&(this.readyFields_=this.readyFields_.filter((t=>t!==e)))}FocusNextField(e){if(this.fields_){const t=this.fields_.indexOf(e);t>=0&&t<this.fields_.length-1&&this.fields_[t+1].ToggleFocus(!0)}}GetInstance(){return this.stripe_}WaitInstance(){return new Promise((e=>{this.mounted_?e(this.stripe_):this.instanceWaiters_.push((()=>e(this.stripe_)))}))}Mount(){this.mounted_||this.mounting_||(this.mounting_=!0,this.LoadResources().then((()=>{this.mounting_=!1,this.mounted_=!0,this.stripe_=Stripe(this.publicKey),this.instanceWaiters_.splice(0).forEach((e=>(0,r.JournalTry)(e)))})))}Pay(e,t=!1){return this.PayOrSetup_(!0,e,t)}Setup(e){return this.PayOrSetup_(!1,e)}WaitReady(){return new Promise((e=>{this.isReady_?e():this.readyWaiters_.push((()=>e()))}))}HandleElementScopeCreated_(e,t){var{scope:n}=e,i=s(e,["scope"]);super.HandleElementScopeCreated_(Object.assign({scope:n},i),t),n.AddPostProcessCallback((()=>!this.defer&&this.Mount())),n.AddUninitCallback((()=>this.stripe_=null))}PayOrSetup_(e,t,n=!1){return new Promise(((i,s)=>{this.WaitInstance().then((r=>{var o,l;if(!r)return i(!1);const a={};if(null===(o=this.fields_)||void 0===o||o.forEach((e=>e.AddDetails(a))),!a.method)return i(!1);let c;c="string"!=typeof a.method?{payment_method:{card:a.method,billing_details:a.billingDetails}}:{payment_method:a.method},e?((null===(l=a.billingDetails)||void 0===l?void 0:l.email)&&(c.receipt_email=a.billingDetails.email),n&&(c.setup_future_usage="off_session"),r.confirmCardPayment(t,c).then(i).catch(s)):r.confirmCardSetup(t,c).then(i).catch(s)})).catch(s)}))}}i([(0,o.Property)({type:"object",checkStoredObject:!0})],l.prototype,"options",void 0),i([(0,o.Property)({type:"string"})],l.prototype,"publicKey",void 0),i([(0,o.Property)({type:"string"})],l.prototype,"onready",void 0),i([(0,o.Property)({type:"string"})],l.prototype,"oncomplete",void 0),i([(0,o.Property)({type:"string"})],l.prototype,"onerrors",void 0),i([(0,o.Property)({type:"boolean"})],l.prototype,"defer",void 0),i([(0,o.Property)({type:"boolean"})],l.prototype,"focusnext",void 0),t.StripeElement=l,t.StripeElementCompact=function(){(0,o.RegisterCustomElement)(l,"stripe")}},419:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InlineJSStripe=void 0;const i=n(617),s=n(645),r=n(538),o=n(409),l=n(380);t.InlineJSStripe=function(){(0,i.WaitForGlobal)().then((()=>{(0,s.StripeElementCompact)(),(0,r.StripeFieldElementCompact)(),(0,o.StripeDetailElementCompact)(),(0,l.StripePaymentMenthodElementCompact)()}))}}},t={};function n(i){var s=t[i];if(void 0!==s)return s.exports;var r=t[i]={exports:{}};return e[i].call(r.exports,r,r.exports,n),r.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(0,n(419).InlineJSStripe)()})();
1
+ (()=>{"use strict";var e={16:(e,t,n)=>{n.r(t),n.d(t,{CustomElement:()=>u,GetGlobalPropertyScope:()=>o,GetProperties:()=>l,GetPropertyScope:()=>a,InlineJSElement:()=>g,NativeElement:()=>h,NativeElementCompact:()=>d,Property:()=>c,Register:()=>y,RegisterCustomElement:()=>r,ResourceElement:()=>m,ResourceElementCompact:()=>_,ResourceTargetElement:()=>b,ResourceTargetElementCompact:()=>v});var i=n(617);function r(e,t){let n=(0,i.ToSnakeCase)(t||e.name);n=n&&(0,i.GetGlobal)().GetConfig().GetElementName(n),n&&!customElements.get(n)&&customElements.define(n,e)}const s=(0,i.RandomString)();function o(){return s}function l(){return(0,i.GetGlobalScope)(`customProperties.${s}`)}function a(e,t){return t||("constructor"in e?t=e.constructor.name:("function"==typeof e||"object"==typeof e&&"name"in e)&&(t=e.name)),t||""}function c(e){return function(t,n,r){let s="",o=null;(void 0!==(null==e?void 0:e.initial)||!r&&(null==e?void 0:e.update))&&(e.initial=e.initial||t[n],o="boolean"===e.type?(e,t)=>{e&&"false"!==e?t.setAttribute(s,s):t.hasAttribute(s)&&t.removeAttribute(s)}:(e,t)=>{t.setAttribute(s,e)});let c=null,u={name:"",type:(null==e?void 0:e.type)||"string",spread:(null==e?void 0:e.spread)||"",update:(null==e?void 0:e.update)||!1,initial:(null==e?void 0:e.initial)||void 0,checkStoredObject:(null==e?void 0:e.checkStoredObject)||!1,delimiter:(null==e?void 0:e.delimiter)||",",handler:null,setInitial:o};if(r){if("function"==typeof r.value&&!r.get&&!r.set&&((null==e?void 0:e.name)||/^Update.+Property/.test(r.value.name))){const t=r.value;s=(0,i.ToSnakeCase)((null==e?void 0:e.name)||r.value.name.replace(/^Update(.+)Property/,"$1")),c=(e,n)=>t.call(n,e)}}else s=(0,i.ToSnakeCase)((null==e?void 0:e.name)||n),c=(e,t)=>t[n]=e;if(s&&c){u.name=s,u.handler=c;const e=a(t);let n=l();n[e]=n[e]||new Array,n[e].push(u)}}}class u extends HTMLElement{constructor(e={}){if(super(),this.options_=e,this.componentId_="",this.resources_=new Array,this.loadedResources_=null,this.loadingResources_=!1,this.queuedResourceHandlers_=new Array,this.nativeElement_=null,this.nativeElements_=new Array,this.nativeAttributesBlacklist_=new Array,this.nativeAttributesWhitelist_=new Array,this.propertyScopes_=new Array,this.instanceProperties_=new Array,this.instancePropertyNames_=new Array,this.attributeChangeHandlers_={},this.spreads_={},this.storedObjects_={},this.booleanAttributes_=new Array,this.nonBooleanAttributes_=new Array,(this.options_.isTemplate||this.options_.isHidden)&&(this.style.display="none"),!(this.options_.disableImplicitData||"InlineJS"in globalThis&&(0,i.IsObject)(globalThis.InlineJS)&&globalThis.InlineJS.disableImplicitData)){const e=(0,i.GetGlobal)().GetConfig().GetDirectiveName("data",!1),t=(0,i.GetGlobal)().GetConfig().GetDirectiveName("data",!0);let n=null;for(let i=this;i;i=i.parentNode)if(i instanceof Element&&(i.hasAttribute(e)||i.hasAttribute(t))){n=i;break}!n&&this.setAttribute(e,"")}}UpdateComponentProperty(e){var t,n;null===(n=null===(t=(0,i.FindComponentById)(this.componentId_))||void 0===t?void 0:t.FindScopeByRoot(this))||void 0===n||n.SetName(e.trim())}AddResource(e){this.resources_.push(e)}RemoveResource(e){this.resources_=this.resources_.filter((t=>t!==e))}LoadResources(){return this.loadingResources_?new Promise(((e,t)=>{this.queuedResourceHandlers_.push((()=>{this.loadedResources_?e(this.loadedResources_):t()}))})):this.loadedResources_?Promise.resolve(this.loadedResources_):(this.loadingResources_=!0,new Promise(((e,t)=>{const n=new Array,r=new Array,s=t=>{this.loadingResources_=!1,this.loadedResources_=t,this.queuedResourceHandlers_.forEach((e=>e())),this.queuedResourceHandlers_=[],e(t)};if(this.resources_.forEach((e=>{"string"==typeof e?r.push(e):"LoadTargetResources"in e?n.push(e.LoadTargetResources()):"GetResource"in e?r.push(e.GetResource()):r.push(e)})),r.length>0){const e=(0,i.GetGlobal)().GetConcept("resource");if(e){const t=e.Get({items:r,attributes:this.GetResourceLoadAttributes_(),concurrent:this.IsConcurrentResourceLoad_()});n.push(t)}}0==n.length?s([]):Promise.all(n).then(s).catch(t)})))}AddNativeElement(e){this.nativeElements_.push(e),this.CopyNativeElements_(e)}RemoveNativeElement(e){this.nativeElements_=this.nativeElements_.filter((t=>t!==e))}AddBooleanAttribute(e){Array.isArray(e)?this.booleanAttributes_.push(...e):this.booleanAttributes_.push(e)}RemoveBooleanAttribute(e){this.booleanAttributes_=Array.isArray(e)?this.booleanAttributes_.filter((t=>!e.includes(t))):this.booleanAttributes_.filter((t=>t!==e))}AddNonBooleanAttribute(e){Array.isArray(e)?this.nonBooleanAttributes_.push(...e):this.nonBooleanAttributes_.push(e)}RemoveNonBooleanAttribute(e){this.nonBooleanAttributes_=Array.isArray(e)?this.nonBooleanAttributes_.filter((t=>!e.includes(t))):this.nonBooleanAttributes_.filter((t=>t!==e))}IsBooleanAttribute(e){return!this.nonBooleanAttributes_.includes(e)&&(!!this.booleanAttributes_.includes(e)||null)}IsTemplate(){return this.options_.isTemplate}OnElementScopeCreated(e){this.HandleElementScopeCreated_(e)}AddPropertyScope_(e){this.propertyScopes_.push(a(u,e))}FindProperty_(e){return this.instanceProperties_.find((t=>t.name===e))}GetAllProperties_(){let e=new Array,t=l();for(let n of this.propertyScopes_)t.hasOwnProperty(n)&&e.push(...Object.values(t[n]));return e}HandleElementScopeCreated_({scope:e,componentId:t},n){this.componentId_=t,this.propertyScopes_=this.ComputePropertyScopes_(),(this.instanceProperties_=this.GetAllProperties_()).forEach((e=>{"boolean"===e.type&&this.booleanAttributes_.push(e.name);const t=e.spread&&(0,i.ToSnakeCase)(e.spread);t&&this.spreads_.hasOwnProperty(t)?this.spreads_[t].push(e.name):t&&(this.spreads_[t]=[e.name])})),this.instancePropertyNames_=this.instanceProperties_.map((e=>e.name)),e.AddPostAttributesProcessCallback((()=>{this.instanceProperties_.forEach((e=>{e.initial&&e.setInitial&&e.setInitial(this.EncodeValue_(e.initial,e.type),this)})),this.InitializeStateFromAttributes_(),n&&n()})),e.AddPostProcessCallback((()=>this.ShouldLoadResources_()&&this.LoadResources())),e.AddAttributeChangeCallback((e=>e&&this.AttributeChanged_(e))),e.AddUninitCallback((()=>this.nativeElement_=null))}InitializeStateFromAttributes_(e){let t=Array.from(this.attributes);e&&(t=t.filter((({name:t})=>e.includes(t)))),t.forEach((({name:e})=>this.AttributeChanged_(e)))}EncodeValue_(e,t){return"boolean"===t?e?"true":"false":"json"===t?JSON.stringify(e):"array"===t?(e||[]).join(","):t.startsWith("array:")?(e||[]).map((e=>this.EncodeValue_(e,t.substring(6)))).join(","):"date"===t?(e||new Date).toString():(0,i.ToString)(e)}DecodeValue_(e,t,n){if("string"===t)return e||"";if("boolean"===t)return null!=e&&"0"!==e&&"false"!==e;if("number"===t)return null===e?NaN:parseFloat(e||"0")||0;if("json"===t){try{return JSON.parse(e||"")}catch(e){}return null}return"array"===t?(e||"").split(n||",").map((e=>e.trim()))||[]:t.startsWith("array:")?(e||"").split(n||",").map((e=>this.DecodeValue_(e,t.substring(6),n)))||[]:"date"===t?new Date(e||""):e}SpreadValue_(e,t){let n=e.split(" ");t.forEach(((e,t)=>{if(t>=n.length){let i=t%4-2;this.DispatchAttributeChange_(e,i<0||i>=n.length?n[0]:n[i])}else this.DispatchAttributeChange_(e,n[t])}))}DispatchAttributeChange_(e,t){let n=!1;this.spreads_.hasOwnProperty(e)&&(this.SpreadValue_(t||"",this.spreads_[e]),n=!0);const r=this.FindProperty_(e),s=this.storedObjects_.hasOwnProperty(e)&&this.storedObjects_[e];if(r){let o=null;if(r.checkStoredObject&&t){if(t===s)return;const n=(0,i.RetrieveStoredObject)({key:t,componentId:this.componentId_,contextElement:this});n!==t&&(this.storedObjects_[e]=t,o=e=>(0,i.JournalTry)((()=>e(n,this))))}o?o(r.handler):(0,i.JournalTry)((()=>r.handler(this.DecodeValue_(t,r.type||"string",r.delimiter),this))),n=!0}return n}AttributeChanged_(e){let t="";this.nativeElement_&&(e.startsWith("data-native-")?t=e.substring(12):e.startsWith("native-")?t=e.substring(7):e.startsWith("-")&&(t=e.substring(1))),t?this.hasAttribute(e)?this.nativeElement_.setAttribute(t,this.getAttribute(e)||""):this.nativeElement_.hasAttribute(t)&&this.nativeElement_.removeAttribute(t):this.DispatchAttributeChange_(e,this.getAttribute(e))||!this.nativeAttributesWhitelist_.includes(e)&&this.nativeAttributesBlacklist_.includes(e)||!this.nativeElement_||e.startsWith("data-")||u.GlobalAttributes.includes(e)||(this.hasAttribute(e)?this.nativeElement_.setAttribute(e,this.getAttribute(e)||""):this.nativeElement_.hasAttribute(e)&&this.nativeElement_.removeAttribute(e))}ComputePropertyScopes_(){let e=new Array;for(let t=Object.getPrototypeOf(this);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t))e.push(t.constructor.name);return e}SetNativeElement_(e){e!==this.nativeElement_&&(this.nativeElement_=e,this.CopyNativeElements_())}CopyNativeElements_(e){this.nativeElement_&&0!=this.nativeElements_.length&&((e?[e]:this.nativeElements_).forEach((e=>{e.GetAttributes().forEach((({name:e,value:t})=>this.nativeElement_.setAttribute(e,t)));for(let t=e.firstChild;t;t=e.firstChild)t.remove(),this.nativeElement_.appendChild(t)})),(0,i.ProcessDirectives)({component:this.componentId_,element:this.nativeElement_}))}GetResourceLoadAttributes_(){}IsConcurrentResourceLoad_(){return!0}ShouldLoadResources_(){return!0}}u.GlobalAttributes=["id","class","style","title","lang","dir","tabindex","accesskey","hidden","draggable","spellcheck","translate","contenteditable"],function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([c({type:"string"})],u.prototype,"UpdateComponentProperty",null);class h extends u{constructor(){super(),this.attributes_=new Array,Array.from(this.attributes).forEach((({name:e,value:t})=>{this.attributes_.push({name:e,value:t}),this.removeAttribute(e)})),this.options_.isTemplate=!0,this.options_.isHidden=!0,this.style.display="none"}GetAttributes(){return this.attributes_}HandleElementScopeCreated_(e,t){var n;null===(n=(0,i.FindAncestor)(this,(e=>"AddNativeElement"in e)))||void 0===n||n.AddNativeElement(this),super.HandleElementScopeCreated_(e,t)}}function d(){r(h)}var p=function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o};class m extends u{constructor(){super({isTemplate:!0,isHidden:!0}),this.src="",this.type=""}GetResource(){return"link"===this.type||"script"===this.type||"data"===this.type?{type:this.type,path:this.src}:this.src}HandleElementScopeCreated_(e,t){super.HandleElementScopeCreated_(e,(()=>{var e;null===(e=(0,i.FindAncestor)(this,(e=>"AddResource"in e)))||void 0===e||e.AddResource(this),t&&t()}))}ShouldLoadResources_(){return!1}}function _(){r(m,"resource")}p([c({type:"string"})],m.prototype,"src",void 0),p([c({type:"string"})],m.prototype,"type",void 0);var f=function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o};class b extends u{constructor(){super({isHidden:!0}),this.attributes_=null,this.sequential=!1,this.defer=!1}UpdateAttributesProperty(e){this.attributes_=e}LoadTargetResources(){return this.LoadResources()}HandleElementScopeCreated_(e,t){super.HandleElementScopeCreated_(e,(()=>{var e;null===(e=(0,i.FindAncestor)(this,(e=>"AddResource"in e)))||void 0===e||e.AddResource(this),t&&t()}))}GetResourceLoadAttributes_(){return this.attributes_||void 0}IsConcurrentResourceLoad_(){return!this.sequential}ShouldLoadResources_(){return!this.defer}}function v(){r(b,"resource-target")}function y(e){return function(t){let n=(0,i.ToSnakeCase)(e||t.name);n=n&&(0,i.GetGlobal)().GetConfig().GetElementName(n),n&&!customElements.get(n)&&customElements.define(n,t)}}function g(){(0,i.WaitForGlobal)().then((()=>{d(),_(),v()}))}f([c({type:"object",checkStoredObject:!0})],b.prototype,"UpdateAttributesProperty",null),f([c({type:"boolean"})],b.prototype,"sequential",void 0),f([c({type:"boolean"})],b.prototype,"defer",void 0)},617:(e,t,n)=>{n.r(t),n.d(t,{AddChanges:()=>N,AddDirectiveExpansionRule:()=>g,AddDirectiveHandler:()=>un,AddMagicHandler:()=>En,AddOutsideEventExcept:()=>ve,AddOutsideEventListener:()=>fe,ApplyDirectiveExpansionRules:()=>A,AreObjects:()=>$,AttributeInterpolator:()=>on,AutoBootstrap:()=>cn,BaseComponent:()=>Ae,BaseGlobal:()=>Ge,BeginsWith:()=>c,BindDirectiveExpansionRule:()=>Pn,BindEvent:()=>mn,BootstrapAndAttach:()=>an,BuildGetterProxyOptions:()=>Et,BuildIntersectionOptions:()=>vn,BuildProxyOptions:()=>At,CallIfFunction:()=>wt,Changes:()=>oe,ChildProxy:()=>xe,ClassDirectiveExpansionRule:()=>xn,Config:()=>ke,Context:()=>le,ContextKeys:()=>_,CreateAnimationLoop:()=>ut,CreateChildProxy:()=>H,CreateDirective:()=>S,CreateDirectiveExpansionRule:()=>y,CreateDirectiveHandlerCallback:()=>hn,CreateGlobal:()=>we,CreateInplaceProxy:()=>yt,CreateLoop:()=>ct,CreateMagicHandlerCallback:()=>Sn,CreateReadonlyProxy:()=>gt,DecodeAttribute:()=>Ke,DecodeValue:()=>qe,DeepCopy:()=>te,DefaultTransitionDelay:()=>Jt,DefaultTransitionDuration:()=>Bt,DefaultTransitionRepeats:()=>zt,DeleteProxyProp:()=>F,DirectiveManager:()=>ue,DisableProxyAction:()=>Ct,DispatchDirective:()=>I,ElementScope:()=>ge,ElementScopeKey:()=>f,EncodeAttribute:()=>Ye,EncodeValue:()=>Ve,EndsWith:()=>Ze,EvaluateLater:()=>Ft,EvaluateMagicProperty:()=>w,ExtractDuration:()=>gn,FindAncestor:()=>Qe,FindAncestorByAttribute:()=>et,FindAncestorByAttributeValue:()=>tt,FindAncestorByClass:()=>Xe,FindAncestorByTagName:()=>nt,FindCacheValue:()=>p,FindComponentById:()=>Me,FindComponentByName:()=>$e,FindComponentByRoot:()=>He,FindFirstAttribute:()=>V,FindFirstAttributeValue:()=>Y,FlattenDirective:()=>x,ForwardEvent:()=>dn,Future:()=>r,GenerateFunctionFromString:()=>Nt,GenerateUniqueId:()=>ee,GenerateValueReturningFunction:()=>Gt,GenerateVoidFunction:()=>Rt,GenericProxy:()=>z,GetAttribute:()=>K,GetCache:()=>h,GetConfig:()=>v,GetDefaultUniqueMarkers:()=>Z,GetDirectiveValue:()=>_n,GetElementContent:()=>tn,GetElementScopeId:()=>b,GetGlobal:()=>je,GetGlobalScope:()=>it,GetLocal:()=>Mt,GetOrCreateGlobal:()=>Ne,GetProxyProp:()=>B,GetTarget:()=>L,GetTargets:()=>T,GlobalCreatedEvent:()=>Fe,IncrementUniqueMarkers:()=>Q,InferComponent:()=>Be,InitCache:()=>u,InitComponentCache:()=>De,InitJITProxy:()=>Pt,InitializeDev:()=>On,InitializeGlobal:()=>Gn,InitializeGlobalScope:()=>rt,InitializeUtilities:()=>Rn,InitializeValues:()=>wn,InitializeVersion:()=>Nn,InlineJS:()=>Fn,InlineJSGlobalKey:()=>Re,InsertHtml:()=>Ut,Interpolate:()=>sn,InterpolateText:()=>rn,IntersectionObserver:()=>yn,IsBooleanAttribute:()=>st,IsEqual:()=>ot,IsInsideTemplate:()=>G,IsObject:()=>M,IsTemplate:()=>O,JoinPath:()=>_t,JoinUniqueMarkers:()=>X,JournalError:()=>s,JournalLog:()=>kn,JournalTry:()=>o,JournalWarn:()=>P,LazyCheck:()=>An,Loop:()=>l,MagicManager:()=>Ee,MeasureCallback:()=>ht,MutationObserver:()=>Se,NativeFetchConcept:()=>Oe,NextIdle:()=>Vt,NextNonIdle:()=>Yt,NextTick:()=>Zt,Nothing:()=>a,OnDirectiveExpansionRule:()=>In,PathToRelative:()=>pt,PeekCurrentComponent:()=>se,PeekCurrentScope:()=>pe,PeekStoredObject:()=>We,PopCurrentComponent:()=>re,PopCurrentScope:()=>de,ProcessDirectives:()=>R,ProxyKeys:()=>j,PushCurrentComponent:()=>ie,PushCurrentScope:()=>he,QueryGlobalComponent:()=>Ht,RandomString:()=>Ie,RemoveDirectiveExpansionRule:()=>C,RemoveOutsideEventListener:()=>be,ReplaceText:()=>nn,ResizeObserver:()=>Pe,ResolveKeyValue:()=>fn,ResolveOptions:()=>Cn,ResolveTransition:()=>Wt,RetrieveStoredObject:()=>ze,RootProxy:()=>W,Scope:()=>Ce,SetAttributeUtil:()=>ft,SetCacheValue:()=>d,SetProxyProp:()=>J,SplitPath:()=>mt,Stack:()=>i,StreamData:()=>jt,SubscribeToChanges:()=>Tt,SupportsAttributes:()=>q,TextContentInterpolator:()=>ln,TidyPath:()=>dt,ToCamelCase:()=>m,ToSnakeCase:()=>bt,ToString:()=>Ue,TraverseDirectives:()=>k,UnbindOutsideEvent:()=>ye,UseEffect:()=>Dt,WaitForGlobal:()=>Le,WaitPromise:()=>xt,WaitTransition:()=>qt,WaitWhile:()=>Lt});class i{constructor(e){this.list_=new Array,e&&(this.list_=e.list_.map((e=>e)))}Push(e){this.list_.push(e)}Pop(){return 0==this.list_.length?null:this.list_.pop()}Peek(){return 0==this.list_.length?null:this.list_[this.list_.length-1]}IsEmpty(){return 0==this.list_.length}GetHistory(){return this.list_.map((e=>e))}}class r{constructor(e){this.callback_=e}Get(){return this.callback_()}}function s(e,t,n){console.error({message:e,context:t||"N/A",contextElement:n||"N/A"})}function o(e,t,n){try{return e()}catch(e){s(e,t,n)}}class l{constructor(e){this.whileCallbacks_=new Array,this.finalCallbacks_=new Array,e((e=>{this.whileCallbacks_.slice(0).forEach(((t,n)=>{!1===o((()=>t(e)),"InlineJS.Loop.While")&&this.whileCallbacks_.splice(n,1)}))}),(e=>{this.whileCallbacks_.splice(0),this.finalCallbacks_.splice(0).forEach((t=>o((()=>t(e)),"InlineJS.Loop.Final")))}),(()=>{this.whileCallbacks_.splice(0),this.finalCallbacks_.splice(0)}))}While(e){return this.whileCallbacks_.push(e),this}Final(e){return this.finalCallbacks_.push(e),this}}class a{}function c(e,t=!1){return new RegExp(`^${e}`,t?"i":void 0)}function u(e,t){return globalThis[e]=t}function h(e,t){return globalThis[e]=globalThis[e]||u(e,t)}function d(e,t,n,i){let r=h(e,i);"object"==typeof r&&(r[t]=n)}function p(e,t){let n=e in globalThis&&globalThis[e]||null;if(n&&"object"==typeof n&&t in n)return n[t]}function m(e,t,n){let[i="",...r]=e.trim().split(n||"-"),s=e=>e.charAt(0).toUpperCase()+e.substring(1);return i&&(t?s(i):i)+(r||[]).map((e=>s(e))).join("")}const _={self:"self",event:"event",scope:"scope"},f="__InlineJS_ELSCOPE_KEY__";function b(e){let t="";for(;e;){if(t=f in(n=e)&&"string"==typeof n[f]?n[f]:"",t||e===document.body)return t||"";e=e.parentElement}var n;return""}function v(){return je().GetConfig()}function y(e,t){return n=>-1==n.search(e)?null:n.replace(e,t)}function g(e){return je().GetDirectiveManager().AddExpansionRule(e)}function C(e){je().GetDirectiveManager().RemoveExpansionRule(e)}function A(e){return je().GetDirectiveManager().Expand(e)}let E={};function S(e,t){if(!e||!(e=e.trim()))return null;if((t=(t||"").trim())===e&&(t=""),e in E)return{meta:E[e],value:t};let n=A(e),i=n.match(v().GetDirectiveRegex());if(!i||3!=i.length||!i[2])return null;let r=i[2].indexOf(":"),s=-1==r?[i[2]]:[i[2].substring(0,r),i[2].substring(r+1)],o="",l="";s.length>1?[o,l]=s:[l]=s;let a=l.split("."),c="";o?c=a[0]:o=a[0],a.splice(0,1);let u=o.split("-"),h={view:{original:e,expanded:n},name:{value:o,joined:u.join("."),parts:u},arg:{key:c,options:a||[]}};return E[e]=h,{meta:h,value:t}}function P(e,t,n){console.warn({message:e,context:t||"N/A",contextElement:n||"N/A"})}function x(e){return{originalView:e.meta.view.original,expandedView:e.meta.view.expanded,nameValue:e.meta.name.value,nameJoined:e.meta.name.joined,nameParts:e.meta.name.parts,argKey:e.meta.arg.key,argOptions:e.meta.arg.options,expression:e.value}}function I(e,t,n,i=0){let r="string"==typeof e?Me(e):e;if(!r)return s(`Failed to find component for '${n.meta.view.original}'`,"InlineJS.DispatchDirective",t),!1;let l=null,a=r.FindElementScope(t);if(a&&(l=a.GetDirectiveManager().FindHandler(n.meta.name.joined),++i),l=l||je().GetDirectiveManager().FindHandler(n.meta.name.joined),!l){let e=`${n.meta.name.parts.reduce(((e,t)=>e?`${e}${t.substring(0,1).toUpperCase()}${t.substring(1)}`:t),"")}DirectiveHandler`;e in globalThis&&"function"==typeof globalThis[e]&&(l=globalThis[e])}return l?(0!=i||a||r.CreateElementScope(t),o((()=>{l(Object.assign(Object.assign({},x(n)),{componentId:r.GetId(),component:r,contextElement:t}))}),"InlineJS.DispatchDirective",t),!0):(P(`No handler found '${n.meta.view.original}'`,"InlineJS.DispatchDirective",t),!1)}function k({element:e,callback:t,attributeCallback:n}){Array.from(e.attributes||[]).forEach((i=>{try{n&&n(i.name,i.value||"");let e=S(i.name,i.value||"");e&&t(e)}catch(t){s(t,"InlineJS.TraverseDirectives",e)}}))}function O(e){return e instanceof HTMLTemplateElement||"IsTemplate"in e&&"function"==typeof e.IsTemplate&&!!e.IsTemplate()}function G(e){for(let t=e.parentNode;t;t=t.parentNode)if(t instanceof Element&&O(t))return!0;return!1}function R({component:e,element:t,options:n={}}){if(!function(e,{checkTemplate:t=!0,checkDocument:n=!0}){return 1===(null==e?void 0:e.nodeType)&&(!n||document.contains(e))&&(!t||!G(e))}(t,n))return;let i="string"==typeof e?Me(e):e;if(!i)return s("Failed to find component.","InlineJS.ProcessDirectives",t),!1;let r=0;k({element:t,callback:n=>{I(e,t,n,r)&&(t.removeAttribute(n.meta.view.original),++r)},attributeCallback:(e,n)=>je().DispatchAttributeProcessing({name:e,value:n,componentId:i.GetId(),component:i,contextElement:t})}),je().DispatchTextContentProcessing({componentId:i.GetId(),component:i,contextElement:t}),"OnElementScopeCreated"in t&&"function"==typeof t.OnElementScopeCreated&&i.CreateElementScope(t);let o=i.FindElementScope(t);if(null==o||o.ExecutePostAttributesProcessCallbacks(),!n.ignoreChildren&&!O(t)){i.PushSelectionScope();let n={checkTemplate:!1,checkDocument:!1},r=(t,i)=>R({component:e,options:Object.assign(Object.assign({},n),{ignoreChildren:i}),element:t});"TraverseChildren"in t&&"function"==typeof t.TraverseChildren?t.TraverseChildren((e=>r(e,e.contains(t)))):Array.from(t.children).forEach((e=>r(e,e.contains(t)))),i.PopSelectionScope()}null==o||o.ExecutePostProcessCallbacks()}function w(e,t,n,i="",r=!0){let l="string"==typeof e?Me(e):e;if(!l)return s(`Failed to find component for '$${n}'`,"InlineJS.EvaluateMagicProperty",t),je().CreateNothing();let a=i&&n.startsWith(i)?n.substring(i.length):n,c=je().GetMagicManager().FindHandler(a,{contextElement:t,componentId:l.GetId(),component:l});if(!c){if(!r)return je().CreateNothing();let e=i&&n.startsWith(`${i}${i}`)||!1;a=e?a.substring(i.length):a;let t=l.FindScopeByName(a);if(t)return e?t.GetRoot():t.GetProxy().GetNative();let s=$e(a);if(s)return e?s.GetRoot():s.GetRootProxy().GetNative();if(e){let e=l.GetId();return t=>{let r=Be(t)||Me(e);if(!r)return null;let s=r.FindElementScope(t),o=s&&s.GetLocal(n.substring(i.length));return s&&!je().IsNothing(o)?o:w(r.GetId(),t,n,`${i}${i}`,!1)}}return je().CreateNothing()}return o((()=>c({componentId:l.GetId(),component:l,contextElement:t})),"InlineJS.EvaluateMagicProperty",t)}function N(e,t,n,i,r=!0){if(!i)return;let s={componentId:i.GetComponentId(),type:e,path:t,prop:n,origin:i.PeekOrigin()};if(i.Add(s),!r)return;let o=t.split(".");for(;o.length>2;)o.pop(),i.Add({original:s,path:o.join(".")})}function F(e,t,n,i){var r;if(!(i in t))return!1;let s=Me(e);return null===(r=null==s?void 0:s.FindProxy(n))||void 0===r||r.RemoveChild(i),delete t[i],null==s||s.RemoveProxy(`${n}.${i}`),N("delete",n,i,null==s?void 0:s.GetBackend().changes),!0}const j={componentId:"__InlineJS_CompnentId__",name:"__InlineJS_Name__",path:"__InlineJS_Path__",parentPath:"__InlineJS_ParentPath__",target:"__InlineJS_Target__"};function L(e){return(Array.isArray(e)||e&&"object"==typeof e)&&j.target in e?L(e[j.target]):e}function T(e){return e.map((e=>L(e)))}function D(e){return(e=L(e))&&"object"==typeof e&&(j.target in e||"__proto__"in e&&"Object"===e.__proto__.constructor.name)}function M(e){return!!D(e)}function $(e){return-1==e.findIndex((e=>!D(e)))}function H(e,t,n,i){if(!e)return null;let r=e.FindChild(t);if(r)return r;if(!Array.isArray(n)&&!M(n))return null;let s=je().CreateChildProxy(e,t,n);return i&&i.AddProxy(s),s}function B(e,t,n,i,r){var s;if(i===j.target)return t;if(i===j.componentId)return e;if(i===j.name)return n.split(".").at(-1);if(i===j.path)return n;if(i===j.parentPath)return n.split(".").slice(0,-1).join(".")||"";let o=i in t;if(!o&&r){let t=r(Me(e)||void 0,i);if(!je().IsNothing(t))return je().IsFuture(t)?t.Get():t}if(o&&!t.hasOwnProperty(i))return t[i];let l=o?t[i]:null;if(je().IsFuture(l))return l.Get();let a=Me(e);return null==a||a.GetBackend().changes.AddGetAccess(`${n}.${i}`),(null===(s=H((null==a?void 0:a.FindProxy(n))||null,i,l,a||void 0))||void 0===s?void 0:s.GetNative())||l}function J(e,t,n,i,r){var s;if(i in t&&r===t[i])return!0;let o=Me(e);return null===(s=null==o?void 0:o.FindProxy(n))||void 0===s||s.RemoveChild(i),t[i]=r,null==o||o.RemoveProxy(`${n}.${i}`),N("set",`${n}.${i}`,i,null==o?void 0:o.GetBackend().changes),!0}class z{constructor(e,t,n,i,r=!1){this.componentId_=e,this.target_=t,this.name_=n,this.native_=null,this.children_={},this.parentPath_=(null==i?void 0:i.GetPath())||"",null==i||i.AddChild(this);let s=this.componentId_,o=this.GetPath(),l=(e,t)=>{let{context:n}=null==e?void 0:e.GetBackend(),i=null==t?void 0:t.startsWith("$");if(i){let e=n.Peek(t.substring(1),je().CreateNothing());if(!je().IsNothing(e))return e}let r=n.Peek(_.self),s=null==e?void 0:e.FindElementLocalValue(r||e.GetRoot(),t,!0);if(!je().IsNothing(s))return s;let o=i?w(e,r,t,"$"):je().CreateNothing();return je().IsNothing(o)&&t&&t in globalThis&&(o=globalThis[t]),o},a=!r&&!this.parentPath_,c={get:(e,t)=>"symbol"==typeof t||"prototype"===t?Reflect.get(e,t):B(s,e,o,t.toString(),a?l:void 0),set:(e,t,n)=>"symbol"==typeof t||"prototype"===t?Reflect.set(e,t,n):J(s,e,o,t.toString(),n),deleteProperty:(e,t)=>"symbol"==typeof t||"prototype"===t?Reflect.get(e,t):F(s,e,o,t.toString()),has:(e,t)=>"symbol"!=typeof t||Reflect.has(e,t)};this.native_=new window.Proxy(this.target_,c)}IsRoot(){return!this.parentPath_}GetComponentId(){return this.componentId_}GetTarget(){return this.target_}GetNative(){return this.native_}GetName(){return this.name_}GetPath(){return this.parentPath_?`${this.parentPath_}.${this.name_}`:this.name_}GetParentPath(){return this.parentPath_}AddChild(e){this.children_[e.GetName()]=e}RemoveChild(e){delete this.children_["string"==typeof e?e:e.GetName()]}FindChild(e){return this.children_.hasOwnProperty(e)?this.children_[e]:null}}class W extends z{constructor(e,t,n){super(e,t,`Proxy<${n||e}>`,void 0,!!n)}}function q(e){return(e=L(e))&&"getAttribute"in e&&"setAttribute"in e}function U(e,t){return t&&q(e)?e.getAttribute(t):null}function K(e,t){for(let n of Array.isArray(t)?t:[t]){let t=U(e,n);if(t)return t}return null}function V(e,t){if(!q(e))return null;for(let n of t)if(e.hasAttribute(n))return{name:n,value:e.getAttribute(n)};return null}function Y(e,t){let n=V(e,t);return n?n.value:null}function Z(){return{level0:0,level1:0,level2:0}}function Q(e,t="level0",n="level1"){e[t]==(Number.MAX_SAFE_INTEGER||9007199254740991)?("level0"===t?Q(e,"level1","level2"):++e[n],e[t]=0):++e[t]}function X(e){return`${e.level2}_${e.level1}_${e.level0}`}function ee(e,t,n,i){return Q(e),`${t||""}${n||""}${X(e)}${i||""}`}function te(e){if(e=L(e),!Array.isArray(e)&&!M(e))return e;if(Array.isArray(e))return e.map((e=>te(e)));let t={};return Object.entries(e).forEach((([e,n])=>t[e]=te(n))),t}class ne{constructor(){this.listeners_=new Array}AddChangesMonitor(e){this.listeners_.push(e),this.listeners_.forEach((e=>o((()=>e({target:"changes-monitor",object:()=>Object.assign({},this.listeners_)})))))}RemoveChangesMonitor(e){let t=this.listeners_.length;this.listeners_=this.listeners_.filter((t=>t!==e)),t!=this.listeners_.length&&this.listeners_.forEach((e=>o((()=>e({target:"changes-monitor",object:()=>Object.assign({},this.listeners_)})))))}NotifyListeners_(e,t){this.listeners_.forEach((n=>o((()=>n({target:e,object:()=>te(t)})))))}}function ie(e){je().PushCurrentComponent(e)}function re(){return je().PopCurrentComponent()}function se(){return je().PeekCurrentComponent()}class oe extends ne{constructor(e){super(),this.componentId_=e,this.nextTickHandlers_=new Array,this.nextIdleHandlers_=new Array,this.nextNonIdleHandlers_=new Array,this.isScheduled_=!1,this.isIdle_=!0,this.list_=new Array,this.subscribers_={},this.lastAccessContext_="",this.getAccessStorages_=new i,this.origins_=new i}GetComponentId(){return this.componentId_}AddNextTickHandler(e){this.nextTickHandlers_.push(e),this.Schedule(),this.NotifyListeners_("next-tick-handlers",this.nextTickHandlers_)}AddNextIdleHandler(e){this.nextIdleHandlers_.push(e),this.Schedule(),this.NotifyListeners_("next-idle-handlers",this.nextIdleHandlers_)}AddNextNonIdleHandler(e){this.nextNonIdleHandlers_.push(e),this.Schedule(),this.NotifyListeners_("next-non-idle-handlers",this.nextNonIdleHandlers_)}Schedule(){this.isScheduled_||(this.isScheduled_=!0,queueMicrotask((()=>{this.isScheduled_=!1,this.isIdle_&&(this.isIdle_=!1,this.nextNonIdleHandlers_.splice(0).forEach((e=>o(e,`InlineJs.Region<${this.componentId_}>.NextNonIdle`))));let e=new Array;this.list_.splice(0).forEach((t=>{Object.values(this.subscribers_).filter((e=>e.path===t.path&&e.callback!==(e=>"original"in e?e.original.origin:e.origin)(t))).forEach((n=>((t,n)=>{let i=e.find((e=>e.callback===n));i?i.changes.push(t):e.push({callback:n,changes:new Array(t)})})(t,n.callback)))})),e.forEach((e=>e.callback(e.changes))),this.nextTickHandlers_.splice(0).forEach((e=>o(e,`InlineJs.Region<${this.componentId_}>.NextTick`))),this.isScheduled_||(this.isIdle_=!0,this.nextIdleHandlers_.splice(0).forEach((e=>o(e,`InlineJs.Region<${this.componentId_}>.NextIdle`))))})),this.NotifyListeners_("scheduled",this.isScheduled_))}Add(e){this.list_.push(e),this.Schedule(),this.NotifyListeners_("list",this.list_)}AddComposed(e,t,n){let i={componentId:this.componentId_,type:"set",path:t?`${t}.${e}`:e,prop:e,origin:this.origins_.Peek()};n?this.Add({original:i,path:n}):this.Add(i)}GetLastChange(e=0){return te(this.list_.at(-(e+1))||null)}AddGetAccess(e){var t,n,i,r;let s=(null===(t=Me(se()||""))||void 0===t?void 0:t.GetBackend().changes)||this,o=e.lastIndexOf(".");s.lastAccessContext_=-1==o?"":e.substring(0,o);let l=s.getAccessStorages_.Peek();(null==l?void 0:l.details)&&(null===(n=l.details.raw)||void 0===n||n.entries.push({compnentId:this.componentId_,path:e}),l.details.optimized&&l.details.optimized.entries!==(null===(i=l.details.raw)||void 0===i?void 0:i.entries)&&0!=l.details.optimized.entries.length&&l.lastAccessPath&&l.lastAccessPath.length<e.length&&0==e.indexOf(`${l.lastAccessPath}.`)?l.details.optimized.entries.at(-1).path=e:l.details.optimized&&l.details.optimized.entries!==(null===(r=l.details.raw)||void 0===r?void 0:r.entries)&&l.details.optimized.entries.push({compnentId:this.componentId_,path:e}),l.lastAccessPath=e,this.NotifyListeners_("last-access-context",this.list_),s.NotifyListeners_("get-access-storages",this.getAccessStorages_))}GetLastAccessContext(){return this.lastAccessContext_}ResetLastAccessContext(){this.lastAccessContext_="",this.NotifyListeners_("last-access-context",this.lastAccessContext_)}PushGetAccessStorage(e){var t;this.getAccessStorages_.Push({details:e||{optimized:"optimized"===(null===(t=Me(this.componentId_))||void 0===t?void 0:t.GetReactiveState())?{entries:new Array,snapshots:new i}:void 0,raw:{entries:new Array,snapshots:new i}},lastAccessPath:""}),this.NotifyListeners_("get-access-storages",this.getAccessStorages_)}PopGetAccessStorage(){var e;let t=(null===(e=this.getAccessStorages_.Pop())||void 0===e?void 0:e.details)||null;return this.NotifyListeners_("get-access-storages",this.getAccessStorages_),t}SwapOptimizedGetAccessStorage(){let e=this.getAccessStorages_.Peek();(null==e?void 0:e.details.optimized)&&e.details.raw&&(e.details.optimized.entries=e.details.raw.entries,this.NotifyListeners_("get-access-storages",this.getAccessStorages_))}RestoreOptimizedGetAccessStorage(){var e;let t=this.getAccessStorages_.Peek();(null==t?void 0:t.details.optimized)&&t.details.optimized.entries===(null===(e=t.details.raw)||void 0===e?void 0:e.entries)&&(t.details.optimized.entries=t.details.raw.entries.slice(0),this.NotifyListeners_("get-access-storages",this.getAccessStorages_))}FlushRawGetAccessStorage(){var e,t;null===(t=null===(e=this.getAccessStorages_.Peek())||void 0===e?void 0:e.details.raw)||void 0===t||t.entries.splice(0),this.NotifyListeners_("get-access-storages",this.getAccessStorages_)}PushGetAccessStorageSnapshot(){var e,t;let n=this.getAccessStorages_.Peek();null===(e=null==n?void 0:n.details.optimized)||void 0===e||e.snapshots.Push(n.details.optimized.entries.slice(0).map((e=>Object.assign({},e)))),null===(t=null==n?void 0:n.details.raw)||void 0===t||t.snapshots.Push(n.details.raw.entries.slice(0).map((e=>Object.assign({},e)))),this.NotifyListeners_("get-access-storages",this.getAccessStorages_)}PopGetAccessStorageSnapshot(e){var t,n,i,r;let s=this.getAccessStorages_.Peek(),o=null===(t=null==s?void 0:s.details.optimized)||void 0===t?void 0:t.snapshots.Pop();!e&&o&&(null===(n=null==s?void 0:s.details.optimized)||void 0===n?void 0:n.entries)&&(s.details.optimized.entries=o);let l=null===(i=null==s?void 0:s.details.raw)||void 0===i?void 0:i.snapshots.Pop();!e&&l&&(null===(r=null==s?void 0:s.details.raw)||void 0===r?void 0:r.entries)&&(s.details.raw.entries=l),this.NotifyListeners_("get-access-storages",this.getAccessStorages_)}PopAllGetAccessStorageSnapshots(e){var t,n,i,r,s,o;let l=this.getAccessStorages_.Peek(),a=null===(t=null==l?void 0:l.details.optimized)||void 0===t?void 0:t.snapshots.Pop();for(;(null===(n=null==l?void 0:l.details.optimized)||void 0===n?void 0:n.snapshots)&&!l.details.optimized.snapshots.IsEmpty();)a=l.details.optimized.snapshots.Pop();!e&&a&&(null===(i=null==l?void 0:l.details.optimized)||void 0===i?void 0:i.entries)&&(l.details.optimized.entries=a);let c=null===(r=null==l?void 0:l.details.raw)||void 0===r?void 0:r.snapshots.Pop();for(;(null===(s=null==l?void 0:l.details.raw)||void 0===s?void 0:s.snapshots)&&!l.details.raw.snapshots.IsEmpty();)c=l.details.raw.snapshots.Pop();!e&&c&&(null===(o=null==l?void 0:l.details.raw)||void 0===o?void 0:o.entries)&&(l.details.raw.entries=c),this.NotifyListeners_("get-access-storages",this.getAccessStorages_)}PushOrigin(e){this.origins_.Push(e),this.NotifyListeners_("origins",this.origins_)}PeekOrigin(){return this.origins_.Peek()}PopOrigin(){let e=this.origins_.Pop();return this.NotifyListeners_("origins",this.origins_),e}Subscribe(e,t){var n;let i=null===(n=Me(this.componentId_))||void 0===n?void 0:n.GenerateUniqueId("sub_");return i&&(this.subscribers_[i]={path:e,callback:t},this.NotifyListeners_("subscribers",this.subscribers_)),i||""}Unsubscribe(e,t){"string"!=typeof e?Object.entries(this.subscribers_).filter((([n,i])=>e===i.callback&&(!t||t===i.path))).map((([e])=>e)).forEach((e=>{this.Unsubscribe_(e)})):e in this.subscribers_&&this.Unsubscribe_(e),this.NotifyListeners_("subscribers",this.subscribers_)}Unsubscribe_(e){delete this.subscribers_[e]}}class le{constructor(){this.record_={}}Push(e,t){(this.record_[e]=this.record_[e]||new i).Push(t)}Pop(e,t){return this.record_.hasOwnProperty(e)?this.record_[e].Pop():t||null}Peek(e,t){return this.record_.hasOwnProperty(e)?this.record_[e].Peek():t||null}Get(e){return this.record_.hasOwnProperty(e)?this.record_[e]:null}GetHistory(e){return this.record_.hasOwnProperty(e)?this.record_[e].GetHistory():[]}GetRecordKeys(){return Object.keys(this.record_)}}function ae(e,t,n){let i="function"==typeof e?function(e){return{handler(t){var{argKey:n}=t,i=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}(t,["argKey"]);this.extensions.hasOwnProperty(n)?this.extensions[n](Object.assign({argKey:n},i)):e(Object.assign({argKey:n},i))},extensions:{}}}(e):e;return i.extensions[t]=n,i}function ce(e,t){let n="",i=null;return"function"==typeof e?(n=t||"",i=e):(n=e.GetName(),i=t=>e.Handle(t)),{computedName:n,callback:i}}class ue{constructor(){this.expansionRules_={},this.handlers_={}}AddExpansionRule(e){let t=je().GenerateUniqueId("exrule_");return this.expansionRules_[t]=e,t}RemoveExpansionRule(e){e in this.expansionRules_&&delete this.expansionRules_[e]}Expand(e){if(!(e=e.trim()))return e;for(let t in this.expansionRules_){let n=this.expansionRules_[t](e);if(n)return n}return e}AddHandler(e,t){let{computedName:n,callback:i}=ce(e,t);n&&i&&(this.handlers_[n]=i)}RemoveHandler(e){e in this.handlers_&&delete this.handlers_[e]}FindHandler(e){if(!this.handlers_.hasOwnProperty(e))return null;let t=this.handlers_[e];return"function"==typeof t?t:t.handler.bind(t)}AddHandlerExtension(e,t,n){let i=this.handlers_.hasOwnProperty(e)?this.handlers_[e]:null;if(!i)return;let{computedName:r,callback:s}=ce(t,n);r&&s&&(this.handlers_[e]=ae(i,r,s))}RemoveHandlerExtension(e,t){let n=this.handlers_.hasOwnProperty(e)?this.handlers_[e]:null;n&&function(e,t){"function"!=typeof e&&e.extensions.hasOwnProperty(t)&&delete e.extensions[t]}(n,t)}}function he(e,t){var n;null===(n="string"==typeof e?Me(e):e)||void 0===n||n.PushCurrentScope(t)}function de(e){var t;return(null===(t="string"==typeof e?Me(e):e)||void 0===t?void 0:t.PopCurrentScope())||null}function pe(e){var t;return(null===(t="string"==typeof e?Me(e):e)||void 0===t?void 0:t.PeekCurrentScope())||null}const me="InlineJS_OutsideEvent";function _e(){return globalThis[me]=globalThis[me]||{targetScopes:new Array,eventCallbacks:{}}}function fe(e,t,n){let i=_e(),r=i.targetScopes.find((t=>t.target===e));r||(r={target:e,listeners:{}},i.targetScopes.push(r)),(Array.isArray(t)?t:[t]).forEach((e=>{e in r.listeners||(r.listeners[e]={handlers:new Array,excepts:null}),r.listeners[e].handlers.push({callback:n,excepts:null}),e in i.eventCallbacks||(i.eventCallbacks[e]=e=>{i.targetScopes.forEach((t=>{e.type in t.listeners&&t.target!==e.target&&!t.target.contains(e.target)&&-1==(t.listeners[e.type].excepts||[]).findIndex((t=>t===e.target||t.contains(e.target)))&&t.listeners[e.type].handlers.filter((t=>-1==(t.excepts||[]).findIndex((t=>t===e.target||t.contains(e.target))))).forEach((t=>o((()=>t.callback(e)),"InlineJS.OutsideEventListener")))}))},window.addEventListener(e,i.eventCallbacks[e]))}))}function be(e,t,n){let i=_e().targetScopes.find((t=>t.target===e));i&&(Array.isArray(t)?t:[t]).forEach((e=>{e in i.listeners&&(n?i.listeners[e].handlers=i.listeners[e].handlers.filter((e=>e.callback!==n)):delete i.listeners[e])}))}function ve(e,t,n){let i=_e().targetScopes.find((t=>t.target===e));i&&Object.keys(t).forEach((e=>{if(e in i.listeners)if(n){let r=i.listeners[e].handlers.find((e=>e.callback===n));r&&(r.excepts=r.excepts||new Array,(Array.isArray(t[e])?t[e]:[t[e]]).forEach((e=>{r.excepts.push(e)})))}else i.listeners[e].excepts=i.listeners[e].excepts||new Array,(Array.isArray(t[e])?t[e]:[t[e]]).forEach((t=>{i.listeners[e].excepts.push(t)}))}))}function ye(e){_e().targetScopes=_e().targetScopes.filter((t=>t.target!==e&&!e.contains(t.target)))}class ge extends ne{constructor(e,t,n,i){super(),this.componentId_=e,this.id_=t,this.element_=n,this.isRoot_=i,this.isInitialized_=!1,this.scopeId_="",this.key_="",this.locals_={},this.data_={},this.queuedAttributeChanges_=null,this.managers_={directive:null},this.callbacks_={post:new Array,postAttributes:new Array,uninit:new Array,treeChange:new Array,attributeChange:new Array},this.state_={isMarked:!1,isDestroyed:!1},this.scopeId_=pe(this.componentId_)||""}SetInitialized(){this.isInitialized_=!0}IsInitialized(){return this.isInitialized_}GetComponentId(){return this.componentId_}GetScopeId(){return this.scopeId_}GetId(){return this.id_}SetKey(e){this.NotifyListeners_("key",this.key_=e)}GetKey(){return this.key_}GetElement(){return this.element_}IsRoot(){return this.isRoot_}SetLocal(e,t){this.state_.isMarked||(this.locals_[e]=t,this.NotifyListeners_("locals",this.locals_))}DeleteLocal(e){delete this.locals_[e],this.NotifyListeners_("locals",this.locals_)}HasLocal(e){return e in this.locals_}GetLocal(e){return e in this.locals_?this.locals_[e]:je().CreateNothing()}GetLocals(){return this.locals_}SetData(e,t){this.state_.isMarked||(this.data_[e]=t,this.NotifyListeners_("data",this.data_))}GetData(e){return e in this.data_?this.data_[e]:je().CreateNothing()}AddPostProcessCallback(e){this.state_.isMarked||(this.callbacks_.post.push(e),this.NotifyListeners_("post-process-callbacks",this.callbacks_.post))}ExecutePostProcessCallbacks(){(this.callbacks_.post||[]).splice(0).forEach((e=>o(e,"ElementScope.ExecutePostProcessCallbacks")))}AddPostAttributesProcessCallback(e){this.state_.isMarked||(this.callbacks_.postAttributes.push(e),this.NotifyListeners_("post-attributes-process-callbacks",this.callbacks_.postAttributes))}ExecutePostAttributesProcessCallbacks(){(this.callbacks_.postAttributes||[]).splice(0).forEach((e=>o(e,"ElementScope.ExecutePostAttributesProcessCallbacks")))}AddUninitCallback(e){this.state_.isMarked||(this.callbacks_.uninit.push(e),this.NotifyListeners_("uninit-callbacks",this.callbacks_.uninit))}RemoveUninitCallback(e){this.callbacks_.uninit=this.callbacks_.uninit.filter((t=>t!==e)),this.NotifyListeners_("uninit-callbacks",this.callbacks_.uninit)}AddTreeChangeCallback(e){this.callbacks_.treeChange.push(e),this.NotifyListeners_("tree-change-callbacks",this.callbacks_.treeChange)}RemoveTreeChangeCallback(e){this.callbacks_.treeChange=this.callbacks_.treeChange.filter((t=>t!==e)),this.NotifyListeners_("tree-change-callbacks",this.callbacks_.treeChange)}ExecuteTreeChangeCallbacks(e,t){this.callbacks_.treeChange.forEach((n=>o((()=>n({added:e,removed:t})))))}AddAttributeChangeCallback(e,t){if(this.state_.isMarked)return;let n=this.callbacks_.attributeChange.find((t=>t.callback===e));n?n.whitelist.push(...t||[]):this.callbacks_.attributeChange.push({callback:e,whitelist:"string"==typeof t?[t]:t||[]}),this.NotifyListeners_("attribute-change-callbacks",this.callbacks_.attributeChange)}RemoveAttributeChangeCallback(e,t){let n=this.callbacks_.attributeChange.findIndex((t=>t.callback===e));if(-1==n)return;let i="string"==typeof t?[t]:t||[];0!=i.length&&0!=this.callbacks_.attributeChange[n].whitelist.length?i.forEach((e=>{this.callbacks_.attributeChange[n].whitelist=this.callbacks_.attributeChange[n].whitelist.filter((t=>t!==e))})):this.callbacks_.attributeChange[n].whitelist.splice(0),0==this.callbacks_.attributeChange[n].whitelist.length&&this.callbacks_.attributeChange.splice(n,1),this.NotifyListeners_("attribute-change-callbacks",this.callbacks_.attributeChange)}ExecuteAttributeChangeCallbacks(e){this.queuedAttributeChanges_?this.queuedAttributeChanges_.push(e):(this.queuedAttributeChanges_=[e],queueMicrotask((()=>{if(!this.queuedAttributeChanges_)return;const e=this.queuedAttributeChanges_;this.queuedAttributeChanges_=null,e.forEach((e=>{(this.callbacks_.attributeChange||[]).filter((t=>0==(t.whitelist||[]).length||t.whitelist.includes(e))).forEach((t=>o((()=>t.callback(e)))))}))})))}Destroy(e){if(this.state_.isDestroyed)return;if(this.state_.isMarked=!0,!(this.element_ instanceof HTMLTemplateElement)){let t=Me(this.componentId_);t&&this.DestroyChildren_(t,this.element_,e||!1)}if(e)return;this.callbacks_.uninit.splice(0).forEach((e=>{try{e()}catch(e){}})),this.callbacks_.post.splice(0),this.callbacks_.treeChange.splice(0),this.callbacks_.attributeChange.splice(0),this.data_={},this.locals_={},this.state_.isDestroyed=!0,ye(this.element_),je().GetMutationObserver().Unobserve(this.element_);let t=Me(this.componentId_);if(null==t||t.RemoveElementScope(this.id_),delete this.element_[f],this.isRoot_){let e=this.componentId_;null==t||t.GetBackend().changes.AddNextTickHandler((()=>je().RemoveComponent(e)))}}IsMarked(){return this.state_.isMarked}IsDestroyed(){return this.state_.isDestroyed}GetDirectiveManager(){return this.managers_.directive=this.managers_.directive||new ue}DestroyChildren_(e,t,n){Array.from(t.children).filter((e=>!e.contains(t))).forEach((t=>{let i=e.FindElementScope(t);i?i.Destroy(n):this.DestroyChildren_(e,t,n)}))}}class Ce{constructor(e,t,n){this.componentId_=e,this.id_=t,this.root_=n,this.name_="",this.proxy_=new W(this.componentId_,{},this.id_)}GetComponentId(){return this.componentId_}GetId(){return this.id_}SetName(e){this.name_=e}GetName(){return this.name_}GetRoot(){return this.root_}GetProxy(){return this.proxy_}FindElement(e,t){if(e===this.root_||!this.root_.contains(e))return null;do{e=e.parentElement;try{if(t(e))return e}catch(e){}}while(e!==this.root_);return null}FindAncestor(e,t){let n=t||0;return this.FindElement(e,(()=>0==n--))}}class Ae extends ne{constructor(e,t){super(),this.id_=e,this.root_=t,this.reactiveState_="default",this.name_="",this.context_=new le,this.scopes_={},this.elementScopes_={},this.proxies_={},this.refs_={},this.currentScope_=new i,this.selectionScopes_=new i,this.uniqueMarkers_={level0:0,level1:0,level2:0},this.attributeObservers_=new Array,this.observers_={intersections:{}},this.changes_=new oe(this.id_),this.rootProxy_=new W(this.id_,{}),this.proxies_[this.rootProxy_.GetPath()]=this.rootProxy_,je().GetMutationObserver().Observe(this.root_,(({added:t,removed:n,attributes:i})=>{let r=Me(e);if(!r)return;let s=new Array,l=je().GetConfig().GetDirectiveRegex(),a=null==i?void 0:i.filter((e=>e.target instanceof HTMLElement));null==a||a.forEach((e=>{var t;l.test(e.name)?e.target.hasAttribute(e.name)&&!s.includes(e.target)&&s.push(e.target):null===(t=null==r?void 0:r.FindElementScope(e.target))||void 0===t||t.ExecuteAttributeChangeCallbacks(e.name)})),a&&this.attributeObservers_.forEach((e=>{let t=a.filter((t=>t.target===e.element||e.element.contains(t.target)));0!=t.length&&o((()=>e.callback(t)))})),s.forEach((e=>R({element:e,component:r,options:{checkTemplate:!0,checkDocument:!1,ignoreChildren:!1}})));let c=[...t||[]];null==t||t.filter((e=>!(null==n?void 0:n.includes(e)))).forEach((e=>{var t;if(e instanceof HTMLElement){R({component:r,element:e,options:{checkTemplate:!0,checkDocument:!1,ignoreChildren:!1}});for(let n=e.parentElement;n&&(null===(t=null==r?void 0:r.FindElementScope(n))||void 0===t||t.ExecuteTreeChangeCallbacks([e],[]),n!==this.root_);n=n.parentElement);}})),null==n||n.filter((e=>!c.includes(e))).forEach((e=>{var t;e instanceof HTMLElement&&(null===(t=r.FindElementScope(e))||void 0===t||t.Destroy())}))}),["add","remove","attribute"])}SetReactiveState(e){this.NotifyListeners_("reactive-state",this.reactiveState_=e)}GetReactiveState(){return"default"===this.reactiveState_?v().GetReactiveState():this.reactiveState_}GetId(){return this.id_}GenerateUniqueId(e,t){const n=ee(this.uniqueMarkers_,`Cmpnt<${this.id_}>.`,e,t);return this.NotifyListeners_("unique-markers",this.uniqueMarkers_),n}SetName(e){this.NotifyListeners_("name",this.name_=e)}GetName(){return this.name_}CreateScope(e){let t=Object.values(this.scopes_).find((t=>t.GetRoot()===e));if(t)return t;if(e===this.root_||!this.root_.contains(e))return null;let n=new Ce(this.id_,this.GenerateUniqueId("scope_"),e);return this.scopes_[n.GetId()]=n,this.AddProxy(n.GetProxy()),this.NotifyListeners_("scopes",this.scopes_),n}RemoveScope(e){let t="string"==typeof e?e:e.GetId();this.scopes_.hasOwnProperty(t)&&(this.RemoveProxy(this.scopes_[t].GetProxy()),delete this.scopes_[t],this.NotifyListeners_("scopes",this.scopes_))}FindScopeById(e){return this.scopes_.hasOwnProperty(e)?this.scopes_[e]:null}FindScopeByName(e){return Object.values(this.scopes_).find((t=>t.GetName()===e))||null}FindScopeByRoot(e){return Object.values(this.scopes_).find((t=>t.GetRoot()===e))||null}PushCurrentScope(e){this.currentScope_.Push(e),this.NotifyListeners_("current-scope",this.currentScope_)}PopCurrentScope(){let e=this.currentScope_.IsEmpty(),t=this.currentScope_.Pop();return!e&&this.NotifyListeners_("current-scope",this.currentScope_),t}PeekCurrentScope(){return this.currentScope_.Peek()}InferScopeFrom(e){var t;return this.FindScopeById((null===(t=this.FindElementScope(b(e)))||void 0===t?void 0:t.GetScopeId())||"")||null}PushSelectionScope(){let e={set:!1};return this.selectionScopes_.Push(e),this.NotifyListeners_("selection-scopes",this.selectionScopes_),e}PopSelectionScope(){let e=this.selectionScopes_.IsEmpty(),t=this.selectionScopes_.Pop();return!e&&this.NotifyListeners_("selection-scopes",this.selectionScopes_),t}PeekSelectionScope(){return this.selectionScopes_.Peek()}GetRoot(){return this.root_}FindElement(e,t){if(e===this.root_||!this.root_.contains(e))return null;for(let n=e.parentNode;n;n=n.parentNode)try{if(n instanceof HTMLElement&&t(n))return n;if(n===this.root_)break}catch(e){break}return null}FindAncestor(e,t){let n=t||0;return this.FindElement(e,(()=>0==n--))}CreateElementScope(e){let t=Object.values(this.elementScopes_).find((t=>t.GetElement()===e));if(t)return t;if(e!==this.root_&&!this.root_.contains(e))return null;let n=new ge(this.id_,this.GenerateUniqueId("elscope_"),e,e===this.root_);this.elementScopes_[n.GetId()]=n,e[f]=n.GetId();let i=t=>{let n=V(e,[v().GetDirectiveName(t,!1),v().GetDirectiveName(t,!0)]);if(n){let t=S(n.name,n.value);t&&I(this,e,t)}};return["data","component","ref","locals","init"].forEach((e=>i(e))),n.SetInitialized(),"OnElementScopeCreated"in e&&"function"==typeof e.OnElementScopeCreated&&o((()=>e.OnElementScopeCreated({componentId:this.id_,component:this,scope:n}))),this.NotifyListeners_("element-scopes",this.elementScopes_),n}RemoveElementScope(e){delete this.elementScopes_[e],this.NotifyListeners_("element-scopes",this.elementScopes_)}FindElementScope(e){if("string"==typeof e)return e in this.elementScopes_?this.elementScopes_[e]:null;let t=!0===e?this.context_.Peek(_.self):e instanceof Node?e:this.root_;return t&&f in t&&"string"==typeof t[f]&&t[f]in this.elementScopes_?this.elementScopes_[t[f]]:null}FindElementLocal(e,t,n){let i=this.FindElementScope(e);if(null==i?void 0:i.HasLocal(t))return i;if(!n||!i&&"string"==typeof e)return null;let r=(null==i?void 0:i.GetElement())||(!0===e?this.context_.Peek(_.self):e instanceof Node?e:this.root_);if(!r)return null;let s=this.FindAncestor(r);return s?this.FindElementLocal(s,t,!0):null}FindElementLocalValue(e,t,n){let i=this.FindElementScope(e),r=i?i.GetLocal(t):je().CreateNothing();if(!je().IsNothing(r)||!n||!i&&"string"==typeof e)return r;let s=(null==i?void 0:i.GetElement())||(!0===e?this.context_.Peek(_.self):e instanceof Node?e:this.root_);if(!s)return r;let o=this.FindAncestor(s);return o?this.FindElementLocalValue(o,t,!0):r}SetElementLocalValue(e,t,n){var i;null===(i=this.FindElementScope(e))||void 0===i||i.SetLocal(t,n)}DeleteElementLocalValue(e,t){var n;null===(n=this.FindElementScope(e))||void 0===n||n.DeleteLocal(t)}AddProxy(e){this.proxies_[e.GetPath()]=e,this.NotifyListeners_("proxies",this.proxies_)}RemoveProxy(e){let t="string"==typeof e?e:e.GetPath();this.proxies_.hasOwnProperty(t)&&(delete this.proxies_[t],this.NotifyListeners_("proxies",this.proxies_))}GetRootProxy(){return this.rootProxy_}FindProxy(e){return e in this.proxies_?this.proxies_[e]:null}AddRefElement(e,t){this.refs_[e]=t,this.NotifyListeners_("refs",this.refs_)}FindRefElement(e){return e in this.refs_?this.refs_[e]:null}GetRefElements(){return this.refs_}AddAttributeChangeCallback(e,t){this.attributeObservers_.push({element:e,callback:t}),this.NotifyListeners_("attribute-observers",this.attributeObservers_)}RemoveAttributeChangeCallback(e,t){this.attributeObservers_=this.attributeObservers_.filter((n=>n.element!==e&&n.callback!==t)),this.NotifyListeners_("attribute-observers",this.attributeObservers_)}AddIntersectionObserver(e){this.observers_.intersections[e.GetId()]=e,this.NotifyListeners_("intersection-observers",this.observers_.intersections)}FindIntersectionObserver(e){return e in this.observers_.intersections?this.observers_.intersections[e]:null}RemoveIntersectionObserver(e){e in this.observers_.intersections&&(delete this.observers_.intersections[e],this.NotifyListeners_("intersection-observers",this.observers_.intersections))}GetBackend(){return{context:this.context_,changes:this.changes_}}GetGlobal(){return je()}}class Ee{constructor(){this.handlers_={}}AddHandler(e,t,n){let i="",r=null;"function"==typeof e?(i=t||"",r=e):(i=e.GetName(),r=t=>e.Handle(t)),i&&(this.handlers_[i]={callback:r,onAccess:n})}RemoveHandler(e){e in this.handlers_&&delete this.handlers_[e]}FindHandler(e,t){return e in this.handlers_?(t&&this.handlers_[e].onAccess&&this.handlers_[e].onAccess(t),this.handlers_[e].callback):null}}class Se{constructor(){if(this.uniqueMarkers_={level0:0,level1:0,level2:0},this.observer_=null,this.handlers_={},globalThis.MutationObserver)try{this.observer_=new globalThis.MutationObserver((e=>{let t={},n=e=>t[e]=t[e]||{added:new Array,removed:new Array,attributes:new Array};e.forEach((e=>{var t,i;if("childList"===(null==e?void 0:e.type)){let i=e=>{var t;let r=b((null===(t=Be(e))||void 0===t?void 0:t.GetRoot())||null);r?n(r).removed.push(e):Array.from(e.childNodes).filter((t=>!t.contains(e))).forEach(i)};e.removedNodes.forEach(i);let r=e.target instanceof HTMLElement?b((null===(t=Be(e.target))||void 0===t?void 0:t.GetRoot())||null):"";r&&n(r).added.push(...Array.from(e.addedNodes))}else if("attributes"===(null==e?void 0:e.type)&&e.attributeName){let t=e.target instanceof HTMLElement?b((null===(i=Be(e.target))||void 0===i?void 0:i.GetRoot())||null):"";t&&n(t).attributes.push({name:e.attributeName,target:e.target})}})),0!=Object.keys(t).length&&Object.entries(this.handlers_).forEach((([e,n])=>{let i=n.target instanceof HTMLElement?b(n.target):"";if(!i||!(i in t))return;let r=(e,t,n)=>!t.whitelist||t.whitelist.includes(e)?n:void 0,s=r("add",n,t[i].added),l=r("remove",n,t[i].removed),a=r("attribute",n,t[i].attributes);(s||l||a)&&o((()=>n.handler({id:e,added:s,removed:l,attributes:a})),"InlineJS.MutationObserver")}))})),this.observer_.observe(document,{childList:!0,subtree:!0,attributes:!0,characterData:!1})}catch(e){this.observer_=null}}GetNative(){return this.observer_}Observe(e,t,n){let i=ee(this.uniqueMarkers_);return this.handlers_[i]={target:e,handler:t,whitelist:n},i}Unobserve(e){"string"!=typeof e?Object.entries(this.handlers_).filter((([t,n])=>n.target===e)).forEach((([e])=>delete this.handlers_[e])):delete this.handlers_[e]}}class Pe{constructor(){if(this.observer_=null,this.handlers_=new Array,globalThis.MutationObserver)try{this.observer_=new globalThis.ResizeObserver(((e,t)=>{e.forEach((e=>{this.handlers_.filter((({target:t})=>t===e.target)).forEach((n=>{o((()=>n.handler({entry:e,observer:t})),"InlineJS.ResizeObserver")}))}))}))}catch(e){this.observer_=null}}GetNative(){return this.observer_}Observe(e,t,n){var i;this.handlers_.push({target:e,handler:t}),null===(i=this.observer_)||void 0===i||i.observe(e,n||{box:"border-box"})}Unobserve(e){var t;this.handlers_=this.handlers_.filter((t=>t.target===e)),null===(t=this.observer_)||void 0===t||t.unobserve(e)}}class xe extends z{constructor(e,t,n){super(e.GetComponentId(),n,t,e)}}function Ie(e,t){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";return Array.from({length:e||11},(()=>(t||n).charAt(Math.floor(Math.random()*(t||n).length)))).join("")}class ke{constructor({appName:e="",reactiveState:t="unoptimized",directivePrefix:n="x",elementPrefix:i,directiveRegex:r,directiveNameBuilder:s}={}){this.keyMap_={return:"enter",ctrl:"control",esc:"escape",space:" ",menu:"contextmenu",del:"delete",ins:"insert",plus:"+",minus:"-",star:"*",slash:"/",alpha:Array.from({length:26}).map(((e,t)=>String.fromCharCode(t+97))),digit:Array.from({length:10}).map(((e,t)=>t.toString()))},this.booleanAttributes_=new Array("allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"),globalThis.InlineJS=globalThis.InlineJS||{};let o=globalThis.InlineJS.config||{};o=M(o)?o:{},this.appName_=o.appName||e,this.reactiveState_=o.reactiveState||t,this.directivePrefix_=o.directivePrefix||n,this.elementPrefix_=o.elementPrefix||i||n,this.directiveRegex_=r||new RegExp(`^(data-)?${n||"x"}-(.+)$`),this.directiveNameBuilder_=s||((e,t=!1)=>t?`data-${this.directivePrefix_||"x"}-${e}`:`${this.directivePrefix_||"x"}-${e}`)}GetAppName(){return this.appName_}SetDirectivePrefix(e){this.directivePrefix_=e,this.directiveRegex_=new RegExp(`^(data-)?${e||"x"}-(.+)$`)}GetDirectivePrefix(){return this.directivePrefix_}SetElementPrefix(e){this.elementPrefix_=e}GetElementPrefix(){return this.elementPrefix_}GetDirectiveRegex(){return this.directiveRegex_}GetDirectiveName(e,t){return this.directiveNameBuilder_(e,t)}GetElementName(e){return`${this.elementPrefix_||this.directivePrefix_||"x"}-${e}`}AddKeyEventMap(e,t){this.keyMap_[e]=t}RemoveKeyEventMap(e){delete this.keyMap_[e]}MapKeyEvent(e){return e in this.keyMap_?this.keyMap_[e]:e}AddBooleanAttribute(e){this.booleanAttributes_.push(e)}RemoveBooleanAttribute(e){this.booleanAttributes_=this.booleanAttributes_.filter((t=>t!==e))}IsBooleanAttribute(e){return this.booleanAttributes_.includes(e)}SetReactiveState(e){this.reactiveState_=e}GetReactiveState(){return this.reactiveState_}}class Oe{Get(e,t){return fetch(e,t)}}class Ge extends ne{constructor(e,t=0){super(),this.nothing_=new a,this.storedObjects_={},this.lastStoredObjectKey_="",this.componentsMonitorList_=new Array,this.components_={},this.currentComponent_=new i,this.attributeProcessors_=new Array,this.textContentProcessors_=new Array,this.customElements_={},this.managers_={directive:new ue,magic:new Ee},this.uniqueMarkers_={level0:0,level1:0,level2:0},this.mutationObserver_=new Se,this.resizeObserver_=new Pe,this.nativeFetch_=new Oe,this.fetchConcept_=null,this.concepts_={},this.config_=new ke(e||{}),this.uniqueMarkers_.level0=t||0}SwapConfig(e){this.NotifyListeners_("config",this.config_=e)}GetConfig(){return this.config_}GenerateUniqueId(e,t){const n=ee(this.uniqueMarkers_,"",e,t);return this.NotifyListeners_("unique-markers",this.uniqueMarkers_),n}StoreObject({object:e,componentId:t,contextElement:n}){var i;if(this.lastStoredObjectKey_=`@!@${Ie(18)}@!@`,n){let r=null===(i=this.FindComponentById(t||"")||this.InferComponentFrom(n))||void 0===i?void 0:i.FindElementScope(n);if(r)return r.SetLocal(this.lastStoredObjectKey_,e),this.lastStoredObjectKey_}return this.storedObjects_[this.lastStoredObjectKey_]=e,this.NotifyListeners_("stored-objects",this.storedObjects_),this.lastStoredObjectKey_}RetrieveObject(e){return this.RetrieveObject_(e,!0)}PeekObject(e){return this.RetrieveObject_(e,!1)}GetLastObjectKey(){return this.lastStoredObjectKey_}AddComponentMonitor(e){this.componentsMonitorList_.push(e),this.NotifyListeners_("components-monitors",this.componentsMonitorList_)}RemoveComponentMonitor(e){let t=this.componentsMonitorList_.length;this.componentsMonitorList_=this.componentsMonitorList_.filter((t=>t!==e)),t!=this.componentsMonitorList_.length&&this.NotifyListeners_("components-monitors",this.componentsMonitorList_)}CreateComponent(e){let t=this.InferComponentFrom(e);if(t)return t;let n=new Ae(this.GenerateUniqueId(),e);return this.components_[n.GetId()]=n,this.componentsMonitorList_.forEach((e=>o((()=>e({action:"add",component:n})),"InlineJS.Global.CreateComponent"))),this.NotifyListeners_("components",this.components_),n}RemoveComponent(e){let t="string"==typeof e?e:e.GetId();if(this.components_.hasOwnProperty(t)){let e=this.components_[t];delete this.components_[t],this.componentsMonitorList_.slice(0).forEach((t=>o((()=>t({action:"remove",component:e})),"InlineJS.Global.RemoveComponent"))),this.NotifyListeners_("components",this.components_)}}TraverseComponents(e){Object.values(this.components_).some((t=>!1===e(t)))}FindComponentById(e){return e&&e in this.components_?this.components_[e]:null}FindComponentByName(e){return e&&Object.values(this.components_).find((t=>t.GetName()===e))||null}FindComponentByRoot(e){return e&&Object.values(this.components_).find((t=>t.GetRoot()===e))||null}PushCurrentComponent(e){this.currentComponent_.Push(e),this.NotifyListeners_("current-component",this.currentComponent_)}PopCurrentComponent(){let e=this.currentComponent_.IsEmpty(),t=this.currentComponent_.Pop();return!e&&this.NotifyListeners_("current-component",this.currentComponent_),t}PeekCurrentComponent(){return this.currentComponent_.Peek()}GetCurrentComponent(){return this.FindComponentById(this.PeekCurrentComponent()||"")}InferComponentFrom(e){return e&&Object.values(this.components_).find((t=>t.GetRoot()===e||t.GetRoot().contains(e)))||null}GetDirectiveManager(){return this.managers_.directive}GetMagicManager(){return this.managers_.magic}AddAttributeProcessor(e){this.attributeProcessors_.push(e),this.NotifyListeners_("attribute-processors",this.attributeProcessors_)}DispatchAttributeProcessing(e){this.attributeProcessors_.forEach((t=>o((()=>t(e)),"InlineJS.Global.DispatchAttribute",e.contextElement)))}AddTextContentProcessor(e){this.textContentProcessors_.push(e),this.NotifyListeners_("text-content-processors",this.textContentProcessors_)}DispatchTextContentProcessing(e){this.textContentProcessors_.forEach((t=>o((()=>t(e)),"InlineJS.Global.DispatchTextContent",e.contextElement)))}GetMutationObserver(){return this.mutationObserver_}GetResizeObserver(){return this.resizeObserver_}SetFetchConcept(e){this.fetchConcept_=e,this.NotifyListeners_("fetch-concept",this.fetchConcept_)}GetFetchConcept(){return this.fetchConcept_||this.nativeFetch_}SetConcept(e,t){this.concepts_[e]=t,this.NotifyListeners_("concepts",this.concepts_)}RemoveConcept(e){delete this.concepts_[e],this.NotifyListeners_("concepts",this.concepts_)}GetConcept(e){return this.concepts_.hasOwnProperty(e)?this.concepts_[e]:null}AddCustomElement(e,t){this.customElements_.hasOwnProperty(e)||(this.customElements_[e]=t,customElements.define(this.config_.GetElementName(e),t),this.NotifyListeners_("custom-elements",this.customElements_))}FindCustomElement(e){return this.customElements_.hasOwnProperty(e)?this.customElements_[e]:null}CreateChildProxy(e,t,n){return new xe(e,t,n)}CreateFuture(e){return new r(e)}IsFuture(e){return e instanceof r}CreateNothing(){return this.nothing_}IsNothing(e){return e instanceof a}RetrieveObject_({key:e,componentId:t,contextElement:n},i){if(n){let r=this.FindComponentById(t||"")||this.InferComponentFrom(n);if(r){let t=r.FindElementLocal(n,e,!0);if(t){const n=t.GetLocal(e);return i&&(t.DeleteLocal(e),e===this.lastStoredObjectKey_&&(this.lastStoredObjectKey_="")),n}}}if(this.storedObjects_.hasOwnProperty(e)){const t=this.storedObjects_[e];return i&&(e===this.lastStoredObjectKey_&&(this.lastStoredObjectKey_=""),delete this.storedObjects_[e],this.NotifyListeners_("stored-objects",this.storedObjects_)),t}return this.CreateNothing()}}const Re="__InlineJS_GLOBAL_KEY__";function we(e,t=0){return De(),globalThis[Re]=new Ge(e,t),(globalThis.InlineJS=globalThis.InlineJS||{}).global=globalThis[Re],window.dispatchEvent(new CustomEvent(Fe)),globalThis[Re]}function Ne(e,t=0){return je()||we(e,t)}const Fe="inlinejs.global.created";function je(){return globalThis[Re]}function Le(){return je()?Promise.resolve():new Promise((e=>window.addEventListener(Fe,e)))}const Te="InlineJS_Comp_Cache";function De(){u(Te,{id:"",component:null})}function Me(e){let t=h(Te,{id:"",component:null});return e===t.id||(t.component=je().FindComponentById(e),t.id=t.component?e:""),t.component}function $e(e){return je().FindComponentByName(e)}function He(e){return je().FindComponentByRoot(e)}function Be(e){let t=b(e).match(/^Cmpnt\<([0-9_]+)\>/);return t?Me(t[1]):null}var Je=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function ze(e){var{key:t}=e,n=Je(e,["key"]);let i=je().RetrieveObject(Object.assign({key:t},n));return je().IsNothing(i)?t:i}function We(e){var{key:t}=e,n=Je(e,["key"]);let i=je().PeekObject(Object.assign({key:t},n));return je().IsNothing(i)?t:i}function qe(e,t,n){var i;return ze({key:e,componentId:t||(n?null===(i=Be(n))||void 0===i?void 0:i.GetId():void 0),contextElement:n})}function Ue(e){return e=L(e),je().IsFuture(e)?Ue(e.Get()):!e&&!1!==e&&0!==e||je().IsNothing(e)?"":"boolean"==typeof e||"number"==typeof e||"string"==typeof e?e.toString():JSON.stringify(e)}function Ke(e,t,n){const i=t&&q(e)?e.getAttribute(t):null;return i?qe(i,n,e):Ue(i)}function Ve(e,t,n){var i;return null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e?Ue(e):je().StoreObject({object:e,componentId:t||(n?null===(i=Be(n))||void 0===i?void 0:i.GetId():void 0),contextElement:n})}function Ye(e,t,n,i){(!t||!q(e))&&e.setAttribute(t,Ve(n,i,e))}function Ze(e,t=!1){return new RegExp(`${e}$`,t?"i":void 0)}function Qe(e,t){for(let n=e.parentNode;n;n=n.parentNode)try{if(n instanceof HTMLElement&&t(n))return n}catch(e){break}return null}function Xe(e,t){return Qe(e,(e=>e.classList.contains(t)))}function et(e,t){return Qe(e,(e=>e.hasAttribute(t)))}function tt(e,t,n){return Qe(e,(e=>e.getAttribute(t)===n))}function nt(e,t){return Qe(e,(e=>e.tagName.toLowerCase()===t.toLowerCase()))}function it(e){let t=globalThis.InlineJS=globalThis.InlineJS||{};return(e=e.trim())&&e.split(".").forEach((e=>{t=t[e]=t[e]||{}})),t}function rt(e,t){let n=it(e);Object.entries(t).forEach((([e,t])=>n[e]=t))}function st(e,t){if(e.hasOwnProperty("IsBooleanAttribute")&&"function"==typeof e.IsBooleanAttribute){let n=e.IsBooleanAttribute(t);if(!1===n||!0===n)return n}return je().GetConfig().IsBooleanAttribute(t)}function ot(e,t,n=!0){let[i,r]=n?T([e,t]):[e,t];if(i===r)return!0;if(Array.isArray(i)&&Array.isArray(r))return i.length==r.length&&-1==i.findIndex(((e,t)=>!ot(e,r[t],n)));if($([i,r])){let e=Object.keys(i),t=Object.keys(r);return e.length==t.length&&-1==e.findIndex((e=>!t.includes(e)||!ot(i[e],r[e],n)))}return i==r}function lt(e,t,n,i,r){let s=!1,a=()=>s=!0,c=0,u=e=>t?Math.floor(e/t):e,h=performance.now(),d=h,p=(l,m,_)=>{if(s)return;let f=_-h;if(r&&f>=r)if(n&&(n<0||c<n)){let t=f-r;i>0&&t<i?setTimeout((()=>{h=performance.now(),e(p.bind(null,l,m))}),i-t):e(p.bind(null,l,m)),c+=1,h=_,d=_}else o((()=>m({repeats:c,steps:r?u(r):-1,elapsed:f,duration:r})));else{e(p.bind(null,l,m));let n=_-d;n>=t&&(d=_+(t?n%t:n),o((()=>l({repeats:c,steps:u(f),elapsed:f,duration:r,abort:a}))))}};return new l(((t,n)=>{e(p.bind(null,t,n))}))}const at=[50,40,30,25,20,15,10,5,4,3,2,1,0];function ct(e,t=1e3,n=0,i=0,r=!0){let s=0,o=Math.floor(t/2.2);for(let e of at)if(e<=o){s=e;break}return lt((e=>setTimeout((()=>{r?requestAnimationFrame(e):e(performance.now())}),s)),t,n,i,e)}function ut(e,t=1e3,n=0,i=0){return lt(requestAnimationFrame,t,n,i,e)}function ht(e){let t=performance.now();return e(),performance.now()-t}function dt(e){return(e=e?e.trim():"")?(!(e=e.replace(/[?][?&=\/]+/g,"?").replace(/[&][?&=\/]+/g,"&").replace(/[=][?=\/]+/g,"=").replace(/[\/][\/=]+/g,"/").replace(/[:]{2,}/g,":").replace(/[:][\/]([^\/])/g,"://$1").replace(/[\/?&=]+$/,"")).startsWith("/?")&&(e=e.replace(/^[\/?&=]+/,"")),e.split(/[?&]/).reduce(((e,t,n)=>e?`${e}${n<2?"?":"&"}${t}`:t),"")):""}function pt(e,t,n){return(e=dt(e))===t?(e=n&&n||"/").startsWith("/")?e:`/${e}`:(e.startsWith(`${t}/`)&&(e=e.substring(t.length)),/^[a-zA-Z0-9_]+:\/\//.test(e)?e:(n&&(e=e.startsWith("/")?`${n}${e}`:`${n}/${e}`),e.startsWith("/")?e:`/${e}`))}function mt(e,t,n){let i=(e=t?pt(e,t,n):e).indexOf("?");return{base:-1==i?e:e.substring(0,i),query:-1==i?"":e.substring(i+1)}}function _t({base:e,query:t},n,i,r){let s=`${dt(e)}?${t}`;return s=n?pt(s,n,i):dt(s),s=r?dt(`${n}/${s}`):s.startsWith("/")||/^[a-zA-Z0-9_]+:\/\//.test(s)?s:`/${s}`,s}function ft(e,t,n){t&&q(e)&&e.setAttribute(t,n)}function bt(e,t="-"){t=t||"-";let n=e.replace(/([A-Z]+)/g,(e=>`${t}${e.toLowerCase()}`));return n.startsWith(t)?n.substring(1):n}var vt=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function yt({target:e,getter:t,setter:n,deleter:i,lookup:r,alert:s}){let o={get(e,n){var i;if("symbol"==typeof n||"string"==typeof n&&"prototype"===n)return Reflect.get(e,n);let r=t?t(n.toString(),e):e[n];return je().IsNothing(r)?Reflect.get(e,n):(!s||s.list&&!(n in s.list)||null===(i=Me(s.componentId))||void 0===i||i.GetBackend().changes.AddGetAccess(`${s.id}.${n}`),r)},set:(e,t,i)=>"symbol"==typeof t||"string"==typeof t&&"prototype"===t?Reflect.set(e,t,i):n?!1!==n(t.toString(),i,e):!!e[t]||!0,deleteProperty:(e,t)=>"symbol"==typeof t||"string"==typeof t&&"prototype"===t?Reflect.deleteProperty(e,t):i?!1!==i(t.toString(),e):!!delete e[t]||!0,has:(e,t)=>!!Reflect.has(e,t)||(Array.isArray(r)?r.includes(t.toString()):r?r(t.toString(),e):t in e)};return new window.Proxy(e||{},o)}function gt(e){return yt(Et({getter:t=>t&&t in e&&e[t]||null,lookup:[...Object.keys(e)]}))}function Ct(){return!1}function At(e){var{setter:t,deleter:n,lookup:i}=e,r=vt(e,["setter","deleter","lookup"]);return Object.assign(Object.assign({},r),{setter:t||Ct,deleter:n||Ct,lookup:i||Ct})}function Et(e){return At(e)}const St="InlineJS_ProxyGlobal";function Pt(e,t,n){let i=null==t?void 0:t.FindElementScope(n),r=null==i?void 0:i.GetId();if(!r)return["",null,null];let s=globalThis[St]=globalThis[St]||{},o=s[e]=s[e]||{};return r in o?[r,o[r],o]:(null==i||i.AddUninitCallback((()=>delete o[r])),[r,null,o])}function xt(e,t,n){if(!(e instanceof Promise))return t(e);n?e.then((e=>xt(e,t,!0))):e.then(t)}const It="__InlineJS_Context__",kt="InlineJS_Func_Cache";function Ot(e,t,n,i=!1){let r=p(kt,t);if(r)return r;try{let n=new Function(It,`\n with (${It}){\n ${e(t)};\n };\n `);return d(kt,t,n,{}),n}catch(e){if(i||!(e instanceof SyntaxError))return void s(e,`InlineJs.Region<${n||"NIL"}>.GenerateFunction`)}return null}function Gt(e,t,n=!1){return Ot((e=>`return (${e})`),e,t,n)}function Rt(e,t,n=!1){return Ot((e=>e),e,t,n)}function wt(e,t,n,i=[]){var r;if("function"==typeof e){let s=Me(n||""),o=null==s?void 0:s.FindProxy(null==s?void 0:s.GetBackend().changes.GetLastAccessContext()),l=e.apply((null===(r=o||(null==s?void 0:s.GetRootProxy()))||void 0===r?void 0:r.GetNative())||null,i||[]);return t?t(l):l}return t?t(e):e}function Nt({componentId:e,contextElement:t,expression:n,disableFunctionCall:i=!1,waitPromise:r="recursive",voidOnly:o}){let l=e=>(e&&e(null),null);if(!(n=n.trim()))return l;let a=o?null:Gt(n,e),c=!1;if(void 0===a)return l;if(!a&&(c=!0),!a&&!(a=Rt(n,e,!0)))return l;let u=(o,l,a,c,u=!0,h)=>{var d;let p=Me(e),m=null==p?void 0:p.GetRootProxy().GetNative();if(!m||(null===(d=null==p?void 0:p.FindElementScope(t))||void 0===d?void 0:d.IsDestroyed()))return;let{context:f=null,changes:b=null}=(null==p?void 0:p.GetBackend())||{};null==f||f.Push(_.self,t),null==b||b.ResetLastAccessContext(),ie(e),Object.entries(c||{}).forEach((([e,t])=>null==f?void 0:f.Push(e,t)));try{let t=l(m);if(je().IsFuture(t)&&(t=t.Get()),!o)return i?t:wt(t,o,e,a);let n=e=>{if(e&&"none"!==r)return xt(e,o,"recursive"===r),h||"Loading data...";o(e)};i?n(t):wt(t,n,e,a)}catch(t){if(u&&t instanceof SyntaxError)throw t;s(t,`InlineJs.Region<${e}>.RunFunction('${n}')`)}finally{Object.entries(c||{}).forEach((([e,t])=>null==f?void 0:f.Pop(e,t))),re(),null==f||f.Pop(_.self)}};return(i,r=[],o,h)=>{try{return u(i,a.bind(t),r||[],o||{},void 0,h)}catch(h){if(h instanceof SyntaxError&&!c)return c=!0,a=Rt(n,e,!0),a?u(i,a.bind(t),r||[],o||{},!1):l(i);s(h,`InlineJs.Region<${e}>.RunFunction('${n}')`)}return l(i)}}function Ft(e){return Nt(e)}function jt(e,t){let n=(e,t)=>xt(e,t,!0);return e instanceof l?new l(((i,r)=>{e.While((e=>{n(e,(e=>{n(t(e),(e=>i(e)))}))})),e.Final((e=>{n(e,(e=>{n(t(e),(e=>r(e)))}))}))})):e instanceof Promise?new Promise((i=>{n(e,(e=>{n(t(e),(e=>i(e)))}))})):t(e)}function Lt(e,t,n){e instanceof l?e.While(t).Final(!1===n?()=>{}:n||t):t(e)}function Tt({componentId:e,changes:t,callback:n,subscriptionsCallback:i,contextElement:r}){var o,l,a,c;t.PopAllGetAccessStorageSnapshots(!1),t.RestoreOptimizedGetAccessStorage();let{optimized:u,raw:h}=t.PopGetAccessStorage();if(0==((null===(o=u||h)||void 0===o?void 0:o.entries.length)||0))return i&&i({}),null;let d={},p=()=>{Object.keys(d).map((e=>Me(e))).filter((e=>!!e)).forEach((e=>{let{changes:t}=e.GetBackend();d[e.GetId()].forEach((e=>t.Unsubscribe(e)))})),d={}},m=!1,_=()=>{m=!0},f=t=>{let i=Me(e);if(!i||m)return void p();let{changes:r}=i.GetBackend();r.PushOrigin(f);try{n({changes:t||[],cancel:_})}catch(t){s(t,`InlineJS.Component<${e}>.SubscribeToChanges.OnChange`)}r.PopOrigin(),m&&p()},b={};return null===(l=u||h)||void 0===l||l.entries.forEach((e=>(b[e.path]=b[e.path]||{})[e.compnentId]=!0)),Object.entries(b).forEach((([e,t])=>{Object.keys(t).map((e=>Me(e))).filter((e=>!!e)).forEach((t=>{(d[t.GetId()]=d[t.GetId()]||[]).push(t.GetBackend().changes.Subscribe(e,f))}))})),r&&(null===(c=null===(a=Me(e))||void 0===a?void 0:a.FindElementScope(r))||void 0===c||c.AddUninitCallback((()=>{_(),p()}))),i&&i(d),p}function Dt({componentId:e,callback:t,contextElement:n,options:i,subscriptionsCallback:r}){var o;let l=()=>{let i=Me(e);if(!i)return;let{changes:o}=i.GetBackend(),l=!1,a=n?i.FindElementScope(n):null,c=()=>{l=!0},u=null==a?void 0:a.GetElement();try{o.PushGetAccessStorage(),t({changes:[],cancel:c})}catch(t){s(t,`InlineJS.Component<${e}>.UseEffect`,u)}if(l)return o.PopAllGetAccessStorageSnapshots(!1),o.RestoreOptimizedGetAccessStorage(),void o.PopGetAccessStorage();Tt({componentId:e,changes:o,callback:t,subscriptionsCallback:r,contextElement:u})};(null==i?void 0:i.nextTick)?null===(o=Me(e))||void 0===o||o.GetBackend().changes.AddNextTickHandler(l):l()}function Mt(e,t,n,i={}){var r;let s=null;if(s=e instanceof HTMLElement?(null===(r="string"==typeof n?Me(n):n)||void 0===r?void 0:r.FindElementScope(e))||null:e,!s)return i;let o=s.GetLocal(t);return je().IsNothing(o)&&s.SetLocal(t,o=i),o}const $t="__InlineJS_GLOBAL_COMPONENT_KEY__";function Ht(e){let t=globalThis[$t];if(t||!1===e)return t.component;let n=document.createElement("template");return globalThis[$t]={root:n,component:je().CreateComponent(n)},globalThis[$t]}const Bt=300,Jt=0,zt=0;function Wt(e,t){if(!e||je().IsNothing(e)||e.allowed&&"both"!==e.allowed&&e.allowed!==(t?"reversed":"normal"))return null;let n=je().GetConcept("animation");return{ease:e.ease||(null==n?void 0:n.GetEaseCollection().Find("default"))||null,actor:e.actor||(null==n?void 0:n.GetActorCollection().Find("default"))||null,duration:e.duration||Bt,delay:e.delay||Jt,repeats:e.repeats||zt,allowed:e.allowed||"both"}}function qt({componentId:e,contextElement:t,target:n,callback:i,onAbort:r,onPass:s,reverse:l,allowRepeats:a,restore:c}){var u,h,d,p;let m=n||t;if("WaitTransition"in m&&"function"==typeof m.WaitTransition)return m.WaitTransition({componentId:e,contextElement:t,target:n,callback:i,onAbort:r,reverse:l,allowRepeats:a});let _=Wt((null===(h=null===(u=Me(e))||void 0===u?void 0:u.FindElementScope(t))||void 0===h?void 0:h.GetData("transition"))||null,l||!1);if(!_||!_.actor||!_.ease||"number"!=typeof _.duration||_.duration<=0)return i(!1),null;let f=e=>{var t;return"function"==typeof(null==_?void 0:_.actor)?null==_?void 0:_.actor(e):_&&(null===(t=_.actor)||void 0===t?void 0:t.Handle(e))},b=e=>{var t;return"function"==typeof _.ease?_.ease(e):_&&(null===(t=_.ease)||void 0===t?void 0:t.Handle(e))||0},v=!1,y=()=>v=!0,g=0,C=e=>l?1-e:e,A=()=>{var n,i;return null===(i=null===(n=Me(e))||void 0===n?void 0:n.FindElementScope(t))||void 0===i||i.RemoveUninitCallback(y),m.dispatchEvent(new CustomEvent("transition.canceled")),r&&o((()=>r())),!1},E=(e,t,n)=>{s&&o((()=>s({duration:_.duration,elapsed:t,fraction:n,target:m,stage:e})))};null===(p=null===(d=Me(e))||void 0===d?void 0:d.FindElementScope(t))||void 0===p||p.AddUninitCallback(y);const S=_.duration,P=e=>{const t=C(e/S),n=b({duration:S,elapsed:e,fraction:t}),i=0==g++?"start":"middle";f({duration:S,elapsed:e,fraction:n,elapsedFraction:t,stage:i,restore:c,target:m,reverse:!!l}),E(i,e,n)};return P(0),ut(S,0,a?_.repeats:0,_.delay).While((({elapsed:e})=>{if(v)return A();0==g&&(m.style.transform="",m.style.transformOrigin="50% 50%",m.dispatchEvent(new CustomEvent("transition.enter"))),P(e)})).Final((()=>{if(v)A();else{const e=C(1);f({duration:S,elapsedFraction:e,elapsed:S,target:m,stage:"end",fraction:b({duration:_.duration,elapsed:_.duration,fraction:e}),reverse:!!l}),E("end",_.duration,e),m.dispatchEvent(new CustomEvent("transition.leave")),o((()=>i(!0)))}})),y}function Ut({element:e,html:t,type:n="replace",component:i,processDirectives:r=!0,afterRemove:s,afterInsert:l,afterTransitionCallback:a,transitionScope:c}){let u="string"==typeof i?i:(null==i?void 0:i.GetId())||"",h=()=>{let i=document.createElement("template");i.innerHTML=t,"replace"===n||"append"===n?e.append(...Array.from(i.content.childNodes)):"prepend"===n&&e.prepend(...Array.from(i.content.childNodes)),l&&o(l,"InlineJS.InsertHtml",e);let s=Me(u);r&&s&&Array.from(e.children).forEach((e=>R({component:s,element:e,options:{checkTemplate:!0,checkDocument:!0,ignoreChildren:!1}}))),a&&((c||e).dispatchEvent(new CustomEvent("html.transition.begin",{detail:{insert:!0}})),qt({componentId:u,contextElement:c||e,target:e,callback:()=>{(c||e).dispatchEvent(new CustomEvent("html.transition.end",{detail:{insert:!0}})),a()}}))};if("replace"===n&&0!=e.childNodes.length){let t=e=>{let n=Me(u),i=je();Array.from(e.children).forEach((e=>{var r;let s=null==n?void 0:n.FindElementScope(e);s||(s=null===(r=i.InferComponentFrom(e))||void 0===r?void 0:r.FindElementScope(e))?s.Destroy():t(e)}))},n=()=>{t(e),Array.from(e.childNodes).forEach((e=>e.remove())),s&&o(s,"InlineJS.InsertHtml",e)};a?((c||e).dispatchEvent(new CustomEvent("html.transition.begin",{detail:{insert:!1}})),qt({componentId:u,contextElement:c||e,target:e,reverse:!0,callback:()=>{(c||e).dispatchEvent(new CustomEvent("html.transition.end",{detail:{insert:!1}})),n(),h()}})):(n(),h())}else h()}class Kt{constructor(e,t,n=!1){this.componentId_=e,this.callback_=t,this.initialized_=n,this.queued_=!1,this.setCallback_=null}Queue(e){var t;let n=()=>(this.setCallback_||e||this.callback_)&&(this.setCallback_||e||this.callback_)();!this.queued_&&this.initialized_?(this.queued_=!0,this.ListenNext_(null===(t=Me(this.componentId_))||void 0===t?void 0:t.GetBackend().changes,(()=>{this.queued_=!1,n()}))):this.initialized_?this.setCallback_=e||null:(this.initialized_=!0,n())}ListenNext_(e,t){}}class Vt extends Kt{constructor(e,t,n=!1){super(e,t,n)}ListenNext_(e,t){null==e||e.AddNextIdleHandler(t)}}class Yt extends Kt{constructor(e,t,n=!1){super(e,t,n)}ListenNext_(e,t){null==e||e.AddNextNonIdleHandler(t)}}class Zt extends Kt{constructor(e,t,n=!1){super(e,t,n)}ListenNext_(e,t){null==e||e.AddNextTickHandler(t)}}var Qt=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};const Xt=/\{\{\s*(.+?)\s*\}\}/g,en=/\{\{.+?\}\}/;function tn(e){let t=e=>[...e.childNodes].reduce(((e,t)=>`${e}${3!=t.nodeType?n(t):t.textContent||""}`),""),n=e=>`${[...e.attributes].reduce(((e,t)=>`${e} ${t.name}="${t.value}"`),`<${e.tagName.toLowerCase()}`)+">"}${t(e)}</${e.tagName.toLowerCase()}>`;return t(e)}function nn({componentId:e,contextElement:t,text:n,handler:i,testRegex:r,matchRegex:s,storeObject:o}){var l;let a=null,c=null;if(o){const o=n.trim();let l=(o.match(r||en)||[])[0];l&&l===o&&(l=l.replace(s||Xt,"$1").trim(),a=l?Ft({componentId:e,contextElement:t,expression:`return (${l});`,voidOnly:!0}):e=>e&&e(""),c=n=>i(Ve(n,e,t)))}a||(n=JSON.stringify(n).replace(s||Xt,'"+($1)+"').replace(/"\+\(\s*\)\+"/g,""),a=Ft({componentId:e,contextElement:t,expression:`let output = ${n}; return output;`})),null===(l=Me(e))||void 0===l||l.CreateElementScope(t),Dt({componentId:e,contextElement:t,callback:()=>a(c||i)})}function rn(e){var{text:t,testRegex:n,matchRegex:i}=e,r=Qt(e,["text","testRegex","matchRegex"]);(n||i||en).test(t)&&nn(Object.assign({text:t,testRegex:n,matchRegex:i},r))}function sn({componentId:e,contextElement:t,text:n,handler:i,testRegex:r,matchRegex:s}){if("string"==typeof n)return i&&rn({componentId:e,contextElement:t,text:n,handler:i,testRegex:r,matchRegex:s});if(!(r||s||en).test(t.textContent||""))return;let l=new Array,a=new Array,c=!1;[...t.childNodes].forEach((n=>{if(3==n.nodeType&&n.textContent&&en.test(n.textContent)){let i={text:n.textContent||"",evaluated:n.textContent||""};l.push(i),a.push((()=>nn({componentId:e,contextElement:t,text:i.text,handler:e=>{i.evaluated=e,c||(c=!0,queueMicrotask((()=>{c=!1,o((()=>(()=>{for(;t.firstChild;)t.firstChild.remove();let e=null;l.forEach((n=>{let i=n instanceof Element?n:document.createTextNode("string"==typeof n?n:n.evaluated);e?t.insertBefore(i,e):t.append(i),e=i}))})()),"InlineJS.Interpolate",t)})))},testRegex:r,matchRegex:s})))}else 3==n.nodeType?l.push(n.textContent||""):l.push(n)})),l.reverse(),a.forEach((e=>o(e,"InlineJS.Interpolate",t)))}function on({componentId:e,contextElement:t,name:n,value:i}){rn({componentId:e,contextElement:t,text:i,handler:e=>t.setAttribute(n,e),storeObject:!0})}function ln({componentId:e,contextElement:t}){sn({componentId:e,contextElement:t})}function an(e){const t=e&&Be(e);if(t)return void R({component:t,element:e});const n=je(),i=n.GetConfig();[i.GetDirectiveName("data",!0),i.GetDirectiveName("data",!1)].forEach((t=>{(e||document).querySelectorAll(`[${t}]`).forEach((e=>{e.hasAttribute(t)&&document.contains(e)&&R({component:n.CreateComponent(e),element:e,options:{checkTemplate:!0,checkDocument:!1,ignoreChildren:!1}})}))}))}function cn(e){Ne(),globalThis.InlineJS=globalThis.InlineJS||{},globalThis.InlineJS.hasOwnProperty("disableAutoBootstrap")&&globalThis.InlineJS.disableAutoBootstrap||setTimeout((()=>{"loading"==document.readyState?document.addEventListener("DOMContentLoaded",(()=>{an(e)})):an(e)}),0)}function un(e,t){let n="",i=null;if("function"==typeof e){let t=e();t?({name:n,callback:i}=t):(n=e("name"),i=e("callback"))}else M(e)?({name:n,callback:i}=e):je().GetDirectiveManager().AddHandler(e);n&&i&&(t?je().GetDirectiveManager().AddHandlerExtension(t,i,n):je().GetDirectiveManager().AddHandler(i,n))}function hn(e,t){return{name:e,callback:t}}function dn(e,t,n,i,r){let s=je().GetConfig().GetDirectiveName("on"),o=(r||[]).join("."),l=S(o?`${s}:${n}.${o}`:`${s}:${n}`,i||"");return!!l&&I(e,t,l)}const pn=["bind","event","on"];function mn({component:e,contextElement:t,key:n,event:i,expression:r,options:s,defaultEvent:o,eventWhitelist:l=[],optionBlacklist:a}){let c=()=>a?null==s?void 0:s.filter((e=>!a.includes(e))):s,u=e=>n?`${n}-${e}.join`:e;return l.includes(i)?dn(e,t,u(i),r,c()):!(!o||i!==o&&!pn.includes(i))&&dn(e,t,u(o),r,c())}function _n(e,t,n){let i=je().GetConfig().GetDirectiveName(t,!1),r=je().GetConfig().GetDirectiveName(t,!0);return e.getAttribute(i)||e.getAttribute(r)||n&&e.getAttribute(n)||null}function fn({componentId:e,contextElement:t,key:n,expression:i,callback:r,arrayCallback:s,useEffect:o=!0}){let l=0,a=Ft({componentId:e,contextElement:t,expression:i}),c=(e,t)=>{jt(e,(e=>{t==l&&(n?r([n,e]):M(e)?Object.entries(e).forEach(r):s&&("string"==typeof e||Array.isArray(e))&&s("string"==typeof e?e.trim().split(" ").filter((e=>!!e)):e))}))};o?Dt({componentId:e,contextElement:t,callback:()=>a((e=>c(e,++l)))}):a((e=>c(e,l)))}const bn=Array.from(Array(100).keys()).map((e=>e/100));function vn(e){let t={root:null,rootMargin:"0px",threshold:0};return M(e)&&Object.entries(t).forEach((([n,i])=>t[n]=n in e&&e[n]||i)),e.spread&&(t.threshold=bn),t}class yn{constructor(e,t){this.id_=e,this.observer_=null,this.handlers_=new Array;let n=this.id_;this.observer_=new globalThis.IntersectionObserver(((e,t)=>{e.forEach((e=>{this.handlers_.filter((({target:t})=>t===e.target)).forEach((i=>{o((()=>i.handler({entry:e,id:n,observer:t})),"InlineJS.IntersectionObserver")}))}))}),vn(t))}GetId(){return this.id_}GetNative(){return this.observer_}Observe(e,t){var n;this.handlers_.push({target:e,handler:t}),null===(n=this.observer_)||void 0===n||n.observe(e)}Unobserve(e){var t;this.handlers_=this.handlers_.filter((t=>t.target===e)),null===(t=this.observer_)||void 0===t||t.unobserve(e)}}function gn(e,t=0){return e&&e.match(/^[0-9]+(s|ms)?$/)?-1==e.indexOf("m")&&-1!=e.indexOf("s")?1e3*parseInt(e):parseInt(e):t}function Cn({options:e,list:t,defaultNumber:n,callback:i,unknownCallback:r}){let s=Array.isArray(e)?e:[e],o=e=>("number"==typeof n?n:n&&n(e))||0;return t.forEach(((n,l)=>{let a=s.find((e=>e&&n in e));if(!a)return r&&r({options:e,list:t,option:n,index:l});i&&!0===i({options:e,list:t,option:n,index:l})||("number"==typeof a[n]?l<t.length-1?a[n]=gn(t[l+1].trim(),o(n)):a[n]=o(n):"boolean"==typeof a[n]&&(a[n]=!0))})),e}function An({componentId:e,component:t,contextElement:n,expression:i,argOptions:r,callback:s,options:o,defaultOptionValue:l,useEffect:a}){let c=Ft({componentId:e,contextElement:n,expression:i}),u=Cn({options:o||{lazy:!1,ancestor:-1,threshold:-1},list:r,defaultNumber:0===l?0:l||-1}),h=()=>c((e=>xt(e,s))),d=()=>!1===a?h():Dt({componentId:e,contextElement:n,callback:h});if(u.lazy){let i=t||Me(e),r={root:u.ancestor<0?null:null==i?void 0:i.FindAncestor(n,u.ancestor),threshold:u.threshold<0?0:u.threshold},s=i?new yn(i.GenerateUniqueId("intob_"),r):null;s?(null==i||i.AddIntersectionObserver(s),s.Observe(n,(({id:t,entry:n}={})=>{var i;(null==n?void 0:n.isIntersecting)&&(null===(i=Me(e))||void 0===i||i.RemoveIntersectionObserver(t),d())}))):d()}else d()}function En(e){let t,n="",i=null;if("function"==typeof e){let r=e();r?({name:n,callback:i,onAccess:t}=r):(n=e("name"),i=e("callback"),t=e("access"))}else M(e)?({name:n,callback:i,onAccess:t}=e):je().GetMagicManager().AddHandler(e);n&&i&&je().GetMagicManager().AddHandler(i,n,t)}function Sn(e,t,n){return{name:e,callback:t,onAccess:n}}function Pn(e){return e.startsWith(":")?je().GetConfig().GetDirectiveName("bind")+e:null}function xn(e){return e.startsWith(".")?e.replace(".",je().GetConfig().GetDirectiveName("class:")):null}function In(e){return e.startsWith("@")?e.replace("@",je().GetConfig().GetDirectiveName("on:")):null}function kn(e,t,n){console.log({message:e,context:t||"N/A",contextElement:n||"N/A"})}function On(e=!0){e&&cn(),je().AddAttributeProcessor(on),je().AddTextContentProcessor(ln)}function Gn(){rt("",{waitForGlobal:Le,bootstrap:an})}function Rn(){rt("utilities",{beginsWith:c,endsWith:Ze,toCamelCase:m,toSnakeCase:bt,insertHtml:Ut,findAncestor:Qe,getAttribute:K,findFirstAttribute:V,findFirstAttributeValue:Y,setAttribute:ft,isBooleanAttribute:st,supportsAttributes:q,getTarget:L,getTargets:T,isEqual:ot,isObject:M,toString:Ue,deepCopy:te,tidyPath:dt,pathToRelative:pt,splitPath:mt,joinPath:_t,getRandomString:Ie,measureCallback:ht,encodeAttribute:Ye,decodeAttribute:Ke,encodeValue:Ve,decodeValue:qe})}function wn(){rt("values",{future:r,loop:l,nothing:a,stack:i})}function Nn(){rt("version",{major:1,minor:1,patch:2,get value(){return`${this.major}.${this.minor}.${this.patch}`},toString(){return this.value}})}function Fn(){On(),Gn(),Rn(),wn(),Nn()}},409:function(e,t,n){var i=this&&this.__decorate||function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o};Object.defineProperty(t,"__esModule",{value:!0}),t.StripeDetailElementCompact=t.StripeDetailElement=void 0;const r=n(16),s=n(979);class o extends s.StripeGenericField{constructor(){super(),this.input=null,this.name="",this.value=""}ToggleFocus(e){const t=this.GetInput_();t&&(e?t.focus():t.blur())}Reset(){const e=this.GetInput_();e&&(e.value="")}AddDetails(e){const t=this.GetInput_();this.name&&((null==t?void 0:t.value)||this.value)&&(e.billingDetails=e.billingDetails||{},"address"===this.name?(e.billingDetails.address=e.billingDetails.address||{},e.billingDetails.address.line1=(null==t?void 0:t.value)||this.value):e.billingDetails[this.name]=(null==t?void 0:t.value)||this.value)}GetInput_(){return this.input||this.querySelector("input")}}i([(0,r.Property)({type:"object",checkStoredObject:!0})],o.prototype,"input",void 0),i([(0,r.Property)({type:"string"})],o.prototype,"name",void 0),i([(0,r.Property)({type:"string"})],o.prototype,"value",void 0),t.StripeDetailElement=o,t.StripeDetailElementCompact=function(){(0,r.RegisterCustomElement)(o,"stripe-detail")}},538:function(e,t,n){var i=this&&this.__decorate||function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o},r=this&&this.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.StripeFieldElementCompact=t.StripeFieldElement=void 0;const s=n(617),o=n(16),l=n(979);class a extends l.StripeGenericField{constructor(){super(),this.stripeField_=null,this.isReady_=!1,this.isComplete_=!1,this.lastError_=null,this.readyWaiters_=new Array,this.changeListeners=new Array,this.options=null,this.type="",this.onready="",this.oncomplete="",this.onerrors=""}WaitReady(){return new Promise((e=>{this.isReady_?e():this.readyWaiters_.push((()=>e()))}))}AddChangeListener(e){this.changeListeners.push(e)}RemoveChangeListener(e){const t=this.changeListeners.indexOf(e);t>=0&&this.changeListeners.splice(t,1)}ToggleFocus(e){var t,n;this.stripeField_&&(e?null===(t=this.stripeField_)||void 0===t||t.focus():null===(n=this.stripeField_)||void 0===n||n.blur())}Reset(){var e;this.stripeField_&&(null===(e=this.stripeField_)||void 0===e||e.clear())}AddDetails(e){this.stripeField_&&("card"===this.type||"number"===this.type||"cardNumber"===this.type)&&(e.method=this.stripeField_)}HandleElementScopeCreated_(e,t){var{scope:n}=e,i=r(e,["scope"]);super.HandleElementScopeCreated_(Object.assign({scope:n},i),t),n.AddPostProcessCallback((()=>{var e;null===(e=this.GetStripe_())||void 0===e||e.WaitInstance().then((e=>{var t;if(!(null==e?void 0:e.stripe))return;let n="";["number","expiry","cvc"].includes(this.type)?n=`card${this.type.substring(0,1).toUpperCase()}${this.type.substring(1)}`:["card","cardNumber","cardExpiry","cardCvc","postalCode","paymentRequestButton","iban","idealBank"].includes(this.type)&&(n=this.type),n&&e.elements&&(this.stripeField_=e.elements.create(n,this.options||(null===(t=this.GetStripe_())||void 0===t?void 0:t.options)||void 0),this.stripeField_.on("ready",(()=>{this.isReady_=!0,this.onready&&(0,s.EvaluateLater)({componentId:this.componentId_,contextElement:this,expression:this.onready,disableFunctionCall:!1})(),this.readyWaiters_.splice(0).forEach((e=>(0,s.JournalTry)(e)))})),this.stripeField_.on("change",(e=>{((null==e?void 0:e.error)||null)!==this.lastError_&&(this.lastError_=(null==e?void 0:e.error)||null,(0,s.EvaluateLater)({componentId:this.componentId_,contextElement:this,expression:this.onerrors,disableFunctionCall:!1})(void 0,[this.lastError_],{error:this.lastError_}),this.changeListeners.forEach((e=>(0,s.JournalTry)((()=>e("error",this.lastError_)))))),((null==e?void 0:e.complete)||!1)!=this.isComplete_&&(this.isComplete_=(null==e?void 0:e.complete)||!1,(0,s.EvaluateLater)({componentId:this.componentId_,contextElement:this,expression:this.oncomplete,disableFunctionCall:!1})(void 0,[this.isComplete_],{complete:this.isComplete_}),this.changeListeners.forEach((e=>(0,s.JournalTry)((()=>e("complete",this.isComplete_))))))})),this.stripeField_.mount(this))}))})),n.AddUninitCallback((()=>{var e;null===(e=this.GetStripe_())||void 0===e||e.RemoveStripeField(this),this.stripeField_=null}))}}i([(0,o.Property)({type:"object",checkStoredObject:!0})],a.prototype,"options",void 0),i([(0,o.Property)({type:"string"})],a.prototype,"type",void 0),i([(0,o.Property)({type:"string"})],a.prototype,"onready",void 0),i([(0,o.Property)({type:"string"})],a.prototype,"oncomplete",void 0),i([(0,o.Property)({type:"string"})],a.prototype,"onerrors",void 0),t.StripeFieldElement=a,t.StripeFieldElementCompact=function(){(0,o.RegisterCustomElement)(a,"stripe-field")}},979:function(e,t,n){var i=this&&this.__decorate||function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o},r=this&&this.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.StripeGenericField=void 0;const s=n(617),o=n(16);class l extends o.CustomElement{constructor(){super(...arguments),this.stripe=null}WaitReady(){return Promise.resolve()}AddChangeListener(e){}RemoveChangeListener(e){}ToggleFocus(e){}Reset(){}AddDetails(e){}HandleElementScopeCreated_(e,t){var{scope:n}=e,i=r(e,["scope"]);super.HandleElementScopeCreated_(Object.assign({scope:n},i),(()=>{var e;null===(e=this.GetStripe_())||void 0===e||e.AddStripeField(this),t&&t()}))}GetStripe_(){return this.stripe||(0,s.FindAncestor)(this,(e=>"AddStripeField"in e))}}i([(0,o.Property)({type:"object",checkStoredObject:!0})],l.prototype,"stripe",void 0),t.StripeGenericField=l},380:function(e,t,n){var i=this&&this.__decorate||function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o};Object.defineProperty(t,"__esModule",{value:!0}),t.StripePaymentMenthodElementCompact=t.StripePaymentMenthodElement=void 0;const r=n(16),s=n(979);class o extends s.StripeGenericField{constructor(){super({isTemplate:!0,isHidden:!0}),this.value=""}AddDetails(e){this.value&&(e.method=this.value)}}i([(0,r.Property)({type:"object",checkStoredObject:!0})],o.prototype,"value",void 0),t.StripePaymentMenthodElement=o,t.StripePaymentMenthodElementCompact=function(){(0,r.RegisterCustomElement)(o,"stripe-payment-method")}},645:function(e,t,n){var i=this&&this.__decorate||function(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o},r=this&&this.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.StripeElementCompact=t.StripeElement=void 0;const s=n(617),o=n(16);class l extends o.CustomElement{constructor(){super(),this.stripe_=null,this.elements_=null,this.mounting_=!1,this.mounted_=!1,this.isReady_=!1,this.readyWaiters_=new Array,this.fields_=null,this.readyFields_=null,this.instanceWaiters_=new Array,this.completeFields_=null,this.errorFields_=null,this.options=null,this.publicKey="",this.onready="",this.oncomplete="",this.onerrors="",this.defer=!1,this.focusnext=!1}AddStripeField(e){this.fields_=this.fields_||[],this.fields_.push(e),e.WaitReady().then((()=>{this.readyFields_=this.readyFields_||[],this.readyFields_.push(e),this.fields_&&this.readyFields_&&this.fields_.length<=this.readyFields_.length&&(0,s.JournalTry)((()=>{this.isReady_=!0,this.onready&&(0,s.EvaluateLater)({componentId:this.componentId_,contextElement:this,expression:this.onready,disableFunctionCall:!1})(),this.readyWaiters_.splice(0).forEach((e=>(0,s.JournalTry)(e)))}))})),e.AddChangeListener(((t,n)=>{if("complete"===t){let t=!1;this.completeFields_=this.completeFields_||[],n&&!this.completeFields_.includes(e)?(this.completeFields_.push(e),t=!(!this.readyFields_||this.completeFields_.length!=this.readyFields_.length)):!n&&this.completeFields_.includes(e)&&(this.completeFields_=this.completeFields_.filter((t=>t!==e)),t=!(!this.readyFields_||this.completeFields_.length!=this.readyFields_.length-1)),t&&this.oncomplete&&(0,s.EvaluateLater)({componentId:this.componentId_,contextElement:this,expression:this.oncomplete,disableFunctionCall:!1})(void 0,[!!n],{complete:!!n}),n&&this.focusnext&&this.FocusNextField(e)}else if("error"===t){let t=!1;this.errorFields_=this.errorFields_||[],this.errorFields_.push(e),this.errorFields_=this.errorFields_||[],n&&!this.errorFields_.includes(e)?(this.errorFields_.push(e),t=1==this.errorFields_.length):!n&&this.errorFields_.includes(e)&&(this.errorFields_=this.errorFields_.filter((t=>t!==e)),t=0==this.errorFields_.length),t&&this.onerrors&&(0,s.EvaluateLater)({componentId:this.componentId_,contextElement:this,expression:this.onerrors,disableFunctionCall:!1})(void 0,[n],{error:n})}}))}RemoveStripeField(e){this.fields_&&(this.fields_=this.fields_.filter((t=>t!==e))),this.readyFields_&&(this.readyFields_=this.readyFields_.filter((t=>t!==e)))}FocusNextField(e){if(this.fields_){const t=this.fields_.indexOf(e);t>=0&&t<this.fields_.length-1&&this.fields_[t+1].ToggleFocus(!0)}}GetDetails(){return{stripe:this.stripe_,elements:this.elements_}}GetInstance(){return this.stripe_}WaitInstance(){return new Promise((e=>{this.mounted_?e(this.GetDetails()):this.instanceWaiters_.push((()=>e(this.GetDetails())))}))}Mount(){this.mounted_||this.mounting_||(this.mounting_=!0,this.LoadResources().then((()=>{this.mounting_=!1,this.mounted_=!0,this.stripe_=Stripe(this.publicKey),this.elements_=this.stripe_.elements(),this.instanceWaiters_.splice(0).forEach((e=>(0,s.JournalTry)(e)))})))}Pay(e,t=!1){return this.PayOrSetup_(!0,e,t)}Setup(e){return this.PayOrSetup_(!1,e)}WaitReady(){return new Promise((e=>{this.isReady_?e():this.readyWaiters_.push((()=>e()))}))}HandleElementScopeCreated_(e,t){var{scope:n}=e,i=r(e,["scope"]);super.HandleElementScopeCreated_(Object.assign({scope:n},i),t),n.AddPostProcessCallback((()=>!this.defer&&this.Mount())),n.AddUninitCallback((()=>this.stripe_=null))}PayOrSetup_(e,t,n=!1){return new Promise(((i,r)=>{this.WaitInstance().then((s=>{var o,l;if(!(null==s?void 0:s.stripe))return i(!1);const a={};if(null===(o=this.fields_)||void 0===o||o.forEach((e=>e.AddDetails(a))),!a.method)return i(!1);let c;c="string"!=typeof a.method?{payment_method:{card:a.method,billing_details:a.billingDetails}}:{payment_method:a.method},e?((null===(l=a.billingDetails)||void 0===l?void 0:l.email)&&(c.receipt_email=a.billingDetails.email),n&&(c.setup_future_usage="off_session"),s.stripe.confirmCardPayment(t,c).then(i).catch(r)):s.stripe.confirmCardSetup(t,c).then(i).catch(r)})).catch(r)}))}}i([(0,o.Property)({type:"object",checkStoredObject:!0})],l.prototype,"options",void 0),i([(0,o.Property)({type:"string"})],l.prototype,"publicKey",void 0),i([(0,o.Property)({type:"string"})],l.prototype,"onready",void 0),i([(0,o.Property)({type:"string"})],l.prototype,"oncomplete",void 0),i([(0,o.Property)({type:"string"})],l.prototype,"onerrors",void 0),i([(0,o.Property)({type:"boolean"})],l.prototype,"defer",void 0),i([(0,o.Property)({type:"boolean"})],l.prototype,"focusnext",void 0),t.StripeElement=l,t.StripeElementCompact=function(){(0,o.RegisterCustomElement)(l,"stripe")}},419:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InlineJSStripe=void 0;const i=n(617),r=n(645),s=n(538),o=n(409),l=n(380);t.InlineJSStripe=function(){(0,i.WaitForGlobal)().then((()=>{(0,r.StripeElementCompact)(),(0,s.StripeFieldElementCompact)(),(0,o.StripeDetailElementCompact)(),(0,l.StripePaymentMenthodElementCompact)()}))}}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var s=t[i]={exports:{}};return e[i].call(s.exports,s,s.exports,n),s.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(0,n(419).InlineJSStripe)()})();
@@ -1,13 +1,10 @@
1
- import { CustomElement } from "@benbraide/inlinejs-element";
2
- import { IStripeField, IStripePaymentDetails, StripeFieldChangeHandlerType } from "../types";
3
- export declare class StripeDetailElement extends CustomElement implements IStripeField {
1
+ import { IStripePaymentDetails } from "../types";
2
+ import { StripeGenericField } from "./generic-field";
3
+ export declare class StripeDetailElement extends StripeGenericField {
4
4
  input: HTMLInputElement | null;
5
5
  name: string;
6
6
  value: string;
7
7
  constructor();
8
- WaitReady(): Promise<void>;
9
- AddChangeListener(listener: StripeFieldChangeHandlerType): void;
10
- RemoveChangeListener(listener: StripeFieldChangeHandlerType): void;
11
8
  ToggleFocus(focused: boolean): void;
12
9
  Reset(): void;
13
10
  AddDetails(details: IStripePaymentDetails): void;
@@ -8,18 +8,14 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.StripeDetailElementCompact = exports.StripeDetailElement = void 0;
10
10
  const inlinejs_element_1 = require("@benbraide/inlinejs-element");
11
- class StripeDetailElement extends inlinejs_element_1.CustomElement {
11
+ const generic_field_1 = require("./generic-field");
12
+ class StripeDetailElement extends generic_field_1.StripeGenericField {
12
13
  constructor() {
13
14
  super();
14
15
  this.input = null;
15
16
  this.name = '';
16
17
  this.value = '';
17
18
  }
18
- WaitReady() {
19
- return Promise.resolve();
20
- }
21
- AddChangeListener(listener) { }
22
- RemoveChangeListener(listener) { }
23
19
  ToggleFocus(focused) {
24
20
  const input = this.GetInput_();
25
21
  input && (focused ? input.focus() : input.blur());
@@ -1,15 +1,14 @@
1
1
  /// <reference types="stripe-v3" />
2
2
  import { IElementScopeCreatedCallbackParams } from "@benbraide/inlinejs";
3
- import { CustomElement } from "@benbraide/inlinejs-element";
4
- import { IStripeElement, IStripeField, IStripePaymentDetails, StripeFieldChangeHandlerType } from "../types";
5
- export declare class StripeFieldElement extends CustomElement implements IStripeField {
3
+ import { IStripePaymentDetails, StripeFieldChangeHandlerType } from "../types";
4
+ import { StripeGenericField } from "./generic-field";
5
+ export declare class StripeFieldElement extends StripeGenericField {
6
6
  protected stripeField_: stripe.elements.Element | null;
7
7
  protected isReady_: boolean;
8
8
  protected isComplete_: boolean;
9
9
  protected lastError_: stripe.Error | null;
10
10
  protected readyWaiters_: (() => void)[];
11
11
  protected changeListeners: StripeFieldChangeHandlerType[];
12
- stripe: IStripeElement | null;
13
12
  options: stripe.elements.ElementsOptions | null;
14
13
  type: string;
15
14
  onready: string;
@@ -23,6 +22,5 @@ export declare class StripeFieldElement extends CustomElement implements IStripe
23
22
  Reset(): void;
24
23
  AddDetails(details: IStripePaymentDetails): void;
25
24
  protected HandleElementScopeCreated_({ scope, ...rest }: IElementScopeCreatedCallbackParams, postAttributesCallback?: () => void): void;
26
- protected GetStripe_(): IStripeElement | null;
27
25
  }
28
26
  export declare function StripeFieldElementCompact(): void;