1var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),u=s({FetchEnctype:()=>k,FetchMethod:()=>O,FetchRequest:()=>A,FetchResponse:()=>Ne,FrameElement:()=>f,FrameLoadingStyle:()=>d,FrameRenderer:()=>_t,PageRenderer:()=>fn,PageSnapshot:()=>F,StreamActions:()=>Rn,StreamElement:()=>zn,StreamSourceElement:()=>Bn,cache:()=>xn,config:()=>w,connectStreamSource:()=>En,disconnectStreamSource:()=>Dn,fetch:()=>Fe,fetchEnctypeFromString:()=>Le,fetchMethodFromString:()=>Ie,isSafe:()=>Re,morphBodyElements:()=>Mn,morphChildren:()=>xt,morphElements:()=>P,morphTurboFrameElements:()=>Nn,navigator:()=>Sn,registerAdapter:()=>wn,renderStreamMessage:()=>On,session:()=>z,setConfirmMethod:()=>An,setFormMode:()=>jn,setProgressBarDelay:()=>kn,start:()=>Cn,visit:()=>Tn}),d={eager:`eager`,lazy:`lazy`},f=class e extends HTMLElement{static delegateConstructor=void 0;loaded=Promise.resolve();static get observedAttributes(){return[`disabled`,`loading`,`src`]}constructor(){super(),this.delegate=new e.delegateConstructor(this)}connectedCallback(){this.delegate.connect()}disconnectedCallback(){this.delegate.disconnect()}reload(){return this.delegate.sourceURLReloaded()}attributeChangedCallback(e){e==`loading`?this.delegate.loadingStyleChanged():e==`src`?this.delegate.sourceURLChanged():e==`disabled`&&this.delegate.disabledChanged()}get src(){return this.getAttribute(`src`)}set src(e){e?this.setAttribute(`src`,e):this.removeAttribute(`src`)}get refresh(){return this.getAttribute(`refresh`)}set refresh(e){e?this.setAttribute(`refresh`,e):this.removeAttribute(`refresh`)}get shouldReloadWithMorph(){return this.src&&this.refresh===`morph`}get loading(){return p(this.getAttribute(`loading`)||``)}set loading(e){e?this.setAttribute(`loading`,e):this.removeAttribute(`loading`)}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){e?this.setAttribute(`disabled`,``):this.removeAttribute(`disabled`)}get autoscroll(){return this.hasAttribute(`autoscroll`)}set autoscroll(e){e?this.setAttribute(`autoscroll`,``):this.removeAttribute(`autoscroll`)}get complete(){return!this.delegate.isLoading}get isActive(){return this.ownerDocument===document&&!this.isPreview}get isPreview(){return this.ownerDocument?.documentElement?.hasAttribute(`data-turbo-preview`)}};function p(e){switch(e.toLowerCase()){case`lazy`:return d.lazy;default:return d.eager}}var m={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`.split(`,`))};function h(e){if(e.getAttribute(`data-turbo-eval`)==`false`)return e;{let t=document.createElement(`script`),n=me();return n&&(t.nonce=n),t.textContent=e.textContent,t.async=!1,ee(t,e),t}}function ee(e,t){for(let{name:n,value:r}of t.attributes)e.setAttribute(n,r)}function te(e){let t=document.createElement(`template`);return t.innerHTML=e,t.content}function g(e,{target:t,cancelable:n,detail:r}={}){let i=new CustomEvent(e,{cancelable:n,bubbles:!0,composed:!0,detail:r});return t&&t.isConnected?t.dispatchEvent(i):document.documentElement.dispatchEvent(i),i}function ne(e){e.preventDefault(),e.stopImmediatePropagation()}
1function _(){return document.visibilityState===`hidden`?v():re()}function re(){return new Promise(e=>requestAnimationFrame(()=>e()))}function v(){return new Promise(e=>setTimeout(()=>e(),0))}function y(e=``){return new DOMParser().parseFromString(e,`text/html`)}function b(e,...t){let n=ie(e,t).replace(/^\n/,``).split(` 2`),r=n[0].match(/^\s+/),i=r?r[0].length:0;return n.map(e=>e.slice(i)).join(` 3`)}function ie(e,t){return e.reduce((e,n,r)=>{let i=t[r]==null?``:t[r];return e+n+i},``)}function x(){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 ae(e,...t){for(let n of t.map(t=>t?.getAttribute(e)))if(typeof n==`string`)return n;return null}function oe(e,...t){return t.some(t=>t&&t.hasAttribute(e))}function se(...e){for(let t of e)t.localName==`turbo-frame`&&t.setAttribute(`busy`,``),t.setAttribute(`aria-busy`,`true`)}function ce(...e){for(let t of e)t.localName==`turbo-frame`&&t.removeAttribute(`busy`),t.removeAttribute(`aria-busy`)}function le(e,t=2e3){return new Promise(n=>{let r=()=>{e.removeEventListener(`error`,r),e.removeEventListener(`load`,r),n()};e.addEventListener(`load`,r,{once:!0}),e.addEventListener(`error`,r,{once:!0}),setTimeout(n,t)})}function ue(e){switch(e){case`replace`:return history.replaceState;case`advance`:case`restore`:return history.pushState}}function de(e){return e==`advance`||e==`replace`||e==`restore`}function S(...e){let t=ae(`data-turbo-action`,...e);return de(t)?t:null}function fe(e){return document.querySelector(`meta[name="${e}"]`)}function pe(e){let t=fe(e);return t&&t.content}function me(){let e=fe(`csp-nonce`);if(e){let{nonce:t,content:n}=e;return t==``?n:t}}function he(e,t){let n=fe(e);return n||(n=document.createElement(`meta`),n.setAttribute(`name`,e),document.head.appendChild(n)),n.setAttribute(`content`,t),n}function C(e,t){if(e instanceof Element)return e.closest(t)||C(e.assignedSlot||e.getRootNode()?.host,t)}function ge(e){return!!e&&e.closest(`[inert], :disabled, [hidden], details:not([open]), dialog:not([open])`)==null&&typeof e.focus==`function`}function _e(e){return Array.from(e.querySelectorAll(`[autofocus]`)).find(ge)}async function ve(e,t){let n=t();return e(),await re(),[n,t()]}function ye(e){if(e===`_blank`)return!1;if(e){for(let t of document.getElementsByName(e))if(t instanceof HTMLIFrameElement)return!1;return!0}return!0}function be(e){let t=C(e,`a[href], a[xlink\\:href]`);if(!t||t.href.startsWith(`#`)||t.hasAttribute(`download`))return null;let n=t.getAttribute(`target`);return n&&n!==`_self`?null:t}function xe(e,t){let n=null;return(...r)=>{clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}var Se={"aria-disabled":{beforeSubmit:e=>{e.setAttribute(`aria-disabled`,`true`),e.addEventListener(`click`,ne)},afterSubmit:e=>{e.removeAttribute(`aria-disabled`),e.removeEventListener(`click`,ne)}},disabled:{beforeSubmit:e=>e.disabled=!0,afterSubmit:e=>e.disabled=!1}},w={drive:m,forms:new class{#e=null;constructor(e){Object.assign(this,e)}get submitter(){return this.#e}set submitter(e){this.#e=Se[e]||e}}({mode:`on`,submitter:`disabled`})};function T(e){return new URL(e.toString(),document.baseURI)}function E(e){let t;if(e.hash)return e.hash.slice(1);if(t=e.href.match(/#(.*)$/))return t[1]}function Ce(e,t){return T(t?.getAttribute(`formaction`)||e.getAttribute(`action`)||e.action)}function we(e){return(je(e).match(/\.[^.]*$/)||[])[0]||``}function Te(e,t){let n=Me(t.origin+t.pathname);return Me(e.href)===n||e.href.startsWith(n)}function D(e,t){return Te(e,t)&&!w.drive.unvisitableExtensions.has(we(e))}function Ee(e){return T(e.getAttribute(`href`)||``)}function De(e){let t=E(e);return t==null?e.href:e.href.slice(0,-(t.length+1))}function Oe(e){return De(e)}function ke(e,t){return T(e).href==T(t).href}function Ae(e){return e.pathname.split(`/`).slice(1)}function je(e){return Ae(e).slice(-1)[0]}function Me(e){return e.endsWith(`/`)?e:e+`/`}var Ne=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 T(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)}},Pe=new class extends Set{constructor(e){super(),this.maxSize=e}add(e){if(this.size>=this.maxSize){let e=this.values().next().value;this.delete(e)}super.add(e)}}(20);function Fe(e,t={}){let n=new Headers(t.headers||{}),r=x();return Pe.add(r),n.append(`X-Turbo-Request-Id`,r),window.fetch(e,{...t,headers:n})}function Ie(e){switch(e.toLowerCase()){case`get`:return O.get;case`post`:return O.post;case`put`:return O.put;case`patch`:return O.patch;case`delete`:return O.delete}}var O={get:`get`,post:`post`,put:`put`,patch:`patch`,delete:`delete`};function Le(e){switch(e.toLowerCase()){case k.multipart:return k.multipart;case k.plain:return k.plain;default:return k.urlEncoded}}var k={urlEncoded:`application/x-www-form-urlencoded`,multipart:`multipart/form-data`,plain:`text/plain`},A=class{abortController=new AbortController;#e=e=>{};
3constructor(e,t,n,r=new URLSearchParams,i=null,a=k.urlEncoded){let[o,s]=ze(T(n),t,r,a);this.delegate=e,this.url=o,this.target=i,this.fetchOptions={credentials:`same-origin`,redirect:`follow`,method:t.toUpperCase(),headers:{...this.defaultHeaders},body:s,signal:this.abortSignal,referrer:this.delegate.referrer?.href},this.enctype=a}get method(){return this.fetchOptions.method}set method(e){let t=this.isSafe?this.url.searchParams:this.fetchOptions.body||new FormData,n=Ie(e)||O.get;this.url.search=``;let[r,i]=ze(this.url,n,t,this.enctype);this.url=r,this.fetchOptions.body=i,this.fetchOptions.method=n.toUpperCase()}get headers(){return this.fetchOptions.headers}set headers(e){this.fetchOptions.headers=e}get body(){return this.isSafe?this.url.searchParams:this.fetchOptions.body}set body(e){this.fetchOptions.body=e}get location(){return this.url}get params(){return this.url.searchParams}get entries(){return this.body?Array.from(this.body.entries()):[]}cancel(){this.abortController.abort()}async perform(){let{fetchOptions:e}=this;this.delegate.prepareRequest(this);let t=await this.#t(e);try{this.delegate.requestStarted(this),this.response=t.detail.fetchRequest?t.detail.fetchRequest.response:Fe(this.url.href,e);let n=await this.response;return await this.receive(n)}catch(e){if(e.name!==`AbortError`)throw this.#n(e)&&this.delegate.requestErrored(this,e),e}finally{this.delegate.requestFinished(this)}}async receive(e){let t=new Ne(e);return g(`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 Re(this.method)}get abortSignal(){return this.abortController.signal}acceptResponseType(e){this.headers.Accept=[e,this.headers.Accept].join(`, `)}async#t(e){let t=new Promise(e=>this.#e=e),n=g(`turbo:before-fetch-request`,{cancelable:!0,detail:{fetchOptions:e,url:this.url,resume:this.#e},target:this.target});return this.url=n.detail.url,n.defaultPrevented&&await t,n}#n(e){return!g(`turbo:fetch-request-error`,{target:this.target,cancelable:!0,detail:{request:this,error:e}}).defaultPrevented}};function Re(e){return Ie(e)==O.get}function ze(e,t,n,r){let i=Array.from(n).length>0?new URLSearchParams(Be(n)):e.searchParams;return Re(t)?[Ve(e,i),null]:r==k.urlEncoded?[e,i]:[e,n]}function Be(e){let t=[];for(let[n,r]of e)if(r instanceof File)continue;else t.push([n,r]);return t}function Ve(e,t){return e.search=new URLSearchParams(Be(t)).toString(),e}var He=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)}},j=class{static contentType=`text/vnd.turbo-stream.html`;static wrap(e){return typeof e==`string`?new this(te(e)):e}constructor(e){this.fragment=Ue(e)}};function Ue(e){for(let t of e.querySelectorAll(`turbo-stream`)){let e=document.importNode(t,!0);for(let t of e.templateElement.content.querySelectorAll(`script`))t.replaceWith(h(t));t.replaceWith(e)}return e}var We=e=>e,Ge=class{keys=[];entries={};#e;constructor(e,t=We){this.size=e,this.#e=t}has(e){return this.#e(e)in this.entries}get(e){if(this.has(e)){let t=this.read(e);return this.touch(e),t}}put(e,t){return this.write(e,t),this.touch(e),t}clear(){for(let 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);let t=this.keys.indexOf(e);t>-1&&this.keys.splice(t,1),this.keys.unshift(e),this.trim()}trim(){for(let e of this.keys.splice(this.size))this.evict(e)}evict(e){delete this.entries[e]}},Ke=100,qe=class extends Ge{#e=null;#t={};constructor(e=1,t=Ke){super(e,Oe),this.prefetchDelay=t}putLater(e,t,n){this.#e=setTimeout(()=>{t.perform(),this.put(e,t,n),this.#e=null},this.prefetchDelay)}put(e,t,n=Je){super.put(e,t),this.#t[Oe(e)]=new Date(new Date().getTime()+n)}clear(){super.clear(),this.#e&&clearTimeout(this.#e)}evict(e){super.evict(e),delete this.#t[e]}has(e){if(super.has(e)){let t=this.#t[Oe(e)];return t&&t>Date.now()}return!1}},Je=1e4,M=new qe,N={initialized:`initialized`,requesting:`requesting`,waiting:`waiting`,receiving:`receiving`,stopping:`stopping`,stopped:`stopped`},Ye=class e{state=N.initialized;static confirmMethod(e){return Promise.resolve(confirm(e))}constructor(e,t,n,r=!1){let i=tt(t,n),a=et($e(t,n),i),o=Xe(t,n),s=nt(t,n);this.delegate=e,this.formElement=t,this.submitter=n,this.fetchRequest=new A(this,i,a,o,t,s),this.mustRedirect=r}get method(){return this.fetchRequest.method}set method(e){this.fetchRequest.method=e}get action(){return this.fetchRequest.url.toString()}set action(e){this.fetchRequest.url=T(e)}get body(){return this.fetchRequest.body}get enctype(){return this.fetchRequest.enctype}get isSafe(){return this.fetchRequest.isSafe}get location(){return this.fetchRequest.url}async start(){let{initialized:t,requesting:n}=N,r=ae(`data-turbo-confirm`,this.submitter,this.formElement);if(!(typeof r==`string`&&!await(typeof w.forms.confirm==`function`?w.forms.confirm:e.confirmMethod)(r,this.formElement,this.submitter))&&this.state==t)return this.state=n,this.fetchRequest.perform()}stop(){let{stopping:e,stopped:t}=N;
3if(this.state!=e&&this.state!=t)return this.state=e,this.fetchRequest.cancel(),!0}prepareRequest(e){if(!e.isSafe){let t=Ze(pe(`csrf-param`))||pe(`csrf-token`);t&&(e.headers[`X-CSRF-Token`]=t)}this.requestAcceptsTurboStreamResponse(e)&&e.acceptResponseType(j.contentType)}requestStarted(e){this.state=N.waiting,this.submitter&&w.forms.submitter.beforeSubmit(this.submitter),this.setSubmitsWith(),se(this.formElement),g(`turbo:submit-start`,{target:this.formElement,detail:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(e,t){M.clear(),this.result={success:t.succeeded,fetchResponse:t}}requestSucceededWithResponse(e,t){if(t.clientError||t.serverError){this.delegate.formSubmissionFailedWithResponse(this,t);return}if(M.clear(),this.requestMustRedirect(e)&&Qe(t)){let e=Error(`Form responses must redirect to another location`);this.delegate.formSubmissionErrored(this,e)}else this.state=N.receiving,this.result={success:!0,fetchResponse:t},this.delegate.formSubmissionSucceededWithResponse(this,t)}requestFailedWithResponse(e,t){this.result={success:!1,fetchResponse:t},this.delegate.formSubmissionFailedWithResponse(this,t)}requestErrored(e,t){this.result={success:!1,error:t},this.delegate.formSubmissionErrored(this,t)}requestFinished(e){this.state=N.stopped,this.submitter&&w.forms.submitter.afterSubmit(this.submitter),this.resetSubmitterText(),ce(this.formElement),g(`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`)){let e=this.submitter;this.originalSubmitText=e.value,e.value=this.submitsWith}}}resetSubmitterText(){if(!(!this.submitter||!this.originalSubmitText)){if(this.submitter.matches(`button`))this.submitter.innerHTML=this.originalSubmitText;else if(this.submitter.matches(`input`)){let e=this.submitter;e.value=this.originalSubmitText}}}requestMustRedirect(e){return!e.isSafe&&this.mustRedirect}requestAcceptsTurboStreamResponse(e){return!e.isSafe||oe(`data-turbo-stream`,this.submitter,this.formElement)}get submitsWith(){return this.submitter?.getAttribute(`data-turbo-submits-with`)}};function Xe(e,t){let n=new FormData(e),r=t?.getAttribute(`name`),i=t?.getAttribute(`value`);return r&&n.append(r,i||``),n}function Ze(e){if(e!=null){let t=(document.cookie?document.cookie.split(`; `):[]).find(t=>t.startsWith(e));if(t){let e=t.split(`=`).slice(1).join(`=`);return e?decodeURIComponent(e):void 0}}}function Qe(e){return e.statusCode==200&&!e.redirected}function $e(e,t){let n=typeof e.action==`string`?e.action:null;return t?.hasAttribute(`formaction`)?t.getAttribute(`formaction`)||``:e.getAttribute(`action`)||n||``}function et(e,t){let n=T(e);return Re(t)&&(n.search=``),n}function tt(e,t){return Ie((t?.getAttribute(`formmethod`)||e.getAttribute(`method`)||``).toLowerCase())||O.get}function nt(e,t){return Le(t?.getAttribute(`formenctype`)||e.enctype)}var rt=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 _e(this.element)}get permanentElements(){return at(this.element)}getPermanentElementById(e){return it(this.element,e)}getPermanentElementMapForSnapshot(e){let t={};for(let n of this.permanentElements){let{id:r}=n,i=e.getPermanentElementById(r);i&&(t[r]=[n,i])}return t}};function it(e,t){return e.querySelector(`#${t}[data-turbo-permanent]`)}function at(e){return e.querySelectorAll(`[id][data-turbo-permanent]`)}var ot=class{started=!1;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||=(this.eventTarget.addEventListener(`submit`,this.submitCaptured,!0),!0)}stop(){this.started&&=(this.eventTarget.removeEventListener(`submit`,this.submitCaptured,!0),!1)}submitCaptured=()=>{this.eventTarget.removeEventListener(`submit`,this.submitBubbled,!1),this.eventTarget.addEventListener(`submit`,this.submitBubbled,!1)};submitBubbled=e=>{if(!e.defaultPrevented){let t=e.target instanceof HTMLFormElement?e.target:void 0,n=e.submitter||void 0;t&&st(t,n)&&ct(t,n)&&this.delegate.willSubmitForm(t,n)&&(e.preventDefault(),e.stopImmediatePropagation(),this.delegate.formSubmitted(t,n))}}};function st(e,t){return(t?.getAttribute(`formmethod`)||e.getAttribute(`method`))!=`dialog`}function ct(e,t){return ye(t?.getAttribute(`formtarget`)||e.getAttribute(`target`))}var lt=class{#e=e=>{};#t=e=>{};constructor(e,t){this.delegate=e,this.element=t}scrollToAnchor(e){let t=this.snapshot.getElementForAnchor(e);t?(this.focusElement(t),this.scrollToElement(t)):this.scrollToPosition({x:0,y:0})}scrollToAnchorFromLocation(e){this.scrollToAnchor(E(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){let{isPreview:t,shouldRender:n,willRender:r,newSnapshot:i}=e,a=r;if(n)try{this.renderPromise=new Promise(e=>this.#e=e),this.renderer=e,await this.prepareToRenderSnapshot(e);let n=new Promise(e=>this.#t=e),r={resume:this.#t,render:this.renderer.renderElement,renderMethod:this.renderer.renderMethod};this.delegate.allowsImmediateRender(i,r)||await n,await this.renderSnapshot(e),this.delegate.viewRenderedSnapshot(i,t,this.renderer.renderMethod),this.delegate.preloadOnLoadLinksForView(this.element),this.finishRenderingSnapshot(e)}finally{delete this.renderer,this.#e(void 0),delete this.renderPromise}else a&&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()}},ut=class extends lt{missing(){this.element.innerHTML=`<strong class="turbo-frame-error">Content missing</strong>`}get snapshot(){return new rt(this.element)}},dt=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){let t=e.composed?e.target?.parentElement:e.target,n=be(t)||t;return n instanceof Element&&n.closest(`turbo-frame, html`)==this.element}},ft=class{started=!1;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||=(this.eventTarget.addEventListener(`click`,this.clickCaptured,!0),!0)}stop(){this.started&&=(this.eventTarget.removeEventListener(`click`,this.clickCaptured,!0),!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)){let t=be(e.composedPath&&e.composedPath()[0]||e.target);if(t&&ye(t.target)){let n=Ee(t);this.delegate.willFollowLinkToLocation(t,n,e)&&(e.preventDefault(),this.delegate.followedLinkToLocation(t,n))}}};clickEventIsSignificant(e){return!(e.target&&e.target.isContentEditable||e.defaultPrevented||e.which>1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)}},pt=class{constructor(e,t){this.delegate=e,this.linkInterceptor=new ft(this,t)}start(){this.linkInterceptor.start()}stop(){this.linkInterceptor.stop()}canPrefetchRequestToLocation(e,t){return!1}prefetchAndCacheRequestToLocation(e,t){}willFollowLinkToLocation(e,t,n){return this.delegate.willSubmitFormLinkToLocation(e,t,n)&&(e.hasAttribute(`data-turbo-method`)||e.hasAttribute(`data-turbo-stream`))}followedLinkToLocation(e,t){let n=document.createElement(`form`);for(let[e,r]of t.searchParams)n.append(Object.assign(document.createElement(`input`),{type:`hidden`,name:e,value:r}));let r=Object.assign(t,{search:``});n.setAttribute(`data-turbo`,`true`),n.setAttribute(`action`,r.href),n.setAttribute(`hidden`,``);let i=e.getAttribute(`data-turbo-method`);i&&n.setAttribute(`method`,i);let a=e.getAttribute(`data-turbo-frame`);a&&n.setAttribute(`data-turbo-frame`,a);let o=S(e);o&&n.setAttribute(`data-turbo-action`,o);let s=e.getAttribute(`data-turbo-confirm`);s&&n.setAttribute(`data-turbo-confirm`,s),e.hasAttribute(`data-turbo-stream`)&&n.setAttribute(`data-turbo-stream`,``),this.delegate.submittedFormLinkToLocation(e,t,n),document.body.appendChild(n),n.addEventListener(`turbo:submit-end`,()=>n.remove(),{once:!0}),requestAnimationFrame(()=>n.requestSubmit())}}
3,mt=class{static async preservingPermanentElements(e,t,n){let r=new this(e,t);r.enter(),await n(),r.leave()}constructor(e,t){this.delegate=e,this.permanentElementMap=t}enter(){for(let e in this.permanentElementMap){let[t,n]=this.permanentElementMap[e];this.delegate.enteringBardo(t,n),this.replaceNewPermanentElementWithPlaceholder(n)}}leave(){for(let e in this.permanentElementMap){let[t]=this.permanentElementMap[e];this.replaceCurrentPermanentElementWithClone(t),this.replacePlaceholderWithPermanentElement(t),this.delegate.leavingBardo(t)}}replaceNewPermanentElementWithPlaceholder(e){let t=ht(e);e.replaceWith(t)}replaceCurrentPermanentElementWithClone(e){let 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 ht(e){let t=document.createElement(`meta`);return t.setAttribute(`name`,`turbo-permanent-placeholder`),t.setAttribute(`content`,e.id),t}var gt=class{#e=null;static renderElement(e,t){}constructor(e,t,n,r=!0){this.currentSnapshot=e,this.newSnapshot=t,this.isPreview=n,this.willRender=r,this.renderElement=this.constructor.renderElement,this.promise=new Promise((e,t)=>this.resolvingFunctions={resolve:e,reject:t})}get shouldRender(){return!0}get shouldAutofocus(){return!0}get reloadReason(){}prepareToRender(){}render(){}finishRendering(){this.resolvingFunctions&&(this.resolvingFunctions.resolve(),delete this.resolvingFunctions)}async preservingPermanentElements(e){await mt.preservingPermanentElements(this,this.permanentElementMap,e)}focusFirstAutofocusableElement(){if(this.shouldAutofocus){let 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`}},_t=class extends gt{static renderElement(e,t){let n=document.createRange();n.selectNodeContents(e),n.deleteContents();let r=t,i=r.ownerDocument?.createRange();i&&(i.selectNodeContents(r),e.appendChild(i.extractContents()))}constructor(e,t,n,r,i,a=!0){super(t,n,r,i,a),this.delegate=e}get shouldRender(){return!0}async render(){await _(),this.preservingPermanentElements(()=>{this.loadFrameElement()}),this.scrollFrameIntoView(),await _(),this.focusFirstAutofocusableElement(),await _(),this.activateScriptElements()}loadFrameElement(){this.delegate.willRenderFrame(this.currentElement,this.newElement),this.renderElement(this.currentElement,this.newElement)}scrollFrameIntoView(){if(this.currentElement.autoscroll||this.newElement.autoscroll){let e=this.currentElement.firstElementChild,t=vt(this.currentElement.getAttribute(`data-autoscroll-block`),`end`),n=yt(this.currentElement.getAttribute(`data-autoscroll-behavior`),`auto`);if(e)return e.scrollIntoView({block:t,behavior:n}),!0}return!1}activateScriptElements(){for(let e of this.newScriptElements){let t=h(e);e.replaceWith(t)}}get newScriptElements(){return this.currentElement.querySelectorAll(`script`)}};function vt(e,t){return e==`end`||e==`start`||e==`center`||e==`nearest`?e:t}function yt(e,t){return e==`auto`||e==`smooth`?e:t}var bt=(function(){let e=()=>{},t={morphStyle:`outerHTML`,callbacks:{beforeNodeAdded:e,afterNodeAdded:e,beforeNodeMorphed:e,afterNodeMorphed:e,beforeNodeRemoved:e,afterNodeRemoved:e,beforeAttributeUpdated:e},head:{style:`merge`,shouldPreserve:e=>e.getAttribute(`im-preserve`)===`true`,shouldReAppend:e=>e.getAttribute(`im-re-append`)===`true`,shouldRemove:e,afterHeadMorphed:e},restoreFocus:!0};function n(e,t,n={}){e=u(e);
3let o=d(t),c=l(e,o,n),f=i(c,()=>s(c,e,o,t=>t.morphStyle===`innerHTML`?(a(t,e,o),Array.from(e.childNodes)):r(t,e,o)));return c.pantry.remove(),f}function r(e,t,n){let r=d(t);return a(e,r,n,t,t.nextSibling),Array.from(r.childNodes)}function i(e,t){if(!e.config.restoreFocus)return t();let n=document.activeElement;if(!(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement))return t();let{id:r,selectionStart:i,selectionEnd:a}=n,o=t();return r&&r!==document.activeElement?.getAttribute(`id`)&&(n=e.target.querySelector(`[id="${r}"]`),n?.focus()),n&&!n.selectionEnd&&a&&n.setSelectionRange(i,a),o}let a=(function(){function e(e,s,c,l=null,u=null){s instanceof HTMLTemplateElement&&c instanceof HTMLTemplateElement&&(s=s.content,c=c.content),l||=s.firstChild;for(let r of c.childNodes){if(l&&l!=u){let t=n(e,r,l,u);if(t){t!==l&&i(e,l,t),o(t,r,e),l=t.nextSibling;continue}}if(r instanceof Element){let t=r.getAttribute(`id`);if(e.persistentIds.has(t)){let n=a(s,t,l,e);o(n,r,e),l=n.nextSibling;continue}}let c=t(s,r,l,e);c&&(l=c.nextSibling)}for(;l&&l!=u;){let t=l;l=l.nextSibling,r(e,t)}}function t(e,t,n,r){if(r.callbacks.beforeNodeAdded(t)===!1)return null;if(r.idMap.has(t)){let i=document.createElement(t.tagName);return e.insertBefore(i,n),o(i,t,r),r.callbacks.afterNodeAdded(i),i}{let i=document.importNode(t,!0);return e.insertBefore(i,n),r.callbacks.afterNodeAdded(i),i}}let n=(function(){function e(e,r,i,a){let o=null,s=r.nextSibling,c=0,l=i;for(;l&&l!=a;){if(n(l,r)){if(t(e,l,r))return l;o===null&&(e.idMap.has(l)||(o=l))}if(o===null&&s&&n(l,s)&&(c++,s=s.nextSibling,c>=2&&(o=void 0)),e.activeElementAndParents.includes(l))break;l=l.nextSibling}return o||null}function t(e,t,n){let r=e.idMap.get(t),i=e.idMap.get(n);if(!i||!r)return!1;for(let e of r)if(i.has(e))return!0;return!1}function n(e,t){let n=e,r=t;return n.nodeType===r.nodeType&&n.tagName===r.tagName&&(!n.getAttribute?.(`id`)||n.getAttribute?.(`id`)===r.getAttribute?.(`id`))}return e})();function r(e,t){if(e.idMap.has(t))c(e.pantry,t,null);else{if(e.callbacks.beforeNodeRemoved(t)===!1)return;t.parentNode?.removeChild(t),e.callbacks.afterNodeRemoved(t)}}function i(e,t,n){let i=t;for(;i&&i!==n;){let t=i;i=i.nextSibling,r(e,t)}return i}function a(e,t,n,r){let i=r.target.getAttribute?.(`id`)===t&&r.target||r.target.querySelector(`[id="${t}"]`)||r.pantry.querySelector(`[id="${t}"]`);return s(i,r),c(e,i,n),i}function s(e,t){let n=e.getAttribute(`id`);for(;e=e.parentNode;){let r=t.idMap.get(e);r&&(r.delete(n),r.size||t.idMap.delete(e))}}function c(e,t,n){if(e.moveBefore)try{e.moveBefore(t,n)}catch{e.insertBefore(t,n)}else e.insertBefore(t,n)}return e})(),o=(function(){function e(e,n,r){return r.ignoreActive&&e===document.activeElement?null:r.callbacks.beforeNodeMorphed(e,n)===!1?e:(e instanceof HTMLHeadElement&&r.head.ignore||(e instanceof HTMLHeadElement&&r.head.style!==`morph`?c(e,n,r):(t(e,n,r),o(e,r)||a(r,e,n))),r.callbacks.afterNodeMorphed(e,n),e)}function t(e,t,r){let a=t.nodeType;if(a===1){let a=e,s=t,c=a.attributes,l=s.attributes;for(let e of l)i(e.name,a,`update`,r)||a.getAttribute(e.name)!==e.value&&a.setAttribute(e.name,e.value);for(let e=c.length-1;0<=e;e--){let t=c[e];if(t&&!s.hasAttribute(t.name)){if(i(t.name,a,`remove`,r))continue;a.removeAttribute(t.name)}}o(a,r)||n(a,s,r)}(a===8||a===3)&&e.nodeValue!==t.nodeValue&&(e.nodeValue=t.nodeValue)}function n(e,t,n){if(e instanceof HTMLInputElement&&t instanceof HTMLInputElement&&t.type!==`file`){let a=t.value,o=e.value;r(e,t,`checked`,n),r(e,t,`disabled`,n),t.hasAttribute(`value`)?o!==a&&(i(`value`,e,`update`,n)||(e.setAttribute(`value`,a),e.value=a)):i(`value`,e,`remove`,n)||(e.value=``,e.removeAttribute(`value`))}else if(e instanceof HTMLOptionElement&&t instanceof HTMLOptionElement)r(e,t,`selected`,n);else if(e instanceof HTMLTextAreaElement&&t instanceof HTMLTextAreaElement){let r=t.value,a=e.value;if(i(`value`,e,`update`,n))return;r!==a&&(e.value=r),e.firstChild&&e.firstChild.nodeValue!==r&&(e.firstChild.nodeValue=r)}}function r(e,t,n,r){let a=t[n];if(a!==e[n]){let o=i(n,e,`update`,r);o||(e[n]=t[n]),a?o||e.setAttribute(n,``):i(n,e,`remove`,r)||e.removeAttribute(n)}}function i(e,t,n,r){return e===`value`&&r.ignoreActiveValue&&t===document.activeElement?!0:r.callbacks.beforeAttributeUpdated(e,t,n)===!1}function o(e,t){return!!t.ignoreActiveValue&&e===document.activeElement&&e!==document.body}return e})();function s(e,t,n,r){if(e.head.block){let i=t.querySelector(`head`),a=n.querySelector(`head`);if(i&&a){let t=c(i,a,e);return Promise.all(t).then(()=>r(Object.assign(e,{head:{block:!1,ignore:!0}})))}}return r(e)}
3function c(e,t,n){let r=[],i=[],a=[],o=[],s=new Map;for(let e of t.children)s.set(e.outerHTML,e);for(let t of e.children){let e=s.has(t.outerHTML),r=n.head.shouldReAppend(t),c=n.head.shouldPreserve(t);e||c?r?i.push(t):(s.delete(t.outerHTML),a.push(t)):n.head.style===`append`?r&&(i.push(t),o.push(t)):n.head.shouldRemove(t)!==!1&&i.push(t)}o.push(...s.values());let c=[];for(let t of o){let i=document.createRange().createContextualFragment(t.outerHTML).firstChild;if(n.callbacks.beforeNodeAdded(i)!==!1){if(`href`in i&&i.href||`src`in i&&i.src){let e,t=new Promise(function(t){e=t});i.addEventListener(`load`,function(){e()}),c.push(t)}e.appendChild(i),n.callbacks.afterNodeAdded(i),r.push(i)}}for(let t of i)n.callbacks.beforeNodeRemoved(t)!==!1&&(e.removeChild(t),n.callbacks.afterNodeRemoved(t));return n.head.afterHeadMorphed(e,{added:r,kept:a,removed:i}),c}let l=(function(){function e(e,t,a){let{persistentIds:o,idMap:c}=s(e,t),l=n(a),u=l.morphStyle||`outerHTML`;if(![`innerHTML`,`outerHTML`].includes(u))throw`Do not understand how to morph style ${u}`;return{target:e,newContent:t,config:l,morphStyle:u,ignoreActive:l.ignoreActive,ignoreActiveValue:l.ignoreActiveValue,restoreFocus:l.restoreFocus,idMap:c,persistentIds:o,pantry:r(),activeElementAndParents:i(e),callbacks:l.callbacks,head:l.head}}function n(e){let n=Object.assign({},t);return Object.assign(n,e),n.callbacks=Object.assign({},t.callbacks,e.callbacks),n.head=Object.assign({},t.head,e.head),n}function r(){let e=document.createElement(`div`);return e.hidden=!0,document.body.insertAdjacentElement(`afterend`,e),e}function i(e){let t=[],n=document.activeElement;if(n?.tagName!==`BODY`&&e.contains(n))for(;n&&(t.push(n),n!==e);)n=n.parentElement;return t}function a(e){let t=Array.from(e.querySelectorAll(`[id]`));return e.getAttribute?.(`id`)&&t.push(e),t}function o(e,t,n,r){for(let i of r){let r=i.getAttribute(`id`);if(t.has(r)){let t=i;for(;t;){let i=e.get(t);if(i??(i=new Set,e.set(t,i)),i.add(r),t===n)break;t=t.parentElement}}}}function s(e,t){let n=a(e),r=a(t),i=c(n,r),s=new Map;return o(s,i,e,n),o(s,i,t.__idiomorphRoot||t,r),{persistentIds:i,idMap:s}}function c(e,t){let n=new Set,r=new Map;for(let{id:t,tagName:i}of e)r.has(t)?n.add(t):r.set(t,i);let i=new Set;for(let{id:e,tagName:a}of t)i.has(e)?n.add(e):r.get(e)===a&&i.add(e);for(let e of n)i.delete(e);return i}return e})(),{normalizeElement:u,normalizeParent:d}=(function(){let e=new WeakSet;function t(e){return e instanceof Document?e.documentElement:e}function n(t){if(t==null)return document.createElement(`div`);if(typeof t==`string`)return n(i(t));if(e.has(t))return t;if(t instanceof Node){if(t.parentNode)return new r(t);{let e=document.createElement(`div`);return e.append(t),e}}{let e=document.createElement(`div`);for(let n of[...t])e.append(n);return e}}class r{constructor(e){this.originalNode=e,this.realParentNode=e.parentNode,this.previousSibling=e.previousSibling,this.nextSibling=e.nextSibling}get childNodes(){let e=[],t=this.previousSibling?this.previousSibling.nextSibling:this.realParentNode.firstChild;for(;t&&t!=this.nextSibling;)e.push(t),t=t.nextSibling;return e}querySelectorAll(e){return this.childNodes.reduce((t,n)=>{if(n instanceof Element){n.matches(e)&&t.push(n);let r=n.querySelectorAll(e);for(let e=0;e<r.length;e++)t.push(r[e])}return t},[])}insertBefore(e,t){return this.realParentNode.insertBefore(e,t)}moveBefore(e,t){return this.realParentNode.moveBefore(e,t)}get __idiomorphRoot(){return this.originalNode}}function i(t){let n=new DOMParser,r=t.replace(/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,``);if(r.match(/<\/html>/)||r.match(/<\/head>/)||r.match(/<\/body>/)){let i=n.parseFromString(t,`text/html`);if(r.match(/<\/html>/))return e.add(i),i;{let t=i.firstChild;return t&&e.add(t),t}}{let r=n.parseFromString(`<body><template>`+t+`</template></body>`,`text/html`).body.querySelector(`template`).content;return e.add(r),r}}return{normalizeElement:t,normalizeParent:n}})();return{morph:n,defaults:t}})();function P(e,t,{callbacks:n,...r}={}){bt.morph(e,t,{...r,callbacks:new Tt(n)})}function xt(e,t,n={}){P(e,t.childNodes,{...n,morphStyle:`innerHTML`})}function St(e,t){return e instanceof f&&e.shouldReloadWithMorph&&(!t||Ct(e,t))&&!e.closest(`[data-turbo-permanent]`)}function Ct(e,t){return t instanceof Element&&t.nodeName===`TURBO-FRAME`&&e.id===t.id&&(!t.getAttribute(`src`)||ke(e.src,t.getAttribute(`src`)))}function wt(e){return e.parentElement.closest(`turbo-frame[src][refresh=morph]`)}var Tt=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)?!g(`turbo:before-morph-element`,{cancelable:!0,target:e,detail:{currentElement:e,newElement:t}}).defaultPrevented:!1};beforeAttributeUpdated=(e,t,n)=>!g(`turbo:before-morph-attribute`,{cancelable:!0,target:t,detail
3:{attributeName:e,mutationType:n}}).defaultPrevented;beforeNodeRemoved=e=>this.beforeNodeMorphed(e);afterNodeMorphed=(e,t)=>{e instanceof Element&&g(`turbo:morph-element`,{target:e,detail:{currentElement:e,newElement:t}})}},Et=class extends _t{static renderElement(e,t){g(`turbo:before-frame-morph`,{target:e,detail:{currentElement:e,newElement:t}}),xt(e,t,{callbacks:{beforeNodeMorphed:(t,n)=>St(t,n)&&wt(t)===e?(t.reload(),!1):!0}})}async preservingPermanentElements(e){return await e()}},Dt=class e{static animationDuration=300;static get defaultCSS(){return b` 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 ${e.animationDuration}ms ease-out, 14 opacity ${e.animationDuration/2}ms ${e.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(e){this.value=e,this.refresh()}installStylesheetElement(){document.head.insertBefore(this.stylesheetElement,document.head.firstChild)}installProgressElement(){this.progressElement.style.width=`0`,this.progressElement.style.opacity=`1`,document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()}fadeProgressElement(t){this.progressElement.style.opacity=`0`,setTimeout(t,e.animationDuration*1.5)}uninstallProgressElement(){this.progressElement.parentNode&&document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||=window.setInterval(this.trickle,e.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(){let t=document.createElement(`style`);t.type=`text/css`,t.textContent=e.defaultCSS;let n=me();return n&&(t.nonce=n),t}createProgressElement(){let e=document.createElement(`div`);return e.className=`turbo-progress-bar`,e}},Ot=class extends rt{detailsByOuterHTML=this.children.filter(e=>!Mt(e)).map(e=>Ft(e)).reduce((e,t)=>{let{outerHTML:n}=t,r=n in e?e[n]:{type:kt(t),tracked:At(t),elements:[]};return{...e,[n]:{...r,elements:[...r.elements,t]}}},{});get trackedElementSignature(){return Object.keys(this.detailsByOuterHTML).filter(e=>this.detailsByOuterHTML[e].tracked).join(``)}getScriptElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot(`script`,e)}getStylesheetElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot(`stylesheet`,e)}getElementsMatchingTypeNotInSnapshot(e,t){return Object.keys(this.detailsByOuterHTML).filter(e=>!(e in t.detailsByOuterHTML)).map(e=>this.detailsByOuterHTML[e]).filter(({type:t})=>t==e).map(({elements:[e]})=>e)}get provisionalElements(){return Object.keys(this.detailsByOuterHTML).reduce((e,t)=>{let{type:n,tracked:r,elements:i}=this.detailsByOuterHTML[t];return n==null&&!r?[...e,...i]:i.length>1?[...e,...i.slice(1)]:e},[])}getMetaValue(e){let t=this.findMetaElementByName(e);return t?t.getAttribute(`content`):null}findMetaElementByName(e){return Object.keys(this.detailsByOuterHTML).reduce((t,n)=>{let{elements:[r]}=this.detailsByOuterHTML[n];return Pt(r,e)?r:t},0)}};function kt(e){if(jt(e))return`script`;if(Nt(e))return`stylesheet`}function At(e){return e.getAttribute(`data-turbo-track`)==`reload`}function jt(e){return e.localName==`script`}function Mt(e){return e.localName==`noscript`}function Nt(e){let t=e.localName;return t==`style`||t==`link`&&e.getAttribute(`rel`)==`stylesheet`}function Pt(e,t){return e.localName==`meta`&&e.getAttribute(`name`)==t}function Ft(e){return e.hasAttribute(`nonce`)&&e.setAttribute(`nonce`,``),e}var F=class e extends rt{static fromHTMLString(e=``){return this.fromDocument(y(e))}static fromElement(e){return this.fromDocument(e.ownerDocument)}static fromDocument({documentElement:e,body:t,head:n}){return new this(e,t,new Ot(n))}constructor(e,t,n){super(t),this.documentElement=e,this.headSnapshot=n}clone(){let t=this.element.cloneNode(!0),n=this.element.querySelectorAll(`select`),r=t.querySelectorAll(`select`);for(let[e,t]of n.entries()){let n=r[e];for(let e of n.selectedOptions)e.selected=!1;for(let e of t.selectedOptions)n.options[e.index].selected=!0}for(let e of t.querySelectorAll(`input[type="password"]`))e.value=``;for(let e of t.querySelectorAll(`noscript`))e.remove();return new e(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 T(this.getSetting(`root`)??`/`)}
17get 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(e){return this.headSnapshot.getMetaValue(`turbo-${e}`)}},It=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}},Lt={action:`advance`,historyChanged:!1,visitCachedSnapshot:()=>{},willRender:!0,updateHistory:!0,shouldCacheSnapshot:!0,acceptsStreamResponse:!1,refresh:{}},Rt={visitStart:`visitStart`,requestStart:`requestStart`,requestEnd:`requestEnd`,visitEnd:`visitEnd`},I={initialized:`initialized`,started:`started`,canceled:`canceled`,failed:`failed`,completed:`completed`},L={networkFailure:0,timeoutFailure:-1,contentTypeMismatch:-2},zt={advance:`forward`,restore:`back`,replace:`none`},Bt=class{identifier=x();timingMetrics={};followedRedirect=!1;historyChanged=!1;scrolled=!1;shouldCacheSnapshot=!0;acceptsStreamResponse=!1;snapshotCached=!1;state=I.initialized;viewTransitioner=new It;constructor(e,t,n,r={}){this.delegate=e,this.location=t,this.restorationIdentifier=n||x();let{action:i,historyChanged:a,referrer:o,snapshot:s,snapshotHTML:c,response:l,visitCachedSnapshot:u,willRender:d,updateHistory:f,shouldCacheSnapshot:p,acceptsStreamResponse:m,direction:h,refresh:ee}={...Lt,...r};this.action=i,this.historyChanged=a,this.referrer=o,this.snapshot=s,this.snapshotHTML=c,this.response=l,this.isPageRefresh=this.view.isPageRefresh(this),this.visitCachedSnapshot=u,this.willRender=d,this.updateHistory=f,this.scrolled=!d,this.shouldCacheSnapshot=p,this.acceptsStreamResponse=m,this.direction=h||zt[i],this.refresh=ee}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==I.initialized&&(this.recordTimingMetric(Rt.visitStart),this.state=I.started,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==I.started&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=I.canceled)}complete(){this.state==I.started&&(this.recordTimingMetric(Rt.visitEnd),this.adapter.visitCompleted(this),this.state=I.completed,this.followRedirect(),this.followedRedirect||this.delegate.visitCompleted(this))}fail(){this.state==I.started&&(this.state=I.failed,this.adapter.visitFailed(this),this.delegate.visitCompleted(this))}changeHistory(){if(!this.historyChanged&&this.updateHistory){let e=ue(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 A(this,O.get,this.location),this.request.perform())}simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric(Rt.requestStart),this.adapter.visitRequestStarted(this)}recordResponse(e=this.response){if(this.response=e,e){let{statusCode:t}=e;Vt(t)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,t)}}finishRequest(){this.recordTimingMetric(Rt.requestEnd),this.adapter.visitRequestFinished(this)}loadResponse(){if(this.response){let{statusCode:e,responseHTML:t}=this.response;this.render(async()=>{if(this.shouldCacheSnapshot&&this.cacheSnapshot(),this.view.renderPromise&&await this.view.renderPromise,Vt(e)&&t!=null){let e=F.fromHTMLString(t);await this.renderPageSnapshot(e,!1),this.adapter.visitRendered(this),this.complete()}else await this.view.renderError(F.fromHTMLString(t),this),this.adapter.visitRendered(this),this.fail()})}}getCachedSnapshot(){let e=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(e&&(!E(this.location)||e.hasAnchor(E(this.location)))&&(this.action==`restore`||e.isPreviewable))return e}getPreloadedSnapshot(){if(this.snapshotHTML)return F.fromHTMLString(this.snapshotHTML)}hasCachedSnapshot(){return this.getCachedSnapshot()!=null}loadCachedSnapshot(){let e=this.getCachedSnapshot();if(e){let 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(j.contentType)}
17requestStarted(){this.startRequest()}requestPreventedHandlingResponse(e,t){}async requestSucceededWithResponse(e,t){let n=await t.responseHTML,{redirected:r,statusCode:i}=t;n==null?this.recordResponse({statusCode:L.contentTypeMismatch,redirected:r}):(this.redirectedToLocation=t.redirected?t.location:void 0,this.recordResponse({statusCode:i,responseHTML:n,redirected:r}))}async requestFailedWithResponse(e,t){let n=await t.responseHTML,{redirected:r,statusCode:i}=t;n==null?this.recordResponse({statusCode:L.contentTypeMismatch,redirected:r}):this.recordResponse({statusCode:i,responseHTML:n,redirected:r})}requestErrored(e,t){this.recordResponse({statusCode:L.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(){let{scrollPosition:e}=this.restorationData;if(e)return this.view.scrollToPosition(e),!0}scrollToAnchor(){let e=E(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)),!0)}async render(e){this.cancelRender(),await new Promise(e=>{this.frame=document.visibilityState===`hidden`?setTimeout(()=>e(),0):requestAnimationFrame(()=>e())}),await e(),delete this.frame}async renderPageSnapshot(e,t){await this.viewTransitioner.renderChange(this.view.shouldTransitionTo(e),async()=>{await this.view.renderPage(e,t,this.willRender,this),this.performScroll()})}cancelRender(){this.frame&&(cancelAnimationFrame(this.frame),delete this.frame)}};function Vt(e){return e>=200&&e<300}var Ht=class{progressBar=new Dt;constructor(e){this.session=e}visitProposedToLocation(e,t){D(e,this.navigator.rootLocation)?this.navigator.startVisit(e,t?.restorationIdentifier||x(),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 L.networkFailure:case L.timeoutFailure:case L.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}formSubmissionStarted(e){this.progressBar.setValue(0),this.showFormProgressBarAfterDelay()}formSubmissionFinished(e){this.progressBar.setValue(1),this.hideFormProgressBar()}showVisitProgressBarAfterDelay(){this.visitProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay)}hideVisitProgressBar(){this.progressBar.hide(),this.visitProgressBarTimeout!=null&&(window.clearTimeout(this.visitProgressBarTimeout),delete this.visitProgressBarTimeout)}showFormProgressBarAfterDelay(){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){g(`turbo:reload`,{detail:e}),window.location.href=(this.redirectedToLocation||this.location)?.toString()||window.location.href}get navigator(){return this.session.navigator}},Ut=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(let e of this.temporaryElements)e.remove()};get temporaryElements(){return[...document.querySelectorAll(this.selector)]}},Wt=class{constructor(e,t){this.session=e,this.element=t,this.linkInterceptor=new dt(this,t),this.formSubmitObserver=new ot(this,t)}start(){this.linkInterceptor.start(),this.formSubmitObserver.start()}stop(){this.linkInterceptor.stop(),this.formSubmitObserver.stop()}shouldInterceptLinkClick(e,t,n){return this.#t(e)}linkClickIntercepted(e,t,n){let r=this.#n(e);r&&r.delegate.linkClickIntercepted(e,t,n)}willSubmitForm(e,t){return e.closest(`turbo-frame`)==null&&this.#e(e,t)&&this.#t(e,t)}formSubmitted(e,t){let n=this.#n(e,t);n&&n.delegate.formSubmitted(e,t)}#e(e,t){let n=Ce(e,t),r=T(this.element.ownerDocument.querySelector(`meta[name="turbo-root"]`)?.content??`/`);return this.#t(e,t)&&D(n,r)}#t(e,t){if(e instanceof HTMLFormElement?this.session.submissionIsNavigatable(e,t):this.session.elementIsNavigatable(e)){let n=this.#n(e,t);return n?n!=e.closest(`turbo-frame`):!1}return!1}#n(e,t){let n=t?.getAttribute(`data-turbo-frame`)||e.getAttribute(`data-turbo-frame`);if(n&&n!=`_top`){let e=this.element.querySelector(`#${n}:not([disabled])`);if(e instanceof f)return e}}},Gt=class{location;restorationIdentifier=x();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),!1)}push(e,t){this.update(history.pushState,e,t)}replace(e,t){this.update(history.replaceState,e,t)}update(e,t,n=x()){e===history.pushState&&++this.currentIndex;let r={turbo:{restorationIdentifier:n,restorationIndex:this.currentIndex}};e.call(history,r,``,t.href),this.location=t,this.restorationIdentifier=n}getRestorationDataForIdentifier(e){return this.restorationData[e]||{}}updateRestorationData(e){let{restorationIdentifier:t}=this,n=this.restorationData[t];this.restorationData[t]={...n,...e}}assumeControlOfScrollRestoration(){this.previousScrollRestoration||(this.previousScrollRestoration=history.scrollRestoration??`auto`,history.scrollRestoration=`manual`)}relinquishControlOfScrollRestoration(){this.previousScrollRestoration&&(history.scrollRestoration=this.previousScrollRestoration,delete this.previousScrollRestoration)}onPopState=e=>{let{turbo:t}=e.state||{};if(this.location=new URL(window.location.href),t){let{restorationIdentifier:e,restorationIndex:n}=t;this.restorationIdentifier=e;let r=n>this.currentIndex?`forward`:`back`;this.delegate.historyPoppedToLocationWithRestorationIdentifierAndDirection(this.location,e,r),this.currentIndex=n}else this.currentIndex++,this.delegate.historyPoppedWithEmptyState(this.location)}},Kt=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.#n,{capture:!0,passive:!0}),this.eventTarget.removeEventListener(`mouseleave`,this.#r,{capture:!0,passive:!0}),this.eventTarget.removeEventListener(`turbo:before-fetch-request`,this.#a,!0),!1)}#t=()=>{this.eventTarget.addEventListener(`mouseenter`,this.#n,{capture:!0,passive:!0}),this.eventTarget.addEventListener(`mouseleave`,this.#r,{capture:!0,passive:!0}),this.eventTarget.addEventListener(`turbo:before-fetch-request`,this.#a,!0),this.started=!0};#n=e=>{if(pe(`turbo-prefetch`)===`false`)return;let t=e.target;if(t.matches&&t.matches(`a[href]:not([target^=_]):not([download])`)&&this.#s(t)){let e=t,n=Ee(e);if(this.delegate.canPrefetchRequestToLocation(e,n)){this.#e=e;let r=new A(this,O.get,n,new URLSearchParams,t);r.fetchOptions.priority=`low`,M.putLater(n,r,this.#o)}}};#r=e=>{e.target===this.#e&&this.#i()};#i=()=>{M.clear(),this.#e=null};#a=e=>{if(e.target.tagName!==`FORM`&&e.detail.fetchOptions.method===`GET`){let t=M.get(e.detail.url);t&&(e.detail.fetchRequest=t),M.clear()}};prepareRequest(e){let t=e.target;e.headers[`X-Sec-Purpose`]=`prefetch`;let n=t.closest(`turbo-frame`),r=t.getAttribute(`data-turbo-frame`)||n?.getAttribute(`target`)||n?.id;r&&r!==`_top`&&(e.headers[`Turbo-Frame`]=r)}requestSucceededWithResponse(){}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}get#o(){return Number(pe(`turbo-prefetch-cache-time`))||Je}#s(e){return!(!e.getAttribute(`href`)||qt(e)||Jt(e)||Yt(e)||Xt(e)||Qt(e))}},qt=e=>e.origin!==document.location.origin||![`http:`,`https:`].includes(e.protocol)||e.hasAttribute(`target`),Jt=e=>e.pathname+e.search===document.location.pathname+document.location.search||e.href.startsWith(`#`),Yt=e=>{if(e.getAttribute(`data-turbo-prefetch`)===`false`||e.getAttribute(`data-turbo`)===`false`)return!0;let t=C(e,`[data-turbo-prefetch]`);return!!(t&&t.getAttribute(`data-turbo-prefetch`)===`false`)},Xt=e=>{let t=e.getAttribute(`data-turbo-method`);return!!(t&&t.toLowerCase()!==`get`||Zt(e)||e.hasAttribute(`data-turbo-confirm`)||e.hasAttribute(`data-turbo-stream`))},Zt=e=>e.hasAttribute(`data-remote`)||e.hasAttribute(`data-behavior`)||e.hasAttribute(`data-confirm`)||e.hasAttribute(`data-method`),Qt=e=>g(`turbo:before-prefetch`,{target:e,cancelable:!0}).defaultPrevented,$t=class{constructor(e){this.delegate=e}proposeVisit(e,t={}){this.delegate.allowsVisitingLocationWithAction(e,t.action)&&this.delegate.visitProposedToLocation(e,t)}startVisit(e,t,n={}){this.stop(),this.currentVisit=new Bt(this,T(e),t,{referrer:this.location,...n}),this.currentVisit.start()}submitForm(e,t){this.stop(),this.formSubmission=new Ye(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){let n=await t.responseHTML;if(n){let r=e.isSafe;r||this.view.clearSnapshotCache();let{statusCode:i,redirected:a}=t,o={action:this.#e(e,t),shouldCacheSnapshot:r,response:{statusCode:i,responseHTML:n,redirected:a}};this.proposeVisit(t.location,o)}}}async formSubmissionFailedWithResponse(e,t){let n=await t.responseHTML;if(n){let e=F.fromHTMLString(n);t.serverError?await this.view.renderError(e,this.currentVisit):await this.view.renderPage(e,!1,!0,this.currentVisit),e.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)}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){let{submitter:n,formElement:r}=e;return S(n,r)||this.#t(t)}#t(e){return e.redirected&&e.location.href===this.location?.href?`replace`:`advance`}},R={initial:0,loading:1,interactive:2,complete:3},en=class{stage=R.initial;started=!1;constructor(e){this.delegate=e}start(){this.started||=(this.stage==R.initial&&(this.stage=R.loading),document.addEventListener(`readystatechange`,this.interpretReadyState,!1),addEventListener(`pagehide`,this.pageWillUnload,!1),!0)}stop(){this.started&&=(document.removeEventListener(`readystatechange`,this.interpretReadyState,!1),removeEventListener(`pagehide`,this.pageWillUnload,!1),!1)}interpretReadyState=()=>{let{readyState:e}=this;e==`interactive`?this.pageIsInteractive():e==`complete`&&this.pageIsComplete()};pageIsInteractive(){this.stage==R.loading&&(this.stage=R.interactive,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==R.interactive&&(this.stage=R.complete,this.delegate.pageLoaded())}pageWillUnload=()=>{this.delegate.pageWillUnload()};get readyState(){return document.readyState}},tn=class{started=!1;constructor(e){this.delegate=e}start(){this.started||=(addEventListener(`scroll`,this.onScroll,!1),this.onScroll(),!0)}stop(){this.started&&=(removeEventListener(`scroll`,this.onScroll,!1),!1)}onScroll=()=>{this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})};updatePosition(e){this.delegate.scrollPositionChanged(e)}},nn=class{render({fragment:e}){mt.preservingPermanentElements(this,rn(e),()=>{an(e,()=>{on(()=>{document.documentElement.appendChild(e)})})})}enteringBardo(e,t){t.replaceWith(e.cloneNode(!0))}leavingBardo(){}};function rn(e){let t=at(document.documentElement),n={};for(let r of t){let{id:t}=r;for(let i of e.querySelectorAll(`turbo-stream`)){let e=it(i.templateElement.content,t);e&&(n[t]=[r,e])}}return n}async function an(e,t){let n=`turbo-stream-autofocus-${x()}`,r=sn(e.querySelectorAll(`turbo-stream`)),i=null;
17if(r&&(i=r.id?r.id:n,r.id=i),t(),await _(),(document.activeElement==null||document.activeElement==document.body)&&i){let e=document.getElementById(i);ge(e)&&e.focus(),e&&e.id==n&&e.removeAttribute(`id`)}}async function on(e){let[t,n]=await ve(e,()=>document.activeElement),r=t&&t.id;if(r){let e=document.getElementById(r);ge(e)&&e!=n&&e.focus()}}function sn(e){for(let t of e){let e=_e(t.templateElement.content);if(e)return e}return null}var cn=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=>{let t=ln(e);t&&un(t)&&(e.preventDefault(),this.receiveMessageResponse(t))};receiveMessageEvent=e=>{this.#e&&typeof e.data==`string`&&this.receiveMessageHTML(e.data)};async receiveMessageResponse(e){let t=await e.responseHTML;t&&this.receiveMessageHTML(t)}receiveMessageHTML(e){this.delegate.receivedMessageFromStream(j.wrap(e))}};function ln(e){let t=e.detail?.fetchResponse;if(t instanceof Ne)return t}function un(e){return(e.contentType??``).startsWith(j.contentType)}var dn=class extends gt{static renderElement(e,t){let{documentElement:n,body:r}=document;n.replaceChild(t,r)}async render(){this.replaceHeadAndBody(),this.activateScriptElements()}replaceHeadAndBody(){let{documentElement:e,head:t}=document;e.replaceChild(this.newHead,t),this.renderElement(this.currentElement,this.newElement)}activateScriptElements(){for(let e of this.scriptElements){let t=e.parentNode;if(t){let n=h(e);t.replaceChild(n,e)}}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return document.documentElement.querySelectorAll(`script`)}},fn=class extends gt{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}get newHeadSnapshot(){return this.newSnapshot.headSnapshot}get newElement(){return this.newSnapshot.element}#e(){let{documentElement:e}=this.currentSnapshot,{dir:t,lang:n}=this.newSnapshot;n?e.setAttribute(`lang`,n):e.removeAttribute(`lang`),t?e.setAttribute(`dir`,t):e.removeAttribute(`dir`)}async mergeHead(){let 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(){let e=[];for(let t of this.newHeadStylesheetElements)e.push(le(t)),document.head.appendChild(t);await Promise.all(e)}copyNewHeadScriptElements(){for(let e of this.newHeadScriptElements)document.head.appendChild(h(e))}removeUnusedDynamicStylesheetElements(){for(let e of this.unusedDynamicStylesheetElements)document.head.removeChild(e)}async mergeProvisionalElements(){let e=[...this.newHeadProvisionalElements];for(let t of this.currentHeadProvisionalElements)this.isCurrentElementInElementList(t,e)||document.head.removeChild(t);for(let t of e)document.head.appendChild(t)}isCurrentElementInElementList(e,t){for(let[n,r]of t.entries()){if(e.tagName==`TITLE`){if(r.tagName!=`TITLE`)continue;if(e.innerHTML==r.innerHTML)return t.splice(n,1),!0}if(r.isEqualNode(e))return t.splice(n,1),!0}return!1}removeCurrentHeadProvisionalElements(){for(let e of this.currentHeadProvisionalElements)document.head.removeChild(e)}copyNewHeadProvisionalElements(){for(let e of this.newHeadProvisionalElements)document.head.appendChild(e)}activateNewBody(){document.adoptNode(this.newElement),this.removeNoscriptElements(),this.activateNewBodyScriptElements()}removeNoscriptElements(){for(let e of this.newElement.querySelectorAll(`noscript`))e.remove()}activateNewBodyScriptElements(){for(let e of this.newBodyScriptElements){let t=h(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`)}},pn=class extends fn{static renderElement(e,t){P(e,t,{callbacks:{beforeNodeMorphed:(e,t)=>St(e,t)&&!wt(e)?(e.reload(),!1):!0}}),g(`turbo:morph`,{detail:{currentElement:e,newElement:t}})}async preservingPermanentElements(e){return await e()}get renderMethod(){return`morph`}get shouldAutofocus(){return!1}},mn=class extends Ge{constructor(e){super(e,Oe)}get snapshots(){return this.entries}},hn=class extends lt{snapshotCache=new mn(10);lastRenderedLocation=new URL(location.href);forceReloaded=!1;shouldTransitionTo(e){return this.snapshot.prefersViewTransitions&&e.prefersViewTransitions}renderPage(e,t=!1,n=!0,r){let i=new(this.isPageRefresh(r)&&(r?.refresh?.method||this.snapshot.refreshMethod)===`morph`?pn:fn)(this.snapshot,e,t,n);return i.shouldRender?r?.changeHistory():this.forceReloaded=!0,this.render(i)}renderError(e,t){t?.changeHistory();let n=new dn(this.snapshot,e,!1);return this.render(n)}clearSnapshotCache(){this.snapshotCache.clear()}async cacheSnapshot(e=this.snapshot){if(e.isCacheable){this.delegate.viewWillCacheSnapshot();let{lastRenderedLocation:t}=this;await v();let n=e.clone();return this.snapshotCache.put(t,n),n}}getCachedSnapshotForLocation(e){return this.snapshotCache.get(e)}isPageRefresh(e){return!e||this.lastRenderedLocation.pathname===e.location.pathname&&e.action===`replace`}shouldPreserveScrollPosition(e){return this.isPageRefresh(e)&&(e?.refresh?.scroll||this.snapshot.refreshScroll)===`preserve`}get snapshot(){return F.fromElement(this.element)}},gn=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(let t of e.querySelectorAll(this.selector))this.delegate.shouldPreloadLink(t)&&this.preloadURL(t)}async preloadURL(e){let t=new URL(e.href);this.snapshotCache.has(t)||await new A(this,O.get,t,new URLSearchParams,e).perform()}prepareRequest(e){e.headers[`X-Sec-Purpose`]=`prefetch`}async requestSucceededWithResponse(e,t){try{let n=await t.responseHTML,r=F.fromHTMLString(n);this.snapshotCache.put(e.url,r)}catch{}}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}#e=()=>{this.preloadOnLoadLinksForView(document.body)}},_n=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){he(`turbo-cache-control`,e)}},vn=class{navigator=new $t(this);history=new Gt(this);view=new hn(this,document.documentElement);adapter=new Ht(this);
17pageObserver=new en(this);cacheObserver=new Ut;linkPrefetchObserver=new Kt(this,document);linkClickObserver=new ft(this,window);formSubmitObserver=new ot(this,document);scrollObserver=new tn(this);streamObserver=new cn(this);formLinkClickObserver=new pt(this,document.documentElement);frameRedirector=new Wt(this,document.documentElement);streamMessageRenderer=new nn;cache=new _n(this);enabled=!0;started=!1;#e=150;constructor(e){this.recentRequests=e,this.preloader=new gn(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(),!1)}registerAdapter(e){this.adapter=e}visit(e,t={}){let n=t.frame?document.getElementById(t.frame):null;if(n instanceof f){let r=t.action||S(n);n.delegate.proposeVisitIfNavigatedWithAction(n,r),n.src=e.toString()}else this.navigator.proposeVisit(T(e),t)}refresh(e,t={}){t=typeof t==`string`?{requestId:t}:t;let{method:n,requestId:r,scroll:i}=t,a=r&&this.recentRequests.has(r),o=e===document.baseURI;!a&&!this.navigator.currentVisit&&o&&this.visit(e,{action:`replace`,shouldCacheSnapshot:!1,refresh:{method:n,scroll:i}})}connectStreamSource(e){this.streamObserver.connectStreamSource(e)}disconnectStreamSource(e){this.streamObserver.disconnectStreamSource(e)}renderStreamMessage(e){this.streamMessageRenderer.render(j.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){w.drive.progressBarDelay=e}get progressBarDelay(){return w.drive.progressBarDelay}set drive(e){w.drive.enabled=e}get drive(){return w.drive.enabled}set formMode(e){w.forms.mode=e}get formMode(){return w.forms.mode}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}get pageRefreshDebouncePeriod(){return this.#e}set pageRefreshDebouncePeriod(e){this.refresh=xe(this.debouncedRefresh.bind(this),e),this.#e=e}shouldPreloadLink(e){let t=e.hasAttribute(`data-turbo-method`),n=e.hasAttribute(`data-turbo-stream`),r=e.getAttribute(`data-turbo-frame`),i=r==`_top`?null:document.getElementById(r)||C(e,`turbo-frame:not([disabled])`);if(t||n||i instanceof f)return!1;{let t=new URL(e.href);return this.elementIsNavigatable(e)&&D(t,this.snapshot.rootLocation)}}historyPoppedToLocationWithRestorationIdentifierAndDirection(e,t,n){this.enabled?this.navigator.startVisit(e,t,{action:`restore`,historyChanged:!0,direction:n}):this.adapter.pageInvalidated({reason:`turbo_disabled`})}historyPoppedWithEmptyState(e){this.history.replace(e),this.view.lastRenderedLocation=e,this.view.cacheSnapshot()}scrollPositionChanged(e){this.history.updateRestorationData({scrollPosition:e})}willSubmitFormLinkToLocation(e,t){return this.elementIsNavigatable(e)&&D(t,this.snapshot.rootLocation)}submittedFormLinkToLocation(){}canPrefetchRequestToLocation(e,t){return this.elementIsNavigatable(e)&&D(t,this.snapshot.rootLocation)&&this.navigator.linkPrefetchingIsEnabledForLocation(t)}willFollowLinkToLocation(e,t,n){return this.elementIsNavigatable(e)&&D(t,this.snapshot.rootLocation)&&this.applicationAllowsFollowingLinkToLocation(e,t,n)}followedLinkToLocation(e,t){let n=this.getActionForLink(e),r=e.hasAttribute(`data-turbo-stream`);this.visit(t.href,{action:n,acceptsStreamResponse:r})}allowsVisitingLocationWithAction(e,t){return this.applicationAllowsVisitingLocation(e)}visitProposedToLocation(e,t){yn(e),this.adapter.visitProposedToLocation(e,t)}visitStarted(e){e.acceptsStreamResponse||(se(document.documentElement),this.view.markVisitDirection(e.direction)),yn(e.location),this.notifyApplicationAfterVisitingLocation(e.location,e.action)}visitCompleted(e){this.view.unmarkVisitDirection(),ce(document.documentElement),this.notifyApplicationAfterPageLoad(e.getTimingMetrics())}willSubmitForm(e,t){let n=Ce(e,t);return this.submissionIsNavigatable(e,t)&&D(T(n),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){let{defaultPrevented:n,detail:{render:r}}=this.notifyApplicationBeforeRender(e,t);return this.view.renderer&&r&&(this.view.renderer.renderElement=r),!n}viewRenderedSnapshot(e,t,n){this.view.lastRenderedLocation=this.history.location,this.notifyApplicationAfterRender(n)}preloadOnLoadLinksForView(e){this.preloader.preloadOnLoadLinksForView(e)}viewInvalidated(e){this.adapter.pageInvalidated(e)}frameLoaded(e){this.notifyApplicationAfterFrameLoad(e)}frameRendered(e,t){this.notifyApplicationAfterFrameRender(e,t)}applicationAllowsFollowingLinkToLocation(e,t,n){return!this.notifyApplicationAfterClickingLinkToLocation(e,t,n).defaultPrevented}applicationAllowsVisitingLocation(e){return!this.notifyApplicationBeforeVisitingLocation(e).defaultPrevented}notifyApplicationAfterClickingLinkToLocation(e,t,n){return g(`turbo:click`,{target:e,detail:{url:t.href,originalEvent:n},cancelable:!0})}notifyApplicationBeforeVisitingLocation(e){return g(`turbo:before-visit`,{detail:{url:e.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(e,t){return g(`turbo:visit`,{detail:{url:e.href,action:t}})}notifyApplicationBeforeCachingSnapshot(){return g(`turbo:before-cache`)}
17notifyApplicationBeforeRender(e,t){return g(`turbo:before-render`,{detail:{newBody:e,...t},cancelable:!0})}notifyApplicationAfterRender(e){return g(`turbo:render`,{detail:{renderMethod:e}})}notifyApplicationAfterPageLoad(e={}){return g(`turbo:load`,{detail:{url:this.location.href,timing:e}})}notifyApplicationAfterFrameLoad(e){return g(`turbo:frame-load`,{target:e})}notifyApplicationAfterFrameRender(e,t){return g(`turbo:frame-render`,{detail:{fetchResponse:e},target:t,cancelable:!0})}submissionIsNavigatable(e,t){if(w.forms.mode==`off`)return!1;{let n=!t||this.elementIsNavigatable(t);return w.forms.mode==`optin`?n&&e.closest(`[data-turbo="true"]`)!=null:n&&this.elementIsNavigatable(e)}}elementIsNavigatable(e){let t=C(e,`[data-turbo]`),n=C(e,`turbo-frame`);return w.drive.enabled||n?!t||t.getAttribute(`data-turbo`)!=`false`:t?t.getAttribute(`data-turbo`)==`true`:!1}getActionForLink(e){return S(e)||`advance`}get snapshot(){return this.view.snapshot}};function yn(e){Object.defineProperties(e,bn)}var bn={absoluteURL:{get(){return this.toString()}}},z=new vn(Pe),{cache:xn,navigator:Sn}=z;function Cn(){z.start()}function wn(e){z.registerAdapter(e)}function Tn(e,t){z.visit(e,t)}function En(e){z.connectStreamSource(e)}function Dn(e){z.disconnectStreamSource(e)}function On(e){z.renderStreamMessage(e)}function kn(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.`"),w.drive.progressBarDelay=e}function An(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.`"),w.forms.confirm=e}function jn(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.`"),w.forms.mode=e}function Mn(e,t){pn.renderElement(e,t)}function Nn(e,t){Et.renderElement(e,t)}var Pn=Object.freeze({__proto__:null,PageRenderer:fn,PageSnapshot:F,FrameRenderer:_t,fetch:Fe,config:w,session:z,cache:xn,navigator:Sn,start:Cn,registerAdapter:wn,visit:Tn,connectStreamSource:En,disconnectStreamSource:Dn,renderStreamMessage:On,setProgressBarDelay:kn,setConfirmMethod:An,setFormMode:jn,morphBodyElements:Mn,morphTurboFrameElements:Nn,morphChildren:xt,morphElements:P}),Fn=class extends Error{},In=class{fetchResponseLoaded=e=>Promise.resolve();#e=null;#t=()=>{};#n=!1;#r=!1;#i=new Set;#a=!1;action=null;constructor(e){this.element=e,this.view=new ut(this,this.element),this.appearanceObserver=new He(this,this.element),this.formLinkClickObserver=new pt(this,this.element),this.linkInterceptor=new dt(this,this.element),this.restorationIdentifier=x(),this.formSubmitObserver=new ot(this,this.element)}connect(){this.#n||(this.#n=!0,this.loadingStyle==d.lazy?this.appearanceObserver.start():this.#o(),this.formLinkClickObserver.start(),this.linkInterceptor.start(),this.formSubmitObserver.start())}disconnect(){this.#n&&(this.#n=!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==d.eager&&this.#o()}sourceURLChanged(){this.#v(`src`)||(this.sourceURL||this.#e?.cancel(),this.element.isConnected&&(this.complete=!1),(this.loadingStyle==d.eager||this.#r)&&this.#o())}sourceURLReloaded(){let{refresh:e,src:t}=this.element;return this.#a=t&&e===`morph`,this.element.removeAttribute(`complete`),this.element.src=null,this.element.src=t,this.element.loaded}loadingStyleChanged(){this.loadingStyle==d.lazy?this.appearanceObserver.start():(this.appearanceObserver.stop(),this.#o())}async#o(){this.enabled&&this.isActive&&!this.complete&&this.sourceURL&&(this.element.loaded=this.#c(T(this.sourceURL)),this.appearanceObserver.stop(),await this.element.loaded,this.#r=!0)}async loadResponse(e){(e.redirected||e.succeeded&&e.isHTML)&&(this.sourceURL=e.response.url);try{let t=await e.responseHTML;if(t){let n=y(t);F.fromDocument(n).isVisitable?await this.#s(e,n):await this.#u(e)}}finally{this.#a=!1,this.fetchResponseLoaded=()=>Promise.resolve()}}elementAppearedInViewport(e){this.proposeVisitIfNavigatedWithAction(e,S(e)),this.#o()}willSubmitFormLinkToLocation(e){return this.#_(e)}submittedFormLinkToLocation(e,t,n){let r=this.#h(e);r&&n.setAttribute(`data-turbo-frame`,r.id)}shouldInterceptLinkClick(e,t,n){return this.#_(e)}linkClickIntercepted(e,t){this.#l(e,t)}willSubmitForm(e,t){return e.closest(`turbo-frame`)==this.element&&this.#_(e,t)}formSubmitted(e,t){this.formSubmission&&this.formSubmission.stop(),this.formSubmission=new Ye(this,e,t);let{fetchRequest:n}=this.formSubmission,r=this.#h(e,t);this.prepareRequest(n,r),this.formSubmission.start()}
17prepareRequest(e,t=this){e.headers[`Turbo-Frame`]=t.id,this.currentNavigationElement?.hasAttribute(`data-turbo-stream`)&&e.acceptResponseType(j.contentType)}requestStarted(e){se(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){ce(this.element)}formSubmissionStarted({formElement:e}){se(e,this.#h(e))}formSubmissionSucceededWithResponse(e,t){let n=this.#h(e.formElement,e.submitter);n.delegate.proposeVisitIfNavigatedWithAction(n,S(e.submitter,e.formElement,n)),n.delegate.loadResponse(t),e.isSafe||z.clearCache()}formSubmissionFailedWithResponse(e,t){this.element.delegate.loadResponse(t),z.clearCache()}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished({formElement:e}){ce(e,this.#h(e))}allowsImmediateRender({element:e},t){let{defaultPrevented:n,detail:{render:r}}=g(`turbo:before-frame-render`,{target:this.element,detail:{newFrame:e,...t},cancelable:!0});return this.view.renderer&&r&&(this.view.renderer.renderElement=r),!n}viewRenderedSnapshot(e,t,n){}preloadOnLoadLinksForView(e){z.preloadOnLoadLinksForView(e)}viewInvalidated(){}willRenderFrame(e,t){this.previousFrameElement=e.cloneNode(!0)}visitCachedSnapshot=({element:e})=>{let t=e.querySelector(`#`+this.element.id);t&&this.previousFrameElement&&t.replaceChildren(...this.previousFrameElement.children),delete this.previousFrameElement};async#s(e,t){let n=await this.extractForeignFrameElement(t.body),r=this.#a?Et:_t;if(n){let t=new rt(n),i=new r(this,this.view.snapshot,t,!1,!1);this.view.renderPromise&&await this.view.renderPromise,this.changeHistory(),await this.view.render(i),this.complete=!0,z.frameRendered(e,this.element),z.frameLoaded(this.element),await this.fetchResponseLoaded(e)}else this.#d(e)&&this.#f(e)}async#c(e){let t=new A(this,O.get,e,new URLSearchParams,this.element);return this.#e?.cancel(),this.#e=t,new Promise(e=>{this.#t=()=>{this.#t=()=>{},this.#e=null,e()},t.perform()})}#l(e,t,n){let r=this.#h(e,n);r.delegate.proposeVisitIfNavigatedWithAction(r,S(n,e,r)),this.#b(e,()=>{r.src=t})}proposeVisitIfNavigatedWithAction(e,t=null){if(this.action=t,this.action){let t=F.fromElement(e).clone(),{visitCachedSnapshot:n}=e.delegate;e.delegate.fetchResponseLoaded=async r=>{if(e.src){let{statusCode:i,redirected:a}=r,o={response:{statusCode:i,redirected:a,responseHTML:await r.responseHTML},visitCachedSnapshot:n,willRender:!1,updateHistory:!1,restorationIdentifier:this.restorationIdentifier,snapshot:t};this.action&&(o.action=this.action),z.visit(e.src,o)}}}}changeHistory(){if(this.action){let e=ue(this.action);z.history.update(e,T(this.element.src||``),this.restorationIdentifier)}}async#u(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.#m(e.response)}#d(e){this.element.setAttribute(`complete`,``);let t=e.response;return!g(`turbo:frame-missing`,{target:this.element,detail:{response:t,visit:async(e,t)=>{e instanceof Response?this.#m(e):z.visit(e,t)}},cancelable:!0}).defaultPrevented}#f(e){this.view.missing(),this.#p(e)}#p(e){throw new Fn(`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#m(e){let t=new Ne(e),n=await t.responseHTML,{location:r,redirected:i,statusCode:a}=t;return z.visit(r,{response:{redirected:i,statusCode:a,responseHTML:n}})}#h(e,t){let n=ae(`data-turbo-frame`,t,e)||this.element.getAttribute(`target`),r=this.#x(n);return r instanceof f?r:this.element}async extractForeignFrameElement(e){let t,n=CSS.escape(this.id);try{if(t=Ln(e.querySelector(`turbo-frame#${n}`),this.sourceURL),t)return t;if(t=Ln(e.querySelector(`turbo-frame[src][recurse~=${n}]`),this.sourceURL),t)return await t.loaded,await this.extractForeignFrameElement(t)}catch(e){return console.error(e),new f}return null}#g(e,t){return D(T(Ce(e,t)),this.rootLocation)}#_(e,t){let n=ae(`data-turbo-frame`,t,e)||this.element.getAttribute(`target`);if(e instanceof HTMLFormElement&&!this.#g(e,t)||!this.enabled||n==`_top`)return!1;if(n){let e=this.#x(n);if(e)return!e.disabled;if(n==`_parent`)return!1}return!(!z.elementIsNavigatable(e)||t&&!z.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.#y(`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.#n}get rootLocation(){return T(this.element.ownerDocument.querySelector(`meta[name="turbo-root"]`)?.content??`/`)}#v(e){return this.#i.has(e)}#y(e,t){this.#i.add(e),t(),this.#i.delete(e)}#b(e,t){this.currentNavigationElement=e,t(),delete this.currentNavigationElement}#x(e){if(e!=null){let t=e===`_parent`?this.element.parentElement.closest(`turbo-frame`):document.getElementById(e);if(t instanceof f)return t}}};function Ln(e,t){if(e){let n=e.getAttribute(`src`);if(n!=null&&t!=null&&ke(n,t))throw 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 f)return e.connectedCallback(),e.disconnectedCallback(),e}}var Rn={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(){let e=this.getAttribute(`method`);this.targetElements.forEach(t=>{e===`morph`?P(t,this.templateContent):t.replaceWith(this.templateContent)})},update(){let e=this.getAttribute(`method`);this.targetElements.forEach(t=>{e===`morph`?xt(t,this.templateContent):(t.innerHTML=``,t.append(this.templateContent))})},refresh(){let e=this.getAttribute(`method`),t=this.requestId,n=this.getAttribute(`scroll`);z.refresh(this.baseURI,{method:e,requestId:t,scroll:n})}},zn=class e extends HTMLElement{static async renderElement(e){await e.performAction()}async connectedCallback(){try{await this.render()}catch(e){console.error(e)}finally{this.disconnect()}}async render(){return this.renderPromise??=(async()=>{let e=this.beforeRenderEvent;this.dispatchEvent(e)&&(await _(),await e.detail.render(this))})()}disconnect(){try{this.remove()}catch{}}removeDuplicateTargetChildren(){this.duplicateChildren.forEach(e=>e.remove())}get duplicateChildren(){let e=this.targetElements.flatMap(e=>[...e.children]).filter(e=>!!e.getAttribute(`id`)),t=[...this.templateContent?.children||[]].filter(e=>!!e.getAttribute(`id`)).map(e=>e.getAttribute(`id`));return e.filter(e=>t.includes(e.getAttribute(`id`)))}removeDuplicateTargetSiblings(){this.duplicateSiblings.forEach(e=>e.remove())}get duplicateSiblings(){let e=this.targetElements.flatMap(e=>[...e.parentElement.children]).filter(e=>!!e.id),t=[...this.templateContent?.children||[]].filter(e=>!!e.id).map(e=>e.id);return e.filter(e=>t.includes(e.id))}get performAction(){if(this.action){let e=Rn[this.action];if(e)return e;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){let e=this.ownerDocument.createElement(`template`);return this.appendChild(e),e}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(e){throw Error(`${this.description}: ${e}`)}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:e.renderElement}})}get targetElementsById(){let e=this.ownerDocument?.getElementById(this.target);return e===null?[]:[e]}get targetElementsByQuery(){let e=this.ownerDocument?.querySelectorAll(this.targets);return e.length===0?[]:Array.prototype.slice.call(e)}},Bn=class extends HTMLElement{streamSource=null;connectedCallback(){this.streamSource=this.src.match(/^ws{1,2}:/)?new WebSocket(this.src):new EventSource(this.src),En(this.streamSource)}disconnectedCallback(){this.streamSource&&(this.streamSource.close(),Dn(this.streamSource))}get src(){return this.getAttribute(`src`)||``}};f.delegateConstructor=In,customElements.get(`turbo-frame`)===void 0&&customElements.define(`turbo-frame`,f),customElements.get(`turbo-stream`)===void 0&&customElements.define(`turbo-stream`,zn),customElements.get(`turbo-stream-source`)===void 0&&customElements.define(`turbo-stream-source`,Bn),(()=>{let 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(b` 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={...Pn,StreamActions:Rn},Cn();var Vn=`modulepreload`,Hn=function(e){return`/vite/`+e},Un={},B=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Hn(t,n),t=s(t),t in Un)return;Un[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Vn,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n
26)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Wn;async function Gn(){return Wn||Kn(qn().then(Kn))}function Kn(e){return Wn=e}async function qn(){let{createConsumer:e}=await B(async()=>{let{createConsumer:e}=await import(`./src-C1JqOUCD.js`);return{createConsumer:e}},[]);return e()}async function Jn(e,t){let{subscriptions:n}=await Gn();return n.create(e,t)}function Yn(e){return!e||typeof e!=`object`||e instanceof Date||e instanceof RegExp?e:Array.isArray(e)?e.map(Yn):Object.keys(e).reduce(function(t,n){var r=n[0].toLowerCase()+n.slice(1).replace(/([A-Z]+)/g,function(e,t){return`_`+t.toLowerCase()});return t[r]=Yn(e[n]),t},{})}var Xn=class extends HTMLElement{static observedAttributes=[`channel`,`signed-stream-name`];async connectedCallback(){En(this),this.subscription=await Jn(this.channel,{received:this.dispatchMessageEvent.bind(this),connected:this.subscriptionConnected.bind(this),disconnected:this.subscriptionDisconnected.bind(this)})}disconnectedCallback(){Dn(this),this.subscription&&this.subscription.unsubscribe(),this.subscriptionDisconnected()}attributeChangedCallback(){this.subscription&&(this.disconnectedCallback(),this.connectedCallback())}dispatchMessageEvent(e){let 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`),...Yn({...this.dataset})}}};customElements.get(`turbo-cable-stream-source`)===void 0&&customElements.define(`turbo-cable-stream-source`,Xn);function Zn(e){if(e.target instanceof HTMLFormElement){let{target:t,detail:{fetchOptions:n}}=e;t.addEventListener(`turbo:submit-start`,({detail:{formSubmission:{submitter:e}}})=>{let r=er(n.body)?n.body:new URLSearchParams,i=Qn(e,r,t);/get/i.test(i)||(/post/i.test(i)?r.delete(`_method`):r.set(`_method`,i),n.method=`post`)},{once:!0})}}function Qn(e,t,n){let r=$n(e),i=t.get(`_method`),a=n.getAttribute(`method`)||`get`;return typeof r==`string`?r:typeof i==`string`?i:a}function $n(e){return e instanceof HTMLButtonElement||e instanceof HTMLInputElement?e.name===`_method`?e.value:e.hasAttribute(`formmethod`)?e.formMethod:null:null}function er(e){return e instanceof FormData||e instanceof URLSearchParams}window.Turbo=u,addEventListener(`turbo:before-fetch-request`,Zn);var V=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},H,tr=class{constructor(e=100){this.max=e,H.set(this,new Map)}get(e){let t=V(this,H,`f`).get(e);return t!==void 0&&(V(this,H,`f`).delete(e),V(this,H,`f`).set(e,t)),t}set(e,t){V(this,H,`f`).delete(e),V(this,H,`f`).set(e,t),V(this,H,`f`).size>this.max&&V(this,H,`f`).delete(V(this,H,`f`).keys().next().value)}clear(){V(this,H,`f`).clear()}};H=new WeakMap;var nr=[];function U(e){let t=new tr(e);return nr.push(t),t}function rr(){for(let e of nr)e.clear()}typeof window<`u`&&typeof window.addEventListener==`function`&&window.addEventListener(`languagechange`,rr);function ir(e,t){return`${e}\u0000${t?JSON.stringify(t):``}`}var ar=U();function W(e,t){let n=ir(e,t),r=ar.get(n);return r||ar.set(n,r=new Intl.DateTimeFormat(e,t)),r}var or=U();function sr(e,t){let n=ir(e,t),r=or.get(n);return r||or.set(n,r=new Intl.RelativeTimeFormat(e,t)),r}var cr=U();function lr(e,t){let n=ir(e,t),r=cr.get(n);return r||cr.set(n,r=new Intl.NumberFormat(e,t)),r}var ur=U();function dr(e){let t=ur.get(e);return t||ur.set(e,t=new Intl.Locale(e)),t}var fr=function(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n},pr=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},G,mr=class{formatToParts(e){let t=[];for(let n of e)t.push({type:`element`,value:n}),t.push({type:`literal`,value:`, `});return t.slice(0,-1)}},hr=typeof Intl<`u`&&Intl.ListFormat||mr,gr=U();function _r(e,t){let n=`${e}\u0000${JSON.stringify(t)}`,r=gr.get(n);return r||gr.set(n,r=new hr(e,t)),r}var vr=[[`years`,`year`],[`months`,`month`],[`weeks`,`week`],[`days`,`day`],[`hours`,`hour`],[`minutes`,`minute`],[`seconds`,`second`],[`milliseconds`,`millisecond`]],yr={minimumIntegerDigits:2},br=class{constructor(e,t={}){G.set(this,void 0);let n=String(t.style||`short`);n!==`long`&&n!==`short`&&n!==`narrow`&&n!==`digital`&&(n=`short`);let r=n===`digital`?`numeric`:n,i=t.hours||r;r=i===`2-digit`?`numeric`:i;let a=t.minutes||r;r=a===`2-digit`?`numeric`:a;let o=t.seconds||r;r=o===`2-digit`?`numeric`:o;let s=t.milliseconds||r;fr(this,G,{locale:e,style:n,years:t.years||n===`digital`?`short`:n,yearsDisplay:t.yearsDisplay===`always`?`always`:`auto`,months:t.months||n===`digital`?`short`:n,monthsDisplay:t.monthsDisplay===`always`?`always`:`auto`,weeks:t.weeks||n===`digital`?`short`:n,weeksDisplay:t.weeksDisplay===`always`?`always`:`auto`,days:t.days||n===`digital`?`short`:n,daysDisplay:t.daysDisplay===`always`?`always`:`auto`,hours:i,hoursDisplay:t.hoursDisplay===`always`||n===`digital`?`always`:`auto`,minutes:a,minutesDisplay:t.minutesDisplay===`always`||n===`digital`?`always`:`auto`,seconds:o,secondsDisplay:t.secondsDisplay===`always`||n===`digital`?`always`:`auto`,milliseconds:s,millisecondsDisplay:t.millisecondsDisplay===`always`?`always`:`auto`},`f`)}resolvedOptions(){return pr(this,G,`f`)}formatToParts(e){let t=[],n=pr(this,G,`f`),r=n.style,i=n.locale;for(let[a,o]of vr){let s=e[a];if(n[`${a}Display`]===`auto`&&!s)continue;let c=n[a],l=lr(i,c===`2-digit`?yr:c===`numeric`?{}:{style:`unit`,unit:o,unitDisplay:c}).format(s);a===`months`&&(c===`narrow`||r===`narrow`&&l.endsWith(`m`))&&(l=l.replace(/(\d+)m$/,`$1mo`)),t.push(l)}return _r(i,{type:`unit`,style:r===`digital`?`short`:r}).formatToParts(t)}format(e){return this.formatToParts(e).map(e=>e.value).join(``)}};G=new WeakMap;var xr=/^[-+]?P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,Sr=U(),Cr=[`style`,`years`,`yearsDisplay`,`months`,`monthsDisplay`,`weeks`,`weeksDisplay`,`days`,`daysDisplay`,`hours`,`hoursDisplay`,`minutes`,`minutesDisplay`,`seconds`,`secondsDisplay`,`milliseconds`,`millisecondsDisplay`];function wr(e,t){let n=e;for(let e of Cr)n+=`\u0000${t[e]??``}`;return n}var Tr=[`year`,`month`,`week`,`day`,`hour`,`minute`,`second`,`millisecond`],Er=e=>xr.test(e),K=class e{constructor(e=0,t=0,n=0,r=0,i=0,a=0,o=0,s=0){this.years=e,this.months=t,this.weeks=n,this.days=r,this.hours=i,this.minutes=a,this.seconds=o,this.milliseconds=s,this.years||=0,this.sign||=Math.sign(this.years),this.months||=0,this.sign||=Math.sign(this.months),this.weeks||=0,this.sign||=Math.sign(this.weeks),this.days||=0,this.sign||=Math.sign(this.days),this.hours||=0,this.sign||=Math.sign(this.hours),this.minutes||=0,this.sign||=Math.sign(this.minutes),this.seconds||=0,this.sign||=Math.sign(this.seconds),this.milliseconds||=0,this.sign||=Math.sign(this.milliseconds),this.blank=this.sign===0}abs(){return new e(Math.abs(this.years),Math.abs(this.months),Math.abs(this.weeks),Math.abs(this.days),Math.abs(this.hours),Math.abs(this.minutes),Math.abs(this.seconds),Math.abs(this.milliseconds))}
26static from(t){if(typeof t==`string`){let n=String(t).trim(),r=n.startsWith(`-`)?-1:1,i=n.match(xr)?.slice(1).map(e=>(Number(e)||0)*r);return i?new e(...i):new e}if(typeof t==`object`){let{years:n,months:r,weeks:i,days:a,hours:o,minutes:s,seconds:c,milliseconds:l}=t;return new e(n,r,i,a,o,s,c,l)}throw RangeError(`invalid duration`)}static compare(t,n){let r=Date.now(),i=Math.abs(Dr(r,e.from(t)).getTime()-r),a=Math.abs(Dr(r,e.from(n)).getTime()-r);return i>a?-1:+(i<a)}toLocaleString(e,t){let n=wr(e,t),r=Sr.get(n);return r||Sr.set(n,r=new br(e,t)),r.format(this)}};function Dr(e,t){let n=new Date(e);return t.sign<0?(n.setUTCSeconds(n.getUTCSeconds()+t.seconds),n.setUTCMinutes(n.getUTCMinutes()+t.minutes),n.setUTCHours(n.getUTCHours()+t.hours),n.setUTCDate(n.getUTCDate()+t.weeks*7+t.days),n.setUTCMonth(n.getUTCMonth()+t.months),n.setUTCFullYear(n.getUTCFullYear()+t.years)):(n.setUTCFullYear(n.getUTCFullYear()+t.years),n.setUTCMonth(n.getUTCMonth()+t.months),n.setUTCDate(n.getUTCDate()+t.weeks*7+t.days),n.setUTCHours(n.getUTCHours()+t.hours),n.setUTCMinutes(n.getUTCMinutes()+t.minutes),n.setUTCSeconds(n.getUTCSeconds()+t.seconds)),n}function Or(e,t=`second`,n=Date.now()){let r=e.getTime()-n;if(r===0)return new K;let i=Math.sign(r),a=Math.abs(r),o=Math.floor(a/1e3),s=Math.floor(o/60),c=Math.floor(s/60),l=Math.floor(c/24),u=Math.floor(l/30),d=Math.floor(u/12),f=Tr.indexOf(t);return new K(f>=0?d*i:0,f>=1?(u-d*12)*i:0,0,f>=3?(l-u*30)*i:0,f>=4?(c-l*24)*i:0,f>=5?(s-c*60)*i:0,f>=6?(o-s*60)*i:0,f>=7?(a-o*1e3)*i:0)}function kr(e,{relativeTo:t=Date.now()}={}){if(t=new Date(t),e.blank)return e;let n=e.sign,r=Math.abs(e.years),i=Math.abs(e.months),a=Math.abs(e.weeks),o=Math.abs(e.days),s=Math.abs(e.hours),c=Math.abs(e.minutes),l=Math.abs(e.seconds),u=Math.abs(e.milliseconds);u>=900&&(l+=Math.round(u/1e3)),(l||c||s||o||a||i||r)&&(u=0),l>=55&&(c+=Math.round(l/60)),(c||s||o||a||i||r)&&(l=0),c>=55&&(s+=Math.round(c/60)),(s||o||a||i||r)&&(c=0),o&&s>=12&&(o+=Math.round(s/24)),!o&&s>=21&&(o+=Math.round(s/24)),(o||a||i||r)&&(s=0);let d=t.getFullYear(),f=t.getMonth(),p=t.getDate();if(o>=27||r+i+o){let e=new Date(t);e.setDate(1),e.setMonth(f+i*n+1),e.setDate(0);let s=Math.max(0,p-e.getDate()),c=new Date(t);c.setFullYear(d+r*n),c.setDate(p-s),c.setMonth(f+i*n),c.setDate(p-s+o*n);let l=c.getFullYear()-t.getFullYear(),u=c.getMonth()-t.getMonth(),m=Math.abs(Math.round((Number(c)-Number(t))/864e5))+s,h=Math.abs(l*12+u);m<27?(o>=6?(a+=Math.round(o/7),o=0):o=m,i=r=0):h<=11?(i=h,r=0):(i=0,r=l*n),(i||r)&&(o=0)}return r&&(i=0),a>=4&&(i+=Math.round(a/4)),(i||r)&&(a=0),o&&a&&!i&&!r&&(a+=Math.round(o/7),o=0),new K(r*n,i*n,a*n,o*n,s*n,c*n,l*n,u*n)}function Ar(e,t){let n=kr(e,t);if(n.blank)return[0,`second`];for(let e of Tr){if(e===`millisecond`)continue;let t=n[`${e}s`];if(t)return[t,e]}return[0,`second`]}var q=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},jr=function(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n},J,Y,Mr,Nr,X,Pr,Fr,Ir,Lr,Rr,zr,Br,Vr,Hr,Ur,Wr,Gr,Kr,Z,qr=globalThis.HTMLElement||null,Jr=new K,Yr=new K(0,0,0,0,0,1),Xr=class extends Event{constructor(e,t,n,r){super(`relative-time-updated`,{bubbles:!0,composed:!0}),this.oldText=e,this.newText=t,this.oldTitle=n,this.newTitle=r}};function Zr(e){let t=e.date;if(!t)return 1/0;let n=Date.now();if(e.format===`duration`||e.format===`elapsed`){let t=e.precision;if(t===`second`)return 1e3;if(t===`minute`)return 6e4}let r=Math.abs(n-t.getTime()),i=36e5;r<6e4?i=1e3:r<36e5&&(i=6e4);let a=$r(e);if(e.format===`micro`&&a){let e=K.from(a),r=Dr(t,t.getTime()>n?Qr(e):e).getTime()-n;r>0&&(i=Math.min(i,r))}return i}function Qr(e){return new K(-e.years,-e.months,-e.weeks,-e.days,-e.hours,-e.minutes,-e.seconds,-e.milliseconds)}function $r(e){let t=e.getAttribute(`threshold`);return t&&Er(t)?t:null}var ei;
26function ti(){if(ei===void 0)try{ei=new Intl.DateTimeFormat([],{hour:`numeric`}).resolvedOptions().hour12===!0}catch{ei=!1}return ei}typeof window<`u`&&typeof window.addEventListener==`function`&&window.addEventListener(`languagechange`,()=>{ei=void 0});var ni=new class{constructor(){this.elements=new Set,this.time=1/0,this.updating=!1,this.timer=-1}observe(e){if(this.elements.add(e),this.updating)return;let t=e.date;if(t&&t.getTime()){let t=Zr(e),n=Date.now()+t;(n<this.time||this.time<=Date.now())&&(clearTimeout(this.timer),this.timer=setTimeout(()=>this.update(),t),this.time=n)}}unobserve(e){this.elements.has(e)&&this.elements.delete(e)}update(){if(clearTimeout(this.timer),!this.elements.size)return;let e=1/0;this.updating=!0;try{for(let t of this.elements)e=Math.min(e,Zr(t)),t.update()}finally{this.updating=!1}this.time=Math.min(36e5,e),this.timer=setTimeout(()=>this.update(),this.time),this.time+=Date.now()}},ri=class extends qr{constructor(){super(...arguments),J.add(this),Y.set(this,!1),Mr.set(this,!1),X.set(this,this.shadowRoot?this.shadowRoot:this.attachShadow?this.attachShadow({mode:`open`}):this),Z.set(this,null)}static define(e=`relative-time`,t=customElements){return t.define(e,this),this}get timeZone(){return this.closest(`[time-zone]`)?.getAttribute(`time-zone`)||this.ownerDocument.documentElement.getAttribute(`time-zone`)||void 0}get hourCycle(){let e=this.closest(`[hour-cycle]`)?.getAttribute(`hour-cycle`)||this.ownerDocument.documentElement.getAttribute(`hour-cycle`);return e===`h11`||e===`h12`||e===`h23`||e===`h24`?e:ti()?`h12`:`h23`}static get observedAttributes(){return[`second`,`minute`,`hour`,`weekday`,`day`,`month`,`year`,`time-zone-name`,`prefix`,`threshold`,`tense`,`precision`,`format`,`format-style`,`no-title`,`datetime`,`lang`,`title`,`aria-hidden`,`time-zone`,`hour-cycle`]}get onRelativeTimeUpdated(){return q(this,Z,`f`)}set onRelativeTimeUpdated(e){q(this,Z,`f`)&&this.removeEventListener(`relative-time-updated`,q(this,Z,`f`)),jr(this,Z,typeof e==`object`||typeof e==`function`?e:null,`f`),typeof e==`function`&&this.addEventListener(`relative-time-updated`,e)}get second(){let e=this.getAttribute(`second`);if(e===`numeric`||e===`2-digit`)return e}set second(e){this.setAttribute(`second`,e||``)}get minute(){let e=this.getAttribute(`minute`);if(e===`numeric`||e===`2-digit`)return e}set minute(e){this.setAttribute(`minute`,e||``)}get hour(){let e=this.getAttribute(`hour`);if(e===`numeric`||e===`2-digit`)return e}set hour(e){this.setAttribute(`hour`,e||``)}get weekday(){let e=this.getAttribute(`weekday`);if(e===`long`||e===`short`||e===`narrow`)return e;if(this.format===`datetime`&&e!==``)return this.formatStyle}set weekday(e){this.setAttribute(`weekday`,e||``)}get day(){let e=this.getAttribute(`day`)??`numeric`;if(e===`numeric`||e===`2-digit`)return e}set day(e){this.setAttribute(`day`,e||``)}get month(){let e=this.format,t=this.getAttribute(`month`);if(t!==``&&(t??=e===`datetime`?this.formatStyle:`short`,t===`numeric`||t===`2-digit`||t===`short`||t===`long`||t===`narrow`))return t}set month(e){this.setAttribute(`month`,e||``)}get year(){let e=this.getAttribute(`year`);if(e===`numeric`||e===`2-digit`)return e;if(!this.hasAttribute(`year`)&&new Date().getUTCFullYear()!==this.date?.getUTCFullYear())return`numeric`}set year(e){this.setAttribute(`year`,e||``)}get timeZoneName(){let e=this.getAttribute(`time-zone-name`);if(e===`long`||e===`short`||e===`shortOffset`||e===`longOffset`||e===`shortGeneric`||e===`longGeneric`)return e}set timeZoneName(e){this.setAttribute(`time-zone-name`,e||``)}get prefix(){return this.getAttribute(`prefix`)??(this.format===`datetime`?``:`on`)}set prefix(e){this.setAttribute(`prefix`,e)}get threshold(){let e=this.getAttribute(`threshold`);return e&&Er(e)?e:`P30D`}set threshold(e){this.setAttribute(`threshold`,e)}get tense(){let e=this.getAttribute(`tense`);return e===`past`?`past`:e===`future`?`future`:`auto`}set tense(e){this.setAttribute(`tense`,e)}get precision(){let e=this.getAttribute(`precision`);return Tr.includes(e)?e:this.format===`micro`?`minute`:`second`}set precision(e){this.setAttribute(`precision`,e)}get format(){let e=this.getAttribute(`format`);return e===`datetime`?`datetime`:e===`relative`?`relative`:e===`duration`?`duration`:e===`micro`?`micro`:e===`elapsed`?`elapsed`:`auto`}set format(e){this.setAttribute(`format`,e)}get formatStyle(){let e=this.getAttribute(`format-style`);if(e===`long`)return`long`;if(e===`short`)return`short`;if(e===`narrow`)return`narrow`;let t=this.format;return t===`elapsed`||t===`micro`?`narrow`:t===`datetime`?`short`:`long`}set formatStyle(e){this.setAttribute(`format-style`,e)}get noTitle(){return this.hasAttribute(`no-title`)}set noTitle(e){this.toggleAttribute(`no-title`,e)}get datetime(){return this.getAttribute(`datetime`)||``}set datetime(e){this.setAttribute(`datetime`,e)}get date(){let e=Date.parse(this.datetime);return Number.isNaN(e)?null:new Date(e)}set date(e){this.datetime=e?.toISOString()||``}connectedCallback(){this.update()}disconnectedCallback(){ni.unobserve(this)}attributeChangedCallback(e,t,n){t!==n&&(e===`title`&&jr(this,Y,n!==null&&(this.date&&q(this,J,`m`,Pr).call(this,this.date,q(this,J,`a`,Nr),this.timeZone,this.hourCycle))!==n,`f`),!q(this,Mr,`f`)&&!(e===`title`&&q(this,Y,`f`))&&jr(this,Mr,(async()=>{await Promise.resolve(),this.update(),jr(this,Mr,!1,`f`)})(),`f`))}update(){let e=q(this,X,`f`).textContent||this.textContent||``,t=this.getAttribute(`title`)||``,n=t,r=this.date;if(typeof Intl>`u`||!Intl.DateTimeFormat||!r){q(this,X,`f`).textContent=e;return}let i=Date.now(),a=q(this,J,`a`,Nr),o=this.timeZone,s=this.hourCycle;q(this,Y,`f`)||(n=q(this,J,`m`,Pr).call(this,r,a,o,s)||``,n&&!this.noTitle&&n!==t&&this.setAttribute(`title`,n));let c=Or(r,this.precision,i),l=q(this,J,`m`,Ir).call(this,c,Or(r,`millisecond`,i)),u=e,d=q(this,J,`m`,Kr).call(this,l);u=d?q(this,J,`m`,Wr).call(this,r,a,o,s):l===`duration`?this.format===`micro`&&this.tense!==`auto`&&Intl.RelativeTimeFormat?q(this,J,`m`,Rr).call(this,c,a):q(this,J,`m`,zr).call(this,c,a):l===`relative`?q(this,J,`m`,Br).call(this,c,a):q(this,J,`m`,Vr).call(this,r,a,o,s),u?q(this,J,`m`,Gr).call(this,u):this.shadowRoot===q(this,X,`f`)&&this.textContent&&q(this,J,`m`,Gr).call(this,this.textContent),(u!==e||n!==t)&&this.dispatchEvent(new Xr(e,u,t,n)),!d&&(l===`relative`||l===`duration`)||this.format===`micro`&&q(this,J,`m`,Fr).call(this)&&r.getTime()>i||d&&(q(this,J,`m`,Hr).call(this,r,a,o)||q(this,J,`m`,Ur).call(this,r,a,o))?ni.observe(this):ni.unobserve(this)}};Y=new WeakMap,Mr=new WeakMap,X=new WeakMap,Z=new WeakMap,J=new WeakSet,Nr=function(){let e=this.closest(`[lang]`)?.getAttribute(`lang`)||this.ownerDocument.documentElement.getAttribute(`lang`);if(!e)return`default`;try{return dr(e).toString()}catch{return`default`}},Pr=function(e,t,n,r){return W(t,{day:`numeric`,month:`short`,year:`numeric`,hour:`numeric`,minute:`2-digit`,timeZoneName:`short`,timeZone:n,hourCycle:r}).format(e)},Fr=function(){return $r(this)},Ir=function(e,t=e){let n=this.format;if(n===`datetime`)return`datetime`;if(n===`duration`||n===`elapsed`)return`duration`;if(n===`micro`){let e=q(this,J,`m`,Fr).call(this);return e&&K.compare(t,e)===-1?`datetime`:`duration`}if((n===`auto`||n===`relative`)&&typeof Intl<`u`&&Intl.RelativeTimeFormat){let t=this.tense;if(t===`past`||t===`future`||K.compare(e,this.threshold)===1)return`relative`}return`datetime`},Lr=function(e){return e=kr(e),e.months===0&&(this.tense===`past`&&e.sign!==-1||this.tense===`future`&&e.sign!==1)?Yr:e},Rr=function(e,t){let n=sr(t,{numeric:`always`,style:`narrow`});e=q(this,J,`m`,Lr).call(this,e);let[r,i]=Ar(e.blank?Yr:e);return n.format(Math.abs(r)*(this.tense===`past`?-1:1),i)},zr=function(e,t){let n=this.format,r=this.formatStyle,i=this.tense,a=Jr;n===`micro`?(e=q(this,J,`m`,Lr).call(this,e),a=Yr):(i===`past`&&e.sign!==-1||i===`future`&&e.sign!==1)&&(e=a);let o=`${this.precision}sDisplay`;
26return e.blank?a.toLocaleString(t,{style:r,[o]:`always`}):e.abs().toLocaleString(t,{style:r})},Br=function(e,t){let n=sr(t,{numeric:`auto`,style:this.formatStyle}),r=this.tense;r===`future`&&e.sign!==1&&(e=Jr),r===`past`&&e.sign!==-1&&(e=Jr);let[i,a]=Ar(e);return a===`second`&&i<10?n.format(0,this.precision===`millisecond`?`second`:this.precision):n.format(i,a)},Vr=function(e,t,n,r){let i=W(t,{second:this.second,minute:this.minute,hour:this.hour,weekday:this.weekday,day:this.day,month:this.month,year:this.year,timeZoneName:this.timeZoneName,timeZone:n,hourCycle:r});return`${this.prefix} ${i.format(e)}`.trim()},Hr=function(e,t,n){let r=new Date,i=W(t,{timeZone:n,year:`numeric`,month:`2-digit`,day:`2-digit`});return i.format(r)===i.format(e)},Ur=function(e,t,n){let r=new Date,i=W(t,{timeZone:n,year:`numeric`});return i.format(r)===i.format(e)},Wr=function(e,t,n,r){let i={hour:`numeric`,minute:`2-digit`,timeZoneName:`short`,timeZone:n,hourCycle:r};if(q(this,J,`m`,Hr).call(this,e,t,n)){let n=sr(t,{numeric:`auto`}).format(0,`day`);n=n.charAt(0).toLocaleUpperCase(t)+n.slice(1);let r=W(t,i).format(e);return`${n} ${r}`}let a=Object.assign(Object.assign({},i),{day:`numeric`,month:`short`});return q(this,J,`m`,Ur).call(this,e,t,n)?W(t,a).format(e):W(t,Object.assign(Object.assign({},a),{year:`numeric`})).format(e)},Gr=function(e){let t=q(this,X,`f`),n=this.hasAttribute(`aria-hidden`)&&this.getAttribute(`aria-hidden`)===`true`,r=t.firstElementChild;(!r||r.getAttribute(`part`)!==`root`||t.childNodes.length!==1)&&(r=document.createElement(`span`),r.setAttribute(`part`,`root`),t.replaceChildren(r)),n?r.getAttribute(`aria-hidden`)!==`true`&&r.setAttribute(`aria-hidden`,`true`):r.hasAttribute(`aria-hidden`)&&r.removeAttribute(`aria-hidden`),r.textContent!==e&&(r.textContent=e)},Kr=function(e){return e===`duration`&&this.format!==`micro`?!1:this.ownerDocument.documentElement.getAttribute(`data-prefers-absolute-time`)===`true`||this.ownerDocument.body?.getAttribute(`data-prefers-absolute-time`)===`true`};var ii=typeof globalThis<`u`?globalThis:window;try{ii.RelativeTimeElement=ri.define()}catch(e){if(!(ii.DOMException&&e instanceof DOMException&&e.name===`NotSupportedError`)&&!(e instanceof ReferenceError))throw e}function Q(e){document.documentElement.addEventListener(`turbo:load`,e)}Q(async()=>{if(document.querySelector(`.remove-attachments, .user-screenshots`)){let{Luminous:e,LuminousGallery:t}=await B(async()=>{let{Luminous:e,LuminousGallery:t}=await import(`./lum-CKUuOizO.js`);return{Luminous:e,LuminousGallery:t}},[]);document.querySelectorAll(`.remove-attachments, .user-screenshots`).forEach(n=>{let r=n.querySelectorAll(`a`);switch(r.length){case 0:break;case 1:new e(r[0]);break;default:new t(r)}})}});var ai=o(((e,t)=>{t.exports={}})),oi=l(o(((e,t)=>{(function(){var e=`input is invalid type`,n=typeof window==`object`,r=n?window:{};
26r.JS_SHA1_NO_WINDOW&&(n=!1);var i=!n&&typeof self==`object`,a=!r.JS_SHA1_NO_NODE_JS&&typeof process==`object`&&process.versions&&process.versions.node;a?r=global:i&&(r=self);var o=!r.JS_SHA1_NO_COMMON_JS&&typeof t==`object`&&t.exports,s=typeof define==`function`&&define.amd,c=!r.JS_SHA1_NO_ARRAY_BUFFER&&typeof ArrayBuffer<`u`,l=`0123456789abcdef`.split(``),u=[-2147483648,8388608,32768,128],d=[24,16,8,0],f=[`hex`,`array`,`digest`,`arrayBuffer`],p=[],m=Array.isArray;(r.JS_SHA1_NO_NODE_JS||!m)&&(m=function(e){return Object.prototype.toString.call(e)===`[object Array]`});var h=ArrayBuffer.isView;c&&(r.JS_SHA1_NO_ARRAY_BUFFER_IS_VIEW||!h)&&(h=function(e){return typeof e==`object`&&e.buffer&&e.buffer.constructor===ArrayBuffer});var ee=function(t){var n=typeof t;if(n===`string`)return[t,!0];if(n!==`object`||t===null)throw Error(e);if(c&&t.constructor===ArrayBuffer)return[new Uint8Array(t),!1];if(!m(t)&&!h(t))throw Error(e);return[t,!1]},te=function(e){return function(t){return new v(!0).update(t)[e]()}},g=function(){var e=te(`hex`);a&&(e=ne(e)),e.create=function(){return new v},e.update=function(t){return e.create().update(t)};for(var t=0;t<f.length;++t){var n=f[t];e[n]=te(n)}return e},ne=function(t){var n=ai(),i=ai().Buffer,a=i.from&&!r.JS_SHA1_NO_BUFFER_FROM?i.from:function(e){return new i(e)};return function(r){if(typeof r==`string`)return n.createHash(`sha1`).update(r,`utf8`).digest(`hex`);if(r==null)throw Error(e);return r.constructor===ArrayBuffer&&(r=new Uint8Array(r)),m(r)||h(r)||r.constructor===i?n.createHash(`sha1`).update(a(r)).digest(`hex`):t(r)}},_=function(e){return function(t,n){return new y(t,!0).update(n)[e]()}},re=function(){var e=_(`hex`);e.create=function(e){return new y(e)},e.update=function(t,n){return e.create(t).update(n)};for(var t=0;t<f.length;++t){var n=f[t];e[n]=_(n)}return e};function v(e){e?(p[0]=p[16]=p[1]=p[2]=p[3]=p[4]=p[5]=p[6]=p[7]=p[8]=p[9]=p[10]=p[11]=p[12]=p[13]=p[14]=p[15]=0,this.blocks=p):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.h0=1732584193,this.h1=4023233417,this.h2=2562383102,this.h3=271733878,this.h4=3285377520,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}v.prototype.update=function(e){if(this.finalized)throw Error(`finalize already called`);var t=ee(e);e=t[0];for(var n=t[1],r,i=0,a,o=e.length||0,s=this.blocks;i<o;){if(this.hashed&&(this.hashed=!1,s[0]=this.block,this.block=s[16]=s[1]=s[2]=s[3]=s[4]=s[5]=s[6]=s[7]=s[8]=s[9]=s[10]=s[11]=s[12]=s[13]=s[14]=s[15]=0),n)for(a=this.start;i<o&&a<64;++i)r=e.charCodeAt(i),r<128?s[a>>>2]|=r<<d[a++&3]:r<2048?(s[a>>>2]|=(192|r>>>6)<<d[a++&3],s[a>>>2]|=(128|r&63)<<d[a++&3]):r<55296||r>=57344?(s[a>>>2]|=(224|r>>>12)<<d[a++&3],s[a>>>2]|=(128|r>>>6&63)<<d[a++&3],s[a>>>2]|=(128|r&63)<<d[a++&3]):(r=65536+((r&1023)<<10|e.charCodeAt(++i)&1023),s[a>>>2]|=(240|r>>>18)<<d[a++&3],s[a>>>2]|=(128|r>>>12&63)<<d[a++&3],s[a>>>2]|=(128|r>>>6&63)<<d[a++&3],s[a>>>2]|=(128|r&63)<<d[a++&3]);else for(a=this.start;i<o&&a<64;++i)s[a>>>2]|=e[i]<<d[a++&3];this.lastByteIndex=a,this.bytes+=a-this.start,a>=64?(this.block=s[16],this.start=a-64,this.hash(),this.hashed=!0):this.start=a}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes%=4294967296),this},v.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>>2]|=u[t&3],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},v.prototype.hash=function(){var e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4,a,o,s,c=this.blocks;for(o=16;o<80;++o)s=c[o-3]^c[o-8]^c[o-14]^c[o-16],c[o]=s<<1|s>>>31;for(o=0;o<20;o+=5)a=t&n|~t&r,s=e<<5|e>>>27,i=s+a+i+1518500249+c[o]<<0,t=t<<30|t>>>2,a=e&t|~e&n,s=i<<5|i>>>27,r=s+a+r+1518500249+c[o+1]<<0,e=e<<30|e>>>2,a=i&e|~i&t,s=r<<5|r>>>27,n=s+a+n+1518500249+c[o+2]<<0,i=i<<30|i>>>2,a=r&i|~r&e,s=n<<5|n>>>27,t=s+a+t+1518500249+c[o+3]<<0,r=r<<30|r>>>2,a=n&r|~n&i,s=t<<5|t>>>27,e=s+a+e+1518500249+c[o+4]<<0,n=n<<30|n>>>2;for(;o<40;o+=5)a=t^n^r,s=e<<5|e>>>27,i=s+a+i+1859775393+c[o]<<0,t=t<<30|t>>>2,a=e^t^n,s=i<<5|i>>>27,r=s+a+r+1859775393+c[o+1]<<0,e=e<<30|e>>>2,a=i^e^t,s=r<<5|r>>>27,n=s+a+n+1859775393+c[o+2]<<0,i=i<<30|i>>>2,a=r^i^e,s=n<<5|n>>>27,t=s+a+t+1859775393+c[o+3]<<0,r=r<<30|r>>>2,a=n^r^i,s=t<<5|t>>>27,e=s+a+e+1859775393+c[o+4]<<0,n=n<<30|n>>>2;for(;o<60;o+=5)a=t&n|t&r|n&r,s=e<<5|e>>>27,i=s+a+i-1894007588+c[o]<<0,t=t<<30|t>>>2,a=e&t|e&n|t&n,s=i<<5|i>>>27,r=s+a+r-1894007588+c[o+1]<<0,e=e<<30|e>>>2,a=i&e|i&t|e&t,s=r<<5|r>>>27,n=s+a+n-1894007588+c[o+2]<<0,i=i<<30|i>>>2,a=r&i|r&e|i&e,s=n<<5|n>>>27,t=s+a+t-1894007588+c[o+3]<<0,r=r<<30|r>>>2,a=n&r|n&i|r&i,s=t<<5|t>>>27,e=s+a+e-1894007588+c[o+4]<<0,n=n<<30|n>>>2;for(;o<80;o+=5)a=t^n^r,s=e<<5|e>>>27,i=s+a+i-899497514+c[o]<<0,t=t<<30|t>>>2,a=e^t^n,s=i<<5|i>>>27,r=s+a+r-899497514+c[o+1]<<0,e=e<<30|e>>>2,a=i^e^t,s=r<<5|r>>>27,n=s+a+n-899497514+c[o+2]<<0,i=i<<30|i>>>2,a=r^i^e,s=n<<5|n>>>27,t=s+a+t-899497514+c[o+3]<<0,r=r<<30|r>>>2,a=n^r^i,s=t<<5|t>>>27,e=s+a+e-899497514+c[o+4]<<0,n=n<<30|n>>>2;this.h0=this.h0+e<<0,this.h1=this.h1+t<<0,this.h2=this.h2+n<<0,this.h3=this.h3+r<<0,this.h4=this.h4+i<<0},v.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4;return l[e>>>28&15]+l[e>>>24&15]+l[e>>>20&15]+l[e>>>16&15]+l[e>>>12&15]+l[e>>>8&15]+l[e>>>4&15]+l[e&15]+l[t>>>28&15]+l[t>>>
2624&15]+l[t>>>20&15]+l[t>>>16&15]+l[t>>>12&15]+l[t>>>8&15]+l[t>>>4&15]+l[t&15]+l[n>>>28&15]+l[n>>>24&15]+l[n>>>20&15]+l[n>>>16&15]+l[n>>>12&15]+l[n>>>8&15]+l[n>>>4&15]+l[n&15]+l[r>>>28&15]+l[r>>>24&15]+l[r>>>20&15]+l[r>>>16&15]+l[r>>>12&15]+l[r>>>8&15]+l[r>>>4&15]+l[r&15]+l[i>>>28&15]+l[i>>>24&15]+l[i>>>20&15]+l[i>>>16&15]+l[i>>>12&15]+l[i>>>8&15]+l[i>>>4&15]+l[i&15]},v.prototype.toString=v.prototype.hex,v.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4;return[e>>>24&255,e>>>16&255,e>>>8&255,e&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255]},v.prototype.array=v.prototype.digest,v.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(20),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),e};function y(e,t){var n,r=ee(e);if(e=r[0],r[1]){var i=[],a=e.length,o=0,s;for(n=0;n<a;++n)s=e.charCodeAt(n),s<128?i[o++]=s:s<2048?(i[o++]=192|s>>>6,i[o++]=128|s&63):s<55296||s>=57344?(i[o++]=224|s>>>12,i[o++]=128|s>>>6&63,i[o++]=128|s&63):(s=65536+((s&1023)<<10|e.charCodeAt(++n)&1023),i[o++]=240|s>>>18,i[o++]=128|s>>>12&63,i[o++]=128|s>>>6&63,i[o++]=128|s&63);e=i}e.length>64&&(e=new v(!0).update(e).array());var c=[],l=[];for(n=0;n<64;++n){var u=e[n]||0;c[n]=92^u,l[n]=54^u}v.call(this,t),this.update(l),this.oKeyPad=c,this.inner=!0,this.sharedMemory=t}y.prototype=new v,y.prototype.finalize=function(){if(v.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();v.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(e),v.prototype.finalize.call(this)}};var b=g();b.sha1=b,b.sha1.hmac=re(),o?t.exports=b:(r.sha1=b,s&&define(function(){return b}))})()}))());function si(){return window.external?.Tampermonkey}function ci(){return window.external?.Violentmonkey}function li(){return window.external?.FireMonkey}function ui(){return si()||ci()||li()}async function di(){return li()||localStorage.getItem(`stylusDetected`)===`1`?!0:(postMessage({type:`style-version-query`,name:`whatever`,namespace:`whatever`,url:location.href},location.origin),new Promise(e=>setTimeout(function(){e(localStorage.getItem(`stylusDetected`)===`1`)},200)))}window.addEventListener(`message`,function(e){e.origin===location.origin&&e.data.type===`style-version`&&localStorage.setItem(`stylusDetected`,`1`)});function fi(e){e.preventDefault(),pi(e.target)}async function pi(e){await mi(e)&&await gi(e)&&await _i()&&await vi(e)&&bi(e)}async function mi(e){let t=e.getAttribute(`data-install-format`)===`js`;if(t){if(localStorage.getItem(`manualOverrideInstallJS`)===`1`||ui())return!0}else if(localStorage.getItem(`manualOverrideInstallCSS`)===`1`||await di())return!0;return hi(t)(e)}function hi(e){return async function(t){let{detect:n}=await B(async()=>{let{detect:e}=await import(`./es-CaB-tJAa.js`);return{detect:e}},[]),r=n().name,i=document.getElementById(e?`installation-instructions-modal-js`:`installation-instructions-modal-css`);switch(r){case`firefox`:case`chrome`:case`opera`:case`safari`:case`edge`:i.classList.add(`installation-instructions-modal-`+r);break;default:i.classList.add(`installation-instructions-modal-other`)}let a=i.querySelector(`.installation-instructions-modal-content-bypass a`);a.setAttribute(`href`,t.getAttribute(`href`));try{gtag(`event`,`Installation install help modal`,{browser_type:r,script_id:t.getAttribute(`data-script-id`),value:1})}catch(e){console.log(e)}return new Promise(t=>{a.addEventListener(`click`,function(t){localStorage.setItem(e?`manualOverrideInstallJS`:`manualOverrideInstallCSS`,`1`),t.preventDefault(),i.close(`continue`)}),i.addEventListener(`close`,e=>{t(i.returnValue==`continue`)}),i.showModal()})}}async function gi(e){return new Promise(t=>{if(e.getAttribute(`data-is-previous-version`)===`true`&&!confirm(e.getAttribute(`data-previous-version-warning`))){t(!1);return}t(!0)})}async function _i(){return new Promise(e=>{let t=document.getElementById(`preinstall-modal`);if(!t){e(!0);return}t.addEventListener(`close`,n=>{e(t.returnValue==`continue`)}),t.showModal()})}async function vi(e){return new Promise(async t=>{let n=e.getAttribute(`data-ping-url`);if(n)try{let t=(0,oi.default)(e.getAttribute(`data-ip-address`)+e.getAttribute(`data-script-id`)+e.getAttribute(`data-ping-key`)),r=n+(n.includes(`?`)?`&`:`?`)+`ping_key=`+encodeURIComponent(t);navigator.sendBeacon(r),gtag(`event`,`Script install`,{event_label:e.getAttribute(`data-script-id`),script_id:e.getAttribute(`data-script-id`),value:1})}catch(e){console.log(e)}let r=!1;if(!ui()){let{detect:e}=await B(async()=>{let{detect:e}=await import(`./es-CaB-tJAa.js`);return{detect:e}},[]);e().name==`firefox`&&(r=!0)}r?window.open(e.href,`_blank`):location.href=e.href,t(!0)})}function yi(e){let t=e.target.getAttribute(`data-ping-url`),n=new Date,r=(0,oi.default)(`4`+n.getUTCFullYear().toString()+(n.getUTCMonth()+1).toString()+n.getUTCDate().toString()+n.getUTCHours().toString());t&&!/[&?]mo=.+$/.test(t)&&e.target.setAttribute(`data-ping-url`,t+(t.includes(`?`)?`&`:`?`)+`mo=`+r)}function bi(e){setTimeout(()=>location.href=e.dataset.postInstallUrl,2e3)}function xi(){document.querySelectorAll(`.install-link`).forEach(function(e){e.addEventListener(`click`,fi),e.addEventListener(`mouseover`,yi),e.addEventListener(`touchstart`,yi)}),Si()}var Si=()=>
26{document.querySelectorAll(`.modal__cancel`).forEach(e=>{e.addEventListener(`click`,t=>{e.closest(`dialog`).close()})}),document.querySelectorAll(`.modal__accept`).forEach(e=>{e.addEventListener(`click`,t=>{e.closest(`dialog`).close(`continue`)})})};Q(xi);function Ci(e,t){return new Promise(function(n,r){let i=si();if(i){i.isInstalled(e,t,function(e){e.installed?n(e.version):n(null)});return}let a=ci();if(a){a.isInstalled(e,t).then(n);return}let o=li();if(o){n(o.installedScriptVersion||null);return}r()})}function wi(e,t){if(e===t)return 0;let n=e.split(`.`),r=t.split(`.`);for(let e=0;e<n.length;e++){let t=Ti(n[e],r[e]);if(t!==0)return t}return r.length>n.length?-1:0}function Ti(e,t){let n=Ei(e),r=Ei(t);for(let e=0;e<n.length;e++){if(n[e].length>0&&r[e].length===0)return-1;if(n[e].length===0&&r[e].length>0||n[e]>r[e])return 1;if(n[e]<r[e])return-1}return 0}function Ei(e){if(!e)return[0,``,0,``];let t=/([0-9]*)([^0-9]*)([0-9]*)([^0-9]*)/.exec(e);return[t[1]?parseInt(t[1]):0,t[2],t[3]?parseInt(t[3]):0,t[4]]}function Di(e,t,n){if(t==null)return;e.removeAttribute(`data-ping-url`);let r;switch(wi(t,n)){case-1:r=e.getAttribute(`data-update-label`);break;case 1:r=e.getAttribute(`data-downgrade-label`);break;case 0:r=e.getAttribute(`data-reinstall-label`)}e.textContent=r;let i=document.querySelector(`#preinstall-modal .modal__accept`);i&&(i.textContent=r)}function Oi(e,t){let n=e.getAttribute(`data-script-name`),r=e.getAttribute(`data-script-namespace`),i=e.getAttribute(`data-script-version`);Ci(n,r).then(function(t){Di(e,t,i)},function(){t&&setTimeout(function(){Oi(e,!1)},1e3)}).catch(function(e){})}function ki(e){let t=li();if(t?.installedStyleVersion){Ai(t.installedStyleVersion);return}let n=e.getAttribute(`data-script-name`),r=e.getAttribute(`data-script-namespace`);postMessage({type:`style-version-query`,name:n,namespace:r,url:location.href},location.origin)}window.addEventListener(`message`,function(e){(e.origin===`https://greasyfork.org`||e.origin===`https://sleazyfork.org`)&&e.data.type===`style-version`&&Ai(e.data.version)},!1);function Ai(e){let t=document.querySelector(`.install-link[data-install-format=css]`);t!=null&&Di(t,e,t.getAttribute(`data-script-version`))}Q(function(){let e=document.querySelector(`.install-link[data-install-format=js]`);e&&Oi(e,!0);let t=document.querySelector(`.install-link[data-install-format=css]`);t&&ki(t)}),window.submitInvisibleRecaptchaForm=function(e){document.getElementById(`new_user`).submit()},window.submitInvisibleRecaptchaFormScriptVersion=function(e){document.getElementById(`new_script_version`).submit()},window.submitInvisibleRecaptchaFormScriptSet=function(e){document.getElementById(`save-indicator`).value=`1`,document.getElementById(`new_script_set`).submit()},window.submitInvisibleRecaptchaDiscussionForm=function(e){document.getElementById(`new-discussion`).submit()},window.submitInvisibleRecaptchaScriptDiscussionForm=function(e){document.getElementById(`new-script-discussion`).submit()};function ji(){let e=document.getElementById(`add-additional-info`);e&&e.addEventListener(`click`,function(t){let n=document.querySelectorAll(`textarea[name*='additional_info']`),r=n[n.length-1].id.split(`-`),i=parseInt(r[r.length-1],10)+1,a=new XMLHttpRequest;a.overrideMimeType(`text/html`),a.open(`get`,Ni(e,i)),a.onload=function(){let t=document.createElement(`div`);t.innerHTML=this.responseText;let n=t.firstElementChild;e.parentNode.parentNode.insertBefore(n,e.parentNode),markupPreview(n.querySelector(`.previewable`))},a.send(),t.preventDefault()})}function Mi(){let e=document.getElementById(`add-synced-additional-info`);e&&e.addEventListener(`click`,function(t){let n=document.querySelectorAll(`input[type='url'][name*='additional_info_sync']`),r=n[n.length-1].id.split(`-`),i=parseInt(r[r.length-1],10)+1,a=new XMLHttpRequest;a.overrideMimeType(`text/html`),a.open(`get`,Ni(e,i)),a.onload=function(){let t=document.createElement(`div`);t.innerHTML=this.responseText,e.parentNode.parentNode.insertBefore(t.children[0],e.parentNode)},a.send(),t.preventDefault()})}var Ni=function(e,t){return`${e.dataset.formPath}${e.dataset.formPath.includes(`?`)?`&`:`?`}index=${t}`};Q(ji),Q(Mi),window.markupPreview=function(e){function t(e){for(;e&&e.className.indexOf(`previewable`)===-1;)e=e.parentNode;return e}function n(e){return e.querySelector(`textarea`)}function r(e){return e.querySelector(`.preview-results`)}function i(e){return e.querySelector(`.preview-tab`).parentNode.className.indexOf(`current`)>-1}function a(e){let n=t(e.target);i(n)||(o(n),e.preventDefault())}function o(e){let t=e.closest(`form`).querySelector(`input[name="`+e.getAttribute(`data-markup-option-name`)+`"]:checked`).value,r=e.getAttribute(`data-preview-source`)===`url`,i=new XMLHttpRequest;i.onload=function(){s(e,i.responseText)},i.onerror=function(){s(e,i.status)},i.open(`POST`,`/preview-markup`);let a=new FormData;a.append(`text`,n(e).value),a.append(`markup`,t),a.append(`url`,String(r)),a.append(document.querySelector(`meta[name='csrf-param']`).getAttribute(`content`),document.querySelector(`meta[name='csrf-token']`).getAttribute(`content`)),i.send(a)}function s(e,t){let i=n(e),a=r(e);a.innerHTML=t,a.style.display=`block`,i.style.display=`block`,a.style.height=`auto`,a.style.height=Math.max(i.clientHeight+c(i),a.scrollHeight+c(a))+`px`,i.style.display!==`none`&&(i.style.display=`none`,d(e,!0))}function c(e){let t=getComputedStyle(e);return parseInt(t.borderTopWidth)+parseInt(t.borderBottomWidth)}function l(e){let i=t(e.target),a=n(i),o=r(i);o.style.display=`none`,a.style.display=`block`,d(i,!1)}function u(e){i(e)&&o(e)}function d(e,t){e.querySelector(t?`.preview-tab`:`.write-tab`).parentNode.classList.add(`current`),e.querySelector(t?`.write-tab`:`.preview-tab`).parentNode.classList.remove(`current`)}let f=document.createElement(`div`);f.className=`tabs`,f.innerHTML=`<span class='current'><a class='write-tab'><span>`+e.getAttribute(`data-write-label`)+`</span></a></span> <span><a class='preview-tab'><span>`+e.getAttribute(`data-preview-label`)+`</span></a></span>`,e.insertBefore(f,e.firstChild);let p=document.createElement(`div`);p.className=`preview-results user-content`,p.style.display=`none`,e.appendChild(p),e.querySelector(`.preview-tab`).addEventListener(`click`,a),e.querySelector(`.write-tab`).addEventListener(`click`,l),Array.prototype.forEach.call(document.querySelectorAll(`input[name="`+e.getAttribute(`data-markup-option-name`)+`"]`),function(t){t.addEventListener(`change`,function(){u(e)})})},Q(()=>Array.prototype.forEach.call(document.querySelectorAll(`.previewable`),markupPreview)),Q(function(){function e(e){for(;e&&e.tagName.toLowerCase()!=`form`;)e=e.parentNode;return e}Array.prototype.forEach.call(document.querySelectorAll(`[data-submit-anchor]`),function(t){t.addEventListener(`click`,function(t){var n=e(t.target);n?.setAttribute(`action`,n.getAttribute(`action`).split(`#`)[0]+`#`+t.target.getAttribute(`data-submit-anchor`))})})});function Pi(e){if(parseInt(getComputedStyle(e).height)<=72)return;e.parentNode.style.position=`relative`,e.style.height=`72px`;let t=getComputedStyle(document.documentElement).direction==`rtl`,n=document.documentElement.clientWidth<=600;function r(){if(e.classList.contains(`expanded`))n?e.style.height=`72px`:(e.style.marginInlineEnd=``,i.style.marginInlineEnd=``),i.removeChild(i.firstChild),i.appendChild(document.createTextNode(`+`)),e.classList.remove(`expanded`),e.classList.add(`collapsed`);else{if(n)e.style.height=`auto`;else{let n=document.querySelector(`.width-constraint`),r=t?n.getBoundingClientRect().left-e.getBoundingClientRect().left+40:n.getBoundingClientRect().right-e.getBoundingClientRect().right-40;e.style.marginInlineEnd=`-`+r+`px`,i.style.marginInlineEnd=`-`+r+`px`}i.removeChild(i.firstChild),i.appendChild(document.createTextNode(`-`)),e.classList.add(`expanded`),e.classList.remove(`collapsed`)}}let i=document.createElement(`span`);i.className=`expander`,i.appendChild(document.createTextNode(`+`)),i.addEventListener(`click`,r),e.insertAdjacentElement(`afterend`,i),e.classList.add(`expanded`),r()}Q(()=>{document.querySelectorAll(`.expandable`).forEach(Pi)});
26function Fi(e,t){e.addEventListener(`keydown`,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())})}Q(()=>{let e=document.querySelector(`.sidebar`),t=document.querySelector(`.open-sidebar`),n=document.querySelector(`.close-sidebar`);if(!e||!t||!n)return;e.id||=`listing-options-sidebar`;let r=n.querySelector(`.sidebar-title`)?.textContent.trim();for(let i of[t,n])i.setAttribute(`role`,`button`),i.setAttribute(`tabindex`,`0`),i.setAttribute(`aria-controls`,e.id),i.setAttribute(`aria-expanded`,`false`),r&&!i.hasAttribute(`aria-label`)&&i.setAttribute(`aria-label`,r);let i=r=>{e.classList.toggle(`collapsed`,!r),t.classList.toggle(`sidebar-collapsed`,!r),t.setAttribute(`aria-expanded`,r.toString()),n.setAttribute(`aria-expanded`,r.toString()),r?n.focus():t.focus()},a=()=>i(!0),o=()=>i(!1);t.addEventListener(`click`,a),n.addEventListener(`click`,o),Fi(t,a),Fi(n,o),e.addEventListener(`keydown`,e=>{e.key===`Escape`&&(e.preventDefault(),o())})});function Ii(){var e=document.getElementById(`announcement-dismiss`);e&&e.addEventListener(`ajax:success`,function(){var t=e.parentNode;t.parentNode.removeChild(t)})}Q(Ii);function Li(e){e.preventDefault();let t=e.target.closest(`.comment`),n=document.getElementById(`post-reply`),r=n.querySelector(`[name='comment[text_markup]']:checked, [name='message[content_markup]']:checked`).value==`html`,i=zi(t,r),a=n.querySelector(`#comment_text, #message_content`),o=a.value!=``&&!a.value.endsWith(` 27`);a.value+=(o?` 28 29`:``)+Ri(i,r)+` 30 31`,a.focus()}function Ri(e,t){return t?`<blockquote>`+e+`</blockquote>`:e.split(` 32`).map(e=>`> `+e+` `).join(` 33`)}function zi(e,t){let n=e.querySelector(`.user-content`),r=window.getSelection(),i=null,a;if(r.type==`Range`&&(i=r.anchorNode,i&&i.nodeType!=Node.ELEMENT_NODE&&(i=i.parentElement),a=r.focusNode,a&&a.nodeType!=Node.ELEMENT_NODE&&(a=a.parentElement),i.closest(`.user-content`)==n&&a.closest(`.user-content`)==n))return r.toString().trim();if(t)return n.innerHTML.trim();let o=n.cloneNode(!0);for(let e of Array.from(o.querySelectorAll(`blockquote`)).reverse())e.parentNode.insertBefore(document.createTextNode(Ri(e.innerText,t)),e),e.parentNode.removeChild(e);return o.innerText.trim()}function Bi(){for(let e of document.querySelectorAll(`.edit-comment`))e.addEventListener(`click`,function(t){t.preventDefault(),document.getElementById(e.getAttribute(`data-comment-container`)).classList.add(`edit-comment-mode`)});for(let e of document.querySelectorAll(`.cancel-edit-comment`))e.addEventListener(`click`,function(t){t.preventDefault(),document.getElementById(e.getAttribute(`data-comment-container`)).classList.remove(`edit-comment-mode`)});for(let e of document.querySelectorAll(`.quote-comment`))e.addEventListener(`click`,Li);let e=document.getElementById(`discussion-locale`);e&&e.addEventListener(`change`,function(){this.selectedOptions[0]&&this.selectedOptions[0].hasAttribute(`data-url`)&&(location.href=this.selectedOptions[0].getAttribute(`data-url`))})}Q(Bi);var Vi=e=>new Promise(t=>{let n=()=>e.every(e=>e.dataset.adsbygoogleStatus===`done`&&e.dataset.adStatus!==void 0);if(n()){t(!0);return}let r=setInterval(()=>{n()&&(clearInterval(r),t(!0))},100)}),Hi=()=>new Promise(async e=>{let t=Array.from(document.querySelectorAll(`.adsbygoogle`));if(t.length==0){e(!1);return}await Vi(t),e(t.every(e=>e.dataset.adStatus===`unfilled`))});function Ui(){if(window.ethicalads===void 0){setTimeout(Ui,100);return}window.ethicalads.wait.then(e=>{typeof gtag<`u`&>ag(`event`,`EthicalAds placement`,{ea_campaign_type:e[0]?.response?.campaign_type||`(none)`}),e.length==0&&Wi()})}var Wi=function(){let e=document.querySelector(`.ea-fallback`);if(!e)return;e.classList.remove(`ea-fallback`);let t=document.createElement(e.getAttribute(`data-element-name`));e.removeAttribute(`data-element-name`),Array.from(e.attributes).forEach(e=>t.setAttributeNode(e.cloneNode(!0)));let n=e.parentNode;if(e.dataset.parentId){let n=document.createElement(`div`);n.id=e.dataset.parentId,n.appendChild(t),t=n}n.insertBefore(t,e),n.removeChild(e),n.style.display=`block`;let r=document.querySelector(`.ethical-ads`);r.parentNode.removeChild(r)};window.switchToEaFallback=Wi;var Gi=async()=>
33{if(!await Hi()){console.log(`At least one AdSense ad was filled; not falling back to EthicalAds.`);return}console.log(`All AdSense ads were unfilled; falling back to EthicalAds.`);let e=document.createElement(`script`);e.onload=function(){ethicalads.load()},e.src=`https://media.ethicalads.io/media/client/ethicalads.min.js`,document.head.appendChild(e),document.querySelector(`[data-ea-manual="true"]`).closest(`.ad-ea`).style.display=`block`,document.querySelectorAll(`.adsbygoogle`).forEach(e=>{e.remove()})};Q(Ui),Q(()=>{document.querySelector(`[data-ea-manual="true"]`)&&Gi()});var Ki=function(e){let t=e.target.selectedOptions[0];t.value==`help`?location.href=e.target.getAttribute(`data-translate-url`):location.href=t.getAttribute(`data-language-url`)};Q(()=>{document.querySelectorAll(`.language-selector-locale`).forEach(e=>{e.addEventListener(`change`,Ki)})});function qi(e){e.style.transition=`background-color 3s`,e.classList.add(`highlight`),setTimeout(()=>e.classList.remove(`highlight`),3e3)}function Ji(e){let t=this.closest(`form`).querySelector(`input[type=file][name*=attachments]`);if(!t)return;let n=t.getAttribute(`accept`).split(`,`),r=Array.from(e.clipboardData.files).filter(e=>n.includes(e.type));if(r.length==0)return;let i=new DataTransfer;for(let e of t.files)i.items.add(e);for(let e of r)i.items.add(e);t.files=i.files,qi(t)}function Yi(){for(let e of document.querySelectorAll(`.previewable textarea`))e.addEventListener(`paste`,Ji)}Q(Yi),Q(()=>{document.querySelectorAll(`.lazy-load-diff`).forEach(e=>{e.addEventListener(`click`,t=>{e.disabled=!0,e.dataset.originalText=e.textContent,e.textContent=e.dataset.disableWith,fetch(e.dataset.url).then(t=>Xi(e,t))})})});async function Xi(e,t){let n=e.closest(`.report-diff`),r=await t.text(),i=new DOMParser().parseFromString(r,`text/html`);n.replaceChild(i.body.firstElementChild,n.firstChild),e.textContent=e.dataset.originalText,e.disabled=!1}async function Zi(){if(!document.querySelector(`.browser-list`))return;let{detect:e}=await B(async()=>{let{detect:e}=await import(`./es-CaB-tJAa.js`);return{detect:e}},[]),t;switch(e().os){case`Android OS`:t=`android-browser-list`;break;case`iOS`:t=`ios-browser-list`;break;default:t=`desktop-browser-list`}Qi(t),document.querySelectorAll(`[data-for]`).forEach(e=>e.addEventListener(`click`,()=>{Qi(e.getAttribute(`data-for`))}))}function Qi(e){document.querySelectorAll(`.browser-list`).forEach(e=>e.style.display=`none`),document.getElementById(e).style.display=`block`,document.querySelectorAll(`.browser-list-selector-active`).forEach(e=>e.classList.remove(`browser-list-selector-active`)),document.querySelector(`[data-for='`+e+`']`).classList.add(`browser-list-selector-active`)}Q(Zi);var $=null;Q(async()=>{let e=document.querySelector(`input.enable-source-editor`);if(!e)return;e.addEventListener(`change`,ea);let t=$i(e);t.addEventListener(`submit`,ta);let n=t.querySelector(`.g-recaptcha`);n&&n.addEventListener(`click`,ta),e.parentNode.style.display=`inline`,ea({target:e})});function $i(e){for(;e&&e.tagName.toLowerCase()!==`form`;)e=e.parentNode;return e}async function ea(e){let t=e.target.getAttribute(`data-related-editor`),n=document.getElementById(t),r=e.target.getAttribute(`data-editor-language`);if(e.target.checked){let e=await B(()=>import(`./ace-CTlyX76M.js`).then(e=>l(e.default)),[]);n.style.display=`none`;let t=document.createElement(`div`);if(t.id=`ace-editor`,t.appendChild(document.createTextNode(n.value)),t.style.height=getComputedStyle(n).height,n.parentNode.insertBefore(t,n.nextSibling),$=e.edit(`ace-editor`),$.session.on(`changeMode`,function(e,t){t.getMode().$id===`ace/mode/javascript`&&t.$worker&&t.$worker.send(`setOptions`,[{esversion:6,"-W064":!1}])}),r===`css`){await B(()=>import(`./mode-css-2isvxDU5.js`).then(e=>l(e.default)),[]);let t=await B(()=>import(`./worker-css-CRdRWcD4.js`),[]);e.config.setModuleUrl(`ace/mode/css_worker`,t.default),$.getSession().setMode(`ace/mode/css`)}else{await B(()=>import(`./mode-javascript-BafIfeN_.js`).then(e=>l(e.default)),[]);let t=await B(()=>import(`./worker-javascript-f9w83ETH.js`),[]);e.config.setModuleUrl(`ace/mode/javascript_worker`,t.default),$.getSession().setMode(`ace/mode/javascript`)}}else{let e=document.getElementById(`ace-editor`);e&&(n.value=$.getSession().getValue(),n.style.display=`block`,n.style.height=getComputedStyle(e).height,e.parentNode.removeChild(e),$.destroy(),$=null)}}function ta(){if(document.getElementById(`ace-editor`)){let e=document.querySelector(`input.enable-source-editor`).getAttribute(`data-related-editor`),t=document.getElementById(e);t.value=$.getSession().getValue()}}window.initializeChart=async function(e,t){let n=document.getElementById(t),r=document.createElement(`canvas`);r.id=t+`-canvas`,r.width=parseInt(getComputedStyle(n).width.replace(`px`,``),10)-5,r.height=400,n.appendChild(r),console.log(getComputedStyle(r).getPropertyValue(`--chart-fill-color`));let i={labels:Object.keys(e),datasets:[{backgroundColor:getComputedStyle(r).getPropertyValue(`--chart-background-color`),data:Object.values(e)}]},a=r.getContext(`2d`),{Chart:o,CategoryScale:s,LinearScale:c,BarController:l,BarElement:u,Tooltip:d}=await B(async()=>{let{Chart:e,CategoryScale:t,LinearScale:n,BarController:r,BarElement:i,Tooltip:a}=await import(`./chart-CH2Mwa8Q.js`);return{Chart:e,CategoryScale:t,LinearScale:n,BarController:r,BarElement:i,Tooltip:a}},[]);o.register([s,c,l,u,d]),new o(a,{type:`bar`,data:i,options:{scaleStartValue:0,legend:{dis
33play:!1},scales:{x:{grid:{display:!1}},y:{suggestedMax:10,beginAtZero:!0,grid:{color:getComputedStyle(r).getPropertyValue(`--chart-border-color`)}}},plugins:{tooltip:{enabled:!0}}}})},Q(()=>{let e=document.querySelector(`.external-login-form [name="authenticity_token"]`);e&&(e.value=document.querySelector(`meta[name="csrf-token"]`).getAttribute(`content`))}),Q(()=>{let e=document.querySelector(`.mobile-nav-opener`),t=document.querySelector(`#mobile-nav nav`);if(!e||!t)return;t.id||=`mobile-nav-menu`;let n=document.querySelector(`#site-name-text h1`)?.textContent.trim();e.setAttribute(`role`,`button`),e.setAttribute(`tabindex`,`0`),e.setAttribute(`aria-controls`,t.id),e.setAttribute(`aria-expanded`,`false`),n&&e.setAttribute(`aria-label`,n);let r=n=>{t.classList.toggle(`collapsed`,!n),e.setAttribute(`aria-expanded`,n.toString())},i=()=>r(e.getAttribute(`aria-expanded`)!==`true`);e.addEventListener(`click`,i),e.addEventListener(`keydown`,t=>{if(t.key===`Escape`&&e.getAttribute(`aria-expanded`)===`true`){t.preventDefault(),r(!1);return}(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),i())}),t.addEventListener(`keydown`,t=>{t.key===`Escape`&&(t.preventDefault(),r(!1),e.focus())})}),Q(()=>{let e=document.getElementById(`wrap-lines`);e&&(e.addEventListener(`change`,e=>na(e.target)),na(e))});var na=e=>{let t=document.querySelector(`.code-container .prettyprint`);if(!t)return;let n=e.checked;t.classList.toggle(`wrap`,n)};Q(function(){let e=Intl.DateTimeFormat().resolvedOptions().timeZone;document.querySelectorAll(`input[name='tz']`).forEach(t=>t.value||=e)});var ra=()=>{let e=document.getElementById(`script_script_type_3`);e&&(document.getElementById(`script-library-inputs`).hidden=!e.checked)};Q(()=>{ra(),document.querySelectorAll(`input[name="script[script_type]"]`).forEach(e=>e.addEventListener(`change`,ra))}),Turbo.session.drive=!1;export{o as t}; 34//# sourceMappingURL=application-dSd3iabZ.js.map
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.