<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&amp;&amp;(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f06c7287-4fba-44e4-bd7a-202e3b62d5de",e._sentryDebugIdIdentifier="sentry-dbid-f06c7287-4fba-44e4-bd7a-202e3b62d5de")}catch(e){}("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"v238.1-0-g85ee98f"};(self.webpackChunk=self.webpackChunk||[]).push([[566],{89:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{YR:function(){return visit},aM:function(){return renderStreamMessage}}),function(prototype){function raise(errorConstructor,message,name){throw new errorConstructor("Failed to execute 'requestSubmit' on 'HTMLFormElement': "+message+".",name)}"function"!=typeof prototype.requestSubmit&amp;&amp;(prototype.requestSubmit=function(submitter){submitter?(!function validateSubmitter(submitter,form){submitter instanceof HTMLElement||raise(TypeError,"parameter 1 is not of type 'HTMLElement'"),"submit"==submitter.type||raise(TypeError,"The specified element is not a submit button"),submitter.form==form||raise(DOMException,"The specified element is not owned by this form element","NotFoundError")}(submitter,this),submitter.click()):((submitter=document.createElement("input")).type="submit",submitter.hidden=!0,this.appendChild(submitter),submitter.click(),this.removeChild(submitter))})}(HTMLFormElement.prototype);const submittersByForm=new WeakMap;function clickCaptured(event){const submitter=function findSubmitterFromClickTarget(target){const element=target instanceof Element?target:target instanceof Node?target.parentElement:null,candidate=element?element.closest("input, button"):null;return"submit"==candidate?.type?candidate:null}(event.target);submitter&amp;&amp;submitter.form&amp;&amp;submittersByForm.set(submitter.form,submitter)}!function(){if("submitter"in Event.prototype)return;let prototype=window.Event.prototype;if("SubmitEvent"in window){const prototypeOfSubmitEvent=window.SubmitEvent.prototype;if(!/Apple Computer/.test(navigator.vendor)||"submitter"in prototypeOfSubmitEvent)return;prototype=prototypeOfSubmitEvent}addEventListener("click",clickCaptured,!0),Object.defineProperty(prototype,"submitter",{get(){if("submit"==this.type&amp;&amp;this.target instanceof HTMLFormElement)return submittersByForm.get(this.target)}})}();const FrameLoadingStyle_eager="eager",FrameLoadingStyle_lazy="lazy";class FrameElement extends HTMLElement{static delegateConstructor=void 0;loaded=Promise.resolve();static get observedAttributes(){return["disabled","loading","src"]}constructor(){super(),this.delegate=new FrameElement.delegateConstructor(this)}connectedCallback(){this.delegate.connect()}disconnectedCallback(){this.delegate.disconnect()}reload(){return this.delegate.sourceURLReloaded()}attributeChangedCallback(name){"loading"==name?this.delegate.loadingStyleChanged():"src"==name?this.delegate.sourceURLChanged():"disabled"==name&amp;&amp;this.delegate.disabledChanged()}get src(){return this.getAttribute("src")}set src(value){value?this.setAttribute("src",value):this.removeAttribute("src")}get refresh(){return this.getAttribute("refresh")}set refresh(value){value?this.setAttribute("refresh",value):this.removeAttribute("refresh")}get shouldReloadWithMorph(){return this.src&amp;&amp;"morph"===this.refresh}get loading(){return function frameLoadingStyleFromString(style){if("lazy"===style.toLowerCase())return FrameLoadingStyle_lazy;return FrameLoadingStyle_eager}(this.getAttribute("loading")||"")}set loading(value){value?this.setAttribute("loading",value):this.removeAttribute("loading")}get disabled(){return this.hasAttribute("disabled")}set disabled(value){value?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get autoscroll(){return this.hasAttribute("autoscroll")}set autoscroll(value){value?this.setAttribute("autoscroll",""):this.removeAttribute("autoscroll")}get complete(){return!this.delegate.isLoading}get isActive(){return this.ownerDocument===document&amp;&amp;!this.isPreview}get isPreview(){return this.ownerDocument?.documentElement?.hasAttribute("data-turbo-preview")}}const drive={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 activateScriptElement(element){if("false"==element.getAttribute("data-turbo-eval"))return element;{const createdScriptElement=document.createElement("script"),cspNonce=getCspNonce();return cspNonce&amp;&amp;(createdScriptElement.nonce=cspNonce),createdScriptElement.textContent=element.textContent,createdScriptElement.async=!1,function copyElementAttributes(destinationElement,sourceElement){for(const{name:name,value:value}of sourceElement.attributes)destinationElement.setAttribute(name,value)}(createdScriptElement,element),createdScriptElement}}function dispatch(eventName,{target:target,cancelable:cancelable,detail:detail}={}){const event=new CustomEvent(eventName,{cancelable:cancelable,bubbles:!0,composed:!0,detail:detail});return target&amp;&amp;target.isConnected?target.dispatchEvent(event):document.documentElement.dispatchEvent(event),event}function cancelEvent(event){event.preventDefault(),event.stopImmediatePropagation()}function nextRepaint(){return"hidden"===document.visibilityState?nextEventLoopTick():nextAnimationFrame()}function nextAnimationFrame(){return new Promise((resolve=&gt;requestAnimationFrame((()=&gt;resolve()))))}function nextEventLoopTick(){return new Promise((resolve=&gt;setTimeout((()=&gt;resolve()),0)))}function parseHTMLDocument(html=""){return(new DOMParser).parseFromString(html,"text/html")}function unindent(strings,...values){const lines=function interpolate(strings,values){return strings.reduce(((result,string,i)=&gt;result+string+(null==values[i]?"":values[i])),"")}(strings,values).replace(/^\n/,"").split("\n"),match=lines[0].match(/^\s+/),indent=match?match[0].length:0;return lines.map((line=&gt;line.slice(indent))).join("\n")}function uuid(){return Array.from({length:36}).map(((_,i)=&gt;8==i||13==i||18==i||23==i?"-":14==i?"4":19==i?(Math.floor(4*Math.random())+8).toString(16):Math.floor(15*Math.random()).toString(16))).join("")}function getAttribute(attributeName,...elements){for(const value of elements.map((element=&gt;element?.getAttribute(attributeName))))if("string"==typeof value)return value;return null}function markAsBusy(...elements){for(const element of elements)"turbo-frame"==element.localName&amp;&amp;element.setAttribute("busy",""),element.setAttribute("aria-busy","true")}function clearBusyState(...elements){for(const element of elements)"turbo-frame"==element.localName&amp;&amp;element.removeAttribute("busy"),element.removeAttribute("aria-busy")}function waitForLoad(element,timeoutInMilliseconds=2e3){return new Promise((resolve=&gt;{const onComplete=()=&gt;{element.removeEventListener("error",onComplete),element.removeEventListener("load",onComplete),resolve()};element.addEventListener("load",onComplete,{once:!0}),element.addEventListener("error",onComplete,{once:!0}),setTimeout(resolve,timeoutInMilliseconds)}))}function getHistoryMethodForAction(action){switch(action){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}function getVisitAction(...elements){const action=getAttribute("data-turbo-action",...elements);return function isAction(action){return"advance"==action||"replace"==action||"restore"==action}(action)?action:null}function getMetaElement(name){return document.querySelector(`meta[name="${name}"]`)}function getMetaContent(name){const element=getMetaElement(name);return element&amp;&amp;element.content}function getCspNonce(){const element=getMetaElement("csp-nonce");if(element){const{nonce:nonce,content:content}=element;return""==nonce?content:nonce}}function findClosestRecursively(element,selector){if(element instanceof Element)return element.closest(selector)||findClosestRecursively(element.assignedSlot||element.getRootNode()?.host,selector)}function elementIsFocusable(element){return!!element&amp;&amp;null==element.closest("[inert], :disabled, [hidden], details:not([open]), dialog:not([open])")&amp;&amp;"function"==typeof element.focus}function queryAutofocusableElement(elementOrDocumentFragment){return Array.from(elementOrDocumentFragment.querySelectorAll("[autofocus]")).find(elementIsFocusable)}function doesNotTargetIFrame(name){if("_blank"===name)return!1;if(name){for(const element of document.getElementsByName(name))if(element instanceof HTMLIFrameElement)return!1;return!0}return!0}function findLinkFromClickTarget(target){return findClosestRecursively(target,"a[href]:not([target^=_]):not([download])")}function getLocationForLink(link){return expandURL(link.getAttribute("href")||"")}const submitter={"aria-disabled":{beforeSubmit:submitter=&gt;{submitter.setAttribute("aria-disabled","true"),submitter.addEventListener("click",cancelEvent)},afterSubmit:submitter=&gt;{submitter.removeAttribute("aria-disabled"),submitter.removeEventListener("click",cancelEvent)}},disabled:{beforeSubmit:submitter=&gt;submitter.disabled=!0,afterSubmit:submitter=&gt;submitter.disabled=!1}};const forms=new class Config{#submitter=null;constructor(config){Object.assign(this,config)}get submitter(){return this.#submitter}set submitter(value){this.#submitter=submitter[value]||value}}({mode:"on",submitter:"disabled"}),config={drive:drive,forms:forms};function expandURL(locatable){return new URL(locatable.toString(),document.baseURI)}function getAnchor(url){let anchorMatch;return url.hash?url.hash.slice(1):(anchorMatch=url.href.match(/#(.*)$/))?anchorMatch[1]:void 0}function getAction$1(form,submitter){return expandURL(submitter?.getAttribute("formaction")||form.getAttribute("action")||form.action)}function getExtension(url){return(function getLastPathComponent(url){return function getPathComponents(url){return url.pathname.split("/").slice(1)}(url).slice(-1)[0]}(url).match(/\.[^.]*$/)||[])[0]||""}function isPrefixedBy(baseURL,url){const prefix=function getPrefix(url){return function addTrailingSlash(value){return value.endsWith("/")?value:value+"/"}(url.origin+url.pathname)}(url);return baseURL.href===expandURL(prefix).href||baseURL.href.startsWith(prefix)}function locationIsVisitable(location,rootLocation){return isPrefixedBy(location,rootLocation)&amp;&amp;!config.drive.unvisitableExtensions.has(getExtension(location))}function getRequestURL(url){const anchor=getAnchor(url);return null!=anchor?url.href.slice(0,-(anchor.length+1)):url.href}function toCacheKey(url){return getRequestURL(url)}class FetchResponse{constructor(response){this.response=response}get succeeded(){return this.response.ok}get failed(){return!this.succeeded}get clientError(){return this.statusCode&gt;=400&amp;&amp;this.statusCode&lt;=499}get serverError(){return this.statusCode&gt;=500&amp;&amp;this.statusCode&lt;=599}get redirected(){return this.response.redirected}get location(){return expandURL(this.response.url)}get isHTML(){return this.contentType&amp;&amp;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(name){return this.response.headers.get(name)}}class LimitedSet extends Set{constructor(maxSize){super(),this.maxSize=maxSize}add(value){if(this.size&gt;=this.maxSize){const oldestValue=this.values().next().value;this.delete(oldestValue)}super.add(value)}}const recentRequests=new LimitedSet(20),nativeFetch=window.fetch;function fetchWithTurboHeaders(url,options={}){const modifiedHeaders=new Headers(options.headers||{}),requestUID=uuid();return recentRequests.add(requestUID),modifiedHeaders.append("X-Turbo-Request-Id",requestUID),nativeFetch(url,{...options,headers:modifiedHeaders})}function fetchMethodFromString(method){switch(method.toLowerCase()){case"get":return FetchMethod.get;case"post":return FetchMethod.post;case"put":return FetchMethod.put;case"patch":return FetchMethod.patch;case"delete":return FetchMethod.delete}}const FetchMethod={get:"get",post:"post",put:"put",patch:"patch",delete:"delete"};const FetchEnctype={urlEncoded:"application/x-www-form-urlencoded",multipart:"multipart/form-data",plain:"text/plain"};class FetchRequest{abortController=new AbortController;#resolveRequestPromise=_value=&gt;{};constructor(delegate,method,location,requestBody=new URLSearchParams,target=null,enctype=FetchEnctype.urlEncoded){const[url,body]=buildResourceAndBody(expandURL(location),method,requestBody,enctype);this.delegate=delegate,this.url=url,this.target=target,this.fetchOptions={credentials:"same-origin",redirect:"follow",method:method.toUpperCase(),headers:{...this.defaultHeaders},body:body,signal:this.abortSignal,referrer:this.delegate.referrer?.href},this.enctype=enctype}get method(){return this.fetchOptions.method}set method(value){const fetchBody=this.isSafe?this.url.searchParams:this.fetchOptions.body||new FormData,fetchMethod=fetchMethodFromString(value)||FetchMethod.get;this.url.search="";const[url,body]=buildResourceAndBody(this.url,fetchMethod,fetchBody,this.enctype);this.url=url,this.fetchOptions.body=body,this.fetchOptions.method=fetchMethod.toUpperCase()}get headers(){return this.fetchOptions.headers}set headers(value){this.fetchOptions.headers=value}get body(){return this.isSafe?this.url.searchParams:this.fetchOptions.body}set body(value){this.fetchOptions.body=value}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:fetchOptions}=this;this.delegate.prepareRequest(this);const event=await this.#allowRequestToBeIntercepted(fetchOptions);try{this.delegate.requestStarted(this),event.detail.fetchRequest?this.response=event.detail.fetchRequest.response:this.response=fetchWithTurboHeaders(this.url.href,fetchOptions);const response=await this.response;return await this.receive(response)}catch(error){if("AbortError"!==error.name)throw this.#willDelegateErrorHandling(error)&amp;&amp;this.delegate.requestErrored(this,error),error}finally{this.delegate.requestFinished(this)}}async receive(response){const fetchResponse=new FetchResponse(response);return dispatch("turbo:before-fetch-response",{cancelable:!0,detail:{fetchResponse:fetchResponse},target:this.target}).defaultPrevented?this.delegate.requestPreventedHandlingResponse(this,fetchResponse):fetchResponse.succeeded?this.delegate.requestSucceededWithResponse(this,fetchResponse):this.delegate.requestFailedWithResponse(this,fetchResponse),fetchResponse}get defaultHeaders(){return{Accept:"text/html, application/xhtml+xml"}}get isSafe(){return isSafe(this.method)}get abortSignal(){return this.abortController.signal}acceptResponseType(mimeType){this.headers.Accept=[mimeType,this.headers.Accept].join(", ")}async#allowRequestToBeIntercepted(fetchOptions){const requestInterception=new Promise((resolve=&gt;this.#resolveRequestPromise=resolve)),event=dispatch("turbo:before-fetch-request",{cancelable:!0,detail:{fetchOptions:fetchOptions,url:this.url,resume:this.#resolveRequestPromise},target:this.target});return this.url=event.detail.url,event.defaultPrevented&amp;&amp;await requestInterception,event}#willDelegateErrorHandling(error){return!dispatch("turbo:fetch-request-error",{target:this.target,cancelable:!0,detail:{request:this,error:error}}).defaultPrevented}}function isSafe(fetchMethod){return fetchMethodFromString(fetchMethod)==FetchMethod.get}function buildResourceAndBody(resource,method,requestBody,enctype){const searchParams=Array.from(requestBody).length&gt;0?new URLSearchParams(entriesExcludingFiles(requestBody)):resource.searchParams;return isSafe(method)?[mergeIntoURLSearchParams(resource,searchParams),null]:enctype==FetchEnctype.urlEncoded?[resource,searchParams]:[resource,requestBody]}function entriesExcludingFiles(requestBody){const entries=[];for(const[name,value]of requestBody)value instanceof File||entries.push([name,value]);return entries}function mergeIntoURLSearchParams(url,requestBody){const searchParams=new URLSearchParams(entriesExcludingFiles(requestBody));return url.search=searchParams.toString(),url}class AppearanceObserver{started=!1;constructor(delegate,element){this.delegate=delegate,this.element=element,this.intersectionObserver=new IntersectionObserver(this.intersect)}start(){this.started||(this.started=!0,this.intersectionObserver.observe(this.element))}stop(){this.started&amp;&amp;(this.started=!1,this.intersectionObserver.unobserve(this.element))}intersect=entries=&gt;{const lastEntry=entries.slice(-1)[0];lastEntry?.isIntersecting&amp;&amp;this.delegate.elementAppearedInViewport(this.element)}}class StreamMessage{static contentType="text/vnd.turbo-stream.html";static wrap(message){return"string"==typeof message?new this(function createDocumentFragment(html){const template=document.createElement("template");return template.innerHTML=html,template.content}(message)):message}constructor(fragment){this.fragment=function importStreamElements(fragment){for(const element of fragment.querySelectorAll("turbo-stream")){const streamElement=document.importNode(element,!0);for(const inertScriptElement of streamElement.templateElement.content.querySelectorAll("script"))inertScriptElement.replaceWith(activateScriptElement(inertScriptElement));element.replaceWith(streamElement)}return fragment}(fragment)}}const prefetchCache=new class PrefetchCache{#prefetchTimeout=null;#prefetched=null;get(url){if(this.#prefetched&amp;&amp;this.#prefetched.url===url&amp;&amp;this.#prefetched.expire&gt;Date.now())return this.#prefetched.request}setLater(url,request,ttl){this.clear(),this.#prefetchTimeout=setTimeout((()=&gt;{request.perform(),this.set(url,request,ttl),this.#prefetchTimeout=null}),100)}set(url,request,ttl){this.#prefetched={url:url,request:request,expire:new Date((new Date).getTime()+ttl)}}clear(){this.#prefetchTimeout&amp;&amp;clearTimeout(this.#prefetchTimeout),this.#prefetched=null}},FormSubmissionState={initialized:"initialized",requesting:"requesting",waiting:"waiting",receiving:"receiving",stopping:"stopping",stopped:"stopped"};class FormSubmission{state=FormSubmissionState.initialized;static confirmMethod(message){return Promise.resolve(confirm(message))}constructor(delegate,formElement,submitter,mustRedirect=!1){const method=function getMethod(formElement,submitter){const method=submitter?.getAttribute("formmethod")||formElement.getAttribute("method")||"";return fetchMethodFromString(method.toLowerCase())||FetchMethod.get}(formElement,submitter),action=function getAction(formAction,fetchMethod){const action=expandURL(formAction);isSafe(fetchMethod)&amp;&amp;(action.search="");return action}(function getFormAction(formElement,submitter){const formElementAction="string"==typeof formElement.action?formElement.action:null;return submitter?.hasAttribute("formaction")?submitter.getAttribute("formaction")||"":formElement.getAttribute("action")||formElementAction||""}(formElement,submitter),method),body=function buildFormData(formElement,submitter){const formData=new FormData(formElement),name=submitter?.getAttribute("name"),value=submitter?.getAttribute("value");name&amp;&amp;formData.append(name,value||"");return formData}(formElement,submitter),enctype=function getEnctype(formElement,submitter){return function fetchEnctypeFromString(encoding){switch(encoding.toLowerCase()){case FetchEnctype.multipart:return FetchEnctype.multipart;case FetchEnctype.plain:return FetchEnctype.plain;default:return FetchEnctype.urlEncoded}}(submitter?.getAttribute("formenctype")||formElement.enctype)}(formElement,submitter);this.delegate=delegate,this.formElement=formElement,this.submitter=submitter,this.fetchRequest=new FetchRequest(this,method,action,body,formElement,enctype),this.mustRedirect=mustRedirect}get method(){return this.fetchRequest.method}set method(value){this.fetchRequest.method=value}get action(){return this.fetchRequest.url.toString()}set action(value){this.fetchRequest.url=expandURL(value)}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:initialized,requesting:requesting}=FormSubmissionState,confirmationMessage=getAttribute("data-turbo-confirm",this.submitter,this.formElement);if("string"==typeof confirmationMessage){const confirmMethod="function"==typeof config.forms.confirm?config.forms.confirm:FormSubmission.confirmMethod;if(!await confirmMethod(confirmationMessage,this.formElement,this.submitter))return}if(this.state==initialized)return this.state=requesting,this.fetchRequest.perform()}stop(){const{stopping:stopping,stopped:stopped}=FormSubmissionState;if(this.state!=stopping&amp;&amp;this.state!=stopped)return this.state=stopping,this.fetchRequest.cancel(),!0}prepareRequest(request){if(!request.isSafe){const token=function getCookieValue(cookieName){if(null!=cookieName){const cookie=(document.cookie?document.cookie.split("; "):[]).find((cookie=&gt;cookie.startsWith(cookieName)));if(cookie){const value=cookie.split("=").slice(1).join("=");return value?decodeURIComponent(value):void 0}}}(getMetaContent("csrf-param"))||getMetaContent("csrf-token");token&amp;&amp;(request.headers["X-CSRF-Token"]=token)}this.requestAcceptsTurboStreamResponse(request)&amp;&amp;request.acceptResponseType(StreamMessage.contentType)}requestStarted(_request){this.state=FormSubmissionState.waiting,this.submitter&amp;&amp;config.forms.submitter.beforeSubmit(this.submitter),this.setSubmitsWith(),markAsBusy(this.formElement),dispatch("turbo:submit-start",{target:this.formElement,detail:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(request,response){prefetchCache.clear(),this.result={success:response.succeeded,fetchResponse:response}}requestSucceededWithResponse(request,response){if(response.clientError||response.serverError)this.delegate.formSubmissionFailedWithResponse(this,response);else if(prefetchCache.clear(),this.requestMustRedirect(request)&amp;&amp;function responseSucceededWithoutRedirect(response){return 200==response.statusCode&amp;&amp;!response.redirected}(response)){const error=new Error("Form responses must redirect to another location");this.delegate.formSubmissionErrored(this,error)}else this.state=FormSubmissionState.receiving,this.result={success:!0,fetchResponse:response},this.delegate.formSubmissionSucceededWithResponse(this,response)}requestFailedWithResponse(request,response){this.result={success:!1,fetchResponse:response},this.delegate.formSubmissionFailedWithResponse(this,response)}requestErrored(request,error){this.result={success:!1,error:error},this.delegate.formSubmissionErrored(this,error)}requestFinished(_request){this.state=FormSubmissionState.stopped,this.submitter&amp;&amp;config.forms.submitter.afterSubmit(this.submitter),this.resetSubmitterText(),clearBusyState(this.formElement),dispatch("turbo:submit-end",{target:this.formElement,detail:{formSubmission:this,...this.result}}),this.delegate.formSubmissionFinished(this)}setSubmitsWith(){if(this.submitter&amp;&amp;this.submitsWith)if(this.submitter.matches("button"))this.originalSubmitText=this.submitter.innerHTML,this.submitter.innerHTML=this.submitsWith;else if(this.submitter.matches("input")){const input=this.submitter;this.originalSubmitText=input.value,input.value=this.submitsWith}}resetSubmitterText(){if(this.submitter&amp;&amp;this.originalSubmitText)if(this.submitter.matches("button"))this.submitter.innerHTML=this.originalSubmitText;else if(this.submitter.matches("input")){this.submitter.value=this.originalSubmitText}}requestMustRedirect(request){return!request.isSafe&amp;&amp;this.mustRedirect}requestAcceptsTurboStreamResponse(request){return!request.isSafe||function hasAttribute(attributeName,...elements){return elements.some((element=&gt;element&amp;&amp;element.hasAttribute(attributeName)))}("data-turbo-stream",this.submitter,this.formElement)}get submitsWith(){return this.submitter?.getAttribute("data-turbo-submits-with")}}class Snapshot{constructor(element){this.element=element}get activeElement(){return this.element.ownerDocument.activeElement}get children(){return[...this.element.children]}hasAnchor(anchor){return null!=this.getElementForAnchor(anchor)}getElementForAnchor(anchor){return anchor?this.element.querySelector(`[id='${anchor}'], a[name='${anchor}']`):null}get isConnected(){return this.element.isConnected}get firstAutofocusableElement(){return queryAutofocusableElement(this.element)}get permanentElements(){return queryPermanentElementsAll(this.element)}getPermanentElementById(id){return getPermanentElementById(this.element,id)}getPermanentElementMapForSnapshot(snapshot){const permanentElementMap={};for(const currentPermanentElement of this.permanentElements){const{id:id}=currentPermanentElement,newPermanentElement=snapshot.getPermanentElementById(id);newPermanentElement&amp;&amp;(permanentElementMap[id]=[currentPermanentElement,newPermanentElement])}return permanentElementMap}}function getPermanentElementById(node,id){return node.querySelector(`#${id}[data-turbo-permanent]`)}function queryPermanentElementsAll(node){return node.querySelectorAll("[id][data-turbo-permanent]")}class FormSubmitObserver{started=!1;constructor(delegate,eventTarget){this.delegate=delegate,this.eventTarget=eventTarget}start(){this.started||(this.eventTarget.addEventListener("submit",this.submitCaptured,!0),this.started=!0)}stop(){this.started&amp;&amp;(this.eventTarget.removeEventListener("submit",this.submitCaptured,!0),this.started=!1)}submitCaptured=()=&gt;{this.eventTarget.removeEventListener("submit",this.submitBubbled,!1),this.eventTarget.addEventListener("submit",this.submitBubbled,!1)};submitBubbled=event=&gt;{if(!event.defaultPrevented){const form=event.target instanceof HTMLFormElement?event.target:void 0,submitter=event.submitter||void 0;form&amp;&amp;function submissionDoesNotDismissDialog(form,submitter){const method=submitter?.getAttribute("formmethod")||form.getAttribute("method");return"dialog"!=method}(form,submitter)&amp;&amp;function submissionDoesNotTargetIFrame(form,submitter){const target=submitter?.getAttribute("formtarget")||form.getAttribute("target");return doesNotTargetIFrame(target)}(form,submitter)&amp;&amp;this.delegate.willSubmitForm(form,submitter)&amp;&amp;(event.preventDefault(),event.stopImmediatePropagation(),this.delegate.formSubmitted(form,submitter))}}}class View{#resolveRenderPromise=_value=&gt;{};#resolveInterceptionPromise=_value=&gt;{};constructor(delegate,element){this.delegate=delegate,this.element=element}scrollToAnchor(anchor){const element=this.snapshot.getElementForAnchor(anchor);element?(this.scrollToElement(element),this.focusElement(element)):this.scrollToPosition({x:0,y:0})}scrollToAnchorFromLocation(location){this.scrollToAnchor(getAnchor(location))}scrollToElement(element){element.scrollIntoView()}focusElement(element){element instanceof HTMLElement&amp;&amp;(element.hasAttribute("tabindex")?element.focus():(element.setAttribute("tabindex","-1"),element.focus(),element.removeAttribute("tabindex")))}scrollToPosition({x:x,y:y}){this.scrollRoot.scrollTo(x,y)}scrollToTop(){this.scrollToPosition({x:0,y:0})}get scrollRoot(){return window}async render(renderer){const{isPreview:isPreview,shouldRender:shouldRender,willRender:willRender,newSnapshot:snapshot}=renderer,shouldInvalidate=willRender;if(shouldRender)try{this.renderPromise=new Promise((resolve=&gt;this.#resolveRenderPromise=resolve)),this.renderer=renderer,await this.prepareToRenderSnapshot(renderer);const renderInterception=new Promise((resolve=&gt;this.#resolveInterceptionPromise=resolve)),options={resume:this.#resolveInterceptionPromise,render:this.renderer.renderElement,renderMethod:this.renderer.renderMethod};this.delegate.allowsImmediateRender(snapshot,options)||await renderInterception,await this.renderSnapshot(renderer),this.delegate.viewRenderedSnapshot(snapshot,isPreview,this.renderer.renderMethod),this.delegate.preloadOnLoadLinksForView(this.element),this.finishRenderingSnapshot(renderer)}finally{delete this.renderer,this.#resolveRenderPromise(void 0),delete this.renderPromise}else shouldInvalidate&amp;&amp;this.invalidate(renderer.reloadReason)}invalidate(reason){this.delegate.viewInvalidated(reason)}async prepareToRenderSnapshot(renderer){this.markAsPreview(renderer.isPreview),await renderer.prepareToRender()}markAsPreview(isPreview){isPreview?this.element.setAttribute("data-turbo-preview",""):this.element.removeAttribute("data-turbo-preview")}markVisitDirection(direction){this.element.setAttribute("data-turbo-visit-direction",direction)}unmarkVisitDirection(){this.element.removeAttribute("data-turbo-visit-direction")}async renderSnapshot(renderer){await renderer.render()}finishRenderingSnapshot(renderer){renderer.finishRendering()}}class FrameView extends View{missing(){this.element.innerHTML='&lt;strong class="turbo-frame-error"&gt;Content missing&lt;/strong&gt;'}get snapshot(){return new Snapshot(this.element)}}class LinkInterceptor{constructor(delegate,element){this.delegate=delegate,this.element=element}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=event=&gt;{this.clickEventIsSignificant(event)?this.clickEvent=event:delete this.clickEvent};linkClicked=event=&gt;{this.clickEvent&amp;&amp;this.clickEventIsSignificant(event)&amp;&amp;this.delegate.shouldInterceptLinkClick(event.target,event.detail.url,event.detail.originalEvent)&amp;&amp;(this.clickEvent.preventDefault(),event.preventDefault(),this.delegate.linkClickIntercepted(event.target,event.detail.url,event.detail.originalEvent)),delete this.clickEvent};willVisit=_event=&gt;{delete this.clickEvent};clickEventIsSignificant(event){const target=event.composed?event.target?.parentElement:event.target,element=findLinkFromClickTarget(target)||target;return element instanceof Element&amp;&amp;element.closest("turbo-frame, html")==this.element}}class LinkClickObserver{started=!1;constructor(delegate,eventTarget){this.delegate=delegate,this.eventTarget=eventTarget}start(){this.started||(this.eventTarget.addEventListener("click",this.clickCaptured,!0),this.started=!0)}stop(){this.started&amp;&amp;(this.eventTarget.removeEventListener("click",this.clickCaptured,!0),this.started=!1)}clickCaptured=()=&gt;{this.eventTarget.removeEventListener("click",this.clickBubbled,!1),this.eventTarget.addEventListener("click",this.clickBubbled,!1)};clickBubbled=event=&gt;{if(event instanceof MouseEvent&amp;&amp;this.clickEventIsSignificant(event)){const link=findLinkFromClickTarget(event.composedPath&amp;&amp;event.composedPath()[0]||event.target);if(link&amp;&amp;doesNotTargetIFrame(link.target)){const location=getLocationForLink(link);this.delegate.willFollowLinkToLocation(link,location,event)&amp;&amp;(event.preventDefault(),this.delegate.followedLinkToLocation(link,location))}}};clickEventIsSignificant(event){return!(event.target&amp;&amp;event.target.isContentEditable||event.defaultPrevented||event.which&gt;1||event.altKey||event.ctrlKey||event.metaKey||event.shiftKey)}}class FormLinkClickObserver{constructor(delegate,element){this.delegate=delegate,this.linkInterceptor=new LinkClickObserver(this,element)}start(){this.linkInterceptor.start()}stop(){this.linkInterceptor.stop()}canPrefetchRequestToLocation(link,location){return!1}prefetchAndCacheRequestToLocation(link,location){}willFollowLinkToLocation(link,location,originalEvent){return this.delegate.willSubmitFormLinkToLocation(link,location,originalEvent)&amp;&amp;(link.hasAttribute("data-turbo-method")||link.hasAttribute("data-turbo-stream"))}followedLinkToLocation(link,location){const form=document.createElement("form");for(const[name,value]of location.searchParams)form.append(Object.assign(document.createElement("input"),{type:"hidden",name:name,value:value}));const action=Object.assign(location,{search:""});form.setAttribute("data-turbo","true"),form.setAttribute("action",action.href),form.setAttribute("hidden","");const method=link.getAttribute("data-turbo-method");method&amp;&amp;form.setAttribute("method",method);const turboFrame=link.getAttribute("data-turbo-frame");turboFrame&amp;&amp;form.setAttribute("data-turbo-frame",turboFrame);const turboAction=getVisitAction(link);turboAction&amp;&amp;form.setAttribute("data-turbo-action",turboAction);const turboConfirm=link.getAttribute("data-turbo-confirm");turboConfirm&amp;&amp;form.setAttribute("data-turbo-confirm",turboConfirm);link.hasAttribute("data-turbo-stream")&amp;&amp;form.setAttribute("data-turbo-stream",""),this.delegate.submittedFormLinkToLocation(link,location,form),document.body.appendChild(form),form.addEventListener("turbo:submit-end",(()=&gt;form.remove()),{once:!0}),requestAnimationFrame((()=&gt;form.requestSubmit()))}}class Bardo{static async preservingPermanentElements(delegate,permanentElementMap,callback){const bardo=new this(delegate,permanentElementMap);bardo.enter(),await callback(),bardo.leave()}constructor(delegate,permanentElementMap){this.delegate=delegate,this.permanentElementMap=permanentElementMap}enter(){for(const id in this.permanentElementMap){const[currentPermanentElement,newPermanentElement]=this.permanentElementMap[id];this.delegate.enteringBardo(currentPermanentElement,newPermanentElement),this.replaceNewPermanentElementWithPlaceholder(newPermanentElement)}}leave(){for(const id in this.permanentElementMap){const[currentPermanentElement]=this.permanentElementMap[id];this.replaceCurrentPermanentElementWithClone(currentPermanentElement),this.replacePlaceholderWithPermanentElement(currentPermanentElement),this.delegate.leavingBardo(currentPermanentElement)}}replaceNewPermanentElementWithPlaceholder(permanentElement){const placeholder=function createPlaceholderForPermanentElement(permanentElement){const element=document.createElement("meta");return element.setAttribute("name","turbo-permanent-placeholder"),element.setAttribute("content",permanentElement.id),element}(permanentElement);permanentElement.replaceWith(placeholder)}replaceCurrentPermanentElementWithClone(permanentElement){const clone=permanentElement.cloneNode(!0);permanentElement.replaceWith(clone)}replacePlaceholderWithPermanentElement(permanentElement){const placeholder=this.getPlaceholderById(permanentElement.id);placeholder?.replaceWith(permanentElement)}getPlaceholderById(id){return this.placeholders.find((element=&gt;element.content==id))}get placeholders(){return[...document.querySelectorAll("meta[name=turbo-permanent-placeholder][content]")]}}class Renderer{#activeElement=null;static renderElement(currentElement,newElement){}constructor(currentSnapshot,newSnapshot,isPreview,willRender=!0){this.currentSnapshot=currentSnapshot,this.newSnapshot=newSnapshot,this.isPreview=isPreview,this.willRender=willRender,this.renderElement=this.constructor.renderElement,this.promise=new Promise(((resolve,reject)=&gt;this.resolvingFunctions={resolve:resolve,reject:reject}))}get shouldRender(){return!0}get shouldAutofocus(){return!0}get reloadReason(){}prepareToRender(){}render(){}finishRendering(){this.resolvingFunctions&amp;&amp;(this.resolvingFunctions.resolve(),delete this.resolvingFunctions)}async preservingPermanentElements(callback){await Bardo.preservingPermanentElements(this,this.permanentElementMap,callback)}focusFirstAutofocusableElement(){if(this.shouldAutofocus){const element=this.connectedSnapshot.firstAutofocusableElement;element&amp;&amp;element.focus()}}enteringBardo(currentPermanentElement){this.#activeElement||currentPermanentElement.contains(this.currentSnapshot.activeElement)&amp;&amp;(this.#activeElement=this.currentSnapshot.activeElement)}leavingBardo(currentPermanentElement){currentPermanentElement.contains(this.#activeElement)&amp;&amp;this.#activeElement instanceof HTMLElement&amp;&amp;(this.#activeElement.focus(),this.#activeElement=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 FrameRenderer extends Renderer{static renderElement(currentElement,newElement){const destinationRange=document.createRange();destinationRange.selectNodeContents(currentElement),destinationRange.deleteContents();const frameElement=newElement,sourceRange=frameElement.ownerDocument?.createRange();sourceRange&amp;&amp;(sourceRange.selectNodeContents(frameElement),currentElement.appendChild(sourceRange.extractContents()))}constructor(delegate,currentSnapshot,newSnapshot,renderElement,isPreview,willRender=!0){super(currentSnapshot,newSnapshot,renderElement,isPreview,willRender),this.delegate=delegate}get shouldRender(){return!0}async render(){await nextRepaint(),this.preservingPermanentElements((()=&gt;{this.loadFrameElement()})),this.scrollFrameIntoView(),await nextRepaint(),this.focusFirstAutofocusableElement(),await nextRepaint(),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 element=this.currentElement.firstElementChild,block=function readScrollLogicalPosition(value,defaultValue){return"end"==value||"start"==value||"center"==value||"nearest"==value?value:defaultValue}(this.currentElement.getAttribute("data-autoscroll-block"),"end"),behavior=function readScrollBehavior(value,defaultValue){return"auto"==value||"smooth"==value?value:defaultValue}(this.currentElement.getAttribute("data-autoscroll-behavior"),"auto");if(element)return element.scrollIntoView({block:block,behavior:behavior}),!0}return!1}activateScriptElements(){for(const inertScriptElement of this.newScriptElements){const activatedScriptElement=activateScriptElement(inertScriptElement);inertScriptElement.replaceWith(activatedScriptElement)}}get newScriptElements(){return this.currentElement.querySelectorAll("script")}}var Idiomorph=function(){let EMPTY_SET=new Set,defaults={morphStyle:"outerHTML",callbacks:{beforeNodeAdded:noOp,afterNodeAdded:noOp,beforeNodeMorphed:noOp,afterNodeMorphed:noOp,beforeNodeRemoved:noOp,afterNodeRemoved:noOp,beforeAttributeUpdated:noOp},head:{style:"merge",shouldPreserve:function(elt){return"true"===elt.getAttribute("im-preserve")},shouldReAppend:function(elt){return"true"===elt.getAttribute("im-re-append")},shouldRemove:noOp,afterHeadMorphed:noOp}};function morphNormalizedContent(oldNode,normalizedNewContent,ctx){if(ctx.head.block){let oldHead=oldNode.querySelector("head"),newHead=normalizedNewContent.querySelector("head");if(oldHead&amp;&amp;newHead){let promises=handleHeadElement(newHead,oldHead,ctx);return void Promise.all(promises).then((function(){morphNormalizedContent(oldNode,normalizedNewContent,Object.assign(ctx,{head:{block:!1,ignore:!0}}))}))}}if("innerHTML"===ctx.morphStyle)return morphChildren(normalizedNewContent,oldNode,ctx),oldNode.children;if("outerHTML"===ctx.morphStyle||null==ctx.morphStyle){let bestMatch=function findBestNodeMatch(newContent,oldNode,ctx){let currentElement;currentElement=newContent.firstChild;let bestElement=currentElement,score=0;for(;currentElement;){let newScore=scoreElement(currentElement,oldNode,ctx);newScore&gt;score&amp;&amp;(bestElement=currentElement,score=newScore),currentElement=currentElement.nextSibling}return bestElement}(normalizedNewContent,oldNode,ctx),previousSibling=bestMatch?.previousSibling,nextSibling=bestMatch?.nextSibling,morphedNode=morphOldNodeTo(oldNode,bestMatch,ctx);return bestMatch?function insertSiblings(previousSibling,morphedNode,nextSibling){let stack=[],added=[];for(;null!=previousSibling;)stack.push(previousSibling),previousSibling=previousSibling.previousSibling;for(;stack.length&gt;0;){let node=stack.pop();added.push(node),morphedNode.parentElement.insertBefore(node,morphedNode)}added.push(morphedNode);for(;null!=nextSibling;)stack.push(nextSibling),added.push(nextSibling),nextSibling=nextSibling.nextSibling;for(;stack.length&gt;0;)morphedNode.parentElement.insertBefore(stack.pop(),morphedNode.nextSibling);return added}(previousSibling,morphedNode,nextSibling):[]}throw"Do not understand how to morph style "+ctx.morphStyle}function ignoreValueOfActiveElement(possibleActiveElement,ctx){return ctx.ignoreActiveValue&amp;&amp;possibleActiveElement===document.activeElement&amp;&amp;possibleActiveElement!==document.body}function morphOldNodeTo(oldNode,newContent,ctx){if(!ctx.ignoreActive||oldNode!==document.activeElement)return null==newContent?!1===ctx.callbacks.beforeNodeRemoved(oldNode)?oldNode:(oldNode.remove(),ctx.callbacks.afterNodeRemoved(oldNode),null):isSoftMatch(oldNode,newContent)?(!1===ctx.callbacks.beforeNodeMorphed(oldNode,newContent)||(oldNode instanceof HTMLHeadElement&amp;&amp;ctx.head.ignore||(oldNode instanceof HTMLHeadElement&amp;&amp;"morph"!==ctx.head.style?handleHeadElement(newContent,oldNode,ctx):(!function syncNodeFrom(from,to,ctx){let type=from.nodeType;if(1===type){const fromAttributes=from.attributes,toAttributes=to.attributes;for(const fromAttribute of fromAttributes)ignoreAttribute(fromAttribute.name,to,"update",ctx)||to.getAttribute(fromAttribute.name)!==fromAttribute.value&amp;&amp;to.setAttribute(fromAttribute.name,fromAttribute.value);for(let i=toAttributes.length-1;0&lt;=i;i--){const toAttribute=toAttributes[i];ignoreAttribute(toAttribute.name,to,"remove",ctx)||(from.hasAttribute(toAttribute.name)||to.removeAttribute(toAttribute.name))}}8!==type&amp;&amp;3!==type||to.nodeValue!==from.nodeValue&amp;&amp;(to.nodeValue=from.nodeValue);ignoreValueOfActiveElement(to,ctx)||function syncInputValue(from,to,ctx){if(from instanceof HTMLInputElement&amp;&amp;to instanceof HTMLInputElement&amp;&amp;"file"!==from.type){let fromValue=from.value,toValue=to.value;syncBooleanAttribute(from,to,"checked",ctx),syncBooleanAttribute(from,to,"disabled",ctx),from.hasAttribute("value")?fromValue!==toValue&amp;&amp;(ignoreAttribute("value",to,"update",ctx)||(to.setAttribute("value",fromValue),to.value=fromValue)):ignoreAttribute("value",to,"remove",ctx)||(to.value="",to.removeAttribute("value"))}else if(from instanceof HTMLOptionElement)syncBooleanAttribute(from,to,"selected",ctx);else if(from instanceof HTMLTextAreaElement&amp;&amp;to instanceof HTMLTextAreaElement){let fromValue=from.value,toValue=to.value;if(ignoreAttribute("value",to,"update",ctx))return;fromValue!==toValue&amp;&amp;(to.value=fromValue),to.firstChild&amp;&amp;to.firstChild.nodeValue!==fromValue&amp;&amp;(to.firstChild.nodeValue=fromValue)}}(from,to,ctx)}(newContent,oldNode,ctx),ignoreValueOfActiveElement(oldNode,ctx)||morphChildren(newContent,oldNode,ctx))),ctx.callbacks.afterNodeMorphed(oldNode,newContent)),oldNode):!1===ctx.callbacks.beforeNodeRemoved(oldNode)||!1===ctx.callbacks.beforeNodeAdded(newContent)?oldNode:(oldNode.parentElement.replaceChild(newContent,oldNode),ctx.callbacks.afterNodeAdded(newContent),ctx.callbacks.afterNodeRemoved(oldNode),newContent)}function morphChildren(newParent,oldParent,ctx){let newChild,nextNewChild=newParent.firstChild,insertionPoint=oldParent.firstChild;for(;nextNewChild;){if(newChild=nextNewChild,nextNewChild=newChild.nextSibling,null==insertionPoint){if(!1===ctx.callbacks.beforeNodeAdded(newChild))return;oldParent.appendChild(newChild),ctx.callbacks.afterNodeAdded(newChild),removeIdsFromConsideration(ctx,newChild);continue}if(isIdSetMatch(newChild,insertionPoint,ctx)){morphOldNodeTo(insertionPoint,newChild,ctx),insertionPoint=insertionPoint.nextSibling,removeIdsFromConsideration(ctx,newChild);continue}let idSetMatch=findIdSetMatch(newParent,oldParent,newChild,insertionPoint,ctx);if(idSetMatch){insertionPoint=removeNodesBetween(insertionPoint,idSetMatch,ctx),morphOldNodeTo(idSetMatch,newChild,ctx),removeIdsFromConsideration(ctx,newChild);continue}let softMatch=findSoftMatch(newParent,oldParent,newChild,insertionPoint,ctx);if(softMatch)insertionPoint=removeNodesBetween(insertionPoint,softMatch,ctx),morphOldNodeTo(softMatch,newChild,ctx),removeIdsFromConsideration(ctx,newChild);else{if(!1===ctx.callbacks.beforeNodeAdded(newChild))return;oldParent.insertBefore(newChild,insertionPoint),ctx.callbacks.afterNodeAdded(newChild),removeIdsFromConsideration(ctx,newChild)}}for(;null!==insertionPoint;){let tempNode=insertionPoint;insertionPoint=insertionPoint.nextSibling,removeNode(tempNode,ctx)}}function ignoreAttribute(attr,to,updateType,ctx){return!("value"!==attr||!ctx.ignoreActiveValue||to!==document.activeElement)||!1===ctx.callbacks.beforeAttributeUpdated(attr,to,updateType)}function syncBooleanAttribute(from,to,attributeName,ctx){if(from[attributeName]!==to[attributeName]){let ignoreUpdate=ignoreAttribute(attributeName,to,"update",ctx);ignoreUpdate||(to[attributeName]=from[attributeName]),from[attributeName]?ignoreUpdate||to.setAttribute(attributeName,from[attributeName]):ignoreAttribute(attributeName,to,"remove",ctx)||to.removeAttribute(attributeName)}}function handleHeadElement(newHeadTag,currentHead,ctx){let added=[],removed=[],preserved=[],nodesToAppend=[],headMergeStyle=ctx.head.style,srcToNewHeadNodes=new Map;for(const newHeadChild of newHeadTag.children)srcToNewHeadNodes.set(newHeadChild.outerHTML,newHeadChild);for(const currentHeadElt of currentHead.children){let inNewContent=srcToNewHeadNodes.has(currentHeadElt.outerHTML),isReAppended=ctx.head.shouldReAppend(currentHeadElt),isPreserved=ctx.head.shouldPreserve(currentHeadElt);inNewContent||isPreserved?isReAppended?removed.push(currentHeadElt):(srcToNewHeadNodes.delete(currentHeadElt.outerHTML),preserved.push(currentHeadElt)):"append"===headMergeStyle?isReAppended&amp;&amp;(removed.push(currentHeadElt),nodesToAppend.push(currentHeadElt)):!1!==ctx.head.shouldRemove(currentHeadElt)&amp;&amp;removed.push(currentHeadElt)}nodesToAppend.push(...srcToNewHeadNodes.values());let promises=[];for(const newNode of nodesToAppend){let newElt=document.createRange().createContextualFragment(newNode.outerHTML).firstChild;if(!1!==ctx.callbacks.beforeNodeAdded(newElt)){if(newElt.href||newElt.src){let resolve=null,promise=new Promise((function(_resolve){resolve=_resolve}));newElt.addEventListener("load",(function(){resolve()})),promises.push(promise)}currentHead.appendChild(newElt),ctx.callbacks.afterNodeAdded(newElt),added.push(newElt)}}for(const removedElement of removed)!1!==ctx.callbacks.beforeNodeRemoved(removedElement)&amp;&amp;(currentHead.removeChild(removedElement),ctx.callbacks.afterNodeRemoved(removedElement));return ctx.head.afterHeadMorphed(currentHead,{added:added,kept:preserved,removed:removed}),promises}function noOp(){}function isIdSetMatch(node1,node2,ctx){return null!=node1&amp;&amp;null!=node2&amp;&amp;(node1.nodeType===node2.nodeType&amp;&amp;node1.tagName===node2.tagName&amp;&amp;(""!==node1.id&amp;&amp;node1.id===node2.id||getIdIntersectionCount(ctx,node1,node2)&gt;0))}function isSoftMatch(node1,node2){return null!=node1&amp;&amp;null!=node2&amp;&amp;(node1.nodeType===node2.nodeType&amp;&amp;node1.tagName===node2.tagName)}function removeNodesBetween(startInclusive,endExclusive,ctx){for(;startInclusive!==endExclusive;){let tempNode=startInclusive;startInclusive=startInclusive.nextSibling,removeNode(tempNode,ctx)}return removeIdsFromConsideration(ctx,endExclusive),endExclusive.nextSibling}function findIdSetMatch(newContent,oldParent,newChild,insertionPoint,ctx){let newChildPotentialIdCount=getIdIntersectionCount(ctx,newChild,oldParent);if(newChildPotentialIdCount&gt;0){let potentialMatch=insertionPoint,otherMatchCount=0;for(;null!=potentialMatch;){if(isIdSetMatch(newChild,potentialMatch,ctx))return potentialMatch;if(otherMatchCount+=getIdIntersectionCount(ctx,potentialMatch,newContent),otherMatchCount&gt;newChildPotentialIdCount)return null;potentialMatch=potentialMatch.nextSibling}}return null}function findSoftMatch(newContent,oldParent,newChild,insertionPoint,ctx){let potentialSoftMatch=insertionPoint,nextSibling=newChild.nextSibling,siblingSoftMatchCount=0;for(;null!=potentialSoftMatch;){if(getIdIntersectionCount(ctx,potentialSoftMatch,newContent)&gt;0)return null;if(isSoftMatch(newChild,potentialSoftMatch))return potentialSoftMatch;if(isSoftMatch(nextSibling,potentialSoftMatch)&amp;&amp;(siblingSoftMatchCount++,nextSibling=nextSibling.nextSibling,siblingSoftMatchCount&gt;=2))return null;potentialSoftMatch=potentialSoftMatch.nextSibling}return potentialSoftMatch}function scoreElement(node1,node2,ctx){return isSoftMatch(node1,node2)?.5+getIdIntersectionCount(ctx,node1,node2):0}function removeNode(tempNode,ctx){removeIdsFromConsideration(ctx,tempNode),!1!==ctx.callbacks.beforeNodeRemoved(tempNode)&amp;&amp;(tempNode.remove(),ctx.callbacks.afterNodeRemoved(tempNode))}function isIdInConsideration(ctx,id){return!ctx.deadIds.has(id)}function idIsWithinNode(ctx,id,targetNode){return(ctx.idMap.get(targetNode)||EMPTY_SET).has(id)}function removeIdsFromConsideration(ctx,node){let idSet=ctx.idMap.get(node)||EMPTY_SET;for(const id of idSet)ctx.deadIds.add(id)}function getIdIntersectionCount(ctx,node1,node2){let sourceSet=ctx.idMap.get(node1)||EMPTY_SET,matchCount=0;for(const id of sourceSet)isIdInConsideration(ctx,id)&amp;&amp;idIsWithinNode(ctx,id,node2)&amp;&amp;++matchCount;return matchCount}function populateIdMapForNode(node,idMap){let nodeParent=node.parentElement,idElements=node.querySelectorAll("[id]");for(const elt of idElements){let current=elt;for(;current!==nodeParent&amp;&amp;null!=current;){let idSet=idMap.get(current);null==idSet&amp;&amp;(idSet=new Set,idMap.set(current,idSet)),idSet.add(elt.id),current=current.parentElement}}}function createIdMap(oldContent,newContent){let idMap=new Map;return populateIdMapForNode(oldContent,idMap),populateIdMapForNode(newContent,idMap),idMap}return{morph:function morph(oldNode,newContent,config={}){oldNode instanceof Document&amp;&amp;(oldNode=oldNode.documentElement),"string"==typeof newContent&amp;&amp;(newContent=function parseContent(newContent){let parser=new DOMParser,contentWithSvgsRemoved=newContent.replace(/&lt;svg(\s[^&gt;]*&gt;|&gt;)([\s\S]*?)&lt;\/svg&gt;/gim,"");if(contentWithSvgsRemoved.match(/&lt;\/html&gt;/)||contentWithSvgsRemoved.match(/&lt;\/head&gt;/)||contentWithSvgsRemoved.match(/&lt;\/body&gt;/)){let content=parser.parseFromString(newContent,"text/html");if(contentWithSvgsRemoved.match(/&lt;\/html&gt;/))return content.generatedByIdiomorph=!0,content;{let htmlElement=content.firstChild;return htmlElement?(htmlElement.generatedByIdiomorph=!0,htmlElement):null}}{let content=parser.parseFromString("&lt;body&gt;&lt;template&gt;"+newContent+"&lt;/template&gt;&lt;/body&gt;","text/html").body.querySelector("template").content;return content.generatedByIdiomorph=!0,content}}(newContent));let normalizedContent=function normalizeContent(newContent){if(null==newContent){return document.createElement("div")}if(newContent.generatedByIdiomorph)return newContent;if(newContent instanceof Node){const dummyParent=document.createElement("div");return dummyParent.append(newContent),dummyParent}{const dummyParent=document.createElement("div");for(const elt of[...newContent])dummyParent.append(elt);return dummyParent}}(newContent),ctx=function createMorphContext(oldNode,newContent,config){return config=function mergeDefaults(config){let finalConfig={};return Object.assign(finalConfig,defaults),Object.assign(finalConfig,config),finalConfig.callbacks={},Object.assign(finalConfig.callbacks,defaults.callbacks),Object.assign(finalConfig.callbacks,config.callbacks),finalConfig.head={},Object.assign(finalConfig.head,defaults.head),Object.assign(finalConfig.head,config.head),finalConfig}(config),{target:oldNode,newContent:newContent,config:config,morphStyle:config.morphStyle,ignoreActive:config.ignoreActive,ignoreActiveValue:config.ignoreActiveValue,idMap:createIdMap(oldNode,newContent),deadIds:new Set,callbacks:config.callbacks,head:config.head}}(oldNode,normalizedContent,config);return morphNormalizedContent(oldNode,normalizedContent,ctx)},defaults:defaults}}();function morphElements(currentElement,newElement,{callbacks:callbacks,...options}={}){Idiomorph.morph(currentElement,newElement,{...options,callbacks:new DefaultIdiomorphCallbacks(callbacks)})}function morphChildren(currentElement,newElement){morphElements(currentElement,newElement.children,{morphStyle:"innerHTML"})}class DefaultIdiomorphCallbacks{#beforeNodeMorphed;constructor({beforeNodeMorphed:beforeNodeMorphed}={}){this.#beforeNodeMorphed=beforeNodeMorphed||(()=&gt;!0)}beforeNodeAdded=node=&gt;!(node.id&amp;&amp;node.hasAttribute("data-turbo-permanent")&amp;&amp;document.getElementById(node.id));beforeNodeMorphed=(currentElement,newElement)=&gt;{if(currentElement instanceof Element){if(!currentElement.hasAttribute("data-turbo-permanent")&amp;&amp;this.#beforeNodeMorphed(currentElement,newElement)){return!dispatch("turbo:before-morph-element",{cancelable:!0,target:currentElement,detail:{currentElement:currentElement,newElement:newElement}}).defaultPrevented}return!1}};beforeAttributeUpdated=(attributeName,target,mutationType)=&gt;!dispatch("turbo:before-morph-attribute",{cancelable:!0,target:target,detail:{attributeName:attributeName,mutationType:mutationType}}).defaultPrevented;beforeNodeRemoved=node=&gt;this.beforeNodeMorphed(node);afterNodeMorphed=(currentElement,newElement)=&gt;{currentElement instanceof Element&amp;&amp;dispatch("turbo:morph-element",{target:currentElement,detail:{currentElement:currentElement,newElement:newElement}})}}class MorphingFrameRenderer extends FrameRenderer{static renderElement(currentElement,newElement){dispatch("turbo:before-frame-morph",{target:currentElement,detail:{currentElement:currentElement,newElement:newElement}}),morphChildren(currentElement,newElement)}async preservingPermanentElements(callback){return await callback()}}class ProgressBar{static animationDuration=300;static get defaultCSS(){return unindent`
      .turbo-progress-bar {
        position: fixed;
        display: block;
        top: 0;
        left: 0;
        height: 3px;
        background: #0076ff;
        z-index: 2147483647;
        transition:
          width ${ProgressBar.animationDuration}ms ease-out,
          opacity ${ProgressBar.animationDuration/2}ms ${ProgressBar.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&amp;&amp;!this.hiding&amp;&amp;(this.hiding=!0,this.fadeProgressElement((()=&gt;{this.uninstallProgressElement(),this.stopTrickling(),this.visible=!1,this.hiding=!1})))}setValue(value){this.value=value,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(callback){this.progressElement.style.opacity="0",setTimeout(callback,1.5*ProgressBar.animationDuration)}uninstallProgressElement(){this.progressElement.parentNode&amp;&amp;document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,ProgressBar.animationDuration))}stopTrickling(){window.clearInterval(this.trickleInterval),delete this.trickleInterval}trickle=()=&gt;{this.setValue(this.value+Math.random()/100)};refresh(){requestAnimationFrame((()=&gt;{this.progressElement.style.width=10+90*this.value+"%"}))}createStylesheetElement(){const element=document.createElement("style");element.type="text/css",element.textContent=ProgressBar.defaultCSS;const cspNonce=getCspNonce();return cspNonce&amp;&amp;(element.nonce=cspNonce),element}createProgressElement(){const element=document.createElement("div");return element.className="turbo-progress-bar",element}}class HeadSnapshot extends Snapshot{detailsByOuterHTML=this.children.filter((element=&gt;!function elementIsNoscript(element){const tagName=element.localName;return"noscript"==tagName}(element))).map((element=&gt;function elementWithoutNonce(element){element.hasAttribute("nonce")&amp;&amp;element.setAttribute("nonce","");return element}(element))).reduce(((result,element)=&gt;{const{outerHTML:outerHTML}=element,details=outerHTML in result?result[outerHTML]:{type:elementType(element),tracked:elementIsTracked(element),elements:[]};return{...result,[outerHTML]:{...details,elements:[...details.elements,element]}}}),{});get trackedElementSignature(){return Object.keys(this.detailsByOuterHTML).filter((outerHTML=&gt;this.detailsByOuterHTML[outerHTML].tracked)).join("")}getScriptElementsNotInSnapshot(snapshot){return this.getElementsMatchingTypeNotInSnapshot("script",snapshot)}getStylesheetElementsNotInSnapshot(snapshot){return this.getElementsMatchingTypeNotInSnapshot("stylesheet",snapshot)}getElementsMatchingTypeNotInSnapshot(matchedType,snapshot){return Object.keys(this.detailsByOuterHTML).filter((outerHTML=&gt;!(outerHTML in snapshot.detailsByOuterHTML))).map((outerHTML=&gt;this.detailsByOuterHTML[outerHTML])).filter((({type:type})=&gt;type==matchedType)).map((({elements:[element]})=&gt;element))}get provisionalElements(){return Object.keys(this.detailsByOuterHTML).reduce(((result,outerHTML)=&gt;{const{type:type,tracked:tracked,elements:elements}=this.detailsByOuterHTML[outerHTML];return null!=type||tracked?elements.length&gt;1?[...result,...elements.slice(1)]:result:[...result,...elements]}),[])}getMetaValue(name){const element=this.findMetaElementByName(name);return element?element.getAttribute("content"):null}findMetaElementByName(name){return Object.keys(this.detailsByOuterHTML).reduce(((result,outerHTML)=&gt;{const{elements:[element]}=this.detailsByOuterHTML[outerHTML];return function elementIsMetaElementWithName(element,name){const tagName=element.localName;return"meta"==tagName&amp;&amp;element.getAttribute("name")==name}(element,name)?element:result}),0)}}function elementType(element){return function elementIsScript(element){const tagName=element.localName;return"script"==tagName}(element)?"script":function elementIsStylesheet(element){const tagName=element.localName;return"style"==tagName||"link"==tagName&amp;&amp;"stylesheet"==element.getAttribute("rel")}(element)?"stylesheet":void 0}function elementIsTracked(element){return"reload"==element.getAttribute("data-turbo-track")}class PageSnapshot extends Snapshot{static fromHTMLString(html=""){return this.fromDocument(parseHTMLDocument(html))}static fromElement(element){return this.fromDocument(element.ownerDocument)}static fromDocument({documentElement:documentElement,body:body,head:head}){return new this(documentElement,body,new HeadSnapshot(head))}constructor(documentElement,body,headSnapshot){super(body),this.documentElement=documentElement,this.headSnapshot=headSnapshot}clone(){const clonedElement=this.element.cloneNode(!0),selectElements=this.element.querySelectorAll("select"),clonedSelectElements=clonedElement.querySelectorAll("select");for(const[index,source]of selectElements.entries()){const clone=clonedSelectElements[index];for(const option of clone.selectedOptions)option.selected=!1;for(const option of source.selectedOptions)clone.options[option.index].selected=!0}for(const clonedPasswordInput of clonedElement.querySelectorAll('input[type="password"]'))clonedPasswordInput.value="";return new PageSnapshot(this.documentElement,clonedElement,this.headSnapshot)}get lang(){return this.documentElement.getAttribute("lang")}get headElement(){return this.headSnapshot.element}get rootLocation(){return expandURL(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"same-origin"===this.headSnapshot.getMetaValue("view-transition")}get shouldMorphPage(){return"morph"===this.getSetting("refresh-method")}get shouldPreserveScrollPosition(){return"preserve"===this.getSetting("refresh-scroll")}getSetting(name){return this.headSnapshot.getMetaValue(`turbo-${name}`)}}class ViewTransitioner{#viewTransitionStarted=!1;#lastOperation=Promise.resolve();renderChange(useViewTransition,render){return useViewTransition&amp;&amp;this.viewTransitionsAvailable&amp;&amp;!this.#viewTransitionStarted?(this.#viewTransitionStarted=!0,this.#lastOperation=this.#lastOperation.then((async()=&gt;{await document.startViewTransition(render).finished}))):this.#lastOperation=this.#lastOperation.then(render),this.#lastOperation}get viewTransitionsAvailable(){return document.startViewTransition}}const defaultOptions={action:"advance",historyChanged:!1,visitCachedSnapshot:()=&gt;{},willRender:!0,updateHistory:!0,shouldCacheSnapshot:!0,acceptsStreamResponse:!1},TimingMetric_visitStart="visitStart",TimingMetric_requestStart="requestStart",TimingMetric_requestEnd="requestEnd",TimingMetric_visitEnd="visitEnd",VisitState_initialized="initialized",VisitState_started="started",VisitState_canceled="canceled",VisitState_failed="failed",VisitState_completed="completed",SystemStatusCode_networkFailure=0,SystemStatusCode_timeoutFailure=-1,SystemStatusCode_contentTypeMismatch=-2,Direction={advance:"forward",restore:"back",replace:"none"};class Visit{identifier=uuid();timingMetrics={};followedRedirect=!1;historyChanged=!1;scrolled=!1;shouldCacheSnapshot=!0;acceptsStreamResponse=!1;snapshotCached=!1;state=VisitState_initialized;viewTransitioner=new ViewTransitioner;constructor(delegate,location,restorationIdentifier,options={}){this.delegate=delegate,this.location=location,this.restorationIdentifier=restorationIdentifier||uuid();const{action:action,historyChanged:historyChanged,referrer:referrer,snapshot:snapshot,snapshotHTML:snapshotHTML,response:response,visitCachedSnapshot:visitCachedSnapshot,willRender:willRender,updateHistory:updateHistory,shouldCacheSnapshot:shouldCacheSnapshot,acceptsStreamResponse:acceptsStreamResponse,direction:direction}={...defaultOptions,...options};this.action=action,this.historyChanged=historyChanged,this.referrer=referrer,this.snapshot=snapshot,this.snapshotHTML=snapshotHTML,this.response=response,this.isSamePage=this.delegate.locationWithActionIsSamePage(this.location,this.action),this.isPageRefresh=this.view.isPageRefresh(this),this.visitCachedSnapshot=visitCachedSnapshot,this.willRender=willRender,this.updateHistory=updateHistory,this.scrolled=!willRender,this.shouldCacheSnapshot=shouldCacheSnapshot,this.acceptsStreamResponse=acceptsStreamResponse,this.direction=direction||Direction[action]}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)}get silent(){return this.isSamePage}start(){this.state==VisitState_initialized&amp;&amp;(this.recordTimingMetric(TimingMetric_visitStart),this.state=VisitState_started,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==VisitState_started&amp;&amp;(this.request&amp;&amp;this.request.cancel(),this.cancelRender(),this.state=VisitState_canceled)}complete(){this.state==VisitState_started&amp;&amp;(this.recordTimingMetric(TimingMetric_visitEnd),this.adapter.visitCompleted(this),this.state=VisitState_completed,this.followRedirect(),this.followedRedirect||this.delegate.visitCompleted(this))}fail(){this.state==VisitState_started&amp;&amp;(this.state=VisitState_failed,this.adapter.visitFailed(this),this.delegate.visitCompleted(this))}changeHistory(){if(!this.historyChanged&amp;&amp;this.updateHistory){const method=getHistoryMethodForAction(this.location.href===this.referrer?.href?"replace":this.action);this.history.update(method,this.location,this.restorationIdentifier),this.historyChanged=!0}}issueRequest(){this.hasPreloadedResponse()?this.simulateRequest():this.shouldIssueRequest()&amp;&amp;!this.request&amp;&amp;(this.request=new FetchRequest(this,FetchMethod.get,this.location),this.request.perform())}simulateRequest(){this.response&amp;&amp;(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric(TimingMetric_requestStart),this.adapter.visitRequestStarted(this)}recordResponse(response=this.response){if(this.response=response,response){const{statusCode:statusCode}=response;isSuccessful(statusCode)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,statusCode)}}finishRequest(){this.recordTimingMetric(TimingMetric_requestEnd),this.adapter.visitRequestFinished(this)}loadResponse(){if(this.response){const{statusCode:statusCode,responseHTML:responseHTML}=this.response;this.render((async()=&gt;{if(this.shouldCacheSnapshot&amp;&amp;this.cacheSnapshot(),this.view.renderPromise&amp;&amp;await this.view.renderPromise,isSuccessful(statusCode)&amp;&amp;null!=responseHTML){const snapshot=PageSnapshot.fromHTMLString(responseHTML);await this.renderPageSnapshot(snapshot,!1),this.adapter.visitRendered(this),this.complete()}else await this.view.renderError(PageSnapshot.fromHTMLString(responseHTML),this),this.adapter.visitRendered(this),this.fail()}))}}getCachedSnapshot(){const snapshot=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(snapshot&amp;&amp;(!getAnchor(this.location)||snapshot.hasAnchor(getAnchor(this.location)))&amp;&amp;("restore"==this.action||snapshot.isPreviewable))return snapshot}getPreloadedSnapshot(){if(this.snapshotHTML)return PageSnapshot.fromHTMLString(this.snapshotHTML)}hasCachedSnapshot(){return null!=this.getCachedSnapshot()}loadCachedSnapshot(){const snapshot=this.getCachedSnapshot();if(snapshot){const isPreview=this.shouldIssueRequest();this.render((async()=&gt;{this.cacheSnapshot(),this.isSamePage||this.isPageRefresh?this.adapter.visitRendered(this):(this.view.renderPromise&amp;&amp;await this.view.renderPromise,await this.renderPageSnapshot(snapshot,isPreview),this.adapter.visitRendered(this),isPreview||this.complete())}))}}followRedirect(){this.redirectedToLocation&amp;&amp;!this.followedRedirect&amp;&amp;this.response?.redirected&amp;&amp;(this.adapter.visitProposedToLocation(this.redirectedToLocation,{action:"replace",response:this.response,shouldCacheSnapshot:!1,willRender:!1}),this.followedRedirect=!0)}goToSamePageAnchor(){this.isSamePage&amp;&amp;this.render((async()=&gt;{this.cacheSnapshot(),this.performScroll(),this.changeHistory(),this.adapter.visitRendered(this)}))}prepareRequest(request){this.acceptsStreamResponse&amp;&amp;request.acceptResponseType(StreamMessage.contentType)}requestStarted(){this.startRequest()}requestPreventedHandlingResponse(_request,_response){}async requestSucceededWithResponse(request,response){const responseHTML=await response.responseHTML,{redirected:redirected,statusCode:statusCode}=response;null==responseHTML?this.recordResponse({statusCode:SystemStatusCode_contentTypeMismatch,redirected:redirected}):(this.redirectedToLocation=response.redirected?response.location:void 0,this.recordResponse({statusCode:statusCode,responseHTML:responseHTML,redirected:redirected}))}async requestFailedWithResponse(request,response){const responseHTML=await response.responseHTML,{redirected:redirected,statusCode:statusCode}=response;null==responseHTML?this.recordResponse({statusCode:SystemStatusCode_contentTypeMismatch,redirected:redirected}):this.recordResponse({statusCode:statusCode,responseHTML:responseHTML,redirected:redirected})}requestErrored(_request,_error){this.recordResponse({statusCode:SystemStatusCode_networkFailure,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.isSamePage&amp;&amp;this.delegate.visitScrolledToSamePageLocation(this.view.lastRenderedLocation,this.location),this.scrolled=!0)}scrollToRestoredPosition(){const{scrollPosition:scrollPosition}=this.restorationData;if(scrollPosition)return this.view.scrollToPosition(scrollPosition),!0}scrollToAnchor(){const anchor=getAnchor(this.location);if(null!=anchor)return this.view.scrollToAnchor(anchor),!0}recordTimingMetric(metric){this.timingMetrics[metric]=(new Date).getTime()}getTimingMetrics(){return{...this.timingMetrics}}getHistoryMethodForAction(action){switch(action){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}hasPreloadedResponse(){return"object"==typeof this.response}shouldIssueRequest(){return!this.isSamePage&amp;&amp;("restore"==this.action?!this.hasCachedSnapshot():this.willRender)}cacheSnapshot(){this.snapshotCached||(this.view.cacheSnapshot(this.snapshot).then((snapshot=&gt;snapshot&amp;&amp;this.visitCachedSnapshot(snapshot))),this.snapshotCached=!0)}async render(callback){this.cancelRender(),await new Promise((resolve=&gt;{this.frame="hidden"===document.visibilityState?setTimeout((()=&gt;resolve()),0):requestAnimationFrame((()=&gt;resolve()))})),await callback(),delete this.frame}async renderPageSnapshot(snapshot,isPreview){await this.viewTransitioner.renderChange(this.view.shouldTransitionTo(snapshot),(async()=&gt;{await this.view.renderPage(snapshot,isPreview,this.willRender,this),this.performScroll()}))}cancelRender(){this.frame&amp;&amp;(cancelAnimationFrame(this.frame),delete this.frame)}}function isSuccessful(statusCode){return statusCode&gt;=200&amp;&amp;statusCode&lt;300}class BrowserAdapter{progressBar=new ProgressBar;constructor(session){this.session=session}visitProposedToLocation(location,options){locationIsVisitable(location,this.navigator.rootLocation)?this.navigator.startVisit(location,options?.restorationIdentifier||uuid(),options):window.location.href=location.toString()}visitStarted(visit){this.location=visit.location,visit.loadCachedSnapshot(),visit.issueRequest(),visit.goToSamePageAnchor()}visitRequestStarted(visit){this.progressBar.setValue(0),visit.hasCachedSnapshot()||"restore"!=visit.action?this.showVisitProgressBarAfterDelay():this.showProgressBar()}visitRequestCompleted(visit){visit.loadResponse()}visitRequestFailedWithStatusCode(visit,statusCode){switch(statusCode){case SystemStatusCode_networkFailure:case SystemStatusCode_timeoutFailure:case SystemStatusCode_contentTypeMismatch:return this.reload({reason:"request_failed",context:{statusCode:statusCode}});default:return visit.loadResponse()}}visitRequestFinished(_visit){}visitCompleted(_visit){this.progressBar.setValue(1),this.hideVisitProgressBar()}pageInvalidated(reason){this.reload(reason)}visitFailed(_visit){this.progressBar.setValue(1),this.hideVisitProgressBar()}visitRendered(_visit){}formSubmissionStarted(_formSubmission){this.progressBar.setValue(0),this.showFormProgressBarAfterDelay()}formSubmissionFinished(_formSubmission){this.progressBar.setValue(1),this.hideFormProgressBar()}showVisitProgressBarAfterDelay(){this.visitProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay)}hideVisitProgressBar(){this.progressBar.hide(),null!=this.visitProgressBarTimeout&amp;&amp;(window.clearTimeout(this.visitProgressBarTimeout),delete this.visitProgressBarTimeout)}showFormProgressBarAfterDelay(){null==this.formProgressBarTimeout&amp;&amp;(this.formProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay))}hideFormProgressBar(){this.progressBar.hide(),null!=this.formProgressBarTimeout&amp;&amp;(window.clearTimeout(this.formProgressBarTimeout),delete this.formProgressBarTimeout)}showProgressBar=()=&gt;{this.progressBar.show()};reload(reason){dispatch("turbo:reload",{detail:reason}),window.location.href=this.location?.toString()||window.location.href}get navigator(){return this.session.navigator}}class CacheObserver{selector="[data-turbo-temporary]";deprecatedSelector="[data-turbo-cache=false]";started=!1;start(){this.started||(this.started=!0,addEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}stop(){this.started&amp;&amp;(this.started=!1,removeEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}removeTemporaryElements=_event=&gt;{for(const element of this.temporaryElements)element.remove()};get temporaryElements(){return[...document.querySelectorAll(this.selector),...this.temporaryElementsWithDeprecation]}get temporaryElementsWithDeprecation(){const elements=document.querySelectorAll(this.deprecatedSelector);return elements.length&amp;&amp;console.warn(`The ${this.deprecatedSelector} selector is deprecated and will be removed in a future version. Use ${this.selector} instead.`),[...elements]}}class FrameRedirector{constructor(session,element){this.session=session,this.element=element,this.linkInterceptor=new LinkInterceptor(this,element),this.formSubmitObserver=new FormSubmitObserver(this,element)}start(){this.linkInterceptor.start(),this.formSubmitObserver.start()}stop(){this.linkInterceptor.stop(),this.formSubmitObserver.stop()}shouldInterceptLinkClick(element,_location,_event){return this.#shouldRedirect(element)}linkClickIntercepted(element,url,event){const frame=this.#findFrameElement(element);frame&amp;&amp;frame.delegate.linkClickIntercepted(element,url,event)}willSubmitForm(element,submitter){return null==element.closest("turbo-frame")&amp;&amp;this.#shouldSubmit(element,submitter)&amp;&amp;this.#shouldRedirect(element,submitter)}formSubmitted(element,submitter){const frame=this.#findFrameElement(element,submitter);frame&amp;&amp;frame.delegate.formSubmitted(element,submitter)}#shouldSubmit(form,submitter){const action=getAction$1(form,submitter),meta=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),rootLocation=expandURL(meta?.content??"/");return this.#shouldRedirect(form,submitter)&amp;&amp;locationIsVisitable(action,rootLocation)}#shouldRedirect(element,submitter){if(element instanceof HTMLFormElement?this.session.submissionIsNavigatable(element,submitter):this.session.elementIsNavigatable(element)){const frame=this.#findFrameElement(element,submitter);return!!frame&amp;&amp;frame!=element.closest("turbo-frame")}return!1}#findFrameElement(element,submitter){const id=submitter?.getAttribute("data-turbo-frame")||element.getAttribute("data-turbo-frame");if(id&amp;&amp;"_top"!=id){const frame=this.element.querySelector(`#${id}:not([disabled])`);if(frame instanceof FrameElement)return frame}}}class History{location;restorationIdentifier=uuid();restorationData={};started=!1;pageLoaded=!1;currentIndex=0;constructor(delegate){this.delegate=delegate}start(){this.started||(addEventListener("popstate",this.onPopState,!1),addEventListener("load",this.onPageLoad,!1),this.currentIndex=history.state?.turbo?.restorationIndex||0,this.started=!0,this.replace(new URL(window.location.href)))}stop(){this.started&amp;&amp;(removeEventListener("popstate",this.onPopState,!1),removeEventListener("load",this.onPageLoad,!1),this.started=!1)}push(location,restorationIdentifier){this.update(history.pushState,location,restorationIdentifier)}replace(location,restorationIdentifier){this.update(history.replaceState,location,restorationIdentifier)}update(method,location,restorationIdentifier=uuid()){method===history.pushState&amp;&amp;++this.currentIndex;const state={turbo:{restorationIdentifier:restorationIdentifier,restorationIndex:this.currentIndex}};method.call(history,state,"",location.href),this.location=location,this.restorationIdentifier=restorationIdentifier}getRestorationDataForIdentifier(restorationIdentifier){return this.restorationData[restorationIdentifier]||{}}updateRestorationData(additionalData){const{restorationIdentifier:restorationIdentifier}=this,restorationData=this.restorationData[restorationIdentifier];this.restorationData[restorationIdentifier]={...restorationData,...additionalData}}assumeControlOfScrollRestoration(){this.previousScrollRestoration||(this.previousScrollRestoration=history.scrollRestoration??"auto",history.scrollRestoration="manual")}relinquishControlOfScrollRestoration(){this.previousScrollRestoration&amp;&amp;(history.scrollRestoration=this.previousScrollRestoration,delete this.previousScrollRestoration)}onPopState=event=&gt;{if(this.shouldHandlePopState()){const{turbo:turbo}=event.state||{};if(turbo){this.location=new URL(window.location.href);const{restorationIdentifier:restorationIdentifier,restorationIndex:restorationIndex}=turbo;this.restorationIdentifier=restorationIdentifier;const direction=restorationIndex&gt;this.currentIndex?"forward":"back";this.delegate.historyPoppedToLocationWithRestorationIdentifierAndDirection(this.location,restorationIdentifier,direction),this.currentIndex=restorationIndex}}};onPageLoad=async _event=&gt;{await function nextMicrotask(){return Promise.resolve()}(),this.pageLoaded=!0};shouldHandlePopState(){return this.pageIsLoaded()}pageIsLoaded(){return this.pageLoaded||"complete"==document.readyState}}class LinkPrefetchObserver{started=!1;#prefetchedLink=null;constructor(delegate,eventTarget){this.delegate=delegate,this.eventTarget=eventTarget}start(){this.started||("loading"===this.eventTarget.readyState?this.eventTarget.addEventListener("DOMContentLoaded",this.#enable,{once:!0}):this.#enable())}stop(){this.started&amp;&amp;(this.eventTarget.removeEventListener("mouseenter",this.#tryToPrefetchRequest,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("mouseleave",this.#cancelRequestIfObsolete,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("turbo:before-fetch-request",this.#tryToUsePrefetchedRequest,!0),this.started=!1)}#enable=()=&gt;{this.eventTarget.addEventListener("mouseenter",this.#tryToPrefetchRequest,{capture:!0,passive:!0}),this.eventTarget.addEventListener("mouseleave",this.#cancelRequestIfObsolete,{capture:!0,passive:!0}),this.eventTarget.addEventListener("turbo:before-fetch-request",this.#tryToUsePrefetchedRequest,!0),this.started=!0};#tryToPrefetchRequest=event=&gt;{if("false"===getMetaContent("turbo-prefetch"))return;const target=event.target;if(target.matches&amp;&amp;target.matches("a[href]:not([target^=_]):not([download])")&amp;&amp;this.#isPrefetchable(target)){const link=target,location=getLocationForLink(link);if(this.delegate.canPrefetchRequestToLocation(link,location)){this.#prefetchedLink=link;const fetchRequest=new FetchRequest(this,FetchMethod.get,location,new URLSearchParams,target);prefetchCache.setLater(location.toString(),fetchRequest,this.#cacheTtl)}}};#cancelRequestIfObsolete=event=&gt;{event.target===this.#prefetchedLink&amp;&amp;this.#cancelPrefetchRequest()};#cancelPrefetchRequest=()=&gt;{prefetchCache.clear(),this.#prefetchedLink=null};#tryToUsePrefetchedRequest=event=&gt;{if("FORM"!==event.target.tagName&amp;&amp;"GET"===event.detail.fetchOptions.method){const cached=prefetchCache.get(event.detail.url.toString());cached&amp;&amp;(event.detail.fetchRequest=cached),prefetchCache.clear()}};prepareRequest(request){const link=request.target;request.headers["X-Sec-Purpose"]="prefetch";const turboFrame=link.closest("turbo-frame"),turboFrameTarget=link.getAttribute("data-turbo-frame")||turboFrame?.getAttribute("target")||turboFrame?.id;turboFrameTarget&amp;&amp;"_top"!==turboFrameTarget&amp;&amp;(request.headers["Turbo-Frame"]=turboFrameTarget)}requestSucceededWithResponse(){}requestStarted(fetchRequest){}requestErrored(fetchRequest){}requestFinished(fetchRequest){}requestPreventedHandlingResponse(fetchRequest,fetchResponse){}requestFailedWithResponse(fetchRequest,fetchResponse){}get#cacheTtl(){return Number(getMetaContent("turbo-prefetch-cache-time"))||1e4}#isPrefetchable(link){return!!link.getAttribute("href")&amp;&amp;(!unfetchableLink(link)&amp;&amp;(!linkToTheSamePage(link)&amp;&amp;(!linkOptsOut(link)&amp;&amp;(!nonSafeLink(link)&amp;&amp;!eventPrevented(link)))))}}const unfetchableLink=link=&gt;link.origin!==document.location.origin||!["http:","https:"].includes(link.protocol)||link.hasAttribute("target"),linkToTheSamePage=link=&gt;link.pathname+link.search===document.location.pathname+document.location.search||link.href.startsWith("#"),linkOptsOut=link=&gt;{if("false"===link.getAttribute("data-turbo-prefetch"))return!0;if("false"===link.getAttribute("data-turbo"))return!0;const turboPrefetchParent=findClosestRecursively(link,"[data-turbo-prefetch]");return!(!turboPrefetchParent||"false"!==turboPrefetchParent.getAttribute("data-turbo-prefetch"))},nonSafeLink=link=&gt;{const turboMethod=link.getAttribute("data-turbo-method");return!(!turboMethod||"get"===turboMethod.toLowerCase())||(!!isUJS(link)||(!!link.hasAttribute("data-turbo-confirm")||!!link.hasAttribute("data-turbo-stream")))},isUJS=link=&gt;link.hasAttribute("data-remote")||link.hasAttribute("data-behavior")||link.hasAttribute("data-confirm")||link.hasAttribute("data-method"),eventPrevented=link=&gt;dispatch("turbo:before-prefetch",{target:link,cancelable:!0}).defaultPrevented;class Navigator{constructor(delegate){this.delegate=delegate}proposeVisit(location,options={}){this.delegate.allowsVisitingLocationWithAction(location,options.action)&amp;&amp;this.delegate.visitProposedToLocation(location,options)}startVisit(locatable,restorationIdentifier,options={}){this.stop(),this.currentVisit=new Visit(this,expandURL(locatable),restorationIdentifier,{referrer:this.location,...options}),this.currentVisit.start()}submitForm(form,submitter){this.stop(),this.formSubmission=new FormSubmission(this,form,submitter,!0),this.formSubmission.start()}stop(){this.formSubmission&amp;&amp;(this.formSubmission.stop(),delete this.formSubmission),this.currentVisit&amp;&amp;(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(formSubmission){"function"==typeof this.adapter.formSubmissionStarted&amp;&amp;this.adapter.formSubmissionStarted(formSubmission)}async formSubmissionSucceededWithResponse(formSubmission,fetchResponse){if(formSubmission==this.formSubmission){const responseHTML=await fetchResponse.responseHTML;if(responseHTML){const shouldCacheSnapshot=formSubmission.isSafe;shouldCacheSnapshot||this.view.clearSnapshotCache();const{statusCode:statusCode,redirected:redirected}=fetchResponse,visitOptions={action:this.#getActionForFormSubmission(formSubmission,fetchResponse),shouldCacheSnapshot:shouldCacheSnapshot,response:{statusCode:statusCode,responseHTML:responseHTML,redirected:redirected}};this.proposeVisit(fetchResponse.location,visitOptions)}}}async formSubmissionFailedWithResponse(formSubmission,fetchResponse){const responseHTML=await fetchResponse.responseHTML;if(responseHTML){const snapshot=PageSnapshot.fromHTMLString(responseHTML);fetchResponse.serverError?await this.view.renderError(snapshot,this.currentVisit):await this.view.renderPage(snapshot,!1,!0,this.currentVisit),snapshot.shouldPreserveScrollPosition||this.view.scrollToTop(),this.view.clearSnapshotCache()}}formSubmissionErrored(formSubmission,error){console.error(error)}formSubmissionFinished(formSubmission){"function"==typeof this.adapter.formSubmissionFinished&amp;&amp;this.adapter.formSubmissionFinished(formSubmission)}visitStarted(visit){this.delegate.visitStarted(visit)}visitCompleted(visit){this.delegate.visitCompleted(visit),delete this.currentVisit}locationWithActionIsSamePage(location,action){const anchor=getAnchor(location),currentAnchor=getAnchor(this.view.lastRenderedLocation),isRestorationToTop="restore"===action&amp;&amp;void 0===anchor;return"replace"!==action&amp;&amp;getRequestURL(location)===getRequestURL(this.view.lastRenderedLocation)&amp;&amp;(isRestorationToTop||null!=anchor&amp;&amp;anchor!==currentAnchor)}visitScrolledToSamePageLocation(oldURL,newURL){this.delegate.visitScrolledToSamePageLocation(oldURL,newURL)}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}#getActionForFormSubmission(formSubmission,fetchResponse){const{submitter:submitter,formElement:formElement}=formSubmission;return getVisitAction(submitter,formElement)||this.#getDefaultAction(fetchResponse)}#getDefaultAction(fetchResponse){return fetchResponse.redirected&amp;&amp;fetchResponse.location.href===this.location?.href?"replace":"advance"}}const PageStage_initial=0,PageStage_loading=1,PageStage_interactive=2,PageStage_complete=3;class PageObserver{stage=PageStage_initial;started=!1;constructor(delegate){this.delegate=delegate}start(){this.started||(this.stage==PageStage_initial&amp;&amp;(this.stage=PageStage_loading),document.addEventListener("readystatechange",this.interpretReadyState,!1),addEventListener("pagehide",this.pageWillUnload,!1),this.started=!0)}stop(){this.started&amp;&amp;(document.removeEventListener("readystatechange",this.interpretReadyState,!1),removeEventListener("pagehide",this.pageWillUnload,!1),this.started=!1)}interpretReadyState=()=&gt;{const{readyState:readyState}=this;"interactive"==readyState?this.pageIsInteractive():"complete"==readyState&amp;&amp;this.pageIsComplete()};pageIsInteractive(){this.stage==PageStage_loading&amp;&amp;(this.stage=PageStage_interactive,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==PageStage_interactive&amp;&amp;(this.stage=PageStage_complete,this.delegate.pageLoaded())}pageWillUnload=()=&gt;{this.delegate.pageWillUnload()};get readyState(){return document.readyState}}class ScrollObserver{started=!1;constructor(delegate){this.delegate=delegate}start(){this.started||(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)}stop(){this.started&amp;&amp;(removeEventListener("scroll",this.onScroll,!1),this.started=!1)}onScroll=()=&gt;{this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})};updatePosition(position){this.delegate.scrollPositionChanged(position)}}class StreamMessageRenderer{render({fragment:fragment}){Bardo.preservingPermanentElements(this,function getPermanentElementMapForFragment(fragment){const permanentElementsInDocument=queryPermanentElementsAll(document.documentElement),permanentElementMap={};for(const permanentElementInDocument of permanentElementsInDocument){const{id:id}=permanentElementInDocument;for(const streamElement of fragment.querySelectorAll("turbo-stream")){const elementInStream=getPermanentElementById(streamElement.templateElement.content,id);elementInStream&amp;&amp;(permanentElementMap[id]=[permanentElementInDocument,elementInStream])}}return permanentElementMap}(fragment),(()=&gt;{!async function withAutofocusFromFragment(fragment,callback){const generatedID=`turbo-stream-autofocus-${uuid()}`,turboStreams=fragment.querySelectorAll("turbo-stream"),elementWithAutofocus=function firstAutofocusableElementInStreams(nodeListOfStreamElements){for(const streamElement of nodeListOfStreamElements){const elementWithAutofocus=queryAutofocusableElement(streamElement.templateElement.content);if(elementWithAutofocus)return elementWithAutofocus}return null}(turboStreams);let willAutofocusId=null;elementWithAutofocus&amp;&amp;(willAutofocusId=elementWithAutofocus.id?elementWithAutofocus.id:generatedID,elementWithAutofocus.id=willAutofocusId);callback(),await nextRepaint();if((null==document.activeElement||document.activeElement==document.body)&amp;&amp;willAutofocusId){const elementToAutofocus=document.getElementById(willAutofocusId);elementIsFocusable(elementToAutofocus)&amp;&amp;elementToAutofocus.focus(),elementToAutofocus&amp;&amp;elementToAutofocus.id==generatedID&amp;&amp;elementToAutofocus.removeAttribute("id")}}(fragment,(()=&gt;{!async function withPreservedFocus(callback){const[activeElementBeforeRender,activeElementAfterRender]=await async function around(callback,reader){const before=reader();return callback(),await nextAnimationFrame(),[before,reader()]}(callback,(()=&gt;document.activeElement)),restoreFocusTo=activeElementBeforeRender&amp;&amp;activeElementBeforeRender.id;if(restoreFocusTo){const elementToFocus=document.getElementById(restoreFocusTo);elementIsFocusable(elementToFocus)&amp;&amp;elementToFocus!=activeElementAfterRender&amp;&amp;elementToFocus.focus()}}((()=&gt;{document.documentElement.appendChild(fragment)}))}))}))}enteringBardo(currentPermanentElement,newPermanentElement){newPermanentElement.replaceWith(currentPermanentElement.cloneNode(!0))}leavingBardo(){}}class StreamObserver{sources=new Set;#started=!1;constructor(delegate){this.delegate=delegate}start(){this.#started||(this.#started=!0,addEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}stop(){this.#started&amp;&amp;(this.#started=!1,removeEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}connectStreamSource(source){this.streamSourceIsConnected(source)||(this.sources.add(source),source.addEventListener("message",this.receiveMessageEvent,!1))}disconnectStreamSource(source){this.streamSourceIsConnected(source)&amp;&amp;(this.sources.delete(source),source.removeEventListener("message",this.receiveMessageEvent,!1))}streamSourceIsConnected(source){return this.sources.has(source)}inspectFetchResponse=event=&gt;{const response=function fetchResponseFromEvent(event){const fetchResponse=event.detail?.fetchResponse;if(fetchResponse instanceof FetchResponse)return fetchResponse}(event);response&amp;&amp;function fetchResponseIsStream(response){const contentType=response.contentType??"";return contentType.startsWith(StreamMessage.contentType)}(response)&amp;&amp;(event.preventDefault(),this.receiveMessageResponse(response))};receiveMessageEvent=event=&gt;{this.#started&amp;&amp;"string"==typeof event.data&amp;&amp;this.receiveMessageHTML(event.data)};async receiveMessageResponse(response){const html=await response.responseHTML;html&amp;&amp;this.receiveMessageHTML(html)}receiveMessageHTML(html){this.delegate.receivedMessageFromStream(StreamMessage.wrap(html))}}class ErrorRenderer extends Renderer{static renderElement(currentElement,newElement){const{documentElement:documentElement,body:body}=document;documentElement.replaceChild(newElement,body)}async render(){this.replaceHeadAndBody(),this.activateScriptElements()}replaceHeadAndBody(){const{documentElement:documentElement,head:head}=document;documentElement.replaceChild(this.newHead,head),this.renderElement(this.currentElement,this.newElement)}activateScriptElements(){for(const replaceableElement of this.scriptElements){const parentNode=replaceableElement.parentNode;if(parentNode){const element=activateScriptElement(replaceableElement);parentNode.replaceChild(element,replaceableElement)}}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return document.documentElement.querySelectorAll("script")}}class PageRenderer extends Renderer{static renderElement(currentElement,newElement){document.body&amp;&amp;newElement instanceof HTMLBodyElement?document.body.replaceWith(newElement):document.documentElement.appendChild(newElement)}get shouldRender(){return this.newSnapshot.isVisitable&amp;&amp;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.#setLanguage(),await this.mergeHead()}async render(){this.willRender&amp;&amp;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}#setLanguage(){const{documentElement:documentElement}=this.currentSnapshot,{lang:lang}=this.newSnapshot;lang?documentElement.setAttribute("lang",lang):documentElement.removeAttribute("lang")}async mergeHead(){const mergedHeadElements=this.mergeProvisionalElements(),newStylesheetElements=this.copyNewHeadStylesheetElements();this.copyNewHeadScriptElements(),await mergedHeadElements,await newStylesheetElements,this.willRender&amp;&amp;this.removeUnusedDynamicStylesheetElements()}async replaceBody(){await this.preservingPermanentElements((async()=&gt;{this.activateNewBody(),await this.assignNewBody()}))}get trackedElementsAreIdentical(){return this.currentHeadSnapshot.trackedElementSignature==this.newHeadSnapshot.trackedElementSignature}async copyNewHeadStylesheetElements(){const loadingElements=[];for(const element of this.newHeadStylesheetElements)loadingElements.push(waitForLoad(element)),document.head.appendChild(element);await Promise.all(loadingElements)}copyNewHeadScriptElements(){for(const element of this.newHeadScriptElements)document.head.appendChild(activateScriptElement(element))}removeUnusedDynamicStylesheetElements(){for(const element of this.unusedDynamicStylesheetElements)document.head.removeChild(element)}async mergeProvisionalElements(){const newHeadElements=[...this.newHeadProvisionalElements];for(const element of this.currentHeadProvisionalElements)this.isCurrentElementInElementList(element,newHeadElements)||document.head.removeChild(element);for(const element of newHeadElements)document.head.appendChild(element)}isCurrentElementInElementList(element,elementList){for(const[index,newElement]of elementList.entries()){if("TITLE"==element.tagName){if("TITLE"!=newElement.tagName)continue;if(element.innerHTML==newElement.innerHTML)return elementList.splice(index,1),!0}if(newElement.isEqualNode(element))return elementList.splice(index,1),!0}return!1}removeCurrentHeadProvisionalElements(){for(const element of this.currentHeadProvisionalElements)document.head.removeChild(element)}copyNewHeadProvisionalElements(){for(const element of this.newHeadProvisionalElements)document.head.appendChild(element)}activateNewBody(){document.adoptNode(this.newElement),this.activateNewBodyScriptElements()}activateNewBodyScriptElements(){for(const inertScriptElement of this.newBodyScriptElements){const activatedScriptElement=activateScriptElement(inertScriptElement);inertScriptElement.replaceWith(activatedScriptElement)}}async assignNewBody(){await this.renderElement(this.currentElement,this.newElement)}get unusedDynamicStylesheetElements(){return this.oldHeadStylesheetElements.filter((element=&gt;"dynamic"===element.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 MorphingPageRenderer extends PageRenderer{static renderElement(currentElement,newElement){morphElements(currentElement,newElement,{callbacks:{beforeNodeMorphed:element=&gt;!canRefreshFrame(element)}});for(const frame of currentElement.querySelectorAll("turbo-frame"))canRefreshFrame(frame)&amp;&amp;frame.reload();dispatch("turbo:morph",{detail:{currentElement:currentElement,newElement:newElement}})}async preservingPermanentElements(callback){return await callback()}get renderMethod(){return"morph"}get shouldAutofocus(){return!1}}function canRefreshFrame(frame){return frame instanceof FrameElement&amp;&amp;frame.src&amp;&amp;"morph"===frame.refresh&amp;&amp;!frame.closest("[data-turbo-permanent]")}class SnapshotCache{keys=[];snapshots={};constructor(size){this.size=size}has(location){return toCacheKey(location)in this.snapshots}get(location){if(this.has(location)){const snapshot=this.read(location);return this.touch(location),snapshot}}put(location,snapshot){return this.write(location,snapshot),this.touch(location),snapshot}clear(){this.snapshots={}}read(location){return this.snapshots[toCacheKey(location)]}write(location,snapshot){this.snapshots[toCacheKey(location)]=snapshot}touch(location){const key=toCacheKey(location),index=this.keys.indexOf(key);index&gt;-1&amp;&amp;this.keys.splice(index,1),this.keys.unshift(key),this.trim()}trim(){for(const key of this.keys.splice(this.size))delete this.snapshots[key]}}class PageView extends View{snapshotCache=new SnapshotCache(10);lastRenderedLocation=new URL(location.href);forceReloaded=!1;shouldTransitionTo(newSnapshot){return this.snapshot.prefersViewTransitions&amp;&amp;newSnapshot.prefersViewTransitions}renderPage(snapshot,isPreview=!1,willRender=!0,visit){const renderer=new(this.isPageRefresh(visit)&amp;&amp;this.snapshot.shouldMorphPage?MorphingPageRenderer:PageRenderer)(this.snapshot,snapshot,isPreview,willRender);return renderer.shouldRender?visit?.changeHistory():this.forceReloaded=!0,this.render(renderer)}renderError(snapshot,visit){visit?.changeHistory();const renderer=new ErrorRenderer(this.snapshot,snapshot,!1);return this.render(renderer)}clearSnapshotCache(){this.snapshotCache.clear()}async cacheSnapshot(snapshot=this.snapshot){if(snapshot.isCacheable){this.delegate.viewWillCacheSnapshot();const{lastRenderedLocation:location}=this;await nextEventLoopTick();const cachedSnapshot=snapshot.clone();return this.snapshotCache.put(location,cachedSnapshot),cachedSnapshot}}getCachedSnapshotForLocation(location){return this.snapshotCache.get(location)}isPageRefresh(visit){return!visit||this.lastRenderedLocation.pathname===visit.location.pathname&amp;&amp;"replace"===visit.action}shouldPreserveScrollPosition(visit){return this.isPageRefresh(visit)&amp;&amp;this.snapshot.shouldPreserveScrollPosition}get snapshot(){return PageSnapshot.fromElement(this.element)}}class Preloader{selector="a[data-turbo-preload]";constructor(delegate,snapshotCache){this.delegate=delegate,this.snapshotCache=snapshotCache}start(){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",this.#preloadAll):this.preloadOnLoadLinksForView(document.body)}stop(){document.removeEventListener("DOMContentLoaded",this.#preloadAll)}preloadOnLoadLinksForView(element){for(const link of element.querySelectorAll(this.selector))this.delegate.shouldPreloadLink(link)&amp;&amp;this.preloadURL(link)}async preloadURL(link){const location=new URL(link.href);if(this.snapshotCache.has(location))return;const fetchRequest=new FetchRequest(this,FetchMethod.get,location,new URLSearchParams,link);await fetchRequest.perform()}prepareRequest(fetchRequest){fetchRequest.headers["X-Sec-Purpose"]="prefetch"}async requestSucceededWithResponse(fetchRequest,fetchResponse){try{const responseHTML=await fetchResponse.responseHTML,snapshot=PageSnapshot.fromHTMLString(responseHTML);this.snapshotCache.put(fetchRequest.url,snapshot)}catch(_){}}requestStarted(fetchRequest){}requestErrored(fetchRequest){}requestFinished(fetchRequest){}requestPreventedHandlingResponse(fetchRequest,fetchResponse){}requestFailedWithResponse(fetchRequest,fetchResponse){}#preloadAll=()=&gt;{this.preloadOnLoadLinksForView(document.body)}}class Cache{constructor(session){this.session=session}clear(){this.session.clearCache()}resetCacheControl(){this.#setCacheControl("")}exemptPageFromCache(){this.#setCacheControl("no-cache")}exemptPageFromPreview(){this.#setCacheControl("no-preview")}#setCacheControl(value){!function setMetaContent(name,content){let element=getMetaElement(name);return element||(element=document.createElement("meta"),element.setAttribute("name",name),document.head.appendChild(element)),element.setAttribute("content",content),element}("turbo-cache-control",value)}}function extendURLWithDeprecatedProperties(url){Object.defineProperties(url,deprecatedLocationPropertyDescriptors)}const deprecatedLocationPropertyDescriptors={absoluteURL:{get(){return this.toString()}}},session=new class Session{navigator=new Navigator(this);history=new History(this);view=new PageView(this,document.documentElement);adapter=new BrowserAdapter(this);pageObserver=new PageObserver(this);cacheObserver=new CacheObserver;linkPrefetchObserver=new LinkPrefetchObserver(this,document);linkClickObserver=new LinkClickObserver(this,window);formSubmitObserver=new FormSubmitObserver(this,document);scrollObserver=new ScrollObserver(this);streamObserver=new StreamObserver(this);formLinkClickObserver=new FormLinkClickObserver(this,document.documentElement);frameRedirector=new FrameRedirector(this,document.documentElement);streamMessageRenderer=new StreamMessageRenderer;cache=new Cache(this);enabled=!0;started=!1;#pageRefreshDebouncePeriod=150;constructor(recentRequests){this.recentRequests=recentRequests,this.preloader=new Preloader(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&amp;&amp;(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(adapter){this.adapter=adapter}visit(location,options={}){const frameElement=options.frame?document.getElementById(options.frame):null;if(frameElement instanceof FrameElement){const action=options.action||getVisitAction(frameElement);frameElement.delegate.proposeVisitIfNavigatedWithAction(frameElement,action),frameElement.src=location.toString()}else this.navigator.proposeVisit(expandURL(location),options)}refresh(url,requestId){requestId&amp;&amp;this.recentRequests.has(requestId)||this.navigator.currentVisit||this.visit(url,{action:"replace",shouldCacheSnapshot:!1})}connectStreamSource(source){this.streamObserver.connectStreamSource(source)}disconnectStreamSource(source){this.streamObserver.disconnectStreamSource(source)}renderStreamMessage(message){this.streamMessageRenderer.render(StreamMessage.wrap(message))}clearCache(){this.view.clearSnapshotCache()}setProgressBarDelay(delay){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=delay}set progressBarDelay(delay){config.drive.progressBarDelay=delay}get progressBarDelay(){return config.drive.progressBarDelay}set drive(value){config.drive.enabled=value}get drive(){return config.drive.enabled}set formMode(value){config.forms.mode=value}get formMode(){return config.forms.mode}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}get pageRefreshDebouncePeriod(){return this.#pageRefreshDebouncePeriod}set pageRefreshDebouncePeriod(value){this.refresh=function debounce(fn,delay){let timeoutId=null;return(...args)=&gt;{clearTimeout(timeoutId),timeoutId=setTimeout((()=&gt;fn.apply(this,args)),delay)}}(this.debouncedRefresh.bind(this),value),this.#pageRefreshDebouncePeriod=value}shouldPreloadLink(element){const isUnsafe=element.hasAttribute("data-turbo-method"),isStream=element.hasAttribute("data-turbo-stream"),frameTarget=element.getAttribute("data-turbo-frame"),frame="_top"==frameTarget?null:document.getElementById(frameTarget)||findClosestRecursively(element,"turbo-frame:not([disabled])");if(isUnsafe||isStream||frame instanceof FrameElement)return!1;{const location=new URL(element.href);return this.elementIsNavigatable(element)&amp;&amp;locationIsVisitable(location,this.snapshot.rootLocation)}}historyPoppedToLocationWithRestorationIdentifierAndDirection(location,restorationIdentifier,direction){this.enabled?this.navigator.startVisit(location,restorationIdentifier,{action:"restore",historyChanged:!0,direction:direction}):this.adapter.pageInvalidated({reason:"turbo_disabled"})}scrollPositionChanged(position){this.history.updateRestorationData({scrollPosition:position})}willSubmitFormLinkToLocation(link,location){return this.elementIsNavigatable(link)&amp;&amp;locationIsVisitable(location,this.snapshot.rootLocation)}submittedFormLinkToLocation(){}canPrefetchRequestToLocation(link,location){return this.elementIsNavigatable(link)&amp;&amp;locationIsVisitable(location,this.snapshot.rootLocation)}willFollowLinkToLocation(link,location,event){return this.elementIsNavigatable(link)&amp;&amp;locationIsVisitable(location,this.snapshot.rootLocation)&amp;&amp;this.applicationAllowsFollowingLinkToLocation(link,location,event)}followedLinkToLocation(link,location){const action=this.getActionForLink(link),acceptsStreamResponse=link.hasAttribute("data-turbo-stream");this.visit(location.href,{action:action,acceptsStreamResponse:acceptsStreamResponse})}allowsVisitingLocationWithAction(location,action){return this.locationWithActionIsSamePage(location,action)||this.applicationAllowsVisitingLocation(location)}visitProposedToLocation(location,options){extendURLWithDeprecatedProperties(location),this.adapter.visitProposedToLocation(location,options)}visitStarted(visit){visit.acceptsStreamResponse||(markAsBusy(document.documentElement),this.view.markVisitDirection(visit.direction)),extendURLWithDeprecatedProperties(visit.location),visit.silent||this.notifyApplicationAfterVisitingLocation(visit.location,visit.action)}visitCompleted(visit){this.view.unmarkVisitDirection(),clearBusyState(document.documentElement),this.notifyApplicationAfterPageLoad(visit.getTimingMetrics())}locationWithActionIsSamePage(location,action){return this.navigator.locationWithActionIsSamePage(location,action)}visitScrolledToSamePageLocation(oldURL,newURL){this.notifyApplicationAfterVisitingSamePageLocation(oldURL,newURL)}willSubmitForm(form,submitter){const action=getAction$1(form,submitter);return this.submissionIsNavigatable(form,submitter)&amp;&amp;locationIsVisitable(expandURL(action),this.snapshot.rootLocation)}formSubmitted(form,submitter){this.navigator.submitForm(form,submitter)}pageBecameInteractive(){this.view.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()}pageLoaded(){this.history.assumeControlOfScrollRestoration()}pageWillUnload(){this.history.relinquishControlOfScrollRestoration()}receivedMessageFromStream(message){this.renderStreamMessage(message)}viewWillCacheSnapshot(){this.navigator.currentVisit?.silent||this.notifyApplicationBeforeCachingSnapshot()}allowsImmediateRender({element:element},options){const event=this.notifyApplicationBeforeRender(element,options),{defaultPrevented:defaultPrevented,detail:{render:render}}=event;return this.view.renderer&amp;&amp;render&amp;&amp;(this.view.renderer.renderElement=render),!defaultPrevented}viewRenderedSnapshot(_snapshot,_isPreview,renderMethod){this.view.lastRenderedLocation=this.history.location,this.notifyApplicationAfterRender(renderMethod)}preloadOnLoadLinksForView(element){this.preloader.preloadOnLoadLinksForView(element)}viewInvalidated(reason){this.adapter.pageInvalidated(reason)}frameLoaded(frame){this.notifyApplicationAfterFrameLoad(frame)}frameRendered(fetchResponse,frame){this.notifyApplicationAfterFrameRender(fetchResponse,frame)}applicationAllowsFollowingLinkToLocation(link,location,ev){return!this.notifyApplicationAfterClickingLinkToLocation(link,location,ev).defaultPrevented}applicationAllowsVisitingLocation(location){return!this.notifyApplicationBeforeVisitingLocation(location).defaultPrevented}notifyApplicationAfterClickingLinkToLocation(link,location,event){return dispatch("turbo:click",{target:link,detail:{url:location.href,originalEvent:event},cancelable:!0})}notifyApplicationBeforeVisitingLocation(location){return dispatch("turbo:before-visit",{detail:{url:location.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(location,action){return dispatch("turbo:visit",{detail:{url:location.href,action:action}})}notifyApplicationBeforeCachingSnapshot(){return dispatch("turbo:before-cache")}notifyApplicationBeforeRender(newBody,options){return dispatch("turbo:before-render",{detail:{newBody:newBody,...options},cancelable:!0})}notifyApplicationAfterRender(renderMethod){return dispatch("turbo:render",{detail:{renderMethod:renderMethod}})}notifyApplicationAfterPageLoad(timing={}){return dispatch("turbo:load",{detail:{url:this.location.href,timing:timing}})}notifyApplicationAfterVisitingSamePageLocation(oldURL,newURL){dispatchEvent(new HashChangeEvent("hashchange",{oldURL:oldURL.toString(),newURL:newURL.toString()}))}notifyApplicationAfterFrameLoad(frame){return dispatch("turbo:frame-load",{target:frame})}notifyApplicationAfterFrameRender(fetchResponse,frame){return dispatch("turbo:frame-render",{detail:{fetchResponse:fetchResponse},target:frame,cancelable:!0})}submissionIsNavigatable(form,submitter){if("off"==config.forms.mode)return!1;{const submitterIsNavigatable=!submitter||this.elementIsNavigatable(submitter);return"optin"==config.forms.mode?submitterIsNavigatable&amp;&amp;null!=form.closest('[data-turbo="true"]'):submitterIsNavigatable&amp;&amp;this.elementIsNavigatable(form)}}elementIsNavigatable(element){const container=findClosestRecursively(element,"[data-turbo]"),withinFrame=findClosestRecursively(element,"turbo-frame");return config.drive.enabled||withinFrame?!container||"false"!=container.getAttribute("data-turbo"):!!container&amp;&amp;"true"==container.getAttribute("data-turbo")}getActionForLink(link){return getVisitAction(link)||"advance"}get snapshot(){return this.view.snapshot}}(recentRequests),{cache:cache,navigator:navigator$1}=session;function start(){session.start()}function visit(location,options){session.visit(location,options)}function connectStreamSource(source){session.connectStreamSource(source)}function disconnectStreamSource(source){session.disconnectStreamSource(source)}function renderStreamMessage(message){session.renderStreamMessage(message)}var Turbo=Object.freeze({__proto__:null,navigator:navigator$1,session:session,cache:cache,PageRenderer:PageRenderer,PageSnapshot:PageSnapshot,FrameRenderer:FrameRenderer,fetch:fetchWithTurboHeaders,config:config,start:start,registerAdapter:function registerAdapter(adapter){session.registerAdapter(adapter)},visit:visit,connectStreamSource:connectStreamSource,disconnectStreamSource:disconnectStreamSource,renderStreamMessage:renderStreamMessage,clearCache:function clearCache(){console.warn("Please replace `Turbo.clearCache()` with `Turbo.cache.clear()`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),session.clearCache()},setProgressBarDelay:function setProgressBarDelay(delay){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.`"),config.drive.progressBarDelay=delay},setConfirmMethod:function setConfirmMethod(confirmMethod){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.`"),config.forms.confirm=confirmMethod},setFormMode:function setFormMode(mode){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.`"),config.forms.mode=mode}});class TurboFrameMissingError extends Error{}function getFrameElementById(id){if(null!=id){const element=document.getElementById(id);if(element instanceof FrameElement)return element}}function activateElement(element,currentURL){if(element){const src=element.getAttribute("src");if(null!=src&amp;&amp;null!=currentURL&amp;&amp;function urlsAreEqual(left,right){return expandURL(left).href==expandURL(right).href}(src,currentURL))throw new Error(`Matching &lt;turbo-frame id="${element.id}"&gt; element has a source URL which references itself`);if(element.ownerDocument!==document&amp;&amp;(element=document.importNode(element,!0)),element instanceof FrameElement)return element.connectedCallback(),element.disconnectedCallback(),element}}const StreamActions={after(){this.targetElements.forEach((e=&gt;e.parentElement?.insertBefore(this.templateContent,e.nextSibling)))},append(){this.removeDuplicateTargetChildren(),this.targetElements.forEach((e=&gt;e.append(this.templateContent)))},before(){this.targetElements.forEach((e=&gt;e.parentElement?.insertBefore(this.templateContent,e)))},prepend(){this.removeDuplicateTargetChildren(),this.targetElements.forEach((e=&gt;e.prepend(this.templateContent)))},remove(){this.targetElements.forEach((e=&gt;e.remove()))},replace(){const method=this.getAttribute("method");this.targetElements.forEach((targetElement=&gt;{"morph"===method?morphElements(targetElement,this.templateContent):targetElement.replaceWith(this.templateContent)}))},update(){const method=this.getAttribute("method");this.targetElements.forEach((targetElement=&gt;{"morph"===method?morphChildren(targetElement,this.templateContent):(targetElement.innerHTML="",targetElement.append(this.templateContent))}))},refresh(){session.refresh(this.baseURI,this.requestId)}};class StreamElement extends HTMLElement{static async renderElement(newElement){await newElement.performAction()}async connectedCallback(){try{await this.render()}catch(error){console.error(error)}finally{this.disconnect()}}async render(){return this.renderPromise??=(async()=&gt;{const event=this.beforeRenderEvent;this.dispatchEvent(event)&amp;&amp;(await nextRepaint(),await event.detail.render(this))})()}disconnect(){try{this.remove()}catch{}}removeDuplicateTargetChildren(){this.duplicateChildren.forEach((c=&gt;c.remove()))}get duplicateChildren(){const existingChildren=this.targetElements.flatMap((e=&gt;[...e.children])).filter((c=&gt;!!c.id)),newChildrenIds=[...this.templateContent?.children||[]].filter((c=&gt;!!c.id)).map((c=&gt;c.id));return existingChildren.filter((c=&gt;newChildrenIds.includes(c.id)))}get performAction(){if(this.action){const actionFunction=StreamActions[this.action];if(actionFunction)return actionFunction;this.#raise("unknown action")}this.#raise("action attribute is missing")}get targetElements(){return this.target?this.targetElementsById:this.targets?this.targetElementsByQuery:void this.#raise("target or targets attribute is missing")}get templateContent(){return this.templateElement.content.cloneNode(!0)}get templateElement(){if(null===this.firstElementChild){const template=this.ownerDocument.createElement("template");return this.appendChild(template),template}if(this.firstElementChild instanceof HTMLTemplateElement)return this.firstElementChild;this.#raise("first child element must be a &lt;template&gt; 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")}#raise(message){throw new Error(`${this.description}: ${message}`)}get description(){return(this.outerHTML.match(/&lt;[^&gt;]+&gt;/)??[])[0]??"&lt;turbo-stream&gt;"}get beforeRenderEvent(){return new CustomEvent("turbo:before-stream-render",{bubbles:!0,cancelable:!0,detail:{newStream:this,render:StreamElement.renderElement}})}get targetElementsById(){const element=this.ownerDocument?.getElementById(this.target);return null!==element?[element]:[]}get targetElementsByQuery(){const elements=this.ownerDocument?.querySelectorAll(this.targets);return 0!==elements.length?Array.prototype.slice.call(elements):[]}}class StreamSourceElement extends HTMLElement{streamSource=null;connectedCallback(){this.streamSource=this.src.match(/^ws{1,2}:/)?new WebSocket(this.src):new EventSource(this.src),connectStreamSource(this.streamSource)}disconnectedCallback(){this.streamSource&amp;&amp;(this.streamSource.close(),disconnectStreamSource(this.streamSource))}get src(){return this.getAttribute("src")||""}}FrameElement.delegateConstructor=class FrameController{fetchResponseLoaded=_fetchResponse=&gt;Promise.resolve();#currentFetchRequest=null;#resolveVisitPromise=()=&gt;{};#connected=!1;#hasBeenLoaded=!1;#ignoredAttributes=new Set;#shouldMorphFrame=!1;action=null;constructor(element){this.element=element,this.view=new FrameView(this,this.element),this.appearanceObserver=new AppearanceObserver(this,this.element),this.formLinkClickObserver=new FormLinkClickObserver(this,this.element),this.linkInterceptor=new LinkInterceptor(this,this.element),this.restorationIdentifier=uuid(),this.formSubmitObserver=new FormSubmitObserver(this,this.element)}connect(){this.#connected||(this.#connected=!0,this.loadingStyle==FrameLoadingStyle_lazy?this.appearanceObserver.start():this.#loadSourceURL(),this.formLinkClickObserver.start(),this.linkInterceptor.start(),this.formSubmitObserver.start())}disconnect(){this.#connected&amp;&amp;(this.#connected=!1,this.appearanceObserver.stop(),this.formLinkClickObserver.stop(),this.linkInterceptor.stop(),this.formSubmitObserver.stop())}disabledChanged(){this.loadingStyle==FrameLoadingStyle_eager&amp;&amp;this.#loadSourceURL()}sourceURLChanged(){this.#isIgnoringChangesTo("src")||(this.element.isConnected&amp;&amp;(this.complete=!1),(this.loadingStyle==FrameLoadingStyle_eager||this.#hasBeenLoaded)&amp;&amp;this.#loadSourceURL())}sourceURLReloaded(){const{refresh:refresh,src:src}=this.element;return this.#shouldMorphFrame=src&amp;&amp;"morph"===refresh,this.element.removeAttribute("complete"),this.element.src=null,this.element.src=src,this.element.loaded}loadingStyleChanged(){this.loadingStyle==FrameLoadingStyle_lazy?this.appearanceObserver.start():(this.appearanceObserver.stop(),this.#loadSourceURL())}async#loadSourceURL(){this.enabled&amp;&amp;this.isActive&amp;&amp;!this.complete&amp;&amp;this.sourceURL&amp;&amp;(this.element.loaded=this.#visit(expandURL(this.sourceURL)),this.appearanceObserver.stop(),await this.element.loaded,this.#hasBeenLoaded=!0)}async loadResponse(fetchResponse){(fetchResponse.redirected||fetchResponse.succeeded&amp;&amp;fetchResponse.isHTML)&amp;&amp;(this.sourceURL=fetchResponse.response.url);try{const html=await fetchResponse.responseHTML;if(html){const document=parseHTMLDocument(html);PageSnapshot.fromDocument(document).isVisitable?await this.#loadFrameResponse(fetchResponse,document):await this.#handleUnvisitableFrameResponse(fetchResponse)}}finally{this.#shouldMorphFrame=!1,this.fetchResponseLoaded=()=&gt;Promise.resolve()}}elementAppearedInViewport(element){this.proposeVisitIfNavigatedWithAction(element,getVisitAction(element)),this.#loadSourceURL()}willSubmitFormLinkToLocation(link){return this.#shouldInterceptNavigation(link)}submittedFormLinkToLocation(link,_location,form){const frame=this.#findFrameElement(link);frame&amp;&amp;form.setAttribute("data-turbo-frame",frame.id)}shouldInterceptLinkClick(element,_location,_event){return this.#shouldInterceptNavigation(element)}linkClickIntercepted(element,location){this.#navigateFrame(element,location)}willSubmitForm(element,submitter){return element.closest("turbo-frame")==this.element&amp;&amp;this.#shouldInterceptNavigation(element,submitter)}formSubmitted(element,submitter){this.formSubmission&amp;&amp;this.formSubmission.stop(),this.formSubmission=new FormSubmission(this,element,submitter);const{fetchRequest:fetchRequest}=this.formSubmission;this.prepareRequest(fetchRequest),this.formSubmission.start()}prepareRequest(request){request.headers["Turbo-Frame"]=this.id,this.currentNavigationElement?.hasAttribute("data-turbo-stream")&amp;&amp;request.acceptResponseType(StreamMessage.contentType)}requestStarted(_request){markAsBusy(this.element)}requestPreventedHandlingResponse(_request,_response){this.#resolveVisitPromise()}async requestSucceededWithResponse(request,response){await this.loadResponse(response),this.#resolveVisitPromise()}async requestFailedWithResponse(request,response){await this.loadResponse(response),this.#resolveVisitPromise()}requestErrored(request,error){console.error(error),this.#resolveVisitPromise()}requestFinished(_request){clearBusyState(this.element)}formSubmissionStarted({formElement:formElement}){markAsBusy(formElement,this.#findFrameElement(formElement))}formSubmissionSucceededWithResponse(formSubmission,response){const frame=this.#findFrameElement(formSubmission.formElement,formSubmission.submitter);frame.delegate.proposeVisitIfNavigatedWithAction(frame,getVisitAction(formSubmission.submitter,formSubmission.formElement,frame)),frame.delegate.loadResponse(response),formSubmission.isSafe||session.clearCache()}formSubmissionFailedWithResponse(formSubmission,fetchResponse){this.element.delegate.loadResponse(fetchResponse),session.clearCache()}formSubmissionErrored(formSubmission,error){console.error(error)}formSubmissionFinished({formElement:formElement}){clearBusyState(formElement,this.#findFrameElement(formElement))}allowsImmediateRender({element:newFrame},options){const event=dispatch("turbo:before-frame-render",{target:this.element,detail:{newFrame:newFrame,...options},cancelable:!0}),{defaultPrevented:defaultPrevented,detail:{render:render}}=event;return this.view.renderer&amp;&amp;render&amp;&amp;(this.view.renderer.renderElement=render),!defaultPrevented}viewRenderedSnapshot(_snapshot,_isPreview,_renderMethod){}preloadOnLoadLinksForView(element){session.preloadOnLoadLinksForView(element)}viewInvalidated(){}willRenderFrame(currentElement,_newElement){this.previousFrameElement=currentElement.cloneNode(!0)}visitCachedSnapshot=({element:element})=&gt;{const frame=element.querySelector("#"+this.element.id);frame&amp;&amp;this.previousFrameElement&amp;&amp;frame.replaceChildren(...this.previousFrameElement.children),delete this.previousFrameElement};async#loadFrameResponse(fetchResponse,document){const newFrameElement=await this.extractForeignFrameElement(document.body),rendererClass=this.#shouldMorphFrame?MorphingFrameRenderer:FrameRenderer;if(newFrameElement){const snapshot=new Snapshot(newFrameElement),renderer=new rendererClass(this,this.view.snapshot,snapshot,!1,!1);this.view.renderPromise&amp;&amp;await this.view.renderPromise,this.changeHistory(),await this.view.render(renderer),this.complete=!0,session.frameRendered(fetchResponse,this.element),session.frameLoaded(this.element),await this.fetchResponseLoaded(fetchResponse)}else this.#willHandleFrameMissingFromResponse(fetchResponse)&amp;&amp;this.#handleFrameMissingFromResponse(fetchResponse)}async#visit(url){const request=new FetchRequest(this,FetchMethod.get,url,new URLSearchParams,this.element);return this.#currentFetchRequest?.cancel(),this.#currentFetchRequest=request,new Promise((resolve=&gt;{this.#resolveVisitPromise=()=&gt;{this.#resolveVisitPromise=()=&gt;{},this.#currentFetchRequest=null,resolve()},request.perform()}))}#navigateFrame(element,url,submitter){const frame=this.#findFrameElement(element,submitter);frame.delegate.proposeVisitIfNavigatedWithAction(frame,getVisitAction(submitter,element,frame)),this.#withCurrentNavigationElement(element,(()=&gt;{frame.src=url}))}proposeVisitIfNavigatedWithAction(frame,action=null){if(this.action=action,this.action){const pageSnapshot=PageSnapshot.fromElement(frame).clone(),{visitCachedSnapshot:visitCachedSnapshot}=frame.delegate;frame.delegate.fetchResponseLoaded=async fetchResponse=&gt;{if(frame.src){const{statusCode:statusCode,redirected:redirected}=fetchResponse,options={response:{statusCode:statusCode,redirected:redirected,responseHTML:await fetchResponse.responseHTML},visitCachedSnapshot:visitCachedSnapshot,willRender:!1,updateHistory:!1,restorationIdentifier:this.restorationIdentifier,snapshot:pageSnapshot};this.action&amp;&amp;(options.action=this.action),session.visit(frame.src,options)}}}}changeHistory(){if(this.action){const method=getHistoryMethodForAction(this.action);session.history.update(method,expandURL(this.element.src||""),this.restorationIdentifier)}}async#handleUnvisitableFrameResponse(fetchResponse){console.warn(`The response (${fetchResponse.statusCode}) from &lt;turbo-frame id="${this.element.id}"&gt; is performing a full page visit due to turbo-visit-control.`),await this.#visitResponse(fetchResponse.response)}#willHandleFrameMissingFromResponse(fetchResponse){this.element.setAttribute("complete","");const response=fetchResponse.response;return!dispatch("turbo:frame-missing",{target:this.element,detail:{response:response,visit:async(url,options)=&gt;{url instanceof Response?this.#visitResponse(url):session.visit(url,options)}},cancelable:!0}).defaultPrevented}#handleFrameMissingFromResponse(fetchResponse){this.view.missing(),this.#throwFrameMissingError(fetchResponse)}#throwFrameMissingError(fetchResponse){const message=`The response (${fetchResponse.statusCode}) did not contain the expected &lt;turbo-frame id="${this.element.id}"&gt; and will be ignored. To perform a full page visit instead, set turbo-visit-control to reload.`;throw new TurboFrameMissingError(message)}async#visitResponse(response){const wrapped=new FetchResponse(response),responseHTML=await wrapped.responseHTML,{location:location,redirected:redirected,statusCode:statusCode}=wrapped;return session.visit(location,{response:{redirected:redirected,statusCode:statusCode,responseHTML:responseHTML}})}#findFrameElement(element,submitter){return getFrameElementById(getAttribute("data-turbo-frame",submitter,element)||this.element.getAttribute("target"))??this.element}async extractForeignFrameElement(container){let element;const id=CSS.escape(this.id);try{if(element=activateElement(container.querySelector(`turbo-frame#${id}`),this.sourceURL),element)return element;if(element=activateElement(container.querySelector(`turbo-frame[src][recurse~=${id}]`),this.sourceURL),element)return await element.loaded,await this.extractForeignFrameElement(element)}catch(error){return console.error(error),new FrameElement}return null}#formActionIsVisitable(form,submitter){return locationIsVisitable(expandURL(getAction$1(form,submitter)),this.rootLocation)}#shouldInterceptNavigation(element,submitter){const id=getAttribute("data-turbo-frame",submitter,element)||this.element.getAttribute("target");if(element instanceof HTMLFormElement&amp;&amp;!this.#formActionIsVisitable(element,submitter))return!1;if(!this.enabled||"_top"==id)return!1;if(id){const frameElement=getFrameElementById(id);if(frameElement)return!frameElement.disabled}return!!session.elementIsNavigatable(element)&amp;&amp;!(submitter&amp;&amp;!session.elementIsNavigatable(submitter))}get id(){return this.element.id}get enabled(){return!this.element.disabled}get sourceURL(){if(this.element.src)return this.element.src}set sourceURL(sourceURL){this.#ignoringChangesToAttribute("src",(()=&gt;{this.element.src=sourceURL??null}))}get loadingStyle(){return this.element.loading}get isLoading(){return void 0!==this.formSubmission||void 0!==this.#resolveVisitPromise()}get complete(){return this.element.hasAttribute("complete")}set complete(value){value?this.element.setAttribute("complete",""):this.element.removeAttribute("complete")}get isActive(){return this.element.isActive&amp;&amp;this.#connected}get rootLocation(){const meta=this.element.ownerDocument.querySelector('meta[name="turbo-root"]');return expandURL(meta?.content??"/")}#isIgnoringChangesTo(attributeName){return this.#ignoredAttributes.has(attributeName)}#ignoringChangesToAttribute(attributeName,callback){this.#ignoredAttributes.add(attributeName),callback(),this.#ignoredAttributes.delete(attributeName)}#withCurrentNavigationElement(element,callback){this.currentNavigationElement=element,callback(),delete this.currentNavigationElement}},void 0===customElements.get("turbo-frame")&amp;&amp;customElements.define("turbo-frame",FrameElement),void 0===customElements.get("turbo-stream")&amp;&amp;customElements.define("turbo-stream",StreamElement),void 0===customElements.get("turbo-stream-source")&amp;&amp;customElements.define("turbo-stream-source",StreamSourceElement),(()=&gt;{let element=document.currentScript;if(element&amp;&amp;!element.hasAttribute("data-turbo-suppress-warning"))for(element=element.parentElement;element;){if(element==document.body)return console.warn(unindent`
        You are loading Turbo from a &lt;script&gt; element inside the &lt;body&gt; element. This is probably not what you meant to do!

        Load your applicationâ€™s JavaScript bundle inside the &lt;head&gt; element instead. &lt;script&gt; elements in &lt;body&gt; are evaluated with each page change.

        For more information, see: https://turbo.hotwired.dev/handbook/building#working-with-script-elements

        â€”â€”
        Suppress this warning by adding a "data-turbo-suppress-warning" attribute to: %s
      `,element.outerHTML);element=element.parentElement}})(),window.Turbo={...Turbo,StreamActions:StreamActions},start()},4731:function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){var globalThis=__webpack_require__(44576);__webpack_require__(10687)(globalThis.JSON,"JSON",!0)},60479:function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){__webpack_require__(10687)(Math,"Math",!0)},66412:function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){__webpack_require__(70511)("asyncIterator")},78125:function(__unused_webpack_module,__unused_webpack_exports,__webpack_require__){var getBuiltIn=__webpack_require__(97751),defineWellKnownSymbol=__webpack_require__(70511),setToStringTag=__webpack_require__(10687);defineWellKnownSymbol("toStringTag"),setToStringTag(getBuiltIn("Symbol"),"Symbol")}}]);
//# sourceMappingURL=566.b77175bb.js.map</pre></body></html>