adhesiones-jekyll-theme 0.4.2 → 0.4.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/_data/en.yml +5 -2
- data/_data/es.yml +5 -2
- data/_data/layouts/adhesion.yml +2 -2
- data/_data/layouts/adhesion_individual.yml +17 -14
- data/_data/layouts/home.yml +151 -0
- data/_data/layouts/menu_external.yml +35 -0
- data/_data/layouts/menu_internal.yml +42 -0
- data/_data/layouts/post.yml +5 -21
- data/_data/manifest.json +699 -0
- data/_data/schema.yml +13 -0
- data/_data/sutty.yml +6 -0
- data/_includes/footer.html +1 -1
- data/_includes/navbar.html +12 -28
- data/_includes/new_content.html +1 -0
- data/_includes/script.html +5 -0
- data/_includes/share_box.html +1 -1
- data/_layouts/default.html +12 -8
- data/_layouts/home.html +60 -41
- data/_layouts/post.html +1 -1
- data/_sass/content.scss +116 -0
- data/assets/css/styles.scss +3 -1
- data/assets/js/env.js +8 -0
- data/assets/js/pack.U4PELPHY.js +49 -0
- data/assets/js/pack.U4PELPHY.js.map +7 -0
- metadata +81 -73
- data/_data/layouts/menu.yml +0 -73
- data/assets/js/pack.js +0 -16
- data/assets/js/pack.js.map +0 -1
- data/assets/js/script.js +0 -49
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
(()=>{var Ii=Object.create;var Dr=Object.defineProperty;var Di=Object.getOwnPropertyDescriptor;var qi=Object.getOwnPropertyNames;var Hi=Object.getPrototypeOf,ji=Object.prototype.hasOwnProperty;var Q=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Vi=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of qi(e))!ji.call(r,i)&&i!==t&&Dr(r,i,{get:()=>e[i],enumerable:!(s=Di(e,i))||s.enumerable});return r};var qr=(r,e,t)=>(t=r!=null?Ii(Hi(r)):{},Vi(e||!r||!r.__esModule?Dr(t,"default",{value:r,enumerable:!0}):t,r));var Zr=Q((_t,Yr)=>{(function(r,e){"use strict";typeof define=="function"&&define.amd?define("stackframe",[],e):typeof _t=="object"?Yr.exports=e():r.StackFrame=e()})(_t,function(){"use strict";function r(y){return!isNaN(parseFloat(y))&&isFinite(y)}function e(y){return y.charAt(0).toUpperCase()+y.substring(1)}function t(y){return function(){return this[y]}}var s=["isConstructor","isEval","isNative","isToplevel"],i=["columnNumber","lineNumber"],n=["fileName","functionName","source"],o=["args"],c=["evalOrigin"],u=s.concat(i,n,o,c);function p(y){if(y)for(var S=0;S<u.length;S++)y[u[S]]!==void 0&&this["set"+e(u[S])](y[u[S]])}p.prototype={getArgs:function(){return this.args},setArgs:function(y){if(Object.prototype.toString.call(y)!=="[object Array]")throw new TypeError("Args must be an Array");this.args=y},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(y){if(y instanceof p)this.evalOrigin=y;else if(y instanceof Object)this.evalOrigin=new p(y);else throw new TypeError("Eval Origin must be an Object or StackFrame")},toString:function(){var y=this.getFileName()||"",S=this.getLineNumber()||"",T=this.getColumnNumber()||"",L=this.getFunctionName()||"";return this.getIsEval()?y?"[eval] ("+y+":"+S+":"+T+")":"[eval]:"+S+":"+T:L?L+" ("+y+":"+S+":"+T+")":y+":"+S+":"+T}},p.fromString=function(S){var T=S.indexOf("("),L=S.lastIndexOf(")"),O=S.substring(0,T),d=S.substring(T+1,L).split(","),w=S.substring(L+1);if(w.indexOf("@")===0)var l=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(w,""),h=l[1],b=l[2],v=l[3];return new p({functionName:O,args:d||void 0,fileName:h,lineNumber:b||void 0,columnNumber:v||void 0})};for(var g=0;g<s.length;g++)p.prototype["get"+e(s[g])]=t(s[g]),p.prototype["set"+e(s[g])]=(function(y){return function(S){this[y]=!!S}})(s[g]);for(var E=0;E<i.length;E++)p.prototype["get"+e(i[E])]=t(i[E]),p.prototype["set"+e(i[E])]=(function(y){return function(S){if(!r(S))throw new TypeError(y+" must be a Number");this[y]=Number(S)}})(i[E]);for(var m=0;m<n.length;m++)p.prototype["get"+e(n[m])]=t(n[m]),p.prototype["set"+e(n[m])]=(function(y){return function(S){this[y]=String(S)}})(n[m]);return p})});var ts=Q((Tt,es)=>{(function(r,e){"use strict";typeof define=="function"&&define.amd?define("error-stack-parser",["stackframe"],e):typeof Tt=="object"?es.exports=e(Zr()):r.ErrorStackParser=e(r.StackFrame)})(Tt,function(e){"use strict";var t=/(^|@)\S+:\d+/,s=/^\s*at .*(\S+:\d+|\(native\))/m,i=/^(eval@)?(\[native code])?$/;return{parse:function(o){if(typeof o.stacktrace<"u"||typeof o["opera#sourceloc"]<"u")return this.parseOpera(o);if(o.stack&&o.stack.match(s))return this.parseV8OrIE(o);if(o.stack)return this.parseFFOrSafari(o);throw new Error("Cannot parse given Error object")},extractLocation:function(o){if(o.indexOf(":")===-1)return[o];var c=/(.+?)(?::(\d+))?(?::(\d+))?$/,u=c.exec(o.replace(/[()]/g,""));return[u[1],u[2]||void 0,u[3]||void 0]},parseV8OrIE:function(o){var c=o.stack.split(`
|
|
2
|
+
`).filter(function(u){return!!u.match(s)},this);return c.map(function(u){u.indexOf("(eval ")>-1&&(u=u.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var p=u.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),g=p.match(/ (\(.+\)$)/);p=g?p.replace(g[0],""):p;var E=this.extractLocation(g?g[1]:p),m=g&&p||void 0,y=["eval","<anonymous>"].indexOf(E[0])>-1?void 0:E[0];return new e({functionName:m,fileName:y,lineNumber:E[1],columnNumber:E[2],source:u})},this)},parseFFOrSafari:function(o){var c=o.stack.split(`
|
|
3
|
+
`).filter(function(u){return!u.match(i)},this);return c.map(function(u){if(u.indexOf(" > eval")>-1&&(u=u.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),u.indexOf("@")===-1&&u.indexOf(":")===-1)return new e({functionName:u});var p=/((.*".+"[^@]*)?[^@]*)(?:@)/,g=u.match(p),E=g&&g[1]?g[1]:void 0,m=this.extractLocation(u.replace(p,""));return new e({functionName:E,fileName:m[0],lineNumber:m[1],columnNumber:m[2],source:u})},this)},parseOpera:function(o){return!o.stacktrace||o.message.indexOf(`
|
|
4
|
+
`)>-1&&o.message.split(`
|
|
5
|
+
`).length>o.stacktrace.split(`
|
|
6
|
+
`).length?this.parseOpera9(o):o.stack?this.parseOpera11(o):this.parseOpera10(o)},parseOpera9:function(o){for(var c=/Line (\d+).*script (?:in )?(\S+)/i,u=o.message.split(`
|
|
7
|
+
`),p=[],g=2,E=u.length;g<E;g+=2){var m=c.exec(u[g]);m&&p.push(new e({fileName:m[2],lineNumber:m[1],source:u[g]}))}return p},parseOpera10:function(o){for(var c=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,u=o.stacktrace.split(`
|
|
8
|
+
`),p=[],g=0,E=u.length;g<E;g+=2){var m=c.exec(u[g]);m&&p.push(new e({functionName:m[3]||void 0,fileName:m[2],lineNumber:m[1],source:u[g]}))}return p},parseOpera11:function(o){var c=o.stack.split(`
|
|
9
|
+
`).filter(function(u){return!!u.match(t)&&!u.match(/^Error created at/)},this);return c.map(function(u){var p=u.split("@"),g=this.extractLocation(p.pop()),E=p.shift()||"",m=E.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,y;E.match(/\(([^)]*)\)/)&&(y=E.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var S=y===void 0||y==="[arguments not available]"?void 0:y.split(",");return new e({functionName:m,args:S,fileName:g[0],lineNumber:g[1],columnNumber:g[2],source:u})},this)}}})});var hs=Q((Y,us)=>{var qe=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global,He=(function(){function r(){this.fetch=!1,this.DOMException=qe.DOMException}return r.prototype=qe,new r})();(function(r){var e=(function(t){var s=typeof r<"u"&&r||typeof self<"u"&&self||typeof global<"u"&&global||{},i={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function n(a){return a&&DataView.prototype.isPrototypeOf(a)}if(i.arrayBuffer)var o=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(a){return a&&o.indexOf(Object.prototype.toString.call(a))>-1};function u(a){if(typeof a!="string"&&(a=String(a)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(a)||a==="")throw new TypeError('Invalid character in header field name: "'+a+'"');return a.toLowerCase()}function p(a){return typeof a!="string"&&(a=String(a)),a}function g(a){var f={next:function(){var M=a.shift();return{done:M===void 0,value:M}}};return i.iterable&&(f[Symbol.iterator]=function(){return f}),f}function E(a){this.map={},a instanceof E?a.forEach(function(f,M){this.append(M,f)},this):Array.isArray(a)?a.forEach(function(f){if(f.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+f.length);this.append(f[0],f[1])},this):a&&Object.getOwnPropertyNames(a).forEach(function(f){this.append(f,a[f])},this)}E.prototype.append=function(a,f){a=u(a),f=p(f);var M=this.map[a];this.map[a]=M?M+", "+f:f},E.prototype.delete=function(a){delete this.map[u(a)]},E.prototype.get=function(a){return a=u(a),this.has(a)?this.map[a]:null},E.prototype.has=function(a){return this.map.hasOwnProperty(u(a))},E.prototype.set=function(a,f){this.map[u(a)]=p(f)},E.prototype.forEach=function(a,f){for(var M in this.map)this.map.hasOwnProperty(M)&&a.call(f,this.map[M],M,this)},E.prototype.keys=function(){var a=[];return this.forEach(function(f,M){a.push(M)}),g(a)},E.prototype.values=function(){var a=[];return this.forEach(function(f){a.push(f)}),g(a)},E.prototype.entries=function(){var a=[];return this.forEach(function(f,M){a.push([M,f])}),g(a)},i.iterable&&(E.prototype[Symbol.iterator]=E.prototype.entries);function m(a){if(!a._noBody){if(a.bodyUsed)return Promise.reject(new TypeError("Already read"));a.bodyUsed=!0}}function y(a){return new Promise(function(f,M){a.onload=function(){f(a.result)},a.onerror=function(){M(a.error)}})}function S(a){var f=new FileReader,M=y(f);return f.readAsArrayBuffer(a),M}function T(a){var f=new FileReader,M=y(f),k=/charset=([A-Za-z0-9_-]+)/.exec(a.type),F=k?k[1]:"utf-8";return f.readAsText(a,F),M}function L(a){for(var f=new Uint8Array(a),M=new Array(f.length),k=0;k<f.length;k++)M[k]=String.fromCharCode(f[k]);return M.join("")}function O(a){if(a.slice)return a.slice(0);var f=new Uint8Array(a.byteLength);return f.set(new Uint8Array(a)),f.buffer}function d(){return this.bodyUsed=!1,this._initBody=function(a){this.bodyUsed=this.bodyUsed,this._bodyInit=a,a?typeof a=="string"?this._bodyText=a:i.blob&&Blob.prototype.isPrototypeOf(a)?this._bodyBlob=a:i.formData&&FormData.prototype.isPrototypeOf(a)?this._bodyFormData=a:i.searchParams&&URLSearchParams.prototype.isPrototypeOf(a)?this._bodyText=a.toString():i.arrayBuffer&&i.blob&&n(a)?(this._bodyArrayBuffer=O(a.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(a)||c(a))?this._bodyArrayBuffer=O(a):this._bodyText=a=Object.prototype.toString.call(a):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof a=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i.searchParams&&URLSearchParams.prototype.isPrototypeOf(a)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i.blob&&(this.blob=function(){var a=m(this);if(a)return a;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var a=m(this);return a||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(i.blob)return this.blob().then(S);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var a=m(this);if(a)return a;if(this._bodyBlob)return T(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(L(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i.formData&&(this.formData=function(){return this.text().then(b)}),this.json=function(){return this.text().then(JSON.parse)},this}var w=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function l(a){var f=a.toUpperCase();return w.indexOf(f)>-1?f:a}function h(a,f){if(!(this instanceof h))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');f=f||{};var M=f.body;if(a instanceof h){if(a.bodyUsed)throw new TypeError("Already read");this.url=a.url,this.credentials=a.credentials,f.headers||(this.headers=new E(a.headers)),this.method=a.method,this.mode=a.mode,this.signal=a.signal,!M&&a._bodyInit!=null&&(M=a._bodyInit,a.bodyUsed=!0)}else this.url=String(a);if(this.credentials=f.credentials||this.credentials||"same-origin",(f.headers||!this.headers)&&(this.headers=new E(f.headers)),this.method=l(f.method||this.method||"GET"),this.mode=f.mode||this.mode||null,this.signal=f.signal||this.signal||(function(){if("AbortController"in s){var C=new AbortController;return C.signal}})(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&M)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(M),(this.method==="GET"||this.method==="HEAD")&&(f.cache==="no-store"||f.cache==="no-cache")){var k=/([?&])_=[^&]*/;if(k.test(this.url))this.url=this.url.replace(k,"$1_="+new Date().getTime());else{var F=/\?/;this.url+=(F.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}h.prototype.clone=function(){return new h(this,{body:this._bodyInit})};function b(a){var f=new FormData;return a.trim().split("&").forEach(function(M){if(M){var k=M.split("="),F=k.shift().replace(/\+/g," "),C=k.join("=").replace(/\+/g," ");f.append(decodeURIComponent(F),decodeURIComponent(C))}}),f}function v(a){var f=new E,M=a.replace(/\r?\n[\t ]+/g," ");return M.split("\r").map(function(k){return k.indexOf(`
|
|
10
|
+
`)===0?k.substr(1,k.length):k}).forEach(function(k){var F=k.split(":"),C=F.shift().trim();if(C){var Be=F.join(":").trim();try{f.append(C,Be)}catch(wt){console.warn("Response "+wt.message)}}}),f}d.call(h.prototype);function A(a,f){if(!(this instanceof A))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(f||(f={}),this.type="default",this.status=f.status===void 0?200:f.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=f.statusText===void 0?"":""+f.statusText,this.headers=new E(f.headers),this.url=f.url||"",this._initBody(a)}d.call(A.prototype),A.prototype.clone=function(){return new A(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new E(this.headers),url:this.url})},A.error=function(){var a=new A(null,{status:200,statusText:""});return a.ok=!1,a.status=0,a.type="error",a};var _=[301,302,303,307,308];A.redirect=function(a,f){if(_.indexOf(f)===-1)throw new RangeError("Invalid status code");return new A(null,{status:f,headers:{location:a}})},t.DOMException=s.DOMException;try{new t.DOMException}catch{t.DOMException=function(f,M){this.message=f,this.name=M;var k=Error(f);this.stack=k.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function R(a,f){return new Promise(function(M,k){var F=new h(a,f);if(F.signal&&F.signal.aborted)return k(new t.DOMException("Aborted","AbortError"));var C=new XMLHttpRequest;function Be(){C.abort()}C.onload=function(){var D={statusText:C.statusText,headers:v(C.getAllResponseHeaders()||"")};F.url.indexOf("file://")===0&&(C.status<200||C.status>599)?D.status=200:D.status=C.status,D.url="responseURL"in C?C.responseURL:D.headers.get("X-Request-URL");var ie="response"in C?C.response:C.responseText;setTimeout(function(){M(new A(ie,D))},0)},C.onerror=function(){setTimeout(function(){k(new TypeError("Network request failed"))},0)},C.ontimeout=function(){setTimeout(function(){k(new TypeError("Network request timed out"))},0)},C.onabort=function(){setTimeout(function(){k(new t.DOMException("Aborted","AbortError"))},0)};function wt(D){try{return D===""&&s.location.href?s.location.href:D}catch{return D}}if(C.open(F.method,wt(F.url),!0),F.credentials==="include"?C.withCredentials=!0:F.credentials==="omit"&&(C.withCredentials=!1),"responseType"in C&&(i.blob?C.responseType="blob":i.arrayBuffer&&(C.responseType="arraybuffer")),f&&typeof f.headers=="object"&&!(f.headers instanceof E||s.Headers&&f.headers instanceof s.Headers)){var Ir=[];Object.getOwnPropertyNames(f.headers).forEach(function(D){Ir.push(u(D)),C.setRequestHeader(D,p(f.headers[D]))}),F.headers.forEach(function(D,ie){Ir.indexOf(ie)===-1&&C.setRequestHeader(ie,D)})}else F.headers.forEach(function(D,ie){C.setRequestHeader(ie,D)});F.signal&&(F.signal.addEventListener("abort",Be),C.onreadystatechange=function(){C.readyState===4&&F.signal.removeEventListener("abort",Be)}),C.send(typeof F._bodyInit>"u"?null:F._bodyInit)})}return R.polyfill=!0,s.fetch||(s.fetch=R,s.Headers=E,s.Request=h,s.Response=A),t.Headers=E,t.Request=h,t.Response=A,t.fetch=R,Object.defineProperty(t,"__esModule",{value:!0}),t})({})})(He);He.fetch.ponyfill=!0;delete He.fetch.polyfill;var le=qe.fetch?qe:He;Y=le.fetch;Y.default=le.fetch;Y.fetch=le.fetch;Y.Headers=le.Headers;Y.Request=le.Request;Y.Response=le.Response;us.exports=Y});var Ot=Q((hc,gs)=>{function $(){}$.prototype.clear=function(){this._root=null,this.size=0};$.prototype.find=function(r){for(var e=this._root;e!==null;){var t=this._comparator(r,e.data);if(t===0)return e.data;e=e.get_child(t>0)}return null};$.prototype.findIter=function(r){for(var e=this._root,t=this.iterator();e!==null;){var s=this._comparator(r,e.data);if(s===0)return t._cursor=e,t;t._ancestors.push(e),e=e.get_child(s>0)}return null};$.prototype.lowerBound=function(r){for(var e=this._root,t=this.iterator(),s=this._comparator;e!==null;){var i=s(r,e.data);if(i===0)return t._cursor=e,t;t._ancestors.push(e),e=e.get_child(i>0)}for(var n=t._ancestors.length-1;n>=0;--n)if(e=t._ancestors[n],s(r,e.data)<0)return t._cursor=e,t._ancestors.length=n,t;return t._ancestors.length=0,t};$.prototype.upperBound=function(r){for(var e=this.lowerBound(r),t=this._comparator;e.data()!==null&&t(e.data(),r)===0;)e.next();return e};$.prototype.min=function(){var r=this._root;if(r===null)return null;for(;r.left!==null;)r=r.left;return r.data};$.prototype.max=function(){var r=this._root;if(r===null)return null;for(;r.right!==null;)r=r.right;return r.data};$.prototype.iterator=function(){return new de(this)};$.prototype.each=function(r){for(var e=this.iterator(),t;(t=e.next())!==null;)if(r(t)===!1)return};$.prototype.reach=function(r){for(var e=this.iterator(),t;(t=e.prev())!==null;)if(r(t)===!1)return};function de(r){this._tree=r,this._ancestors=[],this._cursor=null}de.prototype.data=function(){return this._cursor!==null?this._cursor.data:null};de.prototype.next=function(){if(this._cursor===null){var r=this._tree._root;r!==null&&this._minNode(r)}else if(this._cursor.right===null){var e;do if(e=this._cursor,this._ancestors.length)this._cursor=this._ancestors.pop();else{this._cursor=null;break}while(this._cursor.right===e)}else this._ancestors.push(this._cursor),this._minNode(this._cursor.right);return this._cursor!==null?this._cursor.data:null};de.prototype.prev=function(){if(this._cursor===null){var r=this._tree._root;r!==null&&this._maxNode(r)}else if(this._cursor.left===null){var e;do if(e=this._cursor,this._ancestors.length)this._cursor=this._ancestors.pop();else{this._cursor=null;break}while(this._cursor.left===e)}else this._ancestors.push(this._cursor),this._maxNode(this._cursor.left);return this._cursor!==null?this._cursor.data:null};de.prototype._minNode=function(r){for(;r.left!==null;)this._ancestors.push(r),r=r.left;this._cursor=r};de.prototype._maxNode=function(r){for(;r.right!==null;)this._ancestors.push(r),r=r.right;this._cursor=r};gs.exports=$});var ys=Q((lc,bs)=>{var an=Ot();function fe(r){this.data=r,this.left=null,this.right=null,this.red=!0}fe.prototype.get_child=function(r){return r?this.right:this.left};fe.prototype.set_child=function(r,e){r?this.right=e:this.left=e};function je(r){this._root=null,this._comparator=r,this.size=0}je.prototype=new an;je.prototype.insert=function(r){var e=!1;if(this._root===null)this._root=new fe(r),e=!0,this.size++;else{var t=new fe(void 0),s=0,i=0,n=null,o=t,c=null,u=this._root;for(o.right=this._root;;){if(u===null?(u=new fe(r),c.set_child(s,u),e=!0,this.size++):H(u.left)&&H(u.right)&&(u.red=!0,u.left.red=!1,u.right.red=!1),H(u)&&H(c)){var p=o.right===n;u===c.get_child(i)?o.set_child(p,Ae(n,!i)):o.set_child(p,vs(n,!i))}var g=this._comparator(u.data,r);if(g===0)break;i=s,s=g<0,n!==null&&(o=n),n=c,c=u,u=u.get_child(s)}this._root=t.right}return this._root.red=!1,e};je.prototype.remove=function(r){if(this._root===null)return!1;var e=new fe(void 0),t=e;t.right=this._root;for(var s=null,i=null,n=null,o=1;t.get_child(o)!==null;){var c=o;i=s,s=t,t=t.get_child(o);var u=this._comparator(r,t.data);if(o=u>0,u===0&&(n=t),!H(t)&&!H(t.get_child(o))){if(H(t.get_child(!o))){var p=Ae(t,o);s.set_child(c,p),s=p}else if(!H(t.get_child(!o))){var g=s.get_child(!c);if(g!==null)if(!H(g.get_child(!c))&&!H(g.get_child(c)))s.red=!1,g.red=!0,t.red=!0;else{var E=i.right===s;H(g.get_child(c))?i.set_child(E,vs(s,c)):H(g.get_child(!c))&&i.set_child(E,Ae(s,c));var m=i.get_child(E);m.red=!0,t.red=!0,m.left.red=!1,m.right.red=!1}}}}return n!==null&&(n.data=t.data,s.set_child(s.right===t,t.get_child(t.left===null)),this.size--),this._root=e.right,this._root!==null&&(this._root.red=!1),n!==null};function H(r){return r!==null&&r.red}function Ae(r,e){var t=r.get_child(!e);return r.set_child(!e,t.get_child(e)),t.set_child(e,r),r.red=!0,t.red=!1,t}function vs(r,e){return r.set_child(!e,Ae(r.get_child(!e),!e)),Ae(r,e)}bs.exports=je});var Es=Q((dc,ws)=>{var cn=Ot();function _e(r){this.data=r,this.left=null,this.right=null}_e.prototype.get_child=function(r){return r?this.right:this.left};_e.prototype.set_child=function(r,e){r?this.right=e:this.left=e};function Ve(r){this._root=null,this._comparator=r,this.size=0}Ve.prototype=new cn;Ve.prototype.insert=function(r){if(this._root===null)return this._root=new _e(r),this.size++,!0;for(var e=0,t=null,s=this._root;;){if(s===null)return s=new _e(r),t.set_child(e,s),ret=!0,this.size++,!0;if(this._comparator(s.data,r)===0)return!1;e=this._comparator(s.data,r)<0,t=s,s=s.get_child(e)}};Ve.prototype.remove=function(r){if(this._root===null)return!1;var e=new _e(void 0),t=e;t.right=this._root;for(var s=null,i=null,n=1;t.get_child(n)!==null;){s=t,t=t.get_child(n);var o=this._comparator(r,t.data);n=o>0,o===0&&(i=t)}return i!==null?(i.data=t.data,s.set_child(s.right===t,t.get_child(t.left===null)),this._root=e.right,this.size--,!0):!1};ws.exports=Ve});var As=Q((fc,Ss)=>{Ss.exports={RBTree:ys(),BinTree:Es()}});var Os=Q((pc,Ts)=>{var un=As().RBTree;function P(r,e,t){this.discrete=r===!1,this.delta=r||.01,this.K=e===void 0?25:e,this.CX=t===void 0?1.1:t,this.centroids=new un(_s),this.nreset=0,this.reset()}P.prototype.reset=function(){this.centroids.clear(),this.n=0,this.nreset+=1,this.last_cumulate=0};P.prototype.size=function(){return this.centroids.size};P.prototype.toArray=function(r){var e=[];return r?(this._cumulate(!0),this.centroids.each(function(t){e.push(t)})):this.centroids.each(function(t){e.push({mean:t.mean,n:t.n})}),e};P.prototype.summary=function(){var r=this.discrete?"exact ":"approximating ",e=[r+this.n+" samples using "+this.size()+" centroids","min = "+this.percentile(0),"Q1 = "+this.percentile(.25),"Q2 = "+this.percentile(.5),"Q3 = "+this.percentile(.75),"max = "+this.percentile(1)];return e.join(`
|
|
11
|
+
`)};function _s(r,e){return r.mean>e.mean?1:r.mean<e.mean?-1:0}function hn(r,e){return r.mean_cumn-e.mean_cumn}P.prototype.push=function(r,e){e=e||1,r=Array.isArray(r)?r:[r];for(var t=0;t<r.length;t++)this._digest(r[t],e)};P.prototype.push_centroid=function(r){r=Array.isArray(r)?r:[r];for(var e=0;e<r.length;e++)this._digest(r[e].mean,r[e].n)};P.prototype._cumulate=function(r){if(!(this.n===this.last_cumulate||!r&&this.CX&&this.CX>this.n/this.last_cumulate)){var e=0;this.centroids.each(function(t){t.mean_cumn=e+t.n/2,e=t.cumn=e+t.n}),this.n=this.last_cumulate=e}};P.prototype.find_nearest=function(r){if(this.size()===0)return null;var e=this.centroids.lowerBound({mean:r}),t=e.data()===null?e.prev():e.data();if(t.mean===r||this.discrete)return t;var s=e.prev();return s&&Math.abs(s.mean-r)<Math.abs(t.mean-r)?s:t};P.prototype._new_centroid=function(r,e,t){var s={mean:r,n:e,cumn:t};return this.centroids.insert(s),this.n+=e,s};P.prototype._addweight=function(r,e,t){e!==r.mean&&(r.mean+=t*(e-r.mean)/(r.n+t)),r.cumn+=t,r.mean_cumn+=t/2,r.n+=t,this.n+=t};P.prototype._digest=function(r,e){var t=this.centroids.min(),s=this.centroids.max(),i=this.find_nearest(r);if(i&&i.mean===r)this._addweight(i,r,e);else if(i===t)this._new_centroid(r,e,0);else if(i===s)this._new_centroid(r,e,this.n);else if(this.discrete)this._new_centroid(r,e,i.cumn);else{var n=i.mean_cumn/this.n,o=Math.floor(4*this.n*this.delta*n*(1-n));o-i.n>=e?this._addweight(i,r,e):this._new_centroid(r,e,i.cumn)}this._cumulate(!1),!this.discrete&&this.K&&this.size()>this.K/this.delta&&this.compress()};P.prototype.bound_mean=function(r){var e=this.centroids.upperBound({mean:r}),t=e.prev(),s=t.mean===r?t:e.next();return[t,s]};P.prototype.p_rank=function(r){var e=Array.isArray(r)?r:[r],t=e.map(this._p_rank,this);return Array.isArray(r)?t:t[0]};P.prototype._p_rank=function(r){if(this.size()!==0){{if(r<this.centroids.min().mean)return 0;if(r>this.centroids.max().mean)return 1}this._cumulate(!0);var e=this.bound_mean(r),t=e[0],s=e[1];if(this.discrete)return t.cumn/this.n;var i=t.mean_cumn;return t!==s&&(i+=(r-t.mean)*(s.mean_cumn-t.mean_cumn)/(s.mean-t.mean)),i/this.n}};P.prototype.bound_mean_cumn=function(r){this.centroids._comparator=hn;var e=this.centroids.upperBound({mean_cumn:r});this.centroids._comparator=_s;var t=e.prev(),s=t&&t.mean_cumn===r?t:e.next();return[t,s]};P.prototype.percentile=function(r){var e=Array.isArray(r)?r:[r],t=e.map(this._percentile,this);return Array.isArray(r)?t:t[0]};P.prototype._percentile=function(r){if(this.size()!==0){this._cumulate(!0);var e=this.n*r,t=this.bound_mean_cumn(e),s=t[0],i=t[1];return i===s||s===null||i===null?(s||i).mean:this.discrete?e<=s.cumn?s.mean:i.mean:s.mean+(e-s.mean_cumn)*(i.mean-s.mean)/(i.mean_cumn-s.mean_cumn)}};function ln(r){var e=Math.floor(Math.random()*r.length);return r.splice(e,1)[0]}P.prototype.compress=function(){if(!this.compressing){var r=this.toArray();for(this.reset(),this.compressing=!0;r.length>0;)this.push_centroid(ln(r));this._cumulate(!0),this.compressing=!1}};function Z(r){this.config=r||{},this.mode=this.config.mode||"auto",P.call(this,this.mode==="cont"?r.delta:!1),this.digest_ratio=this.config.ratio||.9,this.digest_thresh=this.config.thresh||1e3,this.n_unique=0}Z.prototype=Object.create(P.prototype);Z.prototype.constructor=Z;Z.prototype.push=function(r){P.prototype.push.call(this,r),this.check_continuous()};Z.prototype._new_centroid=function(r,e,t){this.n_unique+=1,P.prototype._new_centroid.call(this,r,e,t)};Z.prototype._addweight=function(r,e,t){r.n===1&&(this.n_unique-=1),P.prototype._addweight.call(this,r,e,t)};Z.prototype.check_continuous=function(){return this.mode!=="auto"||this.size()<this.digest_thresh?!1:this.n_unique/this.size()>this.digest_ratio?(this.mode="cont",this.discrete=!1,this.delta=this.config.delta||.01,this.compress(),!0):!1};Ts.exports={TDigest:P,Digest:Z}});function $i(r){var e=this.constructor;return this.then(function(t){return e.resolve(r()).then(function(){return t})},function(t){return e.resolve(r()).then(function(){return e.reject(t)})})}var Hr=$i;function Ui(r){var e=this;return new e(function(t,s){if(!(r&&typeof r.length<"u"))return s(new TypeError(typeof r+" "+r+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var i=Array.prototype.slice.call(r);if(i.length===0)return t([]);var n=i.length;function o(u,p){if(p&&(typeof p=="object"||typeof p=="function")){var g=p.then;if(typeof g=="function"){g.call(p,function(E){o(u,E)},function(E){i[u]={status:"rejected",reason:E},--n===0&&t(i)});return}}i[u]={status:"fulfilled",value:p},--n===0&&t(i)}for(var c=0;c<i.length;c++)o(c,i[c])})}var jr=Ui;function Vr(r,e){this.name="AggregateError",this.errors=r,this.message=e||""}Vr.prototype=Error.prototype;function Wi(r){var e=this;return new e(function(t,s){if(!(r&&typeof r.length<"u"))return s(new TypeError("Promise.any accepts an array"));var i=Array.prototype.slice.call(r);if(i.length===0)return s();for(var n=[],o=0;o<i.length;o++)try{e.resolve(i[o]).then(t).catch(function(c){n.push(c),n.length===i.length&&s(new Vr(n,"All promises were rejected"))})}catch(c){s(c)}})}var $r=Wi;var Ki=setTimeout;function Ur(r){return!!(r&&typeof r.length<"u")}function zi(){}function Ji(r,e){return function(){r.apply(e,arguments)}}function N(r){if(!(this instanceof N))throw new TypeError("Promises must be constructed via new");if(typeof r!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],Kr(r,this)}function Wr(r,e){for(;r._state===3;)r=r._value;if(r._state===0){r._deferreds.push(e);return}r._handled=!0,N._immediateFn(function(){var t=r._state===1?e.onFulfilled:e.onRejected;if(t===null){(r._state===1?Et:Se)(e.promise,r._value);return}var s;try{s=t(r._value)}catch(i){Se(e.promise,i);return}Et(e.promise,s)})}function Et(r,e){try{if(e===r)throw new TypeError("A promise cannot be resolved with itself.");if(e&&(typeof e=="object"||typeof e=="function")){var t=e.then;if(e instanceof N){r._state=3,r._value=e,St(r);return}else if(typeof t=="function"){Kr(Ji(t,e),r);return}}r._state=1,r._value=e,St(r)}catch(s){Se(r,s)}}function Se(r,e){r._state=2,r._value=e,St(r)}function St(r){r._state===2&&r._deferreds.length===0&&N._immediateFn(function(){r._handled||N._unhandledRejectionFn(r._value)});for(var e=0,t=r._deferreds.length;e<t;e++)Wr(r,r._deferreds[e]);r._deferreds=null}function Xi(r,e,t){this.onFulfilled=typeof r=="function"?r:null,this.onRejected=typeof e=="function"?e:null,this.promise=t}function Kr(r,e){var t=!1;try{r(function(s){t||(t=!0,Et(e,s))},function(s){t||(t=!0,Se(e,s))})}catch(s){if(t)return;t=!0,Se(e,s)}}N.prototype.catch=function(r){return this.then(null,r)};N.prototype.then=function(r,e){var t=new this.constructor(zi);return Wr(this,new Xi(r,e,t)),t};N.prototype.finally=Hr;N.all=function(r){return new N(function(e,t){if(!Ur(r))return t(new TypeError("Promise.all accepts an array"));var s=Array.prototype.slice.call(r);if(s.length===0)return e([]);var i=s.length;function n(c,u){try{if(u&&(typeof u=="object"||typeof u=="function")){var p=u.then;if(typeof p=="function"){p.call(u,function(g){n(c,g)},t);return}}s[c]=u,--i===0&&e(s)}catch(g){t(g)}}for(var o=0;o<s.length;o++)n(o,s[o])})};N.any=$r;N.allSettled=jr;N.resolve=function(r){return r&&typeof r=="object"&&r.constructor===N?r:new N(function(e){e(r)})};N.reject=function(r){return new N(function(e,t){t(r)})};N.race=function(r){return new N(function(e,t){if(!Ur(r))return t(new TypeError("Promise.race accepts an array"));for(var s=0,i=r.length;s<i;s++)N.resolve(r[s]).then(e,t)})};N._immediateFn=typeof setImmediate=="function"&&function(r){setImmediate(r)}||function(r){Ki(r,0)};N._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var K=N;var Gi="[Filtered]",zr=128;function Xr(r,e){var t=e===void 0?{}:e,s=t.maxLength,i=s===void 0?64e3:s,n=t.keysBlocklist,o=n===void 0?[]:n;if(r.errors)for(var c=0;c<r.errors.length;c++){var u=new Gr({keysBlocklist:o});r.errors[c]=u.truncate(r.errors[c])}for(var p="",g=["context","params","environment","session"],E=0;E<8;E++){for(var m={level:E,keysBlocklist:o},y=0,S=g;y<S.length;y++){var T=S[y],L=r[T];L&&(r[T]=Qi(L,m))}if(p=JSON.stringify(r),p.length<i)return p}var O={json:p.slice(0,Math.floor(i/2))+"..."};g.push("errors");for(var d=0,w=g;d<w.length;d++){var T=w[d],L=r[T];L&&(p=JSON.stringify(L),O[T]=p.length)}var l=new Error("airbrake: notice exceeds max length and can't be truncated");throw l.params=O,l}function Ie(r,e){return r>>e||1}var Gr=(function(){function r(e){this.maxStringLength=1024,this.maxObjectLength=zr,this.maxArrayLength=zr,this.maxDepth=8,this.keys=[],this.keysBlocklist=[],this.seen=[];var t=e.level||0;this.keysBlocklist=e.keysBlocklist||[],this.maxStringLength=Ie(this.maxStringLength,t),this.maxObjectLength=Ie(this.maxObjectLength,t),this.maxArrayLength=Ie(this.maxArrayLength,t),this.maxDepth=Ie(this.maxDepth,t)}return r.prototype.truncate=function(e,t,s){if(t===void 0&&(t=""),s===void 0&&(s=0),e==null)return e;switch(typeof e){case"boolean":case"number":case"function":return e;case"string":return this.truncateString(e);case"object":break;default:return this.truncateString(String(e))}if(e instanceof String)return this.truncateString(e.toString());if(e instanceof Boolean||e instanceof Number||e instanceof Date||e instanceof RegExp)return e;if(e instanceof Error)return this.truncateString(e.toString());if(this.seen.indexOf(e)>=0)return"[Circular "+this.getPath(e)+"]";var i=Yi(e);if(s++,s>this.maxDepth)return"[Truncated "+i+"]";switch(this.keys.push(t),this.seen.push(e),i){case"Array":return this.truncateArray(e,s);case"Object":return this.truncateObject(e,s);default:var n=this.maxDepth;this.maxDepth=0;var o=this.truncateObject(e,s);return o.__type=i,this.maxDepth=n,o}},r.prototype.getPath=function(e){for(var t=this.seen.indexOf(e),s=[this.keys[t]],i=t;i>=0;i--){var n=this.seen[i];n&&Jr(n,s[0])===e&&(e=n,s.unshift(this.keys[i]))}return"~"+s.join(".")},r.prototype.truncateString=function(e){return e.length>this.maxStringLength?e.slice(0,this.maxStringLength)+"...":e},r.prototype.truncateArray=function(e,t){t===void 0&&(t=0);for(var s=0,i=[],n=0;n<e.length;n++){var o=e[n];if(i.push(this.truncate(o,n.toString(),t)),s++,s>=this.maxArrayLength)break}return i},r.prototype.truncateObject=function(e,t){t===void 0&&(t=0);var s=0,i={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(Zi(n,this.keysBlocklist)){i[n]=Gi;continue}var o=Jr(e,n);if(!(o===void 0||typeof o=="function")&&(i[n]=this.truncate(o,n,t),s++,s>=this.maxObjectLength))break}return i},r})();function Qi(r,e){e===void 0&&(e={});var t=new Gr(e);return t.truncate(r)}function Jr(r,e){try{return r[e]}catch{return}}function Yi(r){var e=Object.prototype.toString.apply(r);return e.slice(8,-1)}function Zi(r,e){for(var t=0,s=e;t<s.length;t++){var i=s[t];if(i===r||i instanceof RegExp&&r.match(i))return!0}return!1}var en=(function(){function r(e,t,s){this._dur=0,this._level=0,this._metric=e,this.name=t,this.startTime=s||new Date}return r.prototype.end=function(e){this.endTime=e||new Date,this._dur+=this.endTime.getTime()-this.startTime.getTime(),this._metric._incGroup(this.name,this._dur),this._metric=null},r.prototype._pause=function(){if(!this._paused()){var e=new Date;this._dur+=e.getTime()-this.startTime.getTime(),this.startTime=null}},r.prototype._resume=function(){this._paused()&&(this.startTime=new Date)},r.prototype._paused=function(){return this.startTime==null},r})();var De=(function(){function r(){this._spans={},this._groups={},this.startTime=new Date}return r.prototype.end=function(e){this.endTime||(this.endTime=e||new Date)},r.prototype.isRecording=function(){return!0},r.prototype.startSpan=function(e,t){var s=this._spans[e];s?s._level++:(s=new en(this,e,t),this._spans[e]=s)},r.prototype.endSpan=function(e,t){var s=this._spans[e];if(!s){console.error("airbrake: span=%s does not exist",e);return}s._level>0?s._level--:(s.end(t),delete this._spans[s.name])},r.prototype._incGroup=function(e,t){this._groups[e]=(this._groups[e]||0)+t},r.prototype._duration=function(){return this.endTime||(this.endTime=new Date),this.endTime.getTime()-this.startTime.getTime()},r})();var Qr=(function(){function r(){}return r.prototype.isRecording=function(){return!1},r.prototype.startSpan=function(e,t){},r.prototype.endSpan=function(e,t){},r.prototype._incGroup=function(e,t){},r})();var he=function(){return he=Object.assign||function(r){for(var e,t=1,s=arguments.length;t<s;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},he.apply(this,arguments)},At=(function(){function r(){this._noopMetric=new Qr,this._context={},this._historyMaxLen=20,this._history=[]}return r.prototype.clone=function(){var e=new r;return e._context=he({},this._context),e._history=this._history.slice(),e},r.prototype.setContext=function(e){this._context=he(he({},this._context),e)},r.prototype.context=function(){var e=he({},this._context);return this._history.length>0&&(e.history=this._history.slice()),e},r.prototype.pushHistory=function(e){if(this._isDupState(e)){this._lastRecord.num?this._lastRecord.num++:this._lastRecord.num=2;return}e.date||(e.date=new Date),this._history.push(e),this._lastRecord=e,this._history.length>this._historyMaxLen&&(this._history=this._history.slice(-this._historyMaxLen))},r.prototype._isDupState=function(e){if(!this._lastRecord)return!1;for(var t in e)if(!(!e.hasOwnProperty(t)||t==="date")&&e[t]!==this._lastRecord[t])return!1;return!0},r.prototype.routeMetric=function(){return this._routeMetric||this._noopMetric},r.prototype.setRouteMetric=function(e){this._routeMetric=e},r.prototype.queueMetric=function(){return this._queueMetric||this._noopMetric},r.prototype.setQueueMetric=function(e){this._queueMetric=e},r})();var ss=qr(ts()),tn=typeof console=="object"&&console.warn;function rs(r){try{return ss.default.parse(r)}catch(e){tn&&r.stack&&console.warn("ErrorStackParser:",e.toString(),r.stack)}return r.fileName?[r]:[]}function is(r){var e=[];if(r.noStack)e.push({function:r.functionName||"",file:r.fileName||"",line:r.lineNumber||0,column:r.columnNumber||0});else{var t=rs(r);if(t.length===0)try{throw new Error("fake")}catch(u){t=rs(u),t.shift(),t.shift()}for(var s=0,i=t;s<i.length;s++){var n=i[s];e.push({function:n.functionName||"",file:n.fileName||"",line:n.lineNumber||0,column:n.columnNumber||0})}}var o=r.name?r.name:"",c=r.message?String(r.message):String(r);return{type:o,message:c,backtrace:e}}var rn=new RegExp(["^","\\[(\\$.+)\\]","\\s","([\\s\\S]+)","$"].join(""));function ns(r){var e=r.errors[0];if(e.type!==""&&e.type!=="Error")return r;var t=e.message.match(rn);return t!==null&&(e.type=t[1],e.message=t[2]),r}function os(){var r,e;return function(t){var s=JSON.stringify(t.errors);return s===r?null:(e&&clearTimeout(e),r=s,e=setTimeout(function(){r=""},1e3),t)}}var sn=["Script error","Script error.","InvalidAccessError"];function as(r){var e=r.errors[0];if(e.type===""&&sn.indexOf(e.message)!==-1)return null;if(e.backtrace&&e.backtrace.length>0){var t=e.backtrace[0];if(t.file==="<anonymous>")return null}return r}var nn=new RegExp(["^","Uncaught\\s","(.+?)",":\\s","(.+)","$"].join(""));function cs(r){var e=r.errors[0];if(e.type!==""&&e.type!=="Error")return r;var t=e.message.match(nn);return t!==null&&(e.type=t[1],e.message=t[2]),r}var ds=qr(hs());var z={unauthorized:new Error("airbrake: unauthorized: project id or key are wrong"),ipRateLimited:new Error("airbrake: IP is rate limited")};var ls=0;function fs(r){var e=Date.now()/1e3;if(e<ls)return K.reject(z.ipRateLimited);var t={method:r.method,body:r.body};return(0,ds.default)(r.url,t).then(function(s){if(s.status===401)throw z.unauthorized;if(s.status===429){var i=s.headers.get("X-RateLimit-Delay");if(!i)throw z.ipRateLimited;var n=parseInt(i,10);throw n>0&&(ls=Date.now()/1e3+n),z.ipRateLimited}if(s.status===204)return{json:null};if(s.status===404)throw new Error("404 Not Found");return s.status>=200&&s.status<300?s.json().then(function(o){return{json:o}}):s.status>=400&&s.status<500?s.json().then(function(o){var c=new Error(o.message);throw c}):s.text().then(function(o){var c=new Error("airbrake: fetch: unexpected response: code="+s.status+" body='"+o+"'");throw c})})}function ms(r){return function(e){return on(e,r)}}var ps=0;function on(r,e){var t=Date.now()/1e3;return t<ps?K.reject(z.ipRateLimited):new K(function(s,i){e({url:r.url,method:r.method,body:r.body,headers:{"content-type":"application/json"},timeout:r.timeout},function(n,o,c){if(n){i(n);return}if(!o.statusCode){n=new Error("airbrake: request: response statusCode is "+o.statusCode),i(n);return}if(o.statusCode===401){i(z.unauthorized);return}if(o.statusCode===429){i(z.ipRateLimited);var u=o.headers["x-ratelimit-delay"];if(!u)return;var p=void 0;if(typeof u=="string")p=u;else if(u instanceof Array)p=u[0];else return;var g=parseInt(p,10);g>0&&(ps=Date.now()/1e3+g);return}if(o.statusCode===204){s({json:null});return}if(o.statusCode>=200&&o.statusCode<300){var E=void 0;try{E=JSON.parse(c)}catch(m){i(m);return}s(E);return}if(o.statusCode>=400&&o.statusCode<500){var E=void 0;try{E=JSON.parse(c)}catch(y){i(y);return}n=new Error(E.message),i(n);return}c=c.trim(),n=new Error("airbrake: node: unexpected response: code="+o.statusCode+" body='"+c+"'"),i(n)})})}function J(r){return r.request?ms(r.request):fs}var dn=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,i){s.__proto__=i}||function(s,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(s[n]=i[n])},r(e,t)};return function(e,t){r(e,t);function s(){this.constructor=e}e.prototype=t===null?Object.create(t):(s.prototype=t.prototype,new s)}})(),Ls,ee=!1;try{Ls=Os(),ee=!0}catch{}var pe=(function(){function r(){this.count=0,this.sum=0,this.sumsq=0,this._td=new Ls.Digest}return r.prototype.add=function(e){e===0&&(e=1e-5),this.count+=1,this.sum+=e,this.sumsq+=e*e,this._td&&this._td.push(e)},r.prototype.toJSON=function(){return{count:this.count,sum:this.sum,sumsq:this.sumsq,tdigestCentroids:Rs(this._td)}},r})();var $e=(function(r){dn(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.groups={},t}return e.prototype.addGroups=function(t,s){this.add(t);for(var i in s)s.hasOwnProperty(i)&&this.addGroup(i,s[i])},e.prototype.addGroup=function(t,s){var i=this.groups[t];i||(i=new pe,this.groups[t]=i),i.add(s)},e.prototype.toJSON=function(){return{count:this.count,sum:this.sum,sumsq:this.sumsq,tdigestCentroids:Rs(this._td),groups:this.groups}},e})(pe);function Rs(r){var e=[],t=[];return r.centroids.each(function(s){e.push(s.mean),t.push(s.n)}),{mean:e,count:t}}var Ue=function(){return Ue=Object.assign||function(r){for(var e,t=1,s=arguments.length;t<s;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},Ue.apply(this,arguments)},fn=15e3,Ms=(function(){function r(e){e===void 0&&(e=""),this.method="",this.route="",this.query="",this.func="",this.file="",this.line=0,this.startTime=new Date,this.query=e}return r.prototype._duration=function(){return this.endTime||(this.endTime=new Date),this.endTime.getTime()-this.startTime.getTime()},r})();var ks=(function(){function r(e){this._m={},this._opt=e,this._url=e.host+"/api/v5/projects/"+e.projectId+"/queries-stats?key="+e.projectKey,this._requester=J(e)}return r.prototype.start=function(e){return e===void 0&&(e=""),new Ms(e)},r.prototype.notify=function(e){var t=this;if(ee){var s=e._duration(),i=60*1e3,n=new Date(Math.floor(e.startTime.getTime()/i)*i),o={method:e.method,route:e.route,query:e.query,func:e.func,file:e.file,line:e.line,time:n},c=JSON.stringify(o),u=this._m[c];u||(u=new pe,this._m[c]=u),u.add(s),!this._timer&&(this._timer=setTimeout(function(){t._flush()},fn))}},r.prototype._flush=function(){var e=[];for(var t in this._m)if(this._m.hasOwnProperty(t)){var s=JSON.parse(t),i=Ue(Ue({},s),this._m[t].toJSON());e.push(i)}this._m={},this._timer=null;var n=JSON.stringify({environment:this._opt.environment,queries:e}),o={method:"POST",url:this._url,body:n};this._requester(o).then(function(c){}).catch(function(c){console.error&&console.error("can not report queries stats",c)})},r})();var pn=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,i){s.__proto__=i}||function(s,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(s[n]=i[n])},r(e,t)};return function(e,t){r(e,t);function s(){this.constructor=e}e.prototype=t===null?Object.create(t):(s.prototype=t.prototype,new s)}})(),We=function(){return We=Object.assign||function(r){for(var e,t=1,s=arguments.length;t<s;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},We.apply(this,arguments)},mn=15e3,Cs=(function(r){pn(e,r);function e(t){var s=r.call(this)||this;return s.queue=t,s.startTime=new Date,s}return e})(De);var Ps=(function(){function r(e){this._m={},this._opt=e,this._url=e.host+"/api/v5/projects/"+e.projectId+"/queues-stats?key="+e.projectKey,this._requester=J(e)}return r.prototype.notify=function(e){var t=this;if(ee){var s=e._duration();s===0&&(s=1e-5);var i=60*1e3,n=new Date(Math.floor(e.startTime.getTime()/i)*i),o={queue:e.queue,time:n},c=JSON.stringify(o),u=this._m[c];u||(u=new $e,this._m[c]=u),u.addGroups(s,e._groups),!this._timer&&(this._timer=setTimeout(function(){t._flush()},mn))}},r.prototype._flush=function(){var e=[];for(var t in this._m)if(this._m.hasOwnProperty(t)){var s=JSON.parse(t),i=We(We({},s),this._m[t].toJSON());e.push(i)}this._m={},this._timer=null;var n=JSON.stringify({environment:this._opt.environment,queues:e}),o={method:"POST",url:this._url,body:n};this._requester(o).then(function(c){}).catch(function(c){console.error&&console.error("can not report queues breakdowns",c)})},r})();var gn=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,i){s.__proto__=i}||function(s,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(s[n]=i[n])},r(e,t)};return function(e,t){r(e,t);function s(){this.constructor=e}e.prototype=t===null?Object.create(t):(s.prototype=t.prototype,new s)}})(),me=function(){return me=Object.assign||function(r){for(var e,t=1,s=arguments.length;t<s;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},me.apply(this,arguments)},Fs=15e3,Ns=(function(r){gn(e,r);function e(t,s,i,n){t===void 0&&(t=""),s===void 0&&(s=""),i===void 0&&(i=0),n===void 0&&(n="");var o=r.call(this)||this;return o.method=t,o.route=s,o.statusCode=i,o.contentType=n,o.startTime=new Date,o}return e})(De);var xs=(function(){function r(e){this._m={},this._opt=e,this._url=e.host+"/api/v5/projects/"+e.projectId+"/routes-stats?key="+e.projectKey,this._requester=J(e)}return r.prototype.notify=function(e){var t=this;if(ee){var s=e._duration(),i=60*1e3,n=new Date(Math.floor(e.startTime.getTime()/i)*i),o={method:e.method,route:e.route,statusCode:e.statusCode,time:n},c=JSON.stringify(o),u=this._m[c];u||(u=new pe,this._m[c]=u),u.add(s),!this._timer&&(this._timer=setTimeout(function(){t._flush()},Fs))}},r.prototype._flush=function(){var e=[];for(var t in this._m)if(this._m.hasOwnProperty(t)){var s=JSON.parse(t),i=me(me({},s),this._m[t].toJSON());e.push(i)}this._m={},this._timer=null;var n=JSON.stringify({environment:this._opt.environment,routes:e}),o={method:"POST",url:this._url,body:n};this._requester(o).then(function(c){}).catch(function(c){console.error&&console.error("can not report routes stats",c)})},r})();var Bs=(function(){function r(e){this._m={},this._opt=e,this._url=e.host+"/api/v5/projects/"+e.projectId+"/routes-breakdowns?key="+e.projectKey,this._requester=J(e)}return r.prototype.notify=function(e){var t=this;if(ee&&!(e.statusCode<200||e.statusCode>=300&&e.statusCode<400||e.statusCode===404||Object.keys(e._groups).length===0)){var s=e._duration();s===0&&(s=1e-5);var i=60*1e3,n=new Date(Math.floor(e.startTime.getTime()/i)*i),o={method:e.method,route:e.route,responseType:this._responseType(e),time:n},c=JSON.stringify(o),u=this._m[c];u||(u=new $e,this._m[c]=u),u.addGroups(s,e._groups),!this._timer&&(this._timer=setTimeout(function(){t._flush()},Fs))}},r.prototype._flush=function(){var e=[];for(var t in this._m)if(this._m.hasOwnProperty(t)){var s=JSON.parse(t),i=me(me({},s),this._m[t].toJSON());e.push(i)}this._m={},this._timer=null;var n=JSON.stringify({environment:this._opt.environment,routes:e}),o={method:"POST",url:this._url,body:n};this._requester(o).then(function(c){}).catch(function(c){console.error&&console.error("can not report routes breakdowns",c)})},r.prototype._responseType=function(e){return e.statusCode>=500?"5xx":e.statusCode>=400?"4xx":e.contentType?e.contentType.split(";")[0].split("/")[-1]:""},r})();var Is="airbrake-js/browser",Ds="1.4.2",qs="https://github.com/airbrake/airbrake-js/tree/master/packages/browser";var Ke=function(){return Ke=Object.assign||function(r){for(var e,t=1,s=arguments.length;t<s;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},Ke.apply(this,arguments)},Lt=(function(){function r(e){var t=this;if(this._filters=[],this._performanceFilters=[],this._scope=new At,this._onClose=[],!e.projectId||!e.projectKey)throw new Error("airbrake: projectId and projectKey are required");this._opt=e,this._opt.host=this._opt.host||"https://api.airbrake.io",this._opt.timeout=this._opt.timeout||1e4,this._opt.keysBlocklist=this._opt.keysBlocklist||this._opt.keysBlacklist||[/password/,/secret/],this._url=this._opt.host+"/api/v3/projects/"+this._opt.projectId+"/notices?key="+this._opt.projectKey,this._processor=this._opt.processor||is,this._requester=J(this._opt),this.addFilter(as),this.addFilter(os()),this.addFilter(cs),this.addFilter(ns),this.addFilter(function(s){return s.context.notifier={name:Is,version:Ds,url:qs},t._opt.environment&&(s.context.environment=t._opt.environment),s}),this.routes=new vn(this),this.queues=new bn(this),this.queries=new ks(this._opt)}return r.prototype.close=function(){for(var e=0,t=this._onClose;e<t.length;e++){var s=t[e];s()}},r.prototype.scope=function(){return this._scope},r.prototype.setActiveScope=function(e){this._scope=e},r.prototype.addFilter=function(e){this._filters.push(e)},r.prototype.addPerformanceFilter=function(e){this._performanceFilters.push(e)},r.prototype.notify=function(e){var t={errors:[],context:Ke(Ke({severity:"error"},this.scope().context()),e.context),params:e.params||{},environment:e.environment||{},session:e.session||{}};if((typeof e!="object"||e.error===void 0)&&(e={error:e}),!e.error)return t.error=new Error("airbrake: got err="+JSON.stringify(e.error)+", wanted an Error"),K.resolve(t);var s=this._processor(e.error);t.errors.push(s);for(var i=0,n=this._filters;i<n.length;i++){var o=n[i],c=o(t);if(c===null)return t.error=new Error("airbrake: error is filtered"),K.resolve(t);t=c}return t.context||(t.context={}),t.context.language="JavaScript",this._sendNotice(t)},r.prototype._sendNotice=function(e){var t=Xr(e,{keysBlocklist:this._opt.keysBlocklist});if(this._opt.reporter){if(typeof this._opt.reporter=="function")return this._opt.reporter(e);console.warn("airbrake: options.reporter must be a function")}var s={method:"POST",url:this._url,body:t};return this._requester(s).then(function(i){return e.id=i.json.id,e.url=i.json.url,e}).catch(function(i){return e.error=i,e})},r.prototype.wrap=function(e,t){if(t===void 0&&(t=[]),e._airbrake)return e;var s=this,i=function(){var u=Array.prototype.slice.call(arguments),p=s._wrapArguments(u);try{return e.apply(this,p)}catch(g){throw s.notify({error:g,params:{arguments:u}}),this._ignoreNextWindowError(),g}};for(var n in e)e.hasOwnProperty(n)&&(i[n]=e[n]);for(var o=0,c=t;o<c.length;o++){var n=c[o];e.hasOwnProperty(n)&&(i[n]=e[n])}return i._airbrake=!0,i.inner=e,i},r.prototype._wrapArguments=function(e){for(var t=0;t<e.length;t++){var s=e[t];typeof s=="function"&&(e[t]=this.wrap(s))}return e},r.prototype._ignoreNextWindowError=function(){},r.prototype.call=function(e){for(var t=[],s=1;s<arguments.length;s++)t[s-1]=arguments[s];var i=this.wrap(e);return i.apply(this,Array.prototype.slice.call(arguments,1))},r})();var vn=(function(){function r(e){this._notifier=e,this._routes=new xs(e._opt),this._breakdowns=new Bs(e._opt)}return r.prototype.start=function(e,t,s,i){e===void 0&&(e=""),t===void 0&&(t=""),s===void 0&&(s=0),i===void 0&&(i="");var n=new Ns(e,t,s,i),o=this._notifier.scope().clone();return o.setContext({httpMethod:e,route:t}),o.setRouteMetric(n),this._notifier.setActiveScope(o),n},r.prototype.notify=function(e){e.end();for(var t=0,s=this._notifier._performanceFilters;t<s.length;t++){var i=s[t];if(i(e)===null)return}this._routes.notify(e),this._breakdowns.notify(e)},r})(),bn=(function(){function r(e){this._notifier=e,this._queues=new Ps(e._opt)}return r.prototype.start=function(e){var t=new Cs(e),s=this._notifier.scope().clone();return s.setContext({queue:e}),s.setQueueMetric(t),this._notifier.setActiveScope(s),t},r.prototype.notify=function(e){e.end(),this._queues.notify(e)},r})();function Hs(r){return window.navigator&&window.navigator.userAgent&&(r.context.userAgent=window.navigator.userAgent),window.location&&(r.context.url=String(window.location),r.context.rootDirectory=window.location.protocol+"//"+window.location.host),r}var yn=["debug","log","info","warn","error"];function js(r){for(var e=function(n){if(!(n in console))return"continue";var o=console[n],c=(function(){for(var u=[],p=0;p<arguments.length;p++)u[p]=arguments[p];o.apply(console,u),r.scope().pushHistory({type:"log",severity:n,arguments:u})});c.inner=o,console[n]=c},t=0,s=yn;t<s.length;t++){var i=s[t];e(i)}}var wn=["type","name","src"];function Vs(r){var e=En(r);window.addEventListener&&(window.addEventListener("load",e),window.addEventListener("error",function(t){$s(t,"error")||e(t)},!0)),typeof document=="object"&&document.addEventListener&&(document.addEventListener("DOMContentLoaded",e),document.addEventListener("click",e),document.addEventListener("keypress",e))}function En(r){return function(e){var t=$s(e,"target");if(t){var s={type:e.type};try{s.target=_n(t)}catch(i){s.target="<"+String(i)+">"}r.scope().pushHistory(s)}}}function Sn(r){if(!r)return"";var e=[];if(r.tagName&&e.push(r.tagName.toLowerCase()),r.id&&(e.push("#"),e.push(r.id)),r.classList&&Array.from)e.push("."),e.push(Array.from(r.classList).join("."));else if(r.className){var t=An(r.className);t!==""&&(e.push("."),e.push(t))}if(r.getAttribute)for(var s=0,i=wn;s<i.length;s++){var n=i[s],o=r.getAttribute(n);o&&e.push("["+n+'="'+o+'"]')}return e.join("")}function An(r){return r.split?r.split(" ").join("."):r.baseVal&&r.baseVal.split?r.baseVal.split(" ").join("."):(console.error("unsupported HTMLElement.className type",typeof r),"")}function _n(r){for(var e=10,t=[],s=r;s;){var i=Sn(s);if(i!==""&&(t.push(i),t.length>e))break;s=s.parentNode}return t.length===0?String(r):t.reverse().join(" > ")}function $s(r,e){try{return r[e]}catch{return null}}function Us(r){var e=window.fetch;window.fetch=function(t,s){var i={type:"xhr",date:new Date};return i.method=s&&s.method?s.method:"GET",typeof t=="string"?i.url=t:(i.method=t.method,i.url=t.url),r._ignoreNextXHR++,setTimeout(function(){return r._ignoreNextXHR--}),e.apply(this,arguments).then(function(n){return i.statusCode=n.status,i.duration=new Date().getTime()-i.date.getTime(),r.scope().pushHistory(i),n}).catch(function(n){throw i.error=n,i.duration=new Date().getTime()-i.date.getTime(),r.scope().pushHistory(i),n})}}var Rt="";function Ws(){return document.location&&document.location.pathname}function zs(r){Rt=Ws();var e=window.onpopstate;window.onpopstate=function(i){var n=Ws();if(n&&Ks(r,n),e)return e.apply(this,arguments)};var t=history.pushState;history.pushState=function(i,n,o){o&&Ks(r,o.toString()),t.apply(this,arguments)}}function Ks(r,e){var t=e.indexOf("://");t>=0?(e=e.slice(t+3),t=e.indexOf("/"),e=t>=0?e.slice(t):"/"):e.charAt(0)!=="/"&&(e="/"+e),r.scope().pushHistory({type:"location",from:Rt,to:e}),Rt=e}function Js(r){function e(i){var n=i.__state;n.statusCode=i.status,n.duration=new Date().getTime()-n.date.getTime(),r.scope().pushHistory(n)}var t=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(n,o,c,u,p){r._ignoreNextXHR===0&&(this.__state={type:"xhr",method:n,url:o}),t.apply(this,arguments)};var s=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.send=function(n){var o=this.onreadystatechange;return this.onreadystatechange=function(c){if(this.readyState===4&&this.__state&&e(this),o)return o.apply(this,arguments)},this.__state&&(this.__state.date=new Date),s.apply(this,arguments)}}var Tn=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,i){s.__proto__=i}||function(s,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(s[n]=i[n])},r(e,t)};return function(e,t){r(e,t);function s(){this.constructor=e}e.prototype=t===null?Object.create(t):(s.prototype=t.prototype,new s)}})(),ze=function(){return ze=Object.assign||function(r){for(var e,t=1,s=arguments.length;t<s;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},ze.apply(this,arguments)},Mt=(function(r){Tn(e,r);function e(t){var s=r.call(this,t)||this;return s.offline=!1,s.todo=[],s._ignoreWindowError=0,s._ignoreNextXHR=0,typeof window>"u"||(s.addFilter(Hs),window.addEventListener&&(s.onOnline=s.onOnline.bind(s),window.addEventListener("online",s.onOnline),s.onOffline=s.onOffline.bind(s),window.addEventListener("offline",s.onOffline),s.onUnhandledrejection=s.onUnhandledrejection.bind(s),window.addEventListener("unhandledrejection",s.onUnhandledrejection),s._onClose.push(function(){window.removeEventListener("online",s.onOnline),window.removeEventListener("offline",s.onOffline),window.removeEventListener("unhandledrejection",s.onUnhandledrejection)})),s._opt.ignoreWindowError&&(t.instrumentation.onerror=!1),s._instrument(t.instrumentation)),s}return e.prototype._instrument=function(t){if(t===void 0&&(t={}),t.console===void 0&&(t.console=!On(this._opt.environment)),Te(t.onerror)){var s=this,i=window.onerror;window.onerror=function(){i&&i.apply(this,arguments),s.onerror.apply(s,arguments)}}Vs(this),Te(t.fetch)&&typeof fetch=="function"&&Us(this),Te(t.history)&&typeof history=="object"&&zs(this),Te(t.console)&&typeof console=="object"&&js(this),Te(t.xhr)&&typeof XMLHttpRequest<"u"&&Js(this)},e.prototype.notify=function(t){var s=this;return this.offline?new K(function(i,n){for(s.todo.push({err:t,resolve:i,reject:n});s.todo.length>100;){var o=s.todo.shift();if(o===void 0)break;o.resolve({error:new Error("airbrake: offline queue is too large")})}}):r.prototype.notify.call(this,t)},e.prototype.onOnline=function(){this.offline=!1;for(var t=function(c){s.notify(c.err).then(function(u){c.resolve(u)})},s=this,i=0,n=this.todo;i<n.length;i++){var o=n[i];t(o)}this.todo=[]},e.prototype.onOffline=function(){this.offline=!0},e.prototype.onUnhandledrejection=function(t){var s=t.reason||t.detail&&t.detail.reason;if(s){var i=s.message||String(s);if(!(i.indexOf&&i.indexOf("airbrake: ")===0)){if(typeof s!="object"||s.error===void 0){this.notify({error:s,context:{unhandledRejection:!0}});return}this.notify(ze(ze({},s),{context:{unhandledRejection:!0}}))}}},e.prototype.onerror=function(t,s,i,n,o){if(!(this._ignoreWindowError>0)){if(o){this.notify({error:o,context:{windowError:!0}});return}!s||!i||this.notify({error:{message:t,fileName:s,lineNumber:i,columnNumber:n,noStack:!0},context:{windowError:!0}})}},e.prototype._ignoreNextWindowError=function(){var t=this;this._ignoreWindowError++,setTimeout(function(){return t._ignoreWindowError--})},e})(Lt);function On(r){return r&&r.startsWith&&r.startsWith("dev")}function Te(r){return r===void 0||r===!0}(function(r){if(typeof r.requestSubmit=="function")return;r.requestSubmit=function(s){s?(e(s,this),s.click()):(s=document.createElement("input"),s.type="submit",s.hidden=!0,this.appendChild(s),s.click(),this.removeChild(s))};function e(s,i){s instanceof HTMLElement||t(TypeError,"parameter 1 is not of type 'HTMLElement'"),s.type=="submit"||t(TypeError,"The specified element is not a submit button"),s.form==i||t(DOMException,"The specified element is not owned by this form element","NotFoundError")}function t(s,i,n){throw new s("Failed to execute 'requestSubmit' on 'HTMLFormElement': "+i+".",n)}})(HTMLFormElement.prototype);var ri=new WeakMap;function Ln(r){let e=r instanceof Element?r:r instanceof Node?r.parentElement:null,t=e?e.closest("input, button"):null;return t?.type=="submit"?t:null}function Rn(r){let e=Ln(r.target);e&&e.form&&ri.set(e.form,e)}(function(){if("submitter"in Event.prototype)return;let r=window.Event.prototype;if("SubmitEvent"in window){let e=window.SubmitEvent.prototype;if(/Apple Computer/.test(navigator.vendor)&&!("submitter"in e))r=e;else return}addEventListener("click",Rn,!0),Object.defineProperty(r,"submitter",{get(){if(this.type=="submit"&&this.target instanceof HTMLFormElement)return ri.get(this.target)}})})();var ve={eager:"eager",lazy:"lazy"},W=class r extends HTMLElement{static delegateConstructor=void 0;loaded=Promise.resolve();static get observedAttributes(){return["disabled","loading","src"]}constructor(){super(),this.delegate=new r.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 Mn(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 Mn(r){return r.toLowerCase()==="lazy"?ve.lazy:ve.eager}var kn={enabled:!0,progressBarDelay:500,unvisitableExtensions:new Set([".7z",".aac",".apk",".avi",".bmp",".bz2",".css",".csv",".deb",".dmg",".doc",".docx",".exe",".gif",".gz",".heic",".heif",".ico",".iso",".jpeg",".jpg",".js",".json",".m4a",".mkv",".mov",".mp3",".mp4",".mpeg",".mpg",".msi",".ogg",".ogv",".pdf",".pkg",".png",".ppt",".pptx",".rar",".rtf",".svg",".tar",".tif",".tiff",".txt",".wav",".webm",".webp",".wma",".wmv",".xls",".xlsx",".xml",".zip"])};function Le(r){if(r.getAttribute("data-turbo-eval")=="false")return r;{let e=document.createElement("script"),t=ci();return t&&(e.nonce=t),e.textContent=r.textContent,e.async=!1,Cn(e,r),e}}function Cn(r,e){for(let{name:t,value:s}of e.attributes)r.setAttribute(t,s)}function Pn(r){let e=document.createElement("template");return e.innerHTML=r,e.content}function x(r,{target:e,cancelable:t,detail:s}={}){let i=new CustomEvent(r,{cancelable:t,bubbles:!0,composed:!0,detail:s});return e&&e.isConnected?e.dispatchEvent(i):document.documentElement.dispatchEvent(i),i}function Xs(r){r.preventDefault(),r.stopImmediatePropagation()}function Oe(){return document.visibilityState==="hidden"?ii():si()}function si(){return new Promise(r=>requestAnimationFrame(()=>r()))}function ii(){return new Promise(r=>setTimeout(()=>r(),0))}function Fn(){return Promise.resolve()}function ni(r=""){return new DOMParser().parseFromString(r,"text/html")}function oi(r,...e){let t=Nn(r,e).replace(/^\n/,"").split(`
|
|
12
|
+
`),s=t[0].match(/^\s+/),i=s?s[0].length:0;return t.map(n=>n.slice(i)).join(`
|
|
13
|
+
`)}function Nn(r,e){return r.reduce((t,s,i)=>{let n=e[i]==null?"":e[i];return t+s+n},"")}function re(){return Array.from({length:36}).map((r,e)=>e==8||e==13||e==18||e==23?"-":e==14?"4":e==19?(Math.floor(Math.random()*4)+8).toString(16):Math.floor(Math.random()*15).toString(16)).join("")}function Ge(r,...e){for(let t of e.map(s=>s?.getAttribute(r)))if(typeof t=="string")return t;return null}function xn(r,...e){return e.some(t=>t&&t.hasAttribute(r))}function Qe(...r){for(let e of r)e.localName=="turbo-frame"&&e.setAttribute("busy",""),e.setAttribute("aria-busy","true")}function Ye(...r){for(let e of r)e.localName=="turbo-frame"&&e.removeAttribute("busy"),e.removeAttribute("aria-busy")}function Bn(r,e=2e3){return new Promise(t=>{let s=()=>{r.removeEventListener("error",s),r.removeEventListener("load",s),t()};r.addEventListener("load",s,{once:!0}),r.addEventListener("error",s,{once:!0}),setTimeout(t,e)})}function ai(r){switch(r){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}function In(r){return r=="advance"||r=="replace"||r=="restore"}function ae(...r){let e=Ge("data-turbo-action",...r);return In(e)?e:null}function ar(r){return document.querySelector(`meta[name="${r}"]`)}function Ze(r){let e=ar(r);return e&&e.content}function ci(){let r=ar("csp-nonce");if(r){let{nonce:e,content:t}=r;return e==""?t:e}}function Dn(r,e){let t=ar(r);return t||(t=document.createElement("meta"),t.setAttribute("name",r),document.head.appendChild(t)),t.setAttribute("content",e),t}function ye(r,e){if(r instanceof Element)return r.closest(e)||ye(r.assignedSlot||r.getRootNode()?.host,e)}function cr(r){return!!r&&r.closest("[inert], :disabled, [hidden], details:not([open]), dialog:not([open])")==null&&typeof r.focus=="function"}function ui(r){return Array.from(r.querySelectorAll("[autofocus]")).find(cr)}async function qn(r,e){let t=e();r(),await si();let s=e();return[t,s]}function hi(r){if(r==="_blank")return!1;if(r){for(let e of document.getElementsByName(r))if(e instanceof HTMLIFrameElement)return!1;return!0}else return!0}function li(r){let e=ye(r,"a[href], a[xlink\\:href]");return!e||e.hasAttribute("download")||e.hasAttribute("target")&&e.target!=="_self"?null:e}function di(r){return q(r.getAttribute("href")||"")}function Hn(r,e){let t=null;return(...s)=>{let i=()=>r.apply(this,s);clearTimeout(t),t=setTimeout(i,e)}}var jn={"aria-disabled":{beforeSubmit:r=>{r.setAttribute("aria-disabled","true"),r.addEventListener("click",Xs)},afterSubmit:r=>{r.removeAttribute("aria-disabled"),r.removeEventListener("click",Xs)}},disabled:{beforeSubmit:r=>r.disabled=!0,afterSubmit:r=>r.disabled=!1}},kt=class{#e=null;constructor(e){Object.assign(this,e)}get submitter(){return this.#e}set submitter(e){this.#e=jn[e]||e}},Vn=new kt({mode:"on",submitter:"disabled"}),I={drive:kn,forms:Vn};function q(r){return new URL(r.toString(),document.baseURI)}function ce(r){let e;if(r.hash)return r.hash.slice(1);if(e=r.href.match(/#(.*)$/))return e[1]}function ur(r,e){let t=e?.getAttribute("formaction")||r.getAttribute("action")||r.action;return q(t)}function $n(r){return(Kn(r).match(/\.[^.]*$/)||[])[0]||""}function Un(r,e){let t=Gs(e.origin+e.pathname);return Gs(r.href)===t||r.href.startsWith(t)}function te(r,e){return Un(r,e)&&!I.drive.unvisitableExtensions.has($n(r))}function Ct(r){let e=ce(r);return e!=null?r.href.slice(0,-(e.length+1)):r.href}function Je(r){return Ct(r)}function fi(r,e){return q(r).href==q(e).href}function Wn(r){return r.pathname.split("/").slice(1)}function Kn(r){return Wn(r).slice(-1)[0]}function Gs(r){return r.endsWith("/")?r:r+"/"}var Re=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 q(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)}},Pt=class extends Set{constructor(e){super(),this.maxSize=e}add(e){if(this.size>=this.maxSize){let s=this.values().next().value;this.delete(s)}super.add(e)}},pi=new Pt(20);function mi(r,e={}){let t=new Headers(e.headers||{}),s=re();return pi.add(s),t.append("X-Turbo-Request-Id",s),window.fetch(r,{...e,headers:t})}function hr(r){switch(r.toLowerCase()){case"get":return j.get;case"post":return j.post;case"put":return j.put;case"patch":return j.patch;case"delete":return j.delete}}var j={get:"get",post:"post",put:"put",patch:"patch",delete:"delete"};function zn(r){switch(r.toLowerCase()){case oe.multipart:return oe.multipart;case oe.plain:return oe.plain;default:return oe.urlEncoded}}var oe={urlEncoded:"application/x-www-form-urlencoded",multipart:"multipart/form-data",plain:"text/plain"},ue=class{abortController=new AbortController;#e=e=>{};constructor(e,t,s,i=new URLSearchParams,n=null,o=oe.urlEncoded){let[c,u]=Qs(q(s),t,i,o);this.delegate=e,this.url=c,this.target=n,this.fetchOptions={credentials:"same-origin",redirect:"follow",method:t.toUpperCase(),headers:{...this.defaultHeaders},body:u,signal:this.abortSignal,referrer:this.delegate.referrer?.href},this.enctype=o}get method(){return this.fetchOptions.method}set method(e){let t=this.isSafe?this.url.searchParams:this.fetchOptions.body||new FormData,s=hr(e)||j.get;this.url.search="";let[i,n]=Qs(this.url,s,t,this.enctype);this.url=i,this.fetchOptions.body=n,this.fetchOptions.method=s.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),t.detail.fetchRequest?this.response=t.detail.fetchRequest.response:this.response=mi(this.url.href,e);let s=await this.response;return await this.receive(s)}catch(s){if(s.name!=="AbortError")throw this.#r(s)&&this.delegate.requestErrored(this,s),s}finally{this.delegate.requestFinished(this)}}async receive(e){let t=new Re(e);return x("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 lr(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(i=>this.#e=i),s=x("turbo:before-fetch-request",{cancelable:!0,detail:{fetchOptions:e,url:this.url,resume:this.#e},target:this.target});return this.url=s.detail.url,s.defaultPrevented&&await t,s}#r(e){return!x("turbo:fetch-request-error",{target:this.target,cancelable:!0,detail:{request:this,error:e}}).defaultPrevented}};function lr(r){return hr(r)==j.get}function Qs(r,e,t,s){let i=Array.from(t).length>0?new URLSearchParams(gi(t)):r.searchParams;return lr(e)?[Jn(r,i),null]:s==oe.urlEncoded?[r,i]:[r,t]}function gi(r){let e=[];for(let[t,s]of r)s instanceof File||e.push([t,s]);return e}function Jn(r,e){let t=new URLSearchParams(gi(e));return r.search=t.toString(),r}var Ft=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)}},se=class{static contentType="text/vnd.turbo-stream.html";static wrap(e){return typeof e=="string"?new this(Pn(e)):e}constructor(e){this.fragment=Xn(e)}};function Xn(r){for(let e of r.querySelectorAll("turbo-stream")){let t=document.importNode(e,!0);for(let s of t.templateElement.content.querySelectorAll("script"))s.replaceWith(Le(s));e.replaceWith(t)}return r}var Gn=100,Nt=class{#e=null;#t=null;get(e){if(this.#t&&this.#t.url===e&&this.#t.expire>Date.now())return this.#t.request}setLater(e,t,s){this.clear(),this.#e=setTimeout(()=>{t.perform(),this.set(e,t,s),this.#e=null},Gn)}set(e,t,s){this.#t={url:e,request:t,expire:new Date(new Date().getTime()+s)}}clear(){this.#e&&clearTimeout(this.#e),this.#t=null}},Qn=10*1e3,be=new Nt,ge={initialized:"initialized",requesting:"requesting",waiting:"waiting",receiving:"receiving",stopping:"stopping",stopped:"stopped"},et=class r{state=ge.initialized;static confirmMethod(e){return Promise.resolve(confirm(e))}constructor(e,t,s,i=!1){let n=so(t,s),o=ro(to(t,s),n),c=Yn(t,s),u=io(t,s);this.delegate=e,this.formElement=t,this.submitter=s,this.fetchRequest=new ue(this,n,o,c,t,u),this.mustRedirect=i}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=q(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:e,requesting:t}=ge,s=Ge("data-turbo-confirm",this.submitter,this.formElement);if(!(typeof s=="string"&&!await(typeof I.forms.confirm=="function"?I.forms.confirm:r.confirmMethod)(s,this.formElement,this.submitter))&&this.state==e)return this.state=t,this.fetchRequest.perform()}stop(){let{stopping:e,stopped:t}=ge;if(this.state!=e&&this.state!=t)return this.state=e,this.fetchRequest.cancel(),!0}prepareRequest(e){if(!e.isSafe){let t=Zn(Ze("csrf-param"))||Ze("csrf-token");t&&(e.headers["X-CSRF-Token"]=t)}this.requestAcceptsTurboStreamResponse(e)&&e.acceptResponseType(se.contentType)}requestStarted(e){this.state=ge.waiting,this.submitter&&I.forms.submitter.beforeSubmit(this.submitter),this.setSubmitsWith(),Qe(this.formElement),x("turbo:submit-start",{target:this.formElement,detail:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(e,t){be.clear(),this.result={success:t.succeeded,fetchResponse:t}}requestSucceededWithResponse(e,t){if(t.clientError||t.serverError){this.delegate.formSubmissionFailedWithResponse(this,t);return}if(be.clear(),this.requestMustRedirect(e)&&eo(t)){let s=new Error("Form responses must redirect to another location");this.delegate.formSubmissionErrored(this,s)}else this.state=ge.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=ge.stopped,this.submitter&&I.forms.submitter.afterSubmit(this.submitter),this.resetSubmitterText(),Ye(this.formElement),x("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||xn("data-turbo-stream",this.submitter,this.formElement)}get submitsWith(){return this.submitter?.getAttribute("data-turbo-submits-with")}};function Yn(r,e){let t=new FormData(r),s=e?.getAttribute("name"),i=e?.getAttribute("value");return s&&t.append(s,i||""),t}function Zn(r){if(r!=null){let t=(document.cookie?document.cookie.split("; "):[]).find(s=>s.startsWith(r));if(t){let s=t.split("=").slice(1).join("=");return s?decodeURIComponent(s):void 0}}}function eo(r){return r.statusCode==200&&!r.redirected}function to(r,e){let t=typeof r.action=="string"?r.action:null;return e?.hasAttribute("formaction")?e.getAttribute("formaction")||"":r.getAttribute("action")||t||""}function ro(r,e){let t=q(r);return lr(e)&&(t.search=""),t}function so(r,e){let t=e?.getAttribute("formmethod")||r.getAttribute("method")||"";return hr(t.toLowerCase())||j.get}function io(r,e){return zn(e?.getAttribute("formenctype")||r.enctype)}var Ee=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 ui(this.element)}get permanentElements(){return bi(this.element)}getPermanentElementById(e){return vi(this.element,e)}getPermanentElementMapForSnapshot(e){let t={};for(let s of this.permanentElements){let{id:i}=s,n=e.getPermanentElementById(i);n&&(t[i]=[s,n])}return t}};function vi(r,e){return r.querySelector(`#${e}[data-turbo-permanent]`)}function bi(r){return r.querySelectorAll("[id][data-turbo-permanent]")}var Me=class{started=!1;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.addEventListener("submit",this.submitCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("submit",this.submitCaptured,!0),this.started=!1)}submitCaptured=()=>{this.eventTarget.removeEventListener("submit",this.submitBubbled,!1),this.eventTarget.addEventListener("submit",this.submitBubbled,!1)};submitBubbled=e=>{if(!e.defaultPrevented){let t=e.target instanceof HTMLFormElement?e.target:void 0,s=e.submitter||void 0;t&&no(t,s)&&oo(t,s)&&this.delegate.willSubmitForm(t,s)&&(e.preventDefault(),e.stopImmediatePropagation(),this.delegate.formSubmitted(t,s))}}};function no(r,e){return(e?.getAttribute("formmethod")||r.getAttribute("method"))!="dialog"}function oo(r,e){let t=e?.getAttribute("formtarget")||r.getAttribute("target");return hi(t)}var tt=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(ce(e))}scrollToElement(e){e.scrollIntoView()}focusElement(e){e instanceof HTMLElement&&(e.hasAttribute("tabindex")?e.focus():(e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")))}scrollToPosition({x:e,y:t}){this.scrollRoot.scrollTo(e,t)}scrollToTop(){this.scrollToPosition({x:0,y:0})}get scrollRoot(){return window}async render(e){let{isPreview:t,shouldRender:s,willRender:i,newSnapshot:n}=e,o=i;if(s)try{this.renderPromise=new Promise(g=>this.#e=g),this.renderer=e,await this.prepareToRenderSnapshot(e);let c=new Promise(g=>this.#t=g),u={resume:this.#t,render:this.renderer.renderElement,renderMethod:this.renderer.renderMethod};this.delegate.allowsImmediateRender(n,u)||await c,await this.renderSnapshot(e),this.delegate.viewRenderedSnapshot(n,t,this.renderer.renderMethod),this.delegate.preloadOnLoadLinksForView(this.element),this.finishRenderingSnapshot(e)}finally{delete this.renderer,this.#e(void 0),delete this.renderPromise}else o&&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()}},xt=class extends tt{missing(){this.element.innerHTML='<strong class="turbo-frame-error">Content missing</strong>'}get snapshot(){return new Ee(this.element)}},rt=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,s=li(t)||t;return s instanceof Element&&s.closest("turbo-frame, html")==this.element}},st=class{started=!1;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.addEventListener("click",this.clickCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("click",this.clickCaptured,!0),this.started=!1)}clickCaptured=()=>{this.eventTarget.removeEventListener("click",this.clickBubbled,!1),this.eventTarget.addEventListener("click",this.clickBubbled,!1)};clickBubbled=e=>{if(e instanceof MouseEvent&&this.clickEventIsSignificant(e)){let t=e.composedPath&&e.composedPath()[0]||e.target,s=li(t);if(s&&hi(s.target)){let i=di(s);this.delegate.willFollowLinkToLocation(s,i,e)&&(e.preventDefault(),this.delegate.followedLinkToLocation(s,i))}}};clickEventIsSignificant(e){return!(e.target&&e.target.isContentEditable||e.defaultPrevented||e.which>1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)}},it=class{constructor(e,t){this.delegate=e,this.linkInterceptor=new st(this,t)}start(){this.linkInterceptor.start()}stop(){this.linkInterceptor.stop()}canPrefetchRequestToLocation(e,t){return!1}prefetchAndCacheRequestToLocation(e,t){}willFollowLinkToLocation(e,t,s){return this.delegate.willSubmitFormLinkToLocation(e,t,s)&&(e.hasAttribute("data-turbo-method")||e.hasAttribute("data-turbo-stream"))}followedLinkToLocation(e,t){let s=document.createElement("form"),i="hidden";for(let[E,m]of t.searchParams)s.append(Object.assign(document.createElement("input"),{type:i,name:E,value:m}));let n=Object.assign(t,{search:""});s.setAttribute("data-turbo","true"),s.setAttribute("action",n.href),s.setAttribute("hidden","");let o=e.getAttribute("data-turbo-method");o&&s.setAttribute("method",o);let c=e.getAttribute("data-turbo-frame");c&&s.setAttribute("data-turbo-frame",c);let u=ae(e);u&&s.setAttribute("data-turbo-action",u);let p=e.getAttribute("data-turbo-confirm");p&&s.setAttribute("data-turbo-confirm",p),e.hasAttribute("data-turbo-stream")&&s.setAttribute("data-turbo-stream",""),this.delegate.submittedFormLinkToLocation(e,t,s),document.body.appendChild(s),s.addEventListener("turbo:submit-end",()=>s.remove(),{once:!0}),requestAnimationFrame(()=>s.requestSubmit())}},nt=class{static async preservingPermanentElements(e,t,s){let i=new this(e,t);i.enter(),await s(),i.leave()}constructor(e,t){this.delegate=e,this.permanentElementMap=t}enter(){for(let e in this.permanentElementMap){let[t,s]=this.permanentElementMap[e];this.delegate.enteringBardo(t,s),this.replaceNewPermanentElementWithPlaceholder(s)}}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=ao(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 ao(r){let e=document.createElement("meta");return e.setAttribute("name","turbo-permanent-placeholder"),e.setAttribute("content",r.id),e}var ke=class{#e=null;static renderElement(e,t){}constructor(e,t,s,i=!0){this.currentSnapshot=e,this.newSnapshot=t,this.isPreview=s,this.willRender=i,this.renderElement=this.constructor.renderElement,this.promise=new Promise((n,o)=>this.resolvingFunctions={resolve:n,reject:o})}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 nt.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"}},Ce=class extends ke{static renderElement(e,t){let s=document.createRange();s.selectNodeContents(e),s.deleteContents();let i=t,n=i.ownerDocument?.createRange();n&&(n.selectNodeContents(i),e.appendChild(n.extractContents()))}constructor(e,t,s,i,n,o=!0){super(t,s,i,n,o),this.delegate=e}get shouldRender(){return!0}async render(){await Oe(),this.preservingPermanentElements(()=>{this.loadFrameElement()}),this.scrollFrameIntoView(),await Oe(),this.focusFirstAutofocusableElement(),await Oe(),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=co(this.currentElement.getAttribute("data-autoscroll-block"),"end"),s=uo(this.currentElement.getAttribute("data-autoscroll-behavior"),"auto");if(e)return e.scrollIntoView({block:t,behavior:s}),!0}return!1}activateScriptElements(){for(let e of this.newScriptElements){let t=Le(e);e.replaceWith(t)}}get newScriptElements(){return this.currentElement.querySelectorAll("script")}};function co(r,e){return r=="end"||r=="start"||r=="center"||r=="nearest"?r:e}function uo(r,e){return r=="auto"||r=="smooth"?r:e}var ho=(function(){let r=()=>{},e={morphStyle:"outerHTML",callbacks:{beforeNodeAdded:r,afterNodeAdded:r,beforeNodeMorphed:r,afterNodeMorphed:r,beforeNodeRemoved:r,afterNodeRemoved:r,beforeAttributeUpdated:r},head:{style:"merge",shouldPreserve:m=>m.getAttribute("im-preserve")==="true",shouldReAppend:m=>m.getAttribute("im-re-append")==="true",shouldRemove:r,afterHeadMorphed:r},restoreFocus:!0};function t(m,y,S={}){m=g(m);let T=E(y),L=p(m,T,S),O=i(L,()=>c(L,m,T,d=>d.morphStyle==="innerHTML"?(n(d,m,T),Array.from(m.childNodes)):s(d,m,T)));return L.pantry.remove(),O}function s(m,y,S){let T=E(y);return n(m,T,S,y,y.nextSibling),Array.from(T.childNodes)}function i(m,y){if(!m.config.restoreFocus)return y();let S=document.activeElement;if(!(S instanceof HTMLInputElement||S instanceof HTMLTextAreaElement))return y();let{id:T,selectionStart:L,selectionEnd:O}=S,d=y();return T&&T!==document.activeElement?.getAttribute("id")&&(S=m.target.querySelector(`[id="${T}"]`),S?.focus()),S&&!S.selectionEnd&&O&&S.setSelectionRange(L,O),d}let n=(function(){function m(l,h,b,v=null,A=null){h instanceof HTMLTemplateElement&&b instanceof HTMLTemplateElement&&(h=h.content,b=b.content),v||=h.firstChild;for(let _ of b.childNodes){if(v&&v!=A){let a=S(l,_,v,A);if(a){a!==v&&L(l,v,a),o(a,_,l),v=a.nextSibling;continue}}if(_ instanceof Element){let a=_.getAttribute("id");if(l.persistentIds.has(a)){let f=O(h,a,v,l);o(f,_,l),v=f.nextSibling;continue}}let R=y(h,_,v,l);R&&(v=R.nextSibling)}for(;v&&v!=A;){let _=v;v=v.nextSibling,T(l,_)}}function y(l,h,b,v){if(v.callbacks.beforeNodeAdded(h)===!1)return null;if(v.idMap.has(h)){let A=document.createElement(h.tagName);return l.insertBefore(A,b),o(A,h,v),v.callbacks.afterNodeAdded(A),A}else{let A=document.importNode(h,!0);return l.insertBefore(A,b),v.callbacks.afterNodeAdded(A),A}}let S=(function(){function l(v,A,_,R){let a=null,f=A.nextSibling,M=0,k=_;for(;k&&k!=R;){if(b(k,A)){if(h(v,k,A))return k;a===null&&(v.idMap.has(k)||(a=k))}if(a===null&&f&&b(k,f)&&(M++,f=f.nextSibling,M>=2&&(a=void 0)),v.activeElementAndParents.includes(k))break;k=k.nextSibling}return a||null}function h(v,A,_){let R=v.idMap.get(A),a=v.idMap.get(_);if(!a||!R)return!1;for(let f of R)if(a.has(f))return!0;return!1}function b(v,A){let _=v,R=A;return _.nodeType===R.nodeType&&_.tagName===R.tagName&&(!_.getAttribute?.("id")||_.getAttribute?.("id")===R.getAttribute?.("id"))}return l})();function T(l,h){if(l.idMap.has(h))w(l.pantry,h,null);else{if(l.callbacks.beforeNodeRemoved(h)===!1)return;h.parentNode?.removeChild(h),l.callbacks.afterNodeRemoved(h)}}function L(l,h,b){let v=h;for(;v&&v!==b;){let A=v;v=v.nextSibling,T(l,A)}return v}function O(l,h,b,v){let A=v.target.getAttribute?.("id")===h&&v.target||v.target.querySelector(`[id="${h}"]`)||v.pantry.querySelector(`[id="${h}"]`);return d(A,v),w(l,A,b),A}function d(l,h){let b=l.getAttribute("id");for(;l=l.parentNode;){let v=h.idMap.get(l);v&&(v.delete(b),v.size||h.idMap.delete(l))}}function w(l,h,b){if(l.moveBefore)try{l.moveBefore(h,b)}catch{l.insertBefore(h,b)}else l.insertBefore(h,b)}return m})(),o=(function(){function m(d,w,l){return l.ignoreActive&&d===document.activeElement?null:(l.callbacks.beforeNodeMorphed(d,w)===!1||(d instanceof HTMLHeadElement&&l.head.ignore||(d instanceof HTMLHeadElement&&l.head.style!=="morph"?u(d,w,l):(y(d,w,l),O(d,l)||n(l,d,w))),l.callbacks.afterNodeMorphed(d,w)),d)}function y(d,w,l){let h=w.nodeType;if(h===1){let b=d,v=w,A=b.attributes,_=v.attributes;for(let R of _)L(R.name,b,"update",l)||b.getAttribute(R.name)!==R.value&&b.setAttribute(R.name,R.value);for(let R=A.length-1;0<=R;R--){let a=A[R];if(a&&!v.hasAttribute(a.name)){if(L(a.name,b,"remove",l))continue;b.removeAttribute(a.name)}}O(b,l)||S(b,v,l)}(h===8||h===3)&&d.nodeValue!==w.nodeValue&&(d.nodeValue=w.nodeValue)}function S(d,w,l){if(d instanceof HTMLInputElement&&w instanceof HTMLInputElement&&w.type!=="file"){let h=w.value,b=d.value;T(d,w,"checked",l),T(d,w,"disabled",l),w.hasAttribute("value")?b!==h&&(L("value",d,"update",l)||(d.setAttribute("value",h),d.value=h)):L("value",d,"remove",l)||(d.value="",d.removeAttribute("value"))}else if(d instanceof HTMLOptionElement&&w instanceof HTMLOptionElement)T(d,w,"selected",l);else if(d instanceof HTMLTextAreaElement&&w instanceof HTMLTextAreaElement){let h=w.value,b=d.value;if(L("value",d,"update",l))return;h!==b&&(d.value=h),d.firstChild&&d.firstChild.nodeValue!==h&&(d.firstChild.nodeValue=h)}}function T(d,w,l,h){let b=w[l],v=d[l];if(b!==v){let A=L(l,d,"update",h);A||(d[l]=w[l]),b?A||d.setAttribute(l,""):L(l,d,"remove",h)||d.removeAttribute(l)}}function L(d,w,l,h){return d==="value"&&h.ignoreActiveValue&&w===document.activeElement?!0:h.callbacks.beforeAttributeUpdated(d,w,l)===!1}function O(d,w){return!!w.ignoreActiveValue&&d===document.activeElement&&d!==document.body}return m})();function c(m,y,S,T){if(m.head.block){let L=y.querySelector("head"),O=S.querySelector("head");if(L&&O){let d=u(L,O,m);return Promise.all(d).then(()=>{let w=Object.assign(m,{head:{block:!1,ignore:!0}});return T(w)})}}return T(m)}function u(m,y,S){let T=[],L=[],O=[],d=[],w=new Map;for(let h of y.children)w.set(h.outerHTML,h);for(let h of m.children){let b=w.has(h.outerHTML),v=S.head.shouldReAppend(h),A=S.head.shouldPreserve(h);b||A?v?L.push(h):(w.delete(h.outerHTML),O.push(h)):S.head.style==="append"?v&&(L.push(h),d.push(h)):S.head.shouldRemove(h)!==!1&&L.push(h)}d.push(...w.values());let l=[];for(let h of d){let b=document.createRange().createContextualFragment(h.outerHTML).firstChild;if(S.callbacks.beforeNodeAdded(b)!==!1){if("href"in b&&b.href||"src"in b&&b.src){let v,A=new Promise(function(_){v=_});b.addEventListener("load",function(){v()}),l.push(A)}m.appendChild(b),S.callbacks.afterNodeAdded(b),T.push(b)}}for(let h of L)S.callbacks.beforeNodeRemoved(h)!==!1&&(m.removeChild(h),S.callbacks.afterNodeRemoved(h));return S.head.afterHeadMorphed(m,{added:T,kept:O,removed:L}),l}let p=(function(){function m(l,h,b){let{persistentIds:v,idMap:A}=d(l,h),_=y(b),R=_.morphStyle||"outerHTML";if(!["innerHTML","outerHTML"].includes(R))throw`Do not understand how to morph style ${R}`;return{target:l,newContent:h,config:_,morphStyle:R,ignoreActive:_.ignoreActive,ignoreActiveValue:_.ignoreActiveValue,restoreFocus:_.restoreFocus,idMap:A,persistentIds:v,pantry:S(),activeElementAndParents:T(l),callbacks:_.callbacks,head:_.head}}function y(l){let h=Object.assign({},e);return Object.assign(h,l),h.callbacks=Object.assign({},e.callbacks,l.callbacks),h.head=Object.assign({},e.head,l.head),h}function S(){let l=document.createElement("div");return l.hidden=!0,document.body.insertAdjacentElement("afterend",l),l}function T(l){let h=[],b=document.activeElement;if(b?.tagName!=="BODY"&&l.contains(b))for(;b&&(h.push(b),b!==l);)b=b.parentElement;return h}function L(l){let h=Array.from(l.querySelectorAll("[id]"));return l.getAttribute?.("id")&&h.push(l),h}function O(l,h,b,v){for(let A of v){let _=A.getAttribute("id");if(h.has(_)){let R=A;for(;R;){let a=l.get(R);if(a==null&&(a=new Set,l.set(R,a)),a.add(_),R===b)break;R=R.parentElement}}}}function d(l,h){let b=L(l),v=L(h),A=w(b,v),_=new Map;O(_,A,l,b);let R=h.__idiomorphRoot||h;return O(_,A,R,v),{persistentIds:A,idMap:_}}function w(l,h){let b=new Set,v=new Map;for(let{id:_,tagName:R}of l)v.has(_)?b.add(_):v.set(_,R);let A=new Set;for(let{id:_,tagName:R}of h)A.has(_)?b.add(_):v.get(_)===R&&A.add(_);for(let _ of b)A.delete(_);return A}return m})(),{normalizeElement:g,normalizeParent:E}=(function(){let m=new WeakSet;function y(O){return O instanceof Document?O.documentElement:O}function S(O){if(O==null)return document.createElement("div");if(typeof O=="string")return S(L(O));if(m.has(O))return O;if(O instanceof Node){if(O.parentNode)return new T(O);{let d=document.createElement("div");return d.append(O),d}}else{let d=document.createElement("div");for(let w of[...O])d.append(w);return d}}class T{constructor(d){this.originalNode=d,this.realParentNode=d.parentNode,this.previousSibling=d.previousSibling,this.nextSibling=d.nextSibling}get childNodes(){let d=[],w=this.previousSibling?this.previousSibling.nextSibling:this.realParentNode.firstChild;for(;w&&w!=this.nextSibling;)d.push(w),w=w.nextSibling;return d}querySelectorAll(d){return this.childNodes.reduce((w,l)=>{if(l instanceof Element){l.matches(d)&&w.push(l);let h=l.querySelectorAll(d);for(let b=0;b<h.length;b++)w.push(h[b])}return w},[])}insertBefore(d,w){return this.realParentNode.insertBefore(d,w)}moveBefore(d,w){return this.realParentNode.moveBefore(d,w)}get __idiomorphRoot(){return this.originalNode}}function L(O){let d=new DOMParser,w=O.replace(/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,"");if(w.match(/<\/html>/)||w.match(/<\/head>/)||w.match(/<\/body>/)){let l=d.parseFromString(O,"text/html");if(w.match(/<\/html>/))return m.add(l),l;{let h=l.firstChild;return h&&m.add(h),h}}else{let h=d.parseFromString("<body><template>"+O+"</template></body>","text/html").body.querySelector("template").content;return m.add(h),h}}return{normalizeElement:y,normalizeParent:S}})();return{morph:t,defaults:e}})();function ct(r,e,{callbacks:t,...s}={}){ho.morph(r,e,{...s,callbacks:new Bt(t)})}function dr(r,e,t={}){ct(r,e.childNodes,{...t,morphStyle:"innerHTML"})}function yi(r,e){return r instanceof W&&r.shouldReloadWithMorph&&(!e||lo(r,e))&&!r.closest("[data-turbo-permanent]")}function lo(r,e){return e instanceof Element&&e.nodeName==="TURBO-FRAME"&&r.id===e.id&&(!e.getAttribute("src")||fi(r.src,e.getAttribute("src")))}function wi(r){return r.parentElement.closest("turbo-frame[src][refresh=morph]")}var Bt=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)?!x("turbo:before-morph-element",{cancelable:!0,target:e,detail:{currentElement:e,newElement:t}}).defaultPrevented:!1};beforeAttributeUpdated=(e,t,s)=>!x("turbo:before-morph-attribute",{cancelable:!0,target:t,detail:{attributeName:e,mutationType:s}}).defaultPrevented;beforeNodeRemoved=e=>this.beforeNodeMorphed(e);afterNodeMorphed=(e,t)=>{e instanceof Element&&x("turbo:morph-element",{target:e,detail:{currentElement:e,newElement:t}})}},ot=class extends Ce{static renderElement(e,t){x("turbo:before-frame-morph",{target:e,detail:{currentElement:e,newElement:t}}),dr(e,t,{callbacks:{beforeNodeMorphed:(s,i)=>yi(s,i)&&wi(s)===e?(s.reload(),!1):!0}})}async preservingPermanentElements(e){return await e()}},It=class r{static animationDuration=300;static get defaultCSS(){return oi`
|
|
14
|
+
.turbo-progress-bar {
|
|
15
|
+
position: fixed;
|
|
16
|
+
display: block;
|
|
17
|
+
top: 0;
|
|
18
|
+
left: 0;
|
|
19
|
+
height: 3px;
|
|
20
|
+
background: #0076ff;
|
|
21
|
+
z-index: 2147483647;
|
|
22
|
+
transition:
|
|
23
|
+
width ${r.animationDuration}ms ease-out,
|
|
24
|
+
opacity ${r.animationDuration/2}ms ${r.animationDuration/2}ms ease-in;
|
|
25
|
+
transform: translate3d(0, 0, 0);
|
|
26
|
+
}
|
|
27
|
+
`}hiding=!1;value=0;visible=!1;constructor(){this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement(),this.installStylesheetElement(),this.setValue(0)}show(){this.visible||(this.visible=!0,this.installProgressElement(),this.startTrickling())}hide(){this.visible&&!this.hiding&&(this.hiding=!0,this.fadeProgressElement(()=>{this.uninstallProgressElement(),this.stopTrickling(),this.visible=!1,this.hiding=!1}))}setValue(e){this.value=e,this.refresh()}installStylesheetElement(){document.head.insertBefore(this.stylesheetElement,document.head.firstChild)}installProgressElement(){this.progressElement.style.width="0",this.progressElement.style.opacity="1",document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()}fadeProgressElement(e){this.progressElement.style.opacity="0",setTimeout(e,r.animationDuration*1.5)}uninstallProgressElement(){this.progressElement.parentNode&&document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,r.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 e=document.createElement("style");e.type="text/css",e.textContent=r.defaultCSS;let t=ci();return t&&(e.nonce=t),e}createProgressElement(){let e=document.createElement("div");return e.className="turbo-progress-bar",e}},Dt=class extends Ee{detailsByOuterHTML=this.children.filter(e=>!go(e)).map(e=>yo(e)).reduce((e,t)=>{let{outerHTML:s}=t,i=s in e?e[s]:{type:fo(t),tracked:po(t),elements:[]};return{...e,[s]:{...i,elements:[...i.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(s=>!(s in t.detailsByOuterHTML)).map(s=>this.detailsByOuterHTML[s]).filter(({type:s})=>s==e).map(({elements:[s]})=>s)}get provisionalElements(){return Object.keys(this.detailsByOuterHTML).reduce((e,t)=>{let{type:s,tracked:i,elements:n}=this.detailsByOuterHTML[t];return s==null&&!i?[...e,...n]:n.length>1?[...e,...n.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,s)=>{let{elements:[i]}=this.detailsByOuterHTML[s];return bo(i,e)?i:t},void 0|void 0)}};function fo(r){if(mo(r))return"script";if(vo(r))return"stylesheet"}function po(r){return r.getAttribute("data-turbo-track")=="reload"}function mo(r){return r.localName=="script"}function go(r){return r.localName=="noscript"}function vo(r){let e=r.localName;return e=="style"||e=="link"&&r.getAttribute("rel")=="stylesheet"}function bo(r,e){return r.localName=="meta"&&r.getAttribute("name")==e}function yo(r){return r.hasAttribute("nonce")&&r.setAttribute("nonce",""),r}var U=class r extends Ee{static fromHTMLString(e=""){return this.fromDocument(ni(e))}static fromElement(e){return this.fromDocument(e.ownerDocument)}static fromDocument({documentElement:e,body:t,head:s}){return new this(e,t,new Dt(s))}constructor(e,t,s){super(t),this.documentElement=e,this.headSnapshot=s}clone(){let e=this.element.cloneNode(!0),t=this.element.querySelectorAll("select"),s=e.querySelectorAll("select");for(let[i,n]of t.entries()){let o=s[i];for(let c of o.selectedOptions)c.selected=!1;for(let c of n.selectedOptions)o.options[c.index].selected=!0}for(let i of e.querySelectorAll('input[type="password"]'))i.value="";return new r(this.documentElement,e,this.headSnapshot)}get lang(){return this.documentElement.getAttribute("lang")}get headElement(){return this.headSnapshot.element}get rootLocation(){let e=this.getSetting("root")??"/";return q(e)}get cacheControlValue(){return this.getSetting("cache-control")}get isPreviewable(){return this.cacheControlValue!="no-preview"}get isCacheable(){return this.cacheControlValue!="no-cache"}get isVisitable(){return this.getSetting("visit-control")!="reload"}get prefersViewTransitions(){return(this.getSetting("view-transition")==="true"||this.headSnapshot.getMetaValue("view-transition")==="same-origin")&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches}get shouldMorphPage(){return this.getSetting("refresh-method")==="morph"}get shouldPreserveScrollPosition(){return this.getSetting("refresh-scroll")==="preserve"}getSetting(e){return this.headSnapshot.getMetaValue(`turbo-${e}`)}},qt=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}},wo={action:"advance",historyChanged:!1,visitCachedSnapshot:()=>{},willRender:!0,updateHistory:!0,shouldCacheSnapshot:!0,acceptsStreamResponse:!1},Xe={visitStart:"visitStart",requestStart:"requestStart",requestEnd:"requestEnd",visitEnd:"visitEnd"},X={initialized:"initialized",started:"started",canceled:"canceled",failed:"failed",completed:"completed"},we={networkFailure:0,timeoutFailure:-1,contentTypeMismatch:-2},Eo={advance:"forward",restore:"back",replace:"none"},Ht=class{identifier=re();timingMetrics={};followedRedirect=!1;historyChanged=!1;scrolled=!1;shouldCacheSnapshot=!0;acceptsStreamResponse=!1;snapshotCached=!1;state=X.initialized;viewTransitioner=new qt;constructor(e,t,s,i={}){this.delegate=e,this.location=t,this.restorationIdentifier=s||re();let{action:n,historyChanged:o,referrer:c,snapshot:u,snapshotHTML:p,response:g,visitCachedSnapshot:E,willRender:m,updateHistory:y,shouldCacheSnapshot:S,acceptsStreamResponse:T,direction:L}={...wo,...i};this.action=n,this.historyChanged=o,this.referrer=c,this.snapshot=u,this.snapshotHTML=p,this.response=g,this.isSamePage=this.delegate.locationWithActionIsSamePage(this.location,this.action),this.isPageRefresh=this.view.isPageRefresh(this),this.visitCachedSnapshot=E,this.willRender=m,this.updateHistory=y,this.scrolled=!m,this.shouldCacheSnapshot=S,this.acceptsStreamResponse=T,this.direction=L||Eo[n]}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get history(){return this.delegate.history}get restorationData(){return this.history.getRestorationDataForIdentifier(this.restorationIdentifier)}get silent(){return this.isSamePage}start(){this.state==X.initialized&&(this.recordTimingMetric(Xe.visitStart),this.state=X.started,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==X.started&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=X.canceled)}complete(){this.state==X.started&&(this.recordTimingMetric(Xe.visitEnd),this.adapter.visitCompleted(this),this.state=X.completed,this.followRedirect(),this.followedRedirect||this.delegate.visitCompleted(this))}fail(){this.state==X.started&&(this.state=X.failed,this.adapter.visitFailed(this),this.delegate.visitCompleted(this))}changeHistory(){if(!this.historyChanged&&this.updateHistory){let e=this.location.href===this.referrer?.href?"replace":this.action,t=ai(e);this.history.update(t,this.location,this.restorationIdentifier),this.historyChanged=!0}}issueRequest(){this.hasPreloadedResponse()?this.simulateRequest():this.shouldIssueRequest()&&!this.request&&(this.request=new ue(this,j.get,this.location),this.request.perform())}simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric(Xe.requestStart),this.adapter.visitRequestStarted(this)}recordResponse(e=this.response){if(this.response=e,e){let{statusCode:t}=e;Ys(t)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,t)}}finishRequest(){this.recordTimingMetric(Xe.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,Ys(e)&&t!=null){let s=U.fromHTMLString(t);await this.renderPageSnapshot(s,!1),this.adapter.visitRendered(this),this.complete()}else await this.view.renderError(U.fromHTMLString(t),this),this.adapter.visitRendered(this),this.fail()})}}getCachedSnapshot(){let e=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(e&&(!ce(this.location)||e.hasAnchor(ce(this.location)))&&(this.action=="restore"||e.isPreviewable))return e}getPreloadedSnapshot(){if(this.snapshotHTML)return U.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.isSamePage||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)}goToSamePageAnchor(){this.isSamePage&&this.render(async()=>{this.cacheSnapshot(),this.performScroll(),this.changeHistory(),this.adapter.visitRendered(this)})}prepareRequest(e){this.acceptsStreamResponse&&e.acceptResponseType(se.contentType)}requestStarted(){this.startRequest()}requestPreventedHandlingResponse(e,t){}async requestSucceededWithResponse(e,t){let s=await t.responseHTML,{redirected:i,statusCode:n}=t;s==null?this.recordResponse({statusCode:we.contentTypeMismatch,redirected:i}):(this.redirectedToLocation=t.redirected?t.location:void 0,this.recordResponse({statusCode:n,responseHTML:s,redirected:i}))}async requestFailedWithResponse(e,t){let s=await t.responseHTML,{redirected:i,statusCode:n}=t;s==null?this.recordResponse({statusCode:we.contentTypeMismatch,redirected:i}):this.recordResponse({statusCode:n,responseHTML:s,redirected:i})}requestErrored(e,t){this.recordResponse({statusCode:we.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.isSamePage&&this.delegate.visitScrolledToSamePageLocation(this.view.lastRenderedLocation,this.location),this.scrolled=!0)}scrollToRestoredPosition(){let{scrollPosition:e}=this.restorationData;if(e)return this.view.scrollToPosition(e),!0}scrollToAnchor(){let e=ce(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.isSamePage?!1:this.action=="restore"?!this.hasCachedSnapshot():this.willRender}cacheSnapshot(){this.snapshotCached||(this.view.cacheSnapshot(this.snapshot).then(e=>e&&this.visitCachedSnapshot(e)),this.snapshotCached=!0)}async render(e){this.cancelRender(),await new Promise(t=>{this.frame=document.visibilityState==="hidden"?setTimeout(()=>t(),0):requestAnimationFrame(()=>t())}),await e(),delete this.frame}async renderPageSnapshot(e,t){await this.viewTransitioner.renderChange(this.view.shouldTransitionTo(e),async()=>{await this.view.renderPage(e,t,this.willRender,this),this.performScroll()})}cancelRender(){this.frame&&(cancelAnimationFrame(this.frame),delete this.frame)}};function Ys(r){return r>=200&&r<300}var jt=class{progressBar=new It;constructor(e){this.session=e}visitProposedToLocation(e,t){te(e,this.navigator.rootLocation)?this.navigator.startVisit(e,t?.restorationIdentifier||re(),t):window.location.href=e.toString()}visitStarted(e){this.location=e.location,this.redirectedToLocation=null,e.loadCachedSnapshot(),e.issueRequest(),e.goToSamePageAnchor()}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 we.networkFailure:case we.timeoutFailure:case we.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==null&&(this.formProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay))}hideFormProgressBar(){this.progressBar.hide(),this.formProgressBarTimeout!=null&&(window.clearTimeout(this.formProgressBarTimeout),delete this.formProgressBarTimeout)}showProgressBar=()=>{this.progressBar.show()};reload(e){x("turbo:reload",{detail:e}),window.location.href=(this.redirectedToLocation||this.location)?.toString()||window.location.href}get navigator(){return this.session.navigator}},Vt=class{selector="[data-turbo-temporary]";deprecatedSelector="[data-turbo-cache=false]";started=!1;start(){this.started||(this.started=!0,addEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}stop(){this.started&&(this.started=!1,removeEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}removeTemporaryElements=e=>{for(let t of this.temporaryElements)t.remove()};get temporaryElements(){return[...document.querySelectorAll(this.selector),...this.temporaryElementsWithDeprecation]}get temporaryElementsWithDeprecation(){let e=document.querySelectorAll(this.deprecatedSelector);return e.length&&console.warn(`The ${this.deprecatedSelector} selector is deprecated and will be removed in a future version. Use ${this.selector} instead.`),[...e]}},$t=class{constructor(e,t){this.session=e,this.element=t,this.linkInterceptor=new rt(this,t),this.formSubmitObserver=new Me(this,t)}start(){this.linkInterceptor.start(),this.formSubmitObserver.start()}stop(){this.linkInterceptor.stop(),this.formSubmitObserver.stop()}shouldInterceptLinkClick(e,t,s){return this.#t(e)}linkClickIntercepted(e,t,s){let i=this.#r(e);i&&i.delegate.linkClickIntercepted(e,t,s)}willSubmitForm(e,t){return e.closest("turbo-frame")==null&&this.#e(e,t)&&this.#t(e,t)}formSubmitted(e,t){let s=this.#r(e,t);s&&s.delegate.formSubmitted(e,t)}#e(e,t){let s=ur(e,t),i=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),n=q(i?.content??"/");return this.#t(e,t)&&te(s,n)}#t(e,t){if(e instanceof HTMLFormElement?this.session.submissionIsNavigatable(e,t):this.session.elementIsNavigatable(e)){let i=this.#r(e,t);return i?i!=e.closest("turbo-frame"):!1}else return!1}#r(e,t){let s=t?.getAttribute("data-turbo-frame")||e.getAttribute("data-turbo-frame");if(s&&s!="_top"){let i=this.element.querySelector(`#${s}:not([disabled])`);if(i instanceof W)return i}}},Ut=class{location;restorationIdentifier=re();restorationData={};started=!1;pageLoaded=!1;currentIndex=0;constructor(e){this.delegate=e}start(){this.started||(addEventListener("popstate",this.onPopState,!1),addEventListener("load",this.onPageLoad,!1),this.currentIndex=history.state?.turbo?.restorationIndex||0,this.started=!0,this.replace(new URL(window.location.href)))}stop(){this.started&&(removeEventListener("popstate",this.onPopState,!1),removeEventListener("load",this.onPageLoad,!1),this.started=!1)}push(e,t){this.update(history.pushState,e,t)}replace(e,t){this.update(history.replaceState,e,t)}update(e,t,s=re()){e===history.pushState&&++this.currentIndex;let i={turbo:{restorationIdentifier:s,restorationIndex:this.currentIndex}};e.call(history,i,"",t.href),this.location=t,this.restorationIdentifier=s}getRestorationDataForIdentifier(e){return this.restorationData[e]||{}}updateRestorationData(e){let{restorationIdentifier:t}=this,s=this.restorationData[t];this.restorationData[t]={...s,...e}}assumeControlOfScrollRestoration(){this.previousScrollRestoration||(this.previousScrollRestoration=history.scrollRestoration??"auto",history.scrollRestoration="manual")}relinquishControlOfScrollRestoration(){this.previousScrollRestoration&&(history.scrollRestoration=this.previousScrollRestoration,delete this.previousScrollRestoration)}onPopState=e=>{if(this.shouldHandlePopState()){let{turbo:t}=e.state||{};if(t){this.location=new URL(window.location.href);let{restorationIdentifier:s,restorationIndex:i}=t;this.restorationIdentifier=s;let n=i>this.currentIndex?"forward":"back";this.delegate.historyPoppedToLocationWithRestorationIdentifierAndDirection(this.location,s,n),this.currentIndex=i}}};onPageLoad=async e=>{await Fn(),this.pageLoaded=!0};shouldHandlePopState(){return this.pageIsLoaded()}pageIsLoaded(){return this.pageLoaded||document.readyState=="complete"}},Wt=class{started=!1;#e=null;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.readyState==="loading"?this.eventTarget.addEventListener("DOMContentLoaded",this.#t,{once:!0}):this.#t())}stop(){this.started&&(this.eventTarget.removeEventListener("mouseenter",this.#r,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("mouseleave",this.#n,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("turbo:before-fetch-request",this.#i,!0),this.started=!1)}#t=()=>{this.eventTarget.addEventListener("mouseenter",this.#r,{capture:!0,passive:!0}),this.eventTarget.addEventListener("mouseleave",this.#n,{capture:!0,passive:!0}),this.eventTarget.addEventListener("turbo:before-fetch-request",this.#i,!0),this.started=!0};#r=e=>{if(Ze("turbo-prefetch")==="false")return;let t=e.target;if(t.matches&&t.matches("a[href]:not([target^=_]):not([download])")&&this.#c(t)){let i=t,n=di(i);if(this.delegate.canPrefetchRequestToLocation(i,n)){this.#e=i;let o=new ue(this,j.get,n,new URLSearchParams,t);o.fetchOptions.priority="low",be.setLater(n.toString(),o,this.#s)}}};#n=e=>{e.target===this.#e&&this.#o()};#o=()=>{be.clear(),this.#e=null};#i=e=>{if(e.target.tagName!=="FORM"&&e.detail.fetchOptions.method==="GET"){let t=be.get(e.detail.url.toString());t&&(e.detail.fetchRequest=t),be.clear()}};prepareRequest(e){let t=e.target;e.headers["X-Sec-Purpose"]="prefetch";let s=t.closest("turbo-frame"),i=t.getAttribute("data-turbo-frame")||s?.getAttribute("target")||s?.id;i&&i!=="_top"&&(e.headers["Turbo-Frame"]=i)}requestSucceededWithResponse(){}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}get#s(){return Number(Ze("turbo-prefetch-cache-time"))||Qn}#c(e){return!(!e.getAttribute("href")||So(e)||Ao(e)||_o(e)||To(e)||Lo(e))}},So=r=>r.origin!==document.location.origin||!["http:","https:"].includes(r.protocol)||r.hasAttribute("target"),Ao=r=>r.pathname+r.search===document.location.pathname+document.location.search||r.href.startsWith("#"),_o=r=>{if(r.getAttribute("data-turbo-prefetch")==="false"||r.getAttribute("data-turbo")==="false")return!0;let e=ye(r,"[data-turbo-prefetch]");return!!(e&&e.getAttribute("data-turbo-prefetch")==="false")},To=r=>{let e=r.getAttribute("data-turbo-method");return!!(e&&e.toLowerCase()!=="get"||Oo(r)||r.hasAttribute("data-turbo-confirm")||r.hasAttribute("data-turbo-stream"))},Oo=r=>r.hasAttribute("data-remote")||r.hasAttribute("data-behavior")||r.hasAttribute("data-confirm")||r.hasAttribute("data-method"),Lo=r=>x("turbo:before-prefetch",{target:r,cancelable:!0}).defaultPrevented,Kt=class{constructor(e){this.delegate=e}proposeVisit(e,t={}){this.delegate.allowsVisitingLocationWithAction(e,t.action)&&this.delegate.visitProposedToLocation(e,t)}startVisit(e,t,s={}){this.stop(),this.currentVisit=new Ht(this,q(e),t,{referrer:this.location,...s}),this.currentVisit.start()}submitForm(e,t){this.stop(),this.formSubmission=new et(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 s=await t.responseHTML;if(s){let i=e.isSafe;i||this.view.clearSnapshotCache();let{statusCode:n,redirected:o}=t,u={action:this.#e(e,t),shouldCacheSnapshot:i,response:{statusCode:n,responseHTML:s,redirected:o}};this.proposeVisit(t.location,u)}}}async formSubmissionFailedWithResponse(e,t){let s=await t.responseHTML;if(s){let i=U.fromHTMLString(s);t.serverError?await this.view.renderError(i,this.currentVisit):await this.view.renderPage(i,!1,!0,this.currentVisit),i.shouldPreserveScrollPosition||this.view.scrollToTop(),this.view.clearSnapshotCache()}}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished(e){typeof this.adapter.formSubmissionFinished=="function"&&this.adapter.formSubmissionFinished(e)}linkPrefetchingIsEnabledForLocation(e){return typeof this.adapter.linkPrefetchingIsEnabledForLocation=="function"?this.adapter.linkPrefetchingIsEnabledForLocation(e):!0}visitStarted(e){this.delegate.visitStarted(e)}visitCompleted(e){this.delegate.visitCompleted(e),delete this.currentVisit}locationWithActionIsSamePage(e,t){let s=ce(e),i=ce(this.view.lastRenderedLocation),n=t==="restore"&&typeof s>"u";return t!=="replace"&&Ct(e)===Ct(this.view.lastRenderedLocation)&&(n||s!=null&&s!==i)}visitScrolledToSamePageLocation(e,t){this.delegate.visitScrolledToSamePageLocation(e,t)}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}#e(e,t){let{submitter:s,formElement:i}=e;return ae(s,i)||this.#t(t)}#t(e){return e.redirected&&e.location.href===this.location?.href?"replace":"advance"}},ne={initial:0,loading:1,interactive:2,complete:3},zt=class{stage=ne.initial;started=!1;constructor(e){this.delegate=e}start(){this.started||(this.stage==ne.initial&&(this.stage=ne.loading),document.addEventListener("readystatechange",this.interpretReadyState,!1),addEventListener("pagehide",this.pageWillUnload,!1),this.started=!0)}stop(){this.started&&(document.removeEventListener("readystatechange",this.interpretReadyState,!1),removeEventListener("pagehide",this.pageWillUnload,!1),this.started=!1)}interpretReadyState=()=>{let{readyState:e}=this;e=="interactive"?this.pageIsInteractive():e=="complete"&&this.pageIsComplete()};pageIsInteractive(){this.stage==ne.loading&&(this.stage=ne.interactive,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==ne.interactive&&(this.stage=ne.complete,this.delegate.pageLoaded())}pageWillUnload=()=>{this.delegate.pageWillUnload()};get readyState(){return document.readyState}},Jt=class{started=!1;constructor(e){this.delegate=e}start(){this.started||(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)}stop(){this.started&&(removeEventListener("scroll",this.onScroll,!1),this.started=!1)}onScroll=()=>{this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})};updatePosition(e){this.delegate.scrollPositionChanged(e)}},Xt=class{render({fragment:e}){nt.preservingPermanentElements(this,Ro(e),()=>{Mo(e,()=>{ko(()=>{document.documentElement.appendChild(e)})})})}enteringBardo(e,t){t.replaceWith(e.cloneNode(!0))}leavingBardo(){}};function Ro(r){let e=bi(document.documentElement),t={};for(let s of e){let{id:i}=s;for(let n of r.querySelectorAll("turbo-stream")){let o=vi(n.templateElement.content,i);o&&(t[i]=[s,o])}}return t}async function Mo(r,e){let t=`turbo-stream-autofocus-${re()}`,s=r.querySelectorAll("turbo-stream"),i=Co(s),n=null;if(i&&(i.id?n=i.id:n=t,i.id=n),e(),await Oe(),(document.activeElement==null||document.activeElement==document.body)&&n){let c=document.getElementById(n);cr(c)&&c.focus(),c&&c.id==t&&c.removeAttribute("id")}}async function ko(r){let[e,t]=await qn(r,()=>document.activeElement),s=e&&e.id;if(s){let i=document.getElementById(s);cr(i)&&i!=t&&i.focus()}}function Co(r){for(let e of r){let t=ui(e.templateElement.content);if(t)return t}return null}var Gt=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=Po(e);t&&Fo(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(se.wrap(e))}};function Po(r){let e=r.detail?.fetchResponse;if(e instanceof Re)return e}function Fo(r){return(r.contentType??"").startsWith(se.contentType)}var Qt=class extends ke{static renderElement(e,t){let{documentElement:s,body:i}=document;s.replaceChild(t,i)}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 s=Le(e);t.replaceChild(s,e)}}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return document.documentElement.querySelectorAll("script")}},Pe=class extends ke{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,{lang:t}=this.newSnapshot;t?e.setAttribute("lang",t):e.removeAttribute("lang")}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(Bn(t)),document.head.appendChild(t);await Promise.all(e)}copyNewHeadScriptElements(){for(let e of this.newHeadScriptElements)document.head.appendChild(Le(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[s,i]of t.entries()){if(e.tagName=="TITLE"){if(i.tagName!="TITLE")continue;if(e.innerHTML==i.innerHTML)return t.splice(s,1),!0}if(i.isEqualNode(e))return t.splice(s,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.activateNewBodyScriptElements()}activateNewBodyScriptElements(){for(let e of this.newBodyScriptElements){let t=Le(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")}},at=class extends Pe{static renderElement(e,t){ct(e,t,{callbacks:{beforeNodeMorphed:(s,i)=>yi(s,i)&&!wi(s)?(s.reload(),!1):!0}}),x("turbo:morph",{detail:{currentElement:e,newElement:t}})}async preservingPermanentElements(e){return await e()}get renderMethod(){return"morph"}get shouldAutofocus(){return!1}},Yt=class{keys=[];snapshots={};constructor(e){this.size=e}has(e){return Je(e)in this.snapshots}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(){this.snapshots={}}read(e){return this.snapshots[Je(e)]}write(e,t){this.snapshots[Je(e)]=t}touch(e){let t=Je(e),s=this.keys.indexOf(t);s>-1&&this.keys.splice(s,1),this.keys.unshift(t),this.trim()}trim(){for(let e of this.keys.splice(this.size))delete this.snapshots[e]}},Zt=class extends tt{snapshotCache=new Yt(10);lastRenderedLocation=new URL(location.href);forceReloaded=!1;shouldTransitionTo(e){return this.snapshot.prefersViewTransitions&&e.prefersViewTransitions}renderPage(e,t=!1,s=!0,i){let o=this.isPageRefresh(i)&&this.snapshot.shouldMorphPage?at:Pe,c=new o(this.snapshot,e,t,s);return c.shouldRender?i?.changeHistory():this.forceReloaded=!0,this.render(c)}renderError(e,t){t?.changeHistory();let s=new Qt(this.snapshot,e,!1);return this.render(s)}clearSnapshotCache(){this.snapshotCache.clear()}async cacheSnapshot(e=this.snapshot){if(e.isCacheable){this.delegate.viewWillCacheSnapshot();let{lastRenderedLocation:t}=this;await ii();let s=e.clone();return this.snapshotCache.put(t,s),s}}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)&&this.snapshot.shouldPreserveScrollPosition}get snapshot(){return U.fromElement(this.element)}},er=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);if(this.snapshotCache.has(t))return;await new ue(this,j.get,t,new URLSearchParams,e).perform()}prepareRequest(e){e.headers["X-Sec-Purpose"]="prefetch"}async requestSucceededWithResponse(e,t){try{let s=await t.responseHTML,i=U.fromHTMLString(s);this.snapshotCache.put(e.url,i)}catch{}}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}#e=()=>{this.preloadOnLoadLinksForView(document.body)}},tr=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){Dn("turbo-cache-control",e)}},rr=class{navigator=new Kt(this);history=new Ut(this);view=new Zt(this,document.documentElement);adapter=new jt(this);pageObserver=new zt(this);cacheObserver=new Vt;linkPrefetchObserver=new Wt(this,document);linkClickObserver=new st(this,window);formSubmitObserver=new Me(this,document);scrollObserver=new Jt(this);streamObserver=new Gt(this);formLinkClickObserver=new it(this,document.documentElement);frameRedirector=new $t(this,document.documentElement);streamMessageRenderer=new Xt;cache=new tr(this);enabled=!0;started=!1;#e=150;constructor(e){this.recentRequests=e,this.preloader=new er(this,this.view.snapshotCache),this.debouncedRefresh=this.refresh,this.pageRefreshDebouncePeriod=this.pageRefreshDebouncePeriod}start(){this.started||(this.pageObserver.start(),this.cacheObserver.start(),this.linkPrefetchObserver.start(),this.formLinkClickObserver.start(),this.linkClickObserver.start(),this.formSubmitObserver.start(),this.scrollObserver.start(),this.streamObserver.start(),this.frameRedirector.start(),this.history.start(),this.preloader.start(),this.started=!0,this.enabled=!0)}disable(){this.enabled=!1}stop(){this.started&&(this.pageObserver.stop(),this.cacheObserver.stop(),this.linkPrefetchObserver.stop(),this.formLinkClickObserver.stop(),this.linkClickObserver.stop(),this.formSubmitObserver.stop(),this.scrollObserver.stop(),this.streamObserver.stop(),this.frameRedirector.stop(),this.history.stop(),this.preloader.stop(),this.started=!1)}registerAdapter(e){this.adapter=e}visit(e,t={}){let s=t.frame?document.getElementById(t.frame):null;if(s instanceof W){let i=t.action||ae(s);s.delegate.proposeVisitIfNavigatedWithAction(s,i),s.src=e.toString()}else this.navigator.proposeVisit(q(e),t)}refresh(e,t){let s=t&&this.recentRequests.has(t),i=e===document.baseURI;!s&&!this.navigator.currentVisit&&i&&this.visit(e,{action:"replace",shouldCacheSnapshot:!1})}connectStreamSource(e){this.streamObserver.connectStreamSource(e)}disconnectStreamSource(e){this.streamObserver.disconnectStreamSource(e)}renderStreamMessage(e){this.streamMessageRenderer.render(se.wrap(e))}clearCache(){this.view.clearSnapshotCache()}setProgressBarDelay(e){console.warn("Please replace `session.setProgressBarDelay(delay)` with `session.progressBarDelay = delay`. The function is deprecated and will be removed in a future version of Turbo.`"),this.progressBarDelay=e}set progressBarDelay(e){I.drive.progressBarDelay=e}get progressBarDelay(){return I.drive.progressBarDelay}set drive(e){I.drive.enabled=e}get drive(){return I.drive.enabled}set formMode(e){I.forms.mode=e}get formMode(){return I.forms.mode}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}get pageRefreshDebouncePeriod(){return this.#e}set pageRefreshDebouncePeriod(e){this.refresh=Hn(this.debouncedRefresh.bind(this),e),this.#e=e}shouldPreloadLink(e){let t=e.hasAttribute("data-turbo-method"),s=e.hasAttribute("data-turbo-stream"),i=e.getAttribute("data-turbo-frame"),n=i=="_top"?null:document.getElementById(i)||ye(e,"turbo-frame:not([disabled])");if(t||s||n instanceof W)return!1;{let o=new URL(e.href);return this.elementIsNavigatable(e)&&te(o,this.snapshot.rootLocation)}}historyPoppedToLocationWithRestorationIdentifierAndDirection(e,t,s){this.enabled?this.navigator.startVisit(e,t,{action:"restore",historyChanged:!0,direction:s}):this.adapter.pageInvalidated({reason:"turbo_disabled"})}scrollPositionChanged(e){this.history.updateRestorationData({scrollPosition:e})}willSubmitFormLinkToLocation(e,t){return this.elementIsNavigatable(e)&&te(t,this.snapshot.rootLocation)}submittedFormLinkToLocation(){}canPrefetchRequestToLocation(e,t){return this.elementIsNavigatable(e)&&te(t,this.snapshot.rootLocation)&&this.navigator.linkPrefetchingIsEnabledForLocation(t)}willFollowLinkToLocation(e,t,s){return this.elementIsNavigatable(e)&&te(t,this.snapshot.rootLocation)&&this.applicationAllowsFollowingLinkToLocation(e,t,s)}followedLinkToLocation(e,t){let s=this.getActionForLink(e),i=e.hasAttribute("data-turbo-stream");this.visit(t.href,{action:s,acceptsStreamResponse:i})}allowsVisitingLocationWithAction(e,t){return this.locationWithActionIsSamePage(e,t)||this.applicationAllowsVisitingLocation(e)}visitProposedToLocation(e,t){Zs(e),this.adapter.visitProposedToLocation(e,t)}visitStarted(e){e.acceptsStreamResponse||(Qe(document.documentElement),this.view.markVisitDirection(e.direction)),Zs(e.location),e.silent||this.notifyApplicationAfterVisitingLocation(e.location,e.action)}visitCompleted(e){this.view.unmarkVisitDirection(),Ye(document.documentElement),this.notifyApplicationAfterPageLoad(e.getTimingMetrics())}locationWithActionIsSamePage(e,t){return this.navigator.locationWithActionIsSamePage(e,t)}visitScrolledToSamePageLocation(e,t){this.notifyApplicationAfterVisitingSamePageLocation(e,t)}willSubmitForm(e,t){let s=ur(e,t);return this.submissionIsNavigatable(e,t)&&te(q(s),this.snapshot.rootLocation)}formSubmitted(e,t){this.navigator.submitForm(e,t)}pageBecameInteractive(){this.view.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()}pageLoaded(){this.history.assumeControlOfScrollRestoration()}pageWillUnload(){this.history.relinquishControlOfScrollRestoration()}receivedMessageFromStream(e){this.renderStreamMessage(e)}viewWillCacheSnapshot(){this.navigator.currentVisit?.silent||this.notifyApplicationBeforeCachingSnapshot()}allowsImmediateRender({element:e},t){let s=this.notifyApplicationBeforeRender(e,t),{defaultPrevented:i,detail:{render:n}}=s;return this.view.renderer&&n&&(this.view.renderer.renderElement=n),!i}viewRenderedSnapshot(e,t,s){this.view.lastRenderedLocation=this.history.location,this.notifyApplicationAfterRender(s)}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,s){return!this.notifyApplicationAfterClickingLinkToLocation(e,t,s).defaultPrevented}applicationAllowsVisitingLocation(e){return!this.notifyApplicationBeforeVisitingLocation(e).defaultPrevented}notifyApplicationAfterClickingLinkToLocation(e,t,s){return x("turbo:click",{target:e,detail:{url:t.href,originalEvent:s},cancelable:!0})}notifyApplicationBeforeVisitingLocation(e){return x("turbo:before-visit",{detail:{url:e.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(e,t){return x("turbo:visit",{detail:{url:e.href,action:t}})}notifyApplicationBeforeCachingSnapshot(){return x("turbo:before-cache")}notifyApplicationBeforeRender(e,t){return x("turbo:before-render",{detail:{newBody:e,...t},cancelable:!0})}notifyApplicationAfterRender(e){return x("turbo:render",{detail:{renderMethod:e}})}notifyApplicationAfterPageLoad(e={}){return x("turbo:load",{detail:{url:this.location.href,timing:e}})}notifyApplicationAfterVisitingSamePageLocation(e,t){dispatchEvent(new HashChangeEvent("hashchange",{oldURL:e.toString(),newURL:t.toString()}))}notifyApplicationAfterFrameLoad(e){return x("turbo:frame-load",{target:e})}notifyApplicationAfterFrameRender(e,t){return x("turbo:frame-render",{detail:{fetchResponse:e},target:t,cancelable:!0})}submissionIsNavigatable(e,t){if(I.forms.mode=="off")return!1;{let s=t?this.elementIsNavigatable(t):!0;return I.forms.mode=="optin"?s&&e.closest('[data-turbo="true"]')!=null:s&&this.elementIsNavigatable(e)}}elementIsNavigatable(e){let t=ye(e,"[data-turbo]"),s=ye(e,"turbo-frame");return I.drive.enabled||s?t?t.getAttribute("data-turbo")!="false":!0:t?t.getAttribute("data-turbo")=="true":!1}getActionForLink(e){return ae(e)||"advance"}get snapshot(){return this.view.snapshot}};function Zs(r){Object.defineProperties(r,No)}var No={absoluteURL:{get(){return this.toString()}}},B=new rr(pi),{cache:xo,navigator:Bo}=B;function ut(){B.start()}function Io(r){B.registerAdapter(r)}function Do(r,e){B.visit(r,e)}function Ei(r){B.connectStreamSource(r)}function Si(r){B.disconnectStreamSource(r)}function qo(r){B.renderStreamMessage(r)}function Ho(){console.warn("Please replace `Turbo.clearCache()` with `Turbo.cache.clear()`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),B.clearCache()}function jo(r){console.warn("Please replace `Turbo.setProgressBarDelay(delay)` with `Turbo.config.drive.progressBarDelay = delay`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),I.drive.progressBarDelay=r}function Vo(r){console.warn("Please replace `Turbo.setConfirmMethod(confirmMethod)` with `Turbo.config.forms.confirm = confirmMethod`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),I.forms.confirm=r}function $o(r){console.warn("Please replace `Turbo.setFormMode(mode)` with `Turbo.config.forms.mode = mode`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),I.forms.mode=r}function Uo(r,e){at.renderElement(r,e)}function Wo(r,e){ot.renderElement(r,e)}var Ko=Object.freeze({__proto__:null,navigator:Bo,session:B,cache:xo,PageRenderer:Pe,PageSnapshot:U,FrameRenderer:Ce,fetch:mi,config:I,start:ut,registerAdapter:Io,visit:Do,connectStreamSource:Ei,disconnectStreamSource:Si,renderStreamMessage:qo,clearCache:Ho,setProgressBarDelay:jo,setConfirmMethod:Vo,setFormMode:$o,morphBodyElements:Uo,morphTurboFrameElements:Wo,morphChildren:dr,morphElements:ct}),sr=class extends Error{},ir=class{fetchResponseLoaded=e=>Promise.resolve();#e=null;#t=()=>{};#r=!1;#n=!1;#o=new Set;#i=!1;action=null;constructor(e){this.element=e,this.view=new xt(this,this.element),this.appearanceObserver=new Ft(this,this.element),this.formLinkClickObserver=new it(this,this.element),this.linkInterceptor=new rt(this,this.element),this.restorationIdentifier=re(),this.formSubmitObserver=new Me(this,this.element)}connect(){this.#r||(this.#r=!0,this.loadingStyle==ve.lazy?this.appearanceObserver.start():this.#s(),this.formLinkClickObserver.start(),this.linkInterceptor.start(),this.formSubmitObserver.start())}disconnect(){this.#r&&(this.#r=!1,this.appearanceObserver.stop(),this.formLinkClickObserver.stop(),this.linkInterceptor.stop(),this.formSubmitObserver.stop())}disabledChanged(){this.loadingStyle==ve.eager&&this.#s()}sourceURLChanged(){this.#b("src")||(this.element.isConnected&&(this.complete=!1),(this.loadingStyle==ve.eager||this.#n)&&this.#s())}sourceURLReloaded(){let{refresh:e,src:t}=this.element;return this.#i=t&&e==="morph",this.element.removeAttribute("complete"),this.element.src=null,this.element.src=t,this.element.loaded}loadingStyleChanged(){this.loadingStyle==ve.lazy?this.appearanceObserver.start():(this.appearanceObserver.stop(),this.#s())}async#s(){this.enabled&&this.isActive&&!this.complete&&this.sourceURL&&(this.element.loaded=this.#l(q(this.sourceURL)),this.appearanceObserver.stop(),await this.element.loaded,this.#n=!0)}async loadResponse(e){(e.redirected||e.succeeded&&e.isHTML)&&(this.sourceURL=e.response.url);try{let t=await e.responseHTML;if(t){let s=ni(t);U.fromDocument(s).isVisitable?await this.#c(e,s):await this.#f(e)}}finally{this.#i=!1,this.fetchResponseLoaded=()=>Promise.resolve()}}elementAppearedInViewport(e){this.proposeVisitIfNavigatedWithAction(e,ae(e)),this.#s()}willSubmitFormLinkToLocation(e){return this.#u(e)}submittedFormLinkToLocation(e,t,s){let i=this.#a(e);i&&s.setAttribute("data-turbo-frame",i.id)}shouldInterceptLinkClick(e,t,s){return this.#u(e)}linkClickIntercepted(e,t){this.#d(e,t)}willSubmitForm(e,t){return e.closest("turbo-frame")==this.element&&this.#u(e,t)}formSubmitted(e,t){this.formSubmission&&this.formSubmission.stop(),this.formSubmission=new et(this,e,t);let{fetchRequest:s}=this.formSubmission;this.prepareRequest(s),this.formSubmission.start()}prepareRequest(e){e.headers["Turbo-Frame"]=this.id,this.currentNavigationElement?.hasAttribute("data-turbo-stream")&&e.acceptResponseType(se.contentType)}requestStarted(e){Qe(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){Ye(this.element)}formSubmissionStarted({formElement:e}){Qe(e,this.#a(e))}formSubmissionSucceededWithResponse(e,t){let s=this.#a(e.formElement,e.submitter);s.delegate.proposeVisitIfNavigatedWithAction(s,ae(e.submitter,e.formElement,s)),s.delegate.loadResponse(t),e.isSafe||B.clearCache()}formSubmissionFailedWithResponse(e,t){this.element.delegate.loadResponse(t),B.clearCache()}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished({formElement:e}){Ye(e,this.#a(e))}allowsImmediateRender({element:e},t){let s=x("turbo:before-frame-render",{target:this.element,detail:{newFrame:e,...t},cancelable:!0}),{defaultPrevented:i,detail:{render:n}}=s;return this.view.renderer&&n&&(this.view.renderer.renderElement=n),!i}viewRenderedSnapshot(e,t,s){}preloadOnLoadLinksForView(e){B.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#c(e,t){let s=await this.extractForeignFrameElement(t.body),i=this.#i?ot:Ce;if(s){let n=new Ee(s),o=new i(this,this.view.snapshot,n,!1,!1);this.view.renderPromise&&await this.view.renderPromise,this.changeHistory(),await this.view.render(o),this.complete=!0,B.frameRendered(e,this.element),B.frameLoaded(this.element),await this.fetchResponseLoaded(e)}else this.#p(e)&&this.#m(e)}async#l(e){let t=new ue(this,j.get,e,new URLSearchParams,this.element);return this.#e?.cancel(),this.#e=t,new Promise(s=>{this.#t=()=>{this.#t=()=>{},this.#e=null,s()},t.perform()})}#d(e,t,s){let i=this.#a(e,s);i.delegate.proposeVisitIfNavigatedWithAction(i,ae(s,e,i)),this.#w(e,()=>{i.src=t})}proposeVisitIfNavigatedWithAction(e,t=null){if(this.action=t,this.action){let s=U.fromElement(e).clone(),{visitCachedSnapshot:i}=e.delegate;e.delegate.fetchResponseLoaded=async n=>{if(e.src){let{statusCode:o,redirected:c}=n,u=await n.responseHTML,g={response:{statusCode:o,redirected:c,responseHTML:u},visitCachedSnapshot:i,willRender:!1,updateHistory:!1,restorationIdentifier:this.restorationIdentifier,snapshot:s};this.action&&(g.action=this.action),B.visit(e.src,g)}}}}changeHistory(){if(this.action){let e=ai(this.action);B.history.update(e,q(this.element.src||""),this.restorationIdentifier)}}async#f(e){console.warn(`The response (${e.statusCode}) from <turbo-frame id="${this.element.id}"> is performing a full page visit due to turbo-visit-control.`),await this.#h(e.response)}#p(e){this.element.setAttribute("complete","");let t=e.response,s=async(n,o)=>{n instanceof Response?this.#h(n):B.visit(n,o)};return!x("turbo:frame-missing",{target:this.element,detail:{response:t,visit:s},cancelable:!0}).defaultPrevented}#m(e){this.view.missing(),this.#g(e)}#g(e){let t=`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.`;throw new sr(t)}async#h(e){let t=new Re(e),s=await t.responseHTML,{location:i,redirected:n,statusCode:o}=t;return B.visit(i,{response:{redirected:n,statusCode:o,responseHTML:s}})}#a(e,t){let s=Ge("data-turbo-frame",t,e)||this.element.getAttribute("target");return ei(s)??this.element}async extractForeignFrameElement(e){let t,s=CSS.escape(this.id);try{if(t=ti(e.querySelector(`turbo-frame#${s}`),this.sourceURL),t)return t;if(t=ti(e.querySelector(`turbo-frame[src][recurse~=${s}]`),this.sourceURL),t)return await t.loaded,await this.extractForeignFrameElement(t)}catch(i){return console.error(i),new W}return null}#v(e,t){let s=ur(e,t);return te(q(s),this.rootLocation)}#u(e,t){let s=Ge("data-turbo-frame",t,e)||this.element.getAttribute("target");if(e instanceof HTMLFormElement&&!this.#v(e,t)||!this.enabled||s=="_top")return!1;if(s){let i=ei(s);if(i)return!i.disabled}return!(!B.elementIsNavigatable(e)||t&&!B.elementIsNavigatable(t))}get id(){return this.element.id}get enabled(){return!this.element.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.#r}get rootLocation(){let t=this.element.ownerDocument.querySelector('meta[name="turbo-root"]')?.content??"/";return q(t)}#b(e){return this.#o.has(e)}#y(e,t){this.#o.add(e),t(),this.#o.delete(e)}#w(e,t){this.currentNavigationElement=e,t(),delete this.currentNavigationElement}};function ei(r){if(r!=null){let e=document.getElementById(r);if(e instanceof W)return e}}function ti(r,e){if(r){let t=r.getAttribute("src");if(t!=null&&e!=null&&fi(t,e))throw new Error(`Matching <turbo-frame id="${r.id}"> element has a source URL which references itself`);if(r.ownerDocument!==document&&(r=document.importNode(r,!0)),r instanceof W)return r.connectedCallback(),r.disconnectedCallback(),r}}var Ai={after(){this.targetElements.forEach(r=>r.parentElement?.insertBefore(this.templateContent,r.nextSibling))},append(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(r=>r.append(this.templateContent))},before(){this.targetElements.forEach(r=>r.parentElement?.insertBefore(this.templateContent,r))},prepend(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(r=>r.prepend(this.templateContent))},remove(){this.targetElements.forEach(r=>r.remove())},replace(){let r=this.getAttribute("method");this.targetElements.forEach(e=>{r==="morph"?ct(e,this.templateContent):e.replaceWith(this.templateContent)})},update(){let r=this.getAttribute("method");this.targetElements.forEach(e=>{r==="morph"?dr(e,this.templateContent):(e.innerHTML="",e.append(this.templateContent))})},refresh(){B.refresh(this.baseURI,this.requestId)}},nr=class r 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 Oe(),await e.detail.render(this))})()}disconnect(){try{this.remove()}catch{}}removeDuplicateTargetChildren(){this.duplicateChildren.forEach(e=>e.remove())}get duplicateChildren(){let e=this.targetElements.flatMap(s=>[...s.children]).filter(s=>!!s.getAttribute("id")),t=[...this.templateContent?.children||[]].filter(s=>!!s.getAttribute("id")).map(s=>s.getAttribute("id"));return e.filter(s=>t.includes(s.getAttribute("id")))}get performAction(){if(this.action){let e=Ai[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}else if(this.firstElementChild instanceof HTMLTemplateElement)return this.firstElementChild;this.#e("first child element must be a <template> element")}get action(){return this.getAttribute("action")}get target(){return this.getAttribute("target")}get targets(){return this.getAttribute("targets")}get requestId(){return this.getAttribute("request-id")}#e(e){throw new 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:r.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):[]}},or=class extends HTMLElement{streamSource=null;connectedCallback(){this.streamSource=this.src.match(/^ws{1,2}:/)?new WebSocket(this.src):new EventSource(this.src),Ei(this.streamSource)}disconnectedCallback(){this.streamSource&&(this.streamSource.close(),Si(this.streamSource))}get src(){return this.getAttribute("src")||""}};W.delegateConstructor=ir;customElements.get("turbo-frame")===void 0&&customElements.define("turbo-frame",W);customElements.get("turbo-stream")===void 0&&customElements.define("turbo-stream",nr);customElements.get("turbo-stream-source")===void 0&&customElements.define("turbo-stream-source",or);(()=>{let r=document.currentScript;if(r&&!r.hasAttribute("data-turbo-suppress-warning"))for(r=r.parentElement;r;){if(r==document.body)return console.warn(oi`
|
|
28
|
+
You are loading Turbo from a <script> element inside the <body> element. This is probably not what you meant to do!
|
|
29
|
+
|
|
30
|
+
Load your application’s JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change.
|
|
31
|
+
|
|
32
|
+
For more information, see: https://turbo.hotwired.dev/handbook/building#working-with-script-elements
|
|
33
|
+
|
|
34
|
+
——
|
|
35
|
+
Suppress this warning by adding a "data-turbo-suppress-warning" attribute to: %s
|
|
36
|
+
`,r.outerHTML);r=r.parentElement}})();window.Turbo={...Ko,StreamActions:Ai};ut();var fr=class{constructor(e,t,s){this.eventTarget=e,this.eventName=t,this.eventOptions=s,this.unorderedBindings=new Set}connect(){this.eventTarget.addEventListener(this.eventName,this,this.eventOptions)}disconnect(){this.eventTarget.removeEventListener(this.eventName,this,this.eventOptions)}bindingConnected(e){this.unorderedBindings.add(e)}bindingDisconnected(e){this.unorderedBindings.delete(e)}handleEvent(e){let t=Jo(e);for(let s of this.bindings){if(t.immediatePropagationStopped)break;s.handleEvent(t)}}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort((e,t)=>{let s=e.index,i=t.index;return s<i?-1:s>i?1:0})}};function Jo(r){if("immediatePropagationStopped"in r)return r;{let{stopImmediatePropagation:e}=r;return Object.assign(r,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,e.call(this)}})}}var pr=class{constructor(e){this.application=e,this.eventListenerMaps=new Map,this.started=!1}start(){this.started||(this.started=!0,this.eventListeners.forEach(e=>e.connect()))}stop(){this.started&&(this.started=!1,this.eventListeners.forEach(e=>e.disconnect()))}get eventListeners(){return Array.from(this.eventListenerMaps.values()).reduce((e,t)=>e.concat(Array.from(t.values())),[])}bindingConnected(e){this.fetchEventListenerForBinding(e).bindingConnected(e)}bindingDisconnected(e,t=!1){this.fetchEventListenerForBinding(e).bindingDisconnected(e),t&&this.clearEventListenersForBinding(e)}handleError(e,t,s={}){this.application.handleError(e,`Error ${t}`,s)}clearEventListenersForBinding(e){let t=this.fetchEventListenerForBinding(e);t.hasBindings()||(t.disconnect(),this.removeMappedEventListenerFor(e))}removeMappedEventListenerFor(e){let{eventTarget:t,eventName:s,eventOptions:i}=e,n=this.fetchEventListenerMapForEventTarget(t),o=this.cacheKey(s,i);n.delete(o),n.size==0&&this.eventListenerMaps.delete(t)}fetchEventListenerForBinding(e){let{eventTarget:t,eventName:s,eventOptions:i}=e;return this.fetchEventListener(t,s,i)}fetchEventListener(e,t,s){let i=this.fetchEventListenerMapForEventTarget(e),n=this.cacheKey(t,s),o=i.get(n);return o||(o=this.createEventListener(e,t,s),i.set(n,o)),o}createEventListener(e,t,s){let i=new fr(e,t,s);return this.started&&i.connect(),i}fetchEventListenerMapForEventTarget(e){let t=this.eventListenerMaps.get(e);return t||(t=new Map,this.eventListenerMaps.set(e,t)),t}cacheKey(e,t){let s=[e];return Object.keys(t).sort().forEach(i=>{s.push(`${t[i]?"":"!"}${i}`)}),s.join(":")}},Xo={stop({event:r,value:e}){return e&&r.stopPropagation(),!0},prevent({event:r,value:e}){return e&&r.preventDefault(),!0},self({event:r,value:e,element:t}){return e?t===r.target:!0}},Go=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function Qo(r){let t=r.trim().match(Go)||[],s=t[2],i=t[3];return i&&!["keydown","keyup","keypress"].includes(s)&&(s+=`.${i}`,i=""),{eventTarget:Yo(t[4]),eventName:s,eventOptions:t[7]?Zo(t[7]):{},identifier:t[5],methodName:t[6],keyFilter:t[1]||i}}function Yo(r){if(r=="window")return window;if(r=="document")return document}function Zo(r){return r.split(":").reduce((e,t)=>Object.assign(e,{[t.replace(/^!/,"")]:!/^!/.test(t)}),{})}function ea(r){if(r==window)return"window";if(r==document)return"document"}function Br(r){return r.replace(/(?:[_-])([a-z0-9])/g,(e,t)=>t.toUpperCase())}function mr(r){return Br(r.replace(/--/g,"-").replace(/__/g,"_"))}function Ne(r){return r.charAt(0).toUpperCase()+r.slice(1)}function Fi(r){return r.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`)}function ta(r){return r.match(/[^\s]+/g)||[]}function _i(r){return r!=null}function gr(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var Ti=["meta","ctrl","alt","shift"],vr=class{constructor(e,t,s,i){this.element=e,this.index=t,this.eventTarget=s.eventTarget||e,this.eventName=s.eventName||ra(e)||ht("missing event name"),this.eventOptions=s.eventOptions||{},this.identifier=s.identifier||ht("missing identifier"),this.methodName=s.methodName||ht("missing method name"),this.keyFilter=s.keyFilter||"",this.schema=i}static forToken(e,t){return new this(e.element,e.index,Qo(e.content),t)}toString(){let e=this.keyFilter?`.${this.keyFilter}`:"",t=this.eventTargetName?`@${this.eventTargetName}`:"";return`${this.eventName}${e}${t}->${this.identifier}#${this.methodName}`}shouldIgnoreKeyboardEvent(e){if(!this.keyFilter)return!1;let t=this.keyFilter.split("+");if(this.keyFilterDissatisfied(e,t))return!0;let s=t.filter(i=>!Ti.includes(i))[0];return s?(gr(this.keyMappings,s)||ht(`contains unknown key filter: ${this.keyFilter}`),this.keyMappings[s].toLowerCase()!==e.key.toLowerCase()):!1}shouldIgnoreMouseEvent(e){if(!this.keyFilter)return!1;let t=[this.keyFilter];return!!this.keyFilterDissatisfied(e,t)}get params(){let e={},t=new RegExp(`^data-${this.identifier}-(.+)-param$`,"i");for(let{name:s,value:i}of Array.from(this.element.attributes)){let n=s.match(t),o=n&&n[1];o&&(e[Br(o)]=sa(i))}return e}get eventTargetName(){return ea(this.eventTarget)}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(e,t){let[s,i,n,o]=Ti.map(c=>t.includes(c));return e.metaKey!==s||e.ctrlKey!==i||e.altKey!==n||e.shiftKey!==o}},Oi={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:r=>r.getAttribute("type")=="submit"?"click":"input",select:()=>"change",textarea:()=>"input"};function ra(r){let e=r.tagName.toLowerCase();if(e in Oi)return Oi[e](r)}function ht(r){throw new Error(r)}function sa(r){try{return JSON.parse(r)}catch{return r}}var br=class{constructor(e,t){this.context=e,this.action=t}get index(){return this.action.index}get eventTarget(){return this.action.eventTarget}get eventOptions(){return this.action.eventOptions}get identifier(){return this.context.identifier}handleEvent(e){let t=this.prepareActionEvent(e);this.willBeInvokedByEvent(e)&&this.applyEventModifiers(t)&&this.invokeWithEvent(t)}get eventName(){return this.action.eventName}get method(){let e=this.controller[this.methodName];if(typeof e=="function")return e;throw new Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}applyEventModifiers(e){let{element:t}=this.action,{actionDescriptorFilters:s}=this.context.application,{controller:i}=this.context,n=!0;for(let[o,c]of Object.entries(this.eventOptions))if(o in s){let u=s[o];n=n&&u({name:o,value:c,event:e,element:t,controller:i})}else continue;return n}prepareActionEvent(e){return Object.assign(e,{params:this.action.params})}invokeWithEvent(e){let{target:t,currentTarget:s}=e;try{this.method.call(this.controller,e),this.context.logDebugActivity(this.methodName,{event:e,target:t,currentTarget:s,action:this.methodName})}catch(i){let{identifier:n,controller:o,element:c,index:u}=this,p={identifier:n,controller:o,element:c,index:u,event:e};this.context.handleError(i,`invoking action "${this.action}"`,p)}}willBeInvokedByEvent(e){let t=e.target;return e instanceof KeyboardEvent&&this.action.shouldIgnoreKeyboardEvent(e)||e instanceof MouseEvent&&this.action.shouldIgnoreMouseEvent(e)?!1:this.element===t?!0:t instanceof Element&&this.element.contains(t)?this.scope.containsElement(t):this.scope.containsElement(this.action.element)}get controller(){return this.context.controller}get methodName(){return this.action.methodName}get element(){return this.scope.element}get scope(){return this.context.scope}},lt=class{constructor(e,t){this.mutationObserverInit={attributes:!0,childList:!0,subtree:!0},this.element=e,this.started=!1,this.delegate=t,this.elements=new Set,this.mutationObserver=new MutationObserver(s=>this.processMutations(s))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,this.mutationObserverInit),this.refresh())}pause(e){this.started&&(this.mutationObserver.disconnect(),this.started=!1),e(),this.started||(this.mutationObserver.observe(this.element,this.mutationObserverInit),this.started=!0)}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started){let e=new Set(this.matchElementsInTree());for(let t of Array.from(this.elements))e.has(t)||this.removeElement(t);for(let t of Array.from(e))this.addElement(t)}}processMutations(e){if(this.started)for(let t of e)this.processMutation(t)}processMutation(e){e.type=="attributes"?this.processAttributeChange(e.target,e.attributeName):e.type=="childList"&&(this.processRemovedNodes(e.removedNodes),this.processAddedNodes(e.addedNodes))}processAttributeChange(e,t){this.elements.has(e)?this.delegate.elementAttributeChanged&&this.matchElement(e)?this.delegate.elementAttributeChanged(e,t):this.removeElement(e):this.matchElement(e)&&this.addElement(e)}processRemovedNodes(e){for(let t of Array.from(e)){let s=this.elementFromNode(t);s&&this.processTree(s,this.removeElement)}}processAddedNodes(e){for(let t of Array.from(e)){let s=this.elementFromNode(t);s&&this.elementIsActive(s)&&this.processTree(s,this.addElement)}}matchElement(e){return this.delegate.matchElement(e)}matchElementsInTree(e=this.element){return this.delegate.matchElementsInTree(e)}processTree(e,t){for(let s of this.matchElementsInTree(e))t.call(this,s)}elementFromNode(e){if(e.nodeType==Node.ELEMENT_NODE)return e}elementIsActive(e){return e.isConnected!=this.element.isConnected?!1:this.element.contains(e)}addElement(e){this.elements.has(e)||this.elementIsActive(e)&&(this.elements.add(e),this.delegate.elementMatched&&this.delegate.elementMatched(e))}removeElement(e){this.elements.has(e)&&(this.elements.delete(e),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(e))}},dt=class{constructor(e,t,s){this.attributeName=t,this.delegate=s,this.elementObserver=new lt(e,this)}get element(){return this.elementObserver.element}get selector(){return`[${this.attributeName}]`}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get started(){return this.elementObserver.started}matchElement(e){return e.hasAttribute(this.attributeName)}matchElementsInTree(e){let t=this.matchElement(e)?[e]:[],s=Array.from(e.querySelectorAll(this.selector));return t.concat(s)}elementMatched(e){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(e,this.attributeName)}elementUnmatched(e){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(e,this.attributeName)}elementAttributeChanged(e,t){this.delegate.elementAttributeValueChanged&&this.attributeName==t&&this.delegate.elementAttributeValueChanged(e,t)}};function ia(r,e,t){Ni(r,e).add(t)}function na(r,e,t){Ni(r,e).delete(t),oa(r,e)}function Ni(r,e){let t=r.get(e);return t||(t=new Set,r.set(e,t)),t}function oa(r,e){let t=r.get(e);t!=null&&t.size==0&&r.delete(e)}var G=class{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce((t,s)=>t.concat(Array.from(s)),[])}get size(){return Array.from(this.valuesByKey.values()).reduce((t,s)=>t+s.size,0)}add(e,t){ia(this.valuesByKey,e,t)}delete(e,t){na(this.valuesByKey,e,t)}has(e,t){let s=this.valuesByKey.get(e);return s!=null&&s.has(t)}hasKey(e){return this.valuesByKey.has(e)}hasValue(e){return Array.from(this.valuesByKey.values()).some(s=>s.has(e))}getValuesForKey(e){let t=this.valuesByKey.get(e);return t?Array.from(t):[]}getKeysForValue(e){return Array.from(this.valuesByKey).filter(([t,s])=>s.has(e)).map(([t,s])=>t)}};var yr=class{constructor(e,t,s,i){this._selector=t,this.details=i,this.elementObserver=new lt(e,this),this.delegate=s,this.matchesByElement=new G}get started(){return this.elementObserver.started}get selector(){return this._selector}set selector(e){this._selector=e,this.refresh()}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get element(){return this.elementObserver.element}matchElement(e){let{selector:t}=this;if(t){let s=e.matches(t);return this.delegate.selectorMatchElement?s&&this.delegate.selectorMatchElement(e,this.details):s}else return!1}matchElementsInTree(e){let{selector:t}=this;if(t){let s=this.matchElement(e)?[e]:[],i=Array.from(e.querySelectorAll(t)).filter(n=>this.matchElement(n));return s.concat(i)}else return[]}elementMatched(e){let{selector:t}=this;t&&this.selectorMatched(e,t)}elementUnmatched(e){let t=this.matchesByElement.getKeysForValue(e);for(let s of t)this.selectorUnmatched(e,s)}elementAttributeChanged(e,t){let{selector:s}=this;if(s){let i=this.matchElement(e),n=this.matchesByElement.has(s,e);i&&!n?this.selectorMatched(e,s):!i&&n&&this.selectorUnmatched(e,s)}}selectorMatched(e,t){this.delegate.selectorMatched(e,t,this.details),this.matchesByElement.add(t,e)}selectorUnmatched(e,t){this.delegate.selectorUnmatched(e,t,this.details),this.matchesByElement.delete(t,e)}},wr=class{constructor(e,t){this.element=e,this.delegate=t,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver(s=>this.processMutations(s))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,attributeOldValue:!0}),this.refresh())}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started)for(let e of this.knownAttributeNames)this.refreshAttribute(e,null)}processMutations(e){if(this.started)for(let t of e)this.processMutation(t)}processMutation(e){let t=e.attributeName;t&&this.refreshAttribute(t,e.oldValue)}refreshAttribute(e,t){let s=this.delegate.getStringMapKeyForAttribute(e);if(s!=null){this.stringMap.has(e)||this.stringMapKeyAdded(s,e);let i=this.element.getAttribute(e);if(this.stringMap.get(e)!=i&&this.stringMapValueChanged(i,s,t),i==null){let n=this.stringMap.get(e);this.stringMap.delete(e),n&&this.stringMapKeyRemoved(s,e,n)}else this.stringMap.set(e,i)}}stringMapKeyAdded(e,t){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(e,t)}stringMapValueChanged(e,t,s){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(e,t,s)}stringMapKeyRemoved(e,t,s){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(e,t,s)}get knownAttributeNames(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))}get currentAttributeNames(){return Array.from(this.element.attributes).map(e=>e.name)}get recordedAttributeNames(){return Array.from(this.stringMap.keys())}},ft=class{constructor(e,t,s){this.attributeObserver=new dt(e,t,this),this.delegate=s,this.tokensByElement=new G}get started(){return this.attributeObserver.started}start(){this.attributeObserver.start()}pause(e){this.attributeObserver.pause(e)}stop(){this.attributeObserver.stop()}refresh(){this.attributeObserver.refresh()}get element(){return this.attributeObserver.element}get attributeName(){return this.attributeObserver.attributeName}elementMatchedAttribute(e){this.tokensMatched(this.readTokensForElement(e))}elementAttributeValueChanged(e){let[t,s]=this.refreshTokensForElement(e);this.tokensUnmatched(t),this.tokensMatched(s)}elementUnmatchedAttribute(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))}tokensMatched(e){e.forEach(t=>this.tokenMatched(t))}tokensUnmatched(e){e.forEach(t=>this.tokenUnmatched(t))}tokenMatched(e){this.delegate.tokenMatched(e),this.tokensByElement.add(e.element,e)}tokenUnmatched(e){this.delegate.tokenUnmatched(e),this.tokensByElement.delete(e.element,e)}refreshTokensForElement(e){let t=this.tokensByElement.getValuesForKey(e),s=this.readTokensForElement(e),i=ca(t,s).findIndex(([n,o])=>!ua(n,o));return i==-1?[[],[]]:[t.slice(i),s.slice(i)]}readTokensForElement(e){let t=this.attributeName,s=e.getAttribute(t)||"";return aa(s,e,t)}};function aa(r,e,t){return r.trim().split(/\s+/).filter(s=>s.length).map((s,i)=>({element:e,attributeName:t,content:s,index:i}))}function ca(r,e){let t=Math.max(r.length,e.length);return Array.from({length:t},(s,i)=>[r[i],e[i]])}function ua(r,e){return r&&e&&r.index==e.index&&r.content==e.content}var pt=class{constructor(e,t,s){this.tokenListObserver=new ft(e,t,this),this.delegate=s,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}get started(){return this.tokenListObserver.started}start(){this.tokenListObserver.start()}stop(){this.tokenListObserver.stop()}refresh(){this.tokenListObserver.refresh()}get element(){return this.tokenListObserver.element}get attributeName(){return this.tokenListObserver.attributeName}tokenMatched(e){let{element:t}=e,{value:s}=this.fetchParseResultForToken(e);s&&(this.fetchValuesByTokenForElement(t).set(e,s),this.delegate.elementMatchedValue(t,s))}tokenUnmatched(e){let{element:t}=e,{value:s}=this.fetchParseResultForToken(e);s&&(this.fetchValuesByTokenForElement(t).delete(e),this.delegate.elementUnmatchedValue(t,s))}fetchParseResultForToken(e){let t=this.parseResultsByToken.get(e);return t||(t=this.parseToken(e),this.parseResultsByToken.set(e,t)),t}fetchValuesByTokenForElement(e){let t=this.valuesByTokenByElement.get(e);return t||(t=new Map,this.valuesByTokenByElement.set(e,t)),t}parseToken(e){try{return{value:this.delegate.parseValueForToken(e)}}catch(t){return{error:t}}}},Er=class{constructor(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new pt(this.element,this.actionAttribute,this),this.valueListObserver.start())}stop(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())}get element(){return this.context.element}get identifier(){return this.context.identifier}get actionAttribute(){return this.schema.actionAttribute}get schema(){return this.context.schema}get bindings(){return Array.from(this.bindingsByAction.values())}connectAction(e){let t=new br(this.context,e);this.bindingsByAction.set(e,t),this.delegate.bindingConnected(t)}disconnectAction(e){let t=this.bindingsByAction.get(e);t&&(this.bindingsByAction.delete(e),this.delegate.bindingDisconnected(t))}disconnectAllActions(){this.bindings.forEach(e=>this.delegate.bindingDisconnected(e,!0)),this.bindingsByAction.clear()}parseValueForToken(e){let t=vr.forToken(e,this.schema);if(t.identifier==this.identifier)return t}elementMatchedValue(e,t){this.connectAction(t)}elementUnmatchedValue(e,t){this.disconnectAction(t)}},Sr=class{constructor(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new wr(this.element,this),this.valueDescriptorMap=this.controller.valueDescriptorMap}start(){this.stringMapObserver.start(),this.invokeChangedCallbacksForDefaultValues()}stop(){this.stringMapObserver.stop()}get element(){return this.context.element}get controller(){return this.context.controller}getStringMapKeyForAttribute(e){if(e in this.valueDescriptorMap)return this.valueDescriptorMap[e].name}stringMapKeyAdded(e,t){let s=this.valueDescriptorMap[t];this.hasValue(e)||this.invokeChangedCallback(e,s.writer(this.receiver[e]),s.writer(s.defaultValue))}stringMapValueChanged(e,t,s){let i=this.valueDescriptorNameMap[t];e!==null&&(s===null&&(s=i.writer(i.defaultValue)),this.invokeChangedCallback(t,e,s))}stringMapKeyRemoved(e,t,s){let i=this.valueDescriptorNameMap[e];this.hasValue(e)?this.invokeChangedCallback(e,i.writer(this.receiver[e]),s):this.invokeChangedCallback(e,i.writer(i.defaultValue),s)}invokeChangedCallbacksForDefaultValues(){for(let{key:e,name:t,defaultValue:s,writer:i}of this.valueDescriptors)s!=null&&!this.controller.data.has(e)&&this.invokeChangedCallback(t,i(s),void 0)}invokeChangedCallback(e,t,s){let i=`${e}Changed`,n=this.receiver[i];if(typeof n=="function"){let o=this.valueDescriptorNameMap[e];try{let c=o.reader(t),u=s;s&&(u=o.reader(s)),n.call(this.receiver,c,u)}catch(c){throw c instanceof TypeError&&(c.message=`Stimulus Value "${this.context.identifier}.${o.name}" - ${c.message}`),c}}}get valueDescriptors(){let{valueDescriptorMap:e}=this;return Object.keys(e).map(t=>e[t])}get valueDescriptorNameMap(){let e={};return Object.keys(this.valueDescriptorMap).forEach(t=>{let s=this.valueDescriptorMap[t];e[s.name]=s}),e}hasValue(e){let t=this.valueDescriptorNameMap[e],s=`has${Ne(t.name)}`;return this.receiver[s]}},Ar=class{constructor(e,t){this.context=e,this.delegate=t,this.targetsByName=new G}start(){this.tokenListObserver||(this.tokenListObserver=new ft(this.element,this.attributeName,this),this.tokenListObserver.start())}stop(){this.tokenListObserver&&(this.disconnectAllTargets(),this.tokenListObserver.stop(),delete this.tokenListObserver)}tokenMatched({element:e,content:t}){this.scope.containsElement(e)&&this.connectTarget(e,t)}tokenUnmatched({element:e,content:t}){this.disconnectTarget(e,t)}connectTarget(e,t){var s;this.targetsByName.has(t,e)||(this.targetsByName.add(t,e),(s=this.tokenListObserver)===null||s===void 0||s.pause(()=>this.delegate.targetConnected(e,t)))}disconnectTarget(e,t){var s;this.targetsByName.has(t,e)&&(this.targetsByName.delete(t,e),(s=this.tokenListObserver)===null||s===void 0||s.pause(()=>this.delegate.targetDisconnected(e,t)))}disconnectAllTargets(){for(let e of this.targetsByName.keys)for(let t of this.targetsByName.getValuesForKey(e))this.disconnectTarget(t,e)}get attributeName(){return`data-${this.context.identifier}-target`}get element(){return this.context.element}get scope(){return this.context.scope}};function xe(r,e){let t=xi(r);return Array.from(t.reduce((s,i)=>(la(i,e).forEach(n=>s.add(n)),s),new Set))}function ha(r,e){return xi(r).reduce((s,i)=>(s.push(...da(i,e)),s),[])}function xi(r){let e=[];for(;r;)e.push(r),r=Object.getPrototypeOf(r);return e.reverse()}function la(r,e){let t=r[e];return Array.isArray(t)?t:[]}function da(r,e){let t=r[e];return t?Object.keys(t).map(s=>[s,t[s]]):[]}var _r=class{constructor(e,t){this.started=!1,this.context=e,this.delegate=t,this.outletsByName=new G,this.outletElementsByName=new G,this.selectorObserverMap=new Map,this.attributeObserverMap=new Map}start(){this.started||(this.outletDefinitions.forEach(e=>{this.setupSelectorObserverForOutlet(e),this.setupAttributeObserverForOutlet(e)}),this.started=!0,this.dependentContexts.forEach(e=>e.refresh()))}refresh(){this.selectorObserverMap.forEach(e=>e.refresh()),this.attributeObserverMap.forEach(e=>e.refresh())}stop(){this.started&&(this.started=!1,this.disconnectAllOutlets(),this.stopSelectorObservers(),this.stopAttributeObservers())}stopSelectorObservers(){this.selectorObserverMap.size>0&&(this.selectorObserverMap.forEach(e=>e.stop()),this.selectorObserverMap.clear())}stopAttributeObservers(){this.attributeObserverMap.size>0&&(this.attributeObserverMap.forEach(e=>e.stop()),this.attributeObserverMap.clear())}selectorMatched(e,t,{outletName:s}){let i=this.getOutlet(e,s);i&&this.connectOutlet(i,e,s)}selectorUnmatched(e,t,{outletName:s}){let i=this.getOutletFromMap(e,s);i&&this.disconnectOutlet(i,e,s)}selectorMatchElement(e,{outletName:t}){let s=this.selector(t),i=this.hasOutlet(e,t),n=e.matches(`[${this.schema.controllerAttribute}~=${t}]`);return s?i&&n&&e.matches(s):!1}elementMatchedAttribute(e,t){let s=this.getOutletNameFromOutletAttributeName(t);s&&this.updateSelectorObserverForOutlet(s)}elementAttributeValueChanged(e,t){let s=this.getOutletNameFromOutletAttributeName(t);s&&this.updateSelectorObserverForOutlet(s)}elementUnmatchedAttribute(e,t){let s=this.getOutletNameFromOutletAttributeName(t);s&&this.updateSelectorObserverForOutlet(s)}connectOutlet(e,t,s){var i;this.outletElementsByName.has(s,t)||(this.outletsByName.add(s,e),this.outletElementsByName.add(s,t),(i=this.selectorObserverMap.get(s))===null||i===void 0||i.pause(()=>this.delegate.outletConnected(e,t,s)))}disconnectOutlet(e,t,s){var i;this.outletElementsByName.has(s,t)&&(this.outletsByName.delete(s,e),this.outletElementsByName.delete(s,t),(i=this.selectorObserverMap.get(s))===null||i===void 0||i.pause(()=>this.delegate.outletDisconnected(e,t,s)))}disconnectAllOutlets(){for(let e of this.outletElementsByName.keys)for(let t of this.outletElementsByName.getValuesForKey(e))for(let s of this.outletsByName.getValuesForKey(e))this.disconnectOutlet(s,t,e)}updateSelectorObserverForOutlet(e){let t=this.selectorObserverMap.get(e);t&&(t.selector=this.selector(e))}setupSelectorObserverForOutlet(e){let t=this.selector(e),s=new yr(document.body,t,this,{outletName:e});this.selectorObserverMap.set(e,s),s.start()}setupAttributeObserverForOutlet(e){let t=this.attributeNameForOutletName(e),s=new dt(this.scope.element,t,this);this.attributeObserverMap.set(e,s),s.start()}selector(e){return this.scope.outlets.getSelectorForOutletName(e)}attributeNameForOutletName(e){return this.scope.schema.outletAttributeForScope(this.identifier,e)}getOutletNameFromOutletAttributeName(e){return this.outletDefinitions.find(t=>this.attributeNameForOutletName(t)===e)}get outletDependencies(){let e=new G;return this.router.modules.forEach(t=>{let s=t.definition.controllerConstructor;xe(s,"outlets").forEach(n=>e.add(n,t.identifier))}),e}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){let e=this.dependentControllerIdentifiers;return this.router.contexts.filter(t=>e.includes(t.identifier))}hasOutlet(e,t){return!!this.getOutlet(e,t)||!!this.getOutletFromMap(e,t)}getOutlet(e,t){return this.application.getControllerForElementAndIdentifier(e,t)}getOutletFromMap(e,t){return this.outletsByName.getValuesForKey(t).find(s=>s.element===e)}get scope(){return this.context.scope}get schema(){return this.context.schema}get identifier(){return this.context.identifier}get application(){return this.context.application}get router(){return this.application.router}},Tr=class{constructor(e,t){this.logDebugActivity=(s,i={})=>{let{identifier:n,controller:o,element:c}=this;i=Object.assign({identifier:n,controller:o,element:c},i),this.application.logDebugActivity(this.identifier,s,i)},this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new Er(this,this.dispatcher),this.valueObserver=new Sr(this,this.controller),this.targetObserver=new Ar(this,this),this.outletObserver=new _r(this,this);try{this.controller.initialize(),this.logDebugActivity("initialize")}catch(s){this.handleError(s,"initializing controller")}}connect(){this.bindingObserver.start(),this.valueObserver.start(),this.targetObserver.start(),this.outletObserver.start();try{this.controller.connect(),this.logDebugActivity("connect")}catch(e){this.handleError(e,"connecting controller")}}refresh(){this.outletObserver.refresh()}disconnect(){try{this.controller.disconnect(),this.logDebugActivity("disconnect")}catch(e){this.handleError(e,"disconnecting controller")}this.outletObserver.stop(),this.targetObserver.stop(),this.valueObserver.stop(),this.bindingObserver.stop()}get application(){return this.module.application}get identifier(){return this.module.identifier}get schema(){return this.application.schema}get dispatcher(){return this.application.dispatcher}get element(){return this.scope.element}get parentElement(){return this.element.parentElement}handleError(e,t,s={}){let{identifier:i,controller:n,element:o}=this;s=Object.assign({identifier:i,controller:n,element:o},s),this.application.handleError(e,`Error ${t}`,s)}targetConnected(e,t){this.invokeControllerMethod(`${t}TargetConnected`,e)}targetDisconnected(e,t){this.invokeControllerMethod(`${t}TargetDisconnected`,e)}outletConnected(e,t,s){this.invokeControllerMethod(`${mr(s)}OutletConnected`,e,t)}outletDisconnected(e,t,s){this.invokeControllerMethod(`${mr(s)}OutletDisconnected`,e,t)}invokeControllerMethod(e,...t){let s=this.controller;typeof s[e]=="function"&&s[e](...t)}};function fa(r){return pa(r,ma(r))}function pa(r,e){let t=ya(r),s=ga(r.prototype,e);return Object.defineProperties(t.prototype,s),t}function ma(r){return xe(r,"blessings").reduce((t,s)=>{let i=s(r);for(let n in i){let o=t[n]||{};t[n]=Object.assign(o,i[n])}return t},{})}function ga(r,e){return ba(e).reduce((t,s)=>{let i=va(r,e,s);return i&&Object.assign(t,{[s]:i}),t},{})}function va(r,e,t){let s=Object.getOwnPropertyDescriptor(r,t);if(!(s&&"value"in s)){let n=Object.getOwnPropertyDescriptor(e,t).value;return s&&(n.get=s.get||n.get,n.set=s.set||n.set),n}}var ba=typeof Object.getOwnPropertySymbols=="function"?r=>[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)]:Object.getOwnPropertyNames,ya=(()=>{function r(t){function s(){return Reflect.construct(t,arguments,new.target)}return s.prototype=Object.create(t.prototype,{constructor:{value:s}}),Reflect.setPrototypeOf(s,t),s}function e(){let s=r(function(){this.a.call(this)});return s.prototype.a=function(){},new s}try{return e(),r}catch{return s=>class extends s{}}})();function wa(r){return{identifier:r.identifier,controllerConstructor:fa(r.controllerConstructor)}}var Or=class{constructor(e,t){this.application=e,this.definition=wa(t),this.contextsByScope=new WeakMap,this.connectedContexts=new Set}get identifier(){return this.definition.identifier}get controllerConstructor(){return this.definition.controllerConstructor}get contexts(){return Array.from(this.connectedContexts)}connectContextForScope(e){let t=this.fetchContextForScope(e);this.connectedContexts.add(t),t.connect()}disconnectContextForScope(e){let t=this.contextsByScope.get(e);t&&(this.connectedContexts.delete(t),t.disconnect())}fetchContextForScope(e){let t=this.contextsByScope.get(e);return t||(t=new Tr(this,e),this.contextsByScope.set(e,t)),t}},Lr=class{constructor(e){this.scope=e}has(e){return this.data.has(this.getDataKey(e))}get(e){return this.getAll(e)[0]}getAll(e){let t=this.data.get(this.getDataKey(e))||"";return ta(t)}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}},Rr=class{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(e){let t=this.getAttributeNameForKey(e);return this.element.getAttribute(t)}set(e,t){let s=this.getAttributeNameForKey(e);return this.element.setAttribute(s,t),this.get(e)}has(e){let t=this.getAttributeNameForKey(e);return this.element.hasAttribute(t)}delete(e){if(this.has(e)){let t=this.getAttributeNameForKey(e);return this.element.removeAttribute(t),!0}else return!1}getAttributeNameForKey(e){return`data-${this.identifier}-${Fi(e)}`}},Mr=class{constructor(e){this.warnedKeysByObject=new WeakMap,this.logger=e}warn(e,t,s){let i=this.warnedKeysByObject.get(e);i||(i=new Set,this.warnedKeysByObject.set(e,i)),i.has(t)||(i.add(t),this.logger.warn(s,e))}};function kr(r,e){return`[${r}~="${e}"]`}var Cr=class{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return this.find(e)!=null}find(...e){return e.reduce((t,s)=>t||this.findTarget(s)||this.findLegacyTarget(s),void 0)}findAll(...e){return e.reduce((t,s)=>[...t,...this.findAllTargets(s),...this.findAllLegacyTargets(s)],[])}findTarget(e){let t=this.getSelectorForTargetName(e);return this.scope.findElement(t)}findAllTargets(e){let t=this.getSelectorForTargetName(e);return this.scope.findAllElements(t)}getSelectorForTargetName(e){let t=this.schema.targetAttributeForScope(this.identifier);return kr(t,e)}findLegacyTarget(e){let t=this.getLegacySelectorForTargetName(e);return this.deprecate(this.scope.findElement(t),e)}findAllLegacyTargets(e){let t=this.getLegacySelectorForTargetName(e);return this.scope.findAllElements(t).map(s=>this.deprecate(s,e))}getLegacySelectorForTargetName(e){let t=`${this.identifier}.${e}`;return kr(this.schema.targetAttribute,t)}deprecate(e,t){if(e){let{identifier:s}=this,i=this.schema.targetAttribute,n=this.schema.targetAttributeForScope(s);this.guide.warn(e,`target:${t}`,`Please replace ${i}="${s}.${t}" with ${n}="${t}". The ${i} attribute is deprecated and will be removed in a future version of Stimulus.`)}return e}get guide(){return this.scope.guide}},Pr=class{constructor(e,t){this.scope=e,this.controllerElement=t}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return this.find(e)!=null}find(...e){return e.reduce((t,s)=>t||this.findOutlet(s),void 0)}findAll(...e){return e.reduce((t,s)=>[...t,...this.findAllOutlets(s)],[])}getSelectorForOutletName(e){let t=this.schema.outletAttributeForScope(this.identifier,e);return this.controllerElement.getAttribute(t)}findOutlet(e){let t=this.getSelectorForOutletName(e);if(t)return this.findElement(t,e)}findAllOutlets(e){let t=this.getSelectorForOutletName(e);return t?this.findAllElements(t,e):[]}findElement(e,t){return this.scope.queryElements(e).filter(i=>this.matchesElement(i,e,t))[0]}findAllElements(e,t){return this.scope.queryElements(e).filter(i=>this.matchesElement(i,e,t))}matchesElement(e,t,s){let i=e.getAttribute(this.scope.schema.controllerAttribute)||"";return e.matches(t)&&i.split(" ").includes(s)}},Fr=class r{constructor(e,t,s,i){this.targets=new Cr(this),this.classes=new Lr(this),this.data=new Rr(this),this.containsElement=n=>n.closest(this.controllerSelector)===this.element,this.schema=e,this.element=t,this.identifier=s,this.guide=new Mr(i),this.outlets=new Pr(this.documentScope,t)}findElement(e){return this.element.matches(e)?this.element:this.queryElements(e).find(this.containsElement)}findAllElements(e){return[...this.element.matches(e)?[this.element]:[],...this.queryElements(e).filter(this.containsElement)]}queryElements(e){return Array.from(this.element.querySelectorAll(e))}get controllerSelector(){return kr(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new r(this.schema,document.documentElement,this.identifier,this.guide.logger)}},Nr=class{constructor(e,t,s){this.element=e,this.schema=t,this.delegate=s,this.valueListObserver=new pt(this.element,this.controllerAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap}start(){this.valueListObserver.start()}stop(){this.valueListObserver.stop()}get controllerAttribute(){return this.schema.controllerAttribute}parseValueForToken(e){let{element:t,content:s}=e;return this.parseValueForElementAndIdentifier(t,s)}parseValueForElementAndIdentifier(e,t){let s=this.fetchScopesByIdentifierForElement(e),i=s.get(t);return i||(i=this.delegate.createScopeForElementAndIdentifier(e,t),s.set(t,i)),i}elementMatchedValue(e,t){let s=(this.scopeReferenceCounts.get(t)||0)+1;this.scopeReferenceCounts.set(t,s),s==1&&this.delegate.scopeConnected(t)}elementUnmatchedValue(e,t){let s=this.scopeReferenceCounts.get(t);s&&(this.scopeReferenceCounts.set(t,s-1),s==1&&this.delegate.scopeDisconnected(t))}fetchScopesByIdentifierForElement(e){let t=this.scopesByIdentifierByElement.get(e);return t||(t=new Map,this.scopesByIdentifierByElement.set(e,t)),t}},xr=class{constructor(e){this.application=e,this.scopeObserver=new Nr(this.element,this.schema,this),this.scopesByIdentifier=new G,this.modulesByIdentifier=new Map}get element(){return this.application.element}get schema(){return this.application.schema}get logger(){return this.application.logger}get controllerAttribute(){return this.schema.controllerAttribute}get modules(){return Array.from(this.modulesByIdentifier.values())}get contexts(){return this.modules.reduce((e,t)=>e.concat(t.contexts),[])}start(){this.scopeObserver.start()}stop(){this.scopeObserver.stop()}loadDefinition(e){this.unloadIdentifier(e.identifier);let t=new Or(this.application,e);this.connectModule(t);let s=e.controllerConstructor.afterLoad;s&&s.call(e.controllerConstructor,e.identifier,this.application)}unloadIdentifier(e){let t=this.modulesByIdentifier.get(e);t&&this.disconnectModule(t)}getContextForElementAndIdentifier(e,t){let s=this.modulesByIdentifier.get(t);if(s)return s.contexts.find(i=>i.element==e)}proposeToConnectScopeForElementAndIdentifier(e,t){let s=this.scopeObserver.parseValueForElementAndIdentifier(e,t);s?this.scopeObserver.elementMatchedValue(s.element,s):console.error(`Couldn't find or create scope for identifier: "${t}" and element:`,e)}handleError(e,t,s){this.application.handleError(e,t,s)}createScopeForElementAndIdentifier(e,t){return new Fr(this.schema,e,t,this.logger)}scopeConnected(e){this.scopesByIdentifier.add(e.identifier,e);let t=this.modulesByIdentifier.get(e.identifier);t&&t.connectContextForScope(e)}scopeDisconnected(e){this.scopesByIdentifier.delete(e.identifier,e);let t=this.modulesByIdentifier.get(e.identifier);t&&t.disconnectContextForScope(e)}connectModule(e){this.modulesByIdentifier.set(e.identifier,e),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(s=>e.connectContextForScope(s))}disconnectModule(e){this.modulesByIdentifier.delete(e.identifier),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(s=>e.disconnectContextForScope(s))}},Ea={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:r=>`data-${r}-target`,outletAttributeForScope:(r,e)=>`data-${r}-${e}-outlet`,keyMappings:Object.assign(Object.assign({enter:"Enter",tab:"Tab",esc:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",page_up:"PageUp",page_down:"PageDown"},Li("abcdefghijklmnopqrstuvwxyz".split("").map(r=>[r,r]))),Li("0123456789".split("").map(r=>[r,r])))};function Li(r){return r.reduce((e,[t,s])=>Object.assign(Object.assign({},e),{[t]:s}),{})}var mt=class{constructor(e=document.documentElement,t=Ea){this.logger=console,this.debug=!1,this.logDebugActivity=(s,i,n={})=>{this.debug&&this.logFormattedMessage(s,i,n)},this.element=e,this.schema=t,this.dispatcher=new pr(this),this.router=new xr(this),this.actionDescriptorFilters=Object.assign({},Xo)}static start(e,t){let s=new this(e,t);return s.start(),s}async start(){await Sa(),this.logDebugActivity("application","starting"),this.dispatcher.start(),this.router.start(),this.logDebugActivity("application","start")}stop(){this.logDebugActivity("application","stopping"),this.dispatcher.stop(),this.router.stop(),this.logDebugActivity("application","stop")}register(e,t){this.load({identifier:e,controllerConstructor:t})}registerActionOption(e,t){this.actionDescriptorFilters[e]=t}load(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(i=>{i.controllerConstructor.shouldLoad&&this.router.loadDefinition(i)})}unload(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(i=>this.router.unloadIdentifier(i))}get controllers(){return this.router.contexts.map(e=>e.controller)}getControllerForElementAndIdentifier(e,t){let s=this.router.getContextForElementAndIdentifier(e,t);return s?s.controller:null}handleError(e,t,s){var i;this.logger.error(`%s
|
|
37
|
+
|
|
38
|
+
%o
|
|
39
|
+
|
|
40
|
+
%o`,t,e,s),(i=window.onerror)===null||i===void 0||i.call(window,t,"",0,0,e)}logFormattedMessage(e,t,s={}){s=Object.assign({application:this},s),this.logger.groupCollapsed(`${e} #${t}`),this.logger.log("details:",Object.assign({},s)),this.logger.groupEnd()}};function Sa(){return new Promise(r=>{document.readyState=="loading"?document.addEventListener("DOMContentLoaded",()=>r()):r()})}function Aa(r){return xe(r,"classes").reduce((t,s)=>Object.assign(t,_a(s)),{})}function _a(r){return{[`${r}Class`]:{get(){let{classes:e}=this;if(e.has(r))return e.get(r);{let t=e.getAttributeName(r);throw new Error(`Missing attribute "${t}"`)}}},[`${r}Classes`]:{get(){return this.classes.getAll(r)}},[`has${Ne(r)}Class`]:{get(){return this.classes.has(r)}}}}function Ta(r){return xe(r,"outlets").reduce((t,s)=>Object.assign(t,Oa(s)),{})}function Ri(r,e,t){return r.application.getControllerForElementAndIdentifier(e,t)}function Mi(r,e,t){let s=Ri(r,e,t);if(s||(r.application.router.proposeToConnectScopeForElementAndIdentifier(e,t),s=Ri(r,e,t),s))return s}function Oa(r){let e=mr(r);return{[`${e}Outlet`]:{get(){let t=this.outlets.find(r),s=this.outlets.getSelectorForOutletName(r);if(t){let i=Mi(this,t,r);if(i)return i;throw new Error(`The provided outlet element is missing an outlet controller "${r}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${r}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${s}".`)}},[`${e}Outlets`]:{get(){let t=this.outlets.findAll(r);return t.length>0?t.map(s=>{let i=Mi(this,s,r);if(i)return i;console.warn(`The provided outlet element is missing an outlet controller "${r}" instance for host controller "${this.identifier}"`,s)}).filter(s=>s):[]}},[`${e}OutletElement`]:{get(){let t=this.outlets.find(r),s=this.outlets.getSelectorForOutletName(r);if(t)return t;throw new Error(`Missing outlet element "${r}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${s}".`)}},[`${e}OutletElements`]:{get(){return this.outlets.findAll(r)}},[`has${Ne(e)}Outlet`]:{get(){return this.outlets.has(r)}}}}function La(r){return xe(r,"targets").reduce((t,s)=>Object.assign(t,Ra(s)),{})}function Ra(r){return{[`${r}Target`]:{get(){let e=this.targets.find(r);if(e)return e;throw new Error(`Missing target element "${r}" for "${this.identifier}" controller`)}},[`${r}Targets`]:{get(){return this.targets.findAll(r)}},[`has${Ne(r)}Target`]:{get(){return this.targets.has(r)}}}}function Ma(r){let e=ha(r,"values"),t={valueDescriptorMap:{get(){return e.reduce((s,i)=>{let n=Bi(i,this.identifier),o=this.data.getAttributeNameForKey(n.key);return Object.assign(s,{[o]:n})},{})}}};return e.reduce((s,i)=>Object.assign(s,ka(i)),t)}function ka(r,e){let t=Bi(r,e),{key:s,name:i,reader:n,writer:o}=t;return{[i]:{get(){let c=this.data.get(s);return c!==null?n(c):t.defaultValue},set(c){c===void 0?this.data.delete(s):this.data.set(s,o(c))}},[`has${Ne(i)}`]:{get(){return this.data.has(s)||t.hasCustomDefaultValue}}}}function Bi([r,e],t){return Na({controller:t,token:r,typeDefinition:e})}function gt(r){switch(r){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function Fe(r){switch(typeof r){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(r))return"array";if(Object.prototype.toString.call(r)==="[object Object]")return"object"}function Ca(r){let{controller:e,token:t,typeObject:s}=r,i=_i(s.type),n=_i(s.default),o=i&&n,c=i&&!n,u=!i&&n,p=gt(s.type),g=Fe(r.typeObject.default);if(c)return p;if(u)return g;if(p!==g){let E=e?`${e}.${t}`:t;throw new Error(`The specified default value for the Stimulus Value "${E}" must match the defined type "${p}". The provided default value of "${s.default}" is of type "${g}".`)}if(o)return p}function Pa(r){let{controller:e,token:t,typeDefinition:s}=r,n=Ca({controller:e,token:t,typeObject:s}),o=Fe(s),c=gt(s),u=n||o||c;if(u)return u;let p=e?`${e}.${s}`:t;throw new Error(`Unknown value type "${p}" for "${t}" value`)}function Fa(r){let e=gt(r);if(e)return ki[e];let t=gr(r,"default"),s=gr(r,"type"),i=r;if(t)return i.default;if(s){let{type:n}=i,o=gt(n);if(o)return ki[o]}return r}function Na(r){let{token:e,typeDefinition:t}=r,s=`${Fi(e)}-value`,i=Pa(r);return{type:i,key:s,name:Br(s),get defaultValue(){return Fa(t)},get hasCustomDefaultValue(){return Fe(t)!==void 0},reader:xa[i],writer:Ci[i]||Ci.default}}var ki={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},xa={array(r){let e=JSON.parse(r);if(!Array.isArray(e))throw new TypeError(`expected value of type "array" but instead got value "${r}" of type "${Fe(e)}"`);return e},boolean(r){return!(r=="0"||String(r).toLowerCase()=="false")},number(r){return Number(r.replace(/_/g,""))},object(r){let e=JSON.parse(r);if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError(`expected value of type "object" but instead got value "${r}" of type "${Fe(e)}"`);return e},string(r){return r}},Ci={default:Ba,array:Pi,object:Pi};function Pi(r){return JSON.stringify(r)}function Ba(r){return`${r}`}var V=class{constructor(e){this.context=e}static get shouldLoad(){return!0}static afterLoad(e,t){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:t=this.element,detail:s={},prefix:i=this.identifier,bubbles:n=!0,cancelable:o=!0}={}){let c=i?`${i}:${e}`:e,u=new CustomEvent(c,{detail:s,bubbles:n,cancelable:o});return t.dispatchEvent(u),u}};V.blessings=[Aa,La,Ma,Ta];V.targets=[];V.outlets=[];V.values={};var vt=class extends V{static targets=["counter","submit"];static values={delay:{type:Number,default:30},current:Number,interval:Number};connect(){this.currentValue=this.delayValue,this.submitTarget.disabled=!0,this.intervalValue=setInterval(()=>{this.currentValue===0?(clearInterval(this.intervalValue),this.submitTarget.disabled=!1):this.currentValue=this.currentValue-1},1e3)}currentValueChanged(r){this.counterTarget.innerText=r}};var bt=class extends V{print(){window.print()}};var yt=class extends V{static values={title:String,text:String,url:String};async share(r=void 0){let e=this.titleValue,t=this.textValue,s=this.urlValue,i={title:e,text:t,url:s};"share"in navigator&&navigator.canShare(i)&&(r?.preventDefault(),r?.stopPropagation(),navigator.share(i))}};if(window.env.JEKYLL_ENV==="production")try{window.airbrake=new Mt({projectId:window.env.AIRBRAKE_PROJECT_ID,projectKey:window.env.AIRBRAKE_PROJECT_KEY,host:"https://panel.sutty.nl"}),console.originalError=console.error,console.error=(...r)=>(window.airbrake.notify(r.join(" ")),console.originalError(...r))}catch(r){console.error(r)}ut();window.Stimulus=mt.start();Stimulus.debug=window.env.JEKYLL_ENV!=="production";Stimulus.register("contact",vt);Stimulus.register("print",bt);Stimulus.register("share",yt);})();
|
|
41
|
+
/*! Bundled license information:
|
|
42
|
+
|
|
43
|
+
@hotwired/turbo/dist/turbo.es2017-esm.js:
|
|
44
|
+
(*!
|
|
45
|
+
Turbo 8.0.19
|
|
46
|
+
Copyright © 2025 37signals LLC
|
|
47
|
+
*)
|
|
48
|
+
*/
|
|
49
|
+
//# sourceMappingURL=pack.U4PELPHY.js.map
|