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