/*! Retype v4.2.0 | retype.com | Copyright 2026. Retype, Inc. All rights reserved. */
(()=>{var e={89(e,t,n){"use strict";n.d(t,{Su:()=>Mt,YR:()=>Tt,dZ:()=>Et,gM:()=>_t});const r="eager",o="lazy";class i extends HTMLElement{static delegateConstructor=void 0;loaded=Promise.resolve();static get observedAttributes(){return["disabled","loading","src"]}constructor(){super(),this.delegate=new i.delegateConstructor(this)}connectedCallback(){this.delegate.connect()}disconnectedCallback(){this.delegate.disconnect()}reload(){return this.delegate.sourceURLReloaded()}attributeChangedCallback(e){"loading"==e?this.delegate.loadingStyleChanged():"src"==e?this.delegate.sourceURLChanged():"disabled"==e&&this.delegate.disabledChanged()}get src(){return this.getAttribute("src")}set src(e){e?this.setAttribute("src",e):this.removeAttribute("src")}get refresh(){return this.getAttribute("refresh")}set refresh(e){e?this.setAttribute("refresh",e):this.removeAttribute("refresh")}get shouldReloadWithMorph(){return this.src&&"morph"===this.refresh}get loading(){return function(e){if("lazy"===e.toLowerCase())return o;return r}(this.getAttribute("loading")||"")}set loading(e){e?this.setAttribute("loading",e):this.removeAttribute("loading")}get disabled(){return this.hasAttribute("disabled")}set disabled(e){e?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get autoscroll(){return this.hasAttribute("autoscroll")}set autoscroll(e){e?this.setAttribute("autoscroll",""):this.removeAttribute("autoscroll")}get complete(){return!this.delegate.isLoading}get isActive(){return this.ownerDocument===document&&!this.isPreview}get isPreview(){return this.ownerDocument?.documentElement?.hasAttribute("data-turbo-preview")}}const s={enabled:!0,progressBarDelay:500,unvisitableExtensions:new Set([".7z",".aac",".apk",".avi",".bmp",".bz2",".css",".csv",".deb",".dmg",".doc",".docx",".exe",".gif",".gz",".heic",".heif",".ico",".iso",".jpeg",".jpg",".js",".json",".m4a",".mkv",".mov",".mp3",".mp4",".mpeg",".mpg",".msi",".ogg",".ogv",".pdf",".pkg",".png",".ppt",".pptx",".rar",".rtf",".svg",".tar",".tif",".tiff",".txt",".wav",".webm",".webp",".wma",".wmv",".xls",".xlsx",".xml",".zip"])};function a(e){if("false"==e.getAttribute("data-turbo-eval"))return e;{const t=document.createElement("script"),n=E();return n&&(t.nonce=n),t.textContent=e.textContent,t.async=!1,function(e,t){for(const{name:n,value:r}of t.attributes)e.setAttribute(n,r)}(t,e),t}}function l(e,{target:t,cancelable:n,detail:r}={}){const o=new CustomEvent(e,{cancelable:n,bubbles:!0,composed:!0,detail:r});return t&&t.isConnected?t.dispatchEvent(o):document.documentElement.dispatchEvent(o),o}function c(e){e.preventDefault(),e.stopImmediatePropagation()}function u(){return"hidden"===document.visibilityState?h():d()}function d(){return new Promise(e=>requestAnimationFrame(()=>e()))}function h(){return new Promise(e=>setTimeout(()=>e(),0))}function f(e=""){return(new DOMParser).parseFromString(e,"text/html")}function p(e,...t){const n=function(e,t){return e.reduce((e,n,r)=>e+n+(null==t[r]?"":t[r]),"")}(e,t).replace(/^\n/,"").split("\n"),r=n[0].match(/^\s+/),o=r?r[0].length:0;return n.map(e=>e.slice(o)).join("\n")}function m(){return Array.from({length:36}).map((e,t)=>8==t||13==t||18==t||23==t?"-":14==t?"4":19==t?(Math.floor(4*Math.random())+8).toString(16):Math.floor(16*Math.random()).toString(16)).join("")}function v(e,...t){for(const n of t.map(t=>t?.getAttribute(e)))if("string"==typeof n)return n;return null}function g(...e){for(const t of e)"turbo-frame"==t.localName&&t.setAttribute("busy",""),t.setAttribute("aria-busy","true")}function b(...e){for(const t of e)"turbo-frame"==t.localName&&t.removeAttribute("busy"),t.removeAttribute("aria-busy")}function y(e,t=2e3){return new Promise(n=>{const r=()=>{e.removeEventListener("error",r),e.removeEventListener("load",r),n()};e.addEventListener("load",r,{once:!0}),e.addEventListener("error",r,{once:!0}),setTimeout(n,t)})}function w(e){switch(e){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}function S(...e){const t=v("data-turbo-action",...e);return function(e){return"advance"==e||"replace"==e||"restore"==e}(t)?t:null}function x(e){return document.querySelector(`meta[name="${e}"]`)}function k(e){const t=x(e);return t&&t.content}function E(){const e=x("csp-nonce");if(e){const{nonce:t,content:n}=e;return""==t?n:t}}function C(e,t){if(e instanceof Element)return e.closest(t)||C(e.assignedSlot||e.getRootNode()?.host,t)}function _(e){return!!e&&null==e.closest("[inert], :disabled, [hidden], details:not([open]), dialog:not([open])")&&"function"==typeof e.focus}function A(e){return Array.from(e.querySelectorAll("[autofocus]")).find(_)}function T(e){if("_blank"===e)return!1;if(e){for(const t of document.getElementsByName(e))if(t instanceof HTMLIFrameElement)return!1;return!0}return!0}function L(e){const t=C(e,"a[href], a[xlink\\:href]");if(!t)return null;if(t.href.startsWith("#"))return null;if(t.hasAttribute("download"))return null;const n=t.getAttribute("target");return n&&"_self"!==n?null:t}const R={"aria-disabled":{beforeSubmit:e=>{e.setAttribute("aria-disabled","true"),e.addEventListener("click",c)},afterSubmit:e=>{e.removeAttribute("aria-disabled"),e.removeEventListener("click",c)}},disabled:{beforeSubmit:e=>e.disabled=!0,afterSubmit:e=>e.disabled=!1}};const M=new class{#e=null;constructor(e){Object.assign(this,e)}get submitter(){return this.#e}set submitter(e){this.#e=R[e]||e}}({mode:"on",submitter:"disabled"}),I={drive:s,forms:M};function O(e){return new URL(e.toString(),document.baseURI)}function D(e){let t;return e.hash?e.hash.slice(1):(t=e.href.match(/#(.*)$/))?t[1]:void 0}function P(e,t){return O(t?.getAttribute("formaction")||e.getAttribute("action")||e.action)}function N(e){return(function(e){return function(e){return e.pathname.split("/").slice(1)}(e).slice(-1)[0]}(e).match(/\.[^.]*$/)||[])[0]||""}function F(e,t){return function(e,t){const n=V(t.origin+t.pathname);return V(e.href)===n||e.href.startsWith(n)}(e,t)&&!I.drive.unvisitableExtensions.has(N(e))}function B(e){return O(e.getAttribute("href")||"")}function W(e){return function(e){const t=D(e);return null!=t?e.href.slice(0,-(t.length+1)):e.href}(e)}function H(e,t){return O(e).href==O(t).href}function V(e){return e.endsWith("/")?e:e+"/"}class q{constructor(e){this.response=e}get succeeded(){return this.response.ok}get failed(){return!this.succeeded}get clientError(){return this.statusCode>=400&&this.statusCode<=499}get serverError(){return this.statusCode>=500&&this.statusCode<=599}get redirected(){return this.response.redirected}get location(){return O(this.response.url)}get isHTML(){return this.contentType&&this.contentType.match(/^(?:text\/([^\s;,]+\b)?html|application\/xhtml\+xml)\b/)}get statusCode(){return this.response.status}get contentType(){return this.header("Content-Type")}get responseText(){return this.response.clone().text()}get responseHTML(){return this.isHTML?this.response.clone().text():Promise.resolve(void 0)}header(e){return this.response.headers.get(e)}}class j extends Set{constructor(e){super(),this.maxSize=e}add(e){if(this.size>=this.maxSize){const e=this.values().next().value;this.delete(e)}super.add(e)}}const z=new j(20);function $(e,t={}){const n=new Headers(t.headers||{}),r=m();return z.add(r),n.append("X-Turbo-Request-Id",r),window.fetch(e,{...t,headers:n})}function X(e){switch(e.toLowerCase()){case"get":return K.get;case"post":return K.post;case"put":return K.put;case"patch":return K.patch;case"delete":return K.delete}}const K={get:"get",post:"post",put:"put",patch:"patch",delete:"delete"};const U={urlEncoded:"application/x-www-form-urlencoded",multipart:"multipart/form-data",plain:"text/plain"};class G{abortController=new AbortController;#t=e=>{};constructor(e,t,n,r=new URLSearchParams,o=null,i=U.urlEncoded){const[s,a]=Y(O(n),t,r,i);this.delegate=e,this.url=s,this.target=o,this.fetchOptions={credentials:"same-origin",redirect:"follow",method:t.toUpperCase(),headers:{...this.defaultHeaders},body:a,signal:this.abortSignal,referrer:this.delegate.referrer?.href},this.enctype=i}get method(){return this.fetchOptions.method}set method(e){const t=this.isSafe?this.url.searchParams:this.fetchOptions.body||new FormData,n=X(e)||K.get;this.url.search="";const[r,o]=Y(this.url,n,t,this.enctype);this.url=r,this.fetchOptions.body=o,this.fetchOptions.method=n.toUpperCase()}get headers(){return this.fetchOptions.headers}set headers(e){this.fetchOptions.headers=e}get body(){return this.isSafe?this.url.searchParams:this.fetchOptions.body}set body(e){this.fetchOptions.body=e}get location(){return this.url}get params(){return this.url.searchParams}get entries(){return this.body?Array.from(this.body.entries()):[]}cancel(){this.abortController.abort()}async perform(){const{fetchOptions:e}=this;this.delegate.prepareRequest(this);const t=await this.#n(e);try{this.delegate.requestStarted(this),t.detail.fetchRequest?this.response=t.detail.fetchRequest.response:this.response=$(this.url.href,e);const n=await this.response;return await this.receive(n)}catch(n){if("AbortError"!==n.name)throw this.#r(n)&&this.delegate.requestErrored(this,n),n}finally{this.delegate.requestFinished(this)}}async receive(e){const t=new q(e);return l("turbo:before-fetch-response",{cancelable:!0,detail:{fetchResponse:t},target:this.target}).defaultPrevented?this.delegate.requestPreventedHandlingResponse(this,t):t.succeeded?this.delegate.requestSucceededWithResponse(this,t):this.delegate.requestFailedWithResponse(this,t),t}get defaultHeaders(){return{Accept:"text/html, application/xhtml+xml"}}get isSafe(){return Q(this.method)}get abortSignal(){return this.abortController.signal}acceptResponseType(e){this.headers.Accept=[e,this.headers.Accept].join(", ")}async#n(e){const t=new Promise(e=>this.#t=e),n=l("turbo:before-fetch-request",{cancelable:!0,detail:{fetchOptions:e,url:this.url,resume:this.#t},target:this.target});return this.url=n.detail.url,n.defaultPrevented&&await t,n}#r(e){return!l("turbo:fetch-request-error",{target:this.target,cancelable:!0,detail:{request:this,error:e}}).defaultPrevented}}function Q(e){return X(e)==K.get}function Y(e,t,n,r){const o=Array.from(n).length>0?new URLSearchParams(J(n)):e.searchParams;return Q(t)?[Z(e,o),null]:r==U.urlEncoded?[e,o]:[e,n]}function J(e){const t=[];for(const[n,r]of e)r instanceof File||t.push([n,r]);return t}function Z(e,t){const n=new URLSearchParams(J(t));return e.search=n.toString(),e}class ee{started=!1;constructor(e,t){this.delegate=e,this.element=t,this.intersectionObserver=new IntersectionObserver(this.intersect)}start(){this.started||(this.started=!0,this.intersectionObserver.observe(this.element))}stop(){this.started&&(this.started=!1,this.intersectionObserver.unobserve(this.element))}intersect=e=>{const t=e.slice(-1)[0];t?.isIntersecting&&this.delegate.elementAppearedInViewport(this.element)}}class te{static contentType="text/vnd.turbo-stream.html";static wrap(e){return"string"==typeof e?new this(function(e){const t=document.createElement("template");return t.innerHTML=e,t.content}(e)):e}constructor(e){this.fragment=function(e){for(const t of e.querySelectorAll("turbo-stream")){const e=document.importNode(t,!0);for(const t of e.templateElement.content.querySelectorAll("script"))t.replaceWith(a(t));t.replaceWith(e)}return e}(e)}}const ne=e=>e;class re{keys=[];entries={};#o;constructor(e,t=ne){this.size=e,this.#o=t}has(e){return this.#o(e)in this.entries}get(e){if(this.has(e)){const t=this.read(e);return this.touch(e),t}}put(e,t){return this.write(e,t),this.touch(e),t}clear(){for(const e of Object.keys(this.entries))this.evict(e)}read(e){return this.entries[this.#o(e)]}write(e,t){this.entries[this.#o(e)]=t}touch(e){e=this.#o(e);const t=this.keys.indexOf(e);t>-1&&this.keys.splice(t,1),this.keys.unshift(e),this.trim()}trim(){for(const e of this.keys.splice(this.size))this.evict(e)}evict(e){delete this.entries[e]}}const oe=1e4,ie=new class extends re{#i=null;#s={};constructor(e=1,t=100){super(e,W),this.prefetchDelay=t}putLater(e,t,n){this.#i=setTimeout(()=>{t.perform(),this.put(e,t,n),this.#i=null},this.prefetchDelay)}put(e,t,n=oe){super.put(e,t),this.#s[W(e)]=new Date((new Date).getTime()+n)}clear(){super.clear(),this.#i&&clearTimeout(this.#i)}evict(e){super.evict(e),delete this.#s[e]}has(e){if(super.has(e)){const t=this.#s[W(e)];return t&&t>Date.now()}return!1}},se={initialized:"initialized",requesting:"requesting",waiting:"waiting",receiving:"receiving",stopping:"stopping",stopped:"stopped"};class ae{state=se.initialized;static confirmMethod(e){return Promise.resolve(confirm(e))}constructor(e,t,n,r=!1){const o=function(e,t){const n=t?.getAttribute("formmethod")||e.getAttribute("method")||"";return X(n.toLowerCase())||K.get}(t,n),i=function(e,t){const n=O(e);Q(t)&&(n.search="");return n}(function(e,t){const n="string"==typeof e.action?e.action:null;return t?.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||n||""}(t,n),o),s=function(e,t){const n=new FormData(e),r=t?.getAttribute("name"),o=t?.getAttribute("value");r&&n.append(r,o||"");return n}(t,n),a=function(e,t){return function(e){switch(e.toLowerCase()){case U.multipart:return U.multipart;case U.plain:return U.plain;default:return U.urlEncoded}}(t?.getAttribute("formenctype")||e.enctype)}(t,n);this.delegate=e,this.formElement=t,this.submitter=n,this.fetchRequest=new G(this,o,i,s,t,a),this.mustRedirect=r}get method(){return this.fetchRequest.method}set method(e){this.fetchRequest.method=e}get action(){return this.fetchRequest.url.toString()}set action(e){this.fetchRequest.url=O(e)}get body(){return this.fetchRequest.body}get enctype(){return this.fetchRequest.enctype}get isSafe(){return this.fetchRequest.isSafe}get location(){return this.fetchRequest.url}async start(){const{initialized:e,requesting:t}=se,n=v("data-turbo-confirm",this.submitter,this.formElement);if("string"==typeof n){const e="function"==typeof I.forms.confirm?I.forms.confirm:ae.confirmMethod;if(!await e(n,this.formElement,this.submitter))return}if(this.state==e)return this.state=t,this.fetchRequest.perform()}stop(){const{stopping:e,stopped:t}=se;if(this.state!=e&&this.state!=t)return this.state=e,this.fetchRequest.cancel(),!0}prepareRequest(e){if(!e.isSafe){const t=function(e){if(null!=e){const t=(document.cookie?document.cookie.split("; "):[]).find(t=>t.startsWith(e));if(t){const e=t.split("=").slice(1).join("=");return e?decodeURIComponent(e):void 0}}}(k("csrf-param"))||k("csrf-token");t&&(e.headers["X-CSRF-Token"]=t)}this.requestAcceptsTurboStreamResponse(e)&&e.acceptResponseType(te.contentType)}requestStarted(e){this.state=se.waiting,this.submitter&&I.forms.submitter.beforeSubmit(this.submitter),this.setSubmitsWith(),g(this.formElement),l("turbo:submit-start",{target:this.formElement,detail:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(e,t){ie.clear(),this.result={success:t.succeeded,fetchResponse:t}}requestSucceededWithResponse(e,t){if(t.clientError||t.serverError)this.delegate.formSubmissionFailedWithResponse(this,t);else if(ie.clear(),this.requestMustRedirect(e)&&function(e){return 200==e.statusCode&&!e.redirected}(t)){const e=new Error("Form responses must redirect to another location");this.delegate.formSubmissionErrored(this,e)}else this.state=se.receiving,this.result={success:!0,fetchResponse:t},this.delegate.formSubmissionSucceededWithResponse(this,t)}requestFailedWithResponse(e,t){this.result={success:!1,fetchResponse:t},this.delegate.formSubmissionFailedWithResponse(this,t)}requestErrored(e,t){this.result={success:!1,error:t},this.delegate.formSubmissionErrored(this,t)}requestFinished(e){this.state=se.stopped,this.submitter&&I.forms.submitter.afterSubmit(this.submitter),this.resetSubmitterText(),b(this.formElement),l("turbo:submit-end",{target:this.formElement,detail:{formSubmission:this,...this.result}}),this.delegate.formSubmissionFinished(this)}setSubmitsWith(){if(this.submitter&&this.submitsWith)if(this.submitter.matches("button"))this.originalSubmitText=this.submitter.innerHTML,this.submitter.innerHTML=this.submitsWith;else if(this.submitter.matches("input")){const e=this.submitter;this.originalSubmitText=e.value,e.value=this.submitsWith}}resetSubmitterText(){if(this.submitter&&this.originalSubmitText)if(this.submitter.matches("button"))this.submitter.innerHTML=this.originalSubmitText;else if(this.submitter.matches("input")){this.submitter.value=this.originalSubmitText}}requestMustRedirect(e){return!e.isSafe&&this.mustRedirect}requestAcceptsTurboStreamResponse(e){return!e.isSafe||function(e,...t){return t.some(t=>t&&t.hasAttribute(e))}("data-turbo-stream",this.submitter,this.formElement)}get submitsWith(){return this.submitter?.getAttribute("data-turbo-submits-with")}}class le{constructor(e){this.element=e}get activeElement(){return this.element.ownerDocument.activeElement}get children(){return[...this.element.children]}hasAnchor(e){return null!=this.getElementForAnchor(e)}getElementForAnchor(e){return e?this.element.querySelector(`[id='${e}'], a[name='${e}']`):null}get isConnected(){return this.element.isConnected}get firstAutofocusableElement(){return A(this.element)}get permanentElements(){return ue(this.element)}getPermanentElementById(e){return ce(this.element,e)}getPermanentElementMapForSnapshot(e){const t={};for(const n of this.permanentElements){const{id:r}=n,o=e.getPermanentElementById(r);o&&(t[r]=[n,o])}return t}}function ce(e,t){return e.querySelector(`#${t}[data-turbo-permanent]`)}function ue(e){return e.querySelectorAll("[id][data-turbo-permanent]")}class de{started=!1;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.addEventListener("submit",this.submitCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("submit",this.submitCaptured,!0),this.started=!1)}submitCaptured=()=>{this.eventTarget.removeEventListener("submit",this.submitBubbled,!1),this.eventTarget.addEventListener("submit",this.submitBubbled,!1)};submitBubbled=e=>{if(!e.defaultPrevented){const t=e.target instanceof HTMLFormElement?e.target:void 0,n=e.submitter||void 0;t&&function(e,t){const n=t?.getAttribute("formmethod")||e.getAttribute("method");return"dialog"!=n}(t,n)&&function(e,t){const n=t?.getAttribute("formtarget")||e.getAttribute("target");return T(n)}(t,n)&&this.delegate.willSubmitForm(t,n)&&(e.preventDefault(),e.stopImmediatePropagation(),this.delegate.formSubmitted(t,n))}}}class he{#a=e=>{};#l=e=>{};constructor(e,t){this.delegate=e,this.element=t}scrollToAnchor(e){const t=this.snapshot.getElementForAnchor(e);t?(this.focusElement(t),this.scrollToElement(t)):this.scrollToPosition({x:0,y:0})}scrollToAnchorFromLocation(e){this.scrollToAnchor(D(e))}scrollToElement(e){e.scrollIntoView()}focusElement(e){e instanceof HTMLElement&&(e.hasAttribute("tabindex")?e.focus():(e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")))}scrollToPosition({x:e,y:t}){this.scrollRoot.scrollTo(e,t)}scrollToTop(){this.scrollToPosition({x:0,y:0})}get scrollRoot(){return window}async render(e){const{isPreview:t,shouldRender:n,willRender:r,newSnapshot:o}=e,i=r;if(n)try{this.renderPromise=new Promise(e=>this.#a=e),this.renderer=e,await this.prepareToRenderSnapshot(e);const n=new Promise(e=>this.#l=e),r={resume:this.#l,render:this.renderer.renderElement,renderMethod:this.renderer.renderMethod};this.delegate.allowsImmediateRender(o,r)||await n,await this.renderSnapshot(e),this.delegate.viewRenderedSnapshot(o,t,this.renderer.renderMethod),this.delegate.preloadOnLoadLinksForView(this.element),this.finishRenderingSnapshot(e)}finally{delete this.renderer,this.#a(void 0),delete this.renderPromise}else i&&this.invalidate(e.reloadReason)}invalidate(e){this.delegate.viewInvalidated(e)}async prepareToRenderSnapshot(e){this.markAsPreview(e.isPreview),await e.prepareToRender()}markAsPreview(e){e?this.element.setAttribute("data-turbo-preview",""):this.element.removeAttribute("data-turbo-preview")}markVisitDirection(e){this.element.setAttribute("data-turbo-visit-direction",e)}unmarkVisitDirection(){this.element.removeAttribute("data-turbo-visit-direction")}async renderSnapshot(e){await e.render()}finishRenderingSnapshot(e){e.finishRendering()}}class fe extends he{missing(){this.element.innerHTML='Content missing'}get snapshot(){return new le(this.element)}}class pe{constructor(e,t){this.delegate=e,this.element=t}start(){this.element.addEventListener("click",this.clickBubbled),document.addEventListener("turbo:click",this.linkClicked),document.addEventListener("turbo:before-visit",this.willVisit)}stop(){this.element.removeEventListener("click",this.clickBubbled),document.removeEventListener("turbo:click",this.linkClicked),document.removeEventListener("turbo:before-visit",this.willVisit)}clickBubbled=e=>{this.clickEventIsSignificant(e)?this.clickEvent=e:delete this.clickEvent};linkClicked=e=>{this.clickEvent&&this.clickEventIsSignificant(e)&&this.delegate.shouldInterceptLinkClick(e.target,e.detail.url,e.detail.originalEvent)&&(this.clickEvent.preventDefault(),e.preventDefault(),this.delegate.linkClickIntercepted(e.target,e.detail.url,e.detail.originalEvent)),delete this.clickEvent};willVisit=e=>{delete this.clickEvent};clickEventIsSignificant(e){const t=e.composed?e.target?.parentElement:e.target,n=L(t)||t;return n instanceof Element&&n.closest("turbo-frame, html")==this.element}}class me{started=!1;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.addEventListener("click",this.clickCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("click",this.clickCaptured,!0),this.started=!1)}clickCaptured=()=>{this.eventTarget.removeEventListener("click",this.clickBubbled,!1),this.eventTarget.addEventListener("click",this.clickBubbled,!1)};clickBubbled=e=>{if(e instanceof MouseEvent&&this.clickEventIsSignificant(e)){const t=L(e.composedPath&&e.composedPath()[0]||e.target);if(t&&T(t.target)){const n=B(t);this.delegate.willFollowLinkToLocation(t,n,e)&&(e.preventDefault(),this.delegate.followedLinkToLocation(t,n))}}};clickEventIsSignificant(e){return!(e.target&&e.target.isContentEditable||e.defaultPrevented||e.which>1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)}}class ve{constructor(e,t){this.delegate=e,this.linkInterceptor=new me(this,t)}start(){this.linkInterceptor.start()}stop(){this.linkInterceptor.stop()}canPrefetchRequestToLocation(e,t){return!1}prefetchAndCacheRequestToLocation(e,t){}willFollowLinkToLocation(e,t,n){return this.delegate.willSubmitFormLinkToLocation(e,t,n)&&(e.hasAttribute("data-turbo-method")||e.hasAttribute("data-turbo-stream"))}followedLinkToLocation(e,t){const n=document.createElement("form");for(const[l,c]of t.searchParams)n.append(Object.assign(document.createElement("input"),{type:"hidden",name:l,value:c}));const r=Object.assign(t,{search:""});n.setAttribute("data-turbo","true"),n.setAttribute("action",r.href),n.setAttribute("hidden","");const o=e.getAttribute("data-turbo-method");o&&n.setAttribute("method",o);const i=e.getAttribute("data-turbo-frame");i&&n.setAttribute("data-turbo-frame",i);const s=S(e);s&&n.setAttribute("data-turbo-action",s);const a=e.getAttribute("data-turbo-confirm");a&&n.setAttribute("data-turbo-confirm",a);e.hasAttribute("data-turbo-stream")&&n.setAttribute("data-turbo-stream",""),this.delegate.submittedFormLinkToLocation(e,t,n),document.body.appendChild(n),n.addEventListener("turbo:submit-end",()=>n.remove(),{once:!0}),requestAnimationFrame(()=>n.requestSubmit())}}class ge{static async preservingPermanentElements(e,t,n){const r=new this(e,t);r.enter(),await n(),r.leave()}constructor(e,t){this.delegate=e,this.permanentElementMap=t}enter(){for(const e in this.permanentElementMap){const[t,n]=this.permanentElementMap[e];this.delegate.enteringBardo(t,n),this.replaceNewPermanentElementWithPlaceholder(n)}}leave(){for(const e in this.permanentElementMap){const[t]=this.permanentElementMap[e];this.replaceCurrentPermanentElementWithClone(t),this.replacePlaceholderWithPermanentElement(t),this.delegate.leavingBardo(t)}}replaceNewPermanentElementWithPlaceholder(e){const t=function(e){const t=document.createElement("meta");return t.setAttribute("name","turbo-permanent-placeholder"),t.setAttribute("content",e.id),t}(e);e.replaceWith(t)}replaceCurrentPermanentElementWithClone(e){const t=e.cloneNode(!0);e.replaceWith(t)}replacePlaceholderWithPermanentElement(e){const t=this.getPlaceholderById(e.id);t?.replaceWith(e)}getPlaceholderById(e){return this.placeholders.find(t=>t.content==e)}get placeholders(){return[...document.querySelectorAll("meta[name=turbo-permanent-placeholder][content]")]}}class be{#c=null;static renderElement(e,t){}constructor(e,t,n,r=!0){this.currentSnapshot=e,this.newSnapshot=t,this.isPreview=n,this.willRender=r,this.renderElement=this.constructor.renderElement,this.promise=new Promise((e,t)=>this.resolvingFunctions={resolve:e,reject:t})}get shouldRender(){return!0}get shouldAutofocus(){return!0}get reloadReason(){}prepareToRender(){}render(){}finishRendering(){this.resolvingFunctions&&(this.resolvingFunctions.resolve(),delete this.resolvingFunctions)}async preservingPermanentElements(e){await ge.preservingPermanentElements(this,this.permanentElementMap,e)}focusFirstAutofocusableElement(){if(this.shouldAutofocus){const e=this.connectedSnapshot.firstAutofocusableElement;e&&e.focus()}}enteringBardo(e){this.#c||e.contains(this.currentSnapshot.activeElement)&&(this.#c=this.currentSnapshot.activeElement)}leavingBardo(e){e.contains(this.#c)&&this.#c instanceof HTMLElement&&(this.#c.focus(),this.#c=null)}get connectedSnapshot(){return this.newSnapshot.isConnected?this.newSnapshot:this.currentSnapshot}get currentElement(){return this.currentSnapshot.element}get newElement(){return this.newSnapshot.element}get permanentElementMap(){return this.currentSnapshot.getPermanentElementMapForSnapshot(this.newSnapshot)}get renderMethod(){return"replace"}}class ye extends be{static renderElement(e,t){const n=document.createRange();n.selectNodeContents(e),n.deleteContents();const r=t,o=r.ownerDocument?.createRange();o&&(o.selectNodeContents(r),e.appendChild(o.extractContents()))}constructor(e,t,n,r,o,i=!0){super(t,n,r,o,i),this.delegate=e}get shouldRender(){return!0}async render(){await u(),this.preservingPermanentElements(()=>{this.loadFrameElement()}),this.scrollFrameIntoView(),await u(),this.focusFirstAutofocusableElement(),await u(),this.activateScriptElements()}loadFrameElement(){this.delegate.willRenderFrame(this.currentElement,this.newElement),this.renderElement(this.currentElement,this.newElement)}scrollFrameIntoView(){if(this.currentElement.autoscroll||this.newElement.autoscroll){const n=this.currentElement.firstElementChild,r=(e=this.currentElement.getAttribute("data-autoscroll-block"),t="end","end"==e||"start"==e||"center"==e||"nearest"==e?e:t),o=function(e,t){return"auto"==e||"smooth"==e?e:t}(this.currentElement.getAttribute("data-autoscroll-behavior"),"auto");if(n)return n.scrollIntoView({block:r,behavior:o}),!0}var e,t;return!1}activateScriptElements(){for(const e of this.newScriptElements){const t=a(e);e.replaceWith(t)}}get newScriptElements(){return this.currentElement.querySelectorAll("script")}}var we=function(){const e=()=>{},t={morphStyle:"outerHTML",callbacks:{beforeNodeAdded:e,afterNodeAdded:e,beforeNodeMorphed:e,afterNodeMorphed:e,beforeNodeRemoved:e,afterNodeRemoved:e,beforeAttributeUpdated:e},head:{style:"merge",shouldPreserve:e=>"true"===e.getAttribute("im-preserve"),shouldReAppend:e=>"true"===e.getAttribute("im-re-append"),shouldRemove:e,afterHeadMorphed:e},restoreFocus:!0};const n=function(){function e(e,t,n,o){if(!1===o.callbacks.beforeNodeAdded(t))return null;if(o.idMap.has(t)){const i=document.createElement(t.tagName);return e.insertBefore(i,n),r(i,t,o),o.callbacks.afterNodeAdded(i),i}{const r=document.importNode(t,!0);return e.insertBefore(r,n),o.callbacks.afterNodeAdded(r),r}}const t=function(){function e(e,t,n){let r=e.idMap.get(t),o=e.idMap.get(n);if(!o||!r)return!1;for(const i of r)if(o.has(i))return!0;return!1}function t(e,t){const n=e,r=t;return n.nodeType===r.nodeType&&n.tagName===r.tagName&&(!n.getAttribute?.("id")||n.getAttribute?.("id")===r.getAttribute?.("id"))}return function(n,r,o,i){let s=null,a=r.nextSibling,l=0,c=o;for(;c&&c!=i;){if(t(c,r)){if(e(n,c,r))return c;null===s&&(n.idMap.has(c)||(s=c))}if(null===s&&a&&t(c,a)&&(l++,a=a.nextSibling,l>=2&&(s=void 0)),n.activeElementAndParents.includes(c))break;c=c.nextSibling}return s||null}}();function n(e,t){if(e.idMap.has(t))s(e.pantry,t,null);else{if(!1===e.callbacks.beforeNodeRemoved(t))return;t.parentNode?.removeChild(t),e.callbacks.afterNodeRemoved(t)}}function o(e,t,r){let o=t;for(;o&&o!==r;){let t=o;o=o.nextSibling,n(e,t)}return o}function i(e,t,n,r){const o=r.target.getAttribute?.("id")===t&&r.target||r.target.querySelector(`[id="${t}"]`)||r.pantry.querySelector(`[id="${t}"]`);return function(e,t){const n=e.getAttribute("id");for(;e=e.parentNode;){let r=t.idMap.get(e);r&&(r.delete(n),r.size||t.idMap.delete(e))}}(o,r),s(e,o,n),o}function s(e,t,n){if(e.moveBefore)try{e.moveBefore(t,n)}catch(r){e.insertBefore(t,n)}else e.insertBefore(t,n)}return function(s,a,l,c=null,u=null){a instanceof HTMLTemplateElement&&l instanceof HTMLTemplateElement&&(a=a.content,l=l.content),c||=a.firstChild;for(const n of l.childNodes){if(c&&c!=u){const e=t(s,n,c,u);if(e){e!==c&&o(s,c,e),r(e,n,s),c=e.nextSibling;continue}}if(n instanceof Element){const e=n.getAttribute("id");if(s.persistentIds.has(e)){const t=i(a,e,c,s);r(t,n,s),c=t.nextSibling;continue}}const l=e(a,n,c,s);l&&(c=l.nextSibling)}for(;c&&c!=u;){const e=c;c=c.nextSibling,n(s,e)}}}(),r=function(){function e(e,n,r,o){const i=n[r];if(i!==e[r]){const s=t(r,e,"update",o);s||(e[r]=n[r]),i?s||e.setAttribute(r,""):t(r,e,"remove",o)||e.removeAttribute(r)}}function t(e,t,n,r){return!("value"!==e||!r.ignoreActiveValue||t!==document.activeElement)||!1===r.callbacks.beforeAttributeUpdated(e,t,n)}function r(e,t){return!!t.ignoreActiveValue&&e===document.activeElement&&e!==document.body}return function(i,s,a){return a.ignoreActive&&i===document.activeElement?null:(!1===a.callbacks.beforeNodeMorphed(i,s)||(i instanceof HTMLHeadElement&&a.head.ignore||(i instanceof HTMLHeadElement&&"morph"!==a.head.style?o(i,s,a):(!function(n,o,i){let s=o.nodeType;if(1===s){const s=n,a=o,l=s.attributes,c=a.attributes;for(const e of c)t(e.name,s,"update",i)||s.getAttribute(e.name)!==e.value&&s.setAttribute(e.name,e.value);for(let e=l.length-1;0<=e;e--){const n=l[e];if(n&&!a.hasAttribute(n.name)){if(t(n.name,s,"remove",i))continue;s.removeAttribute(n.name)}}r(s,i)||function(n,r,o){if(n instanceof HTMLInputElement&&r instanceof HTMLInputElement&&"file"!==r.type){let i=r.value,s=n.value;e(n,r,"checked",o),e(n,r,"disabled",o),r.hasAttribute("value")?s!==i&&(t("value",n,"update",o)||(n.setAttribute("value",i),n.value=i)):t("value",n,"remove",o)||(n.value="",n.removeAttribute("value"))}else if(n instanceof HTMLOptionElement&&r instanceof HTMLOptionElement)e(n,r,"selected",o);else if(n instanceof HTMLTextAreaElement&&r instanceof HTMLTextAreaElement){let e=r.value,i=n.value;if(t("value",n,"update",o))return;e!==i&&(n.value=e),n.firstChild&&n.firstChild.nodeValue!==e&&(n.firstChild.nodeValue=e)}}(s,a,i)}8!==s&&3!==s||n.nodeValue!==o.nodeValue&&(n.nodeValue=o.nodeValue)}(i,s,a),r(i,a)||n(a,i,s))),a.callbacks.afterNodeMorphed(i,s)),i)}}();function o(e,t,n){let r=[],o=[],i=[],s=[],a=new Map;for(const c of t.children)a.set(c.outerHTML,c);for(const c of e.children){let e=a.has(c.outerHTML),t=n.head.shouldReAppend(c),r=n.head.shouldPreserve(c);e||r?t?o.push(c):(a.delete(c.outerHTML),i.push(c)):"append"===n.head.style?t&&(o.push(c),s.push(c)):!1!==n.head.shouldRemove(c)&&o.push(c)}s.push(...a.values());let l=[];for(const c of s){let t=document.createRange().createContextualFragment(c.outerHTML).firstChild;if(!1!==n.callbacks.beforeNodeAdded(t)){if("href"in t&&t.href||"src"in t&&t.src){let e,n=new Promise(function(t){e=t});t.addEventListener("load",function(){e()}),l.push(n)}e.appendChild(t),n.callbacks.afterNodeAdded(t),r.push(t)}}for(const c of o)!1!==n.callbacks.beforeNodeRemoved(c)&&(e.removeChild(c),n.callbacks.afterNodeRemoved(c));return n.head.afterHeadMorphed(e,{added:r,kept:i,removed:o}),l}const i=function(){function e(){const e=document.createElement("div");return e.hidden=!0,document.body.insertAdjacentElement("afterend",e),e}function n(e){let t=[],n=document.activeElement;if("BODY"!==n?.tagName&&e.contains(n))for(;n&&(t.push(n),n!==e);)n=n.parentElement;return t}function r(e){let t=Array.from(e.querySelectorAll("[id]"));return e.getAttribute?.("id")&&t.push(e),t}function o(e,t,n,r){for(const o of r){const r=o.getAttribute("id");if(t.has(r)){let t=o;for(;t;){let o=e.get(t);if(null==o&&(o=new Set,e.set(t,o)),o.add(r),t===n)break;t=t.parentElement}}}}return function(i,s,a){const{persistentIds:l,idMap:c}=function(e,t){const n=r(e),i=r(t),s=function(e,t){let n=new Set,r=new Map;for(const{id:i,tagName:s}of e)r.has(i)?n.add(i):r.set(i,s);let o=new Set;for(const{id:i,tagName:s}of t)o.has(i)?n.add(i):r.get(i)===s&&o.add(i);for(const i of n)o.delete(i);return o}(n,i);let a=new Map;o(a,s,e,n);const l=t.__idiomorphRoot||t;return o(a,s,l,i),{persistentIds:s,idMap:a}}(i,s),u=function(e){let n=Object.assign({},t);return Object.assign(n,e),n.callbacks=Object.assign({},t.callbacks,e.callbacks),n.head=Object.assign({},t.head,e.head),n}(a),d=u.morphStyle||"outerHTML";if(!["innerHTML","outerHTML"].includes(d))throw`Do not understand how to morph style ${d}`;return{target:i,newContent:s,config:u,morphStyle:d,ignoreActive:u.ignoreActive,ignoreActiveValue:u.ignoreActiveValue,restoreFocus:u.restoreFocus,idMap:c,persistentIds:l,pantry:e(),activeElementAndParents:n(i),callbacks:u.callbacks,head:u.head}}}(),{normalizeElement:s,normalizeParent:a}=function(){const e=new WeakSet;class t{constructor(e){this.originalNode=e,this.realParentNode=e.parentNode,this.previousSibling=e.previousSibling,this.nextSibling=e.nextSibling}get childNodes(){const e=[];let t=this.previousSibling?this.previousSibling.nextSibling:this.realParentNode.firstChild;for(;t&&t!=this.nextSibling;)e.push(t),t=t.nextSibling;return e}querySelectorAll(e){return this.childNodes.reduce((t,n)=>{if(n instanceof Element){n.matches(e)&&t.push(n);const r=n.querySelectorAll(e);for(let e=0;e]*>|>)([\s\S]*?)<\/svg>/gim,"");if(r.match(/<\/html>/)||r.match(/<\/head>/)||r.match(/<\/body>/)){let o=n.parseFromString(t,"text/html");if(r.match(/<\/html>/))return e.add(o),o;{let t=o.firstChild;return t&&e.add(t),t}}{let r=n.parseFromString(""+t+"","text/html").body.querySelector("template").content;return e.add(r),r}}(r));if(e.has(r))return r;if(r instanceof Node){if(r.parentNode)return new t(r);{const e=document.createElement("div");return e.append(r),e}}{const e=document.createElement("div");for(const t of[...r])e.append(t);return e}}}}();return{morph:function(e,t,r={}){e=s(e);const l=a(t),c=i(e,l,r),u=function(e,t){if(!e.config.restoreFocus)return t();let n=document.activeElement;if(!(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement))return t();const{id:r,selectionStart:o,selectionEnd:i}=n,s=t();r&&r!==document.activeElement?.getAttribute("id")&&(n=e.target.querySelector(`[id="${r}"]`),n?.focus());n&&!n.selectionEnd&&i&&n.setSelectionRange(o,i);return s}(c,()=>function(e,t,n,r){if(e.head.block){const i=t.querySelector("head"),s=n.querySelector("head");if(i&&s){const t=o(i,s,e);return Promise.all(t).then(()=>{const t=Object.assign(e,{head:{block:!1,ignore:!0}});return r(t)})}}return r(e)}(c,e,l,t=>"innerHTML"===t.morphStyle?(n(t,e,l),Array.from(e.childNodes)):function(e,t,r){const o=a(t);return n(e,o,r,t,t.nextSibling),Array.from(o.childNodes)}(t,e,l)));return c.pantry.remove(),u},defaults:t}}();function Se(e,t,{callbacks:n,...r}={}){we.morph(e,t,{...r,callbacks:new Ce(n)})}function xe(e,t,n={}){Se(e,t.childNodes,{...n,morphStyle:"innerHTML"})}function ke(e,t){return e instanceof i&&e.shouldReloadWithMorph&&(!t||function(e,t){return t instanceof Element&&"TURBO-FRAME"===t.nodeName&&e.id===t.id&&(!t.getAttribute("src")||H(e.src,t.getAttribute("src")))}(e,t))&&!e.closest("[data-turbo-permanent]")}function Ee(e){return e.parentElement.closest("turbo-frame[src][refresh=morph]")}class Ce{#u;constructor({beforeNodeMorphed:e}={}){this.#u=e||(()=>!0)}beforeNodeAdded=e=>!(e.id&&e.hasAttribute("data-turbo-permanent")&&document.getElementById(e.id));beforeNodeMorphed=(e,t)=>{if(e instanceof Element){if(!e.hasAttribute("data-turbo-permanent")&&this.#u(e,t)){return!l("turbo:before-morph-element",{cancelable:!0,target:e,detail:{currentElement:e,newElement:t}}).defaultPrevented}return!1}};beforeAttributeUpdated=(e,t,n)=>!l("turbo:before-morph-attribute",{cancelable:!0,target:t,detail:{attributeName:e,mutationType:n}}).defaultPrevented;beforeNodeRemoved=e=>this.beforeNodeMorphed(e);afterNodeMorphed=(e,t)=>{e instanceof Element&&l("turbo:morph-element",{target:e,detail:{currentElement:e,newElement:t}})}}class _e extends ye{static renderElement(e,t){l("turbo:before-frame-morph",{target:e,detail:{currentElement:e,newElement:t}}),xe(e,t,{callbacks:{beforeNodeMorphed:(t,n)=>!ke(t,n)||Ee(t)!==e||(t.reload(),!1)}})}async preservingPermanentElements(e){return await e()}}class Ae{static animationDuration=300;static get defaultCSS(){return p`
.turbo-progress-bar {
position: fixed;
display: block;
top: 0;
left: 0;
height: 3px;
background: #0076ff;
z-index: 2147483647;
transition:
width ${Ae.animationDuration}ms ease-out,
opacity ${Ae.animationDuration/2}ms ${Ae.animationDuration/2}ms ease-in;
transform: translate3d(0, 0, 0);
}
`}hiding=!1;value=0;visible=!1;constructor(){this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement(),this.installStylesheetElement(),this.setValue(0)}show(){this.visible||(this.visible=!0,this.installProgressElement(),this.startTrickling())}hide(){this.visible&&!this.hiding&&(this.hiding=!0,this.fadeProgressElement(()=>{this.uninstallProgressElement(),this.stopTrickling(),this.visible=!1,this.hiding=!1}))}setValue(e){this.value=e,this.refresh()}installStylesheetElement(){document.head.insertBefore(this.stylesheetElement,document.head.firstChild)}installProgressElement(){this.progressElement.style.width="0",this.progressElement.style.opacity="1",document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()}fadeProgressElement(e){this.progressElement.style.opacity="0",setTimeout(e,1.5*Ae.animationDuration)}uninstallProgressElement(){this.progressElement.parentNode&&document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,Ae.animationDuration))}stopTrickling(){window.clearInterval(this.trickleInterval),delete this.trickleInterval}trickle=()=>{this.setValue(this.value+Math.random()/100)};refresh(){requestAnimationFrame(()=>{this.progressElement.style.width=10+90*this.value+"%"})}createStylesheetElement(){const e=document.createElement("style");e.type="text/css",e.textContent=Ae.defaultCSS;const t=E();return t&&(e.nonce=t),e}createProgressElement(){const e=document.createElement("div");return e.className="turbo-progress-bar",e}}class Te extends le{detailsByOuterHTML=this.children.filter(e=>!function(e){const t=e.localName;return"noscript"==t}(e)).map(e=>function(e){e.hasAttribute("nonce")&&e.setAttribute("nonce","");return e}(e)).reduce((e,t)=>{const{outerHTML:n}=t,r=n in e?e[n]:{type:Le(t),tracked:Re(t),elements:[]};return{...e,[n]:{...r,elements:[...r.elements,t]}}},{});get trackedElementSignature(){return Object.keys(this.detailsByOuterHTML).filter(e=>this.detailsByOuterHTML[e].tracked).join("")}getScriptElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("script",e)}getStylesheetElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("stylesheet",e)}getElementsMatchingTypeNotInSnapshot(e,t){return Object.keys(this.detailsByOuterHTML).filter(e=>!(e in t.detailsByOuterHTML)).map(e=>this.detailsByOuterHTML[e]).filter(({type:t})=>t==e).map(({elements:[e]})=>e)}get provisionalElements(){return Object.keys(this.detailsByOuterHTML).reduce((e,t)=>{const{type:n,tracked:r,elements:o}=this.detailsByOuterHTML[t];return null!=n||r?o.length>1?[...e,...o.slice(1)]:e:[...e,...o]},[])}getMetaValue(e){const t=this.findMetaElementByName(e);return t?t.getAttribute("content"):null}findMetaElementByName(e){return Object.keys(this.detailsByOuterHTML).reduce((t,n)=>{const{elements:[r]}=this.detailsByOuterHTML[n];return function(e,t){const n=e.localName;return"meta"==n&&e.getAttribute("name")==t}(r,e)?r:t},0)}}function Le(e){return function(e){const t=e.localName;return"script"==t}(e)?"script":function(e){const t=e.localName;return"style"==t||"link"==t&&"stylesheet"==e.getAttribute("rel")}(e)?"stylesheet":void 0}function Re(e){return"reload"==e.getAttribute("data-turbo-track")}class Me extends le{static fromHTMLString(e=""){return this.fromDocument(f(e))}static fromElement(e){return this.fromDocument(e.ownerDocument)}static fromDocument({documentElement:e,body:t,head:n}){return new this(e,t,new Te(n))}constructor(e,t,n){super(t),this.documentElement=e,this.headSnapshot=n}clone(){const e=this.element.cloneNode(!0),t=this.element.querySelectorAll("select"),n=e.querySelectorAll("select");for(const[r,o]of t.entries()){const e=n[r];for(const t of e.selectedOptions)t.selected=!1;for(const t of o.selectedOptions)e.options[t.index].selected=!0}for(const r of e.querySelectorAll('input[type="password"]'))r.value="";for(const r of e.querySelectorAll("noscript"))r.remove();return new Me(this.documentElement,e,this.headSnapshot)}get lang(){return this.documentElement.getAttribute("lang")}get dir(){return this.documentElement.getAttribute("dir")}get headElement(){return this.headSnapshot.element}get rootLocation(){return O(this.getSetting("root")??"/")}get cacheControlValue(){return this.getSetting("cache-control")}get isPreviewable(){return"no-preview"!=this.cacheControlValue}get isCacheable(){return"no-cache"!=this.cacheControlValue}get isVisitable(){return"reload"!=this.getSetting("visit-control")}get prefersViewTransitions(){return("true"===this.getSetting("view-transition")||"same-origin"===this.headSnapshot.getMetaValue("view-transition"))&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches}get refreshMethod(){return this.getSetting("refresh-method")}get refreshScroll(){return this.getSetting("refresh-scroll")}getSetting(e){return this.headSnapshot.getMetaValue(`turbo-${e}`)}}class Ie{#d=!1;#h=Promise.resolve();renderChange(e,t){return e&&this.viewTransitionsAvailable&&!this.#d?(this.#d=!0,this.#h=this.#h.then(async()=>{await document.startViewTransition(t).finished})):this.#h=this.#h.then(t),this.#h}get viewTransitionsAvailable(){return document.startViewTransition}}const Oe={action:"advance",historyChanged:!1,visitCachedSnapshot:()=>{},willRender:!0,updateHistory:!0,shouldCacheSnapshot:!0,acceptsStreamResponse:!1,refresh:{}},De="visitStart",Pe="requestStart",Ne="requestEnd",Fe="visitEnd",Be="initialized",We="started",He="canceled",Ve="failed",qe="completed",je=0,ze=-1,$e=-2,Xe={advance:"forward",restore:"back",replace:"none"};class Ke{identifier=m();timingMetrics={};followedRedirect=!1;historyChanged=!1;scrolled=!1;shouldCacheSnapshot=!0;acceptsStreamResponse=!1;snapshotCached=!1;state=Be;viewTransitioner=new Ie;constructor(e,t,n,r={}){this.delegate=e,this.location=t,this.restorationIdentifier=n||m();const{action:o,historyChanged:i,referrer:s,snapshot:a,snapshotHTML:l,response:c,visitCachedSnapshot:u,willRender:d,updateHistory:h,shouldCacheSnapshot:f,acceptsStreamResponse:p,direction:v,refresh:g}={...Oe,...r};this.action=o,this.historyChanged=i,this.referrer=s,this.snapshot=a,this.snapshotHTML=l,this.response=c,this.isPageRefresh=this.view.isPageRefresh(this),this.visitCachedSnapshot=u,this.willRender=d,this.updateHistory=h,this.scrolled=!d,this.shouldCacheSnapshot=f,this.acceptsStreamResponse=p,this.direction=v||Xe[o],this.refresh=g}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get history(){return this.delegate.history}get restorationData(){return this.history.getRestorationDataForIdentifier(this.restorationIdentifier)}start(){this.state==Be&&(this.recordTimingMetric(De),this.state=We,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==We&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=He)}complete(){this.state==We&&(this.recordTimingMetric(Fe),this.adapter.visitCompleted(this),this.state=qe,this.followRedirect(),this.followedRedirect||this.delegate.visitCompleted(this))}fail(){this.state==We&&(this.state=Ve,this.adapter.visitFailed(this),this.delegate.visitCompleted(this))}changeHistory(){if(!this.historyChanged&&this.updateHistory){const e=w(this.location.href===this.referrer?.href?"replace":this.action);this.history.update(e,this.location,this.restorationIdentifier),this.historyChanged=!0}}issueRequest(){this.hasPreloadedResponse()?this.simulateRequest():this.shouldIssueRequest()&&!this.request&&(this.request=new G(this,K.get,this.location),this.request.perform())}simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric(Pe),this.adapter.visitRequestStarted(this)}recordResponse(e=this.response){if(this.response=e,e){const{statusCode:t}=e;Ue(t)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,t)}}finishRequest(){this.recordTimingMetric(Ne),this.adapter.visitRequestFinished(this)}loadResponse(){if(this.response){const{statusCode:e,responseHTML:t}=this.response;this.render(async()=>{if(this.shouldCacheSnapshot&&this.cacheSnapshot(),this.view.renderPromise&&await this.view.renderPromise,Ue(e)&&null!=t){const e=Me.fromHTMLString(t);await this.renderPageSnapshot(e,!1),this.adapter.visitRendered(this),this.complete()}else await this.view.renderError(Me.fromHTMLString(t),this),this.adapter.visitRendered(this),this.fail()})}}getCachedSnapshot(){const e=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(e&&(!D(this.location)||e.hasAnchor(D(this.location)))&&("restore"==this.action||e.isPreviewable))return e}getPreloadedSnapshot(){if(this.snapshotHTML)return Me.fromHTMLString(this.snapshotHTML)}hasCachedSnapshot(){return null!=this.getCachedSnapshot()}loadCachedSnapshot(){const e=this.getCachedSnapshot();if(e){const t=this.shouldIssueRequest();this.render(async()=>{this.cacheSnapshot(),this.isPageRefresh?this.adapter.visitRendered(this):(this.view.renderPromise&&await this.view.renderPromise,await this.renderPageSnapshot(e,t),this.adapter.visitRendered(this),t||this.complete())})}}followRedirect(){this.redirectedToLocation&&!this.followedRedirect&&this.response?.redirected&&(this.adapter.visitProposedToLocation(this.redirectedToLocation,{action:"replace",response:this.response,shouldCacheSnapshot:!1,willRender:!1}),this.followedRedirect=!0)}prepareRequest(e){this.acceptsStreamResponse&&e.acceptResponseType(te.contentType)}requestStarted(){this.startRequest()}requestPreventedHandlingResponse(e,t){}async requestSucceededWithResponse(e,t){const n=await t.responseHTML,{redirected:r,statusCode:o}=t;null==n?this.recordResponse({statusCode:$e,redirected:r}):(this.redirectedToLocation=t.redirected?t.location:void 0,this.recordResponse({statusCode:o,responseHTML:n,redirected:r}))}async requestFailedWithResponse(e,t){const n=await t.responseHTML,{redirected:r,statusCode:o}=t;null==n?this.recordResponse({statusCode:$e,redirected:r}):this.recordResponse({statusCode:o,responseHTML:n,redirected:r})}requestErrored(e,t){this.recordResponse({statusCode:je,redirected:!1})}requestFinished(){this.finishRequest()}performScroll(){this.scrolled||this.view.forceReloaded||this.view.shouldPreserveScrollPosition(this)||("restore"==this.action?this.scrollToRestoredPosition()||this.scrollToAnchor()||this.view.scrollToTop():this.scrollToAnchor()||this.view.scrollToTop(),this.scrolled=!0)}scrollToRestoredPosition(){const{scrollPosition:e}=this.restorationData;if(e)return this.view.scrollToPosition(e),!0}scrollToAnchor(){const e=D(this.location);if(null!=e)return this.view.scrollToAnchor(e),!0}recordTimingMetric(e){this.timingMetrics[e]=(new Date).getTime()}getTimingMetrics(){return{...this.timingMetrics}}hasPreloadedResponse(){return"object"==typeof this.response}shouldIssueRequest(){return"restore"==this.action?!this.hasCachedSnapshot():this.willRender}cacheSnapshot(){this.snapshotCached||(this.view.cacheSnapshot(this.snapshot).then(e=>e&&this.visitCachedSnapshot(e)),this.snapshotCached=!0)}async render(e){this.cancelRender(),await new Promise(e=>{this.frame="hidden"===document.visibilityState?setTimeout(()=>e(),0):requestAnimationFrame(()=>e())}),await e(),delete this.frame}async renderPageSnapshot(e,t){await this.viewTransitioner.renderChange(this.view.shouldTransitionTo(e),async()=>{await this.view.renderPage(e,t,this.willRender,this),this.performScroll()})}cancelRender(){this.frame&&(cancelAnimationFrame(this.frame),delete this.frame)}}function Ue(e){return e>=200&&e<300}class Ge{progressBar=new Ae;constructor(e){this.session=e}visitProposedToLocation(e,t){F(e,this.navigator.rootLocation)?this.navigator.startVisit(e,t?.restorationIdentifier||m(),t):window.location.href=e.toString()}visitStarted(e){this.location=e.location,this.redirectedToLocation=null,e.loadCachedSnapshot(),e.issueRequest()}visitRequestStarted(e){this.progressBar.setValue(0),e.hasCachedSnapshot()||"restore"!=e.action?this.showVisitProgressBarAfterDelay():this.showProgressBar()}visitRequestCompleted(e){e.loadResponse(),e.response.redirected&&(this.redirectedToLocation=e.redirectedToLocation)}visitRequestFailedWithStatusCode(e,t){switch(t){case je:case ze:case $e:return this.reload({reason:"request_failed",context:{statusCode:t}});default:return e.loadResponse()}}visitRequestFinished(e){}visitCompleted(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}pageInvalidated(e){this.reload(e)}visitFailed(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}visitRendered(e){}linkPrefetchingIsEnabledForLocation(e){return!0}formSubmissionStarted(e){this.progressBar.setValue(0),this.showFormProgressBarAfterDelay()}formSubmissionFinished(e){this.progressBar.setValue(1),this.hideFormProgressBar()}showVisitProgressBarAfterDelay(){this.visitProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay)}hideVisitProgressBar(){this.progressBar.hide(),null!=this.visitProgressBarTimeout&&(window.clearTimeout(this.visitProgressBarTimeout),delete this.visitProgressBarTimeout)}showFormProgressBarAfterDelay(){null==this.formProgressBarTimeout&&(this.formProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay))}hideFormProgressBar(){this.progressBar.hide(),null!=this.formProgressBarTimeout&&(window.clearTimeout(this.formProgressBarTimeout),delete this.formProgressBarTimeout)}showProgressBar=()=>{this.progressBar.show()};reload(e){l("turbo:reload",{detail:e}),window.location.href=(this.redirectedToLocation||this.location)?.toString()||window.location.href}get navigator(){return this.session.navigator}}class Qe{selector="[data-turbo-temporary]";started=!1;start(){this.started||(this.started=!0,addEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}stop(){this.started&&(this.started=!1,removeEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}removeTemporaryElements=e=>{for(const t of this.temporaryElements)t.remove()};get temporaryElements(){return[...document.querySelectorAll(this.selector)]}}class Ye{constructor(e,t){this.session=e,this.element=t,this.linkInterceptor=new pe(this,t),this.formSubmitObserver=new de(this,t)}start(){this.linkInterceptor.start(),this.formSubmitObserver.start()}stop(){this.linkInterceptor.stop(),this.formSubmitObserver.stop()}shouldInterceptLinkClick(e,t,n){return this.#f(e)}linkClickIntercepted(e,t,n){const r=this.#p(e);r&&r.delegate.linkClickIntercepted(e,t,n)}willSubmitForm(e,t){return null==e.closest("turbo-frame")&&this.#m(e,t)&&this.#f(e,t)}formSubmitted(e,t){const n=this.#p(e,t);n&&n.delegate.formSubmitted(e,t)}#m(e,t){const n=P(e,t),r=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),o=O(r?.content??"/");return this.#f(e,t)&&F(n,o)}#f(e,t){if(e instanceof HTMLFormElement?this.session.submissionIsNavigatable(e,t):this.session.elementIsNavigatable(e)){const n=this.#p(e,t);return!!n&&n!=e.closest("turbo-frame")}return!1}#p(e,t){const n=t?.getAttribute("data-turbo-frame")||e.getAttribute("data-turbo-frame");if(n&&"_top"!=n){const e=this.element.querySelector(`#${n}:not([disabled])`);if(e instanceof i)return e}}}class Je{location;restorationIdentifier=m();restorationData={};started=!1;currentIndex=0;constructor(e){this.delegate=e}start(){this.started||(addEventListener("popstate",this.onPopState,!1),this.currentIndex=history.state?.turbo?.restorationIndex||0,this.started=!0,this.replace(new URL(window.location.href)))}stop(){this.started&&(removeEventListener("popstate",this.onPopState,!1),this.started=!1)}push(e,t){this.update(history.pushState,e,t)}replace(e,t){this.update(history.replaceState,e,t)}update(e,t,n=m()){e===history.pushState&&++this.currentIndex;const r={turbo:{restorationIdentifier:n,restorationIndex:this.currentIndex}};e.call(history,r,"",t.href),this.location=t,this.restorationIdentifier=n}getRestorationDataForIdentifier(e){return this.restorationData[e]||{}}updateRestorationData(e){const{restorationIdentifier:t}=this,n=this.restorationData[t];this.restorationData[t]={...n,...e}}assumeControlOfScrollRestoration(){this.previousScrollRestoration||(this.previousScrollRestoration=history.scrollRestoration??"auto",history.scrollRestoration="manual")}relinquishControlOfScrollRestoration(){this.previousScrollRestoration&&(history.scrollRestoration=this.previousScrollRestoration,delete this.previousScrollRestoration)}onPopState=e=>{const{turbo:t}=e.state||{};if(this.location=new URL(window.location.href),t){const{restorationIdentifier:e,restorationIndex:n}=t;this.restorationIdentifier=e;const r=n>this.currentIndex?"forward":"back";this.delegate.historyPoppedToLocationWithRestorationIdentifierAndDirection(this.location,e,r),this.currentIndex=n}else this.currentIndex++,this.delegate.historyPoppedWithEmptyState(this.location)}}class Ze{started=!1;#v=null;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||("loading"===this.eventTarget.readyState?this.eventTarget.addEventListener("DOMContentLoaded",this.#g,{once:!0}):this.#g())}stop(){this.started&&(this.eventTarget.removeEventListener("mouseenter",this.#b,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("mouseleave",this.#y,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("turbo:before-fetch-request",this.#w,!0),this.started=!1)}#g=()=>{this.eventTarget.addEventListener("mouseenter",this.#b,{capture:!0,passive:!0}),this.eventTarget.addEventListener("mouseleave",this.#y,{capture:!0,passive:!0}),this.eventTarget.addEventListener("turbo:before-fetch-request",this.#w,!0),this.started=!0};#b=e=>{if("false"===k("turbo-prefetch"))return;const t=e.target;if(t.matches&&t.matches("a[href]:not([target^=_]):not([download])")&&this.#S(t)){const e=t,n=B(e);if(this.delegate.canPrefetchRequestToLocation(e,n)){this.#v=e;const r=new G(this,K.get,n,new URLSearchParams,t);r.fetchOptions.priority="low",ie.putLater(n,r,this.#x)}}};#y=e=>{e.target===this.#v&&this.#k()};#k=()=>{ie.clear(),this.#v=null};#w=e=>{if("FORM"!==e.target.tagName&&"GET"===e.detail.fetchOptions.method){const t=ie.get(e.detail.url);t&&(e.detail.fetchRequest=t),ie.clear()}};prepareRequest(e){const t=e.target;e.headers["X-Sec-Purpose"]="prefetch";const n=t.closest("turbo-frame"),r=t.getAttribute("data-turbo-frame")||n?.getAttribute("target")||n?.id;r&&"_top"!==r&&(e.headers["Turbo-Frame"]=r)}requestSucceededWithResponse(){}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}get#x(){return Number(k("turbo-prefetch-cache-time"))||oe}#S(e){return!!e.getAttribute("href")&&(!et(e)&&(!tt(e)&&(!nt(e)&&(!rt(e)&&!it(e)))))}}const et=e=>e.origin!==document.location.origin||!["http:","https:"].includes(e.protocol)||e.hasAttribute("target"),tt=e=>e.pathname+e.search===document.location.pathname+document.location.search||e.href.startsWith("#"),nt=e=>{if("false"===e.getAttribute("data-turbo-prefetch"))return!0;if("false"===e.getAttribute("data-turbo"))return!0;const t=C(e,"[data-turbo-prefetch]");return!(!t||"false"!==t.getAttribute("data-turbo-prefetch"))},rt=e=>{const t=e.getAttribute("data-turbo-method");return!(!t||"get"===t.toLowerCase())||(!!ot(e)||(!!e.hasAttribute("data-turbo-confirm")||!!e.hasAttribute("data-turbo-stream")))},ot=e=>e.hasAttribute("data-remote")||e.hasAttribute("data-behavior")||e.hasAttribute("data-confirm")||e.hasAttribute("data-method"),it=e=>l("turbo:before-prefetch",{target:e,cancelable:!0}).defaultPrevented;class st{constructor(e){this.delegate=e}proposeVisit(e,t={}){this.delegate.allowsVisitingLocationWithAction(e,t.action)&&this.delegate.visitProposedToLocation(e,t)}startVisit(e,t,n={}){this.stop(),this.currentVisit=new Ke(this,O(e),t,{referrer:this.location,...n}),this.currentVisit.start()}submitForm(e,t){this.stop(),this.formSubmission=new ae(this,e,t,!0),this.formSubmission.start()}stop(){this.formSubmission&&(this.formSubmission.stop(),delete this.formSubmission),this.currentVisit&&(this.currentVisit.cancel(),delete this.currentVisit)}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get rootLocation(){return this.view.snapshot.rootLocation}get history(){return this.delegate.history}formSubmissionStarted(e){"function"==typeof this.adapter.formSubmissionStarted&&this.adapter.formSubmissionStarted(e)}async formSubmissionSucceededWithResponse(e,t){if(e==this.formSubmission){const n=await t.responseHTML;if(n){const r=e.isSafe;r||this.view.clearSnapshotCache();const{statusCode:o,redirected:i}=t,s={action:this.#E(e,t),shouldCacheSnapshot:r,response:{statusCode:o,responseHTML:n,redirected:i}};this.proposeVisit(t.location,s)}}}async formSubmissionFailedWithResponse(e,t){const n=await t.responseHTML;if(n){const e=Me.fromHTMLString(n);t.serverError?await this.view.renderError(e,this.currentVisit):await this.view.renderPage(e,!1,!0,this.currentVisit),"preserve"!==e.refreshScroll&&this.view.scrollToTop(),this.view.clearSnapshotCache()}}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished(e){"function"==typeof this.adapter.formSubmissionFinished&&this.adapter.formSubmissionFinished(e)}linkPrefetchingIsEnabledForLocation(e){return"function"!=typeof this.adapter.linkPrefetchingIsEnabledForLocation||this.adapter.linkPrefetchingIsEnabledForLocation(e)}visitStarted(e){this.delegate.visitStarted(e)}visitCompleted(e){this.delegate.visitCompleted(e),delete this.currentVisit}locationWithActionIsSamePage(e,t){return!1}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}#E(e,t){const{submitter:n,formElement:r}=e;return S(n,r)||this.#C(t)}#C(e){return e.redirected&&e.location.href===this.location?.href?"replace":"advance"}}const at=0,lt=1,ct=2,ut=3;class dt{stage=at;started=!1;constructor(e){this.delegate=e}start(){this.started||(this.stage==at&&(this.stage=lt),document.addEventListener("readystatechange",this.interpretReadyState,!1),addEventListener("pagehide",this.pageWillUnload,!1),this.started=!0)}stop(){this.started&&(document.removeEventListener("readystatechange",this.interpretReadyState,!1),removeEventListener("pagehide",this.pageWillUnload,!1),this.started=!1)}interpretReadyState=()=>{const{readyState:e}=this;"interactive"==e?this.pageIsInteractive():"complete"==e&&this.pageIsComplete()};pageIsInteractive(){this.stage==lt&&(this.stage=ct,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==ct&&(this.stage=ut,this.delegate.pageLoaded())}pageWillUnload=()=>{this.delegate.pageWillUnload()};get readyState(){return document.readyState}}class ht{started=!1;constructor(e){this.delegate=e}start(){this.started||(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)}stop(){this.started&&(removeEventListener("scroll",this.onScroll,!1),this.started=!1)}onScroll=()=>{this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})};updatePosition(e){this.delegate.scrollPositionChanged(e)}}class ft{render({fragment:e}){ge.preservingPermanentElements(this,function(e){const t=ue(document.documentElement),n={};for(const r of t){const{id:t}=r;for(const o of e.querySelectorAll("turbo-stream")){const e=ce(o.templateElement.content,t);e&&(n[t]=[r,e])}}return n}(e),()=>{!async function(e,t){const n=`turbo-stream-autofocus-${m()}`,r=e.querySelectorAll("turbo-stream"),o=function(e){for(const t of e){const e=A(t.templateElement.content);if(e)return e}return null}(r);let i=null;o&&(i=o.id?o.id:n,o.id=i);t(),await u();if((null==document.activeElement||document.activeElement==document.body)&&i){const e=document.getElementById(i);_(e)&&e.focus(),e&&e.id==n&&e.removeAttribute("id")}}(e,()=>{!async function(e){const[t,n]=await async function(e,t){const n=t();return e(),await d(),[n,t()]}(e,()=>document.activeElement),r=t&&t.id;if(r){const e=document.getElementById(r);_(e)&&e!=n&&e.focus()}}(()=>{document.documentElement.appendChild(e)})})})}enteringBardo(e,t){t.replaceWith(e.cloneNode(!0))}leavingBardo(){}}class pt{sources=new Set;#_=!1;constructor(e){this.delegate=e}start(){this.#_||(this.#_=!0,addEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}stop(){this.#_&&(this.#_=!1,removeEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}connectStreamSource(e){this.streamSourceIsConnected(e)||(this.sources.add(e),e.addEventListener("message",this.receiveMessageEvent,!1))}disconnectStreamSource(e){this.streamSourceIsConnected(e)&&(this.sources.delete(e),e.removeEventListener("message",this.receiveMessageEvent,!1))}streamSourceIsConnected(e){return this.sources.has(e)}inspectFetchResponse=e=>{const t=function(e){const t=e.detail?.fetchResponse;if(t instanceof q)return t}(e);t&&function(e){const t=e.contentType??"";return t.startsWith(te.contentType)}(t)&&(e.preventDefault(),this.receiveMessageResponse(t))};receiveMessageEvent=e=>{this.#_&&"string"==typeof e.data&&this.receiveMessageHTML(e.data)};async receiveMessageResponse(e){const t=await e.responseHTML;t&&this.receiveMessageHTML(t)}receiveMessageHTML(e){this.delegate.receivedMessageFromStream(te.wrap(e))}}class mt extends be{static renderElement(e,t){const{documentElement:n,body:r}=document;n.replaceChild(t,r)}async render(){this.replaceHeadAndBody(),this.activateScriptElements()}replaceHeadAndBody(){const{documentElement:e,head:t}=document;e.replaceChild(this.newHead,t),this.renderElement(this.currentElement,this.newElement)}activateScriptElements(){for(const e of this.scriptElements){const t=e.parentNode;if(t){const n=a(e);t.replaceChild(n,e)}}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return document.documentElement.querySelectorAll("script")}}class vt extends be{static renderElement(e,t){document.body&&t instanceof HTMLBodyElement?document.body.replaceWith(t):document.documentElement.appendChild(t)}get shouldRender(){return this.newSnapshot.isVisitable&&this.trackedElementsAreIdentical}get reloadReason(){return this.newSnapshot.isVisitable?this.trackedElementsAreIdentical?void 0:{reason:"tracked_element_mismatch"}:{reason:"turbo_visit_control_is_reload"}}async prepareToRender(){this.#A(),await this.mergeHead()}async render(){this.willRender&&await this.replaceBody()}finishRendering(){super.finishRendering(),this.isPreview||this.focusFirstAutofocusableElement()}get currentHeadSnapshot(){return this.currentSnapshot.headSnapshot}get newHeadSnapshot(){return this.newSnapshot.headSnapshot}get newElement(){return this.newSnapshot.element}#A(){const{documentElement:e}=this.currentSnapshot,{dir:t,lang:n}=this.newSnapshot;n?e.setAttribute("lang",n):e.removeAttribute("lang"),t?e.setAttribute("dir",t):e.removeAttribute("dir")}async mergeHead(){const e=this.mergeProvisionalElements(),t=this.copyNewHeadStylesheetElements();this.copyNewHeadScriptElements(),await e,await t,this.willRender&&this.removeUnusedDynamicStylesheetElements()}async replaceBody(){await this.preservingPermanentElements(async()=>{this.activateNewBody(),await this.assignNewBody()})}get trackedElementsAreIdentical(){return this.currentHeadSnapshot.trackedElementSignature==this.newHeadSnapshot.trackedElementSignature}async copyNewHeadStylesheetElements(){const e=[];for(const t of this.newHeadStylesheetElements)e.push(y(t)),document.head.appendChild(t);await Promise.all(e)}copyNewHeadScriptElements(){for(const e of this.newHeadScriptElements)document.head.appendChild(a(e))}removeUnusedDynamicStylesheetElements(){for(const e of this.unusedDynamicStylesheetElements)document.head.removeChild(e)}async mergeProvisionalElements(){const e=[...this.newHeadProvisionalElements];for(const t of this.currentHeadProvisionalElements)this.isCurrentElementInElementList(t,e)||document.head.removeChild(t);for(const t of e)document.head.appendChild(t)}isCurrentElementInElementList(e,t){for(const[n,r]of t.entries()){if("TITLE"==e.tagName){if("TITLE"!=r.tagName)continue;if(e.innerHTML==r.innerHTML)return t.splice(n,1),!0}if(r.isEqualNode(e))return t.splice(n,1),!0}return!1}removeCurrentHeadProvisionalElements(){for(const e of this.currentHeadProvisionalElements)document.head.removeChild(e)}copyNewHeadProvisionalElements(){for(const e of this.newHeadProvisionalElements)document.head.appendChild(e)}activateNewBody(){document.adoptNode(this.newElement),this.removeNoscriptElements(),this.activateNewBodyScriptElements()}removeNoscriptElements(){for(const e of this.newElement.querySelectorAll("noscript"))e.remove()}activateNewBodyScriptElements(){for(const e of this.newBodyScriptElements){const t=a(e);e.replaceWith(t)}}async assignNewBody(){await this.renderElement(this.currentElement,this.newElement)}get unusedDynamicStylesheetElements(){return this.oldHeadStylesheetElements.filter(e=>"dynamic"===e.getAttribute("data-turbo-track"))}get oldHeadStylesheetElements(){return this.currentHeadSnapshot.getStylesheetElementsNotInSnapshot(this.newHeadSnapshot)}get newHeadStylesheetElements(){return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot)}get newHeadScriptElements(){return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot)}get currentHeadProvisionalElements(){return this.currentHeadSnapshot.provisionalElements}get newHeadProvisionalElements(){return this.newHeadSnapshot.provisionalElements}get newBodyScriptElements(){return this.newElement.querySelectorAll("script")}}class gt extends vt{static renderElement(e,t){Se(e,t,{callbacks:{beforeNodeMorphed:(e,t)=>!(ke(e,t)&&!Ee(e))||(e.reload(),!1)}}),l("turbo:morph",{detail:{currentElement:e,newElement:t}})}async preservingPermanentElements(e){return await e()}get renderMethod(){return"morph"}get shouldAutofocus(){return!1}}class bt extends re{constructor(e){super(e,W)}get snapshots(){return this.entries}}class yt extends he{snapshotCache=new bt(10);lastRenderedLocation=new URL(location.href);forceReloaded=!1;shouldTransitionTo(e){return this.snapshot.prefersViewTransitions&&e.prefersViewTransitions}renderPage(e,t=!1,n=!0,r){const o=new(this.isPageRefresh(r)&&"morph"===(r?.refresh?.method||this.snapshot.refreshMethod)?gt:vt)(this.snapshot,e,t,n);return o.shouldRender?r?.changeHistory():this.forceReloaded=!0,this.render(o)}renderError(e,t){t?.changeHistory();const n=new mt(this.snapshot,e,!1);return this.render(n)}clearSnapshotCache(){this.snapshotCache.clear()}async cacheSnapshot(e=this.snapshot){if(e.isCacheable){this.delegate.viewWillCacheSnapshot();const{lastRenderedLocation:t}=this;await h();const n=e.clone();return this.snapshotCache.put(t,n),n}}getCachedSnapshotForLocation(e){return this.snapshotCache.get(e)}isPageRefresh(e){return!e||this.lastRenderedLocation.pathname===e.location.pathname&&"replace"===e.action}shouldPreserveScrollPosition(e){return this.isPageRefresh(e)&&"preserve"===(e?.refresh?.scroll||this.snapshot.refreshScroll)}get snapshot(){return Me.fromElement(this.element)}}class wt{selector="a[data-turbo-preload]";constructor(e,t){this.delegate=e,this.snapshotCache=t}start(){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",this.#T):this.preloadOnLoadLinksForView(document.body)}stop(){document.removeEventListener("DOMContentLoaded",this.#T)}preloadOnLoadLinksForView(e){for(const t of e.querySelectorAll(this.selector))this.delegate.shouldPreloadLink(t)&&this.preloadURL(t)}async preloadURL(e){const t=new URL(e.href);if(this.snapshotCache.has(t))return;const n=new G(this,K.get,t,new URLSearchParams,e);await n.perform()}prepareRequest(e){e.headers["X-Sec-Purpose"]="prefetch"}async requestSucceededWithResponse(e,t){try{const n=await t.responseHTML,r=Me.fromHTMLString(n);this.snapshotCache.put(e.url,r)}catch(n){}}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}#T=()=>{this.preloadOnLoadLinksForView(document.body)}}class St{constructor(e){this.session=e}clear(){this.session.clearCache()}resetCacheControl(){this.#L("")}exemptPageFromCache(){this.#L("no-cache")}exemptPageFromPreview(){this.#L("no-preview")}#L(e){!function(e,t){let n=x(e);n||(n=document.createElement("meta"),n.setAttribute("name",e),document.head.appendChild(n)),n.setAttribute("content",t)}("turbo-cache-control",e)}}function xt(e){Object.defineProperties(e,kt)}const kt={absoluteURL:{get(){return this.toString()}}},Et=new class{navigator=new st(this);history=new Je(this);view=new yt(this,document.documentElement);adapter=new Ge(this);pageObserver=new dt(this);cacheObserver=new Qe;linkPrefetchObserver=new Ze(this,document);linkClickObserver=new me(this,window);formSubmitObserver=new de(this,document);scrollObserver=new ht(this);streamObserver=new pt(this);formLinkClickObserver=new ve(this,document.documentElement);frameRedirector=new Ye(this,document.documentElement);streamMessageRenderer=new ft;cache=new St(this);enabled=!0;started=!1;#R=150;constructor(e){this.recentRequests=e,this.preloader=new wt(this,this.view.snapshotCache),this.debouncedRefresh=this.refresh,this.pageRefreshDebouncePeriod=this.pageRefreshDebouncePeriod}start(){this.started||(this.pageObserver.start(),this.cacheObserver.start(),this.linkPrefetchObserver.start(),this.formLinkClickObserver.start(),this.linkClickObserver.start(),this.formSubmitObserver.start(),this.scrollObserver.start(),this.streamObserver.start(),this.frameRedirector.start(),this.history.start(),this.preloader.start(),this.started=!0,this.enabled=!0)}disable(){this.enabled=!1}stop(){this.started&&(this.pageObserver.stop(),this.cacheObserver.stop(),this.linkPrefetchObserver.stop(),this.formLinkClickObserver.stop(),this.linkClickObserver.stop(),this.formSubmitObserver.stop(),this.scrollObserver.stop(),this.streamObserver.stop(),this.frameRedirector.stop(),this.history.stop(),this.preloader.stop(),this.started=!1)}registerAdapter(e){this.adapter=e}visit(e,t={}){const n=t.frame?document.getElementById(t.frame):null;if(n instanceof i){const r=t.action||S(n);n.delegate.proposeVisitIfNavigatedWithAction(n,r),n.src=e.toString()}else this.navigator.proposeVisit(O(e),t)}refresh(e,t={}){t="string"==typeof t?{requestId:t}:t;const{method:n,requestId:r,scroll:o}=t,i=r&&this.recentRequests.has(r),s=e===document.baseURI;i||this.navigator.currentVisit||!s||this.visit(e,{action:"replace",shouldCacheSnapshot:!1,refresh:{method:n,scroll:o}})}connectStreamSource(e){this.streamObserver.connectStreamSource(e)}disconnectStreamSource(e){this.streamObserver.disconnectStreamSource(e)}renderStreamMessage(e){this.streamMessageRenderer.render(te.wrap(e))}clearCache(){this.view.clearSnapshotCache()}setProgressBarDelay(e){console.warn("Please replace `session.setProgressBarDelay(delay)` with `session.progressBarDelay = delay`. The function is deprecated and will be removed in a future version of Turbo.`"),this.progressBarDelay=e}set progressBarDelay(e){I.drive.progressBarDelay=e}get progressBarDelay(){return I.drive.progressBarDelay}set drive(e){I.drive.enabled=e}get drive(){return I.drive.enabled}set formMode(e){I.forms.mode=e}get formMode(){return I.forms.mode}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}get pageRefreshDebouncePeriod(){return this.#R}set pageRefreshDebouncePeriod(e){this.refresh=function(e,t){let n=null;return(...r)=>{clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}(this.debouncedRefresh.bind(this),e),this.#R=e}shouldPreloadLink(e){const t=e.hasAttribute("data-turbo-method"),n=e.hasAttribute("data-turbo-stream"),r=e.getAttribute("data-turbo-frame"),o="_top"==r?null:document.getElementById(r)||C(e,"turbo-frame:not([disabled])");if(t||n||o instanceof i)return!1;{const t=new URL(e.href);return this.elementIsNavigatable(e)&&F(t,this.snapshot.rootLocation)}}historyPoppedToLocationWithRestorationIdentifierAndDirection(e,t,n){this.enabled?this.navigator.startVisit(e,t,{action:"restore",historyChanged:!0,direction:n}):this.adapter.pageInvalidated({reason:"turbo_disabled"})}historyPoppedWithEmptyState(e){this.history.replace(e),this.view.lastRenderedLocation=e,this.view.cacheSnapshot()}scrollPositionChanged(e){this.history.updateRestorationData({scrollPosition:e})}willSubmitFormLinkToLocation(e,t){return this.elementIsNavigatable(e)&&F(t,this.snapshot.rootLocation)}submittedFormLinkToLocation(){}canPrefetchRequestToLocation(e,t){return this.elementIsNavigatable(e)&&F(t,this.snapshot.rootLocation)&&this.navigator.linkPrefetchingIsEnabledForLocation(t)}willFollowLinkToLocation(e,t,n){return this.elementIsNavigatable(e)&&F(t,this.snapshot.rootLocation)&&this.applicationAllowsFollowingLinkToLocation(e,t,n)}followedLinkToLocation(e,t){const n=this.getActionForLink(e),r=e.hasAttribute("data-turbo-stream");this.visit(t.href,{action:n,acceptsStreamResponse:r})}allowsVisitingLocationWithAction(e,t){return this.applicationAllowsVisitingLocation(e)}visitProposedToLocation(e,t){xt(e),this.adapter.visitProposedToLocation(e,t)}visitStarted(e){e.acceptsStreamResponse||(g(document.documentElement),this.view.markVisitDirection(e.direction)),xt(e.location),this.notifyApplicationAfterVisitingLocation(e.location,e.action)}visitCompleted(e){this.view.unmarkVisitDirection(),b(document.documentElement),this.notifyApplicationAfterPageLoad(e.getTimingMetrics())}willSubmitForm(e,t){const n=P(e,t);return this.submissionIsNavigatable(e,t)&&F(O(n),this.snapshot.rootLocation)}formSubmitted(e,t){this.navigator.submitForm(e,t)}pageBecameInteractive(){this.view.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()}pageLoaded(){this.history.assumeControlOfScrollRestoration()}pageWillUnload(){this.history.relinquishControlOfScrollRestoration()}receivedMessageFromStream(e){this.renderStreamMessage(e)}viewWillCacheSnapshot(){this.notifyApplicationBeforeCachingSnapshot()}allowsImmediateRender({element:e},t){const n=this.notifyApplicationBeforeRender(e,t),{defaultPrevented:r,detail:{render:o}}=n;return this.view.renderer&&o&&(this.view.renderer.renderElement=o),!r}viewRenderedSnapshot(e,t,n){this.view.lastRenderedLocation=this.history.location,this.notifyApplicationAfterRender(n)}preloadOnLoadLinksForView(e){this.preloader.preloadOnLoadLinksForView(e)}viewInvalidated(e){this.adapter.pageInvalidated(e)}frameLoaded(e){this.notifyApplicationAfterFrameLoad(e)}frameRendered(e,t){this.notifyApplicationAfterFrameRender(e,t)}applicationAllowsFollowingLinkToLocation(e,t,n){return!this.notifyApplicationAfterClickingLinkToLocation(e,t,n).defaultPrevented}applicationAllowsVisitingLocation(e){return!this.notifyApplicationBeforeVisitingLocation(e).defaultPrevented}notifyApplicationAfterClickingLinkToLocation(e,t,n){return l("turbo:click",{target:e,detail:{url:t.href,originalEvent:n},cancelable:!0})}notifyApplicationBeforeVisitingLocation(e){return l("turbo:before-visit",{detail:{url:e.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(e,t){return l("turbo:visit",{detail:{url:e.href,action:t}})}notifyApplicationBeforeCachingSnapshot(){return l("turbo:before-cache")}notifyApplicationBeforeRender(e,t){return l("turbo:before-render",{detail:{newBody:e,...t},cancelable:!0})}notifyApplicationAfterRender(e){return l("turbo:render",{detail:{renderMethod:e}})}notifyApplicationAfterPageLoad(e={}){return l("turbo:load",{detail:{url:this.location.href,timing:e}})}notifyApplicationAfterFrameLoad(e){return l("turbo:frame-load",{target:e})}notifyApplicationAfterFrameRender(e,t){return l("turbo:frame-render",{detail:{fetchResponse:e},target:t,cancelable:!0})}submissionIsNavigatable(e,t){if("off"==I.forms.mode)return!1;{const n=!t||this.elementIsNavigatable(t);return"optin"==I.forms.mode?n&&null!=e.closest('[data-turbo="true"]'):n&&this.elementIsNavigatable(e)}}elementIsNavigatable(e){const t=C(e,"[data-turbo]"),n=C(e,"turbo-frame");return I.drive.enabled||n?!t||"false"!=t.getAttribute("data-turbo"):!!t&&"true"==t.getAttribute("data-turbo")}getActionForLink(e){return S(e)||"advance"}get snapshot(){return this.view.snapshot}}(z),{cache:Ct,navigator:_t}=Et;function At(){Et.start()}function Tt(e,t){Et.visit(e,t)}function Lt(e){Et.connectStreamSource(e)}function Rt(e){Et.disconnectStreamSource(e)}function Mt(e,t){gt.renderElement(e,t)}var It=Object.freeze({__proto__:null,PageRenderer:vt,PageSnapshot:Me,FrameRenderer:ye,fetch:$,config:I,session:Et,cache:Ct,navigator:_t,start:At,registerAdapter:function(e){Et.registerAdapter(e)},visit:Tt,connectStreamSource:Lt,disconnectStreamSource:Rt,renderStreamMessage:function(e){Et.renderStreamMessage(e)},setProgressBarDelay:function(e){console.warn("Please replace `Turbo.setProgressBarDelay(delay)` with `Turbo.config.drive.progressBarDelay = delay`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),I.drive.progressBarDelay=e},setConfirmMethod:function(e){console.warn("Please replace `Turbo.setConfirmMethod(confirmMethod)` with `Turbo.config.forms.confirm = confirmMethod`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),I.forms.confirm=e},setFormMode:function(e){console.warn("Please replace `Turbo.setFormMode(mode)` with `Turbo.config.forms.mode = mode`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),I.forms.mode=e},morphBodyElements:Mt,morphTurboFrameElements:function(e,t){_e.renderElement(e,t)},morphChildren:xe,morphElements:Se});class Ot extends Error{}function Dt(e,t){if(e){const n=e.getAttribute("src");if(null!=n&&null!=t&&H(n,t))throw new Error(`Matching element has a source URL which references itself`);if(e.ownerDocument!==document&&(e=document.importNode(e,!0)),e instanceof i)return e.connectedCallback(),e.disconnectedCallback(),e}}const Pt={after(){this.removeDuplicateTargetSiblings(),this.targetElements.forEach(e=>e.parentElement?.insertBefore(this.templateContent,e.nextSibling))},append(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(e=>e.append(this.templateContent))},before(){this.removeDuplicateTargetSiblings(),this.targetElements.forEach(e=>e.parentElement?.insertBefore(this.templateContent,e))},prepend(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(e=>e.prepend(this.templateContent))},remove(){this.targetElements.forEach(e=>e.remove())},replace(){const e=this.getAttribute("method");this.targetElements.forEach(t=>{"morph"===e?Se(t,this.templateContent):t.replaceWith(this.templateContent)})},update(){const e=this.getAttribute("method");this.targetElements.forEach(t=>{"morph"===e?xe(t,this.templateContent):(t.innerHTML="",t.append(this.templateContent))})},refresh(){const e=this.getAttribute("method"),t=this.requestId,n=this.getAttribute("scroll");Et.refresh(this.baseURI,{method:e,requestId:t,scroll:n})}};class Nt extends HTMLElement{static async renderElement(e){await e.performAction()}async connectedCallback(){try{await this.render()}catch(e){console.error(e)}finally{this.disconnect()}}async render(){return this.renderPromise??=(async()=>{const e=this.beforeRenderEvent;this.dispatchEvent(e)&&(await u(),await e.detail.render(this))})()}disconnect(){try{this.remove()}catch{}}removeDuplicateTargetChildren(){this.duplicateChildren.forEach(e=>e.remove())}get duplicateChildren(){const e=this.targetElements.flatMap(e=>[...e.children]).filter(e=>!!e.getAttribute("id")),t=[...this.templateContent?.children||[]].filter(e=>!!e.getAttribute("id")).map(e=>e.getAttribute("id"));return e.filter(e=>t.includes(e.getAttribute("id")))}removeDuplicateTargetSiblings(){this.duplicateSiblings.forEach(e=>e.remove())}get duplicateSiblings(){const e=this.targetElements.flatMap(e=>[...e.parentElement.children]).filter(e=>!!e.id),t=[...this.templateContent?.children||[]].filter(e=>!!e.id).map(e=>e.id);return e.filter(e=>t.includes(e.id))}get performAction(){if(this.action){const e=Pt[this.action];if(e)return e;this.#M("unknown action")}this.#M("action attribute is missing")}get targetElements(){return this.target?this.targetElementsById:this.targets?this.targetElementsByQuery:void this.#M("target or targets attribute is missing")}get templateContent(){return this.templateElement.content.cloneNode(!0)}get templateElement(){if(null===this.firstElementChild){const e=this.ownerDocument.createElement("template");return this.appendChild(e),e}if(this.firstElementChild instanceof HTMLTemplateElement)return this.firstElementChild;this.#M("first child element must be a element")}get action(){return this.getAttribute("action")}get target(){return this.getAttribute("target")}get targets(){return this.getAttribute("targets")}get requestId(){return this.getAttribute("request-id")}#M(e){throw new Error(`${this.description}: ${e}`)}get description(){return(this.outerHTML.match(/<[^>]+>/)??[])[0]??""}get beforeRenderEvent(){return new CustomEvent("turbo:before-stream-render",{bubbles:!0,cancelable:!0,detail:{newStream:this,render:Nt.renderElement}})}get targetElementsById(){const e=this.ownerDocument?.getElementById(this.target);return null!==e?[e]:[]}get targetElementsByQuery(){const e=this.ownerDocument?.querySelectorAll(this.targets);return 0!==e.length?Array.prototype.slice.call(e):[]}}class Ft extends HTMLElement{streamSource=null;connectedCallback(){this.streamSource=this.src.match(/^ws{1,2}:/)?new WebSocket(this.src):new EventSource(this.src),Lt(this.streamSource)}disconnectedCallback(){this.streamSource&&(this.streamSource.close(),Rt(this.streamSource))}get src(){return this.getAttribute("src")||""}}i.delegateConstructor=class{fetchResponseLoaded=e=>Promise.resolve();#I=null;#O=()=>{};#D=!1;#P=!1;#N=new Set;#F=!1;action=null;constructor(e){this.element=e,this.view=new fe(this,this.element),this.appearanceObserver=new ee(this,this.element),this.formLinkClickObserver=new ve(this,this.element),this.linkInterceptor=new pe(this,this.element),this.restorationIdentifier=m(),this.formSubmitObserver=new de(this,this.element)}connect(){this.#D||(this.#D=!0,this.loadingStyle==o?this.appearanceObserver.start():this.#B(),this.formLinkClickObserver.start(),this.linkInterceptor.start(),this.formSubmitObserver.start())}disconnect(){this.#D&&(this.#D=!1,this.appearanceObserver.stop(),this.formLinkClickObserver.stop(),this.linkInterceptor.stop(),this.formSubmitObserver.stop(),this.element.hasAttribute("recurse")||this.#I?.cancel())}disabledChanged(){this.disabled?this.#I?.cancel():this.loadingStyle==r&&this.#B()}sourceURLChanged(){this.#W("src")||(this.sourceURL||this.#I?.cancel(),this.element.isConnected&&(this.complete=!1),(this.loadingStyle==r||this.#P)&&this.#B())}sourceURLReloaded(){const{refresh:e,src:t}=this.element;return this.#F=t&&"morph"===e,this.element.removeAttribute("complete"),this.element.src=null,this.element.src=t,this.element.loaded}loadingStyleChanged(){this.loadingStyle==o?this.appearanceObserver.start():(this.appearanceObserver.stop(),this.#B())}async#B(){this.enabled&&this.isActive&&!this.complete&&this.sourceURL&&(this.element.loaded=this.#H(O(this.sourceURL)),this.appearanceObserver.stop(),await this.element.loaded,this.#P=!0)}async loadResponse(e){(e.redirected||e.succeeded&&e.isHTML)&&(this.sourceURL=e.response.url);try{const t=await e.responseHTML;if(t){const n=f(t);Me.fromDocument(n).isVisitable?await this.#V(e,n):await this.#q(e)}}finally{this.#F=!1,this.fetchResponseLoaded=()=>Promise.resolve()}}elementAppearedInViewport(e){this.proposeVisitIfNavigatedWithAction(e,S(e)),this.#B()}willSubmitFormLinkToLocation(e){return this.#j(e)}submittedFormLinkToLocation(e,t,n){const r=this.#p(e);r&&n.setAttribute("data-turbo-frame",r.id)}shouldInterceptLinkClick(e,t,n){return this.#j(e)}linkClickIntercepted(e,t){this.#z(e,t)}willSubmitForm(e,t){return e.closest("turbo-frame")==this.element&&this.#j(e,t)}formSubmitted(e,t){this.formSubmission&&this.formSubmission.stop(),this.formSubmission=new ae(this,e,t);const{fetchRequest:n}=this.formSubmission,r=this.#p(e,t);this.prepareRequest(n,r),this.formSubmission.start()}prepareRequest(e,t=this){e.headers["Turbo-Frame"]=t.id,this.currentNavigationElement?.hasAttribute("data-turbo-stream")&&e.acceptResponseType(te.contentType)}requestStarted(e){g(this.element)}requestPreventedHandlingResponse(e,t){this.#O()}async requestSucceededWithResponse(e,t){await this.loadResponse(t),this.#O()}async requestFailedWithResponse(e,t){await this.loadResponse(t),this.#O()}requestErrored(e,t){console.error(t),this.#O()}requestFinished(e){b(this.element)}formSubmissionStarted({formElement:e}){g(e,this.#p(e))}formSubmissionSucceededWithResponse(e,t){const n=this.#p(e.formElement,e.submitter);n.delegate.proposeVisitIfNavigatedWithAction(n,S(e.submitter,e.formElement,n)),n.delegate.loadResponse(t),e.isSafe||Et.clearCache()}formSubmissionFailedWithResponse(e,t){this.element.delegate.loadResponse(t),Et.clearCache()}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished({formElement:e}){b(e,this.#p(e))}allowsImmediateRender({element:e},t){const n=l("turbo:before-frame-render",{target:this.element,detail:{newFrame:e,...t},cancelable:!0}),{defaultPrevented:r,detail:{render:o}}=n;return this.view.renderer&&o&&(this.view.renderer.renderElement=o),!r}viewRenderedSnapshot(e,t,n){}preloadOnLoadLinksForView(e){Et.preloadOnLoadLinksForView(e)}viewInvalidated(){}willRenderFrame(e,t){this.previousFrameElement=e.cloneNode(!0)}visitCachedSnapshot=({element:e})=>{const t=e.querySelector("#"+this.element.id);t&&this.previousFrameElement&&t.replaceChildren(...this.previousFrameElement.children),delete this.previousFrameElement};async#V(e,t){const n=await this.extractForeignFrameElement(t.body),r=this.#F?_e:ye;if(n){const t=new le(n),o=new r(this,this.view.snapshot,t,!1,!1);this.view.renderPromise&&await this.view.renderPromise,this.changeHistory(),await this.view.render(o),this.complete=!0,Et.frameRendered(e,this.element),Et.frameLoaded(this.element),await this.fetchResponseLoaded(e)}else this.#$(e)&&this.#X(e)}async#H(e){const t=new G(this,K.get,e,new URLSearchParams,this.element);return this.#I?.cancel(),this.#I=t,new Promise(e=>{this.#O=()=>{this.#O=()=>{},this.#I=null,e()},t.perform()})}#z(e,t,n){const r=this.#p(e,n);r.delegate.proposeVisitIfNavigatedWithAction(r,S(n,e,r)),this.#K(e,()=>{r.src=t})}proposeVisitIfNavigatedWithAction(e,t=null){if(this.action=t,this.action){const t=Me.fromElement(e).clone(),{visitCachedSnapshot:n}=e.delegate;e.delegate.fetchResponseLoaded=async r=>{if(e.src){const{statusCode:o,redirected:i}=r,s={response:{statusCode:o,redirected:i,responseHTML:await r.responseHTML},visitCachedSnapshot:n,willRender:!1,updateHistory:!1,restorationIdentifier:this.restorationIdentifier,snapshot:t};this.action&&(s.action=this.action),Et.visit(e.src,s)}}}}changeHistory(){if(this.action){const e=w(this.action);Et.history.update(e,O(this.element.src||""),this.restorationIdentifier)}}async#q(e){console.warn(`The response (${e.statusCode}) from is performing a full page visit due to turbo-visit-control.`),await this.#U(e.response)}#$(e){this.element.setAttribute("complete","");const t=e.response;return!l("turbo:frame-missing",{target:this.element,detail:{response:t,visit:async(e,t)=>{e instanceof Response?this.#U(e):Et.visit(e,t)}},cancelable:!0}).defaultPrevented}#X(e){this.view.missing(),this.#G(e)}#G(e){const t=`The response (${e.statusCode}) did not contain the expected and will be ignored. To perform a full page visit instead, set turbo-visit-control to reload.`;throw new Ot(t)}async#U(e){const t=new q(e),n=await t.responseHTML,{location:r,redirected:o,statusCode:i}=t;return Et.visit(r,{response:{redirected:o,statusCode:i,responseHTML:n}})}#p(e,t){const n=v("data-turbo-frame",t,e)||this.element.getAttribute("target"),r=this.#Q(n);return r instanceof i?r:this.element}async extractForeignFrameElement(e){let t;const n=CSS.escape(this.id);try{if(t=Dt(e.querySelector(`turbo-frame#${n}`),this.sourceURL),t)return t;if(t=Dt(e.querySelector(`turbo-frame[src][recurse~=${n}]`),this.sourceURL),t)return await t.loaded,await this.extractForeignFrameElement(t)}catch(r){return console.error(r),new i}return null}#Y(e,t){return F(O(P(e,t)),this.rootLocation)}#j(e,t){const n=v("data-turbo-frame",t,e)||this.element.getAttribute("target");if(e instanceof HTMLFormElement&&!this.#Y(e,t))return!1;if(!this.enabled||"_top"==n)return!1;if(n){const e=this.#Q(n);if(e)return!e.disabled;if("_parent"==n)return!1}return!!Et.elementIsNavigatable(e)&&!(t&&!Et.elementIsNavigatable(t))}get id(){return this.element.id}get disabled(){return this.element.disabled}get enabled(){return!this.disabled}get sourceURL(){if(this.element.src)return this.element.src}set sourceURL(e){this.#J("src",()=>{this.element.src=e??null})}get loadingStyle(){return this.element.loading}get isLoading(){return void 0!==this.formSubmission||void 0!==this.#O()}get complete(){return this.element.hasAttribute("complete")}set complete(e){e?this.element.setAttribute("complete",""):this.element.removeAttribute("complete")}get isActive(){return this.element.isActive&&this.#D}get rootLocation(){const e=this.element.ownerDocument.querySelector('meta[name="turbo-root"]');return O(e?.content??"/")}#W(e){return this.#N.has(e)}#J(e,t){this.#N.add(e),t(),this.#N.delete(e)}#K(e,t){this.currentNavigationElement=e,t(),delete this.currentNavigationElement}#Q(e){if(null!=e){const t="_parent"===e?this.element.parentElement.closest("turbo-frame"):document.getElementById(e);if(t instanceof i)return t}}},void 0===customElements.get("turbo-frame")&&customElements.define("turbo-frame",i),void 0===customElements.get("turbo-stream")&&customElements.define("turbo-stream",Nt),void 0===customElements.get("turbo-stream-source")&&customElements.define("turbo-stream-source",Ft),(()=>{const e=document.currentScript;if(!e)return;if(e.hasAttribute("data-turbo-suppress-warning"))return;let t=e.parentElement;for(;t;){if(t==document.body)return console.warn(p`
You are loading Turbo from a