unpoly-rails 3.9.2.1 → 3.9.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/assets/unpoly/unpoly.css +1 -0
- data/assets/unpoly/unpoly.es6.js +23 -16
- data/assets/unpoly/unpoly.es6.min.js +1 -1
- data/assets/unpoly/unpoly.js +23 -16
- data/assets/unpoly/unpoly.min.css +1 -1
- data/assets/unpoly/unpoly.min.js +1 -1
- data/lib/unpoly/rails/change/field_definition.rb +14 -12
- data/lib/unpoly/rails/change.rb +1 -1
- data/lib/unpoly/rails/version.rb +1 -1
- metadata +2 -2
data/assets/unpoly/unpoly.min.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
(()=>{var t={1860:(t,e,n)=>{"use strict";n.r(e)},8711:(t,e,n)=>{"use strict";n.r(e)},4432:(t,e,n)=>{"use strict";n.r(e)},2065:(t,e,n)=>{"use strict";n.r(e)},35:(t,e,n)=>{"use strict";n.r(e)},5074:(t,e,n)=>{"use strict";n.r(e)},2811:()=>{up.browser={submitForm:function(t){t.submit()},canPushState:function(){return"GET"===up.protocol.initialRequestMethod()},canJQuery:function(){return!!window.jQuery},assertConfirmed:function(t){if(t.confirm&&!window.confirm(t.confirm))throw new up.Aborted("User canceled action");return!0},popCookie:function(t){let e=document.cookie.match(new RegExp(t+"=(\\w+)"))?.[1];if(e)return document.cookie=t+"=;Max-Age=0;Path=/",e},canHasSelector:up.util.memoize((()=>CSS.supports("selector(:has(*))")))}},6346:()=>{const t=up.element;up.BodyShifter=class BodyShifter{constructor(){this.t=new Set,this.i=0,this.o=[]}lowerStack(){0==--this.i&&this.u()}raiseStack(){1==++this.i&&this.h()}onAnchoredElementInserted(t){return this.t.add(t),this.l(t,"right"),()=>this.t.delete(t)}p(){return this.m&&this.i>0}h(){this.m=up.viewport.rootScrollbarWidth(),this.o.push(t.setTemporaryStyle(t.root,{"--up-scrollbar-width":this.m+"px"})),this.l(document.body,"padding-right");for(let t of this.t)this.l(t,"right")}l(e,n){if(!this.p())return;let i=t.style(e,n);this.o.push(t.setTemporaryStyle(e,{["--up-original-"+n]:i}),t.addTemporaryClass(e,"up-scrollbar-away"))}u(){let t;for(;t=this.o.pop();)t()}}},7948:()=>{const t=up.util,e=up.element;up.Change.Addition=class Addition extends up.Change{constructor(t){super(t),this.v=t.acceptLayer,this._=t.dismissLayer,this.k=t.eventPlans||[],this.S=t.response}handleLayerChangeRequests(){this.layer.isOverlay()&&(this.tryAcceptLayerFromServer(),this.abortWhenLayerClosed(),this.layer.tryAcceptForLocation(this.responseOption()),this.abortWhenLayerClosed(),this.tryDismissLayerFromServer(),this.abortWhenLayerClosed(),this.layer.tryDismissForLocation(this.responseOption()),this.abortWhenLayerClosed()),this.layer.asCurrent((()=>{for(let t of this.k)up.emit({...t,...this.responseOption()}),this.abortWhenLayerClosed()}))}tryAcceptLayerFromServer(){t.isDefined(this.v)&&this.layer.isOverlay()&&this.layer.accept(this.v,this.responseOption())}tryDismissLayerFromServer(){t.isDefined(this._)&&this.layer.isOverlay()&&this.layer.dismiss(this._,this.responseOption())}abortWhenLayerClosed(t=this.layer){if(t.isClosed())throw new up.Aborted("Layer was closed")}setSource({oldElement:t,newElement:n,source:i}){"keep"===i&&(i=t&&up.fragment.source(t)),i&&e.setMissingAttr(n,"up-source",up.fragment.normalizeSource(i))}setTime({newElement:t,time:n}){e.setMissingAttr(t,"up-time",!!n&&n.toUTCString())}setETag({newElement:t,etag:n}){e.setMissingAttr(t,"up-etag",n||!1)}setReloadAttrs(t){this.setSource(t),this.setTime(t),this.setETag(t)}responseOption(){return{response:this.S}}executeSteps(t,e,n){return new up.Change.UpdateSteps({steps:t,noneOptions:n}).execute(e)}}},3030:()=>{const t=up.util;up.Change=class Change{constructor(t){this.options=t}execute(){throw new up.NotImplemented}onFinished(t){return this.options.onFinished?.(t)}improveHistoryValue(e,n){return!1===e||t.isString(e)?e:n}deriveFailOptions(){return up.RenderOptions.deriveFailOptions(this.options)}}},7422:()=>{const t=up.util;up.Change.CloseLayer=class CloseLayer extends up.Change.Removal{constructor(t){super(t),this.O=t.verb,this.C=up.layer.get(t),this.F=t.origin,this.T=t.value,this.R=t.preventable??!0,this.S=t.response,this.L=t.history??!0}execute(){if(!this.C.isOpen())return Promise.resolve();if(up.browser.assertConfirmed(this.options),this.A().defaultPrevented&&this.R)throw new up.Aborted("Close event was prevented");this.P(),up.fragment.abort({reason:"Layer is closing",layer:this.C});const{parent:t}=this.C;this.C.peel(),this.C.stack.remove(this.C),this.L&&t.restoreHistory(),this.$(t),this.C.teardownHandlers(),this.C.destroyElements(this.options),this.D(t)}A(){let e=this.C.emit(this.M(`up:layer:${this.O}`),{callback:this.C.callback(`on${t.upperCaseFirst(this.O)}`),log:[`Will ${this.O} ${this.C} with value %o`,this.T]});return this.T=e.value,e}P(){let t=this.M(`up:layer:${this.O}ing`);this.C.emit(t,{log:!1})}D(e){const n=`${this.O}ed`,i=t.upperCaseFirst(n);return this.C.emit(this.M(`up:layer:${n}`),{baseLayer:e,callback:this.C.callback(`on${i}`),ensureBubbles:!0,log:[`${i} ${this.C} with value %o`,this.T]})}M(t){return up.event.build(t,{layer:this.C,value:this.T,origin:this.F,response:this.S})}$(t){this.C.overlayFocus.teardown(),t.overlayFocus?.moveToFront();let e=this.C.origin||t.element;up.focus(e,{preventScroll:!0})}}},8228:()=>{up.Change.DestroyFragment=class DestroyFragment extends up.Change.Removal{constructor(t){super(t),this.C=up.layer.get(t)||up.layer.current,this.H=this.options.element,this.N=this.options.animation,this.j=this.options.log}execute(){this.q=this.H.parentNode,up.fragment.markAsDestroying(this.H),up.motion.willAnimate(this.H,this.N,this.options)?this.B():this.U()}async B(){this.I(),await this.K(),this.V(),this.onFinished()}U(){this.V(),this.I(),this.onFinished()}K(){return up.motion.animate(this.H,this.N,this.options)}V(){this.C.asCurrent((()=>{up.fragment.abort(this.H),up.script.clean(this.H,{layer:this.C}),up.element.cleanJQuery(this.H),this.H.remove()}))}I(){up.fragment.emitDestroyed(this.H,{parent:this.q,log:this.j})}}},9005:()=>{var t;const e=up.util;up.Change.FromContent=(t=class FromContent extends up.Change{constructor(t){super(t),this.F=t.origin,this.X=t.preview,this.W=up.layer.getAll(t)}J(){let t=[];return this.G(),this.Y(),this.Z(t,this.W,this.options.target),this.Z(t,this.W,this.options.fallback),t}tt(t){return"new"===t||t.isOpen()}G(){this.W=e.filter(this.W,this.tt)}Z(t,e,n){for(let i of e)for(let e of this.et(n,i)){const n={...this.options,target:e,layer:i,defaultPlacement:this.nt()},s="new"===i?new up.Change.OpenLayer(n):new up.Change.UpdateLayer(n);t.push(s)}}et(t,e){return up.fragment.expandTargets(t,{layer:e,mode:this.options.mode,origin:this.F})}execute(){return this.options.preload?Promise.resolve():this.it(this.st.bind(this))||this.rt()}st(t){let e=t.execute(this.ot(),this.ut.bind(this,t));return e.options=this.options,e}ht(t){return!(t instanceof up.CannotMatch)}ut(t){let e=this.J()[0];t!==e&&up.puts("up.render()",'Could not match primary target "%s". Updating a fallback target "%s".',e.target,t.target);let{assets:n}=this.ot();n&&up.script.assertAssetsOK(n,t.options),this.options.onRender?.()}ot(){if(this.X)return;const t=e.pick(this.options,["target","content","fragment","document","html","cspNonces","origin"]);return up.migrate.handleResponseDocOptions?.(t),"content"===this.nt()&&(t.target=this.ct(t.target)),new up.ResponseDoc(t)}Y(){if(this.X)return;let t=this.ot();this.options.fragment&&(this.options.target||=t.rootSelector()),this.options.title=this.improveHistoryValue(this.options.title,t.title),this.options.metaTags=this.improveHistoryValue(this.options.metaTags,t.metaTags),this.options.lang=this.improveHistoryValue(this.options.lang,t.lang)}nt(){if(!this.options.document&&!this.options.fragment)return"content"}ct(t){let e=this.W[0]||up.layer.root;return this.et(t||":main",e)[0]}getPreflightProps(t={}){return this.it((t=>t.getPreflightProps()))||t.optional||this.lt()}lt(){this.ft("Could not find target in current page")}rt(){this.ft("Could not find common target in current page and response")}ft(t){if(this.J().length){const n=e.uniq(e.map(this.J(),"target")),i=up.layer.optionToString(this.options.layer);throw new up.CannotMatch([t+" (tried selectors %o in %s)",n,i])}if(0!==this.W.length)throw this.options.failPrefixForced?new up.CannotMatch("No target selector given for failed responses (https://unpoly.com/failed-responses)"):new up.CannotMatch("No target selector given");this.dt()}dt(){throw new up.CannotMatch("Could not find a layer to render in. You may have passed an unmatchable layer reference, or a detached element.")}it(t){for(let e of this.J())try{return t(e)}catch(t){if(this.ht(t))throw t}}},e.memoizeMethod(t.prototype,{J:!0,ot:!0,getPreflightProps:!0}),t)},278:()=>{var t;const e=up.util;up.Change.FromResponse=(t=class FromResponse extends up.Change{constructor(t){super(t),this.S=t.response,this.gt=this.S.request}execute(){if(up.fragment.config.skipResponse(this.yt())?this.wt():this.gt.assertEmitted("up:fragment:loaded",{...this.yt(),callback:this.options.onLoaded,log:["Loaded fragment from %s",this.S.description],skip:()=>this.wt()}),e.evalOption(this.options.fail,this.S)??!this.S.ok)throw this.bt(this.deriveFailOptions());return this.bt(this.options)}wt(){up.puts("up.render()","Skipping "+this.S.description),this.options.target=":none",this.options.failTarget=":none"}bt(t){t.failPrefixForced&&up.puts("up.render()","Rendering failed response using fail-prefixed options (https://unpoly.com/failed-responses)"),this.vt(t),t.meta=this._t();let e=new up.Change.FromContent(t).execute();return e.finished=this.finish(e,t),e}async finish(t,e){return t=await t.finished,up.fragment.shouldRevalidate(this.gt,this.S,e)&&(t=await this.kt(t,e)),t}async kt(t,e){let n=e.target,i=t.target;if(/:(before|after)/.test(n))up.warn("up.render()","Cannot revalidate cache when prepending/appending (target %s)",n);else{up.puts("up.render()",'Revalidating cached response for target "%s"',i);let n=await up.reload(i,{...e,preferOldElements:t.fragments,layer:t.layer,onFinished:null,scroll:!1,focus:"keep",transition:!1,cache:!1,confirm:!1,feedback:!1,abort:!1,expiredResponse:this.S});n.none||(t=n)}return t}yt(){const{expiredResponse:t}=this.options;return{request:this.gt,response:this.S,renderOptions:this.options,revalidating:!!t,expiredResponse:t}}_t(){let t={revalidating:!!this.options.expiredResponse};return up.migrate.processCompilerPassMeta?.(t,this.S),t}vt(t){const n=this.S.url;let i=n,s=this.gt.hash;s&&(t.hash=s,i+=s),"GET"===this.S.method?t.source=this.improveHistoryValue(t.source,n):(t.source=this.improveHistoryValue(t.source,"keep"),t.history=!!t.location),t.location=this.improveHistoryValue(t.location,i),t.title=this.improveHistoryValue(t.title,this.S.title),t.eventPlans=this.S.eventPlans;let r=this.S.target;r&&(t.target=r),t.acceptLayer=this.S.acceptLayer,t.dismissLayer=this.S.dismissLayer,t.document=this.S.text,this.S.none&&(t.target=":none"),t.context=e.merge(t.context,this.S.context),t.cspNonces=this.S.cspNonces,t.time??=this.S.lastModified,t.etag??=this.S.etag}},e.memoizeMethod(t.prototype,{yt:!0}),t)},2200:()=>{var t;const e=up.util;up.Change.FromURL=(t=class FromURL extends up.Change{execute(){let t=this.St();return t?(up.puts("up.render()",t),up.network.loadPage(this.options),e.unresolvablePromise()):(this.request=up.request(this.xt()),this.options.onRequest?.(this.request),up.feedback.showAroundRequest(this.request,this.options),up.form.disableWhile(this.request,this.options),this.options.preload?this.request:e.always(this.request,(t=>this.Et(t))))}St(){return e.isCrossOrigin(this.options.url)?"Loading cross-origin content in new page":this.options.history&&!up.browser.canPushState()?"Loading content in new page to restore history support":void 0}xt(){const t=this.Ot(this.options),n=this.Ot(this.deriveFailOptions(),{optional:!0});return{...this.options,...t,...e.renameKeys(n,up.fragment.failKey)}}getPreflightProps(){return this.xt()}Ot(t,e){return new up.Change.FromContent({...t,preview:!0}).getPreflightProps(e)}Et(t){return t instanceof up.Response?this.Ct(t):this.Ft(t)}Ct(t){return new up.Change.FromResponse({...this.options,response:t}).execute()}Ft(t){throw t instanceof up.Offline&&this.request.emit("up:fragment:offline",{callback:this.options.onOffline,renderOptions:this.options,retry:t=>up.render({...this.options,...t}),log:["Cannot load fragment from %s: %s",this.request.description,t.reason]}),t}},e.memoizeMethod(t.prototype,{xt:!0}),t)},7050:()=>{let t=up.util;up.Change.OpenLayer=class OpenLayer extends up.Change.Addition{constructor(t){super(t),this.target=t.target,this.F=t.origin,this.Tt=t.baseLayer}getPreflightProps(){return{mode:this.options.mode,context:this.Rt().context,origin:this.options.origin,target:this.target,layer:this.Tt,fragments:t.compact([up.fragment.get(":main",{layer:this.Tt})]),newLayer:!0}}execute(t,e){this.responseDoc=t,this.Lt(),e(),this.At();let n=this.layer.on("up:layer:accepting up:layer:dimissing",this.Pt.bind(this));try{return this.$t(),this.Pt(),up.RenderResult.both(this.Dt,this.Mt)}finally{n()}}Lt(){if(":none"===this.target?this.Ht=document.createElement("up-none"):this.Ht=this.responseDoc.select(this.target),!this.Ht||this.Tt.isClosed())throw new up.CannotMatch}At(){up.puts("up.render()",`Opening element "${this.target}" in new overlay`),this.Nt(),this.layer=this.Rt(),this.Tt.peel({history:!this.layer.history}),up.layer.stack.push(this.layer),this.layer.createElements(),this.layer.setupHandlers()}$t(){this.jt(),this.handleLayerChangeRequests(),this.responseDoc.commitElement(this.Ht),this.layer.setContent(this.Ht),this.setReloadAttrs({newElement:this.Ht,source:this.options.source}),this.responseDoc.finalizeElement(this.Ht),this.Dt=new up.RenderResult({layer:this.layer,fragments:[this.Ht],target:this.target}),up.hello(this.layer.element,{...this.options,layer:this.layer}),this.qt(),this.Dt.finished=this.Bt(),this.layer.opening=!1,this.Ut(),this.abortWhenLayerClosed()}Pt(){if(this.Mt)return;let t=this.zt().other;this.Mt=this.executeSteps(t,this.responseDoc)}async Bt(){return await this.layer.startOpenAnimation(),this.abortWhenLayerClosed(),this.$(),this.Dt}Rt(){const t={...this.options,opening:!0};return up.layer.build(t,(t=>this.options=up.RenderOptions.finalize(t)))}jt(){"auto"===this.layer.history&&(this.layer.history=up.fragment.hasAutoHistory([this.Ht],this.layer));let{parent:t}=this.layer;this.layer.history&&=t.history,t.saveHistory(),this.layer.updateHistory(this.options)}$(){this.Tt.overlayFocus?.moveToBack(),this.layer.overlayFocus.moveToFront(),new up.FragmentFocus({fragment:this.Ht,layer:this.layer,autoMeans:["autofocus","layer"],inputDevice:this.options.inputDevice}).process(this.options.focus)}qt(){const t={...this.options,fragment:this.Ht,layer:this.layer,autoMeans:["hash","layer"]};new up.FragmentScrolling(t).process(this.options.scroll)}Nt(){up.event.assertEmitted("up:layer:open",{origin:this.F,baseLayer:this.Tt,layerOptions:this.options,log:"Opening new overlay"})}Ut(){this.layer.emit("up:layer:opened",{origin:this.F,callback:this.layer.callback("onOpened"),log:`Opened new ${this.layer}`})}zt(){return up.radio.hungrySteps(this.It())}It(){return{...this.options,layer:this.layer,history:this.layer.history}}}},1752:()=>{up.Change.Removal=class Removal extends up.Change{}},9441:()=>{var t;const e=up.util;up.Change.UpdateLayer=(t=class UpdateLayer extends up.Change.Addition{constructor(t){super(t=up.RenderOptions.finalize(t)),this.layer=t.layer,this.target=t.target,this.Kt=t.context,this.Vt=up.fragment.parseTargetSteps(this.target,this.options)}getPreflightProps(){return this.Xt(),{layer:this.layer,mode:this.layer.mode,context:e.merge(this.layer.context,this.Kt),origin:this.options.origin,target:this.Wt(),fragments:this.Jt(),newLayer:!1}}Wt(){return this.Xt(),up.fragment.targetForSteps(this.Vt)}Jt(){return this.Xt(),e.map(this.Vt,"oldElement")}execute(t,e){this.responseDoc=t,this.Lt(),e();let n=this.layer.on("up:layer:accepting up:layer:dimissing",this.Pt.bind(this));try{return this.Gt(),this.Pt(),up.RenderResult.both(this.Qt,this.Mt)}finally{n()}}Gt(){this.Vt.length&&up.puts("up.render()",`Updating "${this.Wt()}" in ${this.layer}`),this.Yt(),this.options.saveScroll&&up.viewport.saveScroll({layer:this.layer}),this.options.saveFocus&&up.viewport.saveFocus({layer:this.layer}),this.options.peel&&this.layer.peel({history:!this.Zt()}),!1!==this.options.abort&&up.fragment.abort(this.Jt(),{reason:"Fragment is being replaced"}),Object.assign(this.layer.context,this.Kt),this.Zt()&&this.layer.updateHistory(this.options),this.handleLayerChangeRequests(),this.Qt=this.executeSteps(this.Vt,this.responseDoc,this.options)}Pt(){if(this.Mt)return;let t=this.zt().other;this.Mt=this.executeSteps(t,this.responseDoc)}Xt(){this.te(),this.ee()}Lt(){this.te(),this.ne(),this.ee(),this.ie()}ne(){this.Vt.push(...this.zt().current)}te(){this.Vt=this.Vt.filter((t=>{const n=new up.FragmentFinder(e.pick(t,["selector","origin","layer","match","preferOldElements"]));if(t.oldElement||=n.find(),t.oldElement)return!0;if(!t.maybe)throw new up.CannotMatch}))}ie(){this.Vt=this.responseDoc.selectSteps(this.Vt)}ee(){this.Vt=up.fragment.compressNestedSteps(this.Vt)}zt(){return up.radio.hungrySteps(this.It())}Yt(){let t=up.FocusCapsule.preserve(this.layer);this.Vt.forEach(((e,n)=>{e.focusCapsule=t,n>0&&(e.scroll=!1,e.focus=!1)}))}Zt(){return e.evalAutoOption(this.options.history,this.se.bind(this))}se(){const t=e.map(this.Vt,"oldElement");return up.fragment.hasAutoHistory(t,this.layer)}It(){return{...this.options,layer:this.layer,history:this.Zt()}}},e.memoizeMethod(t.prototype,{Xt:!0,te:!0,Zt:!0,zt:!0}),t)},9489:()=>{const t=up.util,e=up.element;up.Change.UpdateSteps=class UpdateSteps extends up.Change.Addition{constructor(e){super(e),this.re=e.noneOptions||{},this.Vt=t.copy(e.steps)}execute(t){if(this.responseDoc=t,this.Vt=t.selectSteps(this.Vt),this.Vt=t.commitSteps(this.Vt),!this.Vt.length)return this.oe();this.renderResult=new up.RenderResult({layer:this.Vt[0]?.layer,target:up.fragment.targetForSteps(this.Vt)}),this.Vt.reverse();const e=this.Vt.map((t=>this.ue(t)));return this.renderResult.finished=this.Bt(e),this.renderResult}oe(){return this.$(null,this.re),this.qt(null,this.re),up.RenderResult.buildNone()}async Bt(t){await Promise.all(t);for(let t of this.Vt)this.abortWhenLayerClosed(t.layer);return this.renderResult}ae(t){let e=t.matches("up-wrapper")?t.children:[t];this.renderResult.fragments.unshift(...e)}ue(t){switch(this.setReloadAttrs(t),t.placement){case"swap":if(this.he(t))return this.$(t.oldElement,t),this.qt(t.oldElement,t),Promise.resolve();{this.ce(t);const e=t.oldElement.parentNode,n={...t,beforeStart(){up.fragment.markAsDestroying(t.oldElement)},afterInsert:()=>{this.le(t),this.responseDoc.finalizeElement(t.newElement),this.pe(t),up.hello(t.newElement,t),this.ae(t.newElement)},beforeDetach:()=>{up.script.clean(t.oldElement,{layer:t.layer})},afterDetach(){up.element.cleanJQuery(),up.fragment.emitDestroyed(t.oldElement,{parent:e,log:!1})},scrollNew:()=>{this.$(t.newElement,t),this.qt(t.newElement,t)}};return up.morph(t.oldElement,t.newElement,t.transition,n)}case"content":{let n=e.wrapChildren(t.oldElement),i=e.wrapChildren(t.newElement),s={...t,placement:"swap",oldElement:n,newElement:i,focus:!1};return this.ue(s).then((()=>{e.unwrap(i),this.$(t.oldElement,t)}))}case"before":case"after":{let n=e.wrapChildren(t.newElement),i="before"===t.placement?"afterbegin":"beforeend";return t.oldElement.insertAdjacentElement(i,n),this.responseDoc.finalizeElement(n),up.hello(n,t),this.ae(n),this.$(n,t),this.qt(n,t),up.animate(n,t.transition,t).then((()=>e.unwrap(n)))}default:up.fail("Unknown placement: %o",t.placement)}}he(t){if(!t.useKeep)return;const{oldElement:n,newElement:i}=t;let s;if(!e.booleanAttr(n,"up-keep"))return;let r=up.fragment.toTarget(n);const o={layer:t.layer};if(s=t.descendantsOnly?up.fragment.get(i,r,o):up.fragment.subtree(i,r,o)[0],s&&!1!==e.booleanAttr(s,"up-keep")){const e={oldElement:n,newElement:s,newData:up.script.data(s),renderOptions:t};if(!up.fragment.emitKeep(e).defaultPrevented)return e}}ce(t){const e=[];if(t.useKeep)for(let n of t.oldElement.querySelectorAll("[up-keep]")){let i=this.he({...t,oldElement:n,descendantsOnly:!0});if(i){const t=n.cloneNode(!0);n.insertAdjacentElement("beforebegin",t),n.classList.add("up-keeping"),up.script.disableSubtree(i.newElement);let s=up.viewport.subtree(i.oldElement);i.revivers=s.map((function(t){let e=up.viewport.copyCursorProps(t);return()=>up.viewport.copyCursorProps(e,t)})),this.fe(document.body)?i.newElement.replaceWith(n):document.body.append(n),e.push(i)}}t.keepPlans=e}le(t){for(let e of t.keepPlans){e.newElement.replaceWith(e.oldElement);for(let t of e.revivers)t()}}pe(t){for(let e of t.keepPlans)e.oldElement.classList.remove("up-keeping")}fe(e){return t.some(this.Vt,(t=>t.oldElement.contains(e)))}$(t,e){return new up.FragmentFocus({...e,fragment:t,autoMeans:up.fragment.config.autoFocus}).process(e.focus)}qt(t,e){return new up.FragmentScrolling({...e,fragment:t,autoMeans:up.fragment.config.autoScroll}).process(e.scroll)}}},1569:()=>{const t=up.util;up.CompilerPass=class CompilerPass{constructor(t,e,{layer:n,data:i,dataMap:s,meta:r}){n||=up.layer.get(t)||up.layer.current,this.de=t,this.me=e,this.C=n,this.ge=i,this.ye=s,r||={},r.layer=n,this.we=r}run(){this.C.asCurrent((()=>{this.setCompileData();for(let t of this.me)this.be(t)}))}setCompileData(){if(this.ge&&(this.de.upCompileData=this.ge),this.ye)for(let t in this.ye)for(let e of this.ve(t))e.upCompileData=this.ye[t]}be(t){const e=this._e(t);if(e.length){if(t.isDefault||up.puts("up.hello()",'Compiling %d× "%s" on %s',e.length,t.selector,this.C),t.batch)this.ke(t,e);else for(let n of e)this.Se(t,n);return up.migrate.postCompile?.(e,t)}}Se(t,e){const n=[e];if(1!==t.length){const t=up.script.data(e);n.push(t,this.we)}const i=this.xe(t,e,n);let s=this.Ee(i);s&&up.destructor(e,s)}ke(e,n){const i=[n];if(1!==e.length){const e=t.map(n,up.script.data);i.push(e,this.we)}const s=this.xe(e,n,i);this.Ee(s)&&up.fail("Compilers with { batch: true } cannot return destructors")}xe(t,e,n){return up.error.guard((()=>t.apply(e,n)))}Ee(e){if(t.isFunction(e)||t.isArray(e)&&t.every(e,t.isFunction))return e}ve(e){return up.fragment.subtree(this.de,t.evalOption(e),{layer:this.C})}_e(e){let n=this.ve(e.selector);return t.filter(n,(t=>{let n=t.upAppliedCompilers||=new Set;if(!n.has(e))return n.add(e),!0}))}}},3742:()=>{const t=up.util,e=up.element;up.Config=class Config{constructor(t=(()=>({}))){this.Oe=t,this.reset(),document.addEventListener("up:framework:reset",(()=>this.reset()))}reset(){Object.assign(this,this.Oe())}matches(t,e){return t.matches(this.selector(e))}selector(n){let i=this[n],s=this["no"+t.upperCaseFirst(n)];return e.unionSelector(i,s)}selectorFn(t){return()=>this.selector(t)}}},2737:()=>{const t=up.util,e=up.element;up.CSSTransition=class CSSTransition{constructor(t,e,n){this.H=t,this.Ce=e,this.Fe=Object.keys(this.Ce),this.Te=n.finishEvent,this.Re=n.duration,this.Le=n.easing,this.Ae=!1}start(){return 0===this.Fe.length?(this.Ae=!0,Promise.resolve()):(this.Pe=t.newDeferred(),this.$e(),this.De=new Date,this.Me(),this.He(),this.Ne(),this.je(),this.Pe)}He(){this.Te&&(this.qe=up.on(this.H,this.Te,this.Be.bind(this)))}Be(t){t.stopPropagation(),this.Bt()}Me(){this.Ue=t.timer(this.Re+100,(()=>this.Bt()))}ze(){clearTimeout(this.Ue)}Ne(){this.Ie=up.on(this.H,"transitionend",this.Ke.bind(this))}Ke(e){if(e.target!==this.H)return;if(new Date-this.De<=.25*this.Re)return;const n=e.propertyName;t.contains(this.Fe,n)&&this.Bt()}Bt(){this.Ae||(this.Ae=!0,this.ze(),this.qe?.(),this.Ie?.(),e.concludeCSSTransition(this.H),this.Ve(),this.Pe.resolve())}$e(){const t=e.style(this.H,["transition-property","transition-duration","transition-delay","transition-timing-function"]);if(e.hasCSSTransition(t)){if("all"!==t["transition-property"]){const n=t["transition-property"].split(/\s*,\s*/),i=e.style(this.H,n);this.Xe=e.setTemporaryStyle(this.H,i)}this.We=e.concludeCSSTransition(this.H)}}Ve(){this.Xe?.(),this.We?.()}je(){e.setStyle(this.H,{"transition-property":this.Fe.join(),"transition-duration":`${this.Re}ms`,"transition-timing-function":this.Le}),e.setStyle(this.H,this.Ce)}}},3635:()=>{const t=up.util;up.DestructorPass=class DestructorPass{constructor(t,e){this.Je=t,this.Ge=e}run(){for(let e of this.Qe()){let n=t.pluckKey(e,"upDestructors");if(n)for(let t of n)this.Ye(t,e);e.classList.remove("up-can-clean")}}Qe(){const t={...this.Ge,destroying:!0};return up.fragment.subtree(this.Je,".up-can-clean",t)}Ye(t,e){up.error.guard((()=>t(e)))}}},1906:()=>{const t=up.util,e=up.element;up.EventEmitter=class EventEmitter extends up.Record{keys(){return["target","event","baseLayer","callback","log","ensureBubbles"]}emit(){return this.Ze(),this.baseLayer?this.baseLayer.asCurrent((()=>this.tn())):this.tn(),this.event}tn(){this.target.dispatchEvent(this.event),this.ensureBubbles&&!this.target.isConnected&&document.dispatchEvent(this.event),up.error.guard((()=>this.callback?.(this.event)))}assertEmitted(){const t=this.emit();if(t.defaultPrevented)throw new up.Aborted(`Event ${t.type} was prevented`)}Ze(){if(!up.log.config.enabled)return;let e,n=this.log;t.isArray(n)?[n,...e]=n:e=[];const{type:i}=this.event;t.isString(n)?up.puts(i,n,...e):!1!==n&&up.puts(i,`Event ${i}`)}static fromEmitArgs(n,i={}){let s,r=t.extractOptions(n);return r=t.merge(i,r),t.isElementish(n[0])?r.target=e.get(n.shift()):n[0]instanceof up.Layer&&(r.layer=n.shift()),t.isGiven(r.layer)&&(s=up.layer.get(r.layer),r.target||=s.element,r.baseLayer||=s),r.baseLayer&&(r.baseLayer=up.layer.get(r.baseLayer)),t.isString(r.target)?r.target=up.fragment.get(r.target,{layer:r.layer}):r.target||(r.target=document),n[0]?.preventDefault?(r.event=n[0],r.log??=n[0].log):t.isString(n[0])?r.event=up.event.build(n[0],r):r.event=up.event.build(r),new this(r)}}},4158:()=>{const t=up.util;up.EventListener=class EventListener extends up.Record{keys(){return["element","eventType","selector","callback","guard","baseLayer","passive","once","capture","beforeBoot"]}constructor(t){super(t),this.en=this.constructor.nn(t),this.isDefault=up.framework.evaling,this.beforeBoot??=0===this.eventType.indexOf("up:framework:"),this.nativeCallback=this.nativeCallback.bind(this)}bind(){const t=this.element.upEventListeners||={};t[this.en]&&up.fail("up.on(): The %o callback %o cannot be registered more than once",this.eventType,this.callback),t[this.en]=this,this.element.addEventListener(...this.sn())}sn(){let e=t.compactObject(t.pick(this,["once","passive","capture"]));return[this.eventType,this.nativeCallback,e]}unbind(){let t=this.element.upEventListeners;t&&delete t[this.en],this.element.removeEventListener(...this.sn())}nativeCallback(e){if(up.framework.beforeBoot&&!this.beforeBoot)return;let n=e.target;if(this.selector&&(n=n.closest(t.evalOption(this.selector))),(!this.guard||this.guard(e))&&n){const t=[e,n],i=this.callback.length;if(1!==i&&2!==i){const e=up.script.data(n);t.push(e)}if("click"===this.eventType&&n.disabled)return;const s=this.callback.bind(n,...t);this.baseLayer?this.baseLayer.asCurrent(s):s()}}static fromElement(t){let e=t.element.upEventListeners;if(e)return e[this.nn(t)]}static nn(e){return e.callback.upUid||=t.uid(),[e.eventType,e.selector,e.callback.upUid].join("|")}static allNonDefault(e){let n=e.upEventListeners;if(n){const e=Object.values(n);return t.reject(e,"isDefault")}return[]}}},3139:()=>{const t=up.util;up.EventListenerGroup=class EventListenerGroup extends up.Record{keys(){return["elements","eventTypes","selector","callback","guard","baseLayer","passive","once","capture","beforeBoot"]}bind(){const e=[];return this.rn((function(t){const n=new up.EventListener(t);return n.bind(),e.push(n.unbind.bind(n))})),t.sequence(e)}rn(t){for(let e of this.elements)for(let n of this.eventTypes)t(this.un(e,n))}un(t,e){return{...this.attributes(),element:t,eventType:e}}unbind(){this.rn((function(t){let e=up.EventListener.fromElement(t);e&&e.unbind()}))}static fromBindArgs(e,n){const i=(e=t.copy(e)).pop();let s;s=e[0].addEventListener?[e.shift()]:t.isJQuery(e[0])||t.isList(e[0])&&e[0][0].addEventListener?e.shift():[document];let r=t.parseTokens(e.shift()),o=up.migrate.fixEventTypes;o&&(r=o(r));const u=t.extractOptions(e);return new this({elements:s,eventTypes:r,selector:e[0],callback:i,...u,...n})}}},2214:()=>{const t=up.util;up.FieldWatcher=class FieldWatcher{constructor(t,e,n){this.Ge=e,this.de=t,this.an=up.form.getScope(t),this.hn=n,this.cn=e.batch,this.ln=e.abortable}start(){this.pn=null,this.fn=this.dn(),this.mn=null,this.gn=!1,this.yn=[],this.wn(this.de),this.de.addEventListener("up:fragment:inserted",(({target:t})=>{t!==this.de&&this.wn(t)})),this.yn.push(up.fragment.onAborted(this.an,(()=>this.bn()))),this.yn.push(up.on(this.an,"reset",(()=>this.vn())))}stop(){this.bn();for(let t of this.yn)t()}_n(e){let n=t.copy(this.Ge);return up.form.watchOptions(e,n,{defaults:{event:"input"}})}wn(t){for(let e of up.form.fields(t))this.kn(e)}kn(t){let e=this._n(t);this.yn.push(up.on(t,e.event,(()=>this.Sn(e))))}bn(){this.pn=null}xn(e,n){this.pn=e,this.En=n;let i=n.delay||0;clearTimeout(this.mn),this.mn=t.timer(i,(()=>{this.mn=null,this.On()}))}Cn(e){return!t.isEqual(e,this.fn)&&!t.isEqual(this.pn,e)}async On(){if(!this.pn)return;if(this.gn)return;if(this.mn)return;if(!this.an.isConnected)return;let e=this.En;const n=this.Fn(this.fn,this.pn);this.fn=this.pn,this.pn=null,this.gn=!0,this.En=null;let i={...e,disable:!1};const s=[];if(this.cn)s.push(this.Tn(n,i));else for(let t in n){const e=n[t];s.push(this.Tn(e,t,i))}if(t.some(s,t.isPromise)){let t=Promise.allSettled(s);up.form.disableWhile(t,e),await t}this.gn=!1,this.On()}Tn(...t){return up.error.guard((()=>this.hn(...t)))}Fn(e,n){const i={};let s=Object.keys(e);s=s.concat(Object.keys(n)),s=t.uniq(s);for(let r of s){const s=e[r],o=n[r];t.isEqual(s,o)||(i[r]=o)}return i}dn(){return up.Params.fromContainer(this.de).toObject()}Sn(t={}){const e=this.dn();this.Cn(e)&&this.xn(e,t)}vn(){t.task((()=>this.Sn()))}}},5949:()=>{const t=up.util;up.FIFOCache=class FIFOCache{constructor({capacity:e=10,normalizeKey:n=t.identity}={}){this.Rn=new Map,this.Ln=e,this.An=n}get(t){return t=this.An(t),this.Rn.get(t)}set(t,e){if(this.Rn.size===this.Ln){let t=this.Rn.keys().next().value;this.Rn.delete(t)}t=this.An(t),this.Rn.set(t,e)}clear(){this.Rn.clear()}}},665:()=>{up.FocusCapsule=class FocusCapsule{constructor(t,e){this.Pn=t,this.$n=e}restore(t,e){let n=up.fragment.get(this.Pn,{layer:t});if(n)return up.viewport.copyCursorProps(this.$n,n),up.focus(n,e),!0}static preserve(t){let e=up.viewport.focusedElementWithin(t.element);if(!e)return;let n=up.fragment.tryToTarget(e);return n?new this(n,up.viewport.copyCursorProps(e)):void 0}}},5240:()=>{const t=up.util,e=up.element;up.FormValidator=class FormValidator{constructor(t){this.Dn=t,this.Mn=[],this.Hn=null,this.Nn=!1,this.jn(),this.qn()}qn(){up.fragment.onAborted(this.Dn,(t=>this.Bn(t)))}Bn(t){this.Mn.length&&(this.Mn=[],this.Un.reject(new up.Aborted(t.reason)),this.jn())}jn(){this.Un=t.newDeferred()}watchContainer(t){let{event:e}=this.zn(t);up.on(t,e,{guard:()=>up.fragment.isAlive(t)},(()=>up.error.muteUncriticalRejection(this.validate({origin:t}))))}validate(t={}){let e=this.In(t);return this.Mn.push(...e),this.Kn(),this.Un}In(t){let e=this.Vn(t)||this.Xn(t)||this.Wn(t.origin);for(let n of e)n.renderOptions=this.zn(n.origin,t),n.target=up.fragment.resolveOrigin(n.target,n);return e}Xn({origin:t,...e}){if(up.form.isField(t))return this.Jn(t)||this.Gn(t,e)}Gn(t,{formGroup:e=!0}){if(!e)return;let n=up.form.groupSolution(t);return n?(up.puts("up.validate()","Validating form group of field %o",t),[n]):void 0}Vn({target:e,origin:n}){if(t.isString(e)){up.puts("up.validate()",'Validating target "%s"',e);let i=up.fragment.splitTarget(e);return t.compact(i.map((function(t){let e=up.fragment.get(t,{origin:n});if(e)return{element:e,target:t,origin:n};up.fail('Validation target "%s" does not match an element',t)})))}}Wn(t){return up.puts("up.validate()","Validating element %o",t),[{element:t,target:up.fragment.toTarget(t),origin:t}]}Jn(t){let n=t.closest("[up-validate]");if(n){let i=e.booleanOrStringAttr(n,"up-validate");return this.Vn({target:i,origin:t})}}zn(t,e){return up.form.watchOptions(t,e,{defaults:{event:"change"}})}Kn(){let e=this.Mn.map((t=>t.renderOptions.delay)),n=Math.min(...e)||0;clearTimeout(this.Hn),this.Hn=t.timer(n,(()=>{this.Hn=null,this.Qn()}))}Qn(){up.error.muteUncriticalRejection(this.Yn())}async Yn(){if(!this.Mn.length)return;if(this.Nn)return;if(this.Hn)return;let e=this.Mn;this.Mn=[];let n=t.map(e,"origin"),i=t.flatMap(n,up.form.fields),s=t.uniq(t.map(i,"name")),r=this.Zn(e),o=t.map(e,"renderOptions"),u=t.mergeDefined(...o,{dataMap:r},up.form.destinationOptions(this.Dn));u.target=t.map(e,"target").join(", "),u.feedback=t.some(o,"feedback"),u.origin=this.Dn,u.focus??="keep",u.failOptions=!1,u.defaultMaybe=!0,u.params=up.Params.merge(u.params,...t.map(o,"params")),u.headers=t.merge(...t.map(o,"headers")),this.ti(u.headers,s),u.guardEvent=up.event.build("up:form:validate",{fields:i,log:"Validating form",params:u.params,form:this.Dn}),this.Nn=!0;let a=this.Un;this.jn(),u.disable=!1;for(let t of e)up.form.disableWhile(a,{disable:t.renderOptions.disable,origin:t.origin});try{a.resolve(up.render(u)),await a}finally{this.Nn=!1,this.Qn()}}ti(t,e){let n=up.protocol.headerize("validate"),i=e.join(" ");(!i||i.length>up.protocol.config.maxHeaderSize)&&(i=":unknown"),t[n]=i}Zn(e){let n={};for(let i of e){let e=t.pluckKey(i.renderOptions,"data");t.pluckKey(i.renderOptions,"keepData")&&(e=up.data(i.element)),e&&(n[i.target]=e)}return n}static forElement(t){let e=up.form.get(t);return e.upFormValidator||=new this(e)}}},2587:()=>{const t=up.util,e=/^([^ >+(]+) (.+)$/;up.FragmentFinder=class FragmentFinder{constructor(t){this.Ge=t,this.F=t.origin,this.ei=t.selector,this.ni=t.document||window.document,this.ii=t.match??up.fragment.config.match,this.si=t.preferOldElements}find(){return this.ri()||this.oi()||this.ui()}ri(){if(this.si)return this.si.find((t=>this.ni.contains(t)&&up.fragment.matches(t,this.ei)))}oi(){if("region"===this.ii&&!up.fragment.containsMainPseudo(this.ei)&&this.F?.isConnected)return this.ai()||this.hi()}ai(){return up.fragment.closest(this.F,this.ei,this.Ge)}hi(){let n=up.fragment.splitTarget(this.ei);return t.findResult(n,(t=>{let n=t.match(e);if(n){let t=up.fragment.closest(this.F,n[1],this.Ge);if(t)return up.fragment.getDumb(t,n[2])}}))}ui(){return up.fragment.getDumb(this.ni,this.ei,this.Ge)}}},7031:()=>{const t=up.util,e=up.element,n={preventScroll:!0};up.FragmentFocus=class FragmentFocus extends up.FragmentProcessor{keys(){return super.keys().concat(["hash","focusCapsule","inputDevice"])}processPrimitive(e){switch(e){case"keep":return this.ci();case"restore":return this.li();case"target":case!0:return this.pi(this.fragment);case"layer":return this.pi(this.layer.getFocusElement());case"main":return this.fi(":main");case"hash":return this.di();case"autofocus":return this.mi();default:if(t.isString(e))return this.fi(e)}}processElement(t){return this.pi(t)}resolveCondition(t){return"lost"===t?this.gi():super.resolveCondition(t)}fi(t){let e=this.findSelector(t);return this.pi(e)}ci(){if(this.gi())return this.focusCapsule?.restore(this.layer,n)}li(){return up.viewport.restoreFocus({layer:this.layer})}mi(){let t=this.fragment&&e.subtree(this.fragment,"[autofocus]")[0];if(t)return this.pi(t)}pi(t){if(t)return up.focus(t,{force:!0,...n,inputDevice:this.inputDevice}),!0}di(){let t=up.viewport.firstHashTarget(this.hash,{layer:this.layer});if(t)return this.pi(t)}gi(){return!this.layer.hasFocus()}}},8057:()=>{const t=up.element;up.FragmentPolling=class FragmentPolling{constructor(t){this.Ge=up.radio.pollOptions(t),this.Je=t,up.destructor(t,this.yi.bind(this)),up.fragment.onAborted(t,this.wi.bind(this)),this.bi="initialized",this.ln=!0,this.vi=!1,this._i()}static forFragment(t){return t.upPolling||=new this(t)}onPollAttributeObserved(){this.ki()}yi(){this.Si()}ki(t){if(Object.assign(this.Ge,t),"started"!==this.bi){if(!up.fragment.isTargetable(this.Je))return void up.warn("[up-poll]","Cannot poll untargetable fragment %o",this.Je);this.bi="started",this.xi(),this.Ei()}}Si(){"started"===this.bi&&(this.Oi(),this.bi="stopped",this.unbindEvents?.())}forceStart(t){Object.assign(this.Ge,t),this.forceStarted=!0,this.ki()}forceStop(){this.Si(),this.forceStarted=!1}xi(){this.unbindEvents||(this.unbindEvents=up.on("visibilitychange up:layer:opened up:layer:dismissed up:layer:accepted",this.Ci.bind(this)))}Ci(){this.Fi()&&this.Ei()}Fi(){return!document.hidden&&("any"===this.Ge.ifLayer||this.Ti())}Oi(){clearTimeout(this.reloadTimer),this.reloadTimer=null}Ei(){this.reloadTimer||this.vi||(this.Oi(),this.reloadTimer=setTimeout(this.Ri.bind(this),this.Li()))}Ri(){this.reloadTimer=null,this.Ai()}Ai(){"started"===this.bi&&(this.Fi()?this.Pi():up.puts("[up-poll]","Will not poll hidden fragment"))}$i(){return this.Ge.interval??t.numberAttr(this.Je,"up-interval")??up.radio.config.pollInterval}Li(){return Math.max(this.$i()-this.Di(),0)}Di(){return new Date-this.Mi}Ti(){return this.layer||=up.layer.get(this.Je),this.layer?.isFront?.()}Pi(){this.Oi();let t=this.ln;try{this.ln=!1,this.vi=!0,up.reload(this.Je,this.Hi()).then(this.Ni.bind(this),this.ji.bind(this))}finally{this.ln=t}}Hi(){let t=up.event.build("up:fragment:poll",{log:["Polling fragment",this.Je]});return{...this.Ge,guardEvent:t}}wi({newLayer:t}){this.ln&&!t&&this.Si()}Ni({fragment:t}){this.vi=!1,this._i(),t?this.qi(t):this.Ei()}qi(t){this.Si(),this.forceStarted&&up.fragment.matches(this.Je,t)&&this.constructor.forFragment(t).forceStart(this.Ge)}ji(t){this.vi=!1,this._i(),this.Ei(),up.error.throwCritical(t)}_i(){this.Mi=new Date}}},2828:()=>{const t=up.util;up.FragmentProcessor=class FragmentProcessor extends up.Record{keys(){return["fragment","autoMeans","origin","layer"]}process(t){let e=this.preprocess(t);return this.tryProcess(e)}preprocess(e){return t.parseTokens(e,{separator:"or"})}tryProcess(e){if(t.isArray(e))return this.processArray(e);if(t.isFunction(e)){let t=up.error.guard((()=>e(this.fragment,this.attributes())));return this.tryProcess(t)}if(t.isElement(e))return this.processElement(e);if(t.isString(e)){if("auto"===e)return this.tryProcess(this.autoMeans);let t=e.match(/^(.+?)-if-(.+?)$/);if(t)return this.resolveCondition(t[2])&&this.process(t[1])}return this.processPrimitive(e)}processArray(e){return t.find(e,(t=>this.tryProcess(t)))}resolveCondition(t){if("main"===t)return this.fragment&&up.fragment.contains(this.fragment,":main")}findSelector(t){const e={layer:this.layer,origin:this.origin};let n=this.fragment&&up.fragment.get(this.fragment,t,e)||up.fragment.get(t,e);if(n)return n;up.warn("up.render()",'Could not find an element matching "%s"',t)}}},4850:()=>{const t=up.util;up.FragmentScrolling=class FragmentScrolling extends up.FragmentProcessor{keys(){return super.keys().concat(["hash","mode","revealTop","revealMax","revealSnap","scrollBehavior"])}processPrimitive(e){switch(e){case"reset":return this.Bi();case"layer":return this.Ui();case"main":return this.zi(":main");case"restore":return this.Ii();case"hash":return this.hash&&up.viewport.revealHash(this.hash,this.attributes());case"target":case"reveal":case!0:return this.Ki(this.fragment);default:if(t.isString(e))return this.zi(e)}}processElement(t){return this.Ki(t)}Ki(t){if(t)return up.reveal(t,this.attributes()),!0}zi(t){let e=this.findSelector(t);return this.Ki(e)}Ui(){return this.Ki(this.layer.getBoxElement())}Bi(){return up.viewport.resetScroll({...this.attributes(),around:this.fragment}),!0}Ii(){return up.viewport.restoreScroll({...this.attributes(),around:this.fragment})}}},7956:()=>{const t=up.element,e=up.util;up.Layer=class Layer extends up.Record{keys(){return["element","stack","history","mode","context","lastScrollTops","lastFocusCapsules"]}defaults(){return{context:{},lastScrollTops:up.viewport.newStateCache(),lastFocusCapsules:up.viewport.newStateCache()}}constructor(t={}){if(super(t),!this.mode)throw"missing { mode } option"}setupHandlers(){up.link.convertClicks(this)}teardownHandlers(){}mainTargets(){return up.layer.mainTargets(this.mode)}sync(){}accept(){throw new up.NotImplemented}dismiss(){throw new up.NotImplemented}peel(t){this.stack.peel(this,t)}evalOption(t){return e.evalOption(t,this)}isCurrent(){return this.stack.isCurrent(this)}isFront(){return this.stack.isFront(this)}isRoot(){return this.stack.isRoot(this)}isOverlay(){return this.stack.isOverlay(this)}isOpen(){return this.stack.isOpen(this)}isClosed(){return this.stack.isClosed(this)}get parent(){return this.stack.parentOf(this)}get child(){return this.stack.childOf(this)}get ancestors(){return this.stack.ancestorsOf(this)}get descendants(){return this.stack.descendantsOf(this)}get subtree(){return[this,...this.descendants]}get index(){return this.Vi??=this.stack.indexOf(this)}getContentElement(){return this.contentElement||this.element}getBoxElement(){return this.boxElement||this.element}getFocusElement(){return this.getBoxElement()}getFirstSwappableElement(){throw new up.NotImplemented}contains(t){return t.closest(up.layer.anySelector())===this.element}on(...t){return this.Xi(t).bind()}off(...t){return this.Xi(t).unbind()}Xi(t){return up.EventListenerGroup.fromBindArgs(t,{guard:t=>this.Wi(t),elements:[this.element],baseLayer:this})}Wi(t){return this.contains(t.target)}wasHitByMouseEvent({clientX:t,clientY:e}){const n=document.elementFromPoint(t,e);return!n||this.contains(n)}Ji(t){return up.EventEmitter.fromEmitArgs(t,{layer:this})}emit(...t){return this.Ji(t).emit()}isDetached(){return!this.element.isConnected}saveHistory(){this.history&&(this.savedTitle=document.title,this.savedMetaTags=up.history.findMetaTags(),this.savedLocation=up.history.location,this.savedLang=up.history.getLang())}restoreHistory(){this.showsLiveHistory()&&(this.savedLocation&&up.history.push(this.savedLocation),this.savedTitle&&(document.title=this.savedTitle),this.savedMetaTags&&up.history.updateMetaTags(this.savedMetaTags),e.isString(this.savedLang)&&up.history.updateLang(this.savedLang))}asCurrent(t){return this.stack.asCurrent(this,t)}updateHistory(t){e.isString(t.location)&&(this.location=t.location),up.history.config.updateMetaTags&&e.isList(t.metaTags)&&(up.migrate?.warnOfHungryMetaTags?.(t.metaTags),this.metaTags=t.metaTags),e.isString(t.title)&&(this.title=t.title),e.isString(t.lang)&&(this.lang=t.lang)}showsLiveHistory(){return this.history&&this.isFront()}get title(){return this.showsLiveHistory()?document.title:this.savedTitle}set title(t){this.savedTitle=t,this.showsLiveHistory()&&(document.title=t)}get metaTags(){return this.showsLiveHistory()?up.history.findMetaTags():this.savedMetaTags}set metaTags(t){this.savedMetaTags=t,this.showsLiveHistory()&&up.history.updateMetaTags(t)}get lang(){return this.showsLiveHistory()?up.history.getLang():this.savedLang}set lang(t){this.savedLang=t,this.showsLiveHistory()&&up.history.updateLang(t)}get location(){return this.showsLiveHistory()?up.history.location:this.savedLocation}set location(t){(this.location!==(t=e.normalizeURL(t))||this.opening)&&(this.savedLocation=t,this.showsLiveHistory()&&up.history.push(t),this.opening||this.emit("up:layer:location:changed",{location:t}))}selector(t){return this.constructor.selector(t)}static selector(t){throw new up.NotImplemented}toString(){throw new up.NotImplemented}affix(...e){return t.affix(this.getFirstSwappableElement(),...e)}[e.isEqual.key](t){return this.constructor===t.constructor&&this.element===t.element}hasFocus(){let t=document.activeElement;return t!==document.body&&this.element.contains(t)}reset(){Object.assign(this,this.defaults())}}},7101:()=>{var t;up.Layer.Cover=((t=class Cover extends up.Layer.OverlayWithViewport{}).mode="cover",t)},5580:()=>{var t;up.Layer.Drawer=((t=class Drawer extends up.Layer.OverlayWithViewport{}).mode="drawer",t)},86:()=>{var t;up.Layer.Modal=((t=class Modal extends up.Layer.OverlayWithViewport{}).mode="modal",t)},7403:()=>{const t=up.element,e=up.util;up.Layer.Overlay=class Overlay extends up.Layer{keys(){return super.keys().concat(["position","align","size","origin","class","backdrop","openAnimation","closeAnimation","openDuration","closeDuration","openEasing","closeEasing","backdropOpenAnimation","backdropCloseAnimation","dismissable","dismissLabel","dismissAriaLabel","onOpened","onAccept","onAccepted","onDismiss","onDismissed","acceptEvent","dismissEvent","acceptLocation","dismissLocation","opening"])}constructor(t){super(t),!0===this.dismissable?this.dismissable=["button","key","outside"]:!1===this.dismissable?this.dismissable=[]:this.dismissable=e.parseTokens(this.dismissable),this.acceptLocation&&(this.acceptLocation=new up.URLPattern(this.acceptLocation)),this.dismissLocation&&(this.dismissLocation=new up.URLPattern(this.dismissLocation))}callback(t){let e=this[t];if(e)return e.bind(this)}createElement(t){this.nesting||=this.Gi();const n=e.compactObject(e.pick(this,["align","position","size","class","nesting"]));this.element=this.affixPart(t,null,n)}createBackdropElement(t){this.backdropElement=this.affixPart(t,"backdrop")}createViewportElement(t){this.viewportElement=this.affixPart(t,"viewport",{"up-viewport":""})}createBoxElement(t){this.boxElement=this.affixPart(t,"box")}createContentElement(t){this.contentElement=this.affixPart(t,"content")}setContent(t){this.contentElement.append(t),this.onContentSet()}onContentSet(){}createDismissElement(e){return this.dismissElement=this.affixPart(e,"dismiss",{"up-dismiss":'":button"',"aria-label":this.dismissAriaLabel}),t.affix(this.dismissElement,'span[aria-hidden="true"]',{text:this.dismissLabel})}affixPart(e,n,i={}){return t.affix(e,this.selector(n),i)}static selector(t){return e.compact(["up",this.mode,t]).join("-")}Gi(){const{parent:t}=this;return this.mode===t.mode?1+t.Gi():0}setupHandlers(){super.setupHandlers(),this.overlayFocus=new up.OverlayFocus(this),this.Qi("button")&&this.createDismissElement(this.getBoxElement()),this.Qi("outside")&&(this.viewportElement?up.on(this.viewportElement,"up:click",(t=>{t.target===this.viewportElement&&this.Yi(t,!0)})):this.unbindParentClicked=this.parent.on("up:click",((t,e)=>{if(!up.layer.isWithinForeignOverlay(e)){const n=this.origin&&this.origin.contains(e);this.Yi(t,n)}}))),this.Qi("key")&&(this.unbindEscapePressed=up.event.onEscape((t=>this.onEscapePressed(t)))),this.registerClickCloser("up-accept",((t,e)=>{this.accept(t,e)})),this.registerClickCloser("up-dismiss",((t,e)=>{this.dismiss(t,e)})),up.migrate.registerLayerCloser?.(this),this.Zi(this.acceptEvent,this.accept),this.Zi(this.dismissEvent,this.dismiss),this.on("up:click","label[for]",((t,e)=>this.ts(t,e)))}ts(e,n){let i=n.getAttribute("for"),s=up.form.fieldSelector(t.idSelector(i)),r=up.fragment.all(s,{layer:"any"}),o=up.fragment.all(s,{layer:this});if(r.length>1&&o[0]!==r[0]){e.preventDefault();const t=o[0];t.focus(),t.matches("input[type=checkbox], input[type=radio]")&&t.click()}}Yi(t,e){up.log.putsEvent(t),e&&up.event.halt(t),up.error.muteUncriticalSync((()=>this.dismiss(":outside",{origin:t.target})))}onEscapePressed(t){if(this.isFront()){let e=up.form.focusedField();e?e.blur():this.Qi("key")&&(up.event.halt(t,{log:!0}),up.error.muteUncriticalSync((()=>this.dismiss(":key"))))}}registerClickCloser(e,n){let i=`[${e}]`;this.on("up:click",i,(function(s){up.event.halt(s,{log:!0});const r=s.target.closest(i),o=t.jsonAttr(r,e),u={origin:r},a=new up.OptionsParser(r,u);a.booleanOrString("animation"),a.string("easing"),a.number("duration"),a.string("confirm"),up.error.muteUncriticalSync((()=>n(o,u)))}))}Zi(t,e){if(t)return this.on(t,(t=>{t.preventDefault(),up.error.muteUncriticalSync((()=>e.call(this,t,{response:t.response})))}))}tryAcceptForLocation(t){this.es(this.acceptLocation,this.accept,t)}tryDismissForLocation(t){this.es(this.dismissLocation,this.dismiss,t)}es(t,e,n){let i,s;if(t&&(i=this.location)&&(s=t.recognize(i))){const t={...s,location:i};up.error.muteUncriticalSync((()=>e.call(this,t,n)))}}teardownHandlers(){super.teardownHandlers(),this.unbindParentClicked?.(),this.unbindEscapePressed?.(),this.overlayFocus.teardown()}destroyElements(t){const e={...t,animation:()=>this.startCloseAnimation(t),onFinished:()=>{this.onElementsRemoved(),t.onFinished?.()},log:!1};up.destroy(this.element,e)}onElementsRemoved(){}ns(t={}){const e=up.animate(this.getBoxElement(),t.boxAnimation,t);let n;return this.backdrop&&!up.motion.isNone(t.boxAnimation)&&(n=up.animate(this.backdropElement,t.backdropAnimation,t)),Promise.all([e,n])}async startOpenAnimation(t={}){await this.ns({boxAnimation:t.animation??this.evalOption(this.openAnimation),backdropAnimation:"fade-in",easing:t.easing||this.openEasing,duration:t.duration||this.openDuration}),this.wasEverVisible=!0}startCloseAnimation(t={}){return this.ns({boxAnimation:this.wasEverVisible&&(t.animation??this.evalOption(this.closeAnimation)),backdropAnimation:this.wasEverVisible&&"fade-out",easing:t.easing||this.closeEasing,duration:t.duration||this.closeDuration})}accept(t=null,e={}){return this.ss("accept",t,e)}dismiss(t=null,e={}){return this.ss("dismiss",t,e)}Qi(t){return e.contains(this.dismissable,t)}ss(t,e,n){return n={...n,verb:t,value:e,layer:this},new up.Change.CloseLayer(n).execute()}getFirstSwappableElement(){return this.getContentElement().children[0]}toString(){return`${this.mode} overlay`}}},6412:()=>{up.Layer.OverlayWithTether=class OverlayWithTether extends up.Layer.Overlay{createElements(){this.origin||up.fail("Missing { origin } option"),this.rs=new up.Tether({anchor:this.origin,align:this.align,position:this.position}),this.createElement(this.rs.parent),this.createContentElement(this.element)}onContentSet(){this.rs.start(this.element)}onElementsRemoved(){this.rs.stop()}sync(){this.isOpen()&&(this.isDetached()||this.rs.isDetached()?this.dismiss(":detached",{animation:!1,preventable:!1}):this.rs.sync())}}},7965:()=>{up.Layer.OverlayWithViewport=class OverlayWithViewport extends up.Layer.Overlay{static getParentElement(){return document.body}createElements(){up.viewport.bodyShifter.raiseStack(),this.createElement(this.constructor.getParentElement()),this.backdrop&&this.createBackdropElement(this.element),this.createViewportElement(this.element),this.createBoxElement(this.viewportElement),this.createContentElement(this.boxElement)}onElementsRemoved(){up.viewport.bodyShifter.lowerStack()}sync(){this.isDetached()&&this.isOpen()&&this.constructor.getParentElement().appendChild(this.element)}}},4552:()=>{var t;up.Layer.Popup=((t=class Popup extends up.Layer.OverlayWithTether{}).mode="popup",t)},7771:()=>{var t;const e=up.element;up.Layer.Root=((t=class Root extends up.Layer{get element(){return e.root}constructor(t){super(t),this.setupHandlers()}getFirstSwappableElement(){return document.body}static selector(){return"html"}setupHandlers(){this.element.upHandlersApplied||(this.element.upHandlersApplied=!0,super.setupHandlers())}sync(){this.setupHandlers()}accept(){this.os()}dismiss(){this.os()}os(){up.fail("Cannot close the root layer")}toString(){return"root layer"}}).mode="root",t)},6066:()=>{var t;const e=up.util,n=up.element;up.LayerLookup=(t=class LayerLookup{constructor(t,n){this.i=t,!1!==n.normalizeLayerOptions&&up.layer.normalizeOptions(n),this.Ge=n,this.us=e.parseTokens(n.layer)}all(){let t=e.flatMap(this.us,(t=>this.hs(t)));return t=e.compact(t),t=e.uniq(t),t}static all(t,...n){const i=e.parseArgIntoOptions(n,"layer"),{layer:s}=i;return s instanceof up.Layer?[s]:new this(t,i).all()}cs(t){return t=n.get(t),e.find(this.i.reversed(),(e=>e.contains(t)))}ls(t){return this.i.at(t)}hs(t){if(t instanceof up.Layer)return t;if(e.isNumber(t))return this.ls(t);if(/^\d+$/.test(t))return this.ls(Number(t));if(e.isElementish(t))return this.cs(t);switch(t){case"any":return[this.ps(),...this.i.reversed()];case"current":return this.ps();case"closest":return this.i.selfAndAncestorsOf(this.ps());case"parent":return this.ps().parent;case"ancestor":case"ancestors":return this.ps().ancestors;case"child":return this.ps().child;case"descendant":case"descendants":return this.ps().descendants;case"subtree":return this.ps().subtree;case"new":return"new";case"root":return this.i.root;case"overlay":case"overlays":return e.reverse(this.i.overlays);case"front":return this.i.front;case"origin":return this.fs();default:return up.fail("Unknown { layer } option: %o",t)}}fs(){let{origin:t,originLayer:e}=this.Ge;return e||(t?this.cs(t):void 0)}ps(){let{baseLayer:t}=this.Ge;if(e.isString(t)){const e={...this.Ge,baseLayer:this.i.current,normalizeLayerOptions:!1,layer:t};return this.constructor.all(this.i,e)[0]}return t||this.fs()||this.i.current}},e.memoizeMethod(t.prototype,{ps:!0,fs:!0}),t)},6387:()=>{const t=up.util;up.LayerStack=class LayerStack{constructor(){this.ds=[],this.layers=[this.gs()]}gs(){return up.layer.build({mode:"root",stack:this})}remove(e){t.remove(this.layers,e)}peel(e,n){const i=t.reverse(e.descendants),s={...n,preventable:!1};for(let t of i)t.dismiss(":peel",s)}reset(){this.peel(this.root,{animation:!1}),this.ds=[],this.root.reset()}isOpen(e){return t.contains(this.layers,e)}isClosed(t){return!this.isOpen(t)}parentOf(t){return this.layers[t.index-1]}childOf(t){return this.layers[t.index+1]}ancestorsOf(e){return t.reverse(this.layers.slice(0,e.index))}selfAndAncestorsOf(t){return[t,...t.ancestors]}descendantsOf(t){return this.layers.slice(t.index+1)}isRoot(t){return this.root===t}isOverlay(t){return this.root!==t}isCurrent(t){return this.current===t}isFront(t){return this.front===t}get(...t){return this.getAll(...t)[0]}getAll(...t){return up.LayerLookup.all(this,...t)}sync(){for(let t of this.layers)t.sync()}asCurrent(t,e){try{return this.ds.push(t),e()}finally{this.ds.pop()}}reversed(){return t.reverse(this.layers)}dismissOverlays(e=null,n={}){n.dismissable=!1;for(let i of t.reverse(this.overlays))i.dismiss(e,n)}at(t){return this.layers[t]}indexOf(t){return this.layers.indexOf(t)}get count(){return this.layers.length}get root(){return this.layers[0]}get overlays(){return this.root.descendants}get current(){return t.last(this.ds)||this.front}get front(){return t.last(this.layers)}}},5390:()=>{const t=up.util;up.LinkFeedbackURLs=class LinkFeedbackURLs{constructor(e){if(this.ys=up.link.isSafe(e),this.ys){const n=e.getAttribute("href");n&&"#"!==n&&(this.ws=t.matchableURL(n));const i=e.getAttribute("up-href");i&&(this.bs=t.matchableURL(i));const s=e.getAttribute("up-alias");s&&(this.vs=new up.URLPattern(s))}}isCurrent(t){return!(!t||this.ws!==t&&this.bs!==t&&!this.vs?.test?.(t,!1))}}},2460:()=>{const t=up.util,e=up.element;up.LinkFollowIntent=class LinkFollowIntent{constructor(t,e){this._s=t,this.hn=e,this.ks("mouseenter mousedown touchstart",(t=>this.Ss(t))),this.ks("mouseleave",(()=>this.xs())),up.fragment.onAborted(this._s,(()=>this.xs()))}ks(t,e){up.on(this._s,t,{passive:!0},e)}Ss(e){if(up.link.shouldFollowEvent(e,this._s))if(this.xs(),"mouseenter"===e.type){let n=this.Es();this.Os=t.timer(n,(()=>this.Tn(e)))}else this.Tn(e)}xs(){clearTimeout(this.Os),up.network.abort((t=>t.origin===this._s&&t.background))}Es(){return e.numberAttr(this._s,"up-preload-delay")??up.link.config.preloadDelay}Tn(t){up.log.putsEvent(t),up.error.muteUncriticalRejection(this.hn())}}},1653:()=>{let t="up.log.enabled",e=!1;try{e=!!sessionStorage?.getItem(t)}catch{}up.LogConfig=class LogConfig extends up.Config{constructor(){super((()=>({banner:!0,format:!0})))}get enabled(){return e}set enabled(n){e=n;try{sessionStorage?.setItem(t,n?"1":"")}catch{}}}},7792:()=>{const t=up.util,e=up.element;up.MotionController=class MotionController{constructor(t){this.Cs=`up-${t}`,this.ei=`.${this.Cs}`,this.finishEvent=`up:${t}:finish`,this.finishCount=0,this.Fs=0}startFunction(t,n,i={}){t=e.list(t);const s=()=>up.error.muteUncriticalRejection(n());if(i.trackMotion=i.trackMotion??up.motion.isEnabled(),!1===i.trackMotion)return s();{i.trackMotion=!1,this.finish(t),this.Ts(t);let e=this.Rs(t,s);return e=e.then((()=>this.Ls(t))),e}}finish(t){if(this.finishCount++,0!==this.Fs&&up.motion.isEnabled()){t=this.As(t);for(let e of t)this.Ps(e);return up.migrate.formerlyAsync?.("up.motion.finish()")}}As(n){return n?t.flatMap(n,(t=>e.list(t.closest(this.ei),t.querySelectorAll(this.ei)))):document.querySelectorAll(this.ei)}isActive(t){return t.classList.contains(this.Cs)}Ps(t){this.$s(t)}$s(t,e={}){return e={target:t,log:!1,...e},up.emit(this.finishEvent,e)}Ts(t){this.Fs++,this.Ds(t,!0)}Ls(t){this.Fs--,this.Ds(t,!1)}Ds(t,e){for(let n of t)n.classList.toggle(this.Cs,e)}Rs(t,e){if(t.length<2)return e();const n=up.on(t,this.finishEvent,(e=>{if(!e.forwarded)for(let n of t)n!==e.target&&this.isActive(n)&&this.$s(n,{forwarded:!0})}));return e().then(n)}async reset(){await this.finish(),this.finishCount=0,this.Fs=0}}},4308:()=>{const t=up.util,e=up.element;up.NonceableCallback=class NonceableCallback{constructor(t,e){this.script=t,this.nonce=e}static fromString(t){let e=t.match(/^(nonce-([^\s]+)\s)?(.*)$/);return new this(e[3],e[2])}toFunction(...t){if(this.nonce){let e=this;return function(...n){return e.Ms(this,t,n)}}return new Function(...t,this.script)}toString(){return`nonce-${this.nonce} ${this.script}`}Ms(t,e,n){let i,s=`\n try {\n up.noncedEval.value = (function(${e.join()}) {\n ${this.script}\n }).apply(up.noncedEval.thisArg, up.noncedEval.args)\n } catch (error) {\n up.noncedEval.error = error\n }\n `;try{if(up.noncedEval={args:n,thisArg:t},i=up.element.affix(document.body,"script",{nonce:this.nonce,text:s}),up.noncedEval.error)throw up.noncedEval.error;return up.noncedEval.value}finally{up.noncedEval=void 0,i&&i.remove()}}Hs(e){return this.nonce&&t.contains(e,this.nonce)}static adoptNonces(n,i){if(!i?.length)return;const s=t.memoize(up.protocol.cspNonce);t.each(up.script.config.nonceableAttributes,(r=>{let o=e.subtree(n,`[${r}^="nonce-"]`);t.each(o,(t=>{let e=t.getAttribute(r),n=this.fromString(e),o=(t,...n)=>up.log.warn("up.render()",`Cannot use callback [${r}="${e}"]: ${t}`,...n);if(!n.Hs(i))return o("Callback's CSP nonce (%o) does not match response header (%o)",n.nonce,i);let u=s();if(!u)return o("Current page's CSP nonce is unknown");n.nonce=u,t.setAttribute(r,n.toString())}))}))}}},1104:()=>{const t=up.util,e=up.element;up.OptionsParser=class OptionsParser{constructor(t,e,n={}){this.Ge=e,this.H=t,this.Ns=n,this.js=n.fail,this.qs=n.closest,this.Bs=n.attrPrefix||"up-",this.Us=n.defaults||{}}string(t,n){this.parse(e.attr,t,n)}boolean(t,n){this.parse(e.booleanAttr,t,n)}number(t,n){this.parse(e.numberAttr,t,n)}booleanOrString(t,n){this.parse(e.booleanOrStringAttr,t,n)}json(t,n){this.parse(e.jsonAttr,t,n)}callback(t,n={}){this.parse(((t,i)=>e.callbackAttr(t,i,n)),t,n)}parse(e,n,i={}){const s=t.wrapList(i.attr??this.zs(n));let r=this.Ge[n];for(let t of s)r??=this.Is(e,this.H,t);r??=i.default??this.Us[n];let o,u=i.normalize;if(u&&(r=u(r)),t.isDefined(r)&&(this.Ge[n]=r),this.js&&(o=up.fragment.failKey(n))){const n=t.compact(t.map(s,(t=>this.Ks(t))));this.parse(e,o,{...i,attr:n})}}include(t){let e=t(this.H,this.Ge,this.Ns);Object.assign(this.Ge,e)}Is(t,n,i){return this.qs?e.closestAttr(n,i,t):t(n,i)}Ks(t){return this.Vs(t,this.Bs+"on-")||this.Vs(t,this.Bs)}Vs(t,e){if(t.startsWith(e))return`${e}fail-${t.substring(e.length)}`}zs(e){return`${this.Bs}${t.camelToKebabCase(e)}`}}},8665:()=>{const t=up.element,e=up.util;up.OverlayFocus=class OverlayFocus{constructor(t){this.C=t,this.pi=this.C.getFocusElement()}moveToFront(){this.Xs||(this.Xs=!0,this.Ws=up.on("focusin",(t=>this.Js(t))),this.Gs=t.setTemporaryAttrs(this.pi,{tabindex:"0",role:"dialog","aria-modal":"true"}),this.Qs=t.affix(this.pi,"beforebegin","up-focus-trap[tabindex=0]"),this.Ys=t.affix(this.pi,"afterend","up-focus-trap[tabindex=0]"))}moveToBack(){this.teardown()}teardown(){this.Xs&&(this.Xs=!1,this.Ws(),this.Gs(),this.Qs.remove(),this.Ys.remove())}Js(t){const{target:e}=t;this.Zs||up.layer.isWithinForeignOverlay(e)||(this.Zs=!0,e===this.Qs?this.tr():e!==this.Ys&&this.C.contains(e)||this.er(),this.Zs=!1)}er(t){up.focus(this.pi,t)}tr(){this.nr(this.C.getBoxElement())||this.er()}nr(t){for(let n of e.reverse(t.children))if(up.viewport.tryFocus(n)||this.nr(n))return!0}}},3645:()=>{const t=up.util,e=up.element;up.Params=class Params{constructor(t){this.clear(),this.addAll(t)}clear(){this.entries=[]}[t.copy.key](){return new up.Params(this)}toObject(){const e={};for(let n of this.entries){const{name:i,value:s}=n;t.isBasicObjectProperty(i)||(this.ir(i)?(e[i]||=[],e[i].push(s)):e[i]=s)}return e}toArray(){return this.entries}toFormData(){const t=new FormData;for(let e of this.entries)t.append(e.name,e.value);return t.entries||(t.originalArray=this.entries),t}toQuery(){let e=t.map(this.entries,this.sr.bind(this));return e=t.compact(e),e.join("&")}sr(e){const{value:n}=e;if(this.rr(n))return;let i=encodeURIComponent(e.name);return t.isGiven(n)&&(i+="=",i+=encodeURIComponent(n)),i}rr(t){return t instanceof Blob}hasBinaryValues(){const e=t.map(this.entries,"value");return t.some(e,this.rr)}toURL(e){let n=[e,this.toQuery()];n=t.filter(n,t.isPresent);const i=t.contains(e,"?")?"&":"?";return n.join(i)}add(t,e){this.entries.push({name:t,value:e})}addAll(e){t.isMissing(e)||(e instanceof this.constructor?this.entries.push(...e.entries):t.isArray(e)?this.entries.push(...e):t.isString(e)?this.ur(e):t.isFormData(e)?this.ar(e):t.isObject(e)?this.hr(e):up.fail("Unsupport params type: %o",e))}hr(e){for(let n in e){const i=e[n],s=t.isArray(i)?i:[i];for(let t of s)this.add(n,t)}}ur(e){for(let n of e.split("&"))if(n){let[e,i]=n.split("=");e=decodeURIComponent(e),i=t.isGiven(i)?decodeURIComponent(i):null,this.add(e,i)}}ar(t){for(let e of t.entries())this.add(...e)}set(t,e){this.delete(t),this.add(t,e)}delete(e){this.entries=t.reject(this.entries,this.cr(e))}cr(t){return e=>e.name===t}get(t){return this.ir(t)?this.getAll(t):this.getFirst(t)}getFirst(e){const n=t.find(this.entries,this.cr(e));return n?.value}getAll(e){if(this.ir(e))return this.getAll(e);{const n=t.map(this.entries,this.cr(e));return t.map(n,"value")}}ir(t){return t.endsWith("[]")}[t.isBlank.key](){return 0===this.entries.length}static fromForm(t){return this.fromContainer(t)}static fromContainer(t){let e=up.form.fields(t);return this.fromFields(e)}static fromFields(e){const n=new this;for(let i of t.wrapList(e))n.addField(i);return n}addField(t){let n=(t=e.get(t)).name;if(n&&!t.disabled){const{tagName:e}=t,{type:i}=t;if("SELECT"===e)for(let e of t.querySelectorAll("option"))e.selected&&this.add(n,e.value);else if("checkbox"===i||"radio"===i)t.checked&&this.add(n,t.value);else{if("file"!==i)return this.add(n,t.value);for(let e of t.files)this.add(n,e)}}}[t.isEqual.key](e){return this.constructor===e.constructor&&t.isEqual(this.entries,e.entries)}static fromURL(e){const n=new this;let i=t.parseURL(e).search;return i&&(i=i.replace(/^\?/,""),n.addAll(i)),n}static stripURL(e){return t.normalizeURL(e,{search:!1})}static merge(...t){return t.reduce((function(t,e){return t.addAll(e),t}),new up.Params)}}},7782:()=>{const t=up.element;up.ProgressBar=class ProgressBar{constructor(){this.lr=0,this.H=t.affix(document.body,"up-progress-bar"),this.H.style.transition="width 300ms ease-out",this.pr(0),up.element.paint(this.H),this.dr=31,this.mr()}mr(){let t;t=this.dr<80?Math.random()<.15?7+5*Math.random():1.5+.5*Math.random():.13*(100-this.dr)*Math.random(),this.pr(this.dr+t),this.lr++;const e=300+40*this.lr;this.timeout=setTimeout(this.mr.bind(this),e)}pr(t){this.dr=t,this.H.style.width=`${t}vw`}destroy(){clearTimeout(this.timeout),this.H.remove()}conclude(){clearTimeout(this.timeout),this.pr(100),setTimeout(this.destroy.bind(this),300)}}},2406:()=>{const t=up.util;up.Record=class Record{keys(){throw"Return an array of keys"}defaults(t){return{}}constructor(t){Object.assign(this,this.defaults(t),this.attributes(t))}attributes(e=this){return t.pick(e,this.keys())}[t.copy.key](){return t.variant(this)}[t.isEqual.key](e){return this.constructor===e.constructor&&t.isEqual(this.attributes(),e.attributes())}}},1279:()=>{up.Rect=class Rect extends up.Record{keys(){return["left","top","width","height"]}get bottom(){return this.top+this.height}get right(){return this.left+this.width}grow(t){this.left-=t,this.top-=t,this.width+=2*t,this.height+=2*t}static fromElement(t){return new this(t.getBoundingClientRect())}}},2714:()=>{var t;const e=up.util;up.RenderJob=(t=class RenderJob{constructor(t){this.options=t}execute(){return this.gr=this.yr(),this}async yr(){try{this.wr(),this.options=up.RenderOptions.preprocess(this.options);let t=await this.br().execute();return this.vr(t),t}catch(t){throw this.vr(t)||this._r(t),t}}vr(t){if(t instanceof up.RenderResult){let{onRendered:n,onFinished:i}=t.options;t.none||up.error.guard((()=>n?.(t)));let s=function(t){up.error.guard((()=>i?.(t)))};return this.finished.then(s,e.noop),!0}}_r(t){let e=t instanceof up.Aborted?"Rendering was aborted":"Error while rendering";up.puts("up.render()",`${e}: ${t.name}: ${t.message}`),up.error.guard((()=>this.options.onError?.(t)))}get finished(){return this.kr()}async kr(){try{let t=await this.gr;return await t.finished}catch(t){throw t instanceof up.RenderResult?await t.finished:t}}br(){if(this.options.url){let t=t=>this.Sr(t);return new up.Change.FromURL({...this.options,onRequest:t})}if(this.options.response){let t=()=>this.Sr(null);return new up.Change.FromResponse({...this.options,onRender:t})}{let t=()=>this.Sr(null);return new up.Change.FromContent({...this.options,onRender:t})}}wr(){up.browser.assertConfirmed(this.options);let t=e.pluckKey(this.options,"guardEvent");if(t&&(t.renderOptions=this.options,up.emit(t,{target:this.options.origin}).defaultPrevented))throw new up.Aborted(`Rendering was prevented by ${t.type} listener`);up.RenderOptions.assertContentGiven(this.options)}Sr(t){let{abort:n}=this.options;if(!n||!up.network.isBusy())return;let{fragments:i,layer:s,origin:r,newLayer:o}=this.br().getPreflightProps(),u={except:t,logOnce:["up.render()","Change with { abort } option will abort other requests"],newLayer:o,origin:r};"target"===n?up.fragment.abort(i,u):"layer"===n?up.fragment.abort({...u,layer:s}):"all"===n||!0===n?up.fragment.abort({...u,layer:"any"}):e.isFunction(n)?n(u):up.fragment.abort(n,{...u,layer:s})}},e.delegate(t.prototype,["then","catch","finally"],(function(){return this.gr})),e.memoizeMethod(t.prototype,{kr:!0,br:!0}),t)},2705:()=>{const t=up.util;up.RenderOptions=function(){const e={useHungry:!0,useKeep:!0,saveScroll:!0,saveFocus:!0,focus:"keep",abort:"target",failOptions:!0},n={abort:!1,confirm:!1,feedback:!1,cache:!0,background:!0},i=["url","method","origin","headers","params","cache","fallback","abort","abortable","confirm","feedback","origin","originLayer","baseLayer","fail","onError"].concat(["keep","hungry","history","source","saveScroll","navigate","baseLayer"]),s=["url","response","content","fragment","document"],r=["history","focus","scroll"];function o({origin:t,originLayer:e}){if(t&&!e)return{originLayer:up.layer.get(t)}}return{preprocess:function(i){up.migrate.preprocessRenderOptions?.(i);const s=t.merge(e,function(t){if(t.navigate)return up.fragment.config.navigateOptions}(i));return t.merge(t.omit(s,r),{defaults:s},{inputDevice:up.event.inputDevice},i,function({url:e}){if(e)return{url:t.normalizeURL(e)}}(i),o(i),function(t){if(t.preload)return n}(i))},finalize:function(e,n){return t.merge(e.defaults,n,e)},assertContentGiven:function(e){t.some(s,(n=>t.isGiven(e[n])))||(e.defaultToEmptyContent?e.content="":up.fail("up.render() needs either { "+s.join(", ")+" } option"))},deriveFailOptions:function(e){let n=function(t){const e={};for(let n in t){const i=t[n];let s=up.fragment.successKey(n);s&&(e[s]=i)}return e}(e),s=o(n);return e.failOptions?{...e.defaults,...t.pick(e,i),...n,...s,failPrefixForced:!0}:{...e,...n,...s}},lookupLayers:o}}()},606:()=>{up.RenderResult=class RenderResult extends up.Record{keys(){return["fragments","layer","target","options","finished"]}defaults(){return{fragments:[]}}get none(){return!this.fragments.length}get fragment(){return this.fragments[0]}static both(t,e,n=!0){return e?new this({target:t.target,layer:t.layer,options:t.options,fragments:t.fragments.concat(e.fragments),finished:n&&this.mergeFinished(t,e)}):t}static async mergeFinished(t,e){return this.both(await t.finished,await e.finished,!1)}static buildNone(){return new this({target:":none",finished:Promise.resolve()})}}},5437:()=>{var t;const e=up.util;up.Request=(t=class Request extends up.Record{keys(){return["method","url","hash","params","target","failTarget","headers","timeout","background","cache","expireCache","evictCache","layer","mode","context","failLayer","failMode","failContext","origin","fragments","builtAt","wrapMethod","contentType","payload","onLoading","fail","abortable","badResponseTime"]}defaults(){return{state:"new",abortable:!0,headers:{},timeout:up.network.config.timeout,builtAt:new Date}}constructor(t){if(super(t),this.params=new up.Params(this.params),null==this.wrapMethod&&(this.wrapMethod=up.network.config.wrapMethod),this.Er(),(this.target||this.layer||this.origin)&&!t.basic){const t={origin:this.origin};this.layer=up.layer.get(this.layer,t),this.failLayer=up.layer.get(this.failLayer,t),this.context||=this.layer.context||{},this.failContext||=this.failLayer?.context||{},this.mode||=this.layer.mode,this.failMode||=this.failLayer?.mode}this.deferred=e.newDeferred(),this.badResponseTime??=e.evalOption(up.network.config.badResponseTime,this),this.Or()}get xhr(){return this.Cr??=new XMLHttpRequest}get fragments(){if(this.Fr)return this.Fr;{let t=up.fragment.parseTargetSteps(this.target),n=e.map(t,"selector"),i={origin:this.origin,layer:this.layer};return e.compact(e.map(n,(t=>up.fragment.get(t,i))))}}set fragments(t){this.Fr=t}get fragment(){return this.fragments?.[0]}Er(){this.method=e.normalizeMethod(this.method),this.Tr(),this.Rr(),this.url=e.normalizeURL(this.url)}Lr(){e.task((()=>{this.layer=void 0,this.failLayer=void 0,this.origin=void 0,this.fragments=void 0}))}Tr(){let t=this.url?.match(/^([^#]*)(#.+)$/);if(t)return this.url=t[1],this.hash=t[2]}Rr(){!this.url||this.allowsPayload()||e.isBlank(this.params)||(this.url=this.params.toURL(this.url),this.params.clear())}isSafe(){return up.network.isSafeMethod(this.method)}allowsPayload(){return e.methodAllowsPayload(this.method)}will302RedirectWithGET(){return this.isSafe()||"POST"===this.method}willCache(){return e.evalAutoOption(this.cache,up.network.config.autoCache,this)}runQueuedCallbacks(){e.always(this,(()=>this.Lr()))}load(){if("new"===this.state)return this.Ar()?(this.state="loading",this.Er(),this.onLoading?.(),this.expired=!1,new up.Request.XHRRenderer(this).buildAndSend({onload:()=>this.Pr(),onerror:()=>this.$r(),ontimeout:()=>this.Dr(),onabort:()=>this.Mr()}),!0):void this.abort({reason:"Prevented by event listener"})}Ar(){return!this.emit("up:request:load",{log:["Loading %s",this.description]}).defaultPrevented}loadPage(){up.network.abort(),new up.Request.FormRenderer(this).buildAndSubmit()}Pr(){const t=this.Hr(),e="Loaded "+t.description;this.emit("up:request:loaded",{request:t.request,response:t,log:e}),this.respondWith(t)}$r(){this.Nr("Network error")}Dr(){this.Nr("Timeout")}Mr(){this.jr()}abort({reason:t}={}){this.jr(t)&&this.Cr&&this.Cr.abort()}jr(t){if(this.qr())return;let e="Aborted request to "+this.description+(t?": "+t:"");return this.state="aborted",this.deferred.reject(new up.Aborted(e)),this.emit("up:request:aborted",{log:e}),!0}Nr(t){if(this.qr())return;let e="Cannot load request to "+this.description+(t?": "+t:"");this.state="offline",this.emit("up:request:offline",{log:e}),this.deferred.reject(new up.Offline(e))}respondWith(t){this.response=t,this.qr()||(this.state="loaded",t.ok?this.deferred.resolve(t):this.deferred.reject(t))}qr(){return"new"!==this.state&&"loading"!==this.state&&"tracking"!==this.state}csrfHeader(){return up.protocol.csrfHeader()}csrfParam(){return up.protocol.csrfParam()}csrfToken(){if(!this.isSafe()&&!this.isCrossOrigin())return up.protocol.csrfToken()}isCrossOrigin(){return e.isCrossOrigin(this.url)}Hr(){const t={method:this.method,url:this.url,request:this,xhr:this.xhr,text:this.xhr.responseText,status:this.xhr.status,title:up.protocol.titleFromXHR(this.xhr),target:up.protocol.targetFromXHR(this.xhr),acceptLayer:up.protocol.acceptLayerFromXHR(this.xhr),dismissLayer:up.protocol.dismissLayerFromXHR(this.xhr),eventPlans:up.protocol.eventPlansFromXHR(this.xhr),context:up.protocol.contextFromXHR(this.xhr),expireCache:up.protocol.expireCacheFromXHR(this.xhr),evictCache:up.protocol.evictCacheFromXHR(this.xhr),fail:this.fail};let n=up.protocol.methodFromXHR(this.xhr),i=up.protocol.locationFromXHR(this.xhr);return i&&(e.matchURLs(this.url,i)||(n||="GET"),t.url=i),n&&(t.method=n),new up.Response(t)}Ji(t){return up.EventEmitter.fromEmitArgs(t,{layer:this.layer,request:this,origin:this.origin})}emit(...t){return this.Ji(t).emit()}assertEmitted(...t){this.Ji(t).assertEmitted()}get description(){return this.method+" "+this.url}isPartOfSubtree(t){return t=e.wrapList(t),e.some(this.fragments,(function(n){return e.some(t,(t=>t.contains(n)))}))}get age(){return new Date-this.builtAt}header(t){return this.headers[t]}Or(){for(let t of["target","failTarget","mode","failMode","context","failContext"])this.Br(t);let t,e;(t=this.csrfHeader())&&(e=this.csrfToken())&&this.Ur(t,e),this.Ur(up.protocol.headerize("version"),up.version)}Br(t){this.Ur(up.protocol.headerize(t),this[t])}Ur(t,n){e.isMissing(n)||((e.isOptions(n)||e.isArray(n))&&(n=e.safeStringifyJSON(n)),this.headers[t]=n)}mergeIfUnsent(t){if("new"!==this.state)return;if(!this.target||!t.target)return;let n=up.fragment.splitTarget(this.target+","+t.target);this.target=e.uniq(n).join(", "),this.Br("target"),this.Fr=e.uniq([...this.fragments,...t.fragments])}static tester(t,{except:n}={}){let i;if(e.isFunction(t))i=t;else if(t instanceof this)i=e=>t===e;else if(e.isString(t)){let e=new up.URLPattern(t);i=t=>e.test(t.url)}else i=e=>t;return n?t=>!up.cache.willHaveSameResponse(t,n)&&i(t):i}},e.delegate(t.prototype,["then","catch","finally"],(function(){return this.deferred})),t)},7974:()=>{const t=up.util;class Route{constructor(){this.varyHeaders=new Set,this.requests=[]}matchBest(e){let n=this.requests.filter((t=>this.satisfies(t,e)));return t.last(n)}delete(e){t.remove(this.requests,e)}put(t){this.requests.push(t)}updateVary(t){for(let e of t.varyHeaderNames)this.varyHeaders.add(e)}satisfies(e,n){return e===n||t.every(this.varyHeaders,(i=>{let s=e.header(i),r=n.header(i);if("X-Up-Target"===i||"X-Up-Fail-Target"===i){if(!s)return!0;if(!r)return!1;let e=t.parseTokens(s,{separator:"comma"}),n=t.parseTokens(r,{separator:"comma"});return t.containsAll(e,n)}return s===r}))}}up.Request.Cache=class Cache{constructor(){this.reset()}reset(){this.zr={},this.Ir=[]}get(t){t=this.Kr(t);let e=this.Vr(t),n=e.matchBest(t);if(n){if(this.Xr(n))return n;this.Wr(t,e)}}async put(t){t=this.Kr(t);let e=this.Vr(t),{response:n}=t;n&&e.updateVary(n);let i=e.requests.filter((n=>e.satisfies(t,n)));for(let t of i)this.Wr(t);t.cacheRoute=e,e.put(t),this.Ir.push(t),this.Jr()}alias(t,e){if(t=this.get(t))return e=this.Kr(e),this.track(t,e,{force:!0}),this.put(e),e}async track(e,n,i={}){n.trackedRequest=e,n.state="tracking";let s=await t.always(e);s instanceof up.Response?i.force||e.cacheRoute.satisfies(e,n)?(n.fromCache=!0,s=t.variant(s,{request:n}),n.respondWith(s),t.delegate(n,["expired","state"],(()=>e))):(delete n.trackedRequest,n.state="new",i.onIncompatible?.(n)):(n.state=e.state,n.deferred.reject(s))}willHaveSameResponse(t,e){return t===e||t===e.trackedRequest}evict(t=!0,e){this.Gr(t,e,(t=>this.Wr(t)))}expire(t=!0,e){this.Gr(t,e,(t=>t.expired=!0))}reindex(t){this.Wr(t),this.put(t)}Wr(e){t.remove(this.Ir,e),e.cacheRoute?.delete(e),delete e.cacheRoute}Vr(t){return t.cacheRoute||(this.zr[t.description]||=new Route)}Xr(t){return t.age<up.network.config.cacheEvictAge}get Qr(){return this.Ir.length}get Ln(){return up.network.config.cacheSize}Jr(){for(let t=0;t<this.Qr-this.Ln;t++)this.Wr(this.Ir[0])}Gr(e=!0,n,i){let s=up.Request.tester(e,n),r=t.filter(this.Ir,s);t.each(r,i)}Kr(e){return t.wrapValue(up.Request,e)}}},5221:()=>{const t=up.util,e=up.element,n=["GET","POST"];up.Request.FormRenderer=class FormRenderer{constructor(t){this.gt=t}buildAndSubmit(){this.params=t.copy(this.gt.params);let i=this.gt.url,{method:s}=this.gt;const r=up.Params.fromURL(i);this.params.addAll(r),i=up.Params.stripURL(i),t.contains(n,s)||(s=up.protocol.wrapMethod(s,this.params)),this.Dn=e.affix(document.body,"form.up-request-loader",{method:s,action:i});let o,u,a=this.gt.contentType;a&&this.Dn.setAttribute("enctype",a),(o=this.gt.csrfParam())&&(u=this.gt.csrfToken())&&this.params.add(o,u),t.each(this.params.toArray(),this.Yr.bind(this)),up.browser.submitForm(this.Dn)}Yr(t){e.affix(this.Dn,"input[type=hidden]",t)}}},6413:()=>{const t=up.util;up.Request.Queue=class Queue{constructor(){this.reset()}reset(){this.Zr=[],this.eo=[],this.no=!1}get allRequests(){return this.eo.concat(this.Zr)}asap(e){e.runQueuedCallbacks(),t.always(e,(t=>this.Et(e,t))),this.io(e),this.so(e),queueMicrotask((()=>this.ro()))}promoteToForeground(t){t.background&&(t.background=!1,this.io(t))}io(e){let n=Math.max(e.badResponseTime-e.age,0);t.timer(n,(()=>this.oo()))}uo(){return t.evalOption(up.network.config.concurrency)}ao(){const t=this.uo();return-1===t||this.eo.length<t}isBusy(){return this.eo.length>0||this.Zr.length>0}so(t){this.Zr.push(t)}ho(){let e=t.find(this.Zr,(t=>!t.background));return e||=this.Zr[0],t.remove(this.Zr,e)}co(t){t.load()&&this.eo.push(t)}Et(e,n){t.remove(this.eo,e)||t.remove(this.Zr,e),n instanceof up.Response&&n.ok&&up.network.registerAliasForRedirect(e,n),this.oo(),queueMicrotask((()=>this.ro()))}ro(){let t;if(this.ao()&&(t=this.ho()))return this.co(t)}abort(...e){let n=t.extractOptions(e),{except:i,reason:s,logOnce:r}=n,o=e[0]??!0,u=up.Request.tester(o,{except:i});for(let e of[this.eo,this.Zr]){const n=t.filter(e,u);for(let i of n)r&&(up.puts(...r),r=null),i.abort({reason:s}),t.remove(e,i)}}oo(){const t=this.lo();this.no!==t&&(this.no=t,t?up.emit("up:network:late",{log:"Server is slow to respond"}):up.emit("up:network:recover",{log:"Slow requests were loaded"}))}lo(){const e=t.reject(this.allRequests,"background");return t.some(e,(t=>t.age>=t.badResponseTime-1))}}},2298:()=>{var t;const e="multipart/form-data",n=up.util;up.Request.XHRRenderer=(t=class XHRRenderer{constructor(t){this.gt=t}buildAndSend(t){const e=this.gt.xhr;this.po=n.copy(this.gt.params),this.gt.timeout&&(e.timeout=this.gt.timeout),e.open(this.fo(),this.gt.url);let i=this.do();i&&e.setRequestHeader("Content-Type",i);for(let t in this.gt.headers){let n=this.gt.headers[t];e.setRequestHeader(t,n)}Object.assign(e,t),e.send(this.mo())}fo(){let t=this.gt.method;return this.gt.wrapMethod&&!this.gt.will302RedirectWithGET()&&(t=up.protocol.wrapMethod(t,this.po)),t}do(){return this.yo(),this.wo}mo(){return this.yo(),this.bo}yo(){this.bo=this.gt.payload,this.wo=this.gt.contentType,!this.bo&&this.gt.allowsPayload()&&(this.wo||(this.wo=this.po.hasBinaryValues()?e:"application/x-www-form-urlencoded"),this.wo===e?(this.wo=null,this.bo=this.po.toFormData()):this.bo=this.po.toQuery().replace(/%20/g,"+"))}},n.memoizeMethod(t.prototype,{yo:!0,fo:!0}),t)},4517:()=>{const t=up.util;up.Response=class Response extends up.Record{keys(){return["method","url","text","status","request","xhr","target","title","acceptLayer","dismissLayer","eventPlans","context","expireCache","evictCache","headers","loadedAt","fail"]}defaults(){return{headers:{},loadedAt:new Date}}get ok(){return!t.evalOption(this.fail??up.network.config.fail,this)}get none(){return!this.text}header(t){return this.headers[t]||this.xhr?.getResponseHeader(t)}get varyHeaderNames(){let e=this.header("Vary");return t.parseTokens(e,{separator:"comma"})}get contentType(){return this.header("Content-Type")}get cspNonces(){return up.protocol.cspNoncesFromHeader(this.header("Content-Security-Policy")||this.header("Content-Security-Policy-Report-Only"))}get lastModified(){let t=this.header("Last-Modified");if(t)return new Date(t)}get etag(){return this.header("ETag")}get json(){return this.parsedJSON||=JSON.parse(this.text)}get age(){return new Date-this.loadedAt}get expired(){return this.age>up.network.config.cacheExpireAge||this.request.expired}get description(){return`HTTP ${this.status} response to ${this.request.description}`}}},7241:()=>{var t;const e=up.util,n=up.element,i=/^\s*<(html|!DOCTYPE)\b/i;up.ResponseDoc=(t=class ResponseDoc{constructor({document:t,fragment:e,content:n,target:i,origin:s,cspNonces:r,match:o}){if(t?this.vo(t):e?this._o(e):this.ko(n||"",i),this.So=r,s){let t=up.fragment.tryToTarget(s);t&&(this.xo=this.select(t))}this.ii=o}vo(t){t instanceof Document?(this.ni=t,this.Eo=!0):e.isString(t)?(this.ni=n.createBrokenDocumentFromHTML(t),this.Eo=i.test(t),this.Oo=!0):(this.ni=this.Co(t),this.Eo=t.matches("html"))}_o(t){let i=e.isString(t)?n.createFromHTML(t):t;this.ni=this.Co(i)}ko(t,i){i||up.fail("must pass a { target } when passing { content }");let s=e.map(up.fragment.parseTargetSteps(i),"selector").join();const r=n.createFromSelector(s);e.isString(t)?r.innerHTML=t:r.appendChild(t),this.ni=this.Co(r)}Co(t){let e=document.createElement("up-document");return e.append(t),e.documentElement=t,e}rootSelector(){return up.fragment.toTarget(this.ni.documentElement)}get title(){return this.Fo(this.To)}Ro(){if(this.Eo)return this.ni.head}Fo(t){let e=this.Ro();return e&&t(e)}get metaTags(){return this.Fo(up.history.findMetaTags)}get assets(){return this.Fo(up.script.findAssets)}get lang(){if(this.Eo)return up.history.getLang(this.ni)}To(t){return t.querySelector("title")?.textContent}select(t){return new up.FragmentFinder({selector:t,origin:this.xo,document:this.ni,match:this.ii}).find()}selectSteps(t){return t.filter((t=>this.Lo(t)||this.Ao(t)))}commitSteps(t){return t.filter((t=>this.commitElement(t.newElement)))}Lo(t){if(t.newElement)return!0;let e=this.select(t.selector);if(!e)return;let{selectEvent:n}=t;return n&&(n.newFragment=e,n.renderOptions=t.originalRenderOptions,up.emit(t.oldElement,n,{callback:t.selectCallback}),n.defaultPrevented)?void 0:(t.newElement=e,!0)}Ao(t){if(!t.maybe)throw new up.CannotMatch}commitElement(t){if(this.ni.contains(t))return up.fragment.config.runScripts||up.script.disableSubtree(t),t.remove(),!0}finalizeElement(t){if(up.NonceableCallback.adoptNonces(t,this.So),this.Oo){let i=n.subtree(t,":is(noscript,script,audio,video):not(.up-keeping, .up-keeping *)");e.each(i,n.fixParserDamage)}}},e.memoizeMethod(t.prototype,{Ro:!0}),t)},2723:()=>{const t=up.element,e=up.util;up.RevealMotion=class RevealMotion{constructor(e,n={}){this.H=e,this.Po=t.get(n.viewport)||up.viewport.get(this.H),this.$o=up.layer.get(this.Po),this.Do=n.scrollBehavior??n.behavior??"instant";const i=up.viewport.config;this.Mo=n.snap??n.revealSnap??i.revealSnap,this.Ho=n.padding??n.revealPadding??i.revealPadding,this.No=n.top??n.revealTop??i.revealTop,this.jo=n.max??n.revealMax??i.revealMax,this.qo=i.selector("fixedTopSelectors"),this.Bo=i.selector("fixedBottomSelectors")}start(){const t=this.Uo(this.Po),n=up.Rect.fromElement(this.H);if(this.jo){const t=e.evalOption(this.jo,this.H);n.height=Math.min(n.height,t)}n.grow(this.Ho),this.zo(t),t.height<0&&up.fail("Viewport has no visible area");const i=this.Po.scrollTop;let s=i;this.No||n.height>t.height?s+=n.top-t.top:n.top<t.top?s-=t.top-n.top:n.bottom>t.bottom&&(s+=n.bottom-t.bottom),e.isNumber(this.Mo)&&s<this.Mo&&n.top<.5*t.height&&(s=0),s!==i&&this.Po.scrollTo({top:s,behavior:this.Do})}Uo(){return up.viewport.isRoot(this.Po)?new up.Rect({left:0,top:0,width:up.viewport.rootWidth(),height:up.viewport.rootHeight()}):up.Rect.fromElement(this.Po)}Io(n){let i=up.fragment.all(n,{layer:this.$o});return e.filter(i,t.isVisible)}zo(t){for(let e of this.Io(this.qo)){let n=up.Rect.fromElement(e).bottom-t.top;n>0&&(t.top+=n,t.height-=n)}for(let e of this.Io(this.Bo)){let n=up.Rect.fromElement(e),i=t.bottom-n.top;i>0&&(t.height-=i)}}}},8720:()=>{const t=up.util,e=/:has\(([^)]+)\)$/;up.Selector=class Selector{constructor(n,i,s={}){let r;if(this.Ko=[],s.destroying||this.Ko.push(up.fragment.isNotDestroying),i&&!document.contains(i)||"any"===s.layer)r=up.layer.root;else{if(s.layer??=t.presence(i,t.isElement),this.W=up.layer.getAll(s),!this.W.length)throw new up.CannotMatch(["Unknown layer: %o",s.layer]);this.Ko.push((e=>t.some(this.W,(t=>t.contains(e))))),r=this.W[0]}let o=up.fragment.expandTargets(n,{...s,layer:r});this.Vo=o.map((t=>(up.browser.canHasSelector()||(t=t.replace(e,((t,e)=>(this.Ko.push((t=>t.querySelector(e))),"")))),t||"*"))),this.Xo=this.Vo.join()||"match-none"}matches(t){return t.matches(this.Xo)&&this.Wo(t)}closest(t){let e;return this.matches(t)?t:(e=t.parentElement)?this.closest(e):void 0}Wo(e){return t.every(this.Ko,(t=>t(e)))}descendants(e=document){const n=t.flatMap(this.Vo,(t=>e.querySelectorAll(t)));return t.filter(n,(t=>this.Wo(t)))}subtree(t){const e=[];return t instanceof Document||!this.matches(t)||e.push(t),e.push(...this.descendants(t)),e}}},7885:()=>{const t=up.util,e=up.element;up.Tether=class Tether{constructor(t){up.migrate.handleTetherOptions?.(t),this.Jo=t.anchor,this.Go=t.align,this.Qo=t.position,this.Yo="top"===this.Qo||"bottom"===this.Qo?"horizontal":"vertical",this.Po=up.viewport.get(this.Jo),this.parent=this.Po===e.root?document.body:this.Po,this.Zo=!this.Po.contains(this.Jo.offsetParent)}start(t){this.H=t,this.H.style.position="absolute",this.tu(0,0),this.sync(),this.eu("on")}stop(){this.eu("off")}eu(t){let e=this.nu.bind(this);up[t](window,"resize",e),this.Zo&&up[t](this.Po,"scroll",e)}nu(){return clearTimeout(this.syncTimer),this.syncTimer=t.task(this.sync.bind(this))}isDetached(){return!this.parent.isConnected||!this.Jo.isConnected}sync(){const n=this.H.getBoundingClientRect(),i=e.styleNumber(this.H,"margin-top"),s=e.styleNumber(this.H,"margin-right"),r=e.styleNumber(this.H,"margin-bottom"),o=e.styleNumber(this.H,"margin-left"),u=this.Jo.getBoundingClientRect();let a,h;switch(this.Yo){case"horizontal":switch(this.Qo){case"top":h=u.top-r-n.height;break;case"bottom":h=u.top+u.height+i}switch(this.Go){case"left":a=u.left+o;break;case"center":a=u.left+.5*(u.width-n.width);break;case"right":a=u.left+u.width-n.width-s}break;case"vertical":switch(this.Go){case"top":h=u.top+i;break;case"center":h=u.top+.5*(u.height-n.height);break;case"bottom":h=u.top+u.height-n.height-r}switch(this.Qo){case"left":a=u.left-s-n.width;break;case"right":a=u.left+u.width+o}}t.isDefined(a)||t.isDefined(h)?this.pr(a,h):up.fail("Invalid tether constraints: %o",this.iu())}iu(){return{position:this.Qo,align:this.Go}}pr(t,e){const n=this.H.getBoundingClientRect();this.tu(t-n.left+this.offsetLeft,e-n.top+this.offsetTop)}tu(t,n){this.offsetLeft=t,this.offsetTop=n,e.setStyle(this.H,{left:t,top:n},"px")}}},4818:()=>{const t=up.util;up.URLPattern=class URLPattern{constructor(e){this.su=[];const n=[],i=[];for(let s of t.parseTokens(e))"-"===s[0]?i.push(s.substring(1)):n.push(s);this.ru=this.ou(n,!0),this.uu=this.ou(i,!1)}ou(e,n){if(!e.length)return;let i=(e=(e=t.flatMap(e,t.matchableURLPatternAtom)).map(t.escapeRegExp)).join("|");return i=i.replace(/\\\*/g,".*?"),i=i.replace(/(:|\\\$)([a-z][\w-]*)/gi,((t,e,i)=>"\\$"===e?(n&&this.su.push({name:i,cast:Number}),"(\\d+)"):(n&&this.su.push({name:i,cast:String}),"([^/?#]+)"))),new RegExp("^(?:"+i+")$")}test(e,n=!0){return n&&(e=t.matchableURL(e)),this.ru.test(e)&&!this.au(e)}recognize(e,n=!0){n&&(e=t.matchableURL(e));let i=this.ru.exec(e);if(i&&!this.au(e)){const t={};return this.su.forEach(((e,n)=>{let s=i[n+1];if(s)return t[e.name]=e.cast(s)})),t}}au(t){return this.uu?.test(t)}}},9675:(t,e,n)=>{n(1860),up.element=function(){const t=up.util;function e(...t){const e=t.pop();return(t[0]||document).querySelector(e)}function n(t,e){const n=[];return t.matches(e)&&n.push(t),n.push(...t.querySelectorAll(e)),n}function i(...n){const i=n.pop();return t.isElement(i)?i:t.isString(i)?e(...n,i):t.isList(i)?(i.length>1&&up.fail("up.element.get(): Cannot cast multiple elements (%o) to a single element",i),i[0]):i}function s(...e){return t.flatMap(e,r)}function r(e){return t.isString(e)?document.querySelectorAll(e):t.wrapList(e)}function o(t){t.setAttribute("hidden","")}function u(t){t.removeAttribute("hidden"),"none"===t.style.display&&(t.style.display="")}function a(e,n){for(let i in n){const s=n[i];t.isGiven(s)?e.setAttribute(i,s):e.removeAttribute(i)}}function h(e,n={}){let i,s,r,{includePath:o}=c(e);for(let t of o){let{tagName:e,id:n,classNames:o,attributes:u}=t;e&&"*"!==e||(e="div"),s=document.createElement(e),i||(i=s),n&&(s.id=n);for(let t of o)s.classList.add(t);for(let t in u){let e=u[t];s.setAttribute(t,e||"")}r?.appendChild(s),r=s}for(let e in n){let s=n[e];if("class"===e)for(let e of t.wrapList(s))i.classList.add(e);else"style"===e?E(i,s):"text"===e?i.textContent=s:"content"===e?i.innerHTML=s:i.setAttribute(e,s)}return i}function c(t){let e;const n=t.replace(/:not\([^)]+\)/,(function(t){return e=t,""})),[i,s]=function(t){let e=[];return[t=p(t,(function({name:t,value:n}){return e.push(n),`[${t}]`})),e]}(n);return{includePath:i.split(/[ >]+/).map((function(e){let n={tagName:null,classNames:[],id:null,attributes:{}};return e=(e=(e=e.replace(/^[\w-*]+/,(function(t){return n.tagName=t,""}))).replace(/#([\w-]+)/,(function(t,e){return n.id=e,""}))).replace(/\.([\w-]+)/g,(function(t,e){return n.classNames.push(e),""})),s.length&&(e=p(e,(function({name:t}){return n.attributes[t]=s.shift(),""}))),e&&up.fail("Cannot parse selector: "+t),n})),includeRaw:n,excludeRaw:e}}const l=/\[([\w-]+)(?:([~|^$*]?=)(["'])?([^\3\]]*?)\3)?]/g;function p(t,e){return t.replace(l,(function(t,n,i,s,r){return r&&(r=r.replace(/\\([\\"'])/,"$1")),e({name:n,operator:i,quote:s,value:r})}))}const f=["HTML","BODY","HEAD","TITLE"];function d(e,n){return t.isGiven(n)?`[${e}="${n=n.replace(/"/g,'\\"')}"]`:`[${e}]`}function m(t){const e=document.createRange();e.setStart(document.body,0);let n=e.createContextualFragment(t.trim()).childNodes;if(1!==n.length)throw new Error("HTML must have a single root element");return n[0]}function g(t){t.offsetHeight}function y(e,n,i){t.isMissing(e.getAttribute(n))&&e.setAttribute(n,i)}function w(e,n){let i=e.getAttribute(n);return t.replaceValue(i,null,void 0)}function b(t,e,n){if(!t.hasAttribute(e))return;const i=w(t,e);switch(i){case"false":return!1;case"true":case"":case e:return!0;default:return!n||i}}function v(t,e){const n=S(t,Object.keys(e));return E(t,e),()=>E(t,n)}function _(t,e){return x(window.getComputedStyle(t),e)}function k(e,n){const i=_(e,n);if(t.isPresent(i))return parseFloat(i)}function S(t,e){const{style:n}=t;return x(n,e)}function x(e,n){return up.migrate.loaded&&(n=up.migrate.fixStyleProps(n)),t.isString(n)?e.getPropertyValue(n):t.mapObject(n,(t=>[t,e.getPropertyValue(t)]))}function E(e,n,i=""){if(up.migrate.loaded&&(n=up.migrate.fixStyleProps(n,i)),t.isString(n))e.setAttribute("style",n);else{const{style:t}=e;for(let e in n){let s=n[e];t.setProperty(e,s+i)}}}function O(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}function C(t){return/^up-/.test(t)}return{subtree:n,contains:function(t,e){const n=i(e);return Node.prototype.contains.call(t,n)},closestAttr:function(t,e,n=w){let i=t.closest("["+e+"]");if(i)return n(i,e)},ancestor:function(t,e){return t.parentNode?.closest(e)},around:function(t,e){return s(t.closest(e),n(t,e))},get:i,list:s,toggle:function(t,e){null==e&&(e=!O(t)),(e?u:o)(t)},hide:o,show:u,metaContent:function(t){const n="meta"+d("name",t);return e(n)?.getAttribute("content")},insertBefore:function(t,e){t.insertAdjacentElement("beforebegin",e)},createFromSelector:h,setAttrs:a,setTemporaryAttrs:function(t,e){const n={};for(let i of Object.keys(e))n[i]=t.getAttribute(i);return a(t,e),()=>a(t,n)},affix:function(e,...n){let i,s;const r=t.extractOptions(n);2===n.length?[i,s]=n:(i="beforeend",s=n[0]);const o=h(s,r);return e.insertAdjacentElement(i,o),o},idSelector:function(t){return t.match(/^[a-z][a-z0-9\-_]*$/i)?`#${t}`:d("id",t)},classSelector:function(t){return`.${t=t.replace(/[^\w-]/g,"\\$&")}`},isSingleton:up.mockable((t=>t.matches(f.join()))),attrSelector:d,tagName:function(t){return t.tagName.toLowerCase()},createBrokenDocumentFromHTML:function(t){return(new DOMParser).parseFromString(t,"text/html")},fixParserDamage:function(t){let e=m(t.outerHTML);t.replaceWith(e)},createFromHTML:m,get root(){return document.documentElement},paint:g,concludeCSSTransition:function(t){const e=v(t,{transition:"none"});return g(t),e},hasCSSTransition:function(t){const e=t["transition-property"],n=t["transition-duration"];return!("none"===e||"all"===e&&0===n)},fixedToAbsolute:function(t){const e=t.getBoundingClientRect();t.style.position="absolute";const n=t.offsetParent.getBoundingClientRect();E(t,{left:e.left-k(t,"margin-left")-n.left+"px",top:e.top-k(t,"margin-top")-n.top+"px",right:"",bottom:""})},setMissingAttrs:function(t,e){for(let n in e)y(t,n,e[n])},setMissingAttr:y,unwrap:function(e){!function(n){const i=document.activeElement;try{return function(){const n=e.parentNode,i=t.toArray(e.childNodes);t.each(i,(t=>n.insertBefore(t,e))),n.removeChild(e)}()}finally{i&&i!==document.activeElement&&i.focus({preventScroll:!0})}}()},wrapChildren:function(t){let e;const n=document.createElement("up-wrapper");for(;e=t.firstChild;)n.appendChild(e);return t.appendChild(n),n},attr:w,booleanAttr:b,numberAttr:function(t,e){let n=t.getAttribute(e);if(n&&(n=n.replace(/_/g,""),n.match(/^-?[\d.]+$/)))return parseFloat(n)},jsonAttr:function(t,e){let n=t.getAttribute?.(e)?.trim();if(n)return JSON.parse(n)},callbackAttr:function(e,n,{exposedKeys:i=[],mainKey:s="event"}={}){let r=e.getAttribute(n);if(r){const n=up.NonceableCallback.fromString(r).toFunction(s,...i);return function(s){const r=Object.values(t.pick(s,i));return n.call(e,s,...r)}}},booleanOrStringAttr:function(t,e,n=!0){let i=b(t,e,!0);return!0===i?n:i},setTemporaryStyle:v,style:_,styleNumber:k,inlineStyle:S,setStyle:E,isVisible:O,upAttrs:function(e){let n=t.filter(e.getAttributeNames(),C);return t.mapObject(n,(t=>[t,e.getAttribute(t)]))},upClasses:function(e){return t.filter(e.classList.values(),C)},toggleAttr:function(t,e,n,i){return null==i&&(i=!t.hasAttribute(e)),i?t.setAttribute(e,n):t.removeAttribute(e)},addTemporaryClass:function(t,e){return t.classList.add(e),()=>t.classList.remove(e)},cleanJQuery:function(t){up.browser.canJQuery()&&jQuery(t).remove()},parseSelector:c,isEmpty:function(t){return!t.children.length>0&&!t.innerText.trim()},crossOriginSelector:function(t){return`[${t}*="//"]:not([${t}*="//${location.host}/"])`},isIntersectingWindow:function(t,{margin:e=0}={}){const n=up.Rect.fromElement(t);return n.grow(e),n.bottom>0&&n.top<window.innerHeight&&n.right>0&&n.left<window.innerWidth},unionSelector:function(e,n){let i=`:is(${e.join()})`;return t.isPresent(n)&&(i+=`:not(${n.join()})`),i}}}()},3924:()=>{up.error=function(){function t(t){if("object"!=typeof(e=t)||!("AbortError"===e.name||e instanceof up.RenderResult||e instanceof up.Response))throw t;var e}function e(t){try{return t()}catch(t){!function(t){console.error("Uncaught %o",t);let e=new ErrorEvent("error",{error:t,message:"Uncaught "+t});window.dispatchEvent(e)}(t)}}return{fail:function(...t){throw new up.Error(t)},throwCritical:t,muteUncriticalRejection:function(e){return e.catch(t)},muteUncriticalSync:function(e){try{return e()}catch(e){t(e)}},guard:e,guardFn:function(t){return(...n)=>e((()=>t(...n)))}}}(),up.fail=up.error.fail},4366:()=>{up.Aborted=class Aborted extends up.Error{constructor(t){super(t,{name:"AbortError"})}}},8010:()=>{up.CannotMatch=class CannotMatch extends up.Error{}},4861:()=>{up.CannotParse=class CannotParse extends up.Error{}},3469:()=>{up.CannotTarget=class CannotTarget extends up.Error{}},376:()=>{up.Error=class Error extends window.Error{constructor(t,e={}){Array.isArray(t)&&(t=up.util.sprintf(...t)),super(t);let n="up."+this.constructor.name;Object.assign(this,{name:n},e)}}},8272:()=>{up.NotImplemented=class NotImplemented extends up.Error{}},4504:()=>{up.Offline=class Offline extends up.Error{}},8670:()=>{up.event=function(){const t=up.util,e=up.element;function n(...t){return i(t).bind()}function i(t,e){return up.EventListenerGroup.fromBindArgs(t,e)}function s(t){return up.EventEmitter.fromEmitArgs(t)}function r(...e){const n=t.extractOptions(e),i=e[0]||n.type||up.fail("Missing event type"),s=new Event(i,{bubbles:!0,cancelable:!0});return Object.assign(s,t.omit(n,["type","target"])),s}const o=["metaKey","shiftKey","ctrlKey","altKey"];function u(e){return(t.isUndefined(e.button)||0===e.button)&&!t.some(o,(t=>e[t]))}function a(e,n,i=[]){const s=r(n,t.pick(e,i));return s.originalEvent=e,["stopPropagation","stopImmediatePropagation","preventDefault"].forEach((function(t){const n=s[t];return s[t]=function(){return e[t](),n.call(s)}})),e.defaultPrevented&&s.preventDefault(),s}n("up:click","[up-emit]",(function(t,n){if(!u(t))return;const i=e.attr(n,"up-emit"),s=e.jsonAttr(n,"up-emit-props"),r=a(t,i);Object.assign(r,s),up.emit(n,r)}));let h=["unknown"];function c(t){h.push(t),setTimeout((()=>h.pop()))}return n("keydown keyup",{capture:!0},(()=>c("key"))),n("pointerdown pointerup",{capture:!0},(()=>c("pointer"))),n("up:framework:reset",(function(){for(let t of[window,document,e.root,document.body])for(let e of up.EventListener.allNonDefault(t))e.unbind()})),{on:n,off:function(...t){return i(t).unbind()},build:r,emit:function(...t){return s(t).emit()},assertEmitted:function(...t){return s(t).assertEmitted()},onEscape:function(t){return n("keydown",(function(e){if("Escape"===e.key)return t(e)}))},halt:function(t,e={}){e.log&&up.log.putsEvent(t),t.stopImmediatePropagation(),t.preventDefault()},isUnmodified:u,isSyntheticClick:function(e){return t.isMissing(e.clientX)},fork:a,keyModifiers:o,get inputDevice(){return t.last(h)}}}(),up.on=up.event.on,up.off=up.event.off,up.emit=up.event.emit},454:()=>{up.feedback=function(){const t=up.util,e=up.element,n=new up.Config((()=>({currentClasses:["up-current"],navSelectors:["[up-nav]","nav"],noNavSelectors:["[up-nav=false]"]}))),i="a, [up-href]";function s(t){return t.upFeedbackURLs||=new up.LinkFeedbackURLs(t)}function r(t,{layer:r}={}){r||=up.layer.get(t);let u=o(r);const a=n.selector("navSelectors"),h=`${a} :is(${i}), ${a}:is(${i})`,c=up.fragment.all(h,{layer:r});for(let t of c){const i=s(t).isCurrent(u);for(let e of n.currentClasses)t.classList.toggle(e,i);e.toggleAttr(t,"aria-current","page",i)}}function o(e){return e.feedbackLocation||t.matchableURL(e.location)}function u(t){const e=t.feedbackLocation,n=o(t.location);e&&e===n||(t.feedbackLocation=n,r(t.element,{layer:t}))}return up.on("up:location:changed",(t=>{!function(){const t=up.layer.front;t.showsLiveHistory()&&u(t)}()})),up.on("up:fragment:compile",((t,e)=>{r(e)})),up.on("up:layer:location:changed",(t=>{u(t.layer)})),up.on("up:framework:reset",(function(){up.layer.root.feedbackLocation=null})),{config:n,showAroundRequest:function(n,s){if(!s.feedback)return;let r=e=>t.always(n,e),o=function(t){let n=t.origin;if(n)return s=n,e.ancestor(s,i)||s;var s}(n);o&&r(e.addTemporaryClass(o,"up-active"));for(let t of n.fragments)r(e.addTemporaryClass(t,"up-loading"))}}}()},2851:()=>{up.form=function(){const t=up.util,e=up.element,n=new up.Config((()=>({groupSelectors:["[up-form-group]","fieldset","label","form"],fieldSelectors:["select","input:not([type=submit]):not([type=image])","button[type]:not([type=submit])","textarea"],submitSelectors:["form:is([up-submit], [up-target], [up-layer], [up-transition])"],noSubmitSelectors:["[up-submit=false]","[target]",e.crossOriginSelector("action")],submitButtonSelectors:["input[type=submit]","input[type=image]","button[type=submit]","button:not([type])"],watchInputEvents:["input","change"],watchInputDelay:0,watchChangeEvents:["change"]})));function i(t=""){return n.fieldSelectors.map((e=>e+t)).join()}function s(t){return t.matches(i())}function r(n){n=e.get(n);let s=e.subtree(n,i());if(n.matches("form[id]")){const r=i(e.attrSelector("form",n.getAttribute("id"))),o=up.fragment.all(r,{layer:n});s.push(...o),s=t.uniq(s)}return s}function o(t){return e.subtree(t,a())}function u(t){return t?.matches(a())}function a(){return n.selector("submitButtonSelectors")}const h=up.mockable(((t,e)=>up.render(c(t,e))));function c(e,n,i){e=x(e),n=t.options(n);let s=new up.OptionsParser(e,n,i);return s.include(d),s.string("failTarget",{default:up.fragment.tryToTarget(e)}),s.booleanOrString("disable"),n.guardEvent||=up.event.build("up:form:submit",{submitButton:n.submitButton,log:"Submitting form",params:n.params,form:e}),n.origin||=up.viewport.focusedElementWithin(e)||n.submitButton||e,s.include(up.link.followOptions),n}function l(t){let e,n=document.activeElement,i=[...r(t),...o(t)];for(let t of i)t===n&&(e=w(n)),p(t);return e&&up.focus(e,{force:!0,preventScroll:!0}),function(){i.forEach(f)}}function p(t){t.upDisableCount||(t.upDisableCount||=0,t.upOriginalDisabled=t.disabled),t.upDisableCount++,t.disabled=!0}function f(t){t.upDisableCount&&(t.disabled?(t.upDisableCount--,t.upDisableCount||(t.disabled=t.upOriginalDisabled)):t.upDisableCount=0)}function d(e,n,i){n=t.options(n),e=x(e);const s=new up.OptionsParser(e,n,i);s.string("contentType",{attr:"enctype"}),s.json("headers");const r=up.Params.fromForm(e),u=n.submitButton??=o(e)[0];return u&&(r.addField(u),n.method||=u.getAttribute("formmethod"),n.url||=u.getAttribute("formaction")),r.addAll(n.params),n.params=r,s.string("url",{attr:"action",default:up.fragment.source(e)}),s.string("method",{attr:["up-method","data-method","method"],default:"GET",normalize:t.normalizeMethod}),"GET"===n.method&&(n.url=up.Params.stripURL(n.url)),n}function m(e,...n){e=up.element.get(e);const i=t.extractCallback(n)||function(t){let e=t.getAttribute("up-watch");if(e)return up.NonceableCallback.fromString(e).toFunction("value","name").bind(t)}(e)||up.fail("No callback given for up.watch()");let s=t.extractOptions(n);const r=new up.FieldWatcher(e,s,i);return r.start(),()=>r.stop()}function g(t,e={}){return m(t,{options:e,batch:!0},((e,n)=>h(t,n)))}function y(){return up.migrate.migratedFormGroupSelectors?.()||n.groupSelectors}function w(t){return b(t).element}function b(e){return t.findResult(y(),(function(t){let n=e.closest(t);if(n){let i=up.fragment.tryToTarget(n),s=up.fragment.tryToTarget(e),r=i||s&&n!==e&&`${t}:has(${s})`;if(r)return{target:r,element:n,origin:e}}}))}function v(n){let i,s;if(n.matches("input[type=checkbox]"))n.checked?(i=n.value,s=":checked"):s=":unchecked";else if(n.matches("input[type=radio]")){const t=E(n),r=n.getAttribute("name"),o=t.querySelector(`input[type=radio]${e.attrSelector("name",r)}:checked`);o?(s=":checked",i=o.value):s=":unchecked"}else i=n.value;const r=[];return t.isPresent(i)?(r.push(i),r.push(":present")):r.push(":blank"),t.isPresent(s)&&r.push(s),r}function _(t,e={}){const n=e.target||e.target||t.getAttribute("up-switch"),i=E(t);n||up.fail("No switch target given for %o",t);const s=v(t);for(let t of up.fragment.all(i,n))k(t,s)}const k=up.mockable((function(n,i){let s;i||=v(function(e){const n=E(e).querySelectorAll("[up-switch]");return t.find(n,(function(t){const n=t.getAttribute("up-switch");return e.matches(n)}))||up.fail("Could not find [up-switch] field for %o",e)}(n));let r=n.getAttribute("up-hide-for");if(r)r=S(r),s=0===t.intersect(i,r).length;else{let e=n.getAttribute("up-show-for");e=e?S(e):[":present",":checked"],s=t.intersect(i,e).length>0}e.toggle(n,s),n.classList.add("up-switched")}));function S(e){return t.parseTokens(e,{json:!0})}function x(t,e={}){const n=up.fragment.get(t,e);return n.form||n.closest("form")}function E(t,e){return x(t,e)||up.layer.get(t).element}return up.on("submit",n.selectorFn("submitSelectors"),(function(e,n){if(e.defaultPrevented)return;const i=t.presence(e.submitter,u);up.event.halt(e,{log:!0}),up.error.muteUncriticalRejection(h(n,{submitButton:i}))})),up.compiler((function(){let t=n.fieldSelectors.map((t=>`${t}[up-validate], [up-validate] ${t}`));return e.unionSelector(t,["[up-validate=false]"])}),(function(t){up.FormValidator.forElement(t).watchContainer(t)})),up.compiler("[up-switch]",(t=>{_(t)})),up.on("change","[up-switch]",((t,e)=>{_(e)})),up.compiler("[up-show-for]:not(.up-switched), [up-hide-for]:not(.up-switched)",(t=>{k(t)})),up.attribute("up-watch",(t=>m(t))),up.attribute("up-autosubmit",(t=>g(t))),{config:n,submit:h,submitOptions:c,destinationOptions:d,watchOptions:function(e,n,i={}){n=t.options(n);let s=new up.OptionsParser(e,n,{...i,closest:!0,attrPrefix:"up-watch-"});s.boolean("feedback"),s.booleanOrString("disable"),s.string("event"),s.number("delay");let r=up.form.config;return"input"===n.event?(n.event=t.evalOption(r.watchInputEvents,e),n.delay??=r.watchInputDelay):"change"===n.event&&(n.event=t.evalOption(r.watchChangeEvents,e)),n.origin||=e,n},isSubmittable:function(t){return t=up.fragment.get(t),n.matches(t,"submitSelectors")},watch:m,validate:function(...e){let n=function(e,...n){const i=t.extractOptions(n);return i.origin?i.target||=up.fragment.toTarget(e):i.origin||=up.fragment.get(e),i}(...e);return up.FormValidator.forElement(n.origin).validate(n)},autosubmit:g,fieldSelector:i,fields:r,isField:s,submitButtons:o,focusedField:function(){return t.presence(document.activeElement,s)},switchTarget:k,disableWhile:function(e,n){let i=function({disable:e,origin:n}){if(!e)return t.noop;let i,s=()=>E(n||void up.fail("Cannot process { disable: '%s' } option without { %s }",e,"origin"));return!0===e?i=[s()]:t.isString(e)&&(i=up.fragment.subtree(s(),e,{origin:n})),t.sequence(i.map(l))}(n);t.always(e,i)},disable:l,group:w,groupSolution:b,groupSelectors:y,get:x,getScope:E}}(),up.submit=up.form.submit,up.watch=up.form.watch,up.autosubmit=up.form.autosubmit,up.validate=up.form.validate},2667:(t,e,n)=>{n(8711);const i=up.util,s=up.element;up.fragment=function(){function t(t){let e=s.tagName(t);if(e.startsWith("up-"))return e}const e=new up.Config((()=>({badTargetClasses:[/^up-/],targetDerivers:["[up-id]","[id]","html","head","body","main","[up-main]",t,"link[rel][type]","link[rel=preload][href]","link[rel=preconnect][href]","link[rel=prefetch][href]","link[rel]","meta[property]","*[name]","form[action]","a[href]","[class]","[up-flashes]","form"],verifyDerivedTarget:!0,navigateOptions:{cache:"auto",revalidate:"auto",feedback:!0,fallback:!0,focus:"auto",scroll:"auto",history:"auto",peel:!0},match:"region",runScripts:!0,autoHistoryTargets:[":main"],autoFocus:["hash","autofocus","main-if-main","keep","target-if-lost"],autoScroll:["hash","layer-if-main"],autoRevalidate:t=>t.expired,skipResponse:n})));function n({response:t,expiredResponse:e}){return!t.text||t.text===e?.text}function r(t,e={}){return t=f(t,e),s.closestAttr(t,"up-source")}function o(t){return i.normalizeURL(t,{hash:!1})}function u(t){let e=s.closestAttr(t,"up-time");if(e&&"false"!==e)return/^\d+$/.test(e)&&(e=1e3*Number(e)),new Date(e)}function a(t){let e=s.closestAttr(t,"up-etag");if(e&&"false"!==e)return e}i.delegate(e,["mainTargets"],(()=>up.layer.config.any));const h=up.mockable(((...t)=>{let e=y(t);return new up.RenderJob(e).execute()})),c=up.mockable(((...t)=>{const e=y(t);return h({...e,navigate:!0})}));function l(t){return!t.closest(".up-destroying")}function p(t){return t.isConnected&&l(t)}function f(...t){const e=i.extractOptions(t),n=t.pop(),r=t[0];return i.isElementish(n)?s.get(n):r?d(r,n,e):new up.FragmentFinder({selector:n,origin:e.origin,layer:e.layer,match:e.match}).find()}function d(...t){return m(...t)[0]}function m(...t){const e=i.extractOptions(t);let n=t.pop();const s=t[0];return i.isElement(n)?[n]:i.isList(n)?n:new up.Selector(n,s,e).descendants(s)}function g(t,e,n={}){return new up.Selector(e,t,n).subtree(t)}function y(t){const e=i.parseArgIntoOptions(t,"target");return i.isElement(e.target)&&(e.origin||=e.target),e}const w=/^(onFail|on|fail)?(.+)$/;function b(t,e){return i.presence(t,i.isString)||v(t,e)||function(t){throw new up.CannotTarget(function(t){return`Cannot derive good target selector from a <${s.tagName(t)}> element without identifying attributes. Try setting an [id] or configure up.fragment.config.targetDerivers.`}(t))}(t)}function v(t,n){return i.findResult(e.targetDerivers,(function(r){let o=function(t,e){if(i.isFunction(e))return e(t);if(t.matches(e))try{return function(t,e){let{includePath:n,excludeRaw:i}=up.element.parseSelector(e);if(1!==n.length)throw new up.CannotParse(e);let{tagName:r,id:o,classNames:u,attributes:a}=n[0],h="";"*"===r?h+=s.tagName(t):r&&(h+=r);for(let t of u)h+=s.classSelector(t);o&&(h+=s.idSelector(o));for(let e in a){let n=a[e]||t.getAttribute(e);if("id"===e)h+=s.idSelector(n);else if("class"===e)for(let e of _(t))h+=s.classSelector(e);else h+=s.attrSelector(e,n)}return i&&(h+=i),h}(t,e)}catch(t){if(t instanceof up.CannotParse)return e;throw t}}(t,r);if(o&&function(t,n,i={}){return!p(n)||!e.verifyDerivedTarget||up.fragment.get(t,{layer:n,...i})===n}(o,t,n))return o}))}function _(t){return i.filter(t.classList,(t=>!i.some(e.badTargetClasses,(e=>{return n=e,s=t,i.isRegExp(n)?n.test(s):n===s;var n,s}))))}const k=/:main\b/,S=/:layer\b/,x=/:origin\b/;function E(t){return k.test(t)}function O(t,e={}){const{layer:n}=e;"new"===n||n instanceof up.Layer||up.fail("Must pass an up.Layer as { layer } option, but got %o",n),t=i.copy(i.wrapList(t));const s=[];for(;t.length;){let r=t.shift();if(!0===r&&(r=":main"),E(r)){let n=C(e),i=up.layer.mainTargets(n).map((t=>r.replace(k,t)));t.unshift(...i)}else if(S.test(r)){if("new"===n||n.opening)continue;let i=b(n.getFirstSwappableElement(),e);t.unshift(r.replace(S,i))}else i.isElementish(r)?s.push(b(r,e)):i.isString(r)&&s.push(T(r,e))}return i.uniq(s)}function C({layer:t,mode:e}){return"new"===t?e||up.fail('Must pass a { mode } option together with { layer: "new" }'):t.mode}function F(t,{origin:e}={}){return t.replace(x,(function(n){if(e)return b(e);up.fail('Missing { origin } element to resolve "%s" reference (found in %s)',n,t)}))}function T(...t){return(up.migrate.resolveOrigin||F)(...t)}function R(t){return i.parseTokens(t,{separator:"comma"})}function L(t,e){let n=up.on("up:fragment:aborted",{guard:e=>e.target.contains(t)},e);return up.destructor(t,n),n}return up.on("up:framework:boot",(function(){const{documentElement:t}=document;if(t.setAttribute("up-source",o(location.href)),up.hello(t),!up.browser.canPushState())return up.warn("Cannot push history changes. Next fragment update will load in a new page.")})),{config:e,reload:function(...t){const e=y(t);e.target||=":main";const n=f(e.target,e);return e.url||=r(n),e.headers=i.merge(e.headers,function(t){let e={},n=u(t);n&&(e["If-Modified-Since"]=n.toUTCString());let i=a(t);return i&&(e["If-None-Match"]=i),e}(n)),(e.keepData||s.booleanAttr(n,"up-keep-data"))&&(e.data=up.data(n)),up.migrate.postprocessReloadOptions?.(e),h(e)},destroy:function(...t){const e=y(t);return(e.element=f(e.target,e))&&new up.Change.DestroyFragment(e).execute(),up.migrate.formerlyAsync?.("up.destroy()")},render:h,navigate:c,get:f,getDumb:d,all:m,subtree:g,contains:function(t,e){return i.isElement(e)?s.contains(t,e)&&up.layer.get(t).contains(e):g(t,e).length>0},closest:function(t,e,n){return new up.Selector(e,t,n).closest(t)},source:r,normalizeSource:o,visit:function(t,e){return c({...e,url:t})},markAsDestroying:function(t){t.classList.add("up-destroying"),t.setAttribute("aria-hidden","true")},emitInserted:function(t){return up.emit(t,"up:fragment:inserted",{log:["Inserted fragment %o",t]})},emitDestroyed:function(t,e){const n=e.log??["Destroyed fragment %o",t],i=e.parent||document;return up.emit(i,"up:fragment:destroyed",{fragment:t,parent:i,log:n})},emitKeep:function(t){let{oldElement:e,newElement:n,newData:i,renderOptions:r}=t;const o=["Keeping fragment %o",e],u=s.callbackAttr(e,"up-on-keep",{exposedKeys:["newFragment","newData"]});return up.emit(e,"up:fragment:keep",{newFragment:n,newData:i,renderOptions:r,log:o,callback:u})},successKey:function(t){let e=w.exec(t);if(e){let[t,n,s]=e;switch(n){case"onFail":return"on"+i.upperCaseFirst(s);case"fail":return i.lowerCaseFirst(s)}}},failKey:function(t){let e=w.exec(t);if(e){let[t,n,s]=e;switch(n){case"on":return"onFail"+i.upperCaseFirst(s);case void 0:return"fail"+i.upperCaseFirst(s)}}},expandTargets:O,resolveOrigin:T,toTarget:b,tryToTarget:v,isTargetable:function(t){return!!v(t)},matches:function(t,e,n={}){if(t=s.get(t),i.isElement(e)){let n=v(e);return n&&t.matches(n)}return new up.Selector(e,t,n).matches(t)},hasAutoHistory:function(t,n){let i=O(e.autoHistoryTargets,{layer:n}).join();for(let e of t)if(s.subtree(e,i).length)return!0;return up.puts("up.render()","Will not auto-update history because fragment doesn't contain a selector from up.fragment.config.autoHistoryTargets"),!1},time:u,etag:a,shouldRevalidate:function(t,n,s={}){return t.fromCache&&i.evalAutoOption(s.revalidate,e.autoRevalidate,n)},abort:function(...t){let e,n,s=y(t),{reason:r,newLayer:o}=s;if(s.target)n=m(s.target,s),e=t=>t.isPartOfSubtree(n),r||="Aborting requests within fragment";else{let t=up.layer.getAll(s);n=i.map(t,"element"),e=e=>i.contains(t,e.layer),r||="Aborting requests within "+t.join(", ")}up.network.abort((t=>t.abortable&&e(t)),{...s,reason:r});for(let t of n)up.emit(t,"up:fragment:aborted",{reason:r,newLayer:o,log:!1})},onAborted:L,onFirstIntersect:function(t,e,{margin:n=0}={}){if(s.isIntersectingWindow(t,{margin:n}))return void e();let i=new IntersectionObserver((function(t){for(let n of t)if(n.isIntersecting)return r(),void e()}),{rootMargin:`${n}px`}),r=()=>i.disconnect();i.observe(t),L(t,r)},splitTarget:R,parseTargetSteps:function(t,e={}){let n=e.defaultPlacement||"swap",i=e.defaultMaybe??!1,s=[],r=R(t);for(let t of r){if(":none"===t)continue;let r=n,o=i;t=t.replace(/\b::?(before|after)\b/,((t,e)=>(r=e,""))),t=t.replace(/\b:maybe\b/,(()=>(o=!0,"")));const u={...e,selector:t,placement:r,maybe:o,originalRenderOptions:e};s.push(u)}return s},isAlive:p,isNotDestroying:l,targetForSteps:function(t){let e=t.filter((t=>!t.maybe||t.oldElement?.isConnected));return i.map(e,"selector").join(", ")||":none"},compressNestedSteps:function(t){if(t.length<2)return t;let e=i.uniqBy(t,"oldElement");return e=i.reject(e,(t=>function(t,e){return i.some(t,(function(t){return t!==e&&("swap"===t.placement||"content"===t.placement)&&t.oldElement.contains(e.oldElement)}))}(e,t))),e},containsMainPseudo:E}}(),up.reload=up.fragment.reload,up.destroy=up.fragment.destroy,up.render=up.fragment.render,up.navigate=up.fragment.navigate,up.visit=up.fragment.visit,i.delegate(up,["context"],(()=>up.layer.current))},9634:()=>{up.framework=function(){let t="evaling";function e(){if("configuring"!==t)return void console.error("Unpoly has already booted");let e=n();e?console.error("Unpoly cannot boot: %s",e):(t="booting",up.emit("up:framework:boot",{log:!1}),t="booted",up.emit("up:framework:booted",{log:!1}))}function n(){for(let t of["URL","Proxy","Promise","DOMParser","FormData"])if(!window[t])return`Browser doesn't support the ${t} API`;if("BackCompat"===document.compatMode)return"Browser is in quirks mode (missing DOCTYPE?)"}return{onEvaled:function(){up.emit("up:framework:evaled",{log:!1}),function(){let t=document.currentScript;return!!t?.async||"manual"===t?.getAttribute("up-boot")||"complete"===document.readyState||void 0}()?console.debug("Call up.boot() after you have configured Unpoly"):document.addEventListener("DOMContentLoaded",e),t="configuring"},boot:e,startExtension:function(){if("configuring"!==t)throw new Error("Unpoly extensions must be loaded before booting");t="evaling"},stopExtension:function(){t="configuring"},reset:function(){up.emit("up:framework:reset",{log:!1})},get evaling(){return"evaling"===t},get booted(){return"booted"===t},get beforeBoot(){return"booting"!==t&&"booted"!==t},isSupported:function(){return!n()}}}(),up.boot=up.framework.boot},8944:()=>{up.history=function(){const t=up.util,e=up.element,n=new up.Config((()=>({enabled:!0,updateMetaTags:!0,restoreTargets:["body"],metaTagSelectors:["meta","link[rel=alternate]","link[rel=canonical]","link[rel=icon]","[up-meta]",'script[type="application/ld+json"]'],noMetaTagSelectors:["meta[http-equiv]","[up-meta=false]","meta[name=csp-nonce]"]})));let i,s;function r(){return t.normalizeURL(location.href)}function o(){const t=r();s!==t&&(i=s,s=t)}function u(e,n){return t.matchURLs(e,location.href,{hash:!0,...n})}function a(e,n={}){c("replaceState",e=t.normalizeURL(e))&&!1!==n.event&&h({location:e,reason:"replace",log:`Replaced state for ${e}`})}function h(t){let e=up.event.build("up:location:changed",t);up.migrate?.renamedProperty?.(e,"url","location"),up.emit(e)}function c(t,e){if(n.enabled){const n={up:{}};return window.history[t](n,"",e),o(),!0}}function l(t){o();let e=r();h({location:e,reason:"pop",log:`Navigated to history entry ${e}`}),up.viewport.saveFocus({location:i}),up.viewport.saveScroll({location:i}),function(t){if(!t?.up)return void up.puts("popstate","Ignoring a history state not owned by Unpoly");let e=r();up.error.muteUncriticalRejection(up.render({guardEvent:up.event.build("up:location:restore",{location:e,log:`Restoring location ${e}`}),url:e,target:n.restoreTargets,fail:!1,history:!0,location:e,peel:!0,layer:"root",cache:"auto",revalidate:"auto",saveScroll:!1,scroll:["restore","auto"],saveFocus:!1,focus:["restore","auto"]}))}(t.state)}function p(){window.addEventListener("popstate",l),"GET"===up.protocol.initialRequestMethod()&&a(r(),{event:!1})}function f(t=document.head){return t.querySelectorAll(n.selector("metaTagSelectors"))}return o(),up.on("up:framework:boot",(function(){"jasmine"in window?p():setTimeout(p,100)})),up.macro("[up-back]",(function(t){i&&(e.setMissingAttrs(t,{"up-href":i,"up-scroll":"restore"}),t.removeAttribute("up-back"),up.link.makeFollowable(t))})),up.on("up:framework:reset",(function(){i=void 0,s=void 0,o()})),{config:n,push:function(e){!u(e=t.normalizeURL(e))&&c("pushState",e)&&h({location:e,reason:"push",log:`Advanced to location ${e}`})},replace:a,get location(){return r()},get previousLocation(){return i},isLocation:u,findMetaTags:f,updateMetaTags:function(t){let e=f();for(let t of e)t.remove();for(let e of t)document.head.append(e)},getLang:function(t=document){let{documentElement:e}=t;if(e.matches("html"))return t.documentElement.lang},updateLang:function(t){e.toggleAttr(e.root,"lang",t,!!t)}}}()},9443:(t,e,n)=>{n(4432);const i=up.util,s=up.element;up.layer=function(){const t=[up.Layer.Root,up.Layer.Modal,up.Layer.Popup,up.Layer.Drawer,up.Layer.Cover],e=new up.Config((function(){const e={mode:"modal",any:{mainTargets:["[up-main='']","main",":layer"]},root:{mainTargets:["[up-main~=root]"],history:!0},overlay:{mainTargets:["[up-main~=overlay]"],openAnimation:"fade-in",closeAnimation:"fade-out",dismissLabel:"×",dismissAriaLabel:"Dismiss dialog",dismissable:!0,history:"auto"},cover:{mainTargets:["[up-main~=cover]"]},drawer:{mainTargets:["[up-main~=drawer]"],backdrop:!0,position:"left",size:"medium",openAnimation(t){switch(t.position){case"left":return"move-from-left";case"right":return"move-from-right"}},closeAnimation(t){switch(t.position){case"left":return"move-to-left";case"right":return"move-to-right"}}},modal:{mainTargets:["[up-main~=modal]"],backdrop:!0,size:"medium"},popup:{mainTargets:["[up-main~=popup]"],position:"bottom",size:"medium",align:"left",dismissable:"outside key"},foreignOverlaySelectors:["dialog"]};for(let n of t)e[n.mode].Class=n;return e}));let n=null,r=[];function o(t){return"root"===t?[e.root,e.any]:[e[t],e.overlay,e.any]}async function u(t){return t=i.options(t,{layer:"new",defaultToEmptyContent:!0,navigate:!0}),(await up.render(t)).layer}up.on("up:fragment:destroyed",(function(){n.sync()})),up.on("up:framework:evaled",(function(){n=new up.LayerStack})),up.on("up:framework:reset",(function(){n.reset(),r=i.filter(r,"isDefault")}));const a={config:e,mainTargets:function(t){return i.flatMap(o(t),"mainTargets")},open:u,build:function(t,s){const{mode:r}=t,{Class:u}=e[r],a=i.reverse(o(r));let h=up.migrate.handleLayerConfig;return h&&a.forEach(h),t.openAnimation??=i.pluckKey(t,"animation"),t=i.mergeDefined(...a,{mode:r,stack:n},t),s&&(t=s(t)),new u(t)},ask:function(t){return new Promise((function(e,n){u(t={...t,onAccepted:t=>e(t.value),onDismissed:t=>n(t.value)})}))},normalizeOptions:function(t){!function(t){if(!(t.layer instanceof up.Layer))if(up.migrate.handleLayerOptions?.(t),i.isGiven(t.layer)){let n=String(t.layer).match(/^(new|shatter|swap)( (\w+))?/);if(n){t.layer="new";const i=n[1],s=n[3];t.mode||=s||e.mode,"swap"===i?up.layer.isOverlay()&&(t.baseLayer="parent"):"shatter"===i&&(t.baseLayer="root")}}else t.mode?t.layer="new":i.isElementish(t.target)?t.layer=n.get(t.target,{normalizeLayerOptions:!1}):t.origin?t.layer="origin":t.layer="current"}(t),t.context??={},function(t){t.baseLayer instanceof up.Layer||(t.baseLayer=n.get("current",{...t,normalizeLayerOptions:!1}))}(t)},openCallbackAttr:function(t,e){return s.callbackAttr(t,e,{exposedKeys:["layer"]})},closeCallbackAttr:function(t,e){return s.callbackAttr(t,e,{exposedKeys:["layer","value","response"]})},anySelector:function(){return i.map(t,(t=>t.selector())).join()},optionToString:function(t){return i.isString(t)?`layer "${t}"`:t.toString()},get stack(){return n.layers},isWithinForeignOverlay:function(t){let n=e.selector("foreignOverlaySelectors");return!(!n||!t.closest(n))}};return i.delegate(a,["get","getAll","root","overlays","current","front","sync","count","dismissOverlays"],(()=>n)),i.delegate(a,["accept","dismiss","isRoot","isOverlay","isFront","on","off","emit","parent","history","location","mode","context","element","contains","size","affix"],(()=>n.current)),a}()},3849:(t,e,n)=>{n(2065),up.link=function(){const t=up.util,e=up.element;let n=null;const i="[up-content], [up-fragment], [up-document]",s=`${i}, [up-target], [up-layer], [up-transition], [up-preload]`,r=new up.Config((()=>({followSelectors:["[up-follow]",`a:is(${s})`],noFollowSelectors:["[up-follow=false]","a[download]","a[target]",'a[href^="javascript:"]','a[href^="mailto:"]',`a[href^="#"]:not(${i})`,e.crossOriginSelector("href"),e.crossOriginSelector("up-href")],instantSelectors:["[up-instant]"],noInstantSelectors:["[up-instant=false]","[onclick]"],preloadSelectors:["[up-preload]"],noPreloadSelectors:["[up-preload=false]"],clickableSelectors:["[up-clickable]","[up-follow]","[up-emit]","[up-accept]","[up-dismiss]",`a:is(${s})`],noClickableSelectors:["[up-clickable=false]","a[href], button"],preloadDelay:90}))),o=up.mockable((function(t,e,n){return up.render(a(t,e,n))}));function u(e,n,i){n=t.options(n);const s=new up.OptionsParser(e,n,{...i,fail:!1});return n.url=function(t,e={}){const n=e.url||t.getAttribute("up-href")||t.getAttribute("href");if("#"!==n)return n}(e,n),n.method=c(e,n),s.json("headers"),s.json("params"),s.booleanOrString("cache"),s.booleanOrString("expireCache"),s.booleanOrString("evictCache"),s.booleanOrString("revalidate"),s.booleanOrString("abort"),s.boolean("abortable"),s.boolean("background"),s.string("contentType"),s.number("badResponseTime"),s.number("timeout"),n}function a(e,n,i){e=up.fragment.get(e),n=t.options(n);const s=new up.OptionsParser(e,n,{fail:!0,...i});return s.include(u),s.boolean("feedback"),n.origin||=e,s.boolean("fail"),s.boolean("navigate",{default:!0}),s.string("confirm",{attr:["up-confirm","data-confirm"]}),s.string("target"),s.booleanOrString("fallback"),s.string("match"),s.string("content"),s.string("fragment"),s.string("document"),s.boolean("useKeep"),s.boolean("useHungry"),s.callback("onLoaded"),s.callback("onRendered",{mainKey:"result"}),s.callback("onFinished",{mainKey:"result"}),s.callback("onOffline",{mainKey:"error"}),s.callback("onError",{mainKey:"error"}),s.boolean("peel"),s.string("layer"),s.string("baseLayer"),s.json("context"),s.string("mode"),s.string("align"),s.string("position"),s.string("class"),s.string("size"),s.booleanOrString("dismissable"),s.parse(up.layer.openCallbackAttr,"onOpened"),s.parse(up.layer.closeCallbackAttr,"onAccepted"),s.parse(up.layer.closeCallbackAttr,"onDismissed"),s.string("acceptEvent"),s.string("dismissEvent"),s.string("acceptLocation"),s.string("dismissLocation"),s.booleanOrString("history"),s.booleanOrString("focus"),s.boolean("saveScroll"),s.boolean("saveFocus"),s.booleanOrString("scroll"),s.boolean("revealTop"),s.number("revealMax"),s.number("revealPadding"),s.number("revealSnap"),s.string("scrollBehavior"),s.booleanOrString("history"),s.booleanOrString("location"),s.booleanOrString("title"),s.boolean("metaTags"),s.booleanOrString("lang"),s.include(up.motion.motionOptions),n.guardEvent??=up.event.build("up:link:follow",{log:["Following link %o",e]}),n}function h(t,e){let n=function(t){if(!g(t))return"Will not preload an unsafe link"}(t=up.fragment.get(t));if(n)return Promise.reject(new up.Error(n));const i=up.event.build("up:link:preload",{log:["Preloading link %o",t]});return o(t,{abortable:!1,...e,guardEvent:i,preload:!0})}function c(e,n={}){return t.normalizeMethod(n.method||e.getAttribute("up-method")||e.getAttribute("data-method"))}function l(t){return t=up.fragment.get(t),r.matches(t,"followSelectors")}function p(t){l(t)||t.setAttribute("up-follow","")}function f(t,e){if(t.defaultPrevented)return!1;const n=`a, [up-follow], ${up.form.fieldSelector()}`,i=t.target.closest(n);return!i||i===e}function d(t){const e=t.closest(r.selector("instantSelectors"));return e&&(n=e,!(r.matches(n,"noInstantSelectors")||r.matches(n,"noFollowSelectors")));var n}function m(t){let e=["clientX","clientY","button",...up.event.keyModifiers];const n=up.event.fork(t,"up:click",e);up.emit(t.target,n,{log:!1})}function g(t){const e=c(t);return up.network.isSafeMethod(e)}function y(t,n,i){switch(t){case"insert":i();break;case"reveal":{let t=e.numberAttr(n,"up-intersect-margin");up.fragment.onFirstIntersect(n,i,{margin:t});break}case"hover":new up.LinkFollowIntent(n,i)}}function w(t,e){let n={navigate:!1,guardEvent:up.event.build("up:deferred:load",{log:["Loading deferred %o",t]}),...e};return o(t,n,{defaults:{target:":origin",cache:"auto",revalidate:"auto",feedback:!0}})}return up.macro(r.selectorFn("clickableSelectors"),(function(t){let n=t.matches("a, [up-follow]")?"link":"button";e.setMissingAttrs(t,{tabindex:"0",role:n,"up-clickable":""}),t.addEventListener("keydown",(function(e){if("Enter"===e.key||"button"===t.role&&"Space"===e.key)return m(e)}))})),up.attribute("up-defer",{defaultValue:"insert"},(function(t,e){y(e,t,(()=>up.error.muteUncriticalRejection(w(t))))})),up.on("up:click",r.selectorFn("followSelectors"),(function(t,e){f(t,e)&&(up.event.halt(t,{log:!0}),up.focus(e,{preventScroll:!0}),up.error.muteUncriticalRejection(o(e)))})),up.attribute("up-expand",{defaultValue:"a, [up-href]",macro:!0},(function(t,n){let i=e.get(t,n);i&&(e.setMissingAttrs(t,{"up-href":e.attr(i,"href"),...e.upAttrs(i)}),t.classList.add(...e.upClasses(i)),p(t))})),up.compiler(r.selectorFn("preloadSelectors"),(function(t){if(!function(t){return!up.browser.canPushState()||!l(t)||!function(t){const e=u(t);if(e.url)return null==e.cache&&(e.cache="auto"),e.basic=!0,new up.Request(e).willCache()}(t)}(t)){let n=()=>up.error.muteUncriticalRejection(h(t));y(e.booleanOrStringAttr(t,"up-preload",null)??"hover",t,n)}})),up.on("up:framework:reset",(function(){n=null})),{follow:o,followOptions:a,requestOptions:u,preload:h,makeFollowable:p,isSafe:g,isFollowable:l,shouldFollowEvent:f,convertClicks:function(t){t.on("click",(function(e,i){if(up.event.isUnmodified(e))return d(i)&&n?up.event.halt(e):("key"===up.event.inputDevice||up.event.isSyntheticClick(e)||t.wasHitByMouseEvent(e)&&(!n||n===e.target))&&m(e),n=null})),t.on("mousedown",(function(t,e){up.event.isUnmodified(t)&&(n=t.target,d(e)&&m(t))}))},config:r,loadDeferred:w}}(),up.follow=up.link.follow,up.deferred={load:up.link.loadDeferred}},4453:()=>{up.log=function(){const t=up.util,e=new up.LogConfig;function n(t,e,n,...s){i(t,e,"",n,...s)}function i(n,i,s,r,...o){r&&(e.format?console[n](`%c${i}%c ${r}`,"color: #666666; padding: 1px 3px; border: 1px solid #bbbbbb; border-radius: 2px; font-size: 90%; display: inline-block;"+s,"",...o):console[n](`[${i}] ${t.sprintf(r,...o)}`))}return up.on("up:framework:boot",(function(){if(!e.banner)return;const t=` __ _____ ___ ___ / /_ __\n/ // / _ \\/ _ \\/ _ \\/ / // / ${up.version}\n\\___/_//_/ .__/\\___/_/\\_. / \n / / / /\n\n`;let n="";up.migrate.loaded||(n+="Load unpoly-migrate.js to polyfill deprecated APIs.\n\n"),e.enabled?n+="Call `up.log.disable()` to disable logging for this session.":n+="Call `up.log.enable()` to enable logging for this session.";const i="color: #777777";e.format?console.log("%c"+t+"%c"+n,"font-family: monospace;"+i,i):console.log(t+n)})),{puts:function(...t){e.enabled&&n("log",...t)},putsEvent:function(t){if(e.enabled){let e="#5566cc";i("log",(t=t.originalEvent||t).type,`color: white; border-color: ${e}; background-color: ${e}`,"Interaction on %o",t.target)}},error:(...t)=>n("error",...t),warn:(...t)=>n("warn",...t),config:e,enable:function(){e.enabled=!0},disable:function(){e.enabled=!1}}}(),up.puts=up.log.puts,up.warn=up.log.warn},6535:()=>{up.migrate={config:{}}},8374:()=>{up.mockable=function(t){if(window.jasmine){let e=t.name,n={[e]:t},i=function(){return n[e].apply(this,arguments)};return i.mock=()=>spyOn(n,e),i}return t}},4034:()=>{up.motion=function(){const t=up.util,e=up.element;let n={},i={};const s=new up.MotionController("motion"),r=new up.Config((()=>({duration:175,easing:"ease",enabled:!matchMedia("(prefers-reduced-motion: reduce)").matches})));function o(e){return t.pickBy(e,"isDefault")}function u(){return r.enabled}function a(t,n,i){return c(i),u()&&!y(n)&&i.duration>0&&!e.isSingleton(t)}function h(t,e,n){return up.migrate.loaded&&(e=up.migrate.fixStyleProps(e)),n={...n,finishEvent:s.finishEvent},new up.CSSTransition(t,e,n).start()}function c(t){t.easing??=r.easing,t.duration??=r.duration}function l(e){if(!y(e)){if(t.isFunction(e))return e;if(t.isArray(e))return p(...e);if(t.isString(e)){let t;if(e.indexOf("/")>=0)return p(...e.split("/"));if(t=i[e])return l(t)}else up.fail("Unknown transition %o",e)}}function p(e,n){if(!y(e)&&!y(n)){const i=f(e)||t.asyncNoop,s=f(n)||t.asyncNoop;return(t,e,n)=>Promise.all([i(t,n),s(e,n)])}}function f(e){var i;if(!y(e))return t.isFunction(e)?e:t.isString(e)?n[i=e]||up.fail("Unknown animation %o",i):t.isOptions(e)?(t,n)=>h(t,e,n):void up.fail("Unknown animation %o",e)}const d=up.mockable((function(t,e){t.replaceWith(e)}));function m(t,e){const n=l(e);n.isDefault=up.framework.evaling,i[t]=n}function g(t,e){const i=f(e);i.isDefault=up.framework.evaling,n[t]=i}function y(t){return!t||"none"===t}function w(t,n,i){g(t,(function(t,s){return t.style.opacity=0,e.setStyle(t,{opacity:n}),h(t,{opacity:i},s)}))}function b(t,e){return{transform:`translate(${t}px, ${e}px)`}}function v(t){return e.setStyle(t,{transform:""}),t.getBoundingClientRect()}function _(t,n){const i=`move-from-${t}`;g(`move-to-${t}`,(function(t,e){const i=v(t);return h(t,n(i),e)})),g(i,(function(t,i){const s=v(t),r=n(s);return e.setStyle(t,r),h(t,{transform:""},i)}))}return up.on("up:framework:boot",(function(){u()||up.puts("up.motion","Animations are disabled")})),w("fade-in",0,1),w("fade-out",1,0),_("top",(function(t){return b(0,-(t.top+t.height))})),_("bottom",(function(t){return b(0,up.viewport.rootHeight()-t.top)})),_("left",(function(t){return b(-(t.left+t.width),0)})),_("right",(function(t){return b(up.viewport.rootWidth()-t.left,0)})),m("cross-fade",["fade-out","fade-in"]),m("move-left",["move-to-left","move-from-right"]),m("move-right",["move-to-right","move-from-left"]),m("move-up",["move-to-top","move-from-bottom"]),m("move-down",["move-to-bottom","move-from-top"]),up.on("up:framework:reset",(function(){s.reset(),n=o(n),i=o(i)})),{morph:function(n,i,r,o){c(o=t.options(o)),n=up.fragment.get(n),i=up.fragment.get(i);let u=l(r);const h=a(n,u,o);u=up.error.guardFn(u);const p=t.pluckKey(o,"beforeStart")||t.noop,f=t.pluckKey(o,"afterInsert")||t.noop,m=t.pluckKey(o,"beforeDetach")||t.noop,g=t.pluckKey(o,"afterDetach")||t.noop,y=t.pluckKey(o,"scrollNew")||t.noop;if(p(),h){if(s.isActive(n)&&!1===o.trackMotion)return u(n,i,o);up.puts("up.morph()","Morphing %o to %o with transition %O over %d ms",n,i,r,o.duration);const t=up.viewport.get(n),a=t.scrollTop,h=up.viewport.absolutize(n,{afterMeasure(){e.insertBefore(n,i),f()}}),c=async function(){y();const e=t.scrollTop;h.moveBounds(0,e-a),await u(n,i,o),m(),h.bounds.remove(),g()};return s.startFunction([n,i],c,o)}return m(),d(n,i),f(),g(),y(),Promise.resolve()},animate:function(n,i,r){n=up.fragment.get(n),r=t.options(r);let o=f(i);const u=a(n,i,r);if(o=up.error.guardFn(o),u){const t=()=>o(n,r);return s.startFunction(n,t,r)}return function(n,i){return t.isOptions(i)&&e.setStyle(n,i),Promise.resolve()}(n,i)},finish:function(t){return s.finish(t)},finishCount:()=>s.finishCount,transition:m,animation:g,config:r,isEnabled:u,isNone:y,willAnimate:a,swapElementsDirectly:d,motionOptions:function(e,n,i){n=t.options(n);let s=new up.OptionsParser(e,n,i);return s.booleanOrString("animation"),s.booleanOrString("transition"),s.string("easing"),s.number("duration"),n}}}(),up.transition=up.motion.transition,up.animation=up.motion.animation,up.morph=up.motion.morph,up.animate=up.motion.animate},1647:(t,e,n)=>{n(35);const i=up.util;up.network=function(){const t=new up.Config((()=>({concurrency:6,wrapMethod:!0,cacheSize:70,cacheExpireAge:15e3,cacheEvictAge:54e5,badResponseTime:400,fail:t=>(t.status<200||t.status>299)&&304!==t.status,autoCache:t=>t.isSafe(),expireCache:(t,e)=>!t.isSafe(),evictCache:!1,progressBar:!0,timeout:9e4}))),e=new up.Request.Queue,n=new up.Request.Cache;let s=null;function r(s){(function(t){let i;if(t.willCache()&&(i=n.get(t)))return up.puts("up.request()","Re-using previous request to %s",t.description),t.background||e.promoteToForeground(i),i.mergeIfUnsent(t),n.track(i,t,{onIncompatible:r}),!0})(s)||function(s){(function(e){e.willCache()&&(n.put(e),e.onLoading=()=>n.reindex(e)),i.always(e,(function(s){let r=s.expireCache??e.expireCache??i.evalOption(t.expireCache,e,s);r&&n.expire(r,{except:e});let o=s.evictCache??e.evictCache??i.evalOption(t.evictCache,e,s);o&&n.evict(o,{except:e});let u=n.get(e),a=s instanceof up.Response,h=!a,c=a&&s.ok,l=a&&!s.ok,p=a&&s.none;l?n.evict(e.url):h||p?n.evict(e):c&&u&&n.put(e)}))})(s),e.asap(s)}(s)}function o(...t){up.migrate.preprocessAbortArgs?.(t),e.abort(...t)}return up.on("up:network:late",(function(){i.evalOption(t.progressBar)&&(s=new up.ProgressBar)})),up.on("up:network:recover",(function(){s?.conclude()})),up.on("up:framework:reset",(function(){o(),e.reset(),n.reset(),s?.destroy(),s=null})),{request:function(...t){const e=function(t){const e=i.extractOptions(t);return e.url||(e.url=t[0]),up.migrate.handleRequestOptions?.(e),e}(t),n=new up.Request(e);return r(n),n},cache:n,isBusy:function(){return e.isBusy()},isSafeMethod:function(t){return i.contains(["GET","OPTIONS","HEAD"],i.normalizeMethod(t))},config:t,abort:o,registerAliasForRedirect:function(t,e){if(t.cache&&e.url&&t.url!==e.url){const s=i.variant(t,{method:e.method,url:e.url,cacheRoute:null});n.alias(t,s)}},queue:e,loadPage:function(t){new up.Request(t).loadPage()}}}(),up.request=up.network.request,up.cache=up.network.cache},3535:()=>{up.protocol=function(){const t=up.util,e=up.element,n=function(t){return"X-Up"+t.replace(/(^.|[A-Z])/g,(t=>"-"+t.toUpperCase()))},i=function(e,i,s=t.identity){let r=e.getResponseHeader(n(i));if(r)return s(r)};function s(t){return"false"!==t&&t}const r=t.memoize((function(){return t.normalizeMethod(up.browser.popCookie("_up_method"))})),o=new up.Config((()=>({methodParam:"_method",csrfParam:()=>e.metaContent("csrf-param"),csrfToken:()=>e.metaContent("csrf-token"),cspNonce:()=>e.metaContent("csp-nonce"),csrfHeader:"X-CSRF-Token",maxHeaderSize:2048})));return{config:o,locationFromXHR:function(t){return i(t,"location")||t.responseURL},titleFromXHR:function(t){return up.migrate.titleFromXHR?.(t)??i(t,"title",JSON.parse)},targetFromXHR:function(t){return i(t,"target")},methodFromXHR:function(e){return i(e,"method",t.normalizeMethod)},acceptLayerFromXHR:function(t){return i(t,"acceptLayer",JSON.parse)},contextFromXHR:function(t){return i(t,"context",JSON.parse)},dismissLayerFromXHR:function(t){return i(t,"dismissLayer",JSON.parse)},eventPlansFromXHR:function(t){return i(t,"events",JSON.parse)},expireCacheFromXHR:function(t){return i(t,"expireCache")||up.migrate.clearCacheFromXHR?.(t)},evictCacheFromXHR:function(t){return i(t,"evictCache",s)},csrfHeader:function(){return t.evalOption(o.csrfHeader)},csrfParam:function(){return t.evalOption(o.csrfParam)},csrfToken:function(){return t.evalOption(o.csrfToken)},cspNonce:function(){return t.evalOption(o.cspNonce)},initialRequestMethod:r,headerize:n,wrapMethod:function(t,e){return e.add(o.methodParam,t),"POST"},cspNoncesFromHeader:function(t){let e=[];if(t){let n=t.split(/\s*;\s*/);for(let t of n)if(0===t.indexOf("script-src")){let n,i=/'nonce-([^']+)'/g;for(;n=i.exec(t);)e.push(n[1])}}return e}}}()},9615:()=>{up.radio=function(){const t=up.element,e=new up.Config((()=>({hungrySelectors:["[up-hungry]"],noHungrySelectors:["[up-hungry=false]"],pollInterval:3e4})));return up.attribute("up-poll",(function(t){up.FragmentPolling.forFragment(t).onPollAttributeObserved()})),up.macro("[up-flashes]",(function(e){t.setMissingAttrs(e,{"up-hungry":"","up-if-layer":"subtree","up-keep":"",role:"alert"}),e.addEventListener("up:fragment:keep",(function(e){t.isEmpty(e.newFragment)||e.preventDefault()}))})),{config:e,hungrySteps:function(n){let{useHungry:i,origin:s,layer:r}=n,o={current:[],other:[]};if(!i)return o;let u=e.selector("hungrySelectors");const a=[r,...r.ancestors,...r.descendants];for(let e of a){let i=up.fragment.all(e.element,u,{layer:e});for(let u of i){let i=up.fragment.tryToTarget(u,{origin:s});if(!i){up.warn("[up-hungry]","Ignoring untargetable fragment %o",u);continue}let a=t.attr(u,"up-if-layer"),h=a?up.layer.getAll(a,{baseLayer:e}):[e],c={selector:i,oldElement:u,layer:e,origin:s,...up.motion.motionOptions(u),placement:"swap",useKeep:!0,maybe:!0,selectEvent:up.event.build("up:fragment:hungry",{log:!1}),selectCallback:t.callbackAttr(u,"up-on-hungry",{exposedKeys:["newFragment","renderOptions"]}),originalRenderOptions:n};h.includes(r)&&(r===e?o.current:o.other).push(c)}}return o.other=up.fragment.compressNestedSteps(o.other),o},startPolling:function(t,e={}){up.FragmentPolling.forFragment(t).forceStart(e)},stopPolling:function(t){up.FragmentPolling.forFragment(t).forceStop()},pollOptions:function(t,n={}){const i=new up.OptionsParser(t,n,{defaults:{background:!0}});return i.number("interval",{default:e.pollInterval}),i.string("ifLayer",{default:"front"}),i.include(up.link.requestOptions),n}}}()},6774:()=>{!function(){const t=up.element;for(let e of["method","confirm"]){const n=`up-${e}`,i=`data-${e}`;up.macro(`a[${i}]`,(function(e){(window.Rails||window.jQuery?.rails)&&up.link.isFollowable(e)&&(t.setMissingAttr(e,n,e.getAttribute(i)),e.removeAttribute(i))}))}}()},1897:()=>{up.script=function(){const t=up.util,e=up.element,n=new up.Config((()=>({assetSelectors:["link[rel=stylesheet]","script[src]","[up-asset]"],noAssetSelectors:["[up-asset=false]"],nonceableAttributes:["up-watch","up-on-accepted","up-on-dismissed","up-on-loaded","up-on-rendered","up-on-finished","up-on-error","up-on-offline"],scriptSelectors:["script"],noScriptSelectors:['script[type="application/ld+json"]']}))),i={"[up-back]":-100,"[up-clickable]":-200,"[up-drawer]":-200,"[up-modal]":-200,"[up-cover]":-200,"[up-popup]":-200,"[up-tooltip]":-200,"[up-dash]":-200,"[up-flashes]":-200,"[up-expand]":-300,"[data-method]":-400,"[data-confirm]":-400};let s=[],r=[];function o(e,n={}){let o=function(e,n){let[i,s,r]=u(e);return s=t.options(s,{selector:i,isDefault:up.framework.evaling,priority:0,batch:!1}),Object.assign(r,s,n)}(e,n);o.macro?(up.framework.evaling&&(o.priority||=function(e){e=t.evalOption(e);for(let t in i)if(e.indexOf(t)>=0)return i[t];up.fail("Unregistered priority for system macro %o",e)}(o.selector)),a(r,o)):a(s,o)}const u=function(e){const n=t.extractOptions(e),i=e.shift(),s=e.pop();return[i,{...n,...t.extractOptions(e)},s]};function a(t,e){let n,i=0;for(;(n=t[i])&&n.priority>=e.priority;)i+=1;if(t.splice(i,0,e),up.framework.booted)if(0===e.priority)for(let t of up.layer.stack)h(t.element,{layer:t,compilers:[e]});else up.puts("up.compiler()","Compiler %s was registered after booting Unpoly. Compiler will run for future fragments only.",e.selector);return e}function h(t,e){up.emit(t,"up:fragment:compile",{log:!1});let n=e.compilers||r.concat(s);new up.CompilerPass(t,n,e).run()}function c(t=document.head){return t.querySelectorAll(n.selector("assetSelectors"))}function l(t){t.type="up-disabled-script"}return up.on("up:framework:reset",(function(){s=t.filter(s,"isDefault"),r=t.filter(r,"isDefault")})),{config:n,compiler:function(...t){o(t)},macro:function(...t){o(t,{macro:!0})},attrCompiler:function(...t){let[n,i,s]=u(t);o([`[${n}]`,i,t=>{let r=e.booleanOrStringAttr(t,n,i.defaultValue);if(r)return s(t,r)}])},destructor:function(e,n){let i=e.upDestructors;i||(i=[],e.upDestructors=i,e.classList.add("up-can-clean")),t.isArray(n)?i.push(...n):i.push(n)},hello:function(t,e={}){return t=up.fragment.get(t,e),up.puts("up.hello()","Compiling fragment %o",t),h(t,e),up.fragment.emitInserted(t),t},clean:function(t,e={}){new up.DestructorPass(t,e).run()},data:function(e){return e=up.fragment.get(e),e.upData||=function(e){if(!e.getAttribute)return{};let n,i=e.getAttribute("up-data");return i&&(n=JSON.parse(i),!t.isOptions(n))?n:{...e.dataset,...n,...e.upCompileData}}(e)},findAssets:c,assertAssetsOK:function(e,n){let i=c();t.map(i,"outerHTML").join()!==t.map(e,"outerHTML").join()&&up.event.assertEmitted("up:assets:changed",{oldAssets:i,newAssets:e,renderOptions:n})},disableSubtree:function(i){let s=n.selector("scriptSelectors");t.each(e.subtree(i,s),l)}}}(),up.compiler=up.script.compiler,up.destructor=up.script.destructor,up.macro=up.script.macro,up.data=up.script.data,up.hello=up.script.hello,up.attribute=up.script.attrCompiler},7924:()=>{up.util=function(){function t(){}function e(t,e){e=L(e,{host:"cross-domain"});const n=o(t);let i="";"cross-domain"===e.host&&(e.host=r(n)),e.host&&(i+=n.protocol+"//"+n.host);let{pathname:s}=n;return!1===e.trailingSlash&&"/"!==s&&(s=s.replace(/\/$/,"")),i+=s,!1!==e.search&&(i+=n.search),!1!==e.hash&&(i+=n.hash),i}function n(t,n){if(t)return e(t,{hash:!1,trailingSlash:!1,...n})}const i=location.protocol,s=location.hostname;function r(t){if(w(t)&&-1===t.indexOf("//"))return!1;const e=o(t);return s!==e.hostname||i!==e.protocol}function o(t){if(t.pathname)return t;let e=document.createElement("a");return e.href=t,e}function u(t){return w(t)?e=>e[t]:t}function a(t,e){if(0===t.length)return[];e=u(e);let n=[],i=0;for(let s of t)n.push(e(s,i++));return n}function h(t,e){let n=0;for(let i of t)e(i,n++)}function c(t){return null===t}function l(t){return void 0===t}const p=Z(l);function f(t){return l(t)||c(t)}const d=Z(f);function m(t){return!!f(t)||(_(t)&&t[m.key]?t[m.key]():w(t)||O(t)?0===t.length:!!v(t)&&0===Object.keys(t).length)}m.key="up.util.isBlank";const g=Z(m);function y(t){return"function"==typeof t}function w(t){return"string"==typeof t||t instanceof String}function b(t){return"number"==typeof t||t instanceof Number}function v(t){return"object"==typeof t&&!c(t)&&(l(t.constructor)||t.constructor===Object)}function _(t){const e=typeof t;return"object"===e&&!c(t)||"function"===e}function k(t){return t instanceof Element}function S(t){return t instanceof RegExp}function x(t){return up.browser.canJQuery()&&t instanceof jQuery}const{isArray:E}=Array;function O(t){return E(t)||function(t){return t instanceof NodeList}(t)||function(t){return"[object Arguments]"===Object.prototype.toString.call(t)}(t)||x(t)||function(t){return t instanceof HTMLCollection}(t)}function C(t){return O(t)?t:f(t)?[]:[t]}function F(t){return _(t)&&t[F.key]?t=t[F.key]():O(t)?t=T(t):v(t)&&(t=Object.assign({},t)),t}function T(t){return Array.prototype.slice.call(t)}function R(...t){return Object.assign({},...t)}function L(t,e){return e?R(e,t):t?F(t):{}}function A(t,e){e=u(e);let n=0;for(let i of t){const t=e(i,n++);if(t)return t}}function P(t,e){e=u(e);let n=!0,i=0;for(let s of t)if(!e(s,i++)){n=!1;break}return n}function $(t){return D(t,d)}function D(t,e){e=u(e);const n=[];return h(t,(function(t,i){if(e(t,i))return n.push(t)})),n}function M(t){return t[t.length-1]}function H(t,e){return(t.indexOf||Array.prototype.indexOf).call(t,e)>=0}function N(t,e){const n={};for(let i of e)i in t&&(n[i]=t[i]);return n}function j(t,e){e=u(e);const n={};for(let i in t)e(t[i],i,t)&&(n[i]=t[i]);return n}function q(t,...e){return y(t)?t(...e):t}F.key="up.util.copy",Date.prototype[F.key]=function(){return new Date(+this)};const B={"&":"&","<":"<",">":">",'"':""","'":"'"};function U(t,e){const n=t[e];return delete t[e],n}function z(t,e){if(e(M(t)))return t.pop()}function I(t){return z(t,v)||{}}function K(t){return t}function V(t){const e=[];for(let n of t)O(n)?e.push(...n):e.push(n);return e}function X(t,e){if(t?.valueOf&&(t=t.valueOf()),e?.valueOf&&(e=e.valueOf()),typeof t!=typeof e)return!1;if(O(t)&&O(e))return W(t,e);if(_(t)&&t[X.key])return t[X.key](e);if(v(t)&&v(e)){const n=Object.keys(t);return!!W(n,Object.keys(e))&&P(n,(n=>X(t[n],e[n])))}return t===e}function W(t,e){return t.length===e.length&&P(t,((t,n)=>X(t,e[n])))}X.key="up.util.isEqual";const J={"space/or":/\s+(?:or\s+)?/,or:/\s+or\s+/,comma:/\s*,\s*/};let G=0;function Q(t,e="%o"){let n;if("%c"===e)return"";if("%s"===e&&d(t)&&(t=t.toString()),w(t))n=t.trim().replace(/[\n\r\t ]+/g," "),"%o"===e&&(n=JSON.stringify(n));else if(l(t))n="undefined";else if(b(t)||y(t))n=t.toString();else if(E(t))n=`[${a(t,Q).join(", ")}]`;else if(x(t))n=`$(${a(t,Q).join(", ")})`;else if(k(t)){n=`<${t.tagName.toLowerCase()}`;for(let e of["id","up-id","name","class"]){let i=t.getAttribute(e);i&&(n+=` ${e}="${i}"`)}n+=">"}else if(S(t)||t instanceof Error)n=t.toString();else try{n=JSON.stringify(t)}catch(t){if("TypeError"!==t.name)throw t;n="(circular structure)"}return n.length>200&&(n=`${n.substr(0,200)}…${M(n)}`),n}const Y=/%[oOdisfc]/g;function Z(t){return function(...e){return!t(...e)}}function tt(t){if(t.error)throw t.error;return t.value}function et(t,e,n){try{return{value:t.apply(e,n)}}catch(t){return{error:t}}}return{parseURL:o,normalizeURL:e,matchableURL:n,matchableURLPatternAtom:function(t){return t.endsWith("/")?[t,t.slice(0,-1)]:t.includes("/?")?[t,t.replace("/?","?")]:t.endsWith("/*")?[t,t.slice(0,-2),t.slice(0,-2)+"?*"]:t},matchURLs:function(t,e,i){return n(t,i)===n(e,i)},normalizeMethod:function(t){return t?t.toUpperCase():"GET"},methodAllowsPayload:function(t){return"GET"!==t&&"HEAD"!==t},copy:F,merge:R,mergeDefined:function(...t){const e={};for(let n of t)if(n)for(let t in n){const i=n[t];p(i)&&(e[t]=i)}return e},options:L,parseArgIntoOptions:function(t,e){let n=I(t);return p(t[0])&&(n=F(n),n[e]=t[0]),n},each:h,map:a,flatMap:function(t,e){return V(a(t,e))},mapObject:function(t,e){return a(t,e).reduce((function(t,e){return t[e[0]]=e[1],t}),{})},findResult:A,some:function(t,e){return!!A(t,e)},every:P,find:function(t,e){let n;e=u(e);for(let i of t)if(e(i)){n=i;break}return n},filter:D,reject:function(t,e){return D(t,e=Z(u(e)))},intersect:function(t,e){return D(t,(t=>H(e,t)))},compact:$,compactObject:function(t){return j(t,d)},uniq:function(t){return t.length<2?t:Array.from(new Set(t))},uniqBy:function(t,e){if(t.length<2)return t;e=u(e);const n=new Set;return D(t,(function(t,i){const s=e(t,i);return!n.has(s)&&(n.add(s),!0)}))},last:M,isNull:c,isDefined:p,isUndefined:l,isGiven:d,isMissing:f,isPresent:g,isBlank:m,presence:function(t,e=g){if(e(t))return t},isObject:_,isFunction:y,isString:w,isBoolean:function(t){return"boolean"==typeof t||t instanceof Boolean},isNumber:b,isElement:k,isJQuery:x,isElementish:function(t){return!(!t||!t.addEventListener&&!t[0]?.addEventListener)},isPromise:function(t){return _(t)&&y(t.then)},isOptions:v,isArray:E,isFormData:function(t){return t instanceof FormData},isList:O,isRegExp:S,timer:function(t,e){return setTimeout(e,t)},contains:H,containsAll:function(t,e){return P(e,(e=>H(t,e)))},objectContains:function(t,e){return X(e,N(t,Object.keys(e)))},toArray:function(t){return E(t)?t:T(t)},pick:N,pickBy:j,omit:function(t,e){return j(t,((t,n)=>!H(e,n)))},unresolvablePromise:function(){return new Promise(t)},remove:function(t,e){const n=t.indexOf(e);if(n>=0)return t.splice(n,1),e},memoize:function(t){let e,n;return function(...i){return n?e:(n=!0,e=t.apply(this,i))}},pluckKey:U,renameKey:function(t,e,n){return t[n]=U(t,e)},extractOptions:I,extractCallback:function(t){return z(t,y)},noop:t,asyncNoop:function(){return Promise.resolve()},identity:K,escapeHTML:function(t){return t.replace(/[&<>"']/g,(t=>B[t]))},escapeRegExp:function(t){return t.replace(/[\\^$*+?.()|[\]{}]/g,"\\$&")},sequence:function(t){return t=$(t),(...e)=>a(t,(t=>t(...e)))},evalOption:q,evalAutoOption:function(t,e,...n){return"auto"===(t=q(t,...n))&&(t=q(e,...n)),t},flatten:V,newDeferred:function(){let t,e;const n=new Promise((function(n,i){t=n,e=i}));return n.resolve=t,n.reject=e,n},always:function(t,e=K){return t.then(e,e)},isBasicObjectProperty:function(t){return Object.prototype.hasOwnProperty(t)},isCrossOrigin:r,task:function(t){return setTimeout(t)},isEqual:X,parseTokens:function(t,e={}){if(w(t)){if(t=t.trim(),e.json&&/^\[.*]$/.test(t))return JSON.parse(t);{let n=e.separator||"space/or",i=J[n];return t.split(i)}}return C(t)},wrapList:C,wrapValue:function(t,...e){return e[0]instanceof t?e[0]:new t(...e)},uid:function(){return G++},upperCaseFirst:function(t){return t[0].toUpperCase()+t.slice(1)},lowerCaseFirst:function(t){return t[0].toLowerCase()+t.slice(1)},delegate:function(t,e,n){for(let i of e)Object.defineProperty(t,i,{get(){const t=n.call(this);let e=t[i];return y(e)&&(e=e.bind(t)),e},set(t){n.call(this)[i]=t}})},reverse:function(t){return F(t).reverse()},camelToKebabCase:function(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))},replaceValue:function(t,e,n){return t===e?n:t},sprintf:function(t,...e){return t.replace(Y,(t=>Q(e.shift(),t)))},renameKeys:function(t,e){const n={};for(let i in t)n[e(i)]=t[i];return n},memoizeMethod:function(t,e){for(let n in e){let e=Object.getOwnPropertyDescriptor(t,n).value,i=function(...t){let i=this[`__${n}MemoizeCache`]||={},s=JSON.stringify(t);return i[s]||=et(e,this,t),tt(i[s])};t[n]=i}},safeStringifyJSON:function(t){return JSON.stringify(t).replace(/[^\x00-\x7F]/g,(t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0")))},variant:function(t,e={}){let n=Object.create(t);return Object.assign(n,e),n}}}()},4606:(t,e,n)=>{n(5074),up.viewport=function(){const t=up.util,e=up.element,n=up.fragment,i=new up.Config((()=>({viewportSelectors:["[up-viewport]","[up-fixed]"],fixedTopSelectors:["[up-fixed~=top]"],fixedBottomSelectors:["[up-fixed~=bottom]"],anchoredRightSelectors:["[up-anchored~=right]","[up-fixed~=top]","[up-fixed~=bottom]","[up-fixed~=right]"],revealSnap:200,revealPadding:0,revealTop:!1,revealMax:()=>.5*window.innerHeight,autoFocusVisible:({element:t,inputDevice:e})=>"key"===e||up.form.isField(t)}))),s=new up.BodyShifter;function r(e,i){return i=t.options(i),e=n.get(e,i),(i.layer=up.layer.get(e))||up.fail("Cannot reveal a detached element"),i.peel&&i.layer.peel(),new up.RevealMotion(e,i).start(),up.migrate.formerlyAsync?.("up.reveal()")||!0}function o(e,{preventScroll:n,force:s,inputDevice:o,focusVisible:a}={}){if(s&&(e.hasAttribute("tabindex")||-1!==e.tabIndex||e.setAttribute("tabindex","-1")),o??=up.event.inputDevice,a??="auto",a=t.evalAutoOption(a,i.autoFocusVisible,{element:e,inputDevice:o}),e.focus({preventScroll:!0,focusVisible:a}),u(e),e.classList.add(a?"up-focus-visible":"up-focus-hidden"),!n)return r(e)}function u(t){t?.classList.remove("up-focus-hidden","up-focus-visible")}function a(t=location.hash,e){let n=y(t,e);if(n)return up.reveal(n,{top:!0})}function h(){return[p().tagName,...i.viewportSelectors].join()}function c(t,e={}){return n.get(t,e).closest(h())}function l(t,i={}){return t=n.get(t,i),e.around(t,h())}function p(){return document.scrollingElement}function f(){return e.root.clientWidth}function d(t){return up.fragment.tryToTarget(t)}function m(e){const i=t.copy(t.extractOptions(e));let s;return i.layer=up.layer.get(i),s=e[0]?[c(e[0],i)]:i.around?l(i.around,i):function(t={}){return n.all(h(),t)}(i),[s,i]}function g(t,e){for(let n of t){const t=d(n);n.scrollTop=e[t]||0}}function y(t,i={}){if(s=t,t=s?.replace(/^#/,"")){const s=[e.attrSelector("id",t),"a"+e.attrSelector("name",t)].join();return n.get(s,i)}var s}up.compiler(i.selectorFn("anchoredRightSelectors"),(function(t){return s.onAnchoredElementInserted(t)})),up.on("focusin",(function({relatedTarget:t}){u(t)}));const w=["selectionStart","selectionEnd","scrollLeft","scrollTop"];let b=!1;return up.on("scroll",{once:!0,beforeBoot:!0},(()=>b=!0)),up.on("up:framework:boot",(function(){t.task((function(){if(!b)return a()}))})),up.on(window,"hashchange",(()=>a())),{reveal:r,revealHash:a,firstHashTarget:y,config:i,get:c,subtree:function(t,i={}){return t=n.get(t,i),e.subtree(t,h())},around:l,get root(){return p()},rootWidth:f,rootHeight:function(){return e.root.clientHeight},isRoot:function(t){return t===p()},rootScrollbarWidth:function(){return window.innerWidth-f()},saveScroll:function(...t){const[e,n]=m(t),i=n.location||n.layer.location;if(i){const t=function(t){let e={};for(let n of t){let t=d(n);t?e[t]=n.scrollTop:up.warn("up.viewport.saveScroll()","Cannot save scroll positions for untargetable viewport %o",n)}return e}(e);n.layer.lastScrollTops.set(i,t)}},restoreScroll:function(...t){const[e,n]=m(t),{location:i}=n.layer,s=n.layer.lastScrollTops.get(i);return!!s&&(g(e,s),up.puts("up.viewport.restoreScroll()","Restored scroll positions to %o",s),!0)},resetScroll:function(...t){const[e,n]=m(t);g(e,{})},saveFocus:function(t={}){const e=up.layer.get(t),n=t.location||e.location;if(n){const t=up.FocusCapsule.preserve(e);e.lastFocusCapsules.set(n,t)}},restoreFocus:function(t={}){const e=up.layer.get(t),n=t.location||e.location,i=t.layer.lastFocusCapsules.get(n);return!(!i||!i.restore(e)||(up.puts("up.viewport.restoreFocus()",'Restored focus to "%s"',i.target),0))},absolutize:function(n,s={}){const r=c(n).getBoundingClientRect(),o=n.getBoundingClientRect(),u=new up.Rect({left:o.left-r.left,top:o.top-r.top,width:o.width,height:o.height});s.afterMeasure?.(),e.setStyle(n,{position:"static"===n.style.position?"static":"relative",top:"auto",right:"auto",bottom:"auto",left:"auto",width:"100%",height:"100%"});const a=e.createFromSelector("up-bounds");e.insertBefore(n,a),a.appendChild(n);const h=function(t,n){return u.left+=t,u.top+=n,e.setStyle(a,u,"px")};h(0,0);const l=n.getBoundingClientRect();return h(o.left-l.left,o.top-l.top),t.each(function(t=document){const e=["[up-fixed]"].concat(i.fixedTopSelectors).concat(i.fixedBottomSelectors);return t.querySelectorAll(e.join())}(n),e.fixedToAbsolute),{bounds:a,moveBounds:h}},focus:o,tryFocus:function(t,e){return o(t,e),t===document.activeElement},newStateCache:function(){return new up.FIFOCache({capacity:30,normalizeKey:t.matchableURL})},focusedElementWithin:function(t){const e=document.activeElement;if(up.fragment.contains(t,e))return e},copyCursorProps:function(t,e={}){for(let n of w)try{e[n]=t[n]}catch(t){}return e},bodyShifter:s}}(),up.focus=up.viewport.focus,up.reveal=up.viewport.reveal},3507:()=>{window.up={version:"3.9.2"}}},e={};function n(i){var s=e[i];if(void 0!==s)return s.exports;var r=e[i]={exports:{}};return t[i](r,r.exports,n),r.exports}n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"hu",{value:!0})},n(3507),n(8374),n(7924),n(3924),n(6535),n(2811),n(9675),n(376),n(8272),n(4366),n(8010),n(4861),n(3469),n(4504),n(2406),n(3742),n(1653),n(1104),n(5949),n(1279),n(6346),n(3030),n(7948),n(2714),n(1752),n(8228),n(7050),n(9441),n(9489),n(7422),n(2200),n(278),n(9005),n(1569),n(2737),n(3635),n(1906),n(4158),n(3139),n(2214),n(5240),n(665),n(2828),n(2587),n(7031),n(8057),n(4850),n(7956),n(7403),n(6412),n(7965),n(7771),n(86),n(4552),n(5580),n(7101),n(6066),n(6387),n(5390),n(2460),n(7792),n(4308),n(8665),n(3645),n(7782),n(2705),n(606),n(5437),n(7974),n(6413),n(5221),n(2298),n(4517),n(7241),n(2723),n(8720),n(7885),n(4818),n(9634),n(8670),n(3535),n(4453),n(1897),n(8944),n(2667),n(4606),n(4034),n(1647),n(9443),n(3849),n(2851),n(454),n(9615),n(6774),up.framework.onEvaled()})();
|
1
|
+
(()=>{var t={1860:(t,e,n)=>{"use strict";n.r(e)},8711:(t,e,n)=>{"use strict";n.r(e)},4432:(t,e,n)=>{"use strict";n.r(e)},2065:(t,e,n)=>{"use strict";n.r(e)},35:(t,e,n)=>{"use strict";n.r(e)},5074:(t,e,n)=>{"use strict";n.r(e)},2811:()=>{up.browser={submitForm:function(t){t.submit()},canPushState:function(){return"GET"===up.protocol.initialRequestMethod()},canJQuery:function(){return!!window.jQuery},assertConfirmed:function(t){if(t.confirm&&!window.confirm(t.confirm))throw new up.Aborted("User canceled action");return!0},popCookie:function(t){let e=document.cookie.match(new RegExp(t+"=(\\w+)"))?.[1];if(e)return document.cookie=t+"=;Max-Age=0;Path=/",e},canHasSelector:up.util.memoize((()=>CSS.supports("selector(:has(*))")))}},6346:()=>{const t=up.element;up.BodyShifter=class BodyShifter{constructor(){this.t=new Set,this.i=0,this.o=[]}lowerStack(){0==--this.i&&this.u()}raiseStack(){1==++this.i&&this.h()}onAnchoredElementInserted(t){return this.t.add(t),this.l(t,"right"),()=>this.t.delete(t)}p(){return this.m&&this.i>0}h(){this.m=up.viewport.rootScrollbarWidth(),this.o.push(t.setTemporaryStyle(t.root,{"--up-scrollbar-width":this.m+"px"})),this.l(document.body,"padding-right");for(let t of this.t)this.l(t,"right")}l(e,n){if(!this.p())return;let i=t.style(e,n);this.o.push(t.setTemporaryStyle(e,{["--up-original-"+n]:i}),t.addTemporaryClass(e,"up-scrollbar-away"))}u(){let t;for(;t=this.o.pop();)t()}}},7948:()=>{const t=up.util,e=up.element;up.Change.Addition=class Addition extends up.Change{constructor(t){super(t),this.v=t.acceptLayer,this._=t.dismissLayer,this.k=t.eventPlans||[],this.S=t.response}handleLayerChangeRequests(){this.layer.isOverlay()&&(this.tryAcceptLayerFromServer(),this.abortWhenLayerClosed(),this.layer.tryAcceptForLocation(this.responseOption()),this.abortWhenLayerClosed(),this.tryDismissLayerFromServer(),this.abortWhenLayerClosed(),this.layer.tryDismissForLocation(this.responseOption()),this.abortWhenLayerClosed()),this.layer.asCurrent((()=>{for(let t of this.k)up.emit({...t,...this.responseOption()}),this.abortWhenLayerClosed()}))}tryAcceptLayerFromServer(){t.isDefined(this.v)&&this.layer.isOverlay()&&this.layer.accept(this.v,this.responseOption())}tryDismissLayerFromServer(){t.isDefined(this._)&&this.layer.isOverlay()&&this.layer.dismiss(this._,this.responseOption())}abortWhenLayerClosed(t=this.layer){if(t.isClosed())throw new up.Aborted("Layer was closed")}setSource({oldElement:t,newElement:n,source:i}){"keep"===i&&(i=t&&up.fragment.source(t)),i&&e.setMissingAttr(n,"up-source",up.fragment.normalizeSource(i))}setTime({newElement:t,time:n}){e.setMissingAttr(t,"up-time",!!n&&n.toUTCString())}setETag({newElement:t,etag:n}){e.setMissingAttr(t,"up-etag",n||!1)}setReloadAttrs(t){this.setSource(t),this.setTime(t),this.setETag(t)}responseOption(){return{response:this.S}}executeSteps(t,e,n){return new up.Change.UpdateSteps({steps:t,noneOptions:n}).execute(e)}}},3030:()=>{const t=up.util;up.Change=class Change{constructor(t){this.options=t}execute(){throw new up.NotImplemented}onFinished(t){return this.options.onFinished?.(t)}improveHistoryValue(e,n){return!1===e||t.isString(e)?e:n}deriveFailOptions(){return up.RenderOptions.deriveFailOptions(this.options)}}},7422:()=>{const t=up.util;up.Change.CloseLayer=class CloseLayer extends up.Change.Removal{constructor(t){super(t),this.O=t.verb,this.C=up.layer.get(t),this.F=t.origin,this.T=t.value,this.R=t.preventable??!0,this.S=t.response,this.L=t.history??!0}execute(){if(!this.C.isOpen())return Promise.resolve();if(up.browser.assertConfirmed(this.options),this.A().defaultPrevented&&this.R)throw new up.Aborted("Close event was prevented");this.P(),up.fragment.abort({reason:"Layer is closing",layer:this.C});const{parent:t}=this.C;this.C.peel(),this.C.stack.remove(this.C),this.L&&t.restoreHistory(),this.$(t),this.C.teardownHandlers(),this.C.destroyElements(this.options),this.D(t)}A(){let e=this.C.emit(this.M(`up:layer:${this.O}`),{callback:this.C.callback(`on${t.upperCaseFirst(this.O)}`),log:[`Will ${this.O} ${this.C} with value %o`,this.T]});return this.T=e.value,e}P(){let t=this.M(`up:layer:${this.O}ing`);this.C.emit(t,{log:!1})}D(e){const n=`${this.O}ed`,i=t.upperCaseFirst(n);return this.C.emit(this.M(`up:layer:${n}`),{baseLayer:e,callback:this.C.callback(`on${i}`),ensureBubbles:!0,log:[`${i} ${this.C} with value %o`,this.T]})}M(t){return up.event.build(t,{layer:this.C,value:this.T,origin:this.F,response:this.S})}$(t){this.C.overlayFocus.teardown(),t.overlayFocus?.moveToFront();let e=this.C.origin||t.element;up.focus(e,{preventScroll:!0})}}},8228:()=>{up.Change.DestroyFragment=class DestroyFragment extends up.Change.Removal{constructor(t){super(t),this.C=up.layer.get(t)||up.layer.current,this.H=this.options.element,this.N=this.options.animation,this.j=this.options.log}execute(){this.q=this.H.parentNode,up.fragment.markAsDestroying(this.H),up.motion.willAnimate(this.H,this.N,this.options)?this.B():this.U()}async B(){this.I(),await this.K(),this.V(),this.onFinished()}U(){this.V(),this.I(),this.onFinished()}K(){return up.motion.animate(this.H,this.N,this.options)}V(){this.C.asCurrent((()=>{up.fragment.abort(this.H),up.script.clean(this.H,{layer:this.C}),up.element.cleanJQuery(this.H),this.H.remove()}))}I(){up.fragment.emitDestroyed(this.H,{parent:this.q,log:this.j})}}},9005:()=>{var t;const e=up.util;up.Change.FromContent=(t=class FromContent extends up.Change{constructor(t){super(t),this.F=t.origin,this.X=t.preview,this.W=up.layer.getAll(t)}J(){let t=[];return this.G(),this.Y(),this.Z(t,this.W,this.options.target),this.Z(t,this.W,this.options.fallback),t}tt(t){return"new"===t||t.isOpen()}G(){this.W=e.filter(this.W,this.tt)}Z(t,e,n){for(let i of e)for(let e of this.et(n,i)){const n={...this.options,target:e,layer:i,defaultPlacement:this.nt()},s="new"===i?new up.Change.OpenLayer(n):new up.Change.UpdateLayer(n);t.push(s)}}et(t,e){return up.fragment.expandTargets(t,{layer:e,mode:this.options.mode,origin:this.F})}execute(){return this.options.preload?Promise.resolve():this.it(this.st.bind(this))||this.rt()}st(t){let e=t.execute(this.ot(),this.ut.bind(this,t));return e.options=this.options,e}ht(t){return!(t instanceof up.CannotMatch)}ut(t){let e=this.J()[0];t!==e&&up.puts("up.render()",'Could not match primary target "%s". Updating a fallback target "%s".',e.target,t.target);let{assets:n}=this.ot();n&&up.script.assertAssetsOK(n,t.options),this.options.onRender?.()}ot(){if(this.X)return;const t=e.pick(this.options,["target","content","fragment","document","html","cspNonces","origin"]);return up.migrate.handleResponseDocOptions?.(t),"content"===this.nt()&&(t.target=this.ct(t.target)),new up.ResponseDoc(t)}Y(){if(this.X)return;let t=this.ot();this.options.fragment&&(this.options.target||=t.rootSelector()),this.options.title=this.improveHistoryValue(this.options.title,t.title),this.options.metaTags=this.improveHistoryValue(this.options.metaTags,t.metaTags),this.options.lang=this.improveHistoryValue(this.options.lang,t.lang)}nt(){if(!this.options.document&&!this.options.fragment)return"content"}ct(t){let e=this.W[0]||up.layer.root;return this.et(t||":main",e)[0]}getPreflightProps(t={}){return this.it((t=>t.getPreflightProps()))||t.optional||this.lt()}lt(){this.ft("Could not find target in current page")}rt(){this.ft("Could not find common target in current page and response")}ft(t){if(this.J().length){const n=e.uniq(e.map(this.J(),"target")),i=up.layer.optionToString(this.options.layer);throw new up.CannotMatch([t+" (tried selectors %o in %s)",n,i])}if(0!==this.W.length)throw this.options.failPrefixForced?new up.CannotMatch("No target selector given for failed responses (https://unpoly.com/failed-responses)"):new up.CannotMatch("No target selector given");this.dt()}dt(){throw new up.CannotMatch("Could not find a layer to render in. You may have passed an unmatchable layer reference, or a detached element.")}it(t){for(let e of this.J())try{return t(e)}catch(t){if(this.ht(t))throw t}}},e.memoizeMethod(t.prototype,{J:!0,ot:!0,getPreflightProps:!0}),t)},278:()=>{var t;const e=up.util;up.Change.FromResponse=(t=class FromResponse extends up.Change{constructor(t){super(t),this.S=t.response,this.gt=this.S.request}execute(){if(up.fragment.config.skipResponse(this.yt())?this.wt():this.gt.assertEmitted("up:fragment:loaded",{...this.yt(),callback:this.options.onLoaded,log:["Loaded fragment from %s",this.S.description],skip:()=>this.wt()}),e.evalOption(this.options.fail,this.S)??!this.S.ok)throw this.bt(this.deriveFailOptions());return this.bt(this.options)}wt(){up.puts("up.render()","Skipping "+this.S.description),this.options.target=":none",this.options.failTarget=":none"}bt(t){t.failPrefixForced&&up.puts("up.render()","Rendering failed response using fail-prefixed options (https://unpoly.com/failed-responses)"),this.vt(t),t.meta=this._t();let e=new up.Change.FromContent(t).execute();return e.finished=this.finish(e,t),e}async finish(t,e){return t=await t.finished,up.fragment.shouldRevalidate(this.gt,this.S,e)&&(t=await this.kt(t,e)),t}async kt(t,e){let n=e.target,i=t.target;if(/:(before|after)/.test(n))up.warn("up.render()","Cannot revalidate cache when prepending/appending (target %s)",n);else{up.puts("up.render()",'Revalidating cached response for target "%s"',i);let n=await up.reload(i,{...e,preferOldElements:t.fragments,layer:t.layer,onFinished:null,scroll:!1,focus:"keep",transition:!1,cache:!1,confirm:!1,feedback:!1,abort:!1,expiredResponse:this.S});n.none||(t=n)}return t}yt(){const{expiredResponse:t}=this.options;return{request:this.gt,response:this.S,renderOptions:this.options,revalidating:!!t,expiredResponse:t}}_t(){let t={revalidating:!!this.options.expiredResponse};return up.migrate.processCompilerPassMeta?.(t,this.S),t}vt(t){const n=this.S.url;let i=n,s=this.gt.hash;s&&(t.hash=s,i+=s),"GET"===this.S.method?t.source=this.improveHistoryValue(t.source,n):(t.source=this.improveHistoryValue(t.source,"keep"),t.history=!!t.location),t.location=this.improveHistoryValue(t.location,i),t.title=this.improveHistoryValue(t.title,this.S.title),t.eventPlans=this.S.eventPlans;let r=this.S.target;r&&(t.target=r),t.acceptLayer=this.S.acceptLayer,t.dismissLayer=this.S.dismissLayer,t.document=this.S.text,this.S.none&&(t.target=":none"),t.context=e.merge(t.context,this.S.context),t.cspNonces=this.S.cspNonces,t.time??=this.S.lastModified,t.etag??=this.S.etag}},e.memoizeMethod(t.prototype,{yt:!0}),t)},2200:()=>{var t;const e=up.util;up.Change.FromURL=(t=class FromURL extends up.Change{execute(){let t=this.St();return t?(up.puts("up.render()",t),up.network.loadPage(this.options),e.unresolvablePromise()):(this.request=up.request(this.xt()),this.options.onRequest?.(this.request),up.feedback.showAroundRequest(this.request,this.options),up.form.disableWhile(this.request,this.options),this.options.preload?this.request:e.always(this.request,(t=>this.Et(t))))}St(){return e.isCrossOrigin(this.options.url)?"Loading cross-origin content in new page":this.options.history&&!up.browser.canPushState()?"Loading content in new page to restore history support":void 0}xt(){const t=this.Ot(this.options),n=this.Ot(this.deriveFailOptions(),{optional:!0});return{...this.options,...t,...e.renameKeys(n,up.fragment.failKey)}}getPreflightProps(){return this.xt()}Ot(t,e){return new up.Change.FromContent({...t,preview:!0}).getPreflightProps(e)}Et(t){return t instanceof up.Response?this.Ct(t):this.Ft(t)}Ct(t){return new up.Change.FromResponse({...this.options,response:t}).execute()}Ft(t){throw t instanceof up.Offline&&this.request.emit("up:fragment:offline",{callback:this.options.onOffline,renderOptions:this.options,retry:t=>up.render({...this.options,...t}),log:["Cannot load fragment from %s: %s",this.request.description,t.reason]}),t}},e.memoizeMethod(t.prototype,{xt:!0}),t)},7050:()=>{let t=up.util;up.Change.OpenLayer=class OpenLayer extends up.Change.Addition{constructor(t){super(t),this.target=t.target,this.F=t.origin,this.Tt=t.baseLayer}getPreflightProps(){return{mode:this.options.mode,context:this.Rt().context,origin:this.options.origin,target:this.target,layer:this.Tt,fragments:t.compact([up.fragment.get(":main",{layer:this.Tt})]),newLayer:!0}}execute(t,e){this.responseDoc=t,this.Lt(),e(),this.At();let n=this.layer.on("up:layer:accepting up:layer:dimissing",this.Pt.bind(this));try{return this.$t(),this.Pt(),up.RenderResult.both(this.Dt,this.Mt)}finally{n()}}Lt(){if(":none"===this.target?this.Ht=document.createElement("up-none"):this.Ht=this.responseDoc.select(this.target),!this.Ht||this.Tt.isClosed())throw new up.CannotMatch}At(){up.puts("up.render()",`Opening element "${this.target}" in new overlay`),this.Nt(),this.layer=this.Rt(),this.Tt.peel({history:!this.layer.history}),up.layer.stack.push(this.layer),this.layer.createElements(),this.layer.setupHandlers()}$t(){this.jt(),this.handleLayerChangeRequests(),this.responseDoc.commitElement(this.Ht),this.layer.setContent(this.Ht),this.setReloadAttrs({newElement:this.Ht,source:this.options.source}),this.responseDoc.finalizeElement(this.Ht),this.Dt=new up.RenderResult({layer:this.layer,fragments:[this.Ht],target:this.target}),up.hello(this.layer.element,{...this.options,layer:this.layer}),this.qt(),this.Dt.finished=this.Bt(),this.layer.opening=!1,this.Ut(),this.abortWhenLayerClosed()}Pt(){if(this.Mt)return;let t=this.zt().other;this.Mt=this.executeSteps(t,this.responseDoc)}async Bt(){return await this.layer.startOpenAnimation(),this.abortWhenLayerClosed(),this.$(),this.Dt}Rt(){const t={...this.options,opening:!0};return up.layer.build(t,(t=>this.options=up.RenderOptions.finalize(t)))}jt(){"auto"===this.layer.history&&(this.layer.history=up.fragment.hasAutoHistory([this.Ht],this.layer));let{parent:t}=this.layer;this.layer.history&&=t.history,t.saveHistory(),this.layer.updateHistory(this.options)}$(){this.Tt.overlayFocus?.moveToBack(),this.layer.overlayFocus.moveToFront(),new up.FragmentFocus({fragment:this.Ht,layer:this.layer,autoMeans:["autofocus","layer"],inputDevice:this.options.inputDevice}).process(this.options.focus)}qt(){const t={...this.options,fragment:this.Ht,layer:this.layer,autoMeans:["hash","layer"]};new up.FragmentScrolling(t).process(this.options.scroll)}Nt(){up.event.assertEmitted("up:layer:open",{origin:this.F,baseLayer:this.Tt,layerOptions:this.options,log:"Opening new overlay"})}Ut(){this.layer.emit("up:layer:opened",{origin:this.F,callback:this.layer.callback("onOpened"),log:`Opened new ${this.layer}`})}zt(){return up.radio.hungrySteps(this.It())}It(){return{...this.options,layer:this.layer,history:this.layer.history}}}},1752:()=>{up.Change.Removal=class Removal extends up.Change{}},9441:()=>{var t;const e=up.util;up.Change.UpdateLayer=(t=class UpdateLayer extends up.Change.Addition{constructor(t){super(t=up.RenderOptions.finalize(t)),this.layer=t.layer,this.target=t.target,this.Kt=t.context,this.Vt=up.fragment.parseTargetSteps(this.target,this.options)}getPreflightProps(){return this.Xt(),{layer:this.layer,mode:this.layer.mode,context:e.merge(this.layer.context,this.Kt),origin:this.options.origin,target:this.Wt(),fragments:this.Jt(),newLayer:!1}}Wt(){return this.Xt(),up.fragment.targetForSteps(this.Vt)}Jt(){return this.Xt(),e.map(this.Vt,"oldElement")}execute(t,e){this.responseDoc=t,this.Lt(),e();let n=this.layer.on("up:layer:accepting up:layer:dimissing",this.Pt.bind(this));try{return this.Gt(),this.Pt(),up.RenderResult.both(this.Qt,this.Mt)}finally{n()}}Gt(){this.Vt.length&&up.puts("up.render()",`Updating "${this.Wt()}" in ${this.layer}`),this.Yt(),this.options.saveScroll&&up.viewport.saveScroll({layer:this.layer}),this.options.saveFocus&&up.viewport.saveFocus({layer:this.layer}),this.options.peel&&this.layer.peel({history:!this.Zt()}),!1!==this.options.abort&&up.fragment.abort(this.Jt(),{reason:"Fragment is being replaced"}),Object.assign(this.layer.context,this.Kt),this.Zt()&&this.layer.updateHistory(this.options),this.handleLayerChangeRequests(),this.Qt=this.executeSteps(this.Vt,this.responseDoc,this.options)}Pt(){if(this.Mt)return;let t=this.zt().other;this.Mt=this.executeSteps(t,this.responseDoc)}Xt(){this.te(),this.ee()}Lt(){this.te(),this.ne(),this.ee(),this.ie()}ne(){this.Vt.push(...this.zt().current)}te(){this.Vt=this.Vt.filter((t=>{const n=new up.FragmentFinder(e.pick(t,["selector","origin","layer","match","preferOldElements"]));if(t.oldElement||=n.find(),t.oldElement)return!0;if(!t.maybe)throw new up.CannotMatch}))}ie(){this.Vt=this.responseDoc.selectSteps(this.Vt)}ee(){this.Vt=up.fragment.compressNestedSteps(this.Vt)}zt(){return up.radio.hungrySteps(this.It())}Yt(){let t=up.FocusCapsule.preserve(this.layer);this.Vt.forEach(((e,n)=>{e.focusCapsule=t,n>0&&(e.scroll=!1,e.focus=!1)}))}Zt(){return e.evalAutoOption(this.options.history,this.se.bind(this))}se(){const t=e.map(this.Vt,"oldElement");return up.fragment.hasAutoHistory(t,this.layer)}It(){return{...this.options,layer:this.layer,history:this.Zt()}}},e.memoizeMethod(t.prototype,{Xt:!0,te:!0,Zt:!0,zt:!0}),t)},9489:()=>{const t=up.util,e=up.element;up.Change.UpdateSteps=class UpdateSteps extends up.Change.Addition{constructor(e){super(e),this.re=e.noneOptions||{},this.Vt=t.copy(e.steps)}execute(t){if(this.responseDoc=t,this.Vt=t.selectSteps(this.Vt),this.Vt=t.commitSteps(this.Vt),!this.Vt.length)return this.oe();this.renderResult=new up.RenderResult({layer:this.Vt[0]?.layer,target:up.fragment.targetForSteps(this.Vt)}),this.Vt.reverse();const e=this.Vt.map((t=>this.ue(t)));return this.renderResult.finished=this.Bt(e),this.renderResult}oe(){return this.$(null,this.re),this.qt(null,this.re),up.RenderResult.buildNone()}async Bt(t){await Promise.all(t);for(let t of this.Vt)this.abortWhenLayerClosed(t.layer);return this.renderResult}ae(t){let e=t.matches("up-wrapper")?t.children:[t];this.renderResult.fragments.unshift(...e)}ue(t){switch(this.setReloadAttrs(t),t.placement){case"swap":if(this.he(t))return this.$(t.oldElement,t),this.qt(t.oldElement,t),Promise.resolve();{this.ce(t);const e=t.oldElement.parentNode,n={...t,beforeStart(){up.fragment.markAsDestroying(t.oldElement)},afterInsert:()=>{this.le(t),this.responseDoc.finalizeElement(t.newElement),this.pe(t),up.hello(t.newElement,t),this.ae(t.newElement)},beforeDetach:()=>{up.script.clean(t.oldElement,{layer:t.layer})},afterDetach(){up.element.cleanJQuery(),up.fragment.emitDestroyed(t.oldElement,{parent:e,log:!1})},scrollNew:()=>{this.$(t.newElement,t),this.qt(t.newElement,t)}};return up.morph(t.oldElement,t.newElement,t.transition,n)}case"content":{let n=e.wrapChildren(t.oldElement),i=e.wrapChildren(t.newElement),s={...t,placement:"swap",oldElement:n,newElement:i,focus:!1};return this.ue(s).then((()=>{e.unwrap(i),this.$(t.oldElement,t)}))}case"before":case"after":{let n=e.wrapChildren(t.newElement),i="before"===t.placement?"afterbegin":"beforeend";return t.oldElement.insertAdjacentElement(i,n),this.responseDoc.finalizeElement(n),up.hello(n,t),this.ae(n),this.$(n,t),this.qt(n,t),up.animate(n,t.transition,t).then((()=>e.unwrap(n)))}default:up.fail("Unknown placement: %o",t.placement)}}he(t){if(!t.useKeep)return;const{oldElement:n,newElement:i}=t;let s;if(!e.booleanAttr(n,"up-keep"))return;let r=up.fragment.toTarget(n);const o={layer:t.layer};if(s=t.descendantsOnly?up.fragment.get(i,r,o):up.fragment.subtree(i,r,o)[0],s&&!1!==e.booleanAttr(s,"up-keep")){const e={oldElement:n,newElement:s,newData:up.script.data(s),renderOptions:t};if(!up.fragment.emitKeep(e).defaultPrevented)return e}}ce(t){const e=[];if(t.useKeep)for(let n of t.oldElement.querySelectorAll("[up-keep]")){let i=this.he({...t,oldElement:n,descendantsOnly:!0});if(i){const t=n.cloneNode(!0);n.insertAdjacentElement("beforebegin",t),n.classList.add("up-keeping"),up.script.disableSubtree(i.newElement);let s=up.viewport.subtree(i.oldElement);i.revivers=s.map((function(t){let e=up.viewport.copyCursorProps(t);return()=>up.viewport.copyCursorProps(e,t)})),this.fe(document.body)?i.newElement.replaceWith(n):document.body.append(n),e.push(i)}}t.keepPlans=e}le(t){for(let e of t.keepPlans){e.newElement.replaceWith(e.oldElement);for(let t of e.revivers)t()}}pe(t){for(let e of t.keepPlans)e.oldElement.classList.remove("up-keeping")}fe(e){return t.some(this.Vt,(t=>t.oldElement.contains(e)))}$(t,e){return new up.FragmentFocus({...e,fragment:t,autoMeans:up.fragment.config.autoFocus}).process(e.focus)}qt(t,e){return new up.FragmentScrolling({...e,fragment:t,autoMeans:up.fragment.config.autoScroll}).process(e.scroll)}}},1569:()=>{const t=up.util;up.CompilerPass=class CompilerPass{constructor(t,e,{layer:n,data:i,dataMap:s,meta:r}){n||=up.layer.get(t)||up.layer.current,this.de=t,this.me=e,this.C=n,this.ge=i,this.ye=s,r||={},r.layer=n,this.we=r}run(){this.C.asCurrent((()=>{this.setCompileData();for(let t of this.me)this.be(t)}))}setCompileData(){if(this.ge&&(this.de.upCompileData=this.ge),this.ye)for(let t in this.ye)for(let e of this.ve(t))e.upCompileData=this.ye[t]}be(t){const e=this._e(t);if(e.length){if(t.isDefault||up.puts("up.hello()",'Compiling %d× "%s" on %s',e.length,t.selector,this.C),t.batch)this.ke(t,e);else for(let n of e)this.Se(t,n);return up.migrate.postCompile?.(e,t)}}Se(t,e){const n=[e];if(1!==t.length){const t=up.script.data(e);n.push(t,this.we)}const i=this.xe(t,e,n);let s=this.Ee(i);s&&up.destructor(e,s)}ke(e,n){const i=[n];if(1!==e.length){const e=t.map(n,up.script.data);i.push(e,this.we)}const s=this.xe(e,n,i);this.Ee(s)&&up.fail("Compilers with { batch: true } cannot return destructors")}xe(t,e,n){return up.error.guard((()=>t.apply(e,n)))}Ee(e){if(t.isFunction(e)||t.isArray(e)&&t.every(e,t.isFunction))return e}ve(e){return up.fragment.subtree(this.de,t.evalOption(e),{layer:this.C})}_e(e){let n=this.ve(e.selector);return t.filter(n,(t=>{let n=t.upAppliedCompilers||=new Set;if(!n.has(e))return n.add(e),!0}))}}},3742:()=>{const t=up.util,e=up.element;up.Config=class Config{constructor(t=(()=>({}))){this.Oe=t,this.reset(),document.addEventListener("up:framework:reset",(()=>this.reset()))}reset(){Object.assign(this,this.Oe())}matches(t,e){return t.matches(this.selector(e))}selector(n){let i=this[n],s=this["no"+t.upperCaseFirst(n)];return e.unionSelector(i,s)}selectorFn(t){return()=>this.selector(t)}}},2737:()=>{const t=up.util,e=up.element;up.CSSTransition=class CSSTransition{constructor(t,e,n){this.H=t,this.Ce=e,this.Fe=Object.keys(this.Ce),this.Te=n.finishEvent,this.Re=n.duration,this.Le=n.easing,this.Ae=!1}start(){return 0===this.Fe.length?(this.Ae=!0,Promise.resolve()):(this.Pe=t.newDeferred(),this.$e(),this.De=new Date,this.Me(),this.He(),this.Ne(),this.je(),this.Pe)}He(){this.Te&&(this.qe=up.on(this.H,this.Te,this.Be.bind(this)))}Be(t){t.stopPropagation(),this.Bt()}Me(){this.Ue=t.timer(this.Re+100,(()=>this.Bt()))}ze(){clearTimeout(this.Ue)}Ne(){this.Ie=up.on(this.H,"transitionend",this.Ke.bind(this))}Ke(e){if(e.target!==this.H)return;if(new Date-this.De<=.25*this.Re)return;const n=e.propertyName;t.contains(this.Fe,n)&&this.Bt()}Bt(){this.Ae||(this.Ae=!0,this.ze(),this.qe?.(),this.Ie?.(),e.concludeCSSTransition(this.H),this.Ve(),this.Pe.resolve())}$e(){const t=e.style(this.H,["transition-property","transition-duration","transition-delay","transition-timing-function"]);if(e.hasCSSTransition(t)){if("all"!==t["transition-property"]){const n=t["transition-property"].split(/\s*,\s*/),i=e.style(this.H,n);this.Xe=e.setTemporaryStyle(this.H,i)}this.We=e.concludeCSSTransition(this.H)}}Ve(){this.Xe?.(),this.We?.()}je(){e.setStyle(this.H,{"transition-property":this.Fe.join(),"transition-duration":`${this.Re}ms`,"transition-timing-function":this.Le}),e.setStyle(this.H,this.Ce)}}},3635:()=>{const t=up.util;up.DestructorPass=class DestructorPass{constructor(t,e){this.Je=t,this.Ge=e}run(){for(let e of this.Qe()){let n=t.pluckKey(e,"upDestructors");if(n)for(let t of n)this.Ye(t,e);e.classList.remove("up-can-clean")}}Qe(){const t={...this.Ge,destroying:!0};return up.fragment.subtree(this.Je,".up-can-clean",t)}Ye(t,e){up.error.guard((()=>t(e)))}}},1906:()=>{const t=up.util,e=up.element;up.EventEmitter=class EventEmitter extends up.Record{keys(){return["target","event","baseLayer","callback","log","ensureBubbles"]}emit(){return this.Ze(),this.baseLayer?this.baseLayer.asCurrent((()=>this.tn())):this.tn(),this.event}tn(){this.target.dispatchEvent(this.event),this.ensureBubbles&&!this.target.isConnected&&document.dispatchEvent(this.event),up.error.guard((()=>this.callback?.(this.event)))}assertEmitted(){const t=this.emit();if(t.defaultPrevented)throw new up.Aborted(`Event ${t.type} was prevented`)}Ze(){if(!up.log.config.enabled)return;let e,n=this.log;t.isArray(n)?[n,...e]=n:e=[];const{type:i}=this.event;t.isString(n)?up.puts(i,n,...e):!1!==n&&up.puts(i,`Event ${i}`)}static fromEmitArgs(n,i={}){let s,r=t.extractOptions(n);return r=t.merge(i,r),t.isElementish(n[0])?r.target=e.get(n.shift()):n[0]instanceof up.Layer&&(r.layer=n.shift()),t.isGiven(r.layer)&&(s=up.layer.get(r.layer),r.target||=s.element,r.baseLayer||=s),r.baseLayer&&(r.baseLayer=up.layer.get(r.baseLayer)),t.isString(r.target)?r.target=up.fragment.get(r.target,{layer:r.layer}):r.target||(r.target=document),n[0]?.preventDefault?(r.event=n[0],r.log??=n[0].log):t.isString(n[0])?r.event=up.event.build(n[0],r):r.event=up.event.build(r),new this(r)}}},4158:()=>{const t=up.util;up.EventListener=class EventListener extends up.Record{keys(){return["element","eventType","selector","callback","guard","baseLayer","passive","once","capture","beforeBoot"]}constructor(t){super(t),this.en=this.constructor.nn(t),this.isDefault=up.framework.evaling,this.beforeBoot??=0===this.eventType.indexOf("up:framework:"),this.nativeCallback=this.nativeCallback.bind(this)}bind(){const t=this.element.upEventListeners||={};t[this.en]&&up.fail("up.on(): The %o callback %o cannot be registered more than once",this.eventType,this.callback),t[this.en]=this,this.element.addEventListener(...this.sn())}sn(){let e=t.compactObject(t.pick(this,["once","passive","capture"]));return[this.eventType,this.nativeCallback,e]}unbind(){let t=this.element.upEventListeners;t&&delete t[this.en],this.element.removeEventListener(...this.sn())}nativeCallback(e){if(up.framework.beforeBoot&&!this.beforeBoot)return;let n=e.target;if(this.selector&&(n=n.closest(t.evalOption(this.selector))),(!this.guard||this.guard(e))&&n){const t=[e,n],i=this.callback.length;if(1!==i&&2!==i){const e=up.script.data(n);t.push(e)}if("click"===this.eventType&&n.disabled)return;const s=this.callback.bind(n,...t);this.baseLayer?this.baseLayer.asCurrent(s):s()}}static fromElement(t){let e=t.element.upEventListeners;if(e)return e[this.nn(t)]}static nn(e){return e.callback.upUid||=t.uid(),[e.eventType,e.selector,e.callback.upUid].join("|")}static allNonDefault(e){let n=e.upEventListeners;if(n){const e=Object.values(n);return t.reject(e,"isDefault")}return[]}}},3139:()=>{const t=up.util;up.EventListenerGroup=class EventListenerGroup extends up.Record{keys(){return["elements","eventTypes","selector","callback","guard","baseLayer","passive","once","capture","beforeBoot"]}bind(){const e=[];return this.rn((function(t){const n=new up.EventListener(t);return n.bind(),e.push(n.unbind.bind(n))})),t.sequence(e)}rn(t){for(let e of this.elements)for(let n of this.eventTypes)t(this.un(e,n))}un(t,e){return{...this.attributes(),element:t,eventType:e}}unbind(){this.rn((function(t){let e=up.EventListener.fromElement(t);e&&e.unbind()}))}static fromBindArgs(e,n){const i=(e=t.copy(e)).pop();let s;s=e[0].addEventListener?[e.shift()]:t.isJQuery(e[0])||t.isList(e[0])&&e[0][0].addEventListener?e.shift():[document];let r=t.parseTokens(e.shift()),o=up.migrate.fixEventTypes;o&&(r=o(r));const u=t.extractOptions(e);return new this({elements:s,eventTypes:r,selector:e[0],callback:i,...u,...n})}}},2214:()=>{const t=up.util;up.FieldWatcher=class FieldWatcher{constructor(t,e,n){this.Ge=e,this.de=t,this.an=up.form.getScope(t),this.hn=n,this.cn=e.batch,this.ln=e.abortable}start(){this.pn=null,this.fn=this.dn(),this.mn=null,this.gn=!1,this.yn=[],this.wn(this.de),this.de.addEventListener("up:fragment:inserted",(({target:t})=>{t!==this.de&&this.wn(t)})),this.yn.push(up.fragment.onAborted(this.an,(()=>this.bn()))),this.yn.push(up.on(this.an,"reset",(()=>this.vn())))}stop(){this.bn();for(let t of this.yn)t()}_n(e){let n=t.copy(this.Ge);return up.form.watchOptions(e,n,{defaults:{event:"input"}})}wn(t){for(let e of up.form.fields(t))this.kn(e)}kn(t){let e=this._n(t);this.yn.push(up.on(t,e.event,(()=>this.Sn(e))))}bn(){this.pn=null}xn(e,n){this.pn=e,this.En=n;let i=n.delay||0;clearTimeout(this.mn),this.mn=t.timer(i,(()=>{this.mn=null,this.On()}))}Cn(e){return!t.isEqual(e,this.fn)&&!t.isEqual(this.pn,e)}async On(){if(!this.pn)return;if(this.gn)return;if(this.mn)return;if(!this.an.isConnected)return;let e=this.En;const n=this.Fn(this.fn,this.pn);this.fn=this.pn,this.pn=null,this.gn=!0,this.En=null;let i={...e,disable:!1};const s=[];if(this.cn)s.push(this.Tn(n,i));else for(let t in n){const e=n[t];s.push(this.Tn(e,t,i))}if(t.some(s,t.isPromise)){let t=Promise.allSettled(s);up.form.disableWhile(t,e),await t}this.gn=!1,this.On()}Tn(...t){return up.error.guard((()=>this.hn(...t)))}Fn(e,n){const i={};let s=Object.keys(e);s=s.concat(Object.keys(n)),s=t.uniq(s);for(let r of s){const s=e[r],o=n[r];t.isEqual(s,o)||(i[r]=o)}return i}dn(){return up.Params.fromContainer(this.de).toObject()}Sn(t={}){const e=this.dn();this.Cn(e)&&this.xn(e,t)}vn(){t.task((()=>this.Sn()))}}},5949:()=>{const t=up.util;up.FIFOCache=class FIFOCache{constructor({capacity:e=10,normalizeKey:n=t.identity}={}){this.Rn=new Map,this.Ln=e,this.An=n}get(t){return t=this.An(t),this.Rn.get(t)}set(t,e){if(this.Rn.size===this.Ln){let t=this.Rn.keys().next().value;this.Rn.delete(t)}t=this.An(t),this.Rn.set(t,e)}clear(){this.Rn.clear()}}},665:()=>{up.FocusCapsule=class FocusCapsule{constructor(t,e){this.Pn=t,this.$n=e}restore(t,e){let n=up.fragment.get(this.Pn,{layer:t});if(n)return up.viewport.copyCursorProps(this.$n,n),up.focus(n,e),!0}static preserve(t){let e=up.viewport.focusedElementWithin(t.element);if(!e)return;let n=up.fragment.tryToTarget(e);return n?new this(n,up.viewport.copyCursorProps(e)):void 0}}},5240:()=>{const t=up.util,e=up.element;up.FormValidator=class FormValidator{constructor(t){this.Dn=t,this.Mn=[],this.Hn=null,this.Nn=!1,this.jn(),this.qn()}qn(){up.fragment.onAborted(this.Dn,(t=>this.Bn(t)))}Bn(t){this.Mn.length&&(this.Mn=[],this.Un.reject(new up.Aborted(t.reason)),this.jn())}jn(){this.Un=t.newDeferred()}watchContainer(t){let{event:e}=this.zn(t);up.on(t,e,{guard:()=>up.fragment.isAlive(t)},(()=>up.error.muteUncriticalRejection(this.validate({origin:t}))))}validate(t={}){let e=this.In(t);return this.Mn.push(...e),this.Kn(),this.Un}In(t){let e=this.Vn(t)||this.Xn(t)||this.Wn(t.origin);for(let n of e)n.renderOptions=this.zn(n.origin,t),n.target=up.fragment.resolveOrigin(n.target,n);return e}Xn({origin:t,...e}){if(up.form.isField(t))return this.Jn(t)||this.Gn(t,e)}Gn(t,{formGroup:e=!0}){if(!e)return;let n=up.form.groupSolution(t);return n?(up.puts("up.validate()","Validating form group of field %o",t),[n]):void 0}Vn({target:e,origin:n}){if(t.isString(e)){up.puts("up.validate()",'Validating target "%s"',e);let i=up.fragment.splitTarget(e);return t.compact(i.map((function(t){let e=up.fragment.get(t,{origin:n});if(e)return{element:e,target:t,origin:n};up.fail('Validation target "%s" does not match an element',t)})))}}Wn(t){return up.puts("up.validate()","Validating element %o",t),[{element:t,target:up.fragment.toTarget(t),origin:t}]}Jn(t){let n=t.closest("[up-validate]");if(n){let i=e.booleanOrStringAttr(n,"up-validate");return this.Vn({target:i,origin:t})}}zn(t,e){return up.form.watchOptions(t,e,{defaults:{event:"change"}})}Kn(){let e=this.Mn.map((t=>t.renderOptions.delay)),n=Math.min(...e)||0;clearTimeout(this.Hn),this.Hn=t.timer(n,(()=>{this.Hn=null,this.Qn()}))}Qn(){up.error.muteUncriticalRejection(this.Yn())}async Yn(){if(!this.Mn.length)return;if(this.Nn)return;if(this.Hn)return;let e=this.Mn;this.Mn=[];let n=t.map(e,"origin"),i=t.flatMap(n,up.form.fields),s=t.uniq(t.map(i,"name")),r=this.Zn(e),o=t.map(e,"renderOptions"),u=t.mergeDefined(...o,{dataMap:r},up.form.destinationOptions(this.Dn));u.target=t.map(e,"target").join(", "),u.feedback=t.some(o,"feedback"),u.origin=this.Dn,u.focus??="keep",u.failOptions=!1,u.defaultMaybe=!0,u.params=up.Params.merge(u.params,...t.map(o,"params")),u.headers=t.merge(...t.map(o,"headers")),this.ti(u.headers,s),u.guardEvent=up.event.build("up:form:validate",{fields:i,log:"Validating form",params:u.params,form:this.Dn}),this.Nn=!0;let a=this.Un;this.jn(),u.disable=!1;for(let t of e)up.form.disableWhile(a,{disable:t.renderOptions.disable,origin:t.origin});try{a.resolve(up.render(u)),await a}finally{this.Nn=!1,this.Qn()}}ti(t,e){let n=up.protocol.headerize("validate"),i=e.join(" ");(!i||i.length>up.protocol.config.maxHeaderSize)&&(i=":unknown"),t[n]=i}Zn(e){let n={};for(let i of e){let e=t.pluckKey(i.renderOptions,"data");t.pluckKey(i.renderOptions,"keepData")&&(e=up.data(i.element)),e&&(n[i.target]=e)}return n}static forElement(t){let e=up.form.get(t);return e.upFormValidator||=new this(e)}}},2587:()=>{const t=up.util,e=/^([^ >+(]+) (.+)$/;up.FragmentFinder=class FragmentFinder{constructor(t){this.Ge=t,this.F=t.origin,this.ei=t.selector,this.ni=t.document||window.document,this.ii=t.match??up.fragment.config.match,this.si=t.preferOldElements}find(){return this.ri()||this.oi()||this.ui()}ri(){if(this.si)return this.si.find((t=>this.ni.contains(t)&&up.fragment.matches(t,this.ei)))}oi(){if("region"===this.ii&&!up.fragment.containsMainPseudo(this.ei)&&this.F?.isConnected)return this.ai()||this.hi()}ai(){return up.fragment.closest(this.F,this.ei,this.Ge)}hi(){let n=up.fragment.splitTarget(this.ei);return t.findResult(n,(t=>{let n=t.match(e);if(n){let t=up.fragment.closest(this.F,n[1],this.Ge);if(t)return up.fragment.getDumb(t,n[2])}}))}ui(){return up.fragment.getDumb(this.ni,this.ei,this.Ge)}}},7031:()=>{const t=up.util,e=up.element,n={preventScroll:!0};up.FragmentFocus=class FragmentFocus extends up.FragmentProcessor{keys(){return super.keys().concat(["hash","focusCapsule","inputDevice"])}processPrimitive(e){switch(e){case"keep":return this.ci();case"restore":return this.li();case"target":case!0:return this.pi(this.fragment);case"layer":return this.pi(this.layer.getFocusElement());case"main":return this.fi(":main");case"hash":return this.di();case"autofocus":return this.mi();default:if(t.isString(e))return this.fi(e)}}processElement(t){return this.pi(t)}resolveCondition(t){return"lost"===t?this.gi():super.resolveCondition(t)}fi(t){let e=this.findSelector(t);return this.pi(e)}ci(){if(this.gi())return this.focusCapsule?.restore(this.layer,n)}li(){return up.viewport.restoreFocus({layer:this.layer})}mi(){let t=this.fragment&&e.subtree(this.fragment,"[autofocus]")[0];if(t)return this.pi(t)}pi(t){if(t)return up.focus(t,{force:!0,...n,inputDevice:this.inputDevice}),!0}di(){let t=up.viewport.firstHashTarget(this.hash,{layer:this.layer});if(t)return this.pi(t)}gi(){return!this.layer.hasFocus()}}},8057:()=>{const t=up.element;up.FragmentPolling=class FragmentPolling{constructor(t){this.Ge=up.radio.pollOptions(t),this.Je=t,up.destructor(t,this.yi.bind(this)),up.fragment.onAborted(t,this.wi.bind(this)),this.bi="initialized",this.ln=!0,this.vi=!1,this._i()}static forFragment(t){return t.upPolling||=new this(t)}onPollAttributeObserved(){this.ki()}yi(){this.Si()}ki(t){if(Object.assign(this.Ge,t),"started"!==this.bi){if(!up.fragment.isTargetable(this.Je))return void up.warn("[up-poll]","Cannot poll untargetable fragment %o",this.Je);this.bi="started",this.xi(),this.Ei()}}Si(){"started"===this.bi&&(this.Oi(),this.bi="stopped",this.unbindEvents?.())}forceStart(t){Object.assign(this.Ge,t),this.forceStarted=!0,this.ki()}forceStop(){this.Si(),this.forceStarted=!1}xi(){this.unbindEvents||(this.unbindEvents=up.on("visibilitychange up:layer:opened up:layer:dismissed up:layer:accepted",this.Ci.bind(this)))}Ci(){this.Fi()&&this.Ei()}Fi(){return!document.hidden&&("any"===this.Ge.ifLayer||this.Ti())}Oi(){clearTimeout(this.reloadTimer),this.reloadTimer=null}Ei(){this.reloadTimer||this.vi||(this.Oi(),this.reloadTimer=setTimeout(this.Ri.bind(this),this.Li()))}Ri(){this.reloadTimer=null,this.Ai()}Ai(){"started"===this.bi&&(this.Fi()?this.Pi():up.puts("[up-poll]","Will not poll hidden fragment"))}$i(){return this.Ge.interval??t.numberAttr(this.Je,"up-interval")??up.radio.config.pollInterval}Li(){return Math.max(this.$i()-this.Di(),0)}Di(){return new Date-this.Mi}Ti(){return this.layer||=up.layer.get(this.Je),this.layer?.isFront?.()}Pi(){this.Oi();let t=this.ln;try{this.ln=!1,this.vi=!0,up.reload(this.Je,this.Hi()).then(this.Ni.bind(this),this.ji.bind(this))}finally{this.ln=t}}Hi(){let t=up.event.build("up:fragment:poll",{log:["Polling fragment",this.Je]});return{...this.Ge,guardEvent:t}}wi({newLayer:t}){this.ln&&!t&&this.Si()}Ni({fragment:t}){this.vi=!1,this._i(),t?this.qi(t):this.Ei()}qi(t){this.Si(),this.forceStarted&&up.fragment.matches(this.Je,t)&&this.constructor.forFragment(t).forceStart(this.Ge)}ji(t){this.vi=!1,this._i(),this.Ei(),up.error.throwCritical(t)}_i(){this.Mi=new Date}}},2828:()=>{const t=up.util;up.FragmentProcessor=class FragmentProcessor extends up.Record{keys(){return["fragment","autoMeans","origin","layer"]}process(t){let e=this.preprocess(t);return this.tryProcess(e)}preprocess(e){return t.parseTokens(e,{separator:"or"})}tryProcess(e){if(t.isArray(e))return this.processArray(e);if(t.isFunction(e)){let t=up.error.guard((()=>e(this.fragment,this.attributes())));return this.tryProcess(t)}if(t.isElement(e))return this.processElement(e);if(t.isString(e)){if("auto"===e)return this.tryProcess(this.autoMeans);let t=e.match(/^(.+?)-if-(.+?)$/);if(t)return this.resolveCondition(t[2])&&this.process(t[1])}return this.processPrimitive(e)}processArray(e){return t.find(e,(t=>this.tryProcess(t)))}resolveCondition(t){if("main"===t)return this.fragment&&up.fragment.contains(this.fragment,":main")}findSelector(t){const e={layer:this.layer,origin:this.origin};let n=this.fragment&&up.fragment.get(this.fragment,t,e)||up.fragment.get(t,e);if(n)return n;up.warn("up.render()",'Could not find an element matching "%s"',t)}}},4850:()=>{const t=up.util;up.FragmentScrolling=class FragmentScrolling extends up.FragmentProcessor{keys(){return super.keys().concat(["hash","mode","revealTop","revealMax","revealSnap","scrollBehavior"])}processPrimitive(e){switch(e){case"reset":return this.Bi();case"layer":return this.Ui();case"main":return this.zi(":main");case"restore":return this.Ii();case"hash":return this.hash&&up.viewport.revealHash(this.hash,this.attributes());case"target":case"reveal":case!0:return this.Ki(this.fragment);default:if(t.isString(e))return this.zi(e)}}processElement(t){return this.Ki(t)}Ki(t){if(t)return up.reveal(t,this.attributes()),!0}zi(t){let e=this.findSelector(t);return this.Ki(e)}Ui(){return this.Ki(this.layer.getBoxElement())}Bi(){return up.viewport.resetScroll({...this.attributes(),around:this.fragment}),!0}Ii(){return up.viewport.restoreScroll({...this.attributes(),around:this.fragment})}}},7956:()=>{const t=up.element,e=up.util;up.Layer=class Layer extends up.Record{keys(){return["element","stack","history","mode","context","lastScrollTops","lastFocusCapsules"]}defaults(){return{context:{},lastScrollTops:up.viewport.newStateCache(),lastFocusCapsules:up.viewport.newStateCache()}}constructor(t={}){if(super(t),!this.mode)throw"missing { mode } option"}setupHandlers(){up.link.convertClicks(this)}teardownHandlers(){}mainTargets(){return up.layer.mainTargets(this.mode)}sync(){}accept(){throw new up.NotImplemented}dismiss(){throw new up.NotImplemented}peel(t){this.stack.peel(this,t)}evalOption(t){return e.evalOption(t,this)}isCurrent(){return this.stack.isCurrent(this)}isFront(){return this.stack.isFront(this)}isRoot(){return this.stack.isRoot(this)}isOverlay(){return this.stack.isOverlay(this)}isOpen(){return this.stack.isOpen(this)}isClosed(){return this.stack.isClosed(this)}get parent(){return this.stack.parentOf(this)}get child(){return this.stack.childOf(this)}get ancestors(){return this.stack.ancestorsOf(this)}get descendants(){return this.stack.descendantsOf(this)}get subtree(){return[this,...this.descendants]}get index(){return this.Vi??=this.stack.indexOf(this)}getContentElement(){return this.contentElement||this.element}getBoxElement(){return this.boxElement||this.element}getFocusElement(){return this.getBoxElement()}getFirstSwappableElement(){throw new up.NotImplemented}contains(t){return t.closest(up.layer.anySelector())===this.element}on(...t){return this.Xi(t).bind()}off(...t){return this.Xi(t).unbind()}Xi(t){return up.EventListenerGroup.fromBindArgs(t,{guard:t=>this.Wi(t),elements:[this.element],baseLayer:this})}Wi(t){return this.contains(t.target)}wasHitByMouseEvent({clientX:t,clientY:e}){const n=document.elementFromPoint(t,e);return!n||this.contains(n)}Ji(t){return up.EventEmitter.fromEmitArgs(t,{layer:this})}emit(...t){return this.Ji(t).emit()}isDetached(){return!this.element.isConnected}saveHistory(){this.history&&(this.savedTitle=document.title,this.savedMetaTags=up.history.findMetaTags(),this.savedLocation=up.history.location,this.savedLang=up.history.getLang())}restoreHistory(){this.showsLiveHistory()&&(this.savedLocation&&up.history.push(this.savedLocation),this.savedTitle&&(document.title=this.savedTitle),this.savedMetaTags&&up.history.updateMetaTags(this.savedMetaTags),e.isString(this.savedLang)&&up.history.updateLang(this.savedLang))}asCurrent(t){return this.stack.asCurrent(this,t)}updateHistory(t){e.isString(t.location)&&(this.location=t.location),up.history.config.updateMetaTags&&e.isList(t.metaTags)&&(up.migrate?.warnOfHungryMetaTags?.(t.metaTags),this.metaTags=t.metaTags),e.isString(t.title)&&(this.title=t.title),e.isString(t.lang)&&(this.lang=t.lang)}showsLiveHistory(){return this.history&&this.isFront()}get title(){return this.showsLiveHistory()?document.title:this.savedTitle}set title(t){this.savedTitle=t,this.showsLiveHistory()&&(document.title=t)}get metaTags(){return this.showsLiveHistory()?up.history.findMetaTags():this.savedMetaTags}set metaTags(t){this.savedMetaTags=t,this.showsLiveHistory()&&up.history.updateMetaTags(t)}get lang(){return this.showsLiveHistory()?up.history.getLang():this.savedLang}set lang(t){this.savedLang=t,this.showsLiveHistory()&&up.history.updateLang(t)}get location(){return this.showsLiveHistory()?up.history.location:this.savedLocation}set location(t){(this.location!==(t=e.normalizeURL(t))||this.opening)&&(this.savedLocation=t,this.showsLiveHistory()&&up.history.push(t),this.opening||this.emit("up:layer:location:changed",{location:t}))}selector(t){return this.constructor.selector(t)}static selector(t){throw new up.NotImplemented}toString(){throw new up.NotImplemented}affix(...e){return t.affix(this.getFirstSwappableElement(),...e)}[e.isEqual.key](t){return this.constructor===t.constructor&&this.element===t.element}hasFocus(){let t=document.activeElement;return t!==document.body&&this.element.contains(t)}reset(){Object.assign(this,this.defaults())}}},7101:()=>{var t;up.Layer.Cover=((t=class Cover extends up.Layer.OverlayWithViewport{}).mode="cover",t)},5580:()=>{var t;up.Layer.Drawer=((t=class Drawer extends up.Layer.OverlayWithViewport{}).mode="drawer",t)},86:()=>{var t;up.Layer.Modal=((t=class Modal extends up.Layer.OverlayWithViewport{}).mode="modal",t)},7403:()=>{const t=up.element,e=up.util;up.Layer.Overlay=class Overlay extends up.Layer{keys(){return super.keys().concat(["position","align","size","origin","class","backdrop","openAnimation","closeAnimation","openDuration","closeDuration","openEasing","closeEasing","backdropOpenAnimation","backdropCloseAnimation","dismissable","dismissLabel","dismissAriaLabel","trapFocus","onOpened","onAccept","onAccepted","onDismiss","onDismissed","acceptEvent","dismissEvent","acceptLocation","dismissLocation","opening"])}constructor(t){super(t),!0===this.dismissable?this.dismissable=["button","key","outside"]:!1===this.dismissable?this.dismissable=[]:this.dismissable=e.parseTokens(this.dismissable),this.acceptLocation&&(this.acceptLocation=new up.URLPattern(this.acceptLocation)),this.dismissLocation&&(this.dismissLocation=new up.URLPattern(this.dismissLocation))}callback(t){let e=this[t];if(e)return e.bind(this)}createElement(t){this.nesting||=this.Gi();const n=e.compactObject(e.pick(this,["align","position","size","class","nesting"]));this.element=this.affixPart(t,null,n)}createBackdropElement(t){this.backdropElement=this.affixPart(t,"backdrop")}createViewportElement(t){this.viewportElement=this.affixPart(t,"viewport",{"up-viewport":""})}createBoxElement(t){this.boxElement=this.affixPart(t,"box")}createContentElement(t){this.contentElement=this.affixPart(t,"content")}setContent(t){this.contentElement.append(t),this.onContentSet()}onContentSet(){}createDismissElement(e){return this.dismissElement=this.affixPart(e,"dismiss",{"up-dismiss":'":button"',"aria-label":this.dismissAriaLabel}),t.affix(this.dismissElement,'span[aria-hidden="true"]',{text:this.dismissLabel})}affixPart(e,n,i={}){return t.affix(e,this.selector(n),i)}static selector(t){return e.compact(["up",this.mode,t]).join("-")}Gi(){const{parent:t}=this;return this.mode===t.mode?1+t.Gi():0}setupHandlers(){super.setupHandlers(),this.overlayFocus=new up.OverlayFocus(this),this.Qi("button")&&this.createDismissElement(this.getBoxElement()),this.Qi("outside")&&(this.viewportElement?up.on(this.viewportElement,"up:click",(t=>{t.target===this.viewportElement&&this.Yi(t,!0)})):this.unbindParentClicked=this.parent.on("up:click",((t,e)=>{if(!up.layer.isWithinForeignOverlay(e)){const n=this.origin&&this.origin.contains(e);this.Yi(t,n)}}))),this.Qi("key")&&(this.unbindEscapePressed=up.event.onEscape((t=>this.onEscapePressed(t)))),this.registerClickCloser("up-accept",((t,e)=>{this.accept(t,e)})),this.registerClickCloser("up-dismiss",((t,e)=>{this.dismiss(t,e)})),up.migrate.registerLayerCloser?.(this),this.Zi(this.acceptEvent,this.accept),this.Zi(this.dismissEvent,this.dismiss),this.on("up:click","label[for]",((t,e)=>this.ts(t,e)))}ts(e,n){let i=n.getAttribute("for"),s=up.form.fieldSelector(t.idSelector(i)),r=up.fragment.all(s,{layer:"any"}),o=up.fragment.all(s,{layer:this});if(r.length>1&&o[0]!==r[0]){e.preventDefault();const t=o[0];t.focus(),t.matches("input[type=checkbox], input[type=radio]")&&t.click()}}Yi(t,e){up.log.putsEvent(t),e&&up.event.halt(t),up.error.muteUncriticalSync((()=>this.dismiss(":outside",{origin:t.target})))}onEscapePressed(t){if(this.isFront()){let e=up.form.focusedField();e?e.blur():this.Qi("key")&&(up.event.halt(t,{log:!0}),up.error.muteUncriticalSync((()=>this.dismiss(":key"))))}}registerClickCloser(e,n){let i=`[${e}]`;this.on("up:click",i,(function(s){up.event.halt(s,{log:!0});const r=s.target.closest(i),o=t.jsonAttr(r,e),u={origin:r},a=new up.OptionsParser(r,u);a.booleanOrString("animation"),a.string("easing"),a.number("duration"),a.string("confirm"),up.error.muteUncriticalSync((()=>n(o,u)))}))}Zi(t,e){if(t)return this.on(t,(t=>{t.preventDefault(),up.error.muteUncriticalSync((()=>e.call(this,t,{response:t.response})))}))}tryAcceptForLocation(t){this.es(this.acceptLocation,this.accept,t)}tryDismissForLocation(t){this.es(this.dismissLocation,this.dismiss,t)}es(t,e,n){let i,s;if(t&&(i=this.location)&&(s=t.recognize(i))){const t={...s,location:i};up.error.muteUncriticalSync((()=>e.call(this,t,n)))}}teardownHandlers(){super.teardownHandlers(),this.unbindParentClicked?.(),this.unbindEscapePressed?.(),this.overlayFocus.teardown()}destroyElements(t){const e={...t,animation:()=>this.startCloseAnimation(t),onFinished:()=>{this.onElementsRemoved(),t.onFinished?.()},log:!1};up.destroy(this.element,e)}onElementsRemoved(){}ns(t={}){const e=up.animate(this.getBoxElement(),t.boxAnimation,t);let n;return this.backdrop&&!up.motion.isNone(t.boxAnimation)&&(n=up.animate(this.backdropElement,t.backdropAnimation,t)),Promise.all([e,n])}async startOpenAnimation(t={}){await this.ns({boxAnimation:t.animation??this.evalOption(this.openAnimation),backdropAnimation:"fade-in",easing:t.easing||this.openEasing,duration:t.duration||this.openDuration}),this.wasEverVisible=!0}startCloseAnimation(t={}){return this.ns({boxAnimation:this.wasEverVisible&&(t.animation??this.evalOption(this.closeAnimation)),backdropAnimation:this.wasEverVisible&&"fade-out",easing:t.easing||this.closeEasing,duration:t.duration||this.closeDuration})}accept(t=null,e={}){return this.ss("accept",t,e)}dismiss(t=null,e={}){return this.ss("dismiss",t,e)}Qi(t){return e.contains(this.dismissable,t)}ss(t,e,n){return n={...n,verb:t,value:e,layer:this},new up.Change.CloseLayer(n).execute()}getFirstSwappableElement(){return this.getContentElement().children[0]}toString(){return`${this.mode} overlay`}}},6412:()=>{up.Layer.OverlayWithTether=class OverlayWithTether extends up.Layer.Overlay{createElements(){this.origin||up.fail("Missing { origin } option"),this.rs=new up.Tether({anchor:this.origin,align:this.align,position:this.position}),this.createElement(this.rs.parent),this.createContentElement(this.element)}onContentSet(){this.rs.start(this.element)}onElementsRemoved(){this.rs.stop()}sync(){this.isOpen()&&(this.isDetached()||this.rs.isDetached()?this.dismiss(":detached",{animation:!1,preventable:!1}):this.rs.sync())}}},7965:()=>{up.Layer.OverlayWithViewport=class OverlayWithViewport extends up.Layer.Overlay{static getParentElement(){return document.body}createElements(){up.viewport.bodyShifter.raiseStack(),this.createElement(this.constructor.getParentElement()),this.backdrop&&this.createBackdropElement(this.element),this.createViewportElement(this.element),this.createBoxElement(this.viewportElement),this.createContentElement(this.boxElement)}onElementsRemoved(){up.viewport.bodyShifter.lowerStack()}sync(){this.isDetached()&&this.isOpen()&&this.constructor.getParentElement().appendChild(this.element)}}},4552:()=>{var t;up.Layer.Popup=((t=class Popup extends up.Layer.OverlayWithTether{}).mode="popup",t)},7771:()=>{var t;const e=up.element;up.Layer.Root=((t=class Root extends up.Layer{get element(){return e.root}constructor(t){super(t),this.setupHandlers()}getFirstSwappableElement(){return document.body}static selector(){return"html"}setupHandlers(){this.element.upHandlersApplied||(this.element.upHandlersApplied=!0,super.setupHandlers())}sync(){this.setupHandlers()}accept(){this.os()}dismiss(){this.os()}os(){up.fail("Cannot close the root layer")}toString(){return"root layer"}}).mode="root",t)},6066:()=>{var t;const e=up.util,n=up.element;up.LayerLookup=(t=class LayerLookup{constructor(t,n){this.i=t,!1!==n.normalizeLayerOptions&&up.layer.normalizeOptions(n),this.Ge=n,this.us=e.parseTokens(n.layer)}all(){let t=e.flatMap(this.us,(t=>this.hs(t)));return t=e.compact(t),t=e.uniq(t),t}static all(t,...n){const i=e.parseArgIntoOptions(n,"layer"),{layer:s}=i;return s instanceof up.Layer?[s]:new this(t,i).all()}cs(t){return t=n.get(t),e.find(this.i.reversed(),(e=>e.contains(t)))}ls(t){return this.i.at(t)}hs(t){if(t instanceof up.Layer)return t;if(e.isNumber(t))return this.ls(t);if(/^\d+$/.test(t))return this.ls(Number(t));if(e.isElementish(t))return this.cs(t);switch(t){case"any":return[this.ps(),...this.i.reversed()];case"current":return this.ps();case"closest":return this.i.selfAndAncestorsOf(this.ps());case"parent":return this.ps().parent;case"ancestor":case"ancestors":return this.ps().ancestors;case"child":return this.ps().child;case"descendant":case"descendants":return this.ps().descendants;case"subtree":return this.ps().subtree;case"new":return"new";case"root":return this.i.root;case"overlay":case"overlays":return e.reverse(this.i.overlays);case"front":return this.i.front;case"origin":return this.fs();default:return up.fail("Unknown { layer } option: %o",t)}}fs(){let{origin:t,originLayer:e}=this.Ge;return e||(t?this.cs(t):void 0)}ps(){let{baseLayer:t}=this.Ge;if(e.isString(t)){const e={...this.Ge,baseLayer:this.i.current,normalizeLayerOptions:!1,layer:t};return this.constructor.all(this.i,e)[0]}return t||this.fs()||this.i.current}},e.memoizeMethod(t.prototype,{ps:!0,fs:!0}),t)},6387:()=>{const t=up.util;up.LayerStack=class LayerStack{constructor(){this.ds=[],this.layers=[this.gs()]}gs(){return up.layer.build({mode:"root",stack:this})}remove(e){t.remove(this.layers,e)}peel(e,n){const i=t.reverse(e.descendants),s={...n,preventable:!1};for(let t of i)t.dismiss(":peel",s)}reset(){this.peel(this.root,{animation:!1}),this.ds=[],this.root.reset()}isOpen(e){return t.contains(this.layers,e)}isClosed(t){return!this.isOpen(t)}parentOf(t){return this.layers[t.index-1]}childOf(t){return this.layers[t.index+1]}ancestorsOf(e){return t.reverse(this.layers.slice(0,e.index))}selfAndAncestorsOf(t){return[t,...t.ancestors]}descendantsOf(t){return this.layers.slice(t.index+1)}isRoot(t){return this.root===t}isOverlay(t){return this.root!==t}isCurrent(t){return this.current===t}isFront(t){return this.front===t}get(...t){return this.getAll(...t)[0]}getAll(...t){return up.LayerLookup.all(this,...t)}sync(){for(let t of this.layers)t.sync()}asCurrent(t,e){try{return this.ds.push(t),e()}finally{this.ds.pop()}}reversed(){return t.reverse(this.layers)}dismissOverlays(e=null,n={}){n.dismissable=!1;for(let i of t.reverse(this.overlays))i.dismiss(e,n)}at(t){return this.layers[t]}indexOf(t){return this.layers.indexOf(t)}get count(){return this.layers.length}get root(){return this.layers[0]}get overlays(){return this.root.descendants}get current(){return t.last(this.ds)||this.front}get front(){return t.last(this.layers)}}},5390:()=>{const t=up.util;up.LinkFeedbackURLs=class LinkFeedbackURLs{constructor(e){if(this.ys=up.link.isSafe(e),this.ys){const n=e.getAttribute("href");n&&"#"!==n&&(this.ws=t.matchableURL(n));const i=e.getAttribute("up-href");i&&(this.bs=t.matchableURL(i));const s=e.getAttribute("up-alias");s&&(this.vs=new up.URLPattern(s))}}isCurrent(t){return!(!t||this.ws!==t&&this.bs!==t&&!this.vs?.test?.(t,!1))}}},2460:()=>{const t=up.util,e=up.element;up.LinkFollowIntent=class LinkFollowIntent{constructor(t,e){this._s=t,this.hn=e,this.ks("mouseenter mousedown touchstart",(t=>this.Ss(t))),this.ks("mouseleave",(()=>this.xs())),up.fragment.onAborted(this._s,(()=>this.xs()))}ks(t,e){up.on(this._s,t,{passive:!0},e)}Ss(e){if(up.link.shouldFollowEvent(e,this._s))if(this.xs(),"mouseenter"===e.type){let n=this.Es();this.Os=t.timer(n,(()=>this.Tn(e)))}else this.Tn(e)}xs(){clearTimeout(this.Os),up.network.abort((t=>t.origin===this._s&&t.background))}Es(){return e.numberAttr(this._s,"up-preload-delay")??up.link.config.preloadDelay}Tn(t){up.log.putsEvent(t),up.error.muteUncriticalRejection(this.hn())}}},1653:()=>{let t="up.log.enabled",e=!1;try{e=!!sessionStorage?.getItem(t)}catch{}up.LogConfig=class LogConfig extends up.Config{constructor(){super((()=>({banner:!0,format:!0})))}get enabled(){return e}set enabled(n){e=n;try{sessionStorage?.setItem(t,n?"1":"")}catch{}}}},7792:()=>{const t=up.util,e=up.element;up.MotionController=class MotionController{constructor(t){this.Cs=`up-${t}`,this.ei=`.${this.Cs}`,this.finishEvent=`up:${t}:finish`,this.finishCount=0,this.Fs=0}startFunction(t,n,i={}){t=e.list(t);const s=()=>up.error.muteUncriticalRejection(n());if(i.trackMotion=i.trackMotion??up.motion.isEnabled(),!1===i.trackMotion)return s();{i.trackMotion=!1,this.finish(t),this.Ts(t);let e=this.Rs(t,s);return e=e.then((()=>this.Ls(t))),e}}finish(t){if(this.finishCount++,0!==this.Fs&&up.motion.isEnabled()){t=this.As(t);for(let e of t)this.Ps(e);return up.migrate.formerlyAsync?.("up.motion.finish()")}}As(n){return n?t.flatMap(n,(t=>e.list(t.closest(this.ei),t.querySelectorAll(this.ei)))):document.querySelectorAll(this.ei)}isActive(t){return t.classList.contains(this.Cs)}Ps(t){this.$s(t)}$s(t,e={}){return e={target:t,log:!1,...e},up.emit(this.finishEvent,e)}Ts(t){this.Fs++,this.Ds(t,!0)}Ls(t){this.Fs--,this.Ds(t,!1)}Ds(t,e){for(let n of t)n.classList.toggle(this.Cs,e)}Rs(t,e){if(t.length<2)return e();const n=up.on(t,this.finishEvent,(e=>{if(!e.forwarded)for(let n of t)n!==e.target&&this.isActive(n)&&this.$s(n,{forwarded:!0})}));return e().then(n)}async reset(){await this.finish(),this.finishCount=0,this.Fs=0}}},4308:()=>{const t=up.util,e=up.element;up.NonceableCallback=class NonceableCallback{constructor(t,e){this.script=t,this.nonce=e}static fromString(t){let e=t.match(/^(nonce-([^\s]+)\s)?(.*)$/);return new this(e[3],e[2])}toFunction(...t){if(this.nonce){let e=this;return function(...n){return e.Ms(this,t,n)}}return new Function(...t,this.script)}toString(){return`nonce-${this.nonce} ${this.script}`}Ms(t,e,n){let i,s=`\n try {\n up.noncedEval.value = (function(${e.join()}) {\n ${this.script}\n }).apply(up.noncedEval.thisArg, up.noncedEval.args)\n } catch (error) {\n up.noncedEval.error = error\n }\n `;try{if(up.noncedEval={args:n,thisArg:t},i=up.element.affix(document.body,"script",{nonce:this.nonce,text:s}),up.noncedEval.error)throw up.noncedEval.error;return up.noncedEval.value}finally{up.noncedEval=void 0,i&&i.remove()}}Hs(e){return this.nonce&&t.contains(e,this.nonce)}static adoptNonces(n,i){if(!i?.length)return;const s=t.memoize(up.protocol.cspNonce);t.each(up.script.config.nonceableAttributes,(r=>{let o=e.subtree(n,`[${r}^="nonce-"]`);t.each(o,(t=>{let e=t.getAttribute(r),n=this.fromString(e),o=(t,...n)=>up.log.warn("up.render()",`Cannot use callback [${r}="${e}"]: ${t}`,...n);if(!n.Hs(i))return o("Callback's CSP nonce (%o) does not match response header (%o)",n.nonce,i);let u=s();if(!u)return o("Current page's CSP nonce is unknown");n.nonce=u,t.setAttribute(r,n.toString())}))}))}}},1104:()=>{const t=up.util,e=up.element;up.OptionsParser=class OptionsParser{constructor(t,e,n={}){this.Ge=e,this.H=t,this.Ns=n,this.js=n.fail,this.qs=n.closest,this.Bs=n.attrPrefix||"up-",this.Us=n.defaults||{}}string(t,n){this.parse(e.attr,t,n)}boolean(t,n){this.parse(e.booleanAttr,t,n)}number(t,n){this.parse(e.numberAttr,t,n)}booleanOrString(t,n){this.parse(e.booleanOrStringAttr,t,n)}json(t,n){this.parse(e.jsonAttr,t,n)}callback(t,n={}){this.parse(((t,i)=>e.callbackAttr(t,i,n)),t,n)}parse(e,n,i={}){const s=t.wrapList(i.attr??this.zs(n));let r=this.Ge[n];for(let t of s)r??=this.Is(e,this.H,t);r??=i.default??this.Us[n];let o,u=i.normalize;if(u&&(r=u(r)),t.isDefined(r)&&(this.Ge[n]=r),this.js&&(o=up.fragment.failKey(n))){const n=t.compact(t.map(s,(t=>this.Ks(t))));this.parse(e,o,{...i,attr:n})}}include(t){let e=t(this.H,this.Ge,this.Ns);Object.assign(this.Ge,e)}Is(t,n,i){return this.qs?e.closestAttr(n,i,t):t(n,i)}Ks(t){return this.Vs(t,this.Bs+"on-")||this.Vs(t,this.Bs)}Vs(t,e){if(t.startsWith(e))return`${e}fail-${t.substring(e.length)}`}zs(e){return`${this.Bs}${t.camelToKebabCase(e)}`}}},8665:()=>{const t=up.element,e=up.util;up.OverlayFocus=class OverlayFocus{constructor(t){this.C=t,this.pi=this.C.getFocusElement(),this.Xs=this.C.trapFocus}moveToFront(){this.Ws||(this.Ws=!0,this.Js=t.setTemporaryAttrs(this.pi,{tabindex:"0",role:"dialog","aria-modal":this.Xs.toString()}),this.Xs&&(this.Gs=up.on("focusin",(t=>this.Qs(t))),this.Ys=t.affix(this.pi,"beforebegin","up-focus-trap[tabindex=0]"),this.Zs=t.affix(this.pi,"afterend","up-focus-trap[tabindex=0]")))}moveToBack(){this.teardown()}teardown(){this.Ws&&(this.Ws=!1,this.Js(),this.Xs&&(this.Gs(),this.Ys.remove(),this.Zs.remove()))}Qs(t){const{target:e}=t;this.tr||up.layer.isWithinForeignOverlay(e)||(this.tr=!0,e===this.Ys?this.er():e!==this.Zs&&this.C.contains(e)||this.nr(),this.tr=!1)}nr(t){up.focus(this.pi,t)}er(){this.ir(this.C.getBoxElement())||this.nr()}ir(t){for(let n of e.reverse(t.children))if(up.viewport.tryFocus(n)||this.ir(n))return!0}}},3645:()=>{const t=up.util,e=up.element;up.Params=class Params{constructor(t){this.clear(),this.addAll(t)}clear(){this.entries=[]}[t.copy.key](){return new up.Params(this)}toObject(){const e={};for(let n of this.entries){const{name:i,value:s}=n;t.isBasicObjectProperty(i)||(this.sr(i)?(e[i]||=[],e[i].push(s)):e[i]=s)}return e}toArray(){return this.entries}toFormData(){const t=new FormData;for(let e of this.entries)t.append(e.name,e.value);return t.entries||(t.originalArray=this.entries),t}toQuery(){let e=t.map(this.entries,this.rr.bind(this));return e=t.compact(e),e.join("&")}rr(e){const{value:n}=e;if(this.ur(n))return;let i=encodeURIComponent(e.name);return t.isGiven(n)&&(i+="=",i+=encodeURIComponent(n)),i}ur(t){return t instanceof Blob}hasBinaryValues(){const e=t.map(this.entries,"value");return t.some(e,this.ur)}toURL(e){let n=[e,this.toQuery()];n=t.filter(n,t.isPresent);const i=t.contains(e,"?")?"&":"?";return n.join(i)}add(t,e){this.entries.push({name:t,value:e})}addAll(e){t.isMissing(e)||(e instanceof this.constructor?this.entries.push(...e.entries):t.isArray(e)?this.entries.push(...e):t.isString(e)?this.ar(e):t.isFormData(e)?this.hr(e):t.isObject(e)?this.cr(e):up.fail("Unsupport params type: %o",e))}cr(e){for(let n in e){const i=e[n],s=t.isArray(i)?i:[i];for(let t of s)this.add(n,t)}}ar(e){for(let n of e.split("&"))if(n){let[e,i]=n.split("=");e=decodeURIComponent(e),i=t.isGiven(i)?decodeURIComponent(i):null,this.add(e,i)}}hr(t){for(let e of t.entries())this.add(...e)}set(t,e){this.delete(t),this.add(t,e)}delete(e){this.entries=t.reject(this.entries,this.lr(e))}lr(t){return e=>e.name===t}get(t){return this.sr(t)?this.getAll(t):this.getFirst(t)}getFirst(e){const n=t.find(this.entries,this.lr(e));return n?.value}getAll(e){if(this.sr(e))return this.getAll(e);{const n=t.map(this.entries,this.lr(e));return t.map(n,"value")}}sr(t){return t.endsWith("[]")}[t.isBlank.key](){return 0===this.entries.length}static fromForm(t){return this.fromContainer(t)}static fromContainer(t){let e=up.form.fields(t);return this.fromFields(e)}static fromFields(e){const n=new this;for(let i of t.wrapList(e))n.addField(i);return n}addField(t){let n=(t=e.get(t)).name;if(n&&!t.disabled){const{tagName:e}=t,{type:i}=t;if("SELECT"===e)for(let e of t.querySelectorAll("option"))e.selected&&this.add(n,e.value);else if("checkbox"===i||"radio"===i)t.checked&&this.add(n,t.value);else{if("file"!==i)return this.add(n,t.value);for(let e of t.files)this.add(n,e)}}}[t.isEqual.key](e){return this.constructor===e.constructor&&t.isEqual(this.entries,e.entries)}static fromURL(e){const n=new this;let i=t.parseURL(e).search;return i&&(i=i.replace(/^\?/,""),n.addAll(i)),n}static stripURL(e){return t.normalizeURL(e,{search:!1})}static merge(...t){return t.reduce((function(t,e){return t.addAll(e),t}),new up.Params)}}},7782:()=>{const t=up.element;up.ProgressBar=class ProgressBar{constructor(){this.pr=0,this.H=t.affix(document.body,"up-progress-bar"),this.H.style.transition="width 300ms ease-out",this.dr(0),up.element.paint(this.H),this.mr=31,this.gr()}gr(){let t;t=this.mr<80?Math.random()<.15?7+5*Math.random():1.5+.5*Math.random():.13*(100-this.mr)*Math.random(),this.dr(this.mr+t),this.pr++;const e=300+40*this.pr;this.timeout=setTimeout(this.gr.bind(this),e)}dr(t){this.mr=t,this.H.style.width=`${t}vw`}destroy(){clearTimeout(this.timeout),this.H.remove()}conclude(){clearTimeout(this.timeout),this.dr(100),setTimeout(this.destroy.bind(this),300)}}},2406:()=>{const t=up.util;up.Record=class Record{keys(){throw"Return an array of keys"}defaults(t){return{}}constructor(t){Object.assign(this,this.defaults(t),this.attributes(t))}attributes(e=this){return t.pick(e,this.keys())}[t.copy.key](){return t.variant(this)}[t.isEqual.key](e){return this.constructor===e.constructor&&t.isEqual(this.attributes(),e.attributes())}}},1279:()=>{up.Rect=class Rect extends up.Record{keys(){return["left","top","width","height"]}get bottom(){return this.top+this.height}get right(){return this.left+this.width}grow(t){this.left-=t,this.top-=t,this.width+=2*t,this.height+=2*t}static fromElement(t){return new this(t.getBoundingClientRect())}}},2714:()=>{var t;const e=up.util;up.RenderJob=(t=class RenderJob{constructor(t){this.options=t}execute(){return this.yr=this.wr(),this}async wr(){try{this.br(),this.options=up.RenderOptions.preprocess(this.options);let t=await this.vr().execute();return this._r(t),t}catch(t){throw this._r(t)||this.kr(t),t}}_r(t){if(t instanceof up.RenderResult){let{onRendered:n,onFinished:i}=t.options;t.none||up.error.guard((()=>n?.(t)));let s=function(t){up.error.guard((()=>i?.(t)))};return this.finished.then(s,e.noop),!0}}kr(t){let e=t instanceof up.Aborted?"Rendering was aborted":"Error while rendering";up.puts("up.render()",`${e}: ${t.name}: ${t.message}`),up.error.guard((()=>this.options.onError?.(t)))}get finished(){return this.Sr()}async Sr(){try{let t=await this.yr;return await t.finished}catch(t){throw t instanceof up.RenderResult?await t.finished:t}}vr(){if(this.options.url){let t=t=>this.Er(t);return new up.Change.FromURL({...this.options,onRequest:t})}if(this.options.response){let t=()=>this.Er(null);return new up.Change.FromResponse({...this.options,onRender:t})}{let t=()=>this.Er(null);return new up.Change.FromContent({...this.options,onRender:t})}}br(){up.browser.assertConfirmed(this.options);let t=e.pluckKey(this.options,"guardEvent");if(t&&(t.renderOptions=this.options,up.emit(t,{target:this.options.origin}).defaultPrevented))throw new up.Aborted(`Rendering was prevented by ${t.type} listener`);up.RenderOptions.assertContentGiven(this.options)}Er(t){let{abort:n}=this.options;if(!n||!up.network.isBusy())return;let{fragments:i,layer:s,origin:r,newLayer:o}=this.vr().getPreflightProps(),u={except:t,logOnce:["up.render()","Change with { abort } option will abort other requests"],newLayer:o,origin:r};"target"===n?up.fragment.abort(i,u):"layer"===n?up.fragment.abort({...u,layer:s}):"all"===n||!0===n?up.fragment.abort({...u,layer:"any"}):e.isFunction(n)?n(u):up.fragment.abort(n,{...u,layer:s})}},e.delegate(t.prototype,["then","catch","finally"],(function(){return this.yr})),e.memoizeMethod(t.prototype,{Sr:!0,vr:!0}),t)},2705:()=>{const t=up.util;up.RenderOptions=function(){const e={useHungry:!0,useKeep:!0,saveScroll:!0,saveFocus:!0,focus:"keep",abort:"target",failOptions:!0},n={abort:!1,confirm:!1,feedback:!1,cache:!0,background:!0},i=["url","method","origin","headers","params","cache","fallback","abort","abortable","confirm","feedback","origin","originLayer","baseLayer","fail","onError"].concat(["keep","hungry","history","source","saveScroll","navigate","baseLayer"]),s=["url","response","content","fragment","document"],r=["history","focus","scroll"];function o({origin:t,originLayer:e}){if(t&&!e)return{originLayer:up.layer.get(t)}}return{preprocess:function(i){up.migrate.preprocessRenderOptions?.(i);const s=t.merge(e,function(t){if(t.navigate)return up.fragment.config.navigateOptions}(i));return t.merge(t.omit(s,r),{defaults:s},{inputDevice:up.event.inputDevice},i,function({url:e}){if(e)return{url:t.normalizeURL(e)}}(i),o(i),function(t){if(t.preload)return n}(i))},finalize:function(e,n){return t.merge(e.defaults,n,e)},assertContentGiven:function(e){t.some(s,(n=>t.isGiven(e[n])))||(e.defaultToEmptyContent?e.content="":up.fail("up.render() needs either { "+s.join(", ")+" } option"))},deriveFailOptions:function(e){let n=function(t){const e={};for(let n in t){const i=t[n];let s=up.fragment.successKey(n);s&&(e[s]=i)}return e}(e),s=o(n);return e.failOptions?{...e.defaults,...t.pick(e,i),...n,...s,failPrefixForced:!0}:{...e,...n,...s}}}}()},606:()=>{up.RenderResult=class RenderResult extends up.Record{keys(){return["fragments","layer","target","options","finished"]}defaults(){return{fragments:[]}}get none(){return!this.fragments.length}get fragment(){return this.fragments[0]}static both(t,e,n=!0){return e?new this({target:t.target,layer:t.layer,options:t.options,fragments:t.fragments.concat(e.fragments),finished:n&&this.mergeFinished(t,e)}):t}static async mergeFinished(t,e){return this.both(await t.finished,await e.finished,!1)}static buildNone(){return new this({target:":none",finished:Promise.resolve()})}}},5437:()=>{var t;const e=up.util;up.Request=(t=class Request extends up.Record{keys(){return["method","url","hash","params","target","failTarget","headers","timeout","background","cache","expireCache","evictCache","layer","mode","context","failLayer","failMode","failContext","origin","fragments","builtAt","wrapMethod","contentType","payload","onLoading","fail","abortable","badResponseTime"]}defaults(){return{state:"new",abortable:!0,headers:{},timeout:up.network.config.timeout,builtAt:new Date}}constructor(t){if(super(t),this.params=new up.Params(this.params),null==this.wrapMethod&&(this.wrapMethod=up.network.config.wrapMethod),this.Or(),(this.target||this.layer||this.origin)&&!t.basic){const t={origin:this.origin};this.layer=up.layer.get(this.layer,t),this.failLayer=up.layer.get(this.failLayer,t),this.context||=this.layer.context||{},this.failContext||=this.failLayer?.context||{},this.mode||=this.layer.mode,this.failMode||=this.failLayer?.mode}this.deferred=e.newDeferred(),this.badResponseTime??=e.evalOption(up.network.config.badResponseTime,this),this.Cr()}get xhr(){return this.Fr??=new XMLHttpRequest}get fragments(){if(this.Tr)return this.Tr;{let t=up.fragment.parseTargetSteps(this.target),n=e.map(t,"selector"),i={origin:this.origin,layer:this.layer};return e.compact(e.map(n,(t=>up.fragment.get(t,i))))}}set fragments(t){this.Tr=t}get fragment(){return this.fragments?.[0]}Or(){this.method=e.normalizeMethod(this.method),this.Rr(),this.Lr(),this.url=e.normalizeURL(this.url)}Ar(){e.task((()=>{this.layer=void 0,this.failLayer=void 0,this.origin=void 0,this.fragments=void 0}))}Rr(){let t=this.url?.match(/^([^#]*)(#.+)$/);if(t)return this.url=t[1],this.hash=t[2]}Lr(){!this.url||this.allowsPayload()||e.isBlank(this.params)||(this.url=this.params.toURL(this.url),this.params.clear())}isSafe(){return up.network.isSafeMethod(this.method)}allowsPayload(){return e.methodAllowsPayload(this.method)}will302RedirectWithGET(){return this.isSafe()||"POST"===this.method}willCache(){return e.evalAutoOption(this.cache,up.network.config.autoCache,this)}runQueuedCallbacks(){e.always(this,(()=>this.Ar()))}load(){if("new"===this.state)return this.Pr()?(this.state="loading",this.Or(),this.onLoading?.(),this.expired=!1,new up.Request.XHRRenderer(this).buildAndSend({onload:()=>this.$r(),onerror:()=>this.Dr(),ontimeout:()=>this.Mr(),onabort:()=>this.Hr()}),!0):void this.abort({reason:"Prevented by event listener"})}Pr(){return!this.emit("up:request:load",{log:["Loading %s",this.description]}).defaultPrevented}loadPage(){up.network.abort(),new up.Request.FormRenderer(this).buildAndSubmit()}$r(){const t=this.Nr(),e="Loaded "+t.description;this.emit("up:request:loaded",{request:t.request,response:t,log:e}),this.respondWith(t)}Dr(){this.jr("Network error")}Mr(){this.jr("Timeout")}Hr(){this.qr()}abort({reason:t}={}){this.qr(t)&&this.Fr&&this.Fr.abort()}qr(t){if(this.Br())return;let e="Aborted request to "+this.description+(t?": "+t:"");return this.state="aborted",this.deferred.reject(new up.Aborted(e)),this.emit("up:request:aborted",{log:e}),!0}jr(t){if(this.Br())return;let e="Cannot load request to "+this.description+(t?": "+t:"");this.state="offline",this.emit("up:request:offline",{log:e}),this.deferred.reject(new up.Offline(e))}respondWith(t){this.response=t,this.Br()||(this.state="loaded",t.ok?this.deferred.resolve(t):this.deferred.reject(t))}Br(){return"new"!==this.state&&"loading"!==this.state&&"tracking"!==this.state}csrfHeader(){return up.protocol.csrfHeader()}csrfParam(){return up.protocol.csrfParam()}csrfToken(){if(!this.isSafe()&&!this.isCrossOrigin())return up.protocol.csrfToken()}isCrossOrigin(){return e.isCrossOrigin(this.url)}Nr(){const t={method:this.method,url:this.url,request:this,xhr:this.xhr,text:this.xhr.responseText,status:this.xhr.status,title:up.protocol.titleFromXHR(this.xhr),target:up.protocol.targetFromXHR(this.xhr),acceptLayer:up.protocol.acceptLayerFromXHR(this.xhr),dismissLayer:up.protocol.dismissLayerFromXHR(this.xhr),eventPlans:up.protocol.eventPlansFromXHR(this.xhr),context:up.protocol.contextFromXHR(this.xhr),expireCache:up.protocol.expireCacheFromXHR(this.xhr),evictCache:up.protocol.evictCacheFromXHR(this.xhr),fail:this.fail};let n=up.protocol.methodFromXHR(this.xhr),i=up.protocol.locationFromXHR(this.xhr);return i&&(e.matchURLs(this.url,i)||(n||="GET"),t.url=i),n&&(t.method=n),new up.Response(t)}Ji(t){return up.EventEmitter.fromEmitArgs(t,{layer:this.layer,request:this,origin:this.origin})}emit(...t){return this.Ji(t).emit()}assertEmitted(...t){this.Ji(t).assertEmitted()}get description(){return this.method+" "+this.url}isPartOfSubtree(t){return t=e.wrapList(t),e.some(this.fragments,(function(n){return e.some(t,(t=>t.contains(n)))}))}get age(){return new Date-this.builtAt}header(t){return this.headers[t]}Cr(){for(let t of["target","failTarget","mode","failMode","context","failContext"])this.Ur(t);let t,e;(t=this.csrfHeader())&&(e=this.csrfToken())&&this.zr(t,e),this.zr(up.protocol.headerize("version"),up.version)}Ur(t){this.zr(up.protocol.headerize(t),this[t])}zr(t,n){e.isMissing(n)||((e.isOptions(n)||e.isArray(n))&&(n=e.safeStringifyJSON(n)),this.headers[t]=n)}mergeIfUnsent(t){if("new"!==this.state)return;if(!this.target||!t.target)return;let n=up.fragment.splitTarget(this.target+","+t.target);this.target=e.uniq(n).join(", "),this.Ur("target"),this.Tr=e.uniq([...this.fragments,...t.fragments])}static tester(t,{except:n}={}){let i;if(e.isFunction(t))i=t;else if(t instanceof this)i=e=>t===e;else if(e.isString(t)){let e=new up.URLPattern(t);i=t=>e.test(t.url)}else i=e=>t;return n?t=>!up.cache.willHaveSameResponse(t,n)&&i(t):i}},e.delegate(t.prototype,["then","catch","finally"],(function(){return this.deferred})),t)},7974:()=>{const t=up.util;class Route{constructor(){this.varyHeaders=new Set,this.requests=[]}matchBest(e){let n=this.requests.filter((t=>this.satisfies(t,e)));return t.last(n)}delete(e){t.remove(this.requests,e)}put(t){this.requests.push(t)}updateVary(t){for(let e of t.varyHeaderNames)this.varyHeaders.add(e)}satisfies(e,n){return e===n||t.every(this.varyHeaders,(i=>{let s=e.header(i),r=n.header(i);if("X-Up-Target"===i||"X-Up-Fail-Target"===i){if(!s)return!0;if(!r)return!1;let e=t.parseTokens(s,{separator:"comma"}),n=t.parseTokens(r,{separator:"comma"});return t.containsAll(e,n)}return s===r}))}}up.Request.Cache=class Cache{constructor(){this.reset()}reset(){this.Ir={},this.Kr=[]}get(t){t=this.Vr(t);let e=this.Xr(t),n=e.matchBest(t);if(n){if(this.Wr(n))return n;this.Jr(t,e)}}async put(t){t=this.Vr(t);let e=this.Xr(t),{response:n}=t;n&&e.updateVary(n);let i=e.requests.filter((n=>e.satisfies(t,n)));for(let t of i)this.Jr(t);t.cacheRoute=e,e.put(t),this.Kr.push(t),this.Gr()}alias(t,e){if(t=this.get(t))return e=this.Vr(e),this.track(t,e,{force:!0}),this.put(e),e}async track(e,n,i={}){n.trackedRequest=e,n.state="tracking";let s=await t.always(e);s instanceof up.Response?i.force||e.cacheRoute.satisfies(e,n)?(n.fromCache=!0,s=t.variant(s,{request:n}),n.respondWith(s),t.delegate(n,["expired","state"],(()=>e))):(delete n.trackedRequest,n.state="new",i.onIncompatible?.(n)):(n.state=e.state,n.deferred.reject(s))}willHaveSameResponse(t,e){return t===e||t===e.trackedRequest}evict(t=!0,e){this.Qr(t,e,(t=>this.Jr(t)))}expire(t=!0,e){this.Qr(t,e,(t=>t.expired=!0))}reindex(t){this.Jr(t),delete t.cacheRoute,this.put(t)}Jr(e){t.remove(this.Kr,e),e.cacheRoute?.delete(e)}Xr(t){return t.cacheRoute||(this.Ir[t.description]||=new Route)}Wr(t){return t.age<up.network.config.cacheEvictAge}get Yr(){return this.Kr.length}get Ln(){return up.network.config.cacheSize}Gr(){for(let t=0;t<this.Yr-this.Ln;t++)this.Jr(this.Kr[0])}Qr(e=!0,n,i){let s=up.Request.tester(e,n),r=t.filter(this.Kr,s);t.each(r,i)}Vr(e){return t.wrapValue(up.Request,e)}}},5221:()=>{const t=up.util,e=up.element,n=["GET","POST"];up.Request.FormRenderer=class FormRenderer{constructor(t){this.gt=t}buildAndSubmit(){this.params=t.copy(this.gt.params);let i=this.gt.url,{method:s}=this.gt;const r=up.Params.fromURL(i);this.params.addAll(r),i=up.Params.stripURL(i),t.contains(n,s)||(s=up.protocol.wrapMethod(s,this.params)),this.Dn=e.affix(document.body,"form.up-request-loader",{method:s,action:i});let o,u,a=this.gt.contentType;a&&this.Dn.setAttribute("enctype",a),(o=this.gt.csrfParam())&&(u=this.gt.csrfToken())&&this.params.add(o,u),t.each(this.params.toArray(),this.Zr.bind(this)),up.browser.submitForm(this.Dn)}Zr(t){e.affix(this.Dn,"input[type=hidden]",t)}}},6413:()=>{const t=up.util;up.Request.Queue=class Queue{constructor(){this.reset()}reset(){this.eo=[],this.no=[],this.io=!1}get allRequests(){return this.no.concat(this.eo)}asap(e){e.runQueuedCallbacks(),t.always(e,(t=>this.Et(e,t))),this.so(e),this.ro(e),queueMicrotask((()=>this.oo()))}promoteToForeground(t){t.background&&(t.background=!1,this.so(t))}so(e){let n=Math.max(e.badResponseTime-e.age,0);t.timer(n,(()=>this.uo()))}ao(){return t.evalOption(up.network.config.concurrency)}ho(){const t=this.ao();return-1===t||this.no.length<t}isBusy(){return this.no.length>0||this.eo.length>0}ro(t){this.eo.push(t)}co(){let e=t.find(this.eo,(t=>!t.background));return e||=this.eo[0],t.remove(this.eo,e)}lo(t){t.load()&&this.no.push(t)}Et(e,n){t.remove(this.no,e)||t.remove(this.eo,e),n instanceof up.Response&&n.ok&&up.network.registerAliasForRedirect(e,n),this.uo(),queueMicrotask((()=>this.oo()))}oo(){let t;if(this.ho()&&(t=this.co()))return this.lo(t)}abort(...e){let n=t.extractOptions(e),{except:i,reason:s,logOnce:r}=n,o=e[0]??!0,u=up.Request.tester(o,{except:i});for(let e of[this.no,this.eo]){const n=t.filter(e,u);for(let i of n)r&&(up.puts(...r),r=null),i.abort({reason:s}),t.remove(e,i)}}uo(){const t=this.po();this.io!==t&&(this.io=t,t?up.emit("up:network:late",{log:"Server is slow to respond"}):up.emit("up:network:recover",{log:"Slow requests were loaded"}))}po(){const e=t.reject(this.allRequests,"background");return t.some(e,(t=>t.age>=t.badResponseTime-1))}}},2298:()=>{var t;const e="multipart/form-data",n=up.util;up.Request.XHRRenderer=(t=class XHRRenderer{constructor(t){this.gt=t}buildAndSend(t){const e=this.gt.xhr;this.fo=n.copy(this.gt.params),this.gt.timeout&&(e.timeout=this.gt.timeout),e.open(this.do(),this.gt.url);let i=this.mo();i&&e.setRequestHeader("Content-Type",i);for(let t in this.gt.headers){let n=this.gt.headers[t];e.setRequestHeader(t,n)}Object.assign(e,t),e.send(this.yo())}do(){let t=this.gt.method;return this.gt.wrapMethod&&!this.gt.will302RedirectWithGET()&&(t=up.protocol.wrapMethod(t,this.fo)),t}mo(){return this.wo(),this.bo}yo(){return this.wo(),this.vo}wo(){this.vo=this.gt.payload,this.bo=this.gt.contentType,!this.vo&&this.gt.allowsPayload()&&(this.bo||(this.bo=this.fo.hasBinaryValues()?e:"application/x-www-form-urlencoded"),this.bo===e?(this.bo=null,this.vo=this.fo.toFormData()):this.vo=this.fo.toQuery().replace(/%20/g,"+"))}},n.memoizeMethod(t.prototype,{wo:!0,do:!0}),t)},4517:()=>{const t=up.util;up.Response=class Response extends up.Record{keys(){return["method","url","text","status","request","xhr","target","title","acceptLayer","dismissLayer","eventPlans","context","expireCache","evictCache","headers","loadedAt","fail"]}defaults(){return{headers:{},loadedAt:new Date}}get ok(){return!t.evalOption(this.fail??up.network.config.fail,this)}get none(){return!this.text}header(t){return this.headers[t]||this.xhr?.getResponseHeader(t)}get varyHeaderNames(){let e=this.header("Vary");return t.parseTokens(e,{separator:"comma"})}get contentType(){return this.header("Content-Type")}get cspNonces(){return up.protocol.cspNoncesFromHeader(this.header("Content-Security-Policy")||this.header("Content-Security-Policy-Report-Only"))}get lastModified(){let t=this.header("Last-Modified");if(t)return new Date(t)}get etag(){return this.header("ETag")}get json(){return this.parsedJSON||=JSON.parse(this.text)}get age(){return new Date-this.loadedAt}get expired(){return this.age>up.network.config.cacheExpireAge||this.request.expired}get description(){return`HTTP ${this.status} response to ${this.request.description}`}}},7241:()=>{var t;const e=up.util,n=up.element,i=/^\s*<(html|!DOCTYPE)\b/i;up.ResponseDoc=(t=class ResponseDoc{constructor({document:t,fragment:e,content:n,target:i,origin:s,cspNonces:r,match:o}){if(t?this._o(t):e?this.ko(e):this.So(n||"",i),this.xo=r,s){let t=up.fragment.tryToTarget(s);t&&(this.Eo=this.select(t))}this.ii=o}_o(t){t instanceof Document?(this.ni=t,this.Oo=!0):e.isString(t)?(this.ni=n.createBrokenDocumentFromHTML(t),this.Oo=i.test(t),this.Co=!0):(this.ni=this.Fo(t),this.Oo=t.matches("html"))}ko(t){let i=e.isString(t)?n.createFromHTML(t):t;this.ni=this.Fo(i)}So(t,i){i||up.fail("must pass a { target } when passing { content }");let s=e.map(up.fragment.parseTargetSteps(i),"selector").join();const r=n.createFromSelector(s);e.isString(t)?r.innerHTML=t:r.appendChild(t),this.ni=this.Fo(r)}Fo(t){let e=document.createElement("up-document");return e.append(t),e.documentElement=t,e}rootSelector(){return up.fragment.toTarget(this.ni.documentElement)}get title(){return this.To(this.Ro)}Lo(){if(this.Oo)return this.ni.head}To(t){let e=this.Lo();return e&&t(e)}get metaTags(){return this.To(up.history.findMetaTags)}get assets(){return this.To(up.script.findAssets)}get lang(){if(this.Oo)return up.history.getLang(this.ni)}Ro(t){return t.querySelector("title")?.textContent}select(t){return new up.FragmentFinder({selector:t,origin:this.Eo,document:this.ni,match:this.ii}).find()}selectSteps(t){return t.filter((t=>this.Ao(t)||this.Po(t)))}commitSteps(t){return t.filter((t=>this.commitElement(t.newElement)))}Ao(t){if(t.newElement)return!0;let e=this.select(t.selector);if(!e)return;let{selectEvent:n}=t;return n&&(n.newFragment=e,n.renderOptions=t.originalRenderOptions,up.emit(t.oldElement,n,{callback:t.selectCallback}),n.defaultPrevented)?void 0:(t.newElement=e,!0)}Po(t){if(!t.maybe)throw new up.CannotMatch}commitElement(t){if(this.ni.contains(t))return up.fragment.config.runScripts||up.script.disableSubtree(t),t.remove(),!0}finalizeElement(t){if(up.NonceableCallback.adoptNonces(t,this.xo),this.Co){let i=n.subtree(t,":is(noscript,script,audio,video):not(.up-keeping, .up-keeping *)");e.each(i,n.fixParserDamage)}}},e.memoizeMethod(t.prototype,{Lo:!0}),t)},2723:()=>{const t=up.element,e=up.util;up.RevealMotion=class RevealMotion{constructor(e,n={}){this.H=e,this.$o=t.get(n.viewport)||up.viewport.get(this.H),this.Do=up.layer.get(this.$o),this.Mo=n.scrollBehavior??n.behavior??"instant";const i=up.viewport.config;this.Ho=n.snap??n.revealSnap??i.revealSnap,this.No=n.padding??n.revealPadding??i.revealPadding,this.jo=n.top??n.revealTop??i.revealTop,this.qo=n.max??n.revealMax??i.revealMax,this.Bo=i.selector("fixedTopSelectors"),this.Uo=i.selector("fixedBottomSelectors")}start(){const t=this.zo(this.$o),n=up.Rect.fromElement(this.H);if(this.qo){const t=e.evalOption(this.qo,this.H);n.height=Math.min(n.height,t)}n.grow(this.No),this.Io(t),t.height<0&&up.fail("Viewport has no visible area");const i=this.$o.scrollTop;let s=i;this.jo||n.height>t.height?s+=n.top-t.top:n.top<t.top?s-=t.top-n.top:n.bottom>t.bottom&&(s+=n.bottom-t.bottom),e.isNumber(this.Ho)&&s<this.Ho&&n.top<.5*t.height&&(s=0),s!==i&&this.$o.scrollTo({top:s,behavior:this.Mo})}zo(){return up.viewport.isRoot(this.$o)?new up.Rect({left:0,top:0,width:up.viewport.rootWidth(),height:up.viewport.rootHeight()}):up.Rect.fromElement(this.$o)}Ko(n){let i=up.fragment.all(n,{layer:this.Do});return e.filter(i,t.isVisible)}Io(t){for(let e of this.Ko(this.Bo)){let n=up.Rect.fromElement(e).bottom-t.top;n>0&&(t.top+=n,t.height-=n)}for(let e of this.Ko(this.Uo)){let n=up.Rect.fromElement(e),i=t.bottom-n.top;i>0&&(t.height-=i)}}}},8720:()=>{const t=up.util,e=/:has\(([^)]+)\)$/;up.Selector=class Selector{constructor(n,i,s={}){let r;if(this.Vo=[],s.destroying||this.Vo.push(up.fragment.isNotDestroying),i&&!document.contains(i)||"any"===s.layer)r=up.layer.root;else{if(s.layer??=t.presence(i,t.isElement),this.W=up.layer.getAll(s),!this.W.length)throw new up.CannotMatch(["Unknown layer: %o",s.layer]);this.Vo.push((e=>t.some(this.W,(t=>t.contains(e))))),r=this.W[0]}let o=up.fragment.expandTargets(n,{...s,layer:r});this.Xo=o.map((t=>(up.browser.canHasSelector()||(t=t.replace(e,((t,e)=>(this.Vo.push((t=>t.querySelector(e))),"")))),t||"*"))),this.Wo=this.Xo.join()||"match-none"}matches(t){return t.matches(this.Wo)&&this.Jo(t)}closest(t){let e;return this.matches(t)?t:(e=t.parentElement)?this.closest(e):void 0}Jo(e){return t.every(this.Vo,(t=>t(e)))}descendants(e=document){const n=t.flatMap(this.Xo,(t=>e.querySelectorAll(t)));return t.filter(n,(t=>this.Jo(t)))}subtree(t){const e=[];return t instanceof Document||!this.matches(t)||e.push(t),e.push(...this.descendants(t)),e}}},7885:()=>{const t=up.util,e=up.element;up.Tether=class Tether{constructor(t){up.migrate.handleTetherOptions?.(t),this.Go=t.anchor,this.Qo=t.align,this.Yo=t.position,this.Zo="top"===this.Yo||"bottom"===this.Yo?"horizontal":"vertical",this.$o=up.viewport.get(this.Go),this.parent=this.$o===e.root?document.body:this.$o,this.tu=!this.$o.contains(this.Go.offsetParent)}start(t){this.H=t,this.H.style.position="absolute",this.eu(0,0),this.sync(),this.nu("on")}stop(){this.nu("off")}nu(t){let e=this.iu.bind(this);up[t](window,"resize",e),this.tu&&up[t](this.$o,"scroll",e)}iu(){return clearTimeout(this.syncTimer),this.syncTimer=t.task(this.sync.bind(this))}isDetached(){return!this.parent.isConnected||!this.Go.isConnected}sync(){const n=this.H.getBoundingClientRect(),i=e.styleNumber(this.H,"margin-top"),s=e.styleNumber(this.H,"margin-right"),r=e.styleNumber(this.H,"margin-bottom"),o=e.styleNumber(this.H,"margin-left"),u=this.Go.getBoundingClientRect();let a,h;switch(this.Zo){case"horizontal":switch(this.Yo){case"top":h=u.top-r-n.height;break;case"bottom":h=u.top+u.height+i}switch(this.Qo){case"left":a=u.left+o;break;case"center":a=u.left+.5*(u.width-n.width);break;case"right":a=u.left+u.width-n.width-s}break;case"vertical":switch(this.Qo){case"top":h=u.top+i;break;case"center":h=u.top+.5*(u.height-n.height);break;case"bottom":h=u.top+u.height-n.height-r}switch(this.Yo){case"left":a=u.left-s-n.width;break;case"right":a=u.left+u.width+o}}t.isDefined(a)||t.isDefined(h)?this.dr(a,h):up.fail("Invalid tether constraints: %o",this.su())}su(){return{position:this.Yo,align:this.Qo}}dr(t,e){const n=this.H.getBoundingClientRect();this.eu(t-n.left+this.offsetLeft,e-n.top+this.offsetTop)}eu(t,n){this.offsetLeft=t,this.offsetTop=n,e.setStyle(this.H,{left:t,top:n},"px")}}},4818:()=>{const t=up.util;up.URLPattern=class URLPattern{constructor(e){this.ru=[];const n=[],i=[];for(let s of t.parseTokens(e))"-"===s[0]?i.push(s.substring(1)):n.push(s);this.ou=this.uu(n,!0),this.au=this.uu(i,!1)}uu(e,n){if(!e.length)return;let i=(e=(e=t.flatMap(e,t.matchableURLPatternAtom)).map(t.escapeRegExp)).join("|");return i=i.replace(/\\\*/g,".*?"),i=i.replace(/(:|\\\$)([a-z][\w-]*)/gi,((t,e,i)=>"\\$"===e?(n&&this.ru.push({name:i,cast:Number}),"(\\d+)"):(n&&this.ru.push({name:i,cast:String}),"([^/?#]+)"))),new RegExp("^(?:"+i+")$")}test(e,n=!0){return n&&(e=t.matchableURL(e)),this.ou.test(e)&&!this.hu(e)}recognize(e,n=!0){n&&(e=t.matchableURL(e));let i=this.ou.exec(e);if(i&&!this.hu(e)){const t={};return this.ru.forEach(((e,n)=>{let s=i[n+1];if(s)return t[e.name]=e.cast(s)})),t}}hu(t){return this.au?.test(t)}}},9675:(t,e,n)=>{n(1860),up.element=function(){const t=up.util;function e(...t){const e=t.pop();return(t[0]||document).querySelector(e)}function n(t,e){const n=[];return t.matches(e)&&n.push(t),n.push(...t.querySelectorAll(e)),n}function i(...n){const i=n.pop();return t.isElement(i)?i:t.isString(i)?e(...n,i):t.isList(i)?(i.length>1&&up.fail("up.element.get(): Cannot cast multiple elements (%o) to a single element",i),i[0]):i}function s(...e){return t.flatMap(e,r)}function r(e){return t.isString(e)?document.querySelectorAll(e):t.wrapList(e)}function o(t){t.setAttribute("hidden","")}function u(t){t.removeAttribute("hidden"),"none"===t.style.display&&(t.style.display="")}function a(e,n){for(let i in n){const s=n[i];t.isGiven(s)?e.setAttribute(i,s):e.removeAttribute(i)}}function h(e,n={}){let i,s,r,{includePath:o}=c(e);for(let t of o){let{tagName:e,id:n,classNames:o,attributes:u}=t;e&&"*"!==e||(e="div"),s=document.createElement(e),i||(i=s),n&&(s.id=n);for(let t of o)s.classList.add(t);for(let t in u){let e=u[t];s.setAttribute(t,e||"")}r?.appendChild(s),r=s}for(let e in n){let s=n[e];if("class"===e)for(let e of t.wrapList(s))i.classList.add(e);else"style"===e?E(i,s):"text"===e?i.textContent=s:"content"===e?i.innerHTML=s:i.setAttribute(e,s)}return i}function c(t){let e;const n=t.replace(/:not\([^)]+\)/,(function(t){return e=t,""})),[i,s]=function(t){let e=[];return[t=p(t,(function({name:t,value:n}){return e.push(n),`[${t}]`})),e]}(n);return{includePath:i.split(/[ >]+/).map((function(e){let n={tagName:null,classNames:[],id:null,attributes:{}};return e=(e=(e=e.replace(/^[\w-*]+/,(function(t){return n.tagName=t,""}))).replace(/#([\w-]+)/,(function(t,e){return n.id=e,""}))).replace(/\.([\w-]+)/g,(function(t,e){return n.classNames.push(e),""})),s.length&&(e=p(e,(function({name:t}){return n.attributes[t]=s.shift(),""}))),e&&up.fail("Cannot parse selector: "+t),n})),includeRaw:n,excludeRaw:e}}const l=/\[([\w-]+)(?:([~|^$*]?=)(["'])?([^\3\]]*?)\3)?]/g;function p(t,e){return t.replace(l,(function(t,n,i,s,r){return r&&(r=r.replace(/\\([\\"'])/,"$1")),e({name:n,operator:i,quote:s,value:r})}))}const f=["HTML","BODY","HEAD","TITLE"];function d(e,n){return t.isGiven(n)?`[${e}="${n=n.replace(/"/g,'\\"')}"]`:`[${e}]`}function m(t){const e=document.createRange();e.setStart(document.body,0);let n=e.createContextualFragment(t.trim()).childNodes;if(1!==n.length)throw new Error("HTML must have a single root element");return n[0]}function g(t){t.offsetHeight}function y(e,n,i){t.isMissing(e.getAttribute(n))&&e.setAttribute(n,i)}function w(e,n){let i=e.getAttribute(n);return t.replaceValue(i,null,void 0)}function b(t,e,n){if(!t.hasAttribute(e))return;const i=w(t,e);switch(i){case"false":return!1;case"true":case"":case e:return!0;default:return!n||i}}function v(t,e){const n=S(t,Object.keys(e));return E(t,e),()=>E(t,n)}function _(t,e){return x(window.getComputedStyle(t),e)}function k(e,n){const i=_(e,n);if(t.isPresent(i))return parseFloat(i)}function S(t,e){const{style:n}=t;return x(n,e)}function x(e,n){return up.migrate.loaded&&(n=up.migrate.fixStyleProps(n)),t.isString(n)?e.getPropertyValue(n):t.mapObject(n,(t=>[t,e.getPropertyValue(t)]))}function E(e,n,i=""){if(up.migrate.loaded&&(n=up.migrate.fixStyleProps(n,i)),t.isString(n))e.setAttribute("style",n);else{const{style:t}=e;for(let e in n){let s=n[e];t.setProperty(e,s+i)}}}function O(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}function C(t){return/^up-/.test(t)}return{subtree:n,contains:function(t,e){const n=i(e);return Node.prototype.contains.call(t,n)},closestAttr:function(t,e,n=w){let i=t.closest("["+e+"]");if(i)return n(i,e)},ancestor:function(t,e){return t.parentNode?.closest(e)},around:function(t,e){return s(t.closest(e),n(t,e))},get:i,list:s,toggle:function(t,e){null==e&&(e=!O(t)),(e?u:o)(t)},hide:o,show:u,metaContent:function(t){const n="meta"+d("name",t);return e(n)?.getAttribute("content")},insertBefore:function(t,e){t.insertAdjacentElement("beforebegin",e)},createFromSelector:h,setAttrs:a,setTemporaryAttrs:function(t,e){const n={};for(let i of Object.keys(e))n[i]=t.getAttribute(i);return a(t,e),()=>a(t,n)},affix:function(e,...n){let i,s;const r=t.extractOptions(n);2===n.length?[i,s]=n:(i="beforeend",s=n[0]);const o=h(s,r);return e.insertAdjacentElement(i,o),o},idSelector:function(t){return t.match(/^[a-z][a-z0-9\-_]*$/i)?`#${t}`:d("id",t)},classSelector:function(t){return`.${t=t.replace(/[^\w-]/g,"\\$&")}`},isSingleton:up.mockable((t=>t.matches(f.join()))),attrSelector:d,tagName:function(t){return t.tagName.toLowerCase()},createBrokenDocumentFromHTML:function(t){return(new DOMParser).parseFromString(t,"text/html")},fixParserDamage:function(t){let e=m(t.outerHTML);t.replaceWith(e)},createFromHTML:m,get root(){return document.documentElement},paint:g,concludeCSSTransition:function(t){const e=v(t,{transition:"none"});return g(t),e},hasCSSTransition:function(t){const e=t["transition-property"],n=t["transition-duration"];return!("none"===e||"all"===e&&0===n)},fixedToAbsolute:function(t){const e=t.getBoundingClientRect();t.style.position="absolute";const n=t.offsetParent.getBoundingClientRect();E(t,{left:e.left-k(t,"margin-left")-n.left+"px",top:e.top-k(t,"margin-top")-n.top+"px",right:"",bottom:""})},setMissingAttrs:function(t,e){for(let n in e)y(t,n,e[n])},setMissingAttr:y,unwrap:function(e){!function(n){const i=document.activeElement;try{return function(){const n=e.parentNode,i=t.toArray(e.childNodes);t.each(i,(t=>n.insertBefore(t,e))),n.removeChild(e)}()}finally{i&&i!==document.activeElement&&i.focus({preventScroll:!0})}}()},wrapChildren:function(t){let e;const n=document.createElement("up-wrapper");for(;e=t.firstChild;)n.appendChild(e);return t.appendChild(n),n},attr:w,booleanAttr:b,numberAttr:function(t,e){let n=t.getAttribute(e);if(n&&(n=n.replace(/_/g,""),n.match(/^-?[\d.]+$/)))return parseFloat(n)},jsonAttr:function(t,e){let n=t.getAttribute?.(e)?.trim();if(n)return JSON.parse(n)},callbackAttr:function(e,n,{exposedKeys:i=[],mainKey:s="event"}={}){let r=e.getAttribute(n);if(r){const n=up.NonceableCallback.fromString(r).toFunction(s,...i);return function(s){const r=Object.values(t.pick(s,i));return n.call(e,s,...r)}}},booleanOrStringAttr:function(t,e,n=!0){let i=b(t,e,!0);return!0===i?n:i},setTemporaryStyle:v,style:_,styleNumber:k,inlineStyle:S,setStyle:E,isVisible:O,upAttrs:function(e){let n=t.filter(e.getAttributeNames(),C);return t.mapObject(n,(t=>[t,e.getAttribute(t)]))},upClasses:function(e){return t.filter(e.classList.values(),C)},toggleAttr:function(t,e,n,i){return null==i&&(i=!t.hasAttribute(e)),i?t.setAttribute(e,n):t.removeAttribute(e)},addTemporaryClass:function(t,e){return t.classList.add(e),()=>t.classList.remove(e)},cleanJQuery:function(t){up.browser.canJQuery()&&jQuery(t).remove()},parseSelector:c,isEmpty:function(t){return!t.children.length>0&&!t.innerText.trim()},crossOriginSelector:function(t){return`[${t}*="//"]:not([${t}*="//${location.host}/"])`},isIntersectingWindow:function(t,{margin:e=0}={}){const n=up.Rect.fromElement(t);return n.grow(e),n.bottom>0&&n.top<window.innerHeight&&n.right>0&&n.left<window.innerWidth},unionSelector:function(e,n){let i=`:is(${e.join()})`;return t.isPresent(n)&&(i+=`:not(${n.join()})`),i}}}()},3924:()=>{up.error=function(){function t(t){if("object"!=typeof(e=t)||!("AbortError"===e.name||e instanceof up.RenderResult||e instanceof up.Response))throw t;var e}function e(t){try{return t()}catch(t){!function(t){console.error("Uncaught %o",t);let e=new ErrorEvent("error",{error:t,message:"Uncaught "+t});window.dispatchEvent(e)}(t)}}return{fail:function(...t){throw new up.Error(t)},throwCritical:t,muteUncriticalRejection:function(e){return e.catch(t)},muteUncriticalSync:function(e){try{return e()}catch(e){t(e)}},guard:e,guardFn:function(t){return(...n)=>e((()=>t(...n)))}}}(),up.fail=up.error.fail},4366:()=>{up.Aborted=class Aborted extends up.Error{constructor(t){super(t,{name:"AbortError"})}}},8010:()=>{up.CannotMatch=class CannotMatch extends up.Error{}},4861:()=>{up.CannotParse=class CannotParse extends up.Error{}},3469:()=>{up.CannotTarget=class CannotTarget extends up.Error{}},376:()=>{up.Error=class Error extends window.Error{constructor(t,e={}){Array.isArray(t)&&(t=up.util.sprintf(...t)),super(t);let n="up."+this.constructor.name;Object.assign(this,{name:n},e)}}},8272:()=>{up.NotImplemented=class NotImplemented extends up.Error{}},4504:()=>{up.Offline=class Offline extends up.Error{}},8670:()=>{up.event=function(){const t=up.util,e=up.element;function n(...t){return i(t).bind()}function i(t,e){return up.EventListenerGroup.fromBindArgs(t,e)}function s(t){return up.EventEmitter.fromEmitArgs(t)}function r(...e){const n=t.extractOptions(e),i=e[0]||n.type||up.fail("Missing event type"),s=new Event(i,{bubbles:!0,cancelable:!0});return Object.assign(s,t.omit(n,["type","target"])),s}const o=["metaKey","shiftKey","ctrlKey","altKey"];function u(e){return(t.isUndefined(e.button)||0===e.button)&&!t.some(o,(t=>e[t]))}function a(e,n,i=[]){const s=r(n,t.pick(e,i));return s.originalEvent=e,["stopPropagation","stopImmediatePropagation","preventDefault"].forEach((function(t){const n=s[t];return s[t]=function(){return e[t](),n.call(s)}})),e.defaultPrevented&&s.preventDefault(),s}n("up:click","[up-emit]",(function(t,n){if(!u(t))return;const i=e.attr(n,"up-emit"),s=e.jsonAttr(n,"up-emit-props"),r=a(t,i);Object.assign(r,s),up.emit(n,r)}));let h=["unknown"];function c(t){h.push(t),setTimeout((()=>h.pop()))}return n("keydown keyup",{capture:!0},(()=>c("key"))),n("pointerdown pointerup",{capture:!0},(()=>c("pointer"))),n("up:framework:reset",(function(){for(let t of[window,document,e.root,document.body])for(let e of up.EventListener.allNonDefault(t))e.unbind()})),{on:n,off:function(...t){return i(t).unbind()},build:r,emit:function(...t){return s(t).emit()},assertEmitted:function(...t){return s(t).assertEmitted()},onEscape:function(t){return n("keydown",(function(e){if("Escape"===e.key)return t(e)}))},halt:function(t,e={}){e.log&&up.log.putsEvent(t),t.stopImmediatePropagation(),t.preventDefault()},isUnmodified:u,isSyntheticClick:function(e){return t.isMissing(e.clientX)},fork:a,keyModifiers:o,get inputDevice(){return t.last(h)}}}(),up.on=up.event.on,up.off=up.event.off,up.emit=up.event.emit},454:()=>{up.feedback=function(){const t=up.util,e=up.element,n=new up.Config((()=>({currentClasses:["up-current"],navSelectors:["[up-nav]","nav"],noNavSelectors:["[up-nav=false]"]}))),i="a, [up-href]";function s(t){return t.upFeedbackURLs||=new up.LinkFeedbackURLs(t)}function r(t,{layer:r}={}){r||=up.layer.get(t);let u=o(r);const a=n.selector("navSelectors"),h=`${a} :is(${i}), ${a}:is(${i})`,c=up.fragment.all(h,{layer:r});for(let t of c){const i=s(t).isCurrent(u);for(let e of n.currentClasses)t.classList.toggle(e,i);e.toggleAttr(t,"aria-current","page",i)}}function o(e){return e.feedbackLocation||t.matchableURL(e.location)}function u(t){const e=t.feedbackLocation,n=o(t.location);e&&e===n||(t.feedbackLocation=n,r(t.element,{layer:t}))}return up.on("up:location:changed",(t=>{!function(){const t=up.layer.front;t.showsLiveHistory()&&u(t)}()})),up.on("up:fragment:compile",((t,e)=>{r(e)})),up.on("up:layer:location:changed",(t=>{u(t.layer)})),up.on("up:framework:reset",(function(){up.layer.root.feedbackLocation=null})),{config:n,showAroundRequest:function(n,s){if(!s.feedback)return;let r=e=>t.always(n,e),o=function(t){let n=t.origin;if(n)return s=n,e.ancestor(s,i)||s;var s}(n);o&&r(e.addTemporaryClass(o,"up-active"));for(let t of n.fragments)r(e.addTemporaryClass(t,"up-loading"))}}}()},2851:()=>{up.form=function(){const t=up.util,e=up.element,n=new up.Config((()=>({groupSelectors:["[up-form-group]","fieldset","label","form"],fieldSelectors:["select","input:not([type=submit]):not([type=image])","button[type]:not([type=submit])","textarea"],submitSelectors:["form:is([up-submit], [up-target], [up-layer], [up-transition])"],noSubmitSelectors:["[up-submit=false]","[target]",e.crossOriginSelector("action")],submitButtonSelectors:["input[type=submit]","input[type=image]","button[type=submit]","button:not([type])"],watchInputEvents:["input","change"],watchInputDelay:0,watchChangeEvents:["change"]})));function i(t=""){return n.fieldSelectors.map((e=>e+t)).join()}function s(t){return t.matches(i())}function r(n){n=e.get(n);let s=e.subtree(n,i());if(n.matches("form[id]")){const r=i(e.attrSelector("form",n.getAttribute("id"))),o=up.fragment.all(r,{layer:n});s.push(...o),s=t.uniq(s)}return s}function o(t){return e.subtree(t,a())}function u(t){return t?.matches(a())}function a(){return n.selector("submitButtonSelectors")}const h=up.mockable(((t,e)=>up.render(c(t,e))));function c(e,n,i){e=x(e),n=t.options(n);let s=new up.OptionsParser(e,n,i);return s.include(d),s.string("failTarget",{default:up.fragment.tryToTarget(e)}),s.booleanOrString("disable"),n.guardEvent||=up.event.build("up:form:submit",{submitButton:n.submitButton,log:"Submitting form",params:n.params,form:e}),n.origin||=up.viewport.focusedElementWithin(e)||n.submitButton||e,s.include(up.link.followOptions),n}function l(t){let e,n=document.activeElement,i=[...r(t),...o(t)];for(let t of i)t===n&&(e=w(n)),p(t);return e&&up.focus(e,{force:!0,preventScroll:!0}),function(){i.forEach(f)}}function p(t){t.upDisableCount||(t.upDisableCount||=0,t.upOriginalDisabled=t.disabled),t.upDisableCount++,t.disabled=!0}function f(t){t.upDisableCount&&(t.disabled?(t.upDisableCount--,t.upDisableCount||(t.disabled=t.upOriginalDisabled)):t.upDisableCount=0)}function d(e,n,i){n=t.options(n),e=x(e);const s=new up.OptionsParser(e,n,i);s.string("contentType",{attr:"enctype"}),s.json("headers");const r=up.Params.fromForm(e),u=n.submitButton??=o(e)[0];return u&&(r.addField(u),n.method||=u.getAttribute("formmethod"),n.url||=u.getAttribute("formaction")),r.addAll(n.params),n.params=r,s.string("url",{attr:"action",default:up.fragment.source(e)}),s.string("method",{attr:["up-method","data-method","method"],default:"GET",normalize:t.normalizeMethod}),"GET"===n.method&&(n.url=up.Params.stripURL(n.url)),n}function m(e,...n){e=up.element.get(e);const i=t.extractCallback(n)||function(t){let e=t.getAttribute("up-watch");if(e)return up.NonceableCallback.fromString(e).toFunction("value","name").bind(t)}(e)||up.fail("No callback given for up.watch()");let s=t.extractOptions(n);const r=new up.FieldWatcher(e,s,i);return r.start(),()=>r.stop()}function g(t,e={}){return m(t,{options:e,batch:!0},((e,n)=>h(t,n)))}function y(){return up.migrate.migratedFormGroupSelectors?.()||n.groupSelectors}function w(t){return b(t).element}function b(e){return t.findResult(y(),(function(t){let n=e.closest(t);if(n){let i=up.fragment.tryToTarget(n),s=up.fragment.tryToTarget(e),r=i||s&&n!==e&&`${t}:has(${s})`;if(r)return{target:r,element:n,origin:e}}}))}function v(n){let i,s;if(n.matches("input[type=checkbox]"))n.checked?(i=n.value,s=":checked"):s=":unchecked";else if(n.matches("input[type=radio]")){const t=E(n),r=n.getAttribute("name"),o=t.querySelector(`input[type=radio]${e.attrSelector("name",r)}:checked`);o?(s=":checked",i=o.value):s=":unchecked"}else i=n.value;const r=[];return t.isPresent(i)?(r.push(i),r.push(":present")):r.push(":blank"),t.isPresent(s)&&r.push(s),r}function _(t,e={}){const n=e.target||e.target||t.getAttribute("up-switch"),i=E(t);n||up.fail("No switch target given for %o",t);const s=v(t);for(let t of up.fragment.all(i,n))k(t,s)}const k=up.mockable((function(n,i){let s;i||=v(function(e){const n=E(e).querySelectorAll("[up-switch]");return t.find(n,(function(t){const n=t.getAttribute("up-switch");return e.matches(n)}))||up.fail("Could not find [up-switch] field for %o",e)}(n));let r=n.getAttribute("up-hide-for");if(r)r=S(r),s=0===t.intersect(i,r).length;else{let e=n.getAttribute("up-show-for");e=e?S(e):[":present",":checked"],s=t.intersect(i,e).length>0}e.toggle(n,s),n.classList.add("up-switched")}));function S(e){return t.parseTokens(e,{json:!0})}function x(t,e={}){const n=up.fragment.get(t,e);return n.form||n.closest("form")}function E(t,e){return x(t,e)||up.layer.get(t).element}return up.on("submit",n.selectorFn("submitSelectors"),(function(e,n){if(e.defaultPrevented)return;const i=t.presence(e.submitter,u);up.event.halt(e,{log:!0}),up.error.muteUncriticalRejection(h(n,{submitButton:i}))})),up.compiler((function(){let t=n.fieldSelectors.map((t=>`${t}[up-validate], [up-validate] ${t}`));return e.unionSelector(t,["[up-validate=false]"])}),(function(t){up.FormValidator.forElement(t).watchContainer(t)})),up.compiler("[up-switch]",(t=>{_(t)})),up.on("change","[up-switch]",((t,e)=>{_(e)})),up.compiler("[up-show-for]:not(.up-switched), [up-hide-for]:not(.up-switched)",(t=>{k(t)})),up.attribute("up-watch",(t=>m(t))),up.attribute("up-autosubmit",(t=>g(t))),{config:n,submit:h,submitOptions:c,destinationOptions:d,watchOptions:function(e,n,i={}){n=t.options(n);let s=new up.OptionsParser(e,n,{...i,closest:!0,attrPrefix:"up-watch-"});s.boolean("feedback"),s.booleanOrString("disable"),s.string("event"),s.number("delay");let r=up.form.config;return"input"===n.event?(n.event=t.evalOption(r.watchInputEvents,e),n.delay??=r.watchInputDelay):"change"===n.event&&(n.event=t.evalOption(r.watchChangeEvents,e)),n.origin||=e,n},isSubmittable:function(t){return t=up.fragment.get(t),n.matches(t,"submitSelectors")},watch:m,validate:function(...e){let n=function(e,...n){const i=t.extractOptions(n);return i.origin?i.target||=up.fragment.toTarget(e):i.origin||=up.fragment.get(e),i}(...e);return up.FormValidator.forElement(n.origin).validate(n)},autosubmit:g,fieldSelector:i,fields:r,isField:s,submitButtons:o,focusedField:function(){return t.presence(document.activeElement,s)},switchTarget:k,disableWhile:function(e,n){let i=function({disable:e,origin:n}){if(!e)return t.noop;let i,s=()=>E(n||void up.fail("Cannot process { disable: '%s' } option without { %s }",e,"origin"));return!0===e?i=[s()]:t.isString(e)&&(i=up.fragment.subtree(s(),e,{origin:n})),t.sequence(i.map(l))}(n);t.always(e,i)},disable:l,group:w,groupSolution:b,groupSelectors:y,get:x,getScope:E}}(),up.submit=up.form.submit,up.watch=up.form.watch,up.autosubmit=up.form.autosubmit,up.validate=up.form.validate},2667:(t,e,n)=>{n(8711);const i=up.util,s=up.element;up.fragment=function(){function t(t){let e=s.tagName(t);if(e.startsWith("up-"))return e}const e=new up.Config((()=>({badTargetClasses:[/^up-/],targetDerivers:["[up-id]","[id]","html","head","body","main","[up-main]",t,"link[rel][type]","link[rel=preload][href]","link[rel=preconnect][href]","link[rel=prefetch][href]","link[rel]","meta[property]","*[name]","form[action]","a[href]","[class]","[up-flashes]","form"],verifyDerivedTarget:!0,navigateOptions:{cache:"auto",revalidate:"auto",feedback:!0,fallback:!0,focus:"auto",scroll:"auto",history:"auto",peel:!0},match:"region",runScripts:!0,autoHistoryTargets:[":main"],autoFocus:["hash","autofocus","main-if-main","keep","target-if-lost"],autoScroll:["hash","layer-if-main"],autoRevalidate:t=>t.expired,skipResponse:n})));function n({response:t,expiredResponse:e}){return!t.text||t.text===e?.text}function r(t,e={}){return t=f(t,e),s.closestAttr(t,"up-source")}function o(t){return i.normalizeURL(t,{hash:!1})}function u(t){let e=s.closestAttr(t,"up-time");if(e&&"false"!==e)return/^\d+$/.test(e)&&(e=1e3*Number(e)),new Date(e)}function a(t){let e=s.closestAttr(t,"up-etag");if(e&&"false"!==e)return e}i.delegate(e,["mainTargets"],(()=>up.layer.config.any));const h=up.mockable(((...t)=>{let e=y(t);return new up.RenderJob(e).execute()})),c=up.mockable(((...t)=>{const e=y(t);return h({...e,navigate:!0})}));function l(t){return!t.closest(".up-destroying")}function p(t){return t.isConnected&&l(t)}function f(...t){const e=i.extractOptions(t),n=t.pop(),r=t[0];return i.isElementish(n)?s.get(n):r?d(r,n,e):new up.FragmentFinder({selector:n,origin:e.origin,layer:e.layer,match:e.match}).find()}function d(...t){return m(...t)[0]}function m(...t){const e=i.extractOptions(t);let n=t.pop();const s=t[0];return i.isElement(n)?[n]:i.isList(n)?n:new up.Selector(n,s,e).descendants(s)}function g(t,e,n={}){return new up.Selector(e,t,n).subtree(t)}function y(t){const e=i.parseArgIntoOptions(t,"target");return i.isElement(e.target)&&(e.origin||=e.target),e}const w=/^(onFail|on|fail)?(.+)$/;function b(t,e){return i.presence(t,i.isString)||v(t,e)||function(t){throw new up.CannotTarget(function(t){return`Cannot derive good target selector from a <${s.tagName(t)}> element without identifying attributes. Try setting an [id] or configure up.fragment.config.targetDerivers.`}(t))}(t)}function v(t,n){return i.findResult(e.targetDerivers,(function(r){let o=function(t,e){if(i.isFunction(e))return e(t);if(t.matches(e))try{return function(t,e){let{includePath:n,excludeRaw:i}=up.element.parseSelector(e);if(1!==n.length)throw new up.CannotParse(e);let{tagName:r,id:o,classNames:u,attributes:a}=n[0],h="";"*"===r?h+=s.tagName(t):r&&(h+=r);for(let t of u)h+=s.classSelector(t);o&&(h+=s.idSelector(o));for(let e in a){let n=a[e]||t.getAttribute(e);if("id"===e)h+=s.idSelector(n);else if("class"===e)for(let e of _(t))h+=s.classSelector(e);else h+=s.attrSelector(e,n)}return i&&(h+=i),h}(t,e)}catch(t){if(t instanceof up.CannotParse)return e;throw t}}(t,r);if(o&&function(t,n,i={}){return!p(n)||!e.verifyDerivedTarget||up.fragment.get(t,{layer:n,...i})===n}(o,t,n))return o}))}function _(t){return i.filter(t.classList,(t=>!i.some(e.badTargetClasses,(e=>{return n=e,s=t,i.isRegExp(n)?n.test(s):n===s;var n,s}))))}const k=/:main\b/,S=/:layer\b/,x=/:origin\b/;function E(t){return k.test(t)}function O(t,e={}){const{layer:n}=e;"new"===n||n instanceof up.Layer||up.fail("Must pass an up.Layer as { layer } option, but got %o",n),t=i.copy(i.wrapList(t));const s=[];for(;t.length;){let r=t.shift();if(!0===r&&(r=":main"),E(r)){let n=C(e),i=up.layer.mainTargets(n).map((t=>r.replace(k,t)));t.unshift(...i)}else if(S.test(r)){if("new"===n||n.opening)continue;let i=b(n.getFirstSwappableElement(),e);t.unshift(r.replace(S,i))}else i.isElementish(r)?s.push(b(r,e)):i.isString(r)&&s.push(T(r,e))}return i.uniq(s)}function C({layer:t,mode:e}){return"new"===t?e||up.fail('Must pass a { mode } option together with { layer: "new" }'):t.mode}function F(t,{origin:e}={}){return t.replace(x,(function(n){if(e)return b(e);up.fail('Missing { origin } element to resolve "%s" reference (found in %s)',n,t)}))}function T(...t){return(up.migrate.resolveOrigin||F)(...t)}function R(t){return i.parseTokens(t,{separator:"comma"})}function L(t,e){let n=up.on("up:fragment:aborted",{guard:e=>e.target.contains(t)},e);return up.destructor(t,n),n}return up.on("up:framework:boot",(function(){const{documentElement:t}=document;if(t.setAttribute("up-source",o(location.href)),up.hello(t),!up.browser.canPushState())return up.warn("Cannot push history changes. Next fragment update will load in a new page.")})),{config:e,reload:function(...t){const e=y(t);e.target||=":main";const n=f(e.target,e);return e.url||=r(n),e.headers=i.merge(e.headers,function(t){let e={},n=u(t);n&&(e["If-Modified-Since"]=n.toUTCString());let i=a(t);return i&&(e["If-None-Match"]=i),e}(n)),(e.keepData||s.booleanAttr(n,"up-keep-data"))&&(e.data=up.data(n)),up.migrate.postprocessReloadOptions?.(e),h(e)},destroy:function(...t){const e=y(t);return(e.element=f(e.target,e))&&new up.Change.DestroyFragment(e).execute(),up.migrate.formerlyAsync?.("up.destroy()")},render:h,navigate:c,get:f,getDumb:d,all:m,subtree:g,contains:function(t,e){return i.isElement(e)?s.contains(t,e)&&up.layer.get(t).contains(e):g(t,e).length>0},closest:function(t,e,n){return new up.Selector(e,t,n).closest(t)},source:r,normalizeSource:o,visit:function(t,e){return c({...e,url:t})},markAsDestroying:function(t){t.classList.add("up-destroying"),t.setAttribute("aria-hidden","true")},emitInserted:function(t){return up.emit(t,"up:fragment:inserted",{log:["Inserted fragment %o",t]})},emitDestroyed:function(t,e){const n=e.log??["Destroyed fragment %o",t],i=e.parent||document;return up.emit(i,"up:fragment:destroyed",{fragment:t,parent:i,log:n})},emitKeep:function(t){let{oldElement:e,newElement:n,newData:i,renderOptions:r}=t;const o=["Keeping fragment %o",e],u=s.callbackAttr(e,"up-on-keep",{exposedKeys:["newFragment","newData"]});return up.emit(e,"up:fragment:keep",{newFragment:n,newData:i,renderOptions:r,log:o,callback:u})},successKey:function(t){let e=w.exec(t);if(e){let[t,n,s]=e;switch(n){case"onFail":return"on"+i.upperCaseFirst(s);case"fail":return i.lowerCaseFirst(s)}}},failKey:function(t){let e=w.exec(t);if(e){let[t,n,s]=e;switch(n){case"on":return"onFail"+i.upperCaseFirst(s);case void 0:return"fail"+i.upperCaseFirst(s)}}},expandTargets:O,resolveOrigin:T,toTarget:b,tryToTarget:v,isTargetable:function(t){return!!v(t)},matches:function(t,e,n={}){if(t=s.get(t),i.isElement(e)){let n=v(e);return n&&t.matches(n)}return new up.Selector(e,t,n).matches(t)},hasAutoHistory:function(t,n){let i=O(e.autoHistoryTargets,{layer:n}).join();for(let e of t)if(s.subtree(e,i).length)return!0;return up.puts("up.render()","Will not auto-update history because fragment doesn't contain a selector from up.fragment.config.autoHistoryTargets"),!1},time:u,etag:a,shouldRevalidate:function(t,n,s={}){return t.fromCache&&i.evalAutoOption(s.revalidate,e.autoRevalidate,n)},abort:function(...t){let e,n,s=y(t),{reason:r,newLayer:o}=s;if(s.target)n=m(s.target,s),e=t=>t.isPartOfSubtree(n),r||="Aborting requests within fragment";else{let t=up.layer.getAll(s);n=i.map(t,"element"),e=e=>i.contains(t,e.layer),r||="Aborting requests within "+t.join(", ")}up.network.abort((t=>t.abortable&&e(t)),{...s,reason:r});for(let t of n)up.emit(t,"up:fragment:aborted",{reason:r,newLayer:o,log:!1})},onAborted:L,onFirstIntersect:function(t,e,{margin:n=0}={}){if(s.isIntersectingWindow(t,{margin:n}))return void e();let i=new IntersectionObserver((function(t){for(let n of t)if(n.isIntersecting)return r(),void e()}),{rootMargin:`${n}px`}),r=()=>i.disconnect();i.observe(t),L(t,r)},splitTarget:R,parseTargetSteps:function(t,e={}){let n=e.defaultPlacement||"swap",i=e.defaultMaybe??!1,s=[],r=R(t);for(let t of r){if(":none"===t)continue;let r=n,o=i;t=t.replace(/\b::?(before|after)\b/,((t,e)=>(r=e,""))),t=t.replace(/\b:maybe\b/,(()=>(o=!0,"")));const u={...e,selector:t,placement:r,maybe:o,originalRenderOptions:e};s.push(u)}return s},isAlive:p,isNotDestroying:l,targetForSteps:function(t){let e=t.filter((t=>!t.maybe||t.oldElement?.isConnected));return i.map(e,"selector").join(", ")||":none"},compressNestedSteps:function(t){if(t.length<2)return t;let e=i.uniqBy(t,"oldElement");return e=i.reject(e,(t=>function(t,e){return i.some(t,(function(t){return t!==e&&("swap"===t.placement||"content"===t.placement)&&t.oldElement.contains(e.oldElement)}))}(e,t))),e},containsMainPseudo:E}}(),up.reload=up.fragment.reload,up.destroy=up.fragment.destroy,up.render=up.fragment.render,up.navigate=up.fragment.navigate,up.visit=up.fragment.visit,i.delegate(up,["context"],(()=>up.layer.current))},9634:()=>{up.framework=function(){let t="evaling";function e(){if("configuring"!==t)return void console.error("Unpoly has already booted");let e=n();e?console.error("Unpoly cannot boot: %s",e):(t="booting",up.emit("up:framework:boot",{log:!1}),t="booted",up.emit("up:framework:booted",{log:!1}))}function n(){for(let t of["URL","Proxy","Promise","DOMParser","FormData"])if(!window[t])return`Browser doesn't support the ${t} API`;if("BackCompat"===document.compatMode)return"Browser is in quirks mode (missing DOCTYPE?)"}return{onEvaled:function(){up.emit("up:framework:evaled",{log:!1}),function(){let t=document.currentScript;return!!t?.async||"manual"===t?.getAttribute("up-boot")||"complete"===document.readyState||void 0}()?console.debug("Call up.boot() after you have configured Unpoly"):document.addEventListener("DOMContentLoaded",e),t="configuring"},boot:e,startExtension:function(){if("configuring"!==t)throw new Error("Unpoly extensions must be loaded before booting");t="evaling"},stopExtension:function(){t="configuring"},reset:function(){up.emit("up:framework:reset",{log:!1})},get evaling(){return"evaling"===t},get booted(){return"booted"===t},get beforeBoot(){return"booting"!==t&&"booted"!==t},isSupported:function(){return!n()}}}(),up.boot=up.framework.boot},8944:()=>{up.history=function(){const t=up.util,e=up.element,n=new up.Config((()=>({enabled:!0,updateMetaTags:!0,restoreTargets:["body"],metaTagSelectors:["meta","link[rel=alternate]","link[rel=canonical]","link[rel=icon]","[up-meta]",'script[type="application/ld+json"]'],noMetaTagSelectors:["meta[http-equiv]","[up-meta=false]","meta[name=csp-nonce]"]})));let i,s;function r(){return t.normalizeURL(location.href)}function o(){const t=r();s!==t&&(i=s,s=t)}function u(e,n){return t.matchURLs(e,location.href,{hash:!0,...n})}function a(e,n={}){c("replaceState",e=t.normalizeURL(e))&&!1!==n.event&&h({location:e,reason:"replace",log:`Replaced state for ${e}`})}function h(t){let e=up.event.build("up:location:changed",t);up.migrate?.renamedProperty?.(e,"url","location"),up.emit(e)}function c(t,e){if(n.enabled){const n={up:{}};return window.history[t](n,"",e),o(),!0}}function l(t){o();let e=r();h({location:e,reason:"pop",log:`Navigated to history entry ${e}`}),up.viewport.saveFocus({location:i}),up.viewport.saveScroll({location:i}),function(t){if(!t?.up)return void up.puts("popstate","Ignoring a history state not owned by Unpoly");let e=r();up.error.muteUncriticalRejection(up.render({guardEvent:up.event.build("up:location:restore",{location:e,log:`Restoring location ${e}`}),url:e,target:n.restoreTargets,fail:!1,history:!0,location:e,peel:!0,layer:"root",cache:"auto",revalidate:"auto",saveScroll:!1,scroll:["restore","auto"],saveFocus:!1,focus:["restore","auto"]}))}(t.state)}function p(){window.addEventListener("popstate",l),"GET"===up.protocol.initialRequestMethod()&&a(r(),{event:!1})}function f(t=document.head){return t.querySelectorAll(n.selector("metaTagSelectors"))}return o(),up.on("up:framework:boot",(function(){"jasmine"in window?p():setTimeout(p,100)})),up.macro("[up-back]",(function(t){i&&(e.setMissingAttrs(t,{"up-href":i,"up-scroll":"restore"}),t.removeAttribute("up-back"),up.link.makeFollowable(t))})),up.on("up:framework:reset",(function(){i=void 0,s=void 0,o()})),{config:n,push:function(e){!u(e=t.normalizeURL(e))&&c("pushState",e)&&h({location:e,reason:"push",log:`Advanced to location ${e}`})},replace:a,get location(){return r()},get previousLocation(){return i},isLocation:u,findMetaTags:f,updateMetaTags:function(t){let e=f();for(let t of e)t.remove();for(let e of t)document.head.append(e)},getLang:function(t=document){let{documentElement:e}=t;if(e.matches("html"))return t.documentElement.lang},updateLang:function(t){e.toggleAttr(e.root,"lang",t,!!t)}}}()},9443:(t,e,n)=>{n(4432);const i=up.util,s=up.element;up.layer=function(){const t=[up.Layer.Root,up.Layer.Modal,up.Layer.Popup,up.Layer.Drawer,up.Layer.Cover],e=new up.Config((function(){const e={mode:"modal",any:{mainTargets:["[up-main='']","main",":layer"]},root:{mainTargets:["[up-main~=root]"],history:!0},overlay:{mainTargets:["[up-main~=overlay]"],openAnimation:"fade-in",closeAnimation:"fade-out",dismissLabel:"×",dismissAriaLabel:"Dismiss dialog",dismissable:!0,history:"auto",trapFocus:!0},cover:{mainTargets:["[up-main~=cover]"]},drawer:{mainTargets:["[up-main~=drawer]"],backdrop:!0,position:"left",size:"medium",openAnimation(t){switch(t.position){case"left":return"move-from-left";case"right":return"move-from-right"}},closeAnimation(t){switch(t.position){case"left":return"move-to-left";case"right":return"move-to-right"}}},modal:{mainTargets:["[up-main~=modal]"],backdrop:!0,size:"medium"},popup:{mainTargets:["[up-main~=popup]"],position:"bottom",size:"medium",align:"left",dismissable:"outside key",trapFocus:!1},foreignOverlaySelectors:["dialog"]};for(let n of t)e[n.mode].Class=n;return e}));let n=null,r=[];function o(t){return"root"===t?[e.root,e.any]:[e[t],e.overlay,e.any]}async function u(t){return t=i.options(t,{layer:"new",defaultToEmptyContent:!0,navigate:!0}),(await up.render(t)).layer}up.on("up:fragment:destroyed",(function(){n.sync()})),up.on("up:framework:evaled",(function(){n=new up.LayerStack})),up.on("up:framework:reset",(function(){n.reset(),r=i.filter(r,"isDefault")}));const a={config:e,mainTargets:function(t){return i.flatMap(o(t),"mainTargets")},open:u,build:function(t,s){const{mode:r}=t,{Class:u}=e[r],a=i.reverse(o(r));let h=up.migrate.handleLayerConfig;return h&&a.forEach(h),t.openAnimation??=i.pluckKey(t,"animation"),t=i.mergeDefined(...a,{mode:r,stack:n},t),s&&(t=s(t)),new u(t)},ask:function(t){return new Promise((function(e,n){u(t={...t,onAccepted:t=>e(t.value),onDismissed:t=>n(t.value)})}))},normalizeOptions:function(t){!function(t){if(!(t.layer instanceof up.Layer))if(up.migrate.handleLayerOptions?.(t),i.isGiven(t.layer)){let n=String(t.layer).match(/^(new|shatter|swap)( (\w+))?/);if(n){t.layer="new";const i=n[1],s=n[3];t.mode||=s||e.mode,"swap"===i?up.layer.isOverlay()&&(t.baseLayer="parent"):"shatter"===i&&(t.baseLayer="root")}}else t.mode?t.layer="new":i.isElementish(t.target)?t.layer=n.get(t.target,{normalizeLayerOptions:!1}):t.origin?t.layer="origin":t.layer="current"}(t),t.context??={},function(t){t.baseLayer instanceof up.Layer||(t.baseLayer=n.get("current",{...t,normalizeLayerOptions:!1}))}(t)},openCallbackAttr:function(t,e){return s.callbackAttr(t,e,{exposedKeys:["layer"]})},closeCallbackAttr:function(t,e){return s.callbackAttr(t,e,{exposedKeys:["layer","value","response"]})},anySelector:function(){return i.map(t,(t=>t.selector())).join()},optionToString:function(t){return i.isString(t)?`layer "${t}"`:t.toString()},get stack(){return n.layers},isWithinForeignOverlay:function(t){let n=e.selector("foreignOverlaySelectors");return!(!n||!t.closest(n))}};return i.delegate(a,["get","getAll","root","overlays","current","front","sync","count","dismissOverlays"],(()=>n)),i.delegate(a,["accept","dismiss","isRoot","isOverlay","isFront","on","off","emit","parent","history","location","mode","context","element","contains","size","affix"],(()=>n.current)),a}()},3849:(t,e,n)=>{n(2065),up.link=function(){const t=up.util,e=up.element;let n=null;const i="[up-content], [up-fragment], [up-document]",s=`${i}, [up-target], [up-layer], [up-transition], [up-preload]`,r=new up.Config((()=>({followSelectors:["[up-follow]",`a:is(${s})`],noFollowSelectors:["[up-follow=false]","a[download]","a[target]",'a[href^="javascript:"]','a[href^="mailto:"]',`a[href^="#"]:not(${i})`,e.crossOriginSelector("href"),e.crossOriginSelector("up-href")],instantSelectors:["[up-instant]"],noInstantSelectors:["[up-instant=false]","[onclick]"],preloadSelectors:["[up-preload]"],noPreloadSelectors:["[up-preload=false]"],clickableSelectors:["[up-clickable]","[up-follow]","[up-emit]","[up-accept]","[up-dismiss]",`a:is(${s})`],noClickableSelectors:["[up-clickable=false]","a[href], button"],preloadDelay:90}))),o=up.mockable((function(t,e,n){return up.render(a(t,e,n))}));function u(e,n,i){n=t.options(n);const s=new up.OptionsParser(e,n,{...i,fail:!1});return n.url=function(t,e={}){const n=e.url||t.getAttribute("up-href")||t.getAttribute("href");if("#"!==n)return n}(e,n),n.method=c(e,n),s.json("headers"),s.json("params"),s.booleanOrString("cache"),s.booleanOrString("expireCache"),s.booleanOrString("evictCache"),s.booleanOrString("revalidate"),s.booleanOrString("abort"),s.boolean("abortable"),s.boolean("background"),s.string("contentType"),s.number("badResponseTime"),s.number("timeout"),n}function a(e,n,i){e=up.fragment.get(e),n=t.options(n);const s=new up.OptionsParser(e,n,{fail:!0,...i});return s.include(u),s.boolean("feedback"),n.origin||=e,s.boolean("fail"),s.boolean("navigate",{default:!0}),s.string("confirm",{attr:["up-confirm","data-confirm"]}),s.string("target"),s.booleanOrString("fallback"),s.string("match"),s.string("content"),s.string("fragment"),s.string("document"),s.boolean("useKeep"),s.boolean("useHungry"),s.callback("onLoaded"),s.callback("onRendered",{mainKey:"result"}),s.callback("onFinished",{mainKey:"result"}),s.callback("onOffline",{mainKey:"error"}),s.callback("onError",{mainKey:"error"}),s.boolean("peel"),s.string("layer"),s.string("baseLayer"),s.json("context"),s.string("mode"),s.string("align"),s.string("position"),s.string("class"),s.string("size"),s.booleanOrString("dismissable"),s.parse(up.layer.openCallbackAttr,"onOpened"),s.parse(up.layer.closeCallbackAttr,"onAccepted"),s.parse(up.layer.closeCallbackAttr,"onDismissed"),s.string("acceptEvent"),s.string("dismissEvent"),s.string("acceptLocation"),s.string("dismissLocation"),s.booleanOrString("history"),s.booleanOrString("focus"),s.boolean("saveScroll"),s.boolean("saveFocus"),s.booleanOrString("scroll"),s.boolean("revealTop"),s.number("revealMax"),s.number("revealPadding"),s.number("revealSnap"),s.string("scrollBehavior"),s.booleanOrString("history"),s.booleanOrString("location"),s.booleanOrString("title"),s.boolean("metaTags"),s.booleanOrString("lang"),s.include(up.motion.motionOptions),n.guardEvent??=up.event.build("up:link:follow",{log:["Following link %o",e]}),n}function h(t,e){let n=function(t){if(!g(t))return"Will not preload an unsafe link"}(t=up.fragment.get(t));if(n)return Promise.reject(new up.Error(n));const i=up.event.build("up:link:preload",{log:["Preloading link %o",t]});return o(t,{abortable:!1,...e,guardEvent:i,preload:!0})}function c(e,n={}){return t.normalizeMethod(n.method||e.getAttribute("up-method")||e.getAttribute("data-method"))}function l(t){return t=up.fragment.get(t),r.matches(t,"followSelectors")}function p(t){l(t)||t.setAttribute("up-follow","")}function f(t,e){if(t.defaultPrevented)return!1;const n=`a, [up-follow], ${up.form.fieldSelector()}`,i=t.target.closest(n);return!i||i===e}function d(t){const e=t.closest(r.selector("instantSelectors"));return e&&(n=e,!(r.matches(n,"noInstantSelectors")||r.matches(n,"noFollowSelectors")));var n}function m(t){let e=["clientX","clientY","button",...up.event.keyModifiers];const n=up.event.fork(t,"up:click",e);up.emit(t.target,n,{log:!1})}function g(t){const e=c(t);return up.network.isSafeMethod(e)}function y(t,n,i){switch(t){case"insert":i();break;case"reveal":{let t=e.numberAttr(n,"up-intersect-margin");up.fragment.onFirstIntersect(n,i,{margin:t});break}case"hover":new up.LinkFollowIntent(n,i)}}function w(t,e){let n={navigate:!1,guardEvent:up.event.build("up:deferred:load",{log:["Loading deferred %o",t]}),...e};return o(t,n,{defaults:{target:":origin",cache:"auto",revalidate:"auto",feedback:!0}})}return up.macro(r.selectorFn("clickableSelectors"),(function(t){let n=t.matches("a, [up-follow]")?"link":"button";e.setMissingAttrs(t,{tabindex:"0",role:n,"up-clickable":""}),t.addEventListener("keydown",(function(e){if("Enter"===e.key||"button"===t.role&&"Space"===e.key)return m(e)}))})),up.attribute("up-defer",{defaultValue:"insert"},(function(t,e){y(e,t,(()=>up.error.muteUncriticalRejection(w(t))))})),up.on("up:click",r.selectorFn("followSelectors"),(function(t,e){f(t,e)&&(up.event.halt(t,{log:!0}),up.focus(e,{preventScroll:!0}),up.error.muteUncriticalRejection(o(e)))})),up.attribute("up-expand",{defaultValue:"a, [up-href]",macro:!0},(function(t,n){let i=e.get(t,n);i&&(e.setMissingAttrs(t,{"up-href":e.attr(i,"href"),...e.upAttrs(i)}),t.classList.add(...e.upClasses(i)),p(t))})),up.compiler(r.selectorFn("preloadSelectors"),(function(t){if(!function(t){return!up.browser.canPushState()||!l(t)||!function(t){const e=u(t);if(e.url)return null==e.cache&&(e.cache="auto"),e.basic=!0,new up.Request(e).willCache()}(t)}(t)){let n=()=>up.error.muteUncriticalRejection(h(t));y(e.booleanOrStringAttr(t,"up-preload",null)??"hover",t,n)}})),up.on("up:framework:reset",(function(){n=null})),{follow:o,followOptions:a,requestOptions:u,preload:h,makeFollowable:p,isSafe:g,isFollowable:l,shouldFollowEvent:f,convertClicks:function(t){t.on("click",(function(e,i){if(up.event.isUnmodified(e))return d(i)&&n?up.event.halt(e):("key"===up.event.inputDevice||up.event.isSyntheticClick(e)||t.wasHitByMouseEvent(e)&&(!n||n===e.target))&&m(e),n=null})),t.on("mousedown",(function(t,e){up.event.isUnmodified(t)&&(n=t.target,d(e)&&m(t))}))},config:r,loadDeferred:w}}(),up.follow=up.link.follow,up.deferred={load:up.link.loadDeferred}},4453:()=>{up.log=function(){const t=up.util,e=new up.LogConfig;function n(t,e,n,...s){i(t,e,"",n,...s)}function i(n,i,s,r,...o){r&&(e.format?console[n](`%c${i}%c ${r}`,"color: #666666; padding: 1px 3px; border: 1px solid #bbbbbb; border-radius: 2px; font-size: 90%; display: inline-block;"+s,"",...o):console[n](`[${i}] ${t.sprintf(r,...o)}`))}return up.on("up:framework:boot",(function(){if(!e.banner)return;const t=` __ _____ ___ ___ / /_ __\n/ // / _ \\/ _ \\/ _ \\/ / // / ${up.version}\n\\___/_//_/ .__/\\___/_/\\_. / \n / / / /\n\n`;let n="";up.migrate.loaded||(n+="Load unpoly-migrate.js to polyfill deprecated APIs.\n\n"),e.enabled?n+="Call `up.log.disable()` to disable logging for this session.":n+="Call `up.log.enable()` to enable logging for this session.";const i="color: #777777";e.format?console.log("%c"+t+"%c"+n,"font-family: monospace;"+i,i):console.log(t+n)})),{puts:function(...t){e.enabled&&n("log",...t)},putsEvent:function(t){if(e.enabled){let e="#5566cc";i("log",(t=t.originalEvent||t).type,`color: white; border-color: ${e}; background-color: ${e}`,"Interaction on %o",t.target)}},error:(...t)=>n("error",...t),warn:(...t)=>n("warn",...t),config:e,enable:function(){e.enabled=!0},disable:function(){e.enabled=!1}}}(),up.puts=up.log.puts,up.warn=up.log.warn},6535:()=>{up.migrate={config:{}}},8374:()=>{up.mockable=function(t){if(window.jasmine){let e=t.name,n={[e]:t},i=function(){return n[e].apply(this,arguments)};return i.mock=()=>spyOn(n,e),i}return t}},4034:()=>{up.motion=function(){const t=up.util,e=up.element;let n={},i={};const s=new up.MotionController("motion"),r=new up.Config((()=>({duration:175,easing:"ease",enabled:!matchMedia("(prefers-reduced-motion: reduce)").matches})));function o(e){return t.pickBy(e,"isDefault")}function u(){return r.enabled}function a(t,n,i){return c(i),u()&&!y(n)&&i.duration>0&&!e.isSingleton(t)}function h(t,e,n){return up.migrate.loaded&&(e=up.migrate.fixStyleProps(e)),n={...n,finishEvent:s.finishEvent},new up.CSSTransition(t,e,n).start()}function c(t){t.easing??=r.easing,t.duration??=r.duration}function l(e){if(!y(e)){if(t.isFunction(e))return e;if(t.isArray(e))return p(...e);if(t.isString(e)){let t;if(e.indexOf("/")>=0)return p(...e.split("/"));if(t=i[e])return l(t)}else up.fail("Unknown transition %o",e)}}function p(e,n){if(!y(e)&&!y(n)){const i=f(e)||t.asyncNoop,s=f(n)||t.asyncNoop;return(t,e,n)=>Promise.all([i(t,n),s(e,n)])}}function f(e){var i;if(!y(e))return t.isFunction(e)?e:t.isString(e)?n[i=e]||up.fail("Unknown animation %o",i):t.isOptions(e)?(t,n)=>h(t,e,n):void up.fail("Unknown animation %o",e)}const d=up.mockable((function(t,e){t.replaceWith(e)}));function m(t,e){const n=l(e);n.isDefault=up.framework.evaling,i[t]=n}function g(t,e){const i=f(e);i.isDefault=up.framework.evaling,n[t]=i}function y(t){return!t||"none"===t}function w(t,n,i){g(t,(function(t,s){return t.style.opacity=0,e.setStyle(t,{opacity:n}),h(t,{opacity:i},s)}))}function b(t,e){return{transform:`translate(${t}px, ${e}px)`}}function v(t){return e.setStyle(t,{transform:""}),t.getBoundingClientRect()}function _(t,n){const i=`move-from-${t}`;g(`move-to-${t}`,(function(t,e){const i=v(t);return h(t,n(i),e)})),g(i,(function(t,i){const s=v(t),r=n(s);return e.setStyle(t,r),h(t,{transform:""},i)}))}return up.on("up:framework:boot",(function(){u()||up.puts("up.motion","Animations are disabled")})),w("fade-in",0,1),w("fade-out",1,0),_("top",(function(t){return b(0,-(t.top+t.height))})),_("bottom",(function(t){return b(0,up.viewport.rootHeight()-t.top)})),_("left",(function(t){return b(-(t.left+t.width),0)})),_("right",(function(t){return b(up.viewport.rootWidth()-t.left,0)})),m("cross-fade",["fade-out","fade-in"]),m("move-left",["move-to-left","move-from-right"]),m("move-right",["move-to-right","move-from-left"]),m("move-up",["move-to-top","move-from-bottom"]),m("move-down",["move-to-bottom","move-from-top"]),up.on("up:framework:reset",(function(){s.reset(),n=o(n),i=o(i)})),{morph:function(n,i,r,o){c(o=t.options(o)),n=up.fragment.get(n),i=up.fragment.get(i);let u=l(r);const h=a(n,u,o);u=up.error.guardFn(u);const p=t.pluckKey(o,"beforeStart")||t.noop,f=t.pluckKey(o,"afterInsert")||t.noop,m=t.pluckKey(o,"beforeDetach")||t.noop,g=t.pluckKey(o,"afterDetach")||t.noop,y=t.pluckKey(o,"scrollNew")||t.noop;if(p(),h){if(s.isActive(n)&&!1===o.trackMotion)return u(n,i,o);up.puts("up.morph()","Morphing %o to %o with transition %O over %d ms",n,i,r,o.duration);const t=up.viewport.get(n),a=t.scrollTop,h=up.viewport.absolutize(n,{afterMeasure(){e.insertBefore(n,i),f()}}),c=async function(){y();const e=t.scrollTop;h.moveBounds(0,e-a),await u(n,i,o),m(),h.bounds.remove(),g()};return s.startFunction([n,i],c,o)}return m(),d(n,i),f(),g(),y(),Promise.resolve()},animate:function(n,i,r){n=up.fragment.get(n),r=t.options(r);let o=f(i);const u=a(n,i,r);if(o=up.error.guardFn(o),u){const t=()=>o(n,r);return s.startFunction(n,t,r)}return function(n,i){return t.isOptions(i)&&e.setStyle(n,i),Promise.resolve()}(n,i)},finish:function(t){return s.finish(t)},finishCount:()=>s.finishCount,transition:m,animation:g,config:r,isEnabled:u,isNone:y,willAnimate:a,swapElementsDirectly:d,motionOptions:function(e,n,i){n=t.options(n);let s=new up.OptionsParser(e,n,i);return s.booleanOrString("animation"),s.booleanOrString("transition"),s.string("easing"),s.number("duration"),n}}}(),up.transition=up.motion.transition,up.animation=up.motion.animation,up.morph=up.motion.morph,up.animate=up.motion.animate},1647:(t,e,n)=>{n(35);const i=up.util;up.network=function(){const t=new up.Config((()=>({concurrency:6,wrapMethod:!0,cacheSize:70,cacheExpireAge:15e3,cacheEvictAge:54e5,badResponseTime:400,fail:t=>(t.status<200||t.status>299)&&304!==t.status,autoCache:t=>t.isSafe(),expireCache:(t,e)=>!t.isSafe(),evictCache:!1,progressBar:!0,timeout:9e4}))),e=new up.Request.Queue,n=new up.Request.Cache;let s=null;function r(s){(function(t){let i;if(t.willCache()&&(i=n.get(t)))return up.puts("up.request()","Re-using previous request to %s",t.description),t.background||e.promoteToForeground(i),i.mergeIfUnsent(t),n.track(i,t,{onIncompatible:r}),!0})(s)||function(s){(function(e){e.willCache()&&(n.put(e),e.onLoading=()=>n.reindex(e)),i.always(e,(function(s){let r=s.expireCache??e.expireCache??i.evalOption(t.expireCache,e,s);r&&n.expire(r,{except:e});let o=s.evictCache??e.evictCache??i.evalOption(t.evictCache,e,s);o&&n.evict(o,{except:e});let u=n.get(e),a=s instanceof up.Response,h=!a,c=a&&s.ok,l=a&&!s.ok,p=a&&s.none;l?n.evict(e.url):h||p?n.evict(e):c&&u&&n.put(e)}))})(s),e.asap(s)}(s)}function o(...t){up.migrate.preprocessAbortArgs?.(t),e.abort(...t)}return up.on("up:network:late",(function(){i.evalOption(t.progressBar)&&(s=new up.ProgressBar)})),up.on("up:network:recover",(function(){s?.conclude()})),up.on("up:framework:reset",(function(){o(),e.reset(),n.reset(),s?.destroy(),s=null})),{request:function(...t){const e=function(t){const e=i.extractOptions(t);return e.url||(e.url=t[0]),up.migrate.handleRequestOptions?.(e),e}(t),n=new up.Request(e);return r(n),n},cache:n,isBusy:function(){return e.isBusy()},isSafeMethod:function(t){return i.contains(["GET","OPTIONS","HEAD"],i.normalizeMethod(t))},config:t,abort:o,registerAliasForRedirect:function(t,e){if(t.cache&&e.url&&t.url!==e.url){const s=i.variant(t,{method:e.method,url:e.url,cacheRoute:null});n.alias(t,s)}},queue:e,loadPage:function(t){new up.Request(t).loadPage()}}}(),up.request=up.network.request,up.cache=up.network.cache},3535:()=>{up.protocol=function(){const t=up.util,e=up.element,n=function(t){return"X-Up"+t.replace(/(^.|[A-Z])/g,(t=>"-"+t.toUpperCase()))},i=function(e,i,s=t.identity){let r=e.getResponseHeader(n(i));if(r)return s(r)};function s(t){return"false"!==t&&t}const r=t.memoize((function(){return t.normalizeMethod(up.browser.popCookie("_up_method"))})),o=new up.Config((()=>({methodParam:"_method",csrfParam:()=>e.metaContent("csrf-param"),csrfToken:()=>e.metaContent("csrf-token"),cspNonce:()=>e.metaContent("csp-nonce"),csrfHeader:"X-CSRF-Token",maxHeaderSize:2048})));return{config:o,locationFromXHR:function(t){return i(t,"location")||t.responseURL},titleFromXHR:function(t){return up.migrate.titleFromXHR?.(t)??i(t,"title",JSON.parse)},targetFromXHR:function(t){return i(t,"target")},methodFromXHR:function(e){return i(e,"method",t.normalizeMethod)},acceptLayerFromXHR:function(t){return i(t,"acceptLayer",JSON.parse)},contextFromXHR:function(t){return i(t,"context",JSON.parse)},dismissLayerFromXHR:function(t){return i(t,"dismissLayer",JSON.parse)},eventPlansFromXHR:function(t){return i(t,"events",JSON.parse)},expireCacheFromXHR:function(t){return i(t,"expireCache")||up.migrate.clearCacheFromXHR?.(t)},evictCacheFromXHR:function(t){return i(t,"evictCache",s)},csrfHeader:function(){return t.evalOption(o.csrfHeader)},csrfParam:function(){return t.evalOption(o.csrfParam)},csrfToken:function(){return t.evalOption(o.csrfToken)},cspNonce:function(){return t.evalOption(o.cspNonce)},initialRequestMethod:r,headerize:n,wrapMethod:function(t,e){return e.add(o.methodParam,t),"POST"},cspNoncesFromHeader:function(t){let e=[];if(t){let n=t.split(/\s*;\s*/);for(let t of n)if(0===t.indexOf("script-src")){let n,i=/'nonce-([^']+)'/g;for(;n=i.exec(t);)e.push(n[1])}}return e}}}()},9615:()=>{up.radio=function(){const t=up.element,e=new up.Config((()=>({hungrySelectors:["[up-hungry]"],noHungrySelectors:["[up-hungry=false]"],pollInterval:3e4})));return up.attribute("up-poll",(function(t){up.FragmentPolling.forFragment(t).onPollAttributeObserved()})),up.macro("[up-flashes]",(function(e){t.setMissingAttrs(e,{"up-hungry":"","up-if-layer":"subtree","up-keep":"",role:"alert"}),e.addEventListener("up:fragment:keep",(function(e){t.isEmpty(e.newFragment)||e.preventDefault()}))})),{config:e,hungrySteps:function(n){let{useHungry:i,origin:s,layer:r}=n,o={current:[],other:[]};if(!i)return o;let u=e.selector("hungrySelectors");const a=[r,...r.ancestors,...r.descendants];for(let e of a){let i=up.fragment.all(e.element,u,{layer:e});for(let u of i){let i=up.fragment.tryToTarget(u,{origin:s});if(!i){up.warn("[up-hungry]","Ignoring untargetable fragment %o",u);continue}let a=t.attr(u,"up-if-layer"),h=a?up.layer.getAll(a,{baseLayer:e}):[e],c={selector:i,oldElement:u,layer:e,origin:s,...up.motion.motionOptions(u),placement:"swap",useKeep:!0,maybe:!0,selectEvent:up.event.build("up:fragment:hungry",{log:!1}),selectCallback:t.callbackAttr(u,"up-on-hungry",{exposedKeys:["newFragment","renderOptions"]}),originalRenderOptions:n};h.includes(r)&&(r===e?o.current:o.other).push(c)}}return o.other=up.fragment.compressNestedSteps(o.other),o},startPolling:function(t,e={}){up.FragmentPolling.forFragment(t).forceStart(e)},stopPolling:function(t){up.FragmentPolling.forFragment(t).forceStop()},pollOptions:function(t,n={}){const i=new up.OptionsParser(t,n,{defaults:{background:!0}});return i.number("interval",{default:e.pollInterval}),i.string("ifLayer",{default:"front"}),i.include(up.link.requestOptions),n}}}()},6774:()=>{!function(){const t=up.element;for(let e of["method","confirm"]){const n=`up-${e}`,i=`data-${e}`;up.macro(`a[${i}]`,(function(e){(window.Rails||window.jQuery?.rails)&&up.link.isFollowable(e)&&(t.setMissingAttr(e,n,e.getAttribute(i)),e.removeAttribute(i))}))}}()},1897:()=>{up.script=function(){const t=up.util,e=up.element,n=new up.Config((()=>({assetSelectors:["link[rel=stylesheet]","script[src]","[up-asset]"],noAssetSelectors:["[up-asset=false]"],nonceableAttributes:["up-watch","up-on-accepted","up-on-dismissed","up-on-loaded","up-on-rendered","up-on-finished","up-on-error","up-on-offline"],scriptSelectors:["script"],noScriptSelectors:['script[type="application/ld+json"]']}))),i={"[up-back]":-100,"[up-clickable]":-200,"[up-drawer]":-200,"[up-modal]":-200,"[up-cover]":-200,"[up-popup]":-200,"[up-tooltip]":-200,"[up-dash]":-200,"[up-flashes]":-200,"[up-expand]":-300,"[data-method]":-400,"[data-confirm]":-400};let s=[],r=[];function o(e,n={}){let o=function(e,n){let[i,s,r]=u(e);return s=t.options(s,{selector:i,isDefault:up.framework.evaling,priority:0,batch:!1}),Object.assign(r,s,n)}(e,n);o.macro?(up.framework.evaling&&(o.priority||=function(e){e=t.evalOption(e);for(let t in i)if(e.indexOf(t)>=0)return i[t];up.fail("Unregistered priority for system macro %o",e)}(o.selector)),a(r,o)):a(s,o)}const u=function(e){const n=t.extractOptions(e),i=e.shift(),s=e.pop();return[i,{...n,...t.extractOptions(e)},s]};function a(t,e){let n,i=0;for(;(n=t[i])&&n.priority>=e.priority;)i+=1;if(t.splice(i,0,e),up.framework.booted)if(0===e.priority)for(let t of up.layer.stack)h(t.element,{layer:t,compilers:[e]});else up.puts("up.compiler()","Compiler %s was registered after booting Unpoly. Compiler will run for future fragments only.",e.selector);return e}function h(t,e){up.emit(t,"up:fragment:compile",{log:!1});let n=e.compilers||r.concat(s);new up.CompilerPass(t,n,e).run()}function c(t=document.head){return t.querySelectorAll(n.selector("assetSelectors"))}function l(t){t.type="up-disabled-script"}return up.on("up:framework:reset",(function(){s=t.filter(s,"isDefault"),r=t.filter(r,"isDefault")})),{config:n,compiler:function(...t){o(t)},macro:function(...t){o(t,{macro:!0})},attrCompiler:function(...t){let[n,i,s]=u(t);o([`[${n}]`,i,t=>{let r=e.booleanOrStringAttr(t,n,i.defaultValue);if(r)return s(t,r)}])},destructor:function(e,n){let i=e.upDestructors;i||(i=[],e.upDestructors=i,e.classList.add("up-can-clean")),t.isArray(n)?i.push(...n):i.push(n)},hello:function(t,e={}){return t=up.fragment.get(t,e),up.puts("up.hello()","Compiling fragment %o",t),h(t,e),up.fragment.emitInserted(t),t},clean:function(t,e={}){new up.DestructorPass(t,e).run()},data:function(e){return e=up.fragment.get(e),e.upData||=function(e){if(!e.getAttribute)return{};let n,i=e.getAttribute("up-data");return i&&(n=JSON.parse(i),!t.isOptions(n))?n:{...e.dataset,...n,...e.upCompileData}}(e)},findAssets:c,assertAssetsOK:function(e,n){let i=c();t.map(i,"outerHTML").join()!==t.map(e,"outerHTML").join()&&up.event.assertEmitted("up:assets:changed",{oldAssets:i,newAssets:e,renderOptions:n})},disableSubtree:function(i){let s=n.selector("scriptSelectors");t.each(e.subtree(i,s),l)}}}(),up.compiler=up.script.compiler,up.destructor=up.script.destructor,up.macro=up.script.macro,up.data=up.script.data,up.hello=up.script.hello,up.attribute=up.script.attrCompiler},7924:()=>{up.util=function(){function t(){}function e(t,e){e=L(e,{host:"cross-domain"});const n=o(t);let i="";"cross-domain"===e.host&&(e.host=r(n)),e.host&&(i+=n.protocol+"//"+n.host);let{pathname:s}=n;return!1===e.trailingSlash&&"/"!==s&&(s=s.replace(/\/$/,"")),i+=s,!1!==e.search&&(i+=n.search),!1!==e.hash&&(i+=n.hash),i}function n(t,n){if(t)return e(t,{hash:!1,trailingSlash:!1,...n})}const i=location.protocol,s=location.hostname;function r(t){if(w(t)&&-1===t.indexOf("//"))return!1;const e=o(t);return s!==e.hostname||i!==e.protocol}function o(t){if(t.pathname)return t;let e=document.createElement("a");return e.href=t,e}function u(t){return w(t)?e=>e[t]:t}function a(t,e){if(0===t.length)return[];e=u(e);let n=[],i=0;for(let s of t)n.push(e(s,i++));return n}function h(t,e){let n=0;for(let i of t)e(i,n++)}function c(t){return null===t}function l(t){return void 0===t}const p=Z(l);function f(t){return l(t)||c(t)}const d=Z(f);function m(t){return!!f(t)||(_(t)&&t[m.key]?t[m.key]():w(t)||O(t)?0===t.length:!!v(t)&&0===Object.keys(t).length)}m.key="up.util.isBlank";const g=Z(m);function y(t){return"function"==typeof t}function w(t){return"string"==typeof t||t instanceof String}function b(t){return"number"==typeof t||t instanceof Number}function v(t){return"object"==typeof t&&!c(t)&&(l(t.constructor)||t.constructor===Object)}function _(t){const e=typeof t;return"object"===e&&!c(t)||"function"===e}function k(t){return t instanceof Element}function S(t){return t instanceof RegExp}function x(t){return up.browser.canJQuery()&&t instanceof jQuery}const{isArray:E}=Array;function O(t){return E(t)||function(t){return t instanceof NodeList}(t)||function(t){return"[object Arguments]"===Object.prototype.toString.call(t)}(t)||x(t)||function(t){return t instanceof HTMLCollection}(t)}function C(t){return O(t)?t:f(t)?[]:[t]}function F(t){return _(t)&&t[F.key]?t=t[F.key]():O(t)?t=T(t):v(t)&&(t=Object.assign({},t)),t}function T(t){return Array.prototype.slice.call(t)}function R(...t){return Object.assign({},...t)}function L(t,e){return e?R(e,t):t?F(t):{}}function A(t,e){e=u(e);let n=0;for(let i of t){const t=e(i,n++);if(t)return t}}function P(t,e){e=u(e);let n=!0,i=0;for(let s of t)if(!e(s,i++)){n=!1;break}return n}function $(t){return D(t,d)}function D(t,e){e=u(e);const n=[];return h(t,(function(t,i){if(e(t,i))return n.push(t)})),n}function M(t){return t[t.length-1]}function H(t,e){return(t.indexOf||Array.prototype.indexOf).call(t,e)>=0}function N(t,e){const n={};for(let i of e)i in t&&(n[i]=t[i]);return n}function j(t,e){e=u(e);const n={};for(let i in t)e(t[i],i,t)&&(n[i]=t[i]);return n}function q(t,...e){return y(t)?t(...e):t}F.key="up.util.copy",Date.prototype[F.key]=function(){return new Date(+this)};const B={"&":"&","<":"<",">":">",'"':""","'":"'"};function U(t,e){const n=t[e];return delete t[e],n}function z(t,e){if(e(M(t)))return t.pop()}function I(t){return z(t,v)||{}}function K(t){return t}function V(t){const e=[];for(let n of t)O(n)?e.push(...n):e.push(n);return e}function X(t,e){if(t?.valueOf&&(t=t.valueOf()),e?.valueOf&&(e=e.valueOf()),typeof t!=typeof e)return!1;if(O(t)&&O(e))return W(t,e);if(_(t)&&t[X.key])return t[X.key](e);if(v(t)&&v(e)){const n=Object.keys(t);return!!W(n,Object.keys(e))&&P(n,(n=>X(t[n],e[n])))}return t===e}function W(t,e){return t.length===e.length&&P(t,((t,n)=>X(t,e[n])))}X.key="up.util.isEqual";const J={"space/or":/\s+(?:or\s+)?/,or:/\s+or\s+/,comma:/\s*,\s*/};let G=0;function Q(t,e="%o"){let n;if("%c"===e)return"";if("%s"===e&&d(t)&&(t=t.toString()),w(t))n=t.trim().replace(/[\n\r\t ]+/g," "),"%o"===e&&(n=JSON.stringify(n));else if(l(t))n="undefined";else if(b(t)||y(t))n=t.toString();else if(E(t))n=`[${a(t,Q).join(", ")}]`;else if(x(t))n=`$(${a(t,Q).join(", ")})`;else if(k(t)){n=`<${t.tagName.toLowerCase()}`;for(let e of["id","up-id","name","class"]){let i=t.getAttribute(e);i&&(n+=` ${e}="${i}"`)}n+=">"}else if(S(t)||t instanceof Error)n=t.toString();else try{n=JSON.stringify(t)}catch(t){if("TypeError"!==t.name)throw t;n="(circular structure)"}return n.length>200&&(n=`${n.substr(0,200)}…${M(n)}`),n}const Y=/%[oOdisfc]/g;function Z(t){return function(...e){return!t(...e)}}function tt(t){if(t.error)throw t.error;return t.value}function et(t,e,n){try{return{value:t.apply(e,n)}}catch(t){return{error:t}}}return{parseURL:o,normalizeURL:e,matchableURL:n,matchableURLPatternAtom:function(t){return t.endsWith("/")?[t,t.slice(0,-1)]:t.includes("/?")?[t,t.replace("/?","?")]:t.endsWith("/*")?[t,t.slice(0,-2),t.slice(0,-2)+"?*"]:t},matchURLs:function(t,e,i){return n(t,i)===n(e,i)},normalizeMethod:function(t){return t?t.toUpperCase():"GET"},methodAllowsPayload:function(t){return"GET"!==t&&"HEAD"!==t},copy:F,merge:R,mergeDefined:function(...t){const e={};for(let n of t)if(n)for(let t in n){const i=n[t];p(i)&&(e[t]=i)}return e},options:L,parseArgIntoOptions:function(t,e){let n=I(t);return p(t[0])&&(n=F(n),n[e]=t[0]),n},each:h,map:a,flatMap:function(t,e){return V(a(t,e))},mapObject:function(t,e){return a(t,e).reduce((function(t,e){return t[e[0]]=e[1],t}),{})},findResult:A,some:function(t,e){return!!A(t,e)},every:P,find:function(t,e){let n;e=u(e);for(let i of t)if(e(i)){n=i;break}return n},filter:D,reject:function(t,e){return D(t,e=Z(u(e)))},intersect:function(t,e){return D(t,(t=>H(e,t)))},compact:$,compactObject:function(t){return j(t,d)},uniq:function(t){return t.length<2?t:Array.from(new Set(t))},uniqBy:function(t,e){if(t.length<2)return t;e=u(e);const n=new Set;return D(t,(function(t,i){const s=e(t,i);return!n.has(s)&&(n.add(s),!0)}))},last:M,isNull:c,isDefined:p,isUndefined:l,isGiven:d,isMissing:f,isPresent:g,isBlank:m,presence:function(t,e=g){if(e(t))return t},isObject:_,isFunction:y,isString:w,isBoolean:function(t){return"boolean"==typeof t||t instanceof Boolean},isNumber:b,isElement:k,isJQuery:x,isElementish:function(t){return!(!t||!t.addEventListener&&!t[0]?.addEventListener)},isPromise:function(t){return _(t)&&y(t.then)},isOptions:v,isArray:E,isFormData:function(t){return t instanceof FormData},isList:O,isRegExp:S,timer:function(t,e){return setTimeout(e,t)},contains:H,containsAll:function(t,e){return P(e,(e=>H(t,e)))},objectContains:function(t,e){return X(e,N(t,Object.keys(e)))},toArray:function(t){return E(t)?t:T(t)},pick:N,pickBy:j,omit:function(t,e){return j(t,((t,n)=>!H(e,n)))},unresolvablePromise:function(){return new Promise(t)},remove:function(t,e){const n=t.indexOf(e);if(n>=0)return t.splice(n,1),e},memoize:function(t){let e,n;return function(...i){return n?e:(n=!0,e=t.apply(this,i))}},pluckKey:U,renameKey:function(t,e,n){return t[n]=U(t,e)},extractOptions:I,extractCallback:function(t){return z(t,y)},noop:t,asyncNoop:function(){return Promise.resolve()},identity:K,escapeHTML:function(t){return t.replace(/[&<>"']/g,(t=>B[t]))},escapeRegExp:function(t){return t.replace(/[\\^$*+?.()|[\]{}]/g,"\\$&")},sequence:function(t){return t=$(t),(...e)=>a(t,(t=>t(...e)))},evalOption:q,evalAutoOption:function(t,e,...n){return"auto"===(t=q(t,...n))&&(t=q(e,...n)),t},flatten:V,newDeferred:function(){let t,e;const n=new Promise((function(n,i){t=n,e=i}));return n.resolve=t,n.reject=e,n},always:function(t,e=K){return t.then(e,e)},isBasicObjectProperty:function(t){return Object.prototype.hasOwnProperty(t)},isCrossOrigin:r,task:function(t){return setTimeout(t)},isEqual:X,parseTokens:function(t,e={}){if(w(t)){if(t=t.trim(),e.json&&/^\[.*]$/.test(t))return JSON.parse(t);{let n=e.separator||"space/or",i=J[n];return t.split(i)}}return C(t)},wrapList:C,wrapValue:function(t,...e){return e[0]instanceof t?e[0]:new t(...e)},uid:function(){return G++},upperCaseFirst:function(t){return t[0].toUpperCase()+t.slice(1)},lowerCaseFirst:function(t){return t[0].toLowerCase()+t.slice(1)},delegate:function(t,e,n){for(let i of e)Object.defineProperty(t,i,{get(){const t=n.call(this);let e=t[i];return y(e)&&(e=e.bind(t)),e},set(t){n.call(this)[i]=t}})},reverse:function(t){return F(t).reverse()},camelToKebabCase:function(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))},replaceValue:function(t,e,n){return t===e?n:t},sprintf:function(t,...e){return t.replace(Y,(t=>Q(e.shift(),t)))},renameKeys:function(t,e){const n={};for(let i in t)n[e(i)]=t[i];return n},memoizeMethod:function(t,e){for(let n in e){let e=Object.getOwnPropertyDescriptor(t,n).value,i=function(...t){let i=this[`__${n}MemoizeCache`]||={},s=JSON.stringify(t);return i[s]||=et(e,this,t),tt(i[s])};t[n]=i}},safeStringifyJSON:function(t){return JSON.stringify(t).replace(/[^\x00-\x7F]/g,(t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0")))},variant:function(t,e={}){let n=Object.create(t);return Object.assign(n,e),n}}}()},4606:(t,e,n)=>{n(5074),up.viewport=function(){const t=up.util,e=up.element,n=up.fragment,i=new up.Config((()=>({viewportSelectors:["[up-viewport]","[up-fixed]"],fixedTopSelectors:["[up-fixed~=top]"],fixedBottomSelectors:["[up-fixed~=bottom]"],anchoredRightSelectors:["[up-anchored~=right]","[up-fixed~=top]","[up-fixed~=bottom]","[up-fixed~=right]"],revealSnap:200,revealPadding:0,revealTop:!1,revealMax:()=>.5*window.innerHeight,autoFocusVisible:({element:t,inputDevice:e})=>"key"===e||up.form.isField(t)}))),s=new up.BodyShifter;function r(e,i){return i=t.options(i),e=n.get(e,i),(i.layer=up.layer.get(e))||up.fail("Cannot reveal a detached element"),i.peel&&i.layer.peel(),new up.RevealMotion(e,i).start(),up.migrate.formerlyAsync?.("up.reveal()")||!0}function o(e,{preventScroll:n,force:s,inputDevice:o,focusVisible:a}={}){if(s&&(e.hasAttribute("tabindex")||-1!==e.tabIndex||e.setAttribute("tabindex","-1")),o??=up.event.inputDevice,a??="auto",a=t.evalAutoOption(a,i.autoFocusVisible,{element:e,inputDevice:o}),e.focus({preventScroll:!0,focusVisible:a}),u(e),e.classList.add(a?"up-focus-visible":"up-focus-hidden"),!n)return r(e)}function u(t){t?.classList.remove("up-focus-hidden","up-focus-visible")}function a(t=location.hash,e){let n=y(t,e);if(n)return up.reveal(n,{top:!0})}function h(){return[p().tagName,...i.viewportSelectors].join()}function c(t,e={}){return n.get(t,e).closest(h())}function l(t,i={}){return t=n.get(t,i),e.around(t,h())}function p(){return document.scrollingElement}function f(){return e.root.clientWidth}function d(t){return up.fragment.tryToTarget(t)}function m(e){const i=t.copy(t.extractOptions(e));let s;return i.layer=up.layer.get(i),s=e[0]?[c(e[0],i)]:i.around?l(i.around,i):function(t={}){return n.all(h(),t)}(i),[s,i]}function g(t,e){for(let n of t){const t=d(n);n.scrollTop=e[t]||0}}function y(t,i={}){if(s=t,t=s?.replace(/^#/,"")){const s=[e.attrSelector("id",t),"a"+e.attrSelector("name",t)].join();return n.get(s,i)}var s}up.compiler(i.selectorFn("anchoredRightSelectors"),(function(t){return s.onAnchoredElementInserted(t)})),up.on("focusin",(function({relatedTarget:t}){u(t)}));const w=["selectionStart","selectionEnd","scrollLeft","scrollTop"];let b=!1;return up.on("scroll",{once:!0,beforeBoot:!0},(()=>b=!0)),up.on("up:framework:boot",(function(){t.task((function(){if(!b)return a()}))})),up.on(window,"hashchange",(()=>a())),{reveal:r,revealHash:a,firstHashTarget:y,config:i,get:c,subtree:function(t,i={}){return t=n.get(t,i),e.subtree(t,h())},around:l,get root(){return p()},rootWidth:f,rootHeight:function(){return e.root.clientHeight},isRoot:function(t){return t===p()},rootScrollbarWidth:function(){return window.innerWidth-f()},saveScroll:function(...t){const[e,n]=m(t),i=n.location||n.layer.location;if(i){const t=function(t){let e={};for(let n of t){let t=d(n);t?e[t]=n.scrollTop:up.warn("up.viewport.saveScroll()","Cannot save scroll positions for untargetable viewport %o",n)}return e}(e);n.layer.lastScrollTops.set(i,t)}},restoreScroll:function(...t){const[e,n]=m(t),{location:i}=n.layer,s=n.layer.lastScrollTops.get(i);return!!s&&(g(e,s),up.puts("up.viewport.restoreScroll()","Restored scroll positions to %o",s),!0)},resetScroll:function(...t){const[e,n]=m(t);g(e,{})},saveFocus:function(t={}){const e=up.layer.get(t),n=t.location||e.location;if(n){const t=up.FocusCapsule.preserve(e);e.lastFocusCapsules.set(n,t)}},restoreFocus:function(t={}){const e=up.layer.get(t),n=t.location||e.location,i=t.layer.lastFocusCapsules.get(n);return!(!i||!i.restore(e)||(up.puts("up.viewport.restoreFocus()",'Restored focus to "%s"',i.target),0))},absolutize:function(n,s={}){const r=c(n).getBoundingClientRect(),o=n.getBoundingClientRect(),u=new up.Rect({left:o.left-r.left,top:o.top-r.top,width:o.width,height:o.height});s.afterMeasure?.(),e.setStyle(n,{position:"static"===n.style.position?"static":"relative",top:"auto",right:"auto",bottom:"auto",left:"auto",width:"100%",height:"100%"});const a=e.createFromSelector("up-bounds");e.insertBefore(n,a),a.appendChild(n);const h=function(t,n){return u.left+=t,u.top+=n,e.setStyle(a,u,"px")};h(0,0);const l=n.getBoundingClientRect();return h(o.left-l.left,o.top-l.top),t.each(function(t=document){const e=["[up-fixed]"].concat(i.fixedTopSelectors).concat(i.fixedBottomSelectors);return t.querySelectorAll(e.join())}(n),e.fixedToAbsolute),{bounds:a,moveBounds:h}},focus:o,tryFocus:function(t,e){return o(t,e),t===document.activeElement},newStateCache:function(){return new up.FIFOCache({capacity:30,normalizeKey:t.matchableURL})},focusedElementWithin:function(t){const e=document.activeElement;if(up.fragment.contains(t,e))return e},copyCursorProps:function(t,e={}){for(let n of w)try{e[n]=t[n]}catch(t){}return e},bodyShifter:s}}(),up.focus=up.viewport.focus,up.reveal=up.viewport.reveal},3507:()=>{window.up={version:"3.9.3"}}},e={};function n(i){var s=e[i];if(void 0!==s)return s.exports;var r=e[i]={exports:{}};return t[i](r,r.exports,n),r.exports}n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"cu",{value:!0})},n(3507),n(8374),n(7924),n(3924),n(6535),n(2811),n(9675),n(376),n(8272),n(4366),n(8010),n(4861),n(3469),n(4504),n(2406),n(3742),n(1653),n(1104),n(5949),n(1279),n(6346),n(3030),n(7948),n(2714),n(1752),n(8228),n(7050),n(9441),n(9489),n(7422),n(2200),n(278),n(9005),n(1569),n(2737),n(3635),n(1906),n(4158),n(3139),n(2214),n(5240),n(665),n(2828),n(2587),n(7031),n(8057),n(4850),n(7956),n(7403),n(6412),n(7965),n(7771),n(86),n(4552),n(5580),n(7101),n(6066),n(6387),n(5390),n(2460),n(7792),n(4308),n(8665),n(3645),n(7782),n(2705),n(606),n(5437),n(7974),n(6413),n(5221),n(2298),n(4517),n(7241),n(2723),n(8720),n(7885),n(4818),n(9634),n(8670),n(3535),n(4453),n(1897),n(8944),n(2667),n(4606),n(4034),n(1647),n(9443),n(3849),n(2851),n(454),n(9615),n(6774),up.framework.onEvaled()})();
|