PageSourceSearch

https://www.urbandictionary.com/assets/app.71a762d8.js

js urbandictionary.com collected 2026-09-24 06:24:36 UTC 608,308 bytes, 114 lines download raw bytes

1var eo=Object.defineProperty;var to=(e,t,s)=>t in e?eo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var Oe=(e,t,s)=>(to(e,typeof t!="symbol"?t+"":t,s),s);function ro(e,t){for(var s=0;s<t.length;s++){const n=t[s];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(n,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>n[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function so(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function no(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var s=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(s,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}),s}(function(){(()=>{var e=[,()=>{window.up={version:"3.14.2"}},()=>{up.mockable=function(n){if(window.jasmine){let a=n.name,i={[a]:n},r=function(){return i[a].apply(this,arguments)};return r.mock=()=>spyOn(i,a),r}else return n}},()=>{up.util=function(){function n(){}function a(){return Promise.resolve()}function i(w,D){let W={};return function(...ne){if(D&&(W=this[D]||(this[D]={})),W.value)return W.value[0];if(W.error)throw W.error;try{return(W.value=[w.apply(this,ne)])[0]}catch(le){throw W.error=le}}}function r(w,D){D=Te(D,{host:"cross-domain"});const W=p(w);let ne="";D.host==="cross-domain"&&(D.host=f(W)),D.host&&(ne+=W.protocol+"//"+W.host);let{pathname:le}=W;return D.trailingSlash===!1&&le!=="/"&&(le=le.replace(/\/$/,"")),ne+=le,D.search!==!1&&(ne+=W.search),D.hash!==!1&&(ne+=W.hash),ne}function o(w,D,W){return l(w,W)===l(D,W)}function l(w,D){if(w)return r(w,{hash:!1,trailingSlash:!1,...D})}function u(w){return w.endsWith("/")?[w,w.slice(0,-1)]:w.includes("/?")?[w,w.replace("/?","?")]:w.endsWith("/*")?[w,w.slice(0,-2),w.slice(0,-2)+"?*"]:w}const c=location.protocol,d=location.hostname;function f(w){if(P(w)&&w.indexOf("//")===-1)return!1;const D=p(w);return d!==D.hostname||c!==D.protocol}function p(w){if(w.pathname)return w;let D=document.createElement("a");return D.href=w,D}function h(w){return w?w.toUpperCase():"GET"}function g(w){return w!=="GET"&&w!=="HEAD"}function v(w){return P(w)?D=>D[w]:w}function b(w,D){if(w.length===0)return[];D=v(D);let W=[],ne=0;for(let le of w)W.push(D(le,ne++));return W}function y(w,D){return Object.fromEntries(w.map(D))}function m(w,D){let W=0;for(let ne of w)D(ne,W++)}function S(w){return w===null}function k(w){return!!w}function C(w){return w===void 0}const L=Or(C);function _(w){return C(w)||S(w)}const E=Or(_);function q(w){return _(w)?!0:X(w)&&w[q.key]?w[q.key]():P(w)||de(w)?w.length===0:G(w)?Object.keys(w).length===0:!1}q.key="up.util.isBlank";function A(w,D=R){if(D(w))return w}const R=Or(q);function T(w){return typeof w=="function"}function P(w){return typeof w=="string"||w instanceof String}function z(w){return typeof w=="boolean"||w instanceof Boolean}function V(w){return typeof w=="number"||w instanceof Number}function G(w){return typeof w=="object"&&!S(w)&&(C(w.constructor)||w.constructor===Object)}function X(w){const D=typeof w;return D==="object"&&!S(w)||D==="function"}function $(w){return w instanceof Element}function K(w){return w instanceof Text}function Y(w){return w instanceof RegExp}function I(w){return w instanceof Error}function H(w){return up.browser.canJQuery()&&w instanceof jQuery}function N(w){var D;return!!(w&&(w.addEventListener||H(w)&&((D=w[0])!=null&&D.addEventListener)))}function j(w){return X(w)&&T(w.then)}const{isArray:Z}=Array;function Q(w){return w instanceof FormData}function se(w){return Z(w)?w:ge(w)}function de(w){return Z(w)||x(w)||J(w)||H(w)||F(w)}function x(w){return w instanceof NodeList}function F(w){return w instanceof HTMLCollection}function J(w){return Object.prototype.toString.call(w)==="[object Arguments]"}function te(w){return/^(before|after)/.test(w)}function oe(w){return de(w)?w:_(w)?[]:[w]}function pe(w){return X(w)&&w[pe.key]?w=w[pe.key]():de(w)?w=ge(w):G(w)&&(w=Object.assign({},w)),w}function ge(w){return Array.prototype.slice.call(w)}pe.key="up.util.copy",Date.prototype[pe.key]=function(){return new Date(+this)};function Se(...w){return Object.assign({},...w)}function Ie(...w){const D={};for(let W of w)if(W)for(let ne in W){const le=W[ne];L(le)&&(D[ne]=le)}return D}function Te(w,D){return D?Se(D,w):w?pe(w):{}}function De(w,D){let[W,ne]=fn(w,"val","options");return L(W)&&(ne[D]=W),ne}function je(w,D){D=v(D);let W;for(let ne of w)if(D(ne)){W=ne;break}return W}function rt(w,D){return!!$e(w,D)}function $e(w,D){D=v(D);let W=0;for(let ne of w){const le=D(ne,W++);if(le)return le}}function Ke(w,D){D=v(D);let W=!0,ne=0;for(let le of w)if(!D(le,ne++)){W=!1;break}return W}function _t(w){return Xe(w,E)}function st(w){return Ye(w,E)}function Ne(w){return w.length<2?w:Array.from(new Set(w))}function nt(w,D){if(w.length<2)return w;D=v(D);const W=new Set;return Xe(w,function(ne,le){const Ee=D(ne,le);
1return W.has(Ee)?!1:(W.add(Ee),!0)})}function Xe(w,D){D=v(D);const W=[];return m(w,function(ne,le){if(D(ne,le))return W.push(ne)}),W}function ze(w,D){return D=Or(v(D)),Xe(w,D)}function dt(w,D){return Xe(w,W=>at(D,W))}function St(w,D){return setTimeout(D,w)}function ir(w){setTimeout(w)}function ar(w){const D=new MessageChannel;D.port1.onmessage=()=>w(),D.port2.postMessage(0)}function it(w){return w[w.length-1]}function at(w,D){return(w.indexOf||Array.prototype.indexOf).call(w,D)>=0}function Et(w,D){return Ke(D,W=>at(w,W))}function jt(w,D){const W=xt(w,Object.keys(D));return _e(D,W)}function xt(w,D){const W={};for(let ne of D)ne in w&&(W[ne]=w[ne]);return W}function Ye(w,D){D=v(D);const W={};for(let ne in w){const le=w[ne];D(le,ne)&&(W[ne]=w[ne])}return W}function or(w,D){return Ye(w,(W,ne)=>!at(D,ne))}function ht(){return new Promise(n)}function Nt(w,D){const W=w.indexOf(D);if(W>=0)return w.splice(W,1),D}function ft(w,...D){return T(w)?w(...D):w}function lr(w,D,...W){return w=ft(w,...W),w==="auto"&&(w=ft(D,...W)),w}const Tt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"};function zt(w){return w.replace(/[&<>"']/g,D=>Tt[D])}function kt(w){return w.replace(/[\\^$*+?.()|[\]{}]/g,"\\$&")}function Bt(w,D){const W=w[D];return delete w[D],W}function M(w,D,W){D in w&&(w[W]=Bt(w,D))}function U(w,D){if(D(it(w)))return w.pop()}function ee(w){return U(w,T)}function ie(w){return U(w,G)||{}}function ae(w){return w}function me(...w){return(...D)=>ye(w,D)}function ye(w,...D){return w=Ar(w),b(w,W=>W(...D))}function O(w){const D=[];for(let W of w)de(W)?D.push(...W):D.push(W);return D}function B(w,D){return O(b(w,D))}function re(w,D=ae){return w.then(D,D)}function fe(){let w,D;const W=new Promise(function(ne,le){w=ne,D=le});return W.resolve=w,W.reject=D,W}function be(w){return Object.prototype.hasOwnProperty(w)}function _e(w,D){return w===D||(w!=null&&w.valueOf&&(w=w.valueOf()),D!=null&&D.valueOf&&(D=D.valueOf()),w===D)?!0:typeof w!=typeof D?!1:de(w)&&de(D)?Re(w,D):X(w)&&w[_e.key]?w[_e.key](D):G(w)&&G(D)?Me(w,D):!1}function Me(w,D){const W=Object.keys(w),ne=Object.keys(D);return Re(W,ne)&&Ke(W,le=>_e(w[le],D[le]))}_e.key="up.util.isEqual";function Re(w,D){return w.length===D.length&&Ke(w,(W,ne)=>_e(W,D[ne]))}function Be(w,{json:D=!1,separator:W=/[,\s]/}={}){return P(w)?D&&/^\[.*]$/.test(w)?os(w):pt(w,W):oe(w)}function pt(w,D){var ne,le;return(((le=(ne=up.migrate).splitAtOr)==null?void 0:le.call(ne,w))||w.split(D)).map(Ee=>Ee.trim()).filter(ae)}function ot(w){if(P(w)){let{maskedTokens:D,restore:W}=Ct(w);return D.map(ne=>W(ne))}else return oe(w)}function Ct(w){let{masked:D,restore:W}=gn(w);return{maskedTokens:pt(D,","),restore:W}}function ns(w,...D){return D[0]instanceof w?D[0]:new w(...D)}let dn=0;function ur(){return dn++}function Pr(w,D){const W={};for(let ne in w){let le=D(ne);E(le)&&(W[le]=w[ne])}return W}function Ia(w){return w.replace(/[A-Z]/g,D=>"-"+D.toLowerCase())}function Ma(w){return w.replace(/-([a-z])/g,(D,W)=>W.toUpperCase())}function Fa(w){return w[0].toLowerCase()+w.slice(1)}function Da(w){return w[0].toUpperCase()+w.slice(1)}function hn(w,D,W){for(let ne of D)Object.defineProperty(w,ne,{get(){const le=W.call(this);let Ee=le[ne];return T(Ee)&&(Ee=Ee.bind(le)),Ee},set(le){const Ee=W.call(this);Ee[ne]=le}})}function $a(w,D){return hn(w,["then","catch","finally"],D)}function is(w,D="%o"){let W;if(D==="%c")return"";if(D==="%s"&&E(w)&&(w=w.toString()),P(w))W=w.trim().replace(/[\n\r\t ]+/g," "),D==="%o"&&(W=JSON.stringify(W));else if(C(w))W="undefined";else if(V(w)||T(w))W=w.toString();else if(Z(w))W=`[${b(w,is).join(", ")}]`;else if(H(w))W=`$(${b(w,is).join(", ")})`;else if($(w))W=Ba(w);else if(Y(w)||I(w))W=w.toString();else try{W=JSON.stringify(w)}catch(le){if(le.name==="TypeError")W="(circular structure)";else throw le}return W.length>200&&(W=`${W.substr(0,200)}…${it(W)}`),W}const ja=/%[oOdisfc]/g;function Na(w,...D){return w.replace(ja,W=>is(D.shift(),W))}const za=/<("[^"]*"|[^">])*>/;function Ba(w){return w.cloneNode().outerHTML.match(za)[0]}function Or(w){return function(...D){return!w(...D)}}function Ha(w,D){for(let W in D){let le=Object.getOwnPropertyDescriptor(w,W).value,Ee=i(le,`__${W}MemoizeCache`);w[W]=Ee}}function Ua(w){let D=JSON.stringify(w);return qa(D)}function qa(w){let D=W=>"\\u"+W.charCodeAt(0).toString(16).padStart(4,"0");return w.replace(/[^\x00-\x7F]/g,D)}function Va(w,D={}){let W=Object.create(w);return Object.assign(W,D),W}function fn(w,...D){let W=[];for(;D.length;){let ne=D.pop();if(ne==="options")W.unshift(ie(w));else if(ne==="callback")W.unshift(ee(w));else if(ne==="val")W.unshift(w.pop());else if(T(ne)){let le=ne(it(w))?w.pop():void 0;W.unshift(le)}}return W}function Ar(...w){return w.flat(2).filter(T)}function Ga(w="lifo"){let D=[],W=function(le,Ee){le=Ar(le).map(Ee),D.push(...Ar(le))},ne=function(...le){W(le,ae)};return ne.guard=function(...le){W(le,up.error.guardFn)},ne.clean=function(...le){w==="lifo"&&D.reverse(),D.forEach(Ee=>Ee(...le)),D=[]},ne}function as(w,D,{keepDelimiters:W=!1}={}){let ne=0,le=/§\d+/g,Ee={}
1,cr=[],vn=(Pt,us)=>{let Rr=!1;w=w.replaceAll(Pt,function(Ht){Rr=!0;let dr="§"+ne++,cs,ds;if(W){let Qa=Ht[0],Za=Ht.slice(-1);ds=Ht.slice(1,-1),cs=Qa+dr+Za}else ds=Ht,cs=dr;return Ee[dr]=ds,cs}),Rr&&cr.unshift({allowRestoreTransform:us})};vn(le,!1);for(let Pt of D)vn(Pt,!0);return{masked:w,restore:(Pt,us=ae)=>{for(let{allowRestoreTransform:Rr}of cr){let Ht=Rr?us:ae;Pt=Pt.replace(le,dr=>Ht(ls(Ee[dr],P)))}return Pt}}}const pn=/'(?:\\\\|\\'|[^'])*'|"(?:\\\\|\\"|[^"])*"/g,Wa=/{(?:[^{}]|{[^{}]*})*}|\((?:[^\(\)]|\([^\(\)]*\))*\)|\[(?:[^\[\]]|\[[^\[\]]*\])*\]/g;function gn(w){return as(w,[pn,Wa],{keepDelimiters:!0})}function mn(w){return w[0]==='"'?w:(ls(w[0]==="'"),w=w.slice(1,-1),'"'+w.replace(/(\\\\)|(\\')|(\\")|(")/g,function(W,ne,le,Ee){return ne||le&&"'"||'\\"'})+'"')}function Ka(w){return JSON.parse(mn(w))}function os(w){let{masked:D,restore:W}=as(w,[pn]);return D=D.replace(/([a-z_$][\w$]*:)/gi,ne=>'"'+ne.slice(0,-1)+'":'),D=D.replace(/,\s*([}\]])/g,"$1"),D=W(D,mn),JSON.parse(D)}function Xa(w){let{maskedTokens:D,restore:W}=Ct(w);return D.map(ne=>{let[le,Ee,cr]=ne.match(/([^{]+)({[^}]*})?/);return[W(Ee.trim()),cr&&os(W(cr))]})}function Ya(w,D){return y(w,W=>[W,D])}function Ja(w){if(V(w))return w;if(P(w)&&/^-?\.?\d[\d._]*$/.test(w))return parseFloat(w.replaceAll("_",""))}function ls(w,D=k){if(D(w))return w;throw"assert failed"}return{parseURL:p,normalizeURL:r,matchableURL:l,matchableURLPatternAtom:u,matchURLs:o,normalizeMethod:h,methodAllowsPayload:g,copy:pe,merge:Se,mergeDefined:Ie,options:Te,parseArgIntoOptions:De,each:m,map:b,flatMap:B,mapObject:y,spanObject:Ya,findResult:$e,some:rt,every:Ke,find:je,filter:Xe,reject:ze,intersect:dt,compact:_t,compactObject:st,uniq:Ne,uniqBy:nt,last:it,isNull:S,isDefined:L,isUndefined:C,isGiven:E,isMissing:_,isPresent:R,isBlank:q,presence:A,isObject:X,isFunction:T,isString:P,isBoolean:z,isNumber:V,isElement:$,isTextNode:K,isJQuery:H,isElementLike:N,isPromise:j,isOptions:G,isArray:Z,isFormData:Q,isList:de,isRegExp:Y,isAdjacentPosition:te,timer:St,contains:at,containsAll:Et,objectContains:jt,toArray:se,pick:xt,pickBy:Ye,omit:or,unresolvablePromise:ht,remove:Nt,memoize:i,pluckKey:Bt,renameKey:M,extractOptions:ie,extractCallback:ee,noop:n,asyncNoop:a,identity:ae,escapeHTML:zt,escapeRegExp:kt,sequence:me,callAll:ye,evalOption:ft,evalAutoOption:lr,flatten:O,newDeferred:fe,always:re,isBasicObjectProperty:be,isCrossOrigin:f,task:ir,fastTask:ar,isEqual:_e,getSimpleTokens:Be,getComplexTokens:ot,wrapList:oe,wrapValue:ns,uid:ur,upperCaseFirst:Da,lowerCaseFirst:Fa,delegate:hn,delegatePromise:$a,camelToKebabCase:Ia,kebabToCamelCase:Ma,sprintf:Na,withRenamedKeys:Pr,memoizeMethod:Ha,safeStringifyJSON:Ua,variant:Va,cleaner:Ga,scanFunctions:Ar,args:fn,parseRelaxedJSON:os,parseScalarJSONPairs:Xa,maskPattern:as,expressionOutline:gn,parseString:Ka,assert:ls,parseNumber:Ja}}()},()=>{up.error=function(){function n(...d){throw new up.Error(d)}function a(d){return typeof d!="object"||d.name!=="AbortError"&&!(d instanceof up.RenderResult)&&!(d instanceof up.Response)}function i(d){return d.catch(o)}function r(d){try{return d()}catch(f){o(f)}}function o(d){if(a(d))throw d}function l(d,...f){try{return d(...f)}catch(p){reportError(p)}}function u(d){return d.catch(reportError)}function c(d){if(d)return(...f)=>l(()=>d(...f))}return{fail:n,throwCritical:o,muteUncriticalRejection:i,muteUncriticalSync:r,guard:l,guardPromise:u,guardFn:c}}(),up.fail=up.error.fail},()=>{up.migrate={config:{}}},()=>{up.browser=function(){function n(l){l.submit()}function a(){return up.protocol.initialRequestMethod()==="GET"}function i(){return!!window.jQuery}function r(l){var c;let u=(c=document.cookie.match(new RegExp(l+"=(\\w+)")))==null?void 0:c[1];if(u)return document.cookie=l+"=;Max-Age=0;Path=/",u}function o(l){if(!(!l.confirm||window.confirm(l.confirm)))throw new up.Aborted("User canceled action");return!0}return{submitForm:n,canPushState:a,canJQuery:i,assertConfirmed:o,popCookie:r}}()},(n,a,i)=>{i(8),up.element=function(){const r=up.util;function o(...O){let[B=document,re]=r.args(O,"val","val");return B.querySelector(re)}function l(O,B){const re=O.querySelectorAll(B);return c(O,B)?[O,...re]:re}function u(O,B){return c(O,B)?O:O.querySelector(B)}function c(O,B){return r.isElement(O)&&O.matches(B)}function d(O,B){const re=h(B);return Node.prototype.contains.call(O,re)}function f(O,B){var re;return(re=O.parentNode)==null?void 0:re.closest(B)}function p(O,B){return g(O.closest(B),l(O,B))}function h(...O){const B=O.pop();return r.isElement(B)?B:r.isString(B)?o(...O,B):r.isList(B)?(B.length>1&&up.fail("up.element.get(): Cannot cast multiple elements (%o) to a 
1single element",B),B[0]):B}function g(...O){return r.flatMap(O,v)}function v(O){return r.isString(O)?document.querySelectorAll(O):r.wrapList(O)}function b(O){C(O,!1)}function y(O){C(O,!0)}function m(O){return k(O,!0)}function S(O){return k(O,!1)}function k(O,B){return B===ht(O)?r.noop:(C(O,B),()=>C(O,!B))}function C(O,B){B?(O.removeAttribute("hidden"),O.style.display==="none"&&(O.style.display="")):O.setAttribute("hidden","")}function L(O,B=!ht(O)){C(O,B)}function _(O,B,re,fe){return fe?O.setAttribute(B,re):O.removeAttribute(B)}function E(O,B){for(let re in B){const fe=B[re];r.isGiven(fe)?O.setAttribute(re,fe):O.removeAttribute(re)}}function q(O,B){let re=Object.keys(B),fe=ft(O,re);return E(O,B),()=>E(O,fe)}function A(O){var re;const B="meta"+K("name",O);return(re=document.head.querySelector(B))==null?void 0:re.content}function R(O,B){O.parentNode.insertBefore(B,O)}function T(O,B={}){let{includePath:re}=z(O),fe,be,_e;for(let Me of re){let{tagName:Re}=Me;(!Re||Re==="*")&&(Re="div"),be=document.createElement(Re),fe||(fe=be),P(be,Me),_e==null||_e.appendChild(be),_e=be}for(let Me in B){let Re=B[Me];Me==="class"?St(fe,r.wrapList(Re)):Me==="style"?Ye(fe,Re):Me==="text"?fe.textContent=Re:Me==="content"?r.isString(Re)?fe.innerHTML=Re:fe.append(...r.wrapList(Re)):fe.setAttribute(Me,Re)}return fe}function P(O,{id:B,classNames:re,attributes:fe}){B&&(O.id=B);for(let[be,_e]of Object.entries(fe))O.setAttribute(be,_e);St(O,re)}function z(O){let B;const{masked:re,restore:fe}=r.expressionOutline(O),be=re.replace(/:not\([^)]*\)/,function(Be){return B=fe(Be),""});let _e=fe(be);return{includePath:be.split(/[ >]+/).map(function(Be){let pt={tagName:null,classNames:[],id:null,attributes:{}};return Be=Be.replace(/^[\w-*]+/,function(ot){return pt.tagName=ot,""}),Be=Be.replace(/#([\w-]+)/,function(ot,Ct){return pt.id=Ct,""}),Be=Be.replace(/\.([\w-]+)/g,function(ot,Ct){return pt.classNames.push(Ct),""}),Be=Be.replace(/\[[^\]]*]/g,function(ot){ot=fe(ot);let[Ct,ns,dn,ur,Pr]=ot.match(/\[([\w-]+)(?:([~|^$*]?=)(["'])?([^\3\]]*?)\3)?]/);return ur||(ur='"'),pt.attributes[ns]=Pr?r.parseString(ur+Pr+ur):"",""}),Be&&up.fail("Cannot parse selector: "+O),pt}),includeRaw:_e,excludeRaw:B}}function V(...O){let[B,re="beforeend",fe,be]=r.args(O,"val",r.isAdjacentPosition,"val","options");const _e=T(fe,be);return B.insertAdjacentElement(re,_e),_e}const G=["HTML","BODY","HEAD","TITLE"],X=up.mockable(O=>O.matches(G.join()));function $(O){return O.tagName.toLowerCase()}function K(O,B){return r.isGiven(B)?(B=B.replace(/"/g,'\\"'),`[${O}="${B}"]`):`[${O}]`}function Y(O){return O.match(/^[a-z][a-z0-9\-_]*$/i)?`#${O}`:K("id",O)}function I(O){return O=O.replace(/[^\w-]/g,"\\$&"),`.${O}`}function H(O){const B=ie(O);return["TR","TD","TH","THEAD","TBODY"].includes(B)&&(O=`<table>${O}</table>`),new DOMParser().parseFromString(O,"text/html")}function N(O){let B=j(O.outerHTML);return"nonce"in O&&(B.nonce=O.nonce),B}function j(O){return Z(se(O))}function Z(O){return Q(O)||up.fail("Expected a single element, but got %d nodes",O.length)}function Q(O){if(O.length===1&&r.isElementLike(O[0]))return O[0]}function se(O){O=O.trim();const B=document.createRange();return B.setStart(document.body,0),B.createContextualFragment(O).childNodes}function de(){return document.documentElement}function x(O){O.offsetHeight}function F(O){const B=O.getBoundingClientRect();O.style.position="absolute";const re=O.offsetParent.getBoundingClientRect();Ye(O,{left:B.left-Et(O,"margin-left")-re.left+"px",top:B.top-Et(O,"margin-top")-re.top+"px",right:"",bottom:""})}function J(O,B){for(let re in B)te(O,re,B[re])}function te(O,B,re){r.isMissing(O.getAttribute(B))&&O.setAttribute(B,re)}function oe(O){Ie(function(){let B=[...O.childNodes];for(let re of B)R(O,re);O.remove()})}function pe(O){const B=document.createElement("up-wrapper");return B.append(...r.wrapList(O)),B}function ge(O){return O.length===1&&r.isElement(O[0])?O[0]:pe(O)}function Se(O){const B=pe(O.childNodes);return O.append(B),B}function Ie(O){const B=document.activeElement;try{return O()}finally{B&&B!==document.activeElement&&B.focus({preventScroll:!0})}}function Te(O,B,...re){var be;if(!((be=O.hasAttribute)!=null&&be.call(O,B)))return;let fe=O.getAttribute(B);for(let _e of re){let Me=_e(fe,B,O);if(r.isDefined(Me))return Me}}function De(O,B){return Te(O,B,je)}let je=r.identity;function rt(O,B){return Te(O,B,$e)}function $e(O,B){switch(O){case"false":return!1;case"true":case"":case B:return!0}}function Ke(O,B){return Te(O,B,$e,je)}function _t(O,B){return Te(O,B,$e,nt)}function st(O,B){return Te(O,B,$e,nt,je)}function Ne(O,B){return Te(O,B,nt)}function nt(O){return r.parseNumber(O)}function Xe(O,B){return Te(O,B,ze)}function ze(O){if(O!=null&&O.trim())return r.parseRelaxedJSON(O)}function dt(O,B,re=De){let fe=O.closest("["+B+"]");if(fe)return re(fe,B)}function St(O,B){for(let re of B)O.classList.add(re)}function ir(O,B){return it(O,B,!0)}function ar(O,B){return it(O,B,!1)}function it(O,B,re){return O.classList.contains(B)===re?r.noop:(O.classList.toggle(B,re),()=>O.classList.toggle(B,!re))}function at(O,B){const re=window.getComputedStyle(O);return xt(re,B)}function Et(O,B){const re=at(O,B);if(r.isPresent(re))return parseFloat(re)}function jt(O,B){const{style:re}=O;return xt(re,B)}function xt(O,B){return up.migrate.loaded&&(B=up.migrate.fixGetStyleProps(B)),r.isString(B)?O.getPropertyValue(B):r.mapObject(B,re=>[re,O.getPropertyValue(re)])}function Ye(O,B,re=""){if(up.migrate.loaded&&(B=up.migrate.fixSetStyleProps(B,re)),r.isString(B))O.setAttribute("style",B);else{const{style:fe}=O;for(let be in B){let _e=B[be];fe.setProperty(be,_e+re)}}}function or(O,B){const re=jt(O,Object.keys(B));return Ye(O,B),()=>Ye(O,re)}function ht(O){return!!(O.offsetWidth||O.offsetHeight||O.getClientRects().length)}function Nt(O){return/^up-/.test(O)}function ft(O,B){return r.mapObject(B,re=>[re,O.getAttribute(re)])}function lr(O){let B=O.getAttributeNames().filter(Nt);return ft(O,B)}function Tt(O){return r.filter(O.classList.values(),Nt)}function zt(O){return!O.children.length>0&&!O.innerText.trim()}function kt(O){return`[${O}*="//"]:not([${O}*="//${location.host}/"])`}function Bt(O,{margin:B=0}={}){const re=up.Rect.fromElement(O);return re.grow(B),re.bottom>0&&re.top<window.innerHeight&&re.right>0&&re.left<window.innerWidth}function M(O,B,re){let fe=`:is(${O.join()})`;return r.isPresent(B)&&(fe+=`:not(${B.join()})`),re&&(fe+=`:is(${re})`),fe}function U(O){let B=O.nextElementSibling;return B?[B,"beforebegin"]:[O.parentElement,"beforeend"]}const ee=/^\s*(<!--[^-]*.*?-->\s*)*<([a-z-!]+)\b/i;function ie(O){var B;return(B=ee.exec(O))==null?void 0:B[2].toUpperCase()}function ae(O){let B=ie(O);return B==="HTML"||B==="!DOCTYPE"}function me(O){for(let B of O){if(r.isElement(B))return B;if(r.isTextNode(B)&&B.textContent.trim())return}}function ye(O,B){let re=/<[^<]+>/g,fe=new RegExp(`\\s+(${B.join("|")})="[^"]*"`,"g"),be=_e=>_e.replace(fe,"");return O=O.replace(re,be),O}return{subtree:l,subtreeFirst:u,contains:d,closestAttr:dt,ancestor:f,around:p,get:h,list:g,toggle:L,hide:b,hideTemp:S,show:y,showTemp:m,metaContent:A,insertBefore:R,createFromSelector:T,setAttrs:E,setAttrsTemp:q,affix:V,idSelector:Y,classSelector:I,isSingleton:X,attrSelector:K,tagName:$,createBrokenDocumentFromHTML:H,revivedClone:N,createNodesFromHTML:se,createFromHTML:j,extractSingular:Z,get root(){return de()},paint:x,fixedToAbsolute:F,setMissingAttrs:J,setMissingAttr:te,unwrap:oe,wrapChildren:Se,wrapIfRequired:ge,attr:De,booleanAttr:rt,numberAttr:Ne,jsonAttr:Xe,parseAttr:Te,booleanOrStringAttr:Ke,booleanOrNumberAttr:_t,booleanOrNumberOrStringAttr:st,setStyleTemp:or,style:at,styleNumber:Et,inlineStyle:jt,setStyle:Ye,isVisible:ht,upAttrs:lr,upClasse
1s:Tt,setAttrPresence:_,addClasses:St,addClassTemp:ir,removeClassTemp:ar,parseSelector:z,isEmpty:zt,crossOriginSelector:kt,isIntersectingWindow:Bt,unionSelector:M,elementLikeMatches:c,documentPosition:U,isFullDocumentHTML:ae,leadingElement:me,removeAttrsFromHTML:ye}}()},(n,a,i)=>{i.r(a)},()=>{up.Error=class extends window.Error{constructor(a,i={}){Array.isArray(a)&&(a=up.util.sprintf(...a)),super(a);let r="up."+this.constructor.name;Object.assign(this,{name:r},i)}}},()=>{up.NotImplemented=class extends up.Error{}},()=>{up.Aborted=class extends up.Error{constructor(a){super(a,{name:"AbortError"})}}},()=>{up.Blocked=class extends up.Error{}},()=>{up.CannotMatch=class extends up.Error{}},()=>{up.CannotParse=class extends up.Error{}},()=>{up.CannotTarget=class extends up.Error{}},()=>{up.Offline=class extends up.Error{}},()=>{const n=up.util;up.Record=class{keys(){throw"Return an array of keys"}defaults(i){return{}}constructor(i){Object.assign(this,n.mergeDefined(this.defaults(i),this.attributes(i)))}attributes(i=this){return n.pick(i,this.keys())}[n.copy.key](){return n.variant(this)}[n.isEqual.key](i){return this.constructor===i.constructor&&n.isEqual(this.attributes(),i.attributes())}}},()=>{const n=up.util,a=up.element;up.Config=class{constructor(r=()=>({})){this._blueprintFn=r,this.reset(),document.addEventListener("up:framework:reset",()=>this.reset())}reset(){Object.assign(this,this._blueprintFn())}matches(r,o,l){return r==null?void 0:r.matches(this.selector(o,l))}matchesFn(r){return(o,l)=>this.matches(o,r,l)}selector(r,o=""){let l=this[r],u=this["no"+n.upperCaseFirst(r)];return a.unionSelector(l,u,o)}selectorFn(r){return o=>this.selector(r,o)}selectorFns(r){return[this.selectorFn(r),this.matchesFn(r)]}}},()=>{let n="up.log.enabled",a=!1;try{a=!!(sessionStorage!=null&&sessionStorage.getItem(n))}catch{}up.LogConfig=class extends up.Config{constructor(){super(()=>({banner:!0,format:!0}))}get enabled(){return a}set enabled(r){a=r;try{sessionStorage==null||sessionStorage.setItem(n,r?"1":"")}catch{}}}},()=>{const n=up.util;up.Registry=class{constructor(i,r=n.identity){this._data={},this._normalize=r,this._valueDescription=i,this.put=this.put.bind(this),document.addEventListener("up:framework:reset",()=>this.reset())}put(i,r){r=this._normalize(r),r.isDefault=up.framework.evaling,this._data[i]=r}get(i){return this._data[i]||up.fail("Unknown %s %o",this._valueDescription,i)}reset(){this._data=n.pickBy(this._data,"isDefault")}}},()=>{const n=up.util,a=up.element;up.OptionsParser=class{constructor(r,o,l={}){this._options=o,this._element=r,this._fail=l.fail,this._closest=l.closest,this._attrPrefix=l.attrPrefix||"up-",this._defaults=l.defaults??{}}string(r,o){this.parse(a.attr,r,o)}boolean(r,o){this.parse(a.booleanAttr,r,o)}number(r,o){this.parse(a.numberAttr,r,o)}booleanOrString(r,o){this.parse(a.booleanOrStringAttr,r,o)}booleanOrNumber(r,o){this.parse(a.booleanOrNumberAttr,r,o)}booleanOrNumberOrString(r,o){this.parse(a.booleanOrNumberOrStringAttr,r,o)}json(r,o){this.parse(a.jsonAttr,r,o)}renderCallback(r,o={}){let l=(u,c)=>up.RenderOptions.callbackAttr(u,c,r);this.parse(l,r,o)}parse(r,o,l={}){const u=n.wrapList(l.attr??this._attrNameForKey(o));let c=this._options[o];for(let f of u)c??(c=this._parseFromAttr(r,this._element,f));if(this._defaults!==!1&&(c??(c=l.default??this._defaults[o])),n.isDefined(c)){let f=l.normalize;f&&(c=f(c)),this._options[o]=c}let d;if(this._fail&&(d=up.fragment.failKey(o))){const f=n.compact(n.map(u,p=>this._deriveFailAttrName(p)));this.parse(r,d,{...l,attr:f})}}include(r,o){let l=r(this._element,this._options,{defaults:this._defaults,...o});Object.assign(this._options,l)}_parseFromAttr(r,o,l){return this._closest?a.closestAttr(o,l,r):r(o,l)}_deriveFailAttrName(r){return this._deriveFailAttrNameForPrefix(r,this._attrPrefix+"on-")||this._deriveFailAttrNameForPrefix(r,this._attrPrefix)}_deriveFailAttrNameForPrefix(r,o){if(r.startsWith(o))return`${o}fail-${r.substring(o.length)}`}_attrNameForKey(r){return`${this._attrPrefix}${n.camelToKebabCase(r)}`}}},()=>{const n=up.util;up.FIFOCache=class{constructor({capacity:i=10,normalizeKey:r=n.identity}={}){this._map=new Map,this._capacity=i,this._normalizeKey=r}get(i){return i=this._normalizeKey(i),this._map.get(i)}set(i,r){if(this._map.size===this._capacity){let o=this._map.keys().next().value;this._map.delete(o)}i=this._normalizeKey(i),this._map.set(i,r)}clear(){this._map.clear()}}},()=>{up.Rect=class extends up.Record{keys(){return["left","top","width","height"]}get bottom(){return this.top+this.height}get right(){return this.left+this.width}grow(a){this.left-=a,this.top-=a,this.width+=a*2,this.height+=a*2}static fromElement(a){return new this(a.getBoundingClientRect())}static fromElementAsFixed(a){let i=a.cloneNode(!0);a.after(i),i.style.position="fixed";let r=this.fromElement(i);return i.remove(),r}}},()=>{const n=up.element,a=up.util,i="up-scrollbar-away";up.BodyShifter=class{constructor(){this._anchoredElements=new Set,this._stack=0,this._cleaner=a.cleaner()}lowerStack(){--this._stack===0&&this._unshiftNow()}raiseStack(){++this._stack===1&&this._shiftNow()}onAnchoredElementInserted(o){return this._anchoredElements.add(o),this._shiftElement(o,"right"),()=>this._anchoredElements.delete(o)}_isShifted(){return this._stack>0}_shiftNow(){this._rootScrollbarWidth=up.viewport.rootScrollbarWidth(),this._cleaner(n.setStyleTemp(n.root,{"--up-scrollbar-width":this._rootScrollbarWidth+"px"})),this._shiftElement(document.body,"padding-right");for(let o of this._anchoredElements)this._shiftElement(o,"right")}_unshiftNow(){this._cleaner.clean()}_shiftElement(o,l){if(!this._isShifted())return;let u=n.style(o,l);this._cleaner(n.setStyleTemp(o,{["--up-original-"+l]:u}),n.addClassTemp(o,i))}}},()=>{up.Change=class{constructor(a){this.options=a}execute(){throw new up.NotImplemented}deriveFailOptions(){return up.RenderOptions.deriveFailOptions(this.options)}}},()=>{const n=up.util,a=up.element;up.Change.Addition=class extends up.Change{constructor(r){super(r),this._acceptLayer=r.acceptLayer,this._dismissLayer=r.dismissLayer,this._eventPlans=r.eventPlans||[],this._response=r.response}handleLayerChangeRequests(r,o){this.layer.isOverlay()&&(this._tryAcceptLayerFromServer(),this.layer.assertAlive(),this.layer.tryAcceptForLocation(o,this._response),this.layer.assertAlive(),this.layer.tryAcceptForElements(r,this._response),this.layer.assertAlive(),this._tryDismissLayerFromServer(),this.layer.assertAlive(),this.layer.tryDismissForLocation(o,this._response),this.layer.assertAlive(),this.layer.tryDismissForElements(r,this._response),this.layer.assertAlive()),this.layer.asCurrent(()=>{for(let l of this._eventPlans)up.emit({...l,response:this._response}),this.layer.assertAlive()})}_tryAcceptLayerFromServer(){n.isDefined(this._acceptLayer)&&this.layer.accept(this._acceptLayer,{response:this._response})}_tryDismissLayerFromServer(){n.isDefined(this._dismissLayer)&&this.layer.dismiss(this._dismissLayer,{response:this._response})}_setSource({oldElement:r,newElement:o,source:l}){l==="keep"&&(l=r&&up.fragment.source(r)),l&&a.setMissingAttr(o,"up-source",up.fragment.normalizeSource(l))}_setTime({newElement:r,time:o}){a.setMissingAttr(r,"up-time",o?o.toUTCString():!1)}_setETag({newElement:r,etag:o}){a.setMissingAttr(r,"up-etag",o||!1)}setReloadAttrs(r){this._setSource(r),this._setTime(r),this._setETag(r)}executeSteps({steps:r,responseDoc:o,noneOptions:l}){return new up.Change.UpdateSteps({steps:r,noneOptions:l}).execute(o)}}},()=>{var n;const a=up.util;up.RenderJob=(n=class{constructor(r){this.renderOptions=r}execute(){return this._rendered=this._executePromise(),this}async _executePromise(){try{this._emitGuardEvent(),this.renderOptions=up.RenderOptions.preprocess(this.renderOptions),up.browser.assertConfirmed(this.renderOptions),up.RenderOptions.assertContentGiven(this.renderOptions);let r=await this._getChange().execute();return this._handleResult(r),r}catch(r){throw this._handleResult(r)||this._handleError(r),r}}_handleResult(r){if(r instanceof up.RenderResult){let{onRendered:o,onFinished:l}=r.renderOptions;r.none||up.error.guard(()=>o==null?void 0:o(r));let u=function(c){up.error.guard(()=>l==null?void 0:l(c))};return this.finished.then(u,a.noop),!0}}_handleError(r){let o=r instanceof up.Aborted?"Rendering was aborted":"Error while rendering";up.puts("up.render()",`${o}: ${r.name}: ${r.message}`),up.error.guard(()=>{var l,u;return(u=(l=this.renderOptions).onError)==null?void 0:u.call(l,r)})}get finished(){return this._awaitFinished()}async _awaitFinished(){try{return await(await this._rendered).finished}catch(r){throw r instanceof up.RenderResult?await r.finished:r}}_getChange(){let r=a.memoize(l=>this._handleAbortOption(l)),o={...this.renderOptions,handleAbort:r};return o.url?new up.Change.FromURL(o):o.response?new up.Change.FromResponse(o):new up.Change.FromContent(o)}_emitGuardEvent(){let r=a.pluckKey(this.renderOptions,"guardEvent");
1if(r&&(r.renderOptions=this.renderOptions,up.emit(r,{target:this.renderOptions.origin}).defaultPrevented))throw new up.Aborted(`Rendering was prevented by ${r.type} listener`)}_handleAbortOption({bindFragments:r,bindLayer:o,origin:l,layer:u,request:c}){let{abort:d}=this.renderOptions;if(!d)return;let f={except:c,logOnce:["up.render()","Change with { abort } option will abort other requests"],newLayer:u==="new",origin:l,jid:this.renderOptions.jid};d==="target"?up.fragment.abort(r,{...f}):d==="layer"?up.fragment.abort({...f,layer:o}):d==="all"||d===!0?up.fragment.abort({...f,layer:"any"}):a.isFunction(d)?d(f):up.fragment.abort(d,{...f,layer:o})}},a.delegatePromise(n.prototype,function(){return this._rendered}),a.memoizeMethod(n.prototype,{_awaitFinished:!0,_getChange:!0}),n)},()=>{up.Change.DestroyFragment=class extends up.Change{constructor(a){super(a),this._layer=up.layer.get(a)||up.layer.current,this._element=this.options.element,this._animation=this.options.animation,this._log=this.options.log}execute(){this._parent=this._element.parentNode,up.fragment.markAsDestroying(this._element),up.animate(this._element,this._animation,{...this.options,onFinished:()=>{var a,i;this._erase(),this._emitDestroyed(),(i=(a=this.options).onFinished)==null||i.call(a)}})}_erase(){this._layer.asCurrent(()=>{up.fragment.abort(this._element),up.script.clean(this._element,{layer:this._layer}),this._element.remove()})}_emitDestroyed(){up.fragment.emitDestroyed(this._element,{parent:this._parent,log:this._log})}}},()=>{let n=up.util;up.Change.OpenLayer=class extends up.Change.Addition{constructor(i){super(i),this.target=i.target,this._origin=i.origin,this._baseLayer=i.baseLayer}getPreflightProps(){return{mode:this.options.mode,context:this._buildLayer().context,origin:this.options.origin,target:this.target,bindLayer:this._baseLayer,layer:"new",bindFragments:n.compact([up.fragment.get(":main",{layer:this._baseLayer})]),fragments:[]}}execute(i,r){this._matchPostflight(i),r(),this._createOverlay();let o=n.memoize(()=>this._renderOtherLayers(i)),l=this.layer.on("up:layer:accepting up:layer:dismissing",o);try{let u=[this._renderOverlayContent(i),...o()];return new up.RenderResult({layer:this.layer,target:this.target,renderOptions:this.options,partialResults:u})}finally{l()}}_matchPostflight(i){if(this.target===":none"?this._content=document.createElement("up-none"):this._content=i.select(this.target),!this._content||!this._baseLayer.isAlive())throw new up.CannotMatch}_createOverlay(){up.puts("up.render()",`Opening element "${this.target}" in new overlay`),this._assertOpenEventEmitted(),this.layer=this._buildLayer(),this._baseLayer.peel({history:!this.layer.history,intent:this.options.peel}),this._baseLayer.saveHistory(),up.layer.stack.push(this.layer),this.layer.createElements(),this.layer.setupHandlers()}_renderOverlayContent(i){this.handleLayerChangeRequests([this._content],this._getNewLocation()),i.commitElement(this._content),this.layer.setContent(this._content),i.finalizeElement(this._content),this._handleHistory(),this.setReloadAttrs({newElement:this._content,source:this.options.source});let r=this._compileLayer();this._handleFocus(),this._handleScroll(),this.layer.state="opened",this._emitOpenedEvent(),this.layer.assertAlive();let o=this.layer.startOpenAnimation();return{fragments:[this._content],finished:Promise.all([r,o]),verifyFinished:()=>this.layer.assertAlive()}}_renderOtherLayers(i){let r=this._getHungrySteps().other;return this.executeSteps({steps:r,responseDoc:i})}async _compileLayer(){await up.hello(this.layer.element,{...this.options,layer:this.layer,dataRoot:this._content})}_buildLayer(){const i=r=>this.options=up.RenderOptions.finalize(r);return up.layer.build(this.options,i)}_handleHistory(){var i;this.layer.history==="auto"&&(this.layer.history=up.fragment.hasAutoHistory([this._content],this.layer)),(i=this.layer).history&&(i.history=this._baseLayer.history),this.layer.updateHistory(this._getEffectiveHistoryOptions())}_handleFocus(){var r;(r=this._baseLayer.overlayFocus)==null||r.moveToBack(),this.layer.overlayFocus.moveToFront(),new up.FragmentFocus({fragment:this._content,layer:this.layer,autoMeans:["autofocus","layer"],inputDevice:this.options.inputDevice}).process(this.options.focus)}_handleScroll(){const i={...this.options,fragment:this._content,layer:this.layer,autoMeans:["hash","layer"]};new up.FragmentScrolling(i).process(this.options.scrollMap??this.options.scroll)}_assertOpenEventEmitted(){up.event.assertEmitted("up:layer:open",{origin:this._origin,baseLayer:this._baseLayer,layerOptions:this.options,log:"Opening new overlay"})}_emitOpenedEvent(){this.layer.emit("up:layer:opened",{origin:this._origin,callback:this.layer.callback("onOpened"),log:`Opened new ${this.layer}`})}_getHungrySteps(){return up.radio.hungrySteps(this._getEffectiveRenderOptions())}_getEffectiveRenderOptions(){return{...this.options,layer:this.layer,history:this.layer.history}}_getEffectiveHistoryOptions(){return up.history.options(this.options)}_getNewLocation(){return this._getEffectiveRenderOptions().location}}},()=>{var n;const a=up.util;up.Change.UpdateLayer=(n=class extends up.Change.Addition{constructor(r){r=up.RenderOptions.finalize(r),super(r),this.layer=r.layer,this.target=r.target,this._context=r.context,this._steps=up.fragment.parseTargetSteps(this.target,this.options)}getPreflightProps(){this._matchPreflight();let r=this._getFragments();return{layer:this.layer,bindLayer:this.layer,mode:this.layer.mode,context:a.merge(this.layer.context,this._context),origin:this.options.origin,target:this._bestPreflightSelector(),fragments:r,bindFragments:r}}_bestPreflightSelector(){this._matchPreflight();const r=u=>{var c;return!u.maybe||((c=u.oldElement)==null?void 0:c.isConnected)};let o=this._steps.filter(r);return a.map(o,"selector").join(", ")||":none"}_getFragments(){return this._matchPreflight(),a.map(this._steps,"oldElement")}execute(r,o){this._matchPostflight(r),o();let l=a.memoize(()=>
1this._renderOtherLayers(r)),u=this.layer.on("up:layer:accepting up:layer:dismissing",l);try{let c=[...this._renderCurrentLayer(r),...l()];return new up.RenderResult({target:this.target,layer:this.layer,renderOptions:this.options,partialResults:c})}finally{u()}}_renderCurrentLayer(r){this._steps.length&&up.puts("up.render()",`Updating "${this._bestPreflightSelector()}" in ${this.layer}`),this._coordinateSteps(),this.options.saveScroll&&up.viewport.saveScroll({layer:this.layer}),this.options.saveFocus&&up.viewport.saveFocus({layer:this.layer});let{peel:o}=this.options;return o&&this.layer.peel({history:!this._hasHistory(),intent:o}),this.options.abort!==!1&&up.fragment.abort(this._getFragments(),{reason:"Fragment is being replaced",jid:this.options.jid}),Object.assign(this.layer.context,this._context),this.handleLayerChangeRequests(a.map(this._steps,"newElement"),this._getNewLocation()),this.layer.updateHistory(this._getEffectiveHistoryOptions()),this.executeSteps({steps:this._steps,noneOptions:this.options,responseDoc:r})}_renderOtherLayers(r){let o=this._getHungrySteps().other;return this.executeSteps({steps:o,responseDoc:r})}_matchPreflight(){this._matchOldElements(),this._compressNestedSteps()}_matchPostflight(r){this._matchOldElements(),this._addHungryStepsOnCurrentLayer(),this._compressNestedSteps(),this._matchNewElements(r)}_addHungryStepsOnCurrentLayer(){this._steps.push(...this._getHungrySteps().current)}_matchOldElements(){this._steps=this._steps.filter(r=>{const o=new up.FragmentFinder(a.pick(r,["selector","origin","layer","match","preferOldElements"]));if(r.oldElement||(r.oldElement=o.find()),r.oldElement)return!0;if(!r.maybe)throw new up.CannotMatch})}_matchNewElements(r){this._steps=r.selectSteps(this._steps)}_compressNestedSteps(){this._steps=up.fragment.compressNestedSteps(this._steps)}_getHungrySteps(){return up.radio.hungrySteps(this._getEffectiveRenderOptions())}_coordinateSteps(){let r=up.FocusCapsule.preserve(this.layer),o=up.viewport.getScrollTops({layer:this.layer});this._steps.forEach((l,u)=>{l.focusCapsule=r,l.oldScrollTops=o,l.scrollMap&&(l.scroll=!1),u>0&&(l.focus=!1,l.scrollMap=void 0,l.scroll!=="keep"&&(l.scroll=!1),l.data=void 0)})}_hasHistory(){return a.evalAutoOption(this.options.history,this._hasAutoHistory.bind(this))}_hasAutoHistory(){const r=a.map(this._steps,"oldElement");return up.fragment.hasAutoHistory(r,this.layer)}_getNewLocation(){return this._getEffectiveHistoryOptions().location}_getEffectiveRenderOptions(){return{...this.options,layer:this.layer,history:this._hasHistory()}}_getEffectiveHistoryOptions(){return this._hasHistory()?up.history.options(this.options):{}}},a.memoizeMethod(n.prototype,{_matchPreflight:!0,_matchOldElements:!0,_hasHistory:!0,_getHungrySteps:!0}),n)},()=>{const n=up.util,a=up.element;up.Change.UpdateSteps=class extends up.Change.Addition{constructor(r){super(r),this._steps=n.copy(n.assert(r.steps)),this._noneOptions=r.noneOptions||{}}execute(r){return this.responseDoc=r,this._steps=r.selectSteps(this._steps),this._steps=r.commitSteps(this._steps),[...this._executeSteps(),this._assertLayersAlive()]}_executeSteps(){return this._steps.length?this._steps.toReversed().map(r=>this._executeStep(r)).toReversed():this._executeNoSteps()}_assertLayersAlive(){return{verifyFinished:()=>{for(let r of this._steps)r.layer.assertAlive()}}}_executeStep(r){switch(r.placement){case"swap":{let o=up.fragment.keepPlan(r);return o?this._executeKeepEverythingStep(r,o):this._executeSwapStep(r)}case"content":return this._executeSwapChildrenStep(r);case"before":case"after":return this._executeInsertChildrenStep(r);default:up.fail("Unknown placement: %o",r.placement)}}_executeNoSteps(){return this._handleFocus(null,this._noneOptions),this._handleScroll(null,this._noneOptions),[{}]}_executeKeepEverythingStep(r,o){if(o)return up.fragment.emitKept(o),this._handleFocus(r.oldElement,r),this._handleScroll(r.oldElement,r),{}}_executeSwapStep(r){const o=r.parentElement??r.oldElement.parentNode;up.fragment.markAsDestroying(r.oldElement),this._preserveDescendantKeepables(r);let l,u=up.motion.morph(r.oldElement,r.newElement,r.transition,{...r,afterInsert:()=>{this._restoreDescendantKeepables(r),l=this._welcomeElement(r.newElement,r),this._finalizeDescendantKeepables(r),this._handleFocus(r.newElement,r),this._handleScroll(r.newElement,r)},beforeRemove:()=>{up.script.clean(r.oldElement,{layer:r.layer})},afterRemove:()=>{var c;up.fragment.emitDestroyed(r.oldElement,{parent:o,log:!1}),(c=r.afterRemove)==null||c.call(r)}});return{fragments:[r.newElement],finished:Promise.all([u,l])}}_executeSwapChildrenStep(r){let o=[...r.newElement.children],l=a.wrapChildren(r.oldElement),u=a.wrapChildren(r.newElement),c=this._executeSwapStep({...r,placement:"swap",parentElement:r.oldElement.parentNode,oldElement:l,newElement:u,focus:!1,afterRemove:()=>{a.unwrap(u),this._handleFocus(r.oldElement,r)}});return{fragments:o,finished:c.finished}}_executeInsertChildrenStep(r){let o=[...r.newElement.children],l=a.wrapChildren(r.newElement),u=r.placement==="before"?"afterbegin":"beforeend";r.oldElement.insertAdjacentElement(u,l);let c=this._welcomeElement(l,r);this._handleScroll(l,r);let d=up.animate(l,r.animation,{...r,onFinished:()=>{a.unwrap(l);const f=a.leadingElement(r.oldElement.childNodes)||r.oldElement;this._handleFocus(f,r)}});return{fragments:o,finished:Promise.all([c,d])}}_welcomeElement(r,o){return this.responseDoc.finalizeElement(r),this.setReloadAttrs(o),up.hello(r,o)}_preserveDescendantKeepables(r){const o=[];if(r.keep)for(let l of r.oldElement.querySelectorAll("[up-keep]")){let u=up.fragment.keepPlan({...r,oldElement:l,desce
1ndantsOnly:!0});if(u){const c=l.cloneNode(!0);l.insertAdjacentElement("beforebegin",c),l.classList.add("up-keeping"),up.script.block(u.newElement);let d=up.viewport.subtree(u.oldElement);u.revivers=n.map(d,function(f){let p=up.viewport.copyCursorProps(f);return()=>up.viewport.copyCursorProps(p,f)}),this._willChangeBody()?u.newElement.replaceWith(l):document.body.append(l),o.push(u)}}r.descendantKeepPlans=o}_restoreDescendantKeepables(r){for(let o of r.descendantKeepPlans){o.newElement.replaceWith(o.oldElement);for(let l of o.revivers)l()}}_finalizeDescendantKeepables(r){for(let o of r.descendantKeepPlans)o.oldElement.classList.remove("up-keeping"),up.fragment.emitKept(o)}_willChangeBody(){return n.some(this._steps,r=>r.oldElement.matches("body"))}_handleFocus(r,o){new up.FragmentFocus({...o,fragment:r,autoMeans:up.fragment.config.autoFocus}).process(o.focus)}_handleScroll(r,o){new up.FragmentScrolling({...o,fragment:r,autoMeans:up.fragment.config.autoScroll}).process(o.scrollMap??o.scroll)}}},()=>{const n=up.util;up.Change.CloseLayer=class extends up.Change{constructor(i){super(i),this._verb=i.verb,this.layer=up.layer.get(i),this._origin=i.origin,this._value=i.value,this._preventable=i.preventable??!0,this._response=i.response,this._history=i.history??!0}execute(){if(this.layer.assertAlive(),up.browser.assertConfirmed(this.options),this._emitCloseEvent().defaultPrevented&&this._preventable)throw new up.Aborted("Close event was prevented");this._emitClosingEvent(),up.fragment.abort({reason:"Layer is closing",layer:this.layer}),this.layer.state="closing";const{parent:i}=this.layer;this.layer.peel(),this._handleFocus(i),this.layer.teardownHandlers(),this.layer.destroyElements(this.options),this.layer.stack.remove(this.layer),this._history&&i.restoreHistory(),this.layer.state="closed",this._emitClosedEvent(i)}_emitCloseEvent(){let i=this.layer.emit(this._buildEvent(`up:layer:${this._verb}`),{callback:this.layer.callback(`on${n.upperCaseFirst(this._verb)}`),log:[`Will ${this._verb} ${this.layer} with value %o`,this._value]});return this._value=i.value,i}_emitClosingEvent(){let i=this._buildEvent(`up:layer:${this._verb}ing`);this.layer.emit(i,{log:!1})}_emitClosedEvent(i){const r=`${this._verb}ed`,o=n.upperCaseFirst(r);return this.layer.emit(this._buildEvent(`up:layer:${r}`),{baseLayer:i,callback:this.layer.callback(`on${o}`),ensureBubbles:!0,log:[`${o} ${this.layer} with value %o`,this._value]})}_buildEvent(i){return up.event.build(i,{layer:this.layer,value:this._value,origin:this._origin,response:this._response})}_handleFocus(i){var o;let r=this.layer.hasFocus();if(this.layer.overlayFocus.teardown(),(o=i.overlayFocus)==null||o.moveToFront(),r){let l=this.layer.origin||i.element;up.focus(l,{preventScroll:!0})}}}},()=>{var n;const a=up.util;up.Change.FromURL=(n=class extends up.Change{async execute(){var u,c;let r=this._newPageReason();if(r)return up.puts("up.render()",r),up.network.loadPage(this.options),a.unresolvablePromise();let o=this._getRequestAttrs(),l=this.request=up.request(o);return(c=(u=this.options).onRequestKnown)==null||c.call(u,l),this.options.preload?l:(this.options.handleAbort({request:l,...o}),l.runPreviews(this.options),await a.always(l,d=>this._onRequestSettled(d)))}_newPageReason(){if(a.isCrossOrigin(this.options.url))return"Loading cross-origin content in new page";if(this.options.history&&!up.browser.canPushState())return"Loading content in new page to restore history support"}_getRequestAttrs(){const r=this._preflightPropsForRenderOptions(this.options),o=this._preflightPropsForRenderOptions(this.deriveFailOptions(),{optional:!0});return{...this.options,...r,...a.withRenamedKeys(o,up.fragment.failKey)}}getPreflightProps(){return this._getRequestAttrs()}_preflightPropsForRenderOptions(r,o){return new up.Change.FromContent({...r,preflight:!0}).getPreflightProps(o)}_onRequestSettled(r){return r instanceof up.Response?this._onRequestSettledWithResponse(r):this._onRequestSettledWithError(r)}_onRequestSettledWithResponse(r){return new up.Change.FromResponse({...this.options,response:r}).execute()}_onRequestSettledWithError(r){if(r instanceof up.Offline){let o=["Cannot load fragment from %s: %s",r.request.description,r.reason];this.request.emit("up:fragment:offline",{callback:this.options.onOffline,renderOptions:this.options,retry:l=>up.render({...this.options,...l}),log:o})}throw r}},a.memoizeMethod(n.prototype,{_getRequestAttrs:!0}),n)},()=>{var n;const a=up.util;up.Change.FromResponse=(n=class extends up.Change{constructor(r){super(r),this._response=r.response,this._request=this._response.request}execute(){if(up.fragment.config.skipResponse(this._loadedEventProps())?this._skip():(this._request.assertEmitted("up:fragment:loaded",{...this._loadedEventProps(),callback:this.options.onLoaded,log:["Loaded fragment from %s",this._response.description],skip:()=>this._skip()}
1),this._assetRenderableResponse()),a.evalOption(this.options.fail,this._response)??!this._response.ok)throw this._updateContentFromResponse(this.deriveFailOptions());return this._updateContentFromResponse(this.options)}_assetRenderableResponse(){if(!up.fragment.config.renderableResponse(this._response))throw new up.CannotParse(['Cannot render response with content-type "%s" (configure with up.fragment.config.renderableResponse)',this._response.contentType])}_skip(){up.puts("up.render()","Skipping "+this._response.description),this.options.target=":none",this.options.failTarget=":none"}_updateContentFromResponse(r){return r.didForceFailOptions&&up.puts("up.render()","Rendering failed response using fail-prefixed options (https://unpoly.com/failed-responses)"),this._augmentOptionsFromResponse(r),r.meta=this._helloMeta(),r.verifyFinished=o=>this._revalidate(o,r),new up.Change.FromContent(r).execute()}async _revalidate(r,o){if(!up.fragment.shouldRevalidate(this._request,this._response,o))return;let l=o.target,u=r.target;if(/:(before|after)/.test(l))up.warn("up.render()","Cannot revalidate cache when prepending/appending (target %s)",l);else{up.puts("up.render()",'Revalidating cached response for target "%s"',u);let c=await up.reload(u,{...o,...up.RenderOptions.NO_MOTION,...up.RenderOptions.NO_INPUT_INTERFERENCE,...up.RenderOptions.NO_PREVIEWS,feedback:o.feedback,preferOldElements:r.fragments,layer:r.layer,onFinished:null,expiredResponse:this._response,preview:this._revalidatePreview(o),abort:!1,cache:!1,background:!0});if(!c.none)return c}}_revalidatePreview({preview:r,revalidatePreview:o}){return o===!0?r:o}_loadedEventProps(){const{expiredResponse:r}=this.options;return{request:this._request,response:this._response,renderOptions:this.options,revalidating:!!r,expiredResponse:r}}_helloMeta(){var o,l;let r={revalidating:!!this.options.expiredResponse,ok:this._response.ok};return(l=(o=up.migrate).processHelloMeta)==null||l.call(o,r,this._response),r}_augmentOptionsFromResponse(r){const o=this._response.url;let l=o,u=this._request.hash;u&&(r.hash=u,l+=u),this._response.method==="GET"?r.source=up.history.refineOption(r.source,o):(r.source=up.history.refineOption(r.source,"keep"),r.history=!!r.location);let d=this._response.openLayer;d&&(up.script.adoptRenderOptionsFromHeader(d,this._response.cspInfo),Object.assign(r,{...up.Layer.Overlay.UNSET_VISUALS,target:void 0,...up.fragment.config.navigateOptions,...d,layer:"new"})),r.location=up.history.refineOption(r.location,l),r.title=up.history.refineOption(r.title,this._response.title),r.eventPlans=this._response.eventPlans;let f=this._response.target;f&&(r.target=f),r.acceptLayer=this._response.acceptLayer,r.dismissLayer=this._response.dismissLayer,r.document=this._response.text,this._response.none&&(r.target=":none"),r.context=a.merge(r.context,this._response.context),r.cspInfo=this._response.cspInfo,r.time??(r.time=this._response.lastModified),r.etag??(r.etag=this._response.etag)}},a.memoizeMethod(n.prototype,{_loadedEventProps:!0}),n)},()=>{var n;const a=up.util;up.Change.FromContent=(n=class extends up.Change{constructor(r){super(r),this._origin=r.origin,this._preflight=r.preflight,this._layers=up.layer.getAll(r)}_getPlans(){let r=[];return this._filterLayers(),this._improveOptionsFromResponseDoc(),this._expandIntoPlans(r,this._layers,this.options.target),this._expandIntoPlans(r,this._layers,this.options.fallback),r}_isRenderableLayer(r){return r==="new"||r.isAlive()}_filterLayers(){this._layers=a.filter(this._layers,this._isRenderableLayer)}_expandIntoPlans(r,o,l){for(let u of o)for(let c of this._expandTargets(l,u)){const d={...this.options,target:c,layer:u,defaultPlacement:this._defaultPlacement()},f=u==="new"?new up.Change.OpenLayer(d):new up.Change.UpdateLayer(d);r.push(f)}}_expandTargets(r,o){return up.fragment.expandTargets(r,{layer:o,mode:this.options.mode,origin:this._origin})}execute(){return this.options.preload?Promise.resolve():this._seekPlan(this._executePlan.bind(this))||this._cannotMatchPostflightTarget()}_executePlan(r){return up.fragment.mutate(()=>r.execute(this._getResponseDoc(),this._onPlanApplicable.bind(this,r)))}_isApplicablePlanError(r){return!(r instanceof up.CannotMatch)}_onPlanApplicable(r){let o=this._getPlans()[0];r!==o&&up.puts("up.render()",'Could not match primary target "%s". Updating a fallback target "%s".',o.target,r.target);let{assets:l}=this._getResponseDoc();l&&up.script.assertAssetsOK(l,r.options),this.options.handleAbort(this.getPreflightProps())}_getResponseDoc(){var o,l;if(this._preflight)return;const r=a.pick(this.options,["target","content","fragment","document","html","cspInfo","origin","data"]);return(l=(o=up.migrate).handleResponseDocOptions)==null||l.call(o,r),this._defaultPlacement()==="content"&&(r.target=this._firstExpandedTarget(r.target)),new up.ResponseDoc(r)}_improveOptionsFromResponseDoc(){var o;if(this._preflight)return;let r=this._getResponseDoc();this.options.fragment&&((o=this.options).target||(o.target=r.rootSelector())),this.options.title=up.history.refineOption(this.options.title,r.title),this.options.metaTags=up.history.refineOption(this.options.metaTags,r.metaTags),this.options.lang=up.history.refineOption(this.options.lang,r.lang)}_defaultPlacement(){if(!this.options.document&&!this.options.fragment)return"content"}_firstExpandedTarget(r){let o=this._layers[0]||up.layer.root;return this._expandTargets(r||":main",o)[0]}getPreflightProps(r={}){const o=l=>l.getPreflightProps();return this._seekPlan(o)||r.optional||this._cannotMatchPreflightTarget()}_cannotMatchPreflightTarget(){this._cannotMatchTarget("Could not find target in current page")}_cannotMatchPostflightTarget(){this._cannotMatchTarget("Could not find common target in current page and response")}_cannotMatchTarget(r){if(this._getPlans().length){const o=a.uniq(a.map(this._getPlans(),"target")),l=up.layer.optionToString(this.options.layer);throw new up.CannotMatch([r+" (tried selectors %o in %s)",o,l])}else if(this._layers.length===0)this._cannotMatchLayer();else throw this.options.didForceFailOptions?new up.CannotMatch("No target selector given for failed responses (https://unpoly.com/failed-responses)"):new up.CannotMatch("No target selector given")}_cannotMatchLayer(){throw new up.CannotMatch("Could not find a layer to render in. You may have passed an unmatchable layer reference, or a detached element.")}_seekPlan(r){for(let o of this._getPlans())try{return r(o)}catch(l){if(this._isApplicablePlanError(l))throw l}}},a.memoizeMethod(n.prototype,{_getPlans:!0,_getResponseDoc:!0,getPreflightProps:!0}),n)},()=>{const n=up.util,a=/'nonce-([^']+)'/g;function i(r){let o=r.matchAll(a);return n.map(o,"1")}up.CSPInfo=class{constructor(o="",l=[]){this.declaration=o,this.nonces=l}isStrictDynamic(){return this.declaration.includes("'strict-dynamic'")}isUnsafeEval(){return this.declaration.includes("'unsafe-eval'")}static fromHeader(o){var c;let l={};if(o){let d=o.split(/\s*;\s*/);for(let f of d){let p=(c=f.match(/^(script|default)-src\s/))==null?void 0:c[1];p&&(l[p]=[f,i(f)])}}let u=l.script||l.default;return u?new this(...u):this.none()}static none(){return new this}}},()=>{const n=up.util;up.HelloFragment=class{constructor(i,r,o,{layer:l,data:u,dataRoot:c,dataMap:d,meta:f,insertedEvent:p}){l||(l=up.layer.get(i)||up.layer.current),this._root=i,this._macros=r,this._compilers=o,this._layer=l,this._data=u,this._dataRoot=c||i,this._dataMap=d,this._compilePromises=[],this._insertedEvent=p??!0,f||(f={}),f.layer??(f.layer=l),f.ok??(f.ok=!0),f.revalidating??(f.revalidating=!1),this._meta=f}async run(){return up.puts("up.hello()","Compiling fragment %o",this._root),this._assignDataToElements(),this._runCompilers(this._macros),this._emitCompileEvent(),this._runCompilers(this._compilers),this._emitInsertedEvent(),await Promise.all(this._compilePromises),this._root}_emitCompileEvent(){up.emit(this._root,"up:compilers:before",{log:!1})}_emitInsertedEvent(){this._insertedEvent&&up.fragment.emitInserted(this._root,this._meta)}_assignDataToElements(){if(this._data&&(this._dataRoot.upCompileData=this._data),this._dataMap)for(let i in this._dataMap)for(let r of this._select(i))r.upCompileData=this._dataMap[i]}_runCompilers(i){this._layer.asCurrent(()=>{for(let r of i)this._runCompiler(r)})}_runCompiler(i){var o,l;const r=this._selectOnce(i);if(r.length){if(i.isDefault||up.puts("up.hello()",'Compiling %d× "%s" on %s',r.length,i.selector,this._layer),i.batch)this._compileBatch(i,r);else for(let u of r)this._compileOneElement(i,u);(l=(o=up.migrate).postCompile)==null||l.call(o,r,i)}}_compileOneElement(i,r){const o=[r];if(i.length!==1){const u=up.script.data(r);o.push(u,this._meta)}let l=u=>up.destructor(r,u);this._applyCompilerFunction(i,r,o,l)}_compileBatch(i,r){const o=[r];if(i.length!==1){const u=n.map(r,up.script.data);o.push(u,this._meta)}let l=()=>this._reportBatchCompilerWithDestructor(i);this._applyCompilerFunction(i,r,o,l)}async _applyCompilerFunction(i,r,o,l){let u=up.error.guard(()=>i.apply(r,o));if(n.isPromise(u)){let c=up.error.guardPromise(u);this._compilePromises.push(c),u=await c}u&&l(u)}_reportBatchCompilerWithDestructor(i){let r=new up.Error(["Batch compiler (%s) cannot return a destructor",i.selector]);reportError(r)}_select(i){return up.fragment.subtree(this._root,n.evalOption(i),{layer:this._layer})}_selectOnce(i){let r=this._select(i.selector);return i.rerun||(r=n.filter(r,o=>{let l=o.upAppliedCompilers||(o.upAppliedCompilers=new Set);if(!l.has(i))return l.add(i),!0})),r}}},()=>{const n=up.util;up.DestructorPass=class{constructor(i,r){this._fragment=i,this._options=r}run(){for(let i of this._selectCleanables()){let r=n.pluckKey(i,"upDestructors");r==null||r.clean(i)}}_selectCleanables(){const i={...this._options,destroying:!0};return up.fragment.subtree(this._fragment,".up-can-clean",i)}}},()=>{const n=up.util,a=up.element;up.EventEmitter=class extends up.Record{keys(){return["target","event","baseLayer","callback","log","ensureBubbles"]}emit(){return this._logEmission(),this.baseLayer?this.baseLayer.asCurrent(()=>this._dispatchEvent()):this._dispatchEvent(),this.event}_dispatchEvent(){this.target.dispatchEvent(this.event),this.ensureBubbles&&!this.target.isConnected&&document.dispatchEvent(this.event),up.error.guard(()=>{var r;return(r=this.callback)==null?void 0:r.call(this,this.event)})}
1assertEmitted(){const r=this.emit();if(r.defaultPrevented)throw new up.Aborted(`Event ${r.type} was prevented`)}_logEmission(){if(!up.log.config.enabled)return;let r=this.log,o;n.isArray(r)?[r,...o]=r:o=[];const{type:l}=this.event;n.isString(r)?up.puts(l,r,...o):r!==!1&&up.puts(l,`Event ${l}`)}static fromEmitArgs(r,o={}){var c;let l=n.extractOptions(r);l=n.merge(o,l),n.isElementLike(r[0])?l.target=a.get(r.shift()):r[0]instanceof up.Layer&&(l.layer=r.shift());let u;return n.isGiven(l.layer)&&(u=up.layer.get(l.layer),l.target||(l.target=u.element),l.baseLayer||(l.baseLayer=u)),l.baseLayer&&(l.baseLayer=up.layer.get(l.baseLayer)),n.isString(l.target)?l.target=up.fragment.get(l.target,{layer:l.layer}):l.target||(l.target=document),(c=r[0])!=null&&c.preventDefault?(l.event=r[0],l.log??(l.log=r[0].log)):n.isString(r[0])?l.event=up.event.build(r[0],l):l.event=up.event.build(l),new this(l)}}},()=>{const n=up.util;up.EventListener=class extends up.Record{keys(){return["element","eventType","selector","callback","guard","baseLayer","passive","once","capture","beforeBoot"]}constructor(i){super(i),this._key=this.constructor._buildKey(i),this.isDefault=up.framework.evaling,this.beforeBoot??(this.beforeBoot=this.eventType.indexOf("up:framework:")===0),this.nativeCallback=this.nativeCallback.bind(this)}bind(){var r;const i=(r=this.element).upEventListeners||(r.upEventListeners={});i[this._key]&&up.fail("up.on(): The %o callback %o cannot be registered more than once",this.eventType,this.callback),i[this._key]=this,this.element.addEventListener(...this._addListenerArg())}_addListenerArg(){let i=n.compactObject(n.pick(this,["once","passive","capture"]));return[this.eventType,this.nativeCallback,i]}unbind(){let i=this.element.upEventListeners;i&&delete i[this._key],this.element.removeEventListener(...this._addListenerArg())}nativeCallback(i){if(up.framework.beforeBoot&&!this.beforeBoot)return;let r=i.target;if(this.selector){let o=n.evalOption(this.selector);r=r.closest(o)}if(!(this.guard&&!this.guard(i))&&r){const o=[i,r],l=this.callback.length;if(l!==1&&l!==2){const c=up.script.data(r);o.push(c)}if(this.eventType==="click"&&r.disabled)return;const u=this.callback.bind(r,...o);this.baseLayer?this.baseLayer.asCurrent(u):u()}}static fromElement(i){let r=i.element.upEventListeners;if(r){const o=this._buildKey(i);return r[o]}}static _buildKey(i){var r;return(r=i.callback).upUid||(r.upUid=n.uid()),[i.eventType,i.selector,i.callback.upUid].join("|")}static allNonDefault(i){let r=i.upEventListeners;if(r){const o=Object.values(r);return n.reject(o,"isDefault")}else return[]}}},()=>{const n=up.util;up.EventListenerGroup=class extends up.Record{keys(){return["elements","eventTypes","selector","callback","guard","baseLayer","passive","once","capture","beforeBoot"]}bind(){const i=n.cleaner();return this._eachListenerAttributes(function(r){const o=new up.EventListener(r);return o.bind(),i(o.unbind.bind(o))}),i.clean}_eachListenerAttributes(i){for(let r of this.elements)for(let o of this.eventTypes)i(this._listenerAttributes(r,o))}_listenerAttributes(i,r){return{...this.attributes(),element:i,eventType:r}}unbind(){this._eachListenerAttributes(function(i){let r=up.EventListener.fromElement(i);r&&r.unbind()})}static fromBindArgs(i,r){i=n.copy(i);const o=i.pop();let l;i[0].addEventListener?l=[i.shift()]:n.isJQuery(i[0])||n.isList(i[0])&&i[0][0].addEventListener?l=i.shift():l=[document];let u=n.getSimpleTokens(i.shift()),c=up.migrate.fixEventTypes;c&&(u=c(u));const d=n.extractOptions(i),f=i[0],p={elements:l,eventTypes:u,selector:f,callback:o,...d,...r};return new this(p)}}},()=>{const n=up.util;up.SelectorTracker=class{constructor(i,r,o){this._selector=i,this._addCallback=o,this._layer=r.layer||"any",this._filter=r.filter||n.identity,this._knownMatches=new Map,this._syncScheduled=!1}start(){return this._sync(),n.sequence(this._trackFragments(),()=>this._removeAllMatches())}_trackFragments(){return up.on("up:fragment:inserted up:fragment:destroyed",()=>this._scheduleSync())}_scheduleSync(){this._syncScheduled||(this._syncScheduled=!0,up.fragment.afterMutate(()=>this._sync()))}_sync(){this._syncScheduled=!1;let i=new Map(this._knownMatches);this._knownMatches.clear();for(let r of this._currentMatches){let o=i.get(r);i.delete(r);let l=o||this._addCallback(r)||n.noop;this._knownMatches.set(r,l)}this._runRemoveCallbacks(i)}get _currentMatches(){let i=up.fragment.all(this._selector,{layer:this._layer});return this._filter(i)}_removeAllMatches(){this._runRemoveCallbacks(this._knownMatches)}_runRemoveCallbacks(i){for(let[r,o]of i)o(r)}}},()=>{const n=up.util;up.FieldWatcher=class{constructor(i,r,o){this._options=r,this._root=i,this._callback=o,this._batch=r.batch,this._logPrefix=r.logPrefix??"up.watch()",this._includeDisabled=r.includeDisabled,this._ensureWatchable()}start(){return this._scheduledValues=null,this._processedValues=this._readFieldValues(),this._currentTimer=null,this._callbackRunning=!1,n.sequence(this._trackFields(),this._trackAbort(),this._trackReset(),()=>this._abort())}_ensureWatchable(){const i=r=>up.fail(r,this._logPrefix,this._root);this._callback||i("No callback provided for %s (%o)"),this._root.matches("input[type=radio]")&&i("Use %s with the container of a radio group, not with an individual radio button (%o)"),up.form.isField(this._root)&&!this._root.name&&i("%s can only watch fields with a name (%o)")}_trackFields(){return up.form.isField(this._root)?this._watchField(this._root):up.form.trackFields(this._root,i=>this._watchField(i))}_trackAbort(){let i=({target:r})=>r.contains(this._region);return up.on("up:fragment:aborted",{guard:i},()=>this._abort())}_trackReset(){let i=({target:r})=>r===this._region;return up.on("reset",{guard:i},r=>this._onFormReset(r))}get _region(){return up.form.getRegion(this._root)}_fieldOptions(i){let r=n.copy(this._options);return up.form.watchOptions(i,r,{defaults:{event:"input"}})}_watchField(i){let r=this._fieldOptions(i),o=r.event;return up.on(i,o,l=>this._check(l,r))}_abort(){this._scheduledValues=null}_scheduleValues(i,r){this._scheduledValues=i,this._scheduledFieldOptions=r;let o=r.delay||0;clearTimeout(this._currentTimer),this._currentTimer=n.timer(o,()=>{this._currentTimer=null,this._requestCallback()})}_isNewValues(i){return!n.isEqual(i,this._processedValues)&&!n.isEqual(this._scheduledValues,i)}async _requestCallback(){if(!this._scheduledValues||this._callbackRunning||this._currentTimer||!up.fragment.isAlive(this._region))return;let i=n.omit(this._scheduledFieldOptions,["event","delay"]);const r=this._changedValues(this._processedValues,this._scheduledValues);this._processedValues=this._scheduledValues,this._scheduledValues=null,this._callbackRunning=!0,this._scheduledFieldOptions=null;const o=[];if(this._batch)o.push(this._runCallback(r,i));else for(let l in r){const u=r[l];o.push(this._runCallback(u,l,i))}n.some(o,n.isPromise)&&await Promise.allSettled(o),this._callbackRunning=!1,this._requestCallback()}_runCallback(...i){return up.error.guard(this._callback,...i)}_changedValues(i,r){const o={};let l=Object.keys(i);l=l.concat(Object.keys(r)),l=n.uniq(l);for(let u of l){const c=i[u],d=r[u];n.isEqual(c,d)||(o[u]=d)}return o}_readFieldValues(){return up.Params.fromContainer(this._root,{includeDisabled:this._includeDisabled}).toObject()}_check(i,r={}){const o=this._readFieldValues();this._isNewValues(o)&&(up.log.putsEvent(i),this._scheduleValues(o,r))}_onFormReset(i){n.task(()=>this._check(i))}}},()=>{const n=up.util,a=up.element,i=[{attr:"up-hide-for",toggle(r,o){a.toggle(r,!o)}},{attr:"up-show-for",toggle(r,o){a.toggle(r,o)}},{attr:"up-disable-for",toggle(r,o){up.form.setDisabled(r,o)}},{attr:"up-enable-for",toggle(r,o){up.form.setDisabled(r,!o)}}];up.Switcher=class{constructor(o){this._root=o,this._switcheeSelector=o.getAttribute("up-switch")||up.fail("No switch target given for %o",o),this._regionSelector=o.getAttribute("up-switch-region")}start(){return this._switchRegion(),n.sequence(this._trackFieldChanges(),this._trackNewSwitchees())}_trackFieldChanges(){var l,u;let o=()=>this._onFieldChanged();return((u=(l=up.migrate).watchForSwitch)==null?void 0:u.call(l,this._root,o))||up.watch(this._root,{logPrefix:"[up-switch]",includeDisabled:!0},o)}_trackNewSwitchees(){let o=u=>{let c=this._scope;return n.filter(u,d=>c==null?void 0:c.contains(d))},l=u=>this._switchSwitchee(u);return up.fragment.trackSelector(this._switcheeSelector,{filter:o},l)}_onFieldChanged(){this._switchRegion()}_switchRegion(){const o=this._buildFieldTokens();for(let l of this._findSwitchees())this._switchSwitchee(l,o)}_switchSwitchee(o,l=this._buildFieldTokens()){let u=o.upSwitchValues;n.isEqual(u,l)||(o.upSwitchValues=l,this._switchSwitcheeNow(o,l))}_switchSwitcheeNow(o,l){for(let{attr:c,toggle:d}of i){let f=o.getAttribute(c);if(f){let p=this._parseSwitcheeTokens(f),h=n.intersect(l,p).length>0;d(o,h)}}let u=["Switching %o",o];up.emit(o,"up:form:switch",{field:this._root,fieldTokens:l,log:u})}_findSwitchees(){let o=this._scope;return o?up.fragment.subtree(o,this._switcheeSelector):[]}get _scope(){return this._regionSelector?up.fragment.get(this._regionSelector,{origin:this._root}):up.form.getRegion(this._root)}_parseSwitcheeTokens(o){return n.getSimpleTokens(o,{json:!0})}_buildFieldTokens(){var d;
1let o=up.Params.fromContainer(this._root,{includeDisabled:!0}).values(),l=[...o],u=n.some(o,n.isPresent);l.push(u?":present":":blank");let c=up.form.fields(this._root);if((d=c[0])!=null&&d.matches("[type=radio], [type=checkbox]")){let f=n.some(c,"checked");l.push(f?":checked":":unchecked")}return l}}},()=>{const n=up.util,a=up.element;up.FormValidator=class{constructor(r){this._form=r,this._dirtySolutions=[],this._nextRenderTimer=null,this._rendering=!1,this._honorAbort()}start(){let r=l=>this._isValidatingField(l),o=l=>this._onFieldAdded(l);return up.form.trackFields(this._form,{guard:r},o)}_isValidatingField(r){return r.closest("[up-validate]:not([up-validate=false])")}_onFieldAdded(r){let o=up.form.validateOptions(r).event;return up.on(r,o,l=>{r.closest(".up-keeping")||(up.log.putsEvent(l),up.error.muteUncriticalRejection(this.validate({origin:r})))})}_honorAbort(){up.fragment.onAborted(this._form,r=>this._onAborted(r))}_onAborted(r){let o=new up.Aborted(r.reason),l;for(;l=this._dirtySolutions.shift();)l.deferred.reject(o)}validate(r={}){var l;let o=this._getSolutions(r);return this._dirtySolutions.push(...o),this._scheduleNextRender(),(l=o[0])==null?void 0:l.deferred}_getSolutions(r){let o=this._getTargetSelectorSolutions(r)||this._getFieldSolutions(r)||this._getElementSolutions(r.origin),l=n.newDeferred();for(let u of o){let c=up.form.validateOptions(u.origin,r);u.batch=n.pluckKey(c,"batch"),u.renderOptions=c,u.destination=`${c.method} ${c.url}`,u.target=up.fragment.resolveOrigin(u.target,u),u.deferred=l}return o}_getFieldSolutions({origin:r,...o}){if(up.form.isField(r))return this._getValidateAttrSolutions(r)||this._getFormGroupSolutions(r,o)}_getFormGroupSolutions(r,{formGroup:o=!0}){if(!o)return;let l=up.form.groupSolution(r);if(l)return up.puts("up.validate()","Validating form group of field %o",r),[l]}_getTargetSelectorSolutions({target:r,origin:o}){if(n.isString(r)){up.puts("up.validate()",'Validating target "%s"',r);let l=up.fragment.splitTarget(r);return n.compact(l.map(function(u){let c=up.fragment.get(u,{origin:o});if(c)return{element:c,target:u,origin:o};up.fail('Validation target "%s" does not match an element',u)}))}}_getElementSolutions(r){return up.puts("up.validate()","Validating element %o",r),[{element:r,target:up.fragment.toTarget(r),origin:r}]}_getValidateAttrSolutions(r){let o=r.closest("[up-validate]");if(o){let l=a.booleanOrStringAttr(o,"up-validate");return this._getTargetSelectorSolutions({target:l,origin:r})}}_scheduleNextRender(){let r=this._dirtySolutions.map(l=>l.renderOptions.delay),o=Math.min(...r)||0;clearTimeout(this._nextRenderTimer),this._nextRenderTimer=n.timer(o,()=>{this._nextRenderTimer=null,this._renderDirtySolutions()})}_renderDirtySolutions(){up.error.muteUncriticalRejection(this._doRenderDirtySolutions())}async _doRenderDirtySolutions(){if(!this._dirtySolutions.length||this._rendering||this._nextRenderTimer)return;let r=this._selectDirtySolutionsBatch(),o=this._mergeRenderOptions(r);this._rendering=!0;try{let l=up.render(o);for(let u of r)u.deferred.resolve(l);await l}finally{this._rendering=!1,this._renderDirtySolutions()}}_selectDirtySolutionsBatch(){let r=[],o=0;for(;o<this._dirtySolutions.length;){let l=this._dirtySolutions[o];r.length===0||this._canBatchSolutions(r[0],l)?(r.push(l),this._dirtySolutions.splice(o,1)):o++}return r}_canBatchSolutions(r,o){return r.destination===o.destination&&r.batch&&o.batch}_mergeRenderOptions(r){let o=n.map(r,"origin"),l=n.flatMap(o,up.form.fields),u=n.uniq(n.map(l,"name")),c=n.map(r,"renderOptions"),d=up.form.destinationOptions(this._form),f=n.mergeDefined(d,...c);return f.target=n.map(r,"target").join(", "),f.origin=this._form,f.focus??(f.focus="keep"),f.failOptions=!1,f.defaultMaybe=!0,f.params=up.Params.merge(d.params,...n.map(c,"params")),f.headers=n.merge(d.headers,...n.map(c,"headers")),this._addValidateHeader(f.headers,u),f.feedback=n.some(c,"feedback"),f.data=void 0,f.dataMap=n.mapObject(r,({target:p,element:h,renderOptions:{data:g,keepData:v}})=>[p,v?up.data(h):g]),f.preview=void 0,f.previewMap=n.mapObject(r,({target:p,renderOptions:{preview:h}})=>[p,h]),f.placeholder=void 0,f.placeholderMap=n.mapObject(r,({target:p,renderOptions:{placeholder:h}})=>[p,h]),f.disable=r.map(p=>up.fragment.resolveOrigin(p.renderOptions.disable,p)),f.guardEvent=up.event.build("up:form:validate",{fields:l,log:"Validating form",params:f.params,form:this._form}),f}_addValidateHeader(r,o){let l=up.protocol.headerize("validate"),u=o.join(" ");(!u||u.length>up.protocol.config.maxHeaderSize)&&(u=":unknown"),r[l]=u}}},()=>{up.FocusCapsule=class{constructor(a,i){this._element=a,this._target=i,this._cursorProps=up.viewport.copyCursorProps(this._element)}wasLost(){return document.activeElement!==this._element&&!this._voided}autoVoid(){up.on("focusin",{once:!0},()=>this._voided=!0)}restore(a,i){if(!this.wasLost())return!1;let r=up.fragment.get(this._target,{layer:a});if(r)return up.viewport.copyCursorProps(this._cursorProps,r),up.focus(r,i),!0}static preserve(a){let i=up.viewport.focusedElementWithin(a.element);if(!i)return;let r=up.fragment.tryToTarget(i);if(r)return new this(i,r)}}},()=>{const n=up.util;up.FragmentProcessor=class extends up.Record{keys(){return["fragment","autoMeans","origin","layer"]}process(i){let r=this.preprocessOnce(i);return this.tryProcess(r)}
1preprocessOnce(i){return n.getComplexTokens(i)}tryProcess(i){if(n.isArray(i))return this.processArray(i);if(n.isOptions(i))return this.processSelectorMap(i);if(n.isFunction(i)){let r=up.error.guard(i,this.fragment,this.attributes());return this.tryProcess(r)}if(n.isElement(i))return this.processElement(i);if(n.isString(i)){if(i==="auto")return this.tryProcess(this.autoMeans);let r=i.match(/^(.+?)-if-(.+?)$/);if(r)return this.resolveCondition(r[2])&&this.tryProcess(r[1])}return this.processPrimitive(i)}processSelectorMap(i){return Object.keys(i).filter(r=>{let o=this.findSelector(r);if(o){let l=new this.constructor({...this.attributes(),fragment:o}),u=i[r];return l.process(u)}})}processArray(i){return n.find(i,r=>this.tryProcess(r))}resolveCondition(i){if(i==="main")return this.fragment&&up.fragment.contains(this.fragment,":main")}findSelector(i){const r={layer:this.layer,origin:this.origin};let l=this.fragment&&up.fragment.get(this.fragment,i,r)||up.fragment.get(i,r);if(l)return l;up.warn("up.render()",'Could not find an element matching "%s"',i)}}},()=>{const n=up.util,a=/^([^ >+(]+) (.+)$/;up.FragmentFinder=class{constructor(r){this._options=r,this._origin=r.origin,this._selector=r.selector,this._document=r.document||window.document,this._match=r.match??up.fragment.config.match,this._preferOldElements=r.preferOldElements}find(){return this._findInPreferredElements()||this._findInRegion()||this._findFirst()}_findInPreferredElements(){if(this._preferOldElements)return this._preferOldElements.find(r=>this._document.contains(r)&&up.fragment.matches(r,this._selector))}_findInRegion(){var r;if(this._match==="region"&&!up.fragment.containsMainPseudo(this._selector)&&((r=this._origin)!=null&&r.isConnected))return this._findClosest()||this._findDescendantInRegion()}_findClosest(){return up.fragment.closest(this._origin,this._selector,this._options)}_findDescendantInRegion(){let r=up.fragment.splitTarget(this._selector);return n.findResult(r,o=>{let l=o.match(a);if(l){let u=up.fragment.closest(this._origin,l[1],this._options);if(u)return up.fragment.getFirstDescendant(u,l[2])}})}_findFirst(){return up.fragment.getFirstDescendant(this._document,this._selector,this._options)}}},()=>{const n=up.util,a=up.element,i={preventScroll:!0};up.FragmentFocus=class extends up.FragmentProcessor{keys(){return super.keys().concat(["hash","focusVisible","focusCapsule","inputDevice"])}processPrimitive(o){switch(o){case"keep":return this._restoreLostFocus();case"restore":return this._restorePreviousFocusForLocation();case"target":case!0:return this._focusElement(this.fragment);case"layer":return this._focusElement(this.layer.getFocusElement());case"main":return this._focusSelector(":main");case"hash":return this._focusHash();case"autofocus":return this._autofocus();default:if(n.isString(o))return this._focusSelector(o)}}processElement(o){return this._focusElement(o)}resolveCondition(o){return o==="lost"?this._wasFocusLost():super.resolveCondition(o)}_focusSelector(o){let l=this.findSelector(o);return this._focusElement(l)}_restoreLostFocus(){var o;return(o=this.focusCapsule)==null?void 0:o.restore(this.layer,i)}_restorePreviousFocusForLocation(){return up.viewport.restoreFocus({layer:this.layer})}_autofocus(){let o=this.fragment&&a.subtreeFirst(this.fragment,"[autofocus]");if(o)return this._focusElement(o)}_focusElement(o){if(o)return up.focus(o,{force:!0,...i,inputDevice:this.inputDevice,focusVisible:this.focusVisible}),!0}_focusHash(){let o=up.viewport.firstHashTarget(this.hash,{layer:this.layer});if(o)return this._focusElement(o)}_wasFocusLost(){var o;return(o=this.focusCapsule)==null?void 0:o.wasLost()}}},()=>{const n=up.element,a=up.util;up.FragmentPolling=class{static forFragment(r){return r.upPolling||(r.upPolling=new this(r))}constructor(r){this._options=up.radio.pollOptions(r),this._fragment=r,up.destructor(r,this._onFragmentDestroyed.bind(this)),this._state="stopped",this._forceIntent=null,this._reloadJID=a.uid(),this._loading=!1,this._satisfyInterval()}onPollAttributeObserved(){this._start()}_onFragmentAborted({newLayer:r,jid:o}){o===this._reloadJID||r||this._stop()}_onFragmentKept(){this._forceIntent!=="stop"&&this._start()}_onFragmentDestroyed(){this._stop()}_start(r){if(Object.assign(this._options,r),this._state==="stopped"){if(!up.fragment.isTargetable(this._fragment)){up.warn("[up-poll]","Cannot poll untargetable fragment %o",this._fragment);return}this._state="started",this._bindEvents(),this._scheduleRemainingTime()}}_stop(){this._state==="started"&&(this._clearReloadTimer(),this._state="stopped")}forceStart(r){Object.assign(this._options,r),this._forceIntent="start",this._start()}forceStop(){this._forceIntent="stop",this._stop()}_bindEvents(){this._eventsBound||(this._eventsBound=!0,up.destructor(this._fragment,up.on("visibilitychange up:layer:opened up:layer:dismissed up:layer:
1accepted",this._onVisibilityChange.bind(this))),up.fragment.onAborted(this._fragment,this._onFragmentAborted.bind(this)),up.fragment.onKept(this._fragment,this._onFragmentKept.bind(this)))}_onVisibilityChange(){this._isFragmentVisible()?this._scheduleRemainingTime():this._clearReloadTimer()}_isFragmentVisible(){return!document.hidden&&(this._options.ifLayer==="any"||this._isOnFrontLayer())}_clearReloadTimer(){clearTimeout(this._reloadTimer),this._reloadTimer=null}_scheduleRemainingTime(){this._reloadTimer||this._loading||this._state==="stopped"||(this._clearReloadTimer(),this._reloadTimer=setTimeout(this._onTimerReached.bind(this),this._getRemainingDelay()))}_onTimerReached(){this._reloadTimer=null,this._tryReload()}_tryReload(){if(this._state!=="stopped"){if(!up.fragment.isAlive(this._fragment)){this._stop(),up.puts("[up-poll]","Stopped polling a detached fragment");return}if(!this._isFragmentVisible()){up.puts("[up-poll]","Will not poll hidden fragment");return}this._reloadNow()}}_getFullDelay(){return this._options.interval??n.numberAttr(this._fragment,"up-interval")??up.radio.config.pollInterval}_getRemainingDelay(){return Math.max(this._getFullDelay()-this._getFragmentAge(),0)}_getFragmentAge(){return new Date-this._lastAttempt}_isOnFrontLayer(){var r,o;return this.layer||(this.layer=up.layer.get(this._fragment)),(o=(r=this.layer)==null?void 0:r.isFront)==null?void 0:o.call(r)}_reloadNow(){this._clearReloadTimer(),this._loading=!0;let r=up.event.build("up:fragment:poll",{log:["Polling fragment",this._fragment]}),o={...this._options,guardEvent:r,jid:this._reloadJID};up.reload(this._fragment,o).then(this._onReloadSuccess.bind(this),this._onReloadFailure.bind(this))}_onReloadSuccess({fragment:r}){this._loading=!1,this._satisfyInterval(),r?this._onFragmentSwapped(r):this._scheduleRemainingTime()}_onFragmentSwapped(r){this._forceIntent==="start"&&up.fragment.matches(this._fragment,r)&&this.constructor.forFragment(r).forceStart(this._options)}_onReloadFailure(r){this._loading=!1,this._satisfyInterval(),this._scheduleRemainingTime(),up.error.throwCritical(r)}_satisfyInterval(){this._lastAttempt=new Date}}},()=>{const n=up.util;up.FragmentScrolling=class extends up.FragmentProcessor{keys(){return super.keys().concat(["hash","mode","revealTop","revealMax","revealSnap","scrollBehavior","oldScrollTops"])}processPrimitive(i){switch(i){case"top":return this._scrollTo(0);case"bottom":return this._scrollTo(-0);case"layer":return this._revealLayer();case"main":return this._revealSelector(":main");case"keep":return this._restoreOld();case"restore":return this._restoreSaved();case"hash":return this.hash&&up.viewport.revealHash(this.hash,this.attributes());case"target":case"reveal":case!0:return this._revealElement(this.fragment);default:if(n.isNumber(i))return this._scrollTo(i);if(n.isString(i))return this._revealSelector(i)}}processElement(i){return this._revealElement(i)}_revealElement(i){if(i)return up.reveal(i,this.attributes()),!0}_revealSelector(i){let r=this.findSelector(i);return this._revealElement(r)}_revealLayer(){return this._revealElement(this.layer.getBoxElement())}_scrollTo(i){return up.viewport.scrollTo(i,{...this.attributes(),around:this.fragment})}_restoreOld(){if(this.oldScrollTops)return this._restoreSaved({scrollTops:this.oldScrollTops})}_restoreSaved(i){return up.viewport.restoreScroll({...this.attributes(),around:this.fragment,...i})}}},()=>{const n=up.element,a=up.util;up.Layer=class extends up.Record{keys(){return["element","stack","history","mode","context","lastScrollTops","lastFocusCapsules"]}defaults(){return{context:{},lastScrollTops:up.viewport.newStateCache(),lastFocusCapsules:up.viewport.newStateCache()}}constructor(r={}){super(r),a.assert(this.mode)}setupHandlers(){up.link.convertClicks(this),this._unbindLocationChanged=up.on("up:location:changed",r=>this._onBrowserLocationChanged(r))}teardownHandlers(){var r;(r=this._unbindLocationChanged)==null||r.call(this)}mainTargets(){return up.layer.mainTargets(this.mode)}sync(){}accept(){throw new up.NotImplemented}dismiss(){throw new up.NotImplemented}peel(r){this.stack.peel(this,r)}evalOption(r){return a.evalOption(r,this)}isCurrent(){return this.stack.isCurrent(this)}isFront(){return this.stack.isFront(this)}isRoot(){return this.stack.isRoot(this)}isOverlay(){return this.stack.isOverlay(this)}isAlive(){throw new up.NotImplemented}assertAlive(){if(!this.isAlive())throw new up.Aborted("Layer is no longer alive")}get parent(){return this.stack.parentOf(this)}get child(){return this.stack.childOf(this)}get ancestors(){return this.stack.ancestorsOf(this)}get descendants(){return this.stack.descendantsOf(this)}get subtree(){return[this,...this.descendants]}get index(){return this._index??(this._index=this.stack.indexOf(this))}getContentElement(){return this.contentElement||this.element}getBoxElement(){return this.boxElement||this.element}getFocusElement(){return this.getBoxElement()}getFirstSwappableElement(){throw new up.NotImplemented}contains(r){return r.closest(up.layer.anySelector())===this.element}on(...r){return this._buildEventListenerGroup(r).bind()}off(...r){return this._buildEventListenerGroup(r).unbind()}_buildEventListenerGroup(r){return up.EventListenerGroup.fromBindArgs(r,{guard:o=>this._containsEventTarget(o),elements:[this.element],baseLayer:this})}_containsEventTarget(r){return this.contains(r.target)}wasHitByMouseEvent({clientX:r,clientY:o}){const l=document.elementFromPoint(r,o);return!l||this.contains(l)}_buildEventEmitter(r){return up.EventEmitter.fromEmitArgs(r,{layer:this})}emit(...r){return this._buildEventEmitter(r).emit()}saveHistory(){a.assert(this.isFront()),this.showsLiveHistory()&&(this._savedTitle=this.title,this._savedMetaTags=this.metaTags,this._savedLocation=this.location,this._savedLang=this.lang)}restoreHistory(){this.showsLiveHistory()&&(this._savedLocation&&up.history.push(this._savedLocation),this._savedTitle&&(document.title=this._savedTitle),this._savedMetaTags&&up.history.updateMetaTags(this._savedMetaTags),a.isString(this._savedLang)&&up.history.updateLang(this._savedLang))}asCurrent(r){return this.stack.asCurrent(this,r)}updateHistory(r){var o,l;a.isString(r.location)&&this._updateLocation(r.location,{push:!0}),up.history.config.updateMetaTags&&a.isList(r.metaTags)&&((l=(o=up.migrate)==null?void 0:o.warnOfHungryMetaTags)==null||l.call(o,r.metaTags),this._updateMetaTags(r.metaTags)),a.isString(r.title)&&this._updateTitle(r.title),a.isString(r.lang)&&this._updateLang(r.lang)}showsLiveHistory(){return this.history&&this.isFront()}_onBrowserLocationChanged({location:r}){this.showsLiveHistory()&&this._updateLocation(r,{push:!1})}get title(){return this.showsLiveHistory()?document.title:this._savedTitle}_updateTitle(r){this._savedTitle=r,this.showsLiveHistory()&&(document.title=r)}get metaTags(){return this.showsLiveHistory()?up.history.findMetaTags():this._savedMetaTags}_updateMetaTags(r){this._savedMetaTags=r,this.showsLiveHistory()&&up.history.updateMetaTags(r)}get lang(){return this.showsLiveHistory()?up.history.getLang():this._savedLang}_updateLang(r){this._savedLang=r,this.showsLiveHistory()&&up.history.updateLang(r)}get location(){return this.showsLiveHistory()?up.history.location:this._savedLocation}_updateLocation(r,{push:o}){let l=this._savedLocation,u=up.history.location;this._savedLocation=r,r!==u&&this.showsLiveHistory()&&o&&up.history.push(r),r!==l&&this.state!=="opening"&&this.emit
1("up:layer:location:changed",{location:r,previousLocation:l,log:!1})}selector(r){return this.constructor.selector(r)}static selector(r){throw new up.NotImplemented}toString(){throw new up.NotImplemented}affix(...r){return n.affix(this.getFirstSwappableElement(),...r)}[a.isEqual.key](r){return this.constructor===r.constructor&&this.element===r.element}hasFocus(){let r=document.activeElement;return r!==document.body&&this.element.contains(r)}reset(){Object.assign(this,this.defaults())}}},()=>{var n;const a=up.element,i=up.util;up.Layer.Overlay=(n=class extends up.Layer{keys(){return[...super.keys(),...this.constructor.VISUAL_KEYS,"onOpened","onAccept","onAccepted","onDismiss","onDismissed","acceptEvent","dismissEvent","acceptLocation","dismissLocation","acceptFragment","dismissFragment"]}constructor(o){super(o),this.state="opening",this.dismissible===!0?this.dismissible=["button","key","outside"]:this.dismissible===!1?this.dismissible=[]:this.dismissible=i.getSimpleTokens(this.dismissible),this.acceptLocation&&(this.acceptLocation=new up.URLPattern(this.acceptLocation)),this.dismissLocation&&(this.dismissLocation=new up.URLPattern(this.dismissLocation))}callback(o){let l=this[o];if(l)return l.bind(this)}createElement(o){this.nesting||(this.nesting=this._suggestVisualNesting());const l=i.compactObject(i.pick(this,["align","position","size","class","nesting"]));this.element=this.affixPart(o,null,l)}createBackdropElement(o){this.backdropElement=this.affixPart(o,"backdrop")}createViewportElement(o){this.viewportElement=this.affixPart(o,"viewport",{"up-viewport":""})}createBoxElement(o){this.boxElement=this.affixPart(o,"box")}createContentElement(o){this.contentElement=this.affixPart(o,"content")}setContent(o){this.contentElement.append(o),this.onContentSet()}onContentSet(){}createDismissElement(o){return this.dismissElement=this.affixPart(o,"dismiss",{"up-dismiss":'":button"',"aria-label":this.dismissARIALabel}),a.affix(this.dismissElement,'span[aria-hidden="true"]',{text:this.dismissLabel})}affixPart(o,l,u={}){return a.affix(o,this.selector(l),u)}static selector(o){return i.compact(["up",this.mode,o]).join("-")}_suggestVisualNesting(){const{parent:o}=this;return this.mode===o.mode?1+o._suggestVisualNesting():0}setupHandlers(){var o,l;super.setupHandlers(),this.overlayFocus=new up.OverlayFocus(this),this._supportsDismissMethod("button")&&this.createDismissElement(this.getBoxElement()),this._supportsDismissMethod("outside")&&(this.viewportElement?up.on(this.viewportElement,"up:click",u=>{u.target===this.viewportElement&&this._onOutsideClicked(u,!0)}):this._unbindParentClicked=this.parent.on("up:click",(u,c)=>{if(!up.layer.isWithinForeignOverlay(c)){const d=this.origin&&this.origin.contains(c);this._onOutsideClicked(u,d)}})),this._supportsDismissMethod("key")&&(this._unbindEscapePressed=up.event.onEscape(u=>this.onEscapePressed(u))),this.registerAttrCloser("up-accept",(u,c)=>{this.accept(u,c)}),this.registerAttrCloser("up-dismiss",(u,c)=>{this.dismiss(u,c)}),(l=(o=up.migrate).registerLayerCloser)==null||l.call(o,this),this._registerExternalEventCloser(this.acceptEvent,this.accept),this._registerExternalEventCloser(this.dismissEvent,this.dismiss),this.on("up:click","label[for]",(u,c)=>this._onLabelForClicked(u,c))}_onLabelForClicked(o,l){let u=l.getAttribute("for"),c=up.form.fieldSelector(a.idSelector(u)),d=up.fragment.all(c,{layer:"any"}),f=up.fragment.all(c,{layer:this});if(d.length>1&&f[0]!==d[0]){o.preventDefault();const p=f[0];p.focus(),p.matches("input[type=checkbox], input[type=radio]")&&p.click()}}_onOutsideClicked(o,l){up.log.putsEvent(o),l&&up.event.halt(o),up.error.muteUncriticalSync(()=>this.dismiss(":outside",{origin:o.target}))}onEscapePressed(o){if(this.isFront()){let l=up.form.focusedField();l?l.blur():this._supportsDismissMethod("key")&&(up.event.halt(o,{log:!0}),up.error.muteUncriticalSync(()=>this.dismiss(":key")))}}registerAttrCloser(o,l){this._registerClickCloser(o,l),this._registerSubmitCloser(o,l)}_registerClickCloser(o,l){this.on("up:click",`[${o}]:not(form)`,(u,c)=>{up.event.halt(u,{log:!0});const d=a.jsonAttr(c,o);this._onAttrCloserActivated(c,d,l)})}_registerSubmitCloser(o,l){this.on("submit",`[${o}]`,(u,c)=>{up.event.halt(u,{log:!0});
1const d=up.Params.fromForm(c);this._onAttrCloserActivated(c,d,l)})}_onAttrCloserActivated(o,l,u){const c={origin:o},d=new up.OptionsParser(o,c);d.booleanOrString("animation"),d.string("easing"),d.number("duration"),d.string("confirm"),up.error.muteUncriticalSync(()=>u(l,c))}_registerExternalEventCloser(o,l){if(o)return this.on(o,u=>{u.preventDefault(),up.error.muteUncriticalSync(()=>l.call(this,u,{response:u.response}))})}tryAcceptForElements(o,l){this._tryCloseForElements(this.acceptFragment,this.accept,o,l)}tryDismissForElements(o,l){this._tryCloseForElements(this.dismissFragment,this.dismiss,o,l)}_tryCloseForElements(o,l,u,c){let d=i.findResult(u,f=>a.subtreeFirst(f,o));if(d){const f=up.data(d);up.error.muteUncriticalSync(()=>l.call(this,f,{response:c}))}}tryAcceptForLocation(o,l){this._tryCloseForLocation(o,this.acceptLocation,this.accept,l)}tryDismissForLocation(o,l){this._tryCloseForLocation(o,this.dismissLocation,this.dismiss,l)}_tryCloseForLocation(o,l,u,c){let d=o&&(l==null?void 0:l.recognize(o));if(d){const f={...d,location:o};up.error.muteUncriticalSync(()=>u.call(this,f,{response:c}))}}teardownHandlers(){var o,l;super.teardownHandlers(),(o=this._unbindParentClicked)==null||o.call(this),(l=this._unbindEscapePressed)==null||l.call(this)}destroyElements(o){const l=this.closeAnimationProps(o),u=()=>{var c;this.onElementsRemoved(),(c=o.onFinished)==null||c.call(o)};up.destroy(this.element,{...o,...l,onFinished:u,log:!1})}onElementsRemoved(){}_animationFn(o,l){return up.motion.isNone(o)?!1:(l=this.backdrop&&l,(u,c)=>{const d=up.animate(this.getBoxElement(),o,c),f=up.animate(this.backdropElement,l,c);return Promise.all([d,f])})}startOpenAnimation(o={}){const l=this.openAnimationProps(o),u=()=>{var c;this.wasEverVisible=!0,(c=o.onFinished)==null||c.call(o)};return up.animate(this.element,l.animation,{...l,onFinished:u})}openAnimationProps(o={}){let l=o.animation??this.evalOption(this.openAnimation),u="fade-in";return{animation:this._animationFn(l,u),easing:o.easing||this.openEasing,duration:o.duration||this.openDuration}}closeAnimationProps(o={}){let l=this.wasEverVisible&&(o.animation??this.evalOption(this.closeAnimation)),u="fade-out";return{animation:this._animationFn(l,u),easing:o.easing||this.closeEasing,duration:o.duration??this.closeDuration}}isAlive(){return["opening","opened"].includes(this.state)}accept(o=null,l={}){return this._executeCloseChange("accept",o,l)}dismiss(o=null,l={}){return this._executeCloseChange("dismiss",o,l)}_supportsDismissMethod(o){return i.contains(this.dismissible,o)}_executeCloseChange(o,l,u){return u={...u,verb:o,value:l,layer:this},new up.Change.CloseLayer(u).execute()}getFirstSwappableElement(){return this.getContentElement().children[0]}toString(){return`${this.mode} overlay`}},n.VISUAL_KEYS=["mode","position","align","size","origin","class","backdrop","dismissible","dismissLabel","dismissARIALabel","openAnimation","closeAnimation","openDuration","closeDuration","openEasing","closeEasing","trapFocus"],n.UNSET_VISUALS=i.spanObject(n.VISUAL_KEYS,void 0),n)},()=>{up.Layer.OverlayWithTether=class extends up.Layer.Overlay{createElements(){this.origin||up.fail("Missing { origin } option"),this._tether=new up.Tether({anchor:this.origin,align:this.align,position:this.position}),this.createElement(this._tether.parent),this.createContentElement(this.element)}onContentSet(){this._tether.start(this.element)}onElementsRemoved(){this._tether.stop()}sync(){this.isAlive()&&(up.fragment.isAlive(this.element)&&this._tether.isAlive()?this._tether.sync():this.dismiss(":detached",{animation:!1,preventable:!1}))}}},()=>{up.Layer.OverlayWithViewport=class extends up.Layer.Overlay{static getParentElement(){return document.body}createElements(){up.viewport.bodyShifter.raiseStack(),this.createElement(this.constructor.getParentElement()),this.backdrop&&this.createBackdropElement(this.element),this.createViewportElement(this.element),this.createBoxElement(this.viewportElement),this.createContentElement(this.boxElement)}onElementsRemoved(){up.viewport.bodyShifter.lowerStack()}sync(){this.isAlive()&&!this.element.isConnected&&this.constructor.getParentElement().appendChild(this.element)}}},()=>{var n;const a=up.element;
1up.Layer.Root=(n=class extends up.Layer{get element(){return a.root}constructor(r){super(r),this.setupHandlers()}getFirstSwappableElement(){return document.body}static selector(){return"html"}setupHandlers(){this.element.upHandlersApplied||(this.element.upHandlersApplied=!0,super.setupHandlers())}sync(){this.setupHandlers()}isAlive(){return!0}accept(){this._cannotCloseRoot()}dismiss(){this._cannotCloseRoot()}_cannotCloseRoot(){up.fail("Cannot close the root layer")}toString(){return"root layer"}},n.mode="root",n)},()=>{var n;up.Layer.Modal=(n=class extends up.Layer.OverlayWithViewport{},n.mode="modal",n)},()=>{var n;up.Layer.Popup=(n=class extends up.Layer.OverlayWithTether{},n.mode="popup",n)},()=>{var n;up.Layer.Drawer=(n=class extends up.Layer.OverlayWithViewport{},n.mode="drawer",n)},()=>{var n;up.Layer.Cover=(n=class extends up.Layer.OverlayWithViewport{},n.mode="cover",n)},()=>{var n;const a=up.util,i=up.element;up.LayerLookup=(n=class{constructor(o,l){this._stack=o,l.normalizeLayerOptions!==!1&&up.layer.normalizeOptions(l),this._options=l,this._values=a.getSimpleTokens(l.layer)}all(){let o=a.flatMap(this._values,l=>this._resolveValue(l));return o=a.compact(o),o=a.uniq(o),o}static all(o,...l){const u=a.parseArgIntoOptions(l,"layer"),{layer:c}=u;return c instanceof up.Layer?[c]:new this(o,u).all()}_forElement(o){return o=i.get(o),a.find(this._stack.reversed(),l=>l.contains(o))}_forIndex(o){return this._stack.at(o)}_resolveValue(o){if(o instanceof up.Layer)return o;if(a.isNumber(o))return this._forIndex(o);if(/^\d+$/.test(o))return this._forIndex(Number(o));if(a.isElementLike(o))return this._forElement(o);switch(o){case"any":return[this._getBaseLayer(),...this._stack.reversed()];case"current":return this._getBaseLayer();case"closest":return this._stack.selfAndAncestorsOf(this._getBaseLayer());case"parent":return this._getBaseLayer().parent;case"ancestor":case"ancestors":return this._getBaseLayer().ancestors;case"child":return this._getBaseLayer().child;case"descendant":case"descendants":return this._getBaseLayer().descendants;case"subtree":return this._getBaseLayer().subtree;case"new":return"new";case"root":return this._stack.root;case"overlay":case"overlays":return this._stack.overlays.toReversed();case"front":return this._stack.front;case"origin":return this._getOriginLayer();default:return up.fail("Unknown { layer } option: %o",o)}}_getOriginLayer(){let{origin:o,originLayer:l}=this._options;if(l)return l;if(o)return this._forElement(o)}_getBaseLayer(){let{baseLayer:o}=this._options;if(a.isString(o)){const l={...this._options,baseLayer:this._stack.current,normalizeLayerOptions:!1,layer:o};return this.constructor.all(this._stack,l)[0]}else return o||this._getOriginLayer()||this._stack.current}},a.memoizeMethod(n.prototype,{_getBaseLayer:!0,_getOriginLayer:!0}),n)},()=>{const n=up.util;up.LayerStack=class{constructor(){this._currentOverrides=[],this.layers=[this._buildRoot()]}_buildRoot(){return up.layer.build({mode:"root",stack:this})}remove(i){n.remove(this.layers,i)}peel(i,r={}){const o=i.descendants.toReversed(),l={...r,preventable:!1},u=r.intent==="accept"?"accept":"dismiss",c=r.value??":peel";for(let d of o)d[u](c,l)}reset(){this.peel(this.root,{animation:!1}),this._currentOverrides=[],this.root.reset()}parentOf(i){return this.layers[i.index-1]}childOf(i){return this.layers[i.index+1]}ancestorsOf(i){return this.layers.slice(0,i.index).toReversed()}selfAndAncestorsOf(i){return[i,...i.ancestors]}descendantsOf(i){return this.layers.slice(i.index+1)}isRoot(i){return this.root===i}isOverlay(i){return this.root!==i}isCurrent(i){return this.current===i}isFront(i){return this.front===i}get(...i){return this.getAll(...i)[0]}getAll(...i){return up.LayerLookup.all(this,...i)}sync(){for(let i of this.layers)i.sync()}asCurrent(i,r){try{return this._currentOverrides.push(i),r()}finally{this._currentOverrides.pop()}}reversed(){return this.layers.toReversed()}dismissOverlays(i=null,r={}){r.dismissible=!1;for(let o of this.overlays.toReversed())o.dismiss(i,r)}at(i){return this.layers[i]}indexOf(i){return this.layers.indexOf(i)}get count(){return this.layers.length}get root(){return this.layers[0]}get overlays(){return this.root.descendants}get current(){return n.last(this._currentOverrides)||this.front}get front(){return n.last(this.layers)}}},()=>{const n=up.util;up.LinkCurrentURLs=class{constructor(i){if(this._isSafe=up.link.isSafe(i),this._isSafe){const r=i.getAttribute("href");r&&r!=="#"&&(this._href=n.matchableURL(r));const o=i.getAttribute("up-href");o&&(this._upHREF=n.matchableURL(o));const l=i.getAttribute("up-alias");l&&(this._aliasPattern=new up.URLPattern(l))}}isCurrent(i){var r,o;return i?!!(this._href===i||this._upHREF===i||(o=(r=this._aliasPattern)==null?void 0:r.test)!=null&&o.call(r,i,!1)):!1}isAnyCurrent(i){return i.some(r=>{var o,l;return this._href===r||this._upHREF===r||((l=(o=this._aliasPattern)==null?void 0:o.test)==null?void 0:l.call(o,r,!1))})}}},()=>{const n=up.util,a=up.element;up.LinkFollowIntent=class{constructor(r,o){this._link=r,this._callback=o,this._lastRequest=null,this._on("mouseenter mousedown touchstart",l=>this._scheduleCallback(l)),this._on("mouseleave",()=>this._unscheduleCallback()),up.fragment.onAborted(this._link,()=>this._unscheduleCallback())}_on(r,o){up.on(this._link,r,{passive:!0},o)}
1_scheduleCallback(r){if(!up.link.shouldFollowEvent(r,this._link))return;if(this._unscheduleCallback(),r.type==="mouseenter"){let l=this._parseDelay();this._timer=n.timer(l,()=>this._runCallback(r))}else this._runCallback(r)}_unscheduleCallback(){var r;clearTimeout(this._timer),(r=this._lastRequest)!=null&&r.background&&this._lastRequest.abort(),this._lastRequest=null}_parseDelay(){return a.numberAttr(this._link,"up-preload-delay")??up.link.config.preloadDelay}_runCallback(r){up.log.putsEvent(r),up.fragment.isAlive(this._link)&&this._callback({onRequestKnown:o=>this._lastRequest=o})}}},()=>{const n=up.util;up.MotionController=class{constructor(i){this.finishEvent=`up:${i}:finish`,this._resetProps()}startFunction(i,r){const o=this._startingCount>0;if(!o)for(let l of i)this.finish(l);this._startingCount++;try{return this._playingClusters.push(i),up.error.muteUncriticalRejection(r({nested:o})).finally(()=>n.remove(this._playingClusters,i))}finally{this._startingCount--}}finish(i=document.body){for(let r of this._findPlayingClusters(i)){n.remove(this._playingClusters,r);for(let o of r)this._emitFinishEvent(o)}}_findPlayingClusters(i){return this._playingClusters.filter(r=>n.some(r,o=>i.contains(o)))}_emitFinishEvent(i){return up.emit(i,this.finishEvent,{log:!1})}_resetProps(){this._startingCount=0,this._playingClusters=[]}reset(){this.finish(),this._resetProps()}}},()=>{const n=up.element;up.NonceableCallback=class{constructor(i,r){this.script=i,this.nonce=r}static fromString(i){let r=i.match(/^(nonce-(\S+)\s)?(.*)$/);return new this(r[3],r[2])}unsafeEval(i){return this.nonce?this._runAsScriptElement(i):this._runAsFunction(i)}toString(){return`nonce-${this.nonce} ${this.script}`}_runAsFunction({argNames:i,argValues:r,thisContext:o}){return new Function(...i,this.script).apply(o,r)}_runAsScriptElement(i){let r=`
2      try {
3        up.noncedEval.value = (function(${i.argNames.join()}) {
4          ${this.script}
5        }).apply(up.noncedEval.thisContext, up.noncedEval.argValues)
6      } catch (error) {
7        up.noncedEval.error = error
8      }
9    `,o;try{if(up.noncedEval={...i},o=n.affix(document.body,"script",{nonce:this.nonce,text:r}),up.noncedEval.error)throw up.noncedEval.error;return up.noncedEval.value}finally{up.noncedEval=void 0,o==null||o.remove()}}}},()=>{const n=up.element;up.OverlayFocus=class{constructor(i){this._layer=i,this._focusElement=this._layer.getFocusElement(),this._trapFocus=this._layer.trapFocus}moveToFront(){this._active||(this._active=!0,this._unsetAttrs=n.setAttrsTemp(this._focusElement,{tabindex:"0",role:"dialog","aria-modal":this._trapFocus.toString()}),this._trapFocus&&(this._untrapFocus=up.on("focusin",i=>this._onFocus(i)),this._focusTrapBefore=n.affix(this._focusElement,"beforebegin","up-focus-trap[tabindex=0]"),this._focusTrapAfter=n.affix(this._focusElement,"afterend","up-focus-trap[tabindex=0]")))}moveToBack(){this.teardown()}teardown(){this._active&&(this._active=!1,this._unsetAttrs(),this._trapFocus&&(this._untrapFocus(),this._focusTrapBefore.remove(),this._focusTrapAfter.remove()))}_onFocus(i){const{target:r}=i;this._processingFocusEvent||up.layer.isWithinForeignOverlay(r)||(this._processingFocusEvent=!0,r===this._focusTrapBefore?this._focusEnd():(r===this._focusTrapAfter||!this._layer.contains(r))&&this._focusStart(),this._processingFocusEvent=!1)}_focusStart(i){up.focus(this._focusElement,i)}_focusEnd(){this._focusLastDescendant(this._layer.getBoxElement())||this._focusStart()}_focusLastDescendant(i){for(let r of[...i.children].toReversed())if(up.viewport.tryFocus(r)||this._focusLastDescendant(r))return!0}}},()=>{const n=up.util,a=up.element;up.Params=class{constructor(r,o={}){this._options=o,this.clear(),this.addAll(r)}clear(){this.entries=[]}[n.copy.key](){return new up.Params(this,this._options)}toObject(){const r={};for(let o of this.entries){const{name:l,value:u}=o;n.isBasicObjectProperty(l)||(this._isArrayKey(l)?(r[l]||(r[l]=[]),r[l].push(u)):r[l]=u)}return r}toArray(){return this.entries}toFormData(){const r=new FormData;for(let o of this.entries)r.append(o.name,o.value);return r.entries||(r.originalArray=this.entries),r}toQuery(){return this.withoutBinaryEntries().entries.map(this._arrayEntryToQuery).join("&")}_arrayEntryToQuery(r){const{value:o}=r;let l=encodeURIComponent(r.name);return n.isGiven(o)&&(l+="=",l+=encodeURIComponent(o)),l}_isBinaryEntry({value:r}){return r instanceof Blob}hasBinaryEntries(){return n.some(this.entries,this._isBinaryEntry)}withoutBinaryEntries(){let r=n.reject(this.entries,this._isBinaryEntry);return new this.constructor(r,this._options)}toURL(r){let o=[r,this.toQuery()];o=n.filter(o,n.isPresent);const l=n.contains(r,"?")?"&":"?";return o.join(l)}add(r,o){this.entries.push({name:r,value:o})}addAll(r){n.isMissing(r)||(r instanceof this.constructor?this.entries.push(...r.entries):n.isArray(r)?this.entries.push(...r):n.isString(r)?this._addAllFromQuery(r):n.isFormData(r)?this._addAllFromFormData(r):n.isObject(r)?this._addAllFromObject(r):up.fail("Unsupported params type: %o",r))}keys(){return n.map(this.entries,"name")}values(){return n.map(this.entries,"value")}
9_addAllFromObject(r){for(let o in r){const l=r[o],u=n.isArray(l)?l:[l];for(let c of u)this.add(o,c)}}_addAllFromQuery(r){for(let o of r.split("&"))if(o){let[l,u]=o.split("=");l=decodeURIComponent(l),n.isGiven(u)?u=decodeURIComponent(u):u=null,this.add(l,u)}}_addAllFromFormData(r){for(let o of r.entries())this.add(...o)}set(r,o){this.delete(r),this.add(r,o)}delete(r){this.entries=n.reject(this.entries,this._matchEntryFn(r))}_matchEntryFn(r){return o=>o.name===r}get(r){return this._isArrayKey(r)?this.getAll(r):this.getFirst(r)}getFirst(r){const o=n.find(this.entries,this._matchEntryFn(r));return o==null?void 0:o.value}getAll(r){const o=n.filter(this.entries,this._matchEntryFn(r));return n.map(o,"value")}_isArrayKey(r){return n.evalOption(up.form.config.arrayParam,r)}[n.isBlank.key](){return this.entries.length===0}static fromForm(r,o){return this.fromContainer(r,o)}static fromContainer(r,o){let l=up.form.fields(r);return this.fromFields(l,o)}static fromFields(r,o){const l=new this(null,o);for(let u of n.wrapList(r))l.addField(u);return l}addField(r){r=a.get(r);let o=r.name;if(o&&this._considerFieldEnabled(r)){const{tagName:l}=r,{type:u}=r;if(l==="SELECT")for(let c of r.querySelectorAll("option"))c.selected&&this.add(o,c.value);else if(u==="checkbox"||u==="radio")r.checked&&this.add(o,r.value);else if(u==="file")for(let c of r.files)this.add(o,c);else return this.add(o,r.value)}}_considerFieldEnabled(r){return!r.disabled||this._options.includeDisabled}[n.isEqual.key](r){return this.constructor===r.constructor&&n.isEqual(this.entries,r.entries)}static fromURL(r){const o=new this;let u=n.parseURL(r).search;return u&&(u=u.replace(/^\?/,""),o.addAll(u)),o}static stripURL(r){return n.normalizeURL(r,{search:!1})}static merge(r,...o){let l=n.copy(r);for(let u of o){let c=n.wrapValue(this,u);for(let d of c.keys())l.delete(d);l.addAll(c)}return l}}},()=>{const n=up.util,a=up.element;up.Preview=class{constructor({fragment:r,request:o,renderOptions:l,cleaner:u}){this.fragment=r,this.request=o,this.renderOptions=l,this._cleaner=u}undo(...r){this.ended?reportError(new up.Error("Preview used after end of request")):this._cleaner.guard(...r)}get origin(){return this.request.origin}get params(){return this.request.params}get layer(){return this.request.layer}get ended(){return this.request.ended}get expiredResponse(){return this.renderOptions.expiredResponse}get revalidating(){return!!this.expiredResponse}run(r,o={}){for(let l of up.status.resolvePreviewFns(r))this.undo(up.error.guard(l,this,o))}revert(){this._cleaner.clean()}setAttrs(...r){let[o,l]=this._parseMutatorArgs(r,"val","val");this.undo(a.setAttrsTemp(o,l))}addClass(...r){let[o,l]=this._parseMutatorArgs(r,"val","val");this.undo(a.addClassTemp(o,l))}addClassBatch(r,o){for(let l of r)for(let u of o)this.addClass(l,u)}removeClass(...r){let[o,l]=this._parseMutatorArgs(r,"val","val");this.undo(a.removeClassTemp(o,l))}setStyle(...r){let[o,l]=this._parseMutatorArgs(r,"val","val");this.undo(a.setStyleTemp(o,l))}disable(...r){let[o]=this._parseMutatorArgs(r,"val");this.undo(up.form.disableTemp(o))}insert(...r){let[o,l="beforeend",u]=this._parseMutatorArgs(r,"val",n.isAdjacentPosition,"val");this.undo(up.fragment.insertTemp(o,l,u))}show(...r){let[o]=this._parseMutatorArgs(r,"val");this.undo(a.showTemp(o))}hide(...r){let[o]=this._parseMutatorArgs(r,"val");this.undo(a.hideTemp(o))}hideContent(...r){let[o]=this._parseMutatorArgs(r,"val"),l=a.wrapChildren(o);a.hide(l),this.undo(()=>a.unwrap(l))}showPlaceholder(...r){let[o,l]=this._parseMutatorArgs(r,"val","val"),u=up.fragment.provideNodes(l,{origin:this.origin});up.puts("[up-placeholder]","Showing placeholder %o",l),o?this.swapContent(o,u):this.layer==="new"&&(this.openLayer(u,{closeAnimation:!1}),this.renderOptions.openAnimation=!1)}swapContent(...r){let[o,l]=this._parseMutatorArgs(r,"val","val");this.hideContent(o),this.insert(o,l)}openLayer(r,o={}){let l=":undo-preview",u=({value:d})=>{d!==l&&this.request.abort({reason:"Preview overlay dismissed"})};up.layer.open({...n.pick(this.renderOptions,[...up.Layer.Overlay.VISUAL_KEYS,"target"]),...o,content:r,abort:!1,onDismiss:u});let c=up.layer.front;return this.undo(()=>c.dismiss(l,{preventable:!1})),c}_parseMutatorArgs(r,...o){let[l,...u]=n.args(r,...o);return l=up.fragment.get(l,{layer:this.layer,origin:this.origin})||this.fragment,[l,...u]}}},()=>{const n=up.element,a=300;up.ProgressBar=class{constructor(){this._step=0,this._element=n.affix(document.body,"up-progress-bar"),this._element.style.transition=`width ${a}ms ease-out`,this._moveTo(0),n.paint(this._element),this._width=31,this._nextStep()}_nextStep(){let r;this._width<80?Math.random()<.15?r=7+5*Math.random():r=1.5+.5*Math.random():r=.13*(100-this._width)*Math.random(),this._moveTo(this._width+r),this._step++;const o=a+this._step*40;this.timeout=setTimeout(this._nextStep.bind(this),o)}_moveTo(r){this._width=r,this._element.style.width=`${r}vw`}destroy(){clearTimeout(this.timeout),this._element.remove()}conclude(){clearTimeout(this.timeout),this._moveTo(100),setTimeout(this.destroy.bind(this),a)}}},()=>{const n=up.util;up.RenderOptions=function(){const a={preview:!1,disable:!1,placeholder:!1,feedback:!1},i={scroll:!1,focus:"keep",confirm:!1},r={transition:!1,animation:!1,openAnimation:!1,closeAnimation:!1},l=["url","method","origin","headers","params","cache","fallback","abort","abortable","handleAbort","confirm","feedback","disable","placeholder","preview","origin","originLayer","baseLayer","navigate","fail","onError"].concat(["keep","hungry","history","source","saveScroll"]),u=["url","response","content","fragment","document"],c=["history","focus","scroll"],d={},f={argNames:["result"]},p={argNames:["error"]},h={expandObject:["layer"]},g={expandObject:["layer","value","response"]},v={onLoaded:d,onRendered:f,onFinished:f,onOffline:p,onError:p,onOpened:h,onDismissed:g,onAccepted:g};function b(T,P){return up.script.parseCallback(P,y(T))}function y(T){return v[T]??up.fail(`Unknown callback { ${T} }`)}function m(T,P,z){return up.script.callbackAttr(T,P,y(z))}function S(T){if(T.navigate)return up.fragment.config.navigateOptions}function k({url:T}){if(T)return{url:n.normalizeURL(T)}}function C(T){n.renameKey(T,"useData","data"),n.renameKey(T,"useHungry","hungry"),n.renameKey(T,"useKeep","keep")}function L(T){var z,V;(V=(z=up.migrate).preprocessRenderOptions)==null||V.call(z,T),up.layer.normalizeOptions(T),C(T);const P=n.merge(up.fragment.config.renderOptions,S(T));return n.merge(n.omit(P,c),{defaults:P},{inputDevice:up.event.inputDevice},T,k(T),_(T))}function _({origin:T,originLayer:P}){if(T&&!P)return{originLayer:up.layer.get(T)}}function E(T,P){return n.merge(T.defaults,P,T)}function q(T){n.some(u,P=>
9n.isGiven(T[P]))||(T.defaultToEmptyContent?T.content="":up.fail("up.render() needs either { "+u.join(", ")+" } option"))}function A(T){const P={};for(let z in T){const V=T[z];let G=up.fragment.successKey(z);G&&(P[G]=V)}return P}function R(T){let P={didFail:!0},z=A(T);return T.failOptions?{...T.defaults,...n.pick(T,l),...z,didForceFailOptions:!0,...P}:{...T,...z,...P}}return{preprocess:L,finalize:E,assertContentGiven:q,deriveFailOptions:R,parseCallback:b,callbackAttr:m,NO_PREVIEWS:a,NO_MOTION:r,NO_INPUT_INTERFERENCE:i}}()},()=>{const n=up.util;up.RenderResult=class{constructor({layer:i,target:r,renderOptions:o={},partialResults:l=[]}={}){this.layer=i,this.target=r,this.renderOptions=o,this.fragments=this._partialPhase(l,"fragments").flat(),this.finished=this._finish(l)}_partialPhase(i,r,o){return n.compact([...n.map(i,r),o])}async _finish(i){let r=this._partialPhase(i,"finished"),o=this._partialPhase(i,"verifyFinished",this.renderOptions.verifyFinished);await Promise.all(r);let l=this;for(let u of o)l=await u(l)||l;return l}get none(){return!this.fragments.length}get fragment(){return this.fragments[0]}get ok(){return!this.renderOptions.didFail}}},()=>{var n;const a=up.util;up.Request=(n=class extends up.Record{keys(){return["method","url","hash","params","target","failTarget","headers","timeout","background","cache","expireCache","evictCache","layer","mode","context","failLayer","failMode","failContext","origin","originLayer","originMode","builtAt","wrapMethod","contentType","payload","onLoading","fail","abortable","lateDelay","previews"]}defaults(){let r=up.network.config;return{state:"new",abortable:!0,headers:{},timeout:r.timeout,builtAt:new Date,previews:[],wrapMethod:r.wrapMethod}}constructor(r){var o,l,u;if(super(r),this.params=new up.Params(this.params),this._normalize(),(this.target||this.layer||this.origin)&&!r.basic){const c={origin:this.origin};this.layer=up.layer.get(this.layer,c),this.context||(this.context=this.layer.context||{}),this.mode||(this.mode=this.layer.mode),this.failLayer=up.layer.get(this.failLayer,c),this.failContext||(this.failContext=((o=this.failLayer)==null?void 0:o.context)||{}),this.failMode||(this.failMode=(l=this.failLayer)==null?void 0:l.mode),this.originLayer||(this.originLayer=up.layer.get(this.origin)||up.layer.current),this.originMode||(this.originMode=(u=this.originLayer)==null?void 0:u.mode)}this.bindLayer=r.bindLayer||this.layer,this._fragments=r.fragments,this._bindFragments=r.bindFragments,this._deferred=a.newDeferred(),this._setAutoHeaders()}get effectiveLateTime(){return this.background?!1:this.lateDelay??a.evalOption(up.network.config.lateDelay,this)}isTimed(){return a.isNumber(this.effectiveLateTime)}get xhr(){return this._xhr??(this._xhr=new XMLHttpRequest)}get fragments(){return this._fragments||(this._fragments=this._findFragments())}_findFragments(){let r=up.fragment.parseTargetSteps(this.target),o={origin:this.origin,layer:this.layer},l=a.map(r,u=>up.fragment.get(u.selector,o));return a.compact(l)}get bindFragments(){return this._bindFragments||this.fragments}get fragment(){var r;return(r=this.fragments)==null?void 0:r[0]}_normalize(){this.method=a.normalizeMethod(this.method),this._extractHashFromURL(),this._transferParamsToURL(),this.url=a.normalizeURL(this.url)}_evictExpensiveAttrs(){a.task(()=>{this.layer=void 0,this.failLayer=void 0,this.bindLayer=void 0,this.origin=void 0,this.originLayer=void 0,this._fragments=void 0,this._bindFragments=void 0})}_extractHashFromURL(){var o;let r=(o=this.url)==null?void 0:o.match(/^([^#]*)(#.+)$/);if(r)return this.url=r[1],this.hash=r[2]}_transferParamsToURL(){!this.url||this.allowsPayload()||a.isBlank(this.params)||(this.url=this.params.toURL(this.url),this.params.clear())}isSafe(){return up.network.isSafeMethod(this.method)}allowsPayload(){return a.methodAllowsPayload(this.method)}will302RedirectWithGET(){return this.isSafe()||this.method==="POST"}willCache(){return a.evalAutoOption(this.cache,up.network.config.autoCache,this)}runQueuedCallbacks(){a.always(this,()=>this._evictExpensiveAttrs())}load(){var r;if(this.state==="new"){if(this._emitLoad())return this.state="loading",this._normalize(),(r=this.onLoading)==null||r.call(this),this.expired=!1,new up.Request.XHRRenderer(this).buildAndSend({onload:()=>this._onXHRLoad(),onerror:()=>this._onXHRError(),ontimeout:()=>this._onXHRTimeout(),onabort:()=>this._onXHRAbort()}),!0;this.abort({reason:"Prevented by event listener"})}}runPreviews(r){!this.ended&&!this.fromCache&&(this._revertPreviews=up.status.runPreviews(this,r))}
9_emitLoad(){return!this.emit("up:request:load",{log:["Loading %s",this.description]}).defaultPrevented}loadPage(){up.network.abort(),new up.Request.FormRenderer(this).buildAndSubmit()}_onXHRLoad(){const r=this._extractResponseFromXHR(),o="Loaded "+r.description;this.emit("up:request:loaded",{request:r.request,response:r,log:o}),this.respondWith(r)}_onXHRError(){this._setOfflineState("Network error")}_onXHRTimeout(){this._setOfflineState("Timeout")}_onXHRAbort(){this._setAbortedState()}abort({reason:r}={}){this._setAbortedState(r)&&this._xhr&&this._xhr.abort()}_setAbortedState(r="Unknown reason"){if(this.ended)return;let o=["Aborted request to %s: %s",this.description,r];return this.state="aborted",this._reject(new up.Aborted(o)),this.emit("up:request:aborted",{log:o}),!0}_setOfflineState(r="Unknown reason"){if(this.ended)return;let o=["Cannot load request from %s: %s",this.description,r];this.state="offline",this.emit("up:request:offline",{log:o}),this._reject(new up.Offline(o,{reason:r,request:this}))}respondWith(r){this.response=r,!this.ended&&(this.state="loaded",r.ok?this._resolve(r):this._reject(r))}_resolve(r){this._onSettle(),this._deferred.resolve(r)}_reject(r){this._onSettle(),this._deferred.reject(r)}_onSettle(){var r;(r=this._revertPreviews)==null||r.call(this)}get ended(){return this.state!=="new"&&this.state!=="loading"&&this.state!=="tracking"}csrfHeader(){return up.protocol.csrfHeader()}csrfParam(){return up.protocol.csrfParam()}csrfToken(){if(!this.isSafe()&&!this.isCrossOrigin())return up.protocol.csrfToken()}isCrossOrigin(){return a.isCrossOrigin(this.url)}_extractResponseFromXHR(){const r={method:this.method,url:this.url,request:this,xhr:this.xhr,text:this.xhr.responseText,status:this.xhr.status,title:up.protocol.titleFromXHR(this.xhr),target:up.protocol.targetFromXHR(this.xhr),openLayer:up.protocol.openLayerFromXHR(this.xhr),acceptLayer:up.protocol.acceptLayerFromXHR(this.xhr),dismissLayer:up.protocol.dismissLayerFromXHR(this.xhr),eventPlans:up.protocol.eventPlansFromXHR(this.xhr),context:up.protocol.contextFromXHR(this.xhr),expireCache:up.protocol.expireCacheFromXHR(this.xhr),evictCache:up.protocol.evictCacheFromXHR(this.xhr),fail:this.fail};let o=up.protocol.methodFromXHR(this.xhr),l=up.protocol.locationFromXHR(this.xhr);return l&&(a.matchURLs(this.url,l)||o||(o="GET"),r.url=l),o&&(r.method=o),new up.Response(r)}_buildEventEmitter(r){return up.EventEmitter.fromEmitArgs(r,{layer:this.bindLayer,request:this,origin:this.origin})}emit(...r){return this._buildEventEmitter(r).emit()}assertEmitted(...r){this._buildEventEmitter(r).assertEmitted()}get description(){return this.method+" "+this.url}isBoundToSubtrees(r){return r=a.wrapList(r),a.some(this.bindFragments,function(o){return a.some(r,l=>l.contains(o))})}isBoundToLayers(r){return a.contains(r,this.bindLayer)}get age(){return new Date-this.builtAt}header(r){return this.headers[r]}_setAutoHeaders(){for(let l of["target","failTarget","mode","failMode","context","failContext","originMode"])this._setPropertyHeader(l);let r,o;(r=this.csrfHeader())&&(o=this.csrfToken())&&this._setAutoHeader(r,o),this._setAutoHeader(up.protocol.headerize("version"),up.version)}_setPropertyHeader(r){this._setAutoHeader(up.protocol.headerize(r),this[r])}_setAutoHeader(r,o){a.isMissing(o)||((a.isOptions(o)||a.isArray(o))&&(o=a.safeStringifyJSON(o)),this.headers[r]=o)}mergeIfUnsent(r){if(this.state!=="new"||!this.target||!r.target)return;let o=up.fragment.splitTarget(this.target+","+r.target);this.target=a.uniq(o).join(", "),this._setPropertyHeader("target"),this._fragments=a.uniq([...this.fragments,...r.fragments])}static tester(r,{except:o}={}){let l;if(a.isFunction(r))l=r;else if(r instanceof this)l=u=>r===u;else if(a.isString(r)){let u=new up.URLPattern(r);l=c=>u.test(c.url)}else l=u=>r;return o?u=>!up.cache.willHaveSameResponse(u,o)&&l(u):l}},a.delegatePromise(n.prototype,function(){return this._deferred}),n)},()=>{const n=up.util;class a{constructor(){this.varyHeaders=new Set,this.requests=[]}matchBest(r){let o=this.requests.filter(l=>this.satisfies(l,r));return n.last(o)}delete(r){n.remove(this.requests,r)}put(r){this.requests.push(r)}updateVary(r){for(let o of r.varyHeaderNames)this.varyHeaders.add(o)}satisfies(r,o){return r===o?!0:n.every(this.varyHeaders,l=>{let u=r.header(l),c=o.header(l);if(l==="X-Up-Target"||l==="X-Up-Fail-Target"){if(!u)return!0;
9if(!c)return!1;let d=up.fragment.splitTarget(u),f=up.fragment.splitTarget(c);return n.containsAll(d,f)}else return u===c})}}up.Request.Cache=class{constructor(){this.reset()}reset(){this._routes={},this._requests=[]}get(r){r=this._wrap(r);let o=this._getRoute(r),l=o.matchBest(r);if(l){if(this._isUsable(l))return l;this._delete(r,o)}}async put(r){r=this._wrap(r);let o=this._getRoute(r),{response:l}=r;l&&o.updateVary(l);let u=o.requests.filter(c=>o.satisfies(r,c));for(let c of u)this._delete(c);r.cacheRoute=o,o.put(r),this._requests.push(r),this._limitSize()}async track(r,o,l={}){var c;o.trackedRequest=r,o.state="tracking";let u;r.ended&&r.response?u=r.response:u=await n.always(r),u instanceof up.Response?l.force||r.cacheRoute.satisfies(r,o)?(o.fromCache=!0,u=n.variant(u,{request:o}),o.respondWith(u),n.delegate(o,["expired","state"],()=>r)):(delete o.trackedRequest,o.state="new",(c=l.onIncompatible)==null||c.call(l,o)):(o.state=r.state,o._reject(u))}willHaveSameResponse(r,o){return r===o||r===o.trackedRequest}evict(r=!0,o){this._eachMatch(r,o,l=>this._delete(l))}expire(r=!0,o){this._eachMatch(r,o,l=>l.expired=!0)}reindex(r){this._delete(r),delete r.cacheRoute,this.put(r)}_delete(r){var o;n.remove(this._requests,r),(o=r.cacheRoute)==null||o.delete(r)}_getRoute(r){var o,l;return r.cacheRoute||(o=this._routes)[l=r.description]||(o[l]=new a)}_isUsable(r){return r.age<up.network.config.cacheEvictAge}get currentSize(){return this._requests.length}get _capacity(){return up.network.config.cacheSize}_limitSize(){for(let r=0;r<this.currentSize-this._capacity;r++)this._delete(this._requests[0])}_eachMatch(r=!0,o,l){let u=up.Request.tester(r,o),c=n.filter(this._requests,u);n.each(c,l)}_wrap(r){return n.wrapValue(up.Request,r)}}},()=>{const n=up.util;up.Request.Queue=class{constructor(){this.reset()}reset(){this._queuedRequests=[],this._currentRequests=[],this._emittedLate=!1}get allRequests(){return this._currentRequests.concat(this._queuedRequests)}asap(i){i.runQueuedCallbacks(),n.always(i,()=>this._onRequestSettled(i)),this._scheduleSlowTimer(i),this._queueRequest(i),queueMicrotask(()=>this._poke())}promoteToForeground(i){i.background&&(i.background=!1,this._scheduleSlowTimer(i))}_scheduleSlowTimer(i){if(!i.isTimed())return;let r=Math.max(i.effectiveLateTime-i.age);n.timer(r,()=>
9this._checkForLate())}_getMaxConcurrency(){return n.evalOption(up.network.config.concurrency)}_hasConcurrencyLeft(){const i=this._getMaxConcurrency();return i===-1||this._currentRequests.length<i}get size(){return this.allRequests.length}isBusy(){return this.size>0}_queueRequest(i){this._queuedRequests.push(i)}_pluckNextRequest(){let i=n.find(this._queuedRequests,r=>!r.background);return i||(i=this._queuedRequests[0]),n.remove(this._queuedRequests,i)}_sendRequestNow(i){i.load()&&this._currentRequests.push(i)}_onRequestSettled(i){n.remove(this._currentRequests,i)||n.remove(this._queuedRequests,i),queueMicrotask(()=>this._poke()),n.task(()=>this._checkForRecover())}_poke(){let i;if(this._hasConcurrencyLeft()&&(i=this._pluckNextRequest()))return this._sendRequestNow(i)}abort(...i){let[r=!0,{except:o,reason:l,logOnce:u}]=n.args(i,"val","options"),c=up.Request.tester(r,{except:o});for(let d of[this._currentRequests,this._queuedRequests]){const f=n.filter(d,c);for(let p of f)u&&(up.puts(...u),u=null),p.abort({reason:l}),n.remove(d,p)}}
9_checkForLate(){!this._emittedLate&&this._hasLateTimedRequests()&&(this._emittedLate=!0,up.emit("up:network:late",{log:"Server is slow to respond"}))}_checkForRecover(){this._emittedLate&&!this._timedRequests.length&&(this._emittedLate=!1,up.emit("up:network:recover",{log:"Slow requests were loaded"}))}get _timedRequests(){return this.allRequests.filter(i=>i.isTimed())}_hasLateTimedRequests(){const r=o=>o.age>=o.effectiveLateTime-1;return n.some(this._timedRequests,r)}}},()=>{const n=up.util,a=up.element,i=["GET","POST"];up.Request.FormRenderer=class{constructor(o){this._request=o}buildAndSubmit(){this.params=this._request.params.withoutBinaryEntries();let o=this._request.url,{method:l}=this._request;const u=up.Params.fromURL(o);this.params.addAll(u),o=up.Params.stripURL(o),n.contains(i,l)||(l=up.protocol.wrapMethod(l,this.params)),this._form=a.affix(document.body,"form.up-request-loader",{method:l,action:o});let c=this._request.contentType;c&&this._form.setAttribute("enctype",c);let d,f;(d=this._request.csrfParam())&&(f=this._request.csrfToken())&&this.params.add(d,f),n.each(this.params.toArray(),this._addField.bind(this)),up.browser.submitForm(this._form)}_addField(o){a.affix(this._form,"input[type=hidden]",o)}}},()=>{var n;const a="application/x-www-form-urlencoded",i="multipart/form-data",r=up.util;up.Request.XHRRenderer=(n=class{constructor(l){this._request=l}buildAndSend(l){const u=this._request.xhr;this._params=r.copy(this._request.params),this._request.timeout&&(u.timeout=this._request.timeout),u.open(this._getMethod(),this._request.url);let c=this._getContentType();c&&u.setRequestHeader("Content-Type",c);for(let d in this._request.headers){let f=this._request.headers[d];u.setRequestHeader(d,f)}Object.assign(u,l),u.send(this._getPayload())}_getMethod(){let l=this._request.method;return this._request.wrapMethod&&!this._request.will302RedirectWithGET()&&(l=up.protocol.wrapMethod(l,this._params)),l}_getContentType(){return this._finalizePayload(),this._contentType}_getPayload(){return this._finalizePayload(),this._payload}_finalizePayload(){this._payload=this._request.payload,this._contentType=this._request.contentType,!this._payload&&this._request.allowsPayload()&&(this._contentType||(this._contentType=this._params.hasBinaryEntries()?i:a),this._contentType===i?(this._contentType=null,this._payload=this._params.toFormData()):this._payload=this._params.toQuery().replace(/%20/g,"+"))}},r.memoizeMethod(n.prototype,{_finalizePayload:!0,_getMethod:!0}),n)},()=>{const n=up.util,a=/^(text\/html|application\/xhtml\+xml) *(;|$)/i;up.Response=class extends up.Record{keys(){return["method","url","text","status","request","xhr","target","title","openLayer","acceptLayer","dismissLayer","eventPlans","context","expireCache","evictCache","headers","loadedAt","fail"]}defaults(){return{headers:{},loadedAt:new Date}}get ok(){return!n.evalOption(this.fail??up.network.config.fail,this)}get none(){return!this.text}header(r){var o;return this.headers[r]||((o=this.xhr)==null?void 0:o.getResponseHeader(r))}get varyHeaderNames(){let r=this.header("Vary");return n.getSimpleTokens(r,{separator:","})}get contentType(){return this.header("Content-Type")}isHTML(){return a.test(this.contentType)}get cspInfo(){let r=this.header("Content-Security-Policy")||this.header("Content-Security-Policy-Report-Only");return up.CSPInfo.fromHeader(r)}get lastModified(){let r=this.header("Last-Modified");if(r)return new Date(r)}get etag(){return this.header("ETag")}get json(){return this.parsedJSON||(this.parsedJSON=JSON.parse(this.text))}get age(){return new Date-this.loadedAt}get expired(){return this.age>up.network.config.cacheExpireAge||this.request.expired}get description(){return`HTTP ${this.status} response to ${this.request.description}`}get redirect(){return this.url!==this.request.url||this.method!==this.request.method}get redirectRequest(){if(!this.redirect)return;let r=n.variant(this.request,{method:this.method,url:this.url,cacheRoute:null});return up.cache.track(this.request,r,{force:!0}),r}}},()=>{var n;const a=up.util,i=up.element;up.ResponseDoc=(n=class{constructor({document:o,fragment:l,content:u,target:c,origin:d,data:f,cspInfo:p,match:h}){if(o?this._parseDocument(o,d,f):l?this._parseFragment(l,d,f):this._parseContent(u||"",d,c,f),this._cspInfo=p,up.script.warnOfUnsafeCSP(p),d){let g=up.fragment.tryToTarget(d);g&&(this._rediscoveredOrigin=this.select(g))}this._match=h}_parseDocument(o,l,u){if(o instanceof Document)this._document=o,this._isFullDocument=!0;else if(a.isString(o)){this._isFullDocument=i.isFullDocumentHTML(o);let c=f=>[i.createBrokenDocumentFromHTML(f)],d=up.fragment.provideNodes(o,{origin:l,data:u,htmlParser:c});d[0]instanceof Document?this._document=d[0]:this._document=this._buildFauxDocument(d)}else this._document=this._buildFauxDocument(o)}_parseFragment(o,l,u){let c=i.extractSingular(up.fragment.provideNodes(o,{origin:l,data:u}));this._document=this._buildFauxDocument(c)}_parseContent(o,l,u,c){u||up.fail("must pass a { target } when passing { content }");let d=a.map(up.fragment.parseTargetSteps(u),"selector").join(),f=up.fragment.provideNodes(o,{origin:l,data:c}),p=i.createFromSelector(d,{content:f});this._document=this._buildFauxDocument(p)}
9_buildFauxDocument(o){o=a.wrapList(o);let l=document.createElement("up-document");return l.append(...o),l}rootSelector(){return up.fragment.toTarget(this._document.children[0])}get title(){return this._fromHead(this._getTitleText)}_getHead(){if(this._isFullDocument)return this._document.head}_fromHead(o){let l=this._getHead();return l&&o(l)}get metaTags(){return this._fromHead(up.history.findMetaTags)}get assets(){return this._fromHead(o=>{let l=up.script.findAssets(o);return a.map(l,u=>(u=i.revivedClone(u),up.script.adoptDetachedHeadAsset(u,this._cspInfo),u))})}get lang(){if(this._isFullDocument)return up.history.getLang(this._document)}_getTitleText(o){var l;return(l=o.querySelector("title"))==null?void 0:l.textContent}select(o){return new up.FragmentFinder({selector:o,origin:this._rediscoveredOrigin,document:this._document,match:this._match}).find()}selectSteps(o){return o.filter(l=>this._trySelectStep(l)||this._cannotMatchStep(l))}commitSteps(o){return o.filter(l=>this.commitElement(l.newElement))}_trySelectStep(o){if(o.newElement)return!0;let l=this.select(o.selector);if(!l)return;let{selectEvent:u}=o;if(!(u&&(u.newFragment=l,u.renderOptions=o.originalRenderOptions,up.emit(o.oldElement,u,{callback:o.selectCallback}),u.defaultPrevented)))return o.newElement=l,!0}_cannotMatchStep(o){if(!o.maybe)throw new up.CannotMatch}commitElement(o){if(this._document.contains(o))return up.script.adoptNewFragment(o,this._cspInfo),o.remove(),!0}finalizeElement(o){if(this._document instanceof Document)for(let l of i.subtree(o,":is(noscript, script, audio, video):not(.up-keeping, .up-keeping *)")){let u=i.revivedClone(l);l.replaceWith(u)}}},a.memoizeMethod(n.prototype,{_getHead:!0}),n)},()=>{const n=up.element,a=up.util;up.RevealMotion=class{constructor(r,o={}){this._element=r,this._viewport=n.get(o.viewport)||up.viewport.get(this._element),this._obstructionsLayer=up.layer.get(this._viewport),this._behavior=o.scrollBehavior??o.behavior??"instant";const l=up.viewport.config;this._snap=o.snap??o.revealSnap??l.revealSnap,this._padding=o.padding??o.revealPadding??l.revealPadding,this._top=o.top??o.revealTop??l.revealTop,this._max=o.max??o.revealMax??l.revealMax,this._topObstructionSelector=l.selector("fixedTopSelectors"),this._bottomObstructionSelector=l.selector("fixedBottomSelectors")}start(){const r=this._getViewportRect(this._viewport),o=up.Rect.fromElement(this._element);if(this._max){const c=a.evalOption(this._max,this._element);o.height=Math.min(o.height,c)}o.grow(this._padding),this._substractObstructions(r),r.height<0&&up.fail("Viewport has no visible area");const l=this._viewport.scrollTop;let u=l;if(this._top||o.height>r.height){const c=o.top-r.top;u+=c}else o.top<r.top?u-=r.top-o.top:o.bottom>r.bottom&&(u+=o.bottom-r.bottom);a.isNumber(this._snap)&&u<this._snap&&o.top<.5*r.height&&(u=0),u!==l&&this._viewport.scrollTo({top:u,behavior:this._behavior})}_getViewportRect(){return up.viewport.isRoot(this._viewport)?new up.Rect({left:0,top:0,width:up.viewport.rootWidth(),height:up.viewport.rootHeight()}):up.Rect.fromElement(this._viewport)}_computeObstructionRects(r){let o=up.fragment.all(r,{layer:this._obstructionsLayer});return o=a.filter(o,n.isVisible),a.map(o,l=>n.style(l,"position")==="sticky"?up.Rect.fromElementAsFixed(l):up.Rect.fromElement(l))}_substractObstructions(r){for(let o of this._computeObstructionRects(this._topObstructionSelector)){let l=o.bottom-r.top;l>
90&&(r.top+=l,r.height-=l)}for(let o of this._computeObstructionRects(this._bottomObstructionSelector)){let l=r.bottom-o.top;l>0&&(r.height-=l)}}}},()=>{const n=up.element,a=up.util;up.ScriptGate=class{constructor(g=up.CSPInfo.none()){let v=up.script.cspNonce();this._evalCallbackPolicy=new l(v,g),this._scriptElementPolicy=new u(v,g),this._detachedAssetPolicy=new r(v,g)}warnOfUnsafeCSP(){up.script.config.cspWarnings&&(this._evalCallbackPolicy.warnOfUnsafeCSP(),this._scriptElementPolicy.warnOfUnsafeCSP())}evalCallback(g,v){if(this._evalCallbackPolicy.passesItem(g.nonce))try{return g.unsafeEval(v)}catch(y){throw y instanceof EvalError?new up.Blocked(y.message):y}else throw new up.Blocked("Blocked callback: "+g.script)}adoptNewFragment(g){this._adoptScriptElements(g),this._adoptAttrCallbacks(g)}adoptDetachedHeadAsset(g){if(!up.script.isScript(g))return;let v=new p(g);this._detachedAssetPolicy.processItem(v)}adoptRenderOptionsFromHeader(g){let v=this._evalCallbackPolicy;for(let b of Object.keys(g)){let y=g[b];if(/^on[A-Z]/.test(b)&&a.isString(y)){let m=new f(g,b);v.processItem(m),g[b]=up.RenderOptions.parseCallback(b,g[b])}}}_adoptScriptElements(g){const v=this._scriptElementPolicy;for(let b of up.script.findScripts(g)){let y=new p(b);v.processItem(y)}}_adoptAttrCallbacks(g){const v=this._evalCallbackPolicy;for(let b of up.script.config.nonceableAttributes){let y=n.subtree(g,n.attrSelector(b));for(let m of y){let S=new d(m,b,v);v.processItem(S)}}}};class i{constructor(g,v){this.pageNonce=g,this.cspInfo=v,this._validNonces=new Set(v.nonces),g&&this._validNonces.add(g)}isValidNonce(g){return this._validNonces.has(g)}tryRewriteNonce(g,v=g.readNonce()){this.pageNonce&&this.isValidNonce(v)&&g.writeNonce(this.pageNonce)}warnOfUnsafeCSP(){throw new up.NotImplemented}processItem(g){let v=g.readNonce();!this.passesItem(v)?(this.log(...g.logBlockedDescriptor()),g.block()):this.tryRewriteNonce(g,v)}passesItem(g){throw new up.NotImplemented}}class r extends i{constructor(...g){super(...g)}passesItem(g){return!0}}class o extends i{constructor(g,v,b){super(v,b),this._configProp=g;let y=up.script.config[g];y==="auto"&&(y=this.resolveAuto()),y==="nonce"&&!this.pageNonce&&(this.warn('Enforcing nonces requires a <meta name="csp-nonce">.'),y="block"),this.policyString=y}resolveAuto(){throw new up.NotImplemented}passesItem(g){switch(this.policyString){case"pass":return!0;case"block":return!1;case"nonce":return this.isValidNonce(g);default:up.fail("Unknown policy: %s = %o",this.configExpression(),this.policyString)}}log(...g){up.puts(this.configExpression(),...g)}warn(...g){up.warn(this.configExpression(),...g)}configExpression(){return"up.script.config."+this._configProp}}class l extends o{constructor(...g){super("evalCallbackPolicy",...g)}resolveAuto(){return this.pageNonce?"nonce":"pass"}warnOfUnsafeCSP(){this.policyString==="pass"&&this.cspInfo.isUnsafeEval()&&this.warn(`An 'unsafe-eval' CSP allows arbitrary [up-on...] callbacks. Consider setting ${this.configExpression()} = 'nonce'.`)}}class u extends o{constructor(...g){super("scriptElementPolicy",...g)}resolveAuto(){return this.cspInfo.isStrictDynamic()?"nonce":"pass"}warnOfUnsafeCSP(){this.policyString==="pass"&&this.cspInfo.isStrictDynamic()&&this.warn(`A 'strict-dynamic' CSP allows arbitrary <script> elements in new fragments. Consider setting ${this.configExpression()} = 'nonce'.`)}}class c{readNonce(){return this._getCallback().nonce}writeNonce(g){let v=this._getCallback();v.nonce=g,this.writeCallbackString(v.toString())}_getCallback(){return this._cacheCallback||(this._cacheCallback=up.NonceableCallback.fromString(this.readCallbackString()))}logBlockedDescriptor(){throw new up.NotImplemented}block(){this.writeCallbackString("/* blocked */")}readCallbackString(){throw new up.NotImplemented}writeCallbackString(g){throw new up.NotImplemented}}class d extends c{constructor(g,v){super(),this._element=g,this._attribute=v}logBlockedDescriptor(){return["Blocked callback attribute: %s",n.attrSelector(this._attribute,this.readCallbackString())]}readCallbackString(){return this._element.getAttribute(this._attribute)}writeCallbackString(g){this._element.setAttribute(this._attribute,g)}}class f extends c{constructor(g,v){super(),this._object=g,this._key=v}logBlockedDescriptor(){return["Blocked string callback: { %s: %o }",this._key,this.readCallbackString()]}readCallbackString(){return this._object[this._key]}writeCallbackString(g){this._object[this._key]=g}}class p{constructor(g){this._element=g}readNonce(){return this._element.nonce}writeNonce(g){this._element.setAttribute("nonce",g)}logBlockedDescriptor(){return["Blocked <script> element: %o",this._element]}block(){up.script.block(this._element)}}},()=>{const n=up.util,a=up.element;up.Selector=class{constructor(r,o,l={}){this._filters=[];let u=o&&!document.contains(o);!u&&!l.destroying&&this._filters.push(up.fragment.isNotDestroying),this._ignoreLayers=u||l.layer==="any"||up.layer.count===1;let c;if(this._ignoreLayers)c=up.layer.root;else{if(l.layer??(l.layer=n.presence(o,n.isElement)),this._layers=up.layer.getAll(l),!this._layers.length)throw new up.CannotMatch(["Unknown layer: %o",l.layer]);this._filters.push(d=>n.some(this._layers,f=>f.contains(d))),c=this._layers[0]}this._selectors=up.fragment.expandTargets(r,{...l,layer:c}),this._unionSelector=this._selectors.join()||"match-none"}matches(r){return a.elementLikeMatches(r,this._unionSelector)&&this._passesFilter(r)}closest(r){return this._filterOne(r.closest(this._unionSelector))}descendants(r=document){return this._filterMany(r.querySelectorAll(this._unionSelector))}firstDescendant(r){return this._ignoreLayers?(r||(r=document),this._firstSelectorMatch(o=>
9r.querySelectorAll(o))):n.findResult(this._layers,o=>this._firstSelectorMatch(l=>a.subtree(o.element,l)))}subtree(r){return this._filterMany(a.subtree(r,this._unionSelector))}_firstSelectorMatch(r){return n.findResult(this._selectors,o=>this._filterMany(r(o))[0])}_passesFilter(r){return r&&n.every(this._filters,o=>o(r))}_filterOne(r){return n.presence(r,this._passesFilter.bind(this))}_filterMany(r){return n.filter(r,this._passesFilter.bind(this))}}},()=>{const n=up.util,a=up.element;up.Tether=class{constructor(r){var o,l;(l=(o=up.migrate).handleTetherOptions)==null||l.call(o,r),this._anchor=r.anchor,this._align=r.align,this._position=r.position,this._alignAxis=this._position==="top"||this._position==="bottom"?"horizontal":"vertical",this._viewport=up.viewport.get(this._anchor),this.parent=this._viewport===a.root?document.body:this._viewport,this._syncOnScroll=!this._viewport.contains(this._anchor.offsetParent)}start(r){this._element=r,this._element.style.position="absolute",this._setOffset(0,0),this.sync(),this._changeEventSubscription("on")}stop(){this._changeEventSubscription("off")}_changeEventSubscription(r){let o=this._scheduleSync.bind(this);up[r](window,"resize",o),this._syncOnScroll&&up[r](this._viewport,"scroll",o)}_scheduleSync(){return clearTimeout(this.syncTimer),this.syncTimer=n.task(this.sync.bind(this))}isAlive(){return up.fragment.isAlive(this.parent)&&up.fragment.isAlive(this._anchor)}sync(){const r=this._element.getBoundingClientRect(),o={top:a.styleNumber(this._element,"margin-top"),right:a.styleNumber(this._element,"margin-right"),bottom:a.styleNumber(this._element,"margin-bottom"),left:a.styleNumber(this._element,"margin-left")},l=this._anchor.getBoundingClientRect();let u,c;switch(this._alignAxis){case"horizontal":{switch(this._position){case"top":c=l.top-o.bottom-r.height;break;case"bottom":c=l.top+l.height+o.top;break}switch(this._align){case"left":u=l.left+o.left;break;case"center":u=l.left+.5*(l.width-r.width);break;case"right":u=l.left+l.width-r.width-o.right;break}break}case"vertical":{switch(this._align){case"top":c=l.top+o.top;break;case"center":c=l.top+.5*(l.height-r.height);break;case"bottom":c=l.top+l.height-r.height-o.bottom;break}switch(this._position){case"left":u=l.left-o.right-r.width;break;case"right":u=l.left+l.width+o.left;break}break}}n.isDefined(u)||n.isDefined(c)?this._moveTo(u,c):up.fail("Invalid tether constraints: %o",this._describeConstraints())}_describeConstraints(){return{position:this._position,align:this._align}}_moveTo(r,o){const l=this._element.getBoundingClientRect();this._setOffset(r-l.left+this.offsetLeft,o-l.top+this.offsetTop)}_setOffset(r,o){this.offsetLeft=r,this.offsetTop=o,a.setStyle(this._element,{left:r,top:o},"px")}}},()=>{const n=up.util;up.URLPattern=class{constructor(i){this._groups=[];const r=[],o=[];for(let l of n.getSimpleTokens(i))l[0]==="-"?o.push(l.substring(1)):r.push(l);this._positiveRegexp=this._buildRegexp(r,!0),this._negativeRegexp=this._buildRegexp(o,!1)}_buildRegexp(i,r){if(!i.length)return;i=n.flatMap(i,n.matchableURLPatternAtom),i=i.map(n.escapeRegExp);let o=i.join("|");return o=o.replace(/\\\*/g,".*?"),o=o.replace(/(:|\\\$)([a-z][\w-]*)/ig,(l,u,c)=>u==="\\$"?(r&&this._groups.push({name:c,cast:Number}),"(\\d+)"):(r&&this._groups.push({name:c,cast:String}),"([^/?#]+)")),new RegExp("^(?:"+o+")$")}test(i,r=!0){return r&&(i=n.matchableURL(i)),this._positiveRegexp.test(i)&&!this._isExcluded(i)}recognize(i,r=!0){r&&(i=n.matchableURL(i));let o=this._positiveRegexp.exec(i);if(o&&!this._isExcluded(i)){const l={};return this._groups.forEach((u,c)=>{let d=o[c+1];if(d)return l[u.name]=u.cast(d)}),l}}_isExcluded(i){var r;return(r=this._negativeRegexp)==null?void 0:r.test(i)}}},()=>{up.framework=function(){let n="evaling";function a(){up.emit("up:framework:reset",{log:!1})}function i({mode:f="manual"}={}){if(n!=="configuring"){console.error("Unpoly has already booted");return}let p=d();p?console.error("Unpoly cannot boot: %s",p):(n="booting",up.emit("up:framework:boot",{mode:f,log:!1}),n="booted",up.emit("up:framework:booted",{mode:f,log:!1}))}function r(){var f;if((f=document.currentScript)!=null&&f.async||document.querySelector("[up-boot=manual]:is(html, script)")||document.readyState==="complete")return!0}function o(){up.emit("up:framework:evaled",{log:!1}),r()?console.debug("Call up.boot() after you have configured Unpoly"):document.addEventListener("DOMContentLoaded",()=>i({mode:"auto"})),n="configuring"}function l(){if(n!=="configuring")throw new Error("Unpoly extensions must be loaded before booting");n="evaling"}function u(){n="configuring"}function c(){return!d()}function d(){for(let f of["Promise","DOMParser","FormData","reportError"])if(!window[f])return`Browser doesn't support the ${f} API`;if(document.compatMode==="BackCompat")return"Browser is in quirks mode (missing DOCTYPE?)";
9for(let f of[":is(*)",":has(*)"])if(!CSS.supports(`selector(${f})`))return`Browser doesn't support the ${f} selector`}return{onEvaled:o,boot:i,startExtension:l,stopExtension:u,reset:a,get evaling(){return n==="evaling"},get booted(){return n==="booted"},get beforeBoot(){return n!=="booting"&&n!=="booted"},isSupported:c}}(),up.boot=up.framework.boot},()=>{up.event=function(){const n=up.util,a=up.element;function i(){for(let _ of[window,document,a.root,document.body])for(let E of up.EventListener.allNonDefault(_))E.unbind()}function r(..._){return u(_).bind()}function o(_,E,q){let A=T=>T.target.contains(_),R=up.on(E,{guard:A},q);return up.destructor(_,R),R}function l(..._){return u(_).unbind()}function u(_,E){return up.EventListenerGroup.fromBindArgs(_,E)}function c(_){return up.EventEmitter.fromEmitArgs(_)}function d(..._){return c(_).emit()}function f(..._){const E=n.extractOptions(_),q=_[0]||E.type||up.fail("Missing event type"),A=new Event(q,{bubbles:!0,cancelable:!0});return Object.assign(A,n.omit(E,["type","target"])),A}function p(..._){return c(_).assertEmitted()}function h(_){return r("keydown",function(E){if(E.key==="Escape")return _(E)})}function g(_,E={}){E.log&&up.log.putsEvent(_),_.stopImmediatePropagation(),_.preventDefault()}const v=["metaKey","shiftKey","ctrlKey","altKey"];function b(_){return _.button>0||n.some(v,E=>_[E])}function y(_){return n.isMissing(_.clientX)}function m(_,E,q=[]){const A=f(E,n.pick(_,q));return A.originalEvent=_,["stopPropagation","stopImmediatePropagation","preventDefault"].forEach(function(R){const T=A[R];return A[R]=function(){return _[R](),T.call(A)}}),_.defaultPrevented&&A.preventDefault(),A}function S(_,E){if(b(_))return;const q=a.attr(E,"up-emit"),A=a.jsonAttr(E,"up-emit-props"),R=m(_,q);Object.assign(R,A),up.emit(E,R)}r("up:click","[up-emit]",S);let k=["unknown"];function C(){return n.last(k)}function L(_){k.push(_),setTimeout(()=>k.pop())}return r("keydown keyup",{capture:!0},()=>L("key")),r("pointerdown pointerup",{capture:!0},()=>L("pointer")),r("up:framework:reset",i),{on:r,onClosest:o,off:l,build:f,emit:d,assertEmitted:p,onEscape:h,halt:g,isModified:b,isSyntheticClick:y,fork:m,keyModifiers:v,get inputDevice(){return C()}}}(),up.on=up.event.on,up.off=up.event.off,up.emit=up.event.emit},()=>{up.protocol=function(){const n=up.util,a=up.element,i=function(E){return"X-Up"+E.replace(/(^.|[A-Z])/g,A=>"-"+A.toUpperCase())},r=function(E,q,A=n.identity){let R=E.getResponseHeader(i(q));if(R)return A(R)};function o(E){return r(E,"target")}function l(E){return E==="false"?!1:E}function u(E){return r(E,"evictCache",l)}function c(E){var q,A;return r(E,"expireCache")||((A=(q=up.migrate).clearCacheFromXHR)==null?void 0:A.call(q,E))}function d(E){return r(E,"context",n.parseRelaxedJSON)}function f(E){return r(E,"method",n.normalizeMethod)}function p(E){var q,A;return((A=(q=up.migrate).titleFromXHR)==null?void 0:A.call(q,E))??r(E,"title",n.parseRelaxedJSON)}function h(E){return r(E,"events",n.parseRelaxedJSON)}function g(E){return r(E,"openLayer",n.parseRelaxedJSON)}function v(E){return r(E,"acceptLayer",n.parseRelaxedJSON)}function b(E){return r(E,"dismissLayer",n.parseRelaxedJSON)}const y=n.memoize(function(){return n.normalizeMethod(up.browser.popCookie("_up_method"))});function m(E){let q=r(E,"location")||E.responseURL;if(q)return n.normalizeURL(q)}const S=new up.Config(()=>({methodParam:"_method",csrfParam(){return a.metaContent("csrf-param")},csrfToken(){return a.metaContent("csrf-token")},csrfHeader:"X-CSRF-Token",maxHeaderSize:2048}));function k(){return n.evalOption(S.csrfHeader)}function C(){return n.evalOption(S.csrfParam)}function L(){return n.evalOption(S.csrfToken)}function _(E,q){return q.add(S.methodParam,E),"POST"}return{config:S,locationFromXHR:m,titleFromXHR:p,targetFromXHR:o,methodFromXHR:f,openLayerFromXHR:g,acceptLayerFromXHR:v,contextFromXHR:d,dismissLayerFromXHR:b,eventPlansFromXHR:h,expireCacheFromXHR:c,evictCacheFromXHR:u,csrfHeader:k,csrfParam:C,csrfToken:L,initialRequestMethod:y,headerize:i,wrapMethod:_}}()},()=>{up.log=function(){const n=up.util,a=new up.LogConfig;function i(...g){a.enabled&&l("log",...g)}const r=(...g)=>l("warn",...g),o=(...g)=>l("error",...g);function l(g,v,b,...y){u(g,v,"",b,...y)}function u(g,v,b,y,...m){y&&(a.format?console[g](`%c${v}%c ${y}`,"color: #666666; padding: 1px 3px; border: 1px solid #bbbbbb; border-radius: 2px; font-size: 90%; display: inline-block;"+b,"",...m):console[g](`[${v}] ${n.sprintf(y,...m)}`))}let c;function d(g){if(a.enabled&&c!==g){c=g;let v=g.originalEvent||g,b="#5566cc";u("log",v.type,`color: white; border-color: ${b}; background-color: ${b}`,"Interaction on %o",v.target)}}function f(){if(!a.banner)return;const g=` __ _____  ___  ___  / /_ __
10/ // / _ \\/ _ \\/ _ \\/ / // /  ${up.version}
11\\___/_//_/ .__/\\___/_/\\_. / 
12        / /            / /
13
14`;let v="";up.migrate.loaded||(v+=`Load unpoly-migrate.js to polyfill deprecated APIs.
15
16`),a.enabled?v+="Call `up.log.disable()` to disable logging for this session.":v+="Call `up.log.enable()` to enable logging for this session.";const b="color: #777777";a.format?console.log("%c"+g+"%c"+v,"font-family: monospace;"+b,b):console.log(g+v)}up.on("up:framework:boot",f);function p(){a.enabled=!0}function h(){a.enabled=!1}return{puts:i,putsEvent:d,error:o,warn:r,config:a,enable:p,disable:h}}(),up.puts=up.log.puts,up.warn=up.log.warn},()=>{up.script=function(){const n=up.util,a=up.element,i=new up.Config(()=>({cspNonce(){return a.metaContent("csp-nonce")},cspWarnings:!0,scriptElementPolicy:"auto",evalCallbackPolicy:"auto",assetSelectors:["link[rel=stylesheet]","script[src]","[up-asset]"],noAssetSelectors:["[up-asset=false]"],nonceableAttributes:["up-watch","up-on-keep","up-on-hungry","up-on-opened","up-on-accepted","up-on-dismissed","up-on-loaded","up-on-rendered","up-on-finished","up-on-error","up-on-offline"],scriptSelectors:["script:not([type])",'script[type="text/javascript"]','script[type="module"]','script[type="importmap"]'],noScriptSelectors:['script[type="application/ld+json"]']})),r={"[up-back]":-100,"[up-clickable]":-200,"[up-drawer]":-200,"[up-modal]":-200,"[up-cover]":-200,"[up-popup]":-200,"[up-tooltip]":-200,"[up-dash]":-200,"[up-flashes]":-200,"[up-expand]":-300,"[data-method]":-400,"[data-confirm]":-400,"[up-keep]":9999999999};let o=[],l=[];function u(...I){p(I)}function c(...I){p(I,{macro:!0})}function d(...I){let[H,N,j]=h(I),Z=`[${H}]`,{defaultValue:Q}=N;p([Z,N,de=>{let x=a.booleanOrStringAttr(de,H);if(x!==!1)return n.isDefined(Q)&&x===!0&&(x=Q),j(de,x)}])}function f(I){I=n.evalOption(I);for(let H in r)if(I.indexOf(H)>=0)return r[H];up.fail("Unregistered priority for system macro %o",I)}function p(I,H={}){let N=g(I,H);N.macro?(up.framework.evaling&&(N.priority||(N.priority=f(N.selector))),v(l,N)):v(o,N)}const h=function(I){return n.args(I,"val","options","callback")};function g(I,H){let[N,j,Z]=h(I);return j=n.options(j,{selector:N,isDefault:up.framework.evaling,priority:0,batch:!1,rerun:!1}),Object.assign(Z,j,H)}function v(I,H){let N,j=0;for(;(N=I[j])&&N.priority>=H.priority;)j+=1;if(I.splice(j,0,H),up.framework.booted)if(H.priority===0)for(let Z of up.layer.stack)m(Z.element,{layer:Z,compilers:[H],macros:[],insertedEvent:!1});else up.puts("up.compiler()","Compiler with priority (%s) was registered after booting Unpoly. Compiler will run for future fragments only.",H.selector);return H}function b(I,H){let N=n.scanFunctions(H);if(N.length)if(I.isConnected)(I.upDestructors||(I.upDestructors=y(I))).guard(N);else{up.puts("up.destructor()","Immediately calling destructor for detached element (%o)",I);for(let j of N)up.error.guard(j,I)}}function y(I){let H=n.cleaner();return H(a.addClassTemp(I,"up-can-clean")),H}function m(I,H={}){I=up.fragment.get(I,H);let N=H.macros??l,j=H.compilers??o;return new up.HelloFragment(I,N,j,H).run()}function S(I,H={}){new up.DestructorPass(I,H).run()}function k(I){return I=up.fragment.get(I),I.upData||(I.upData=C(I))}function C(I){let H=a.jsonAttr(I,"up-data")??{};return n.isOptions(H)?{...I.upTemplateData,...I.dataset,...H,...I.upCompileData}:H}function L(I=document.head){return I.querySelectorAll(i.selector("assetSelectors"))}function _(I,H){let{response:N}=H,j=L();
16E(j)!==E(I)&&up.event.assertEmitted("up:assets:changed",{oldAssets:j,newAssets:I,renderOptions:H,response:N})}function E(I){return n.map(I,q).join()}function q(I){return a.removeAttrsFromHTML(I.outerHTML,["nonce"])}function A(I){for(let H of R(I))H.type="up-blocked-script"}function R(I,H=""){let N=i.selector("scriptSelectors",H);return a.subtree(I,N)}function T(I){return i.matches(I,"scriptSelectors")}function P(I,H){new up.ScriptGate(H).adoptNewFragment(I)}function z(I,H){new up.ScriptGate(H).adoptDetachedHeadAsset(I)}function V(I,H){new up.ScriptGate(H).adoptRenderOptionsFromHeader(I)}function G(I,H,N){return a.parseAttr(I,H,j=>X(j,N).bind(I))}function X(I,{argNames:H=["event"],expandObject:N=!1}={}){return function(...j){if(N){let se=j[0];H=[...H,...N],j=[se,...Object.values(n.pick(se,N))]}const Z=up.NonceableCallback.fromString(I),Q={thisContext:this,argNames:H,argValues:j};return new up.ScriptGate().evalCallback(Z,Q)}}function $(){return n.evalOption(i.cspNonce)}function K(I){new up.ScriptGate(I).warnOfUnsafeCSP()}function Y(){o=n.filter(o,"isDefault"),l=n.filter(l,"isDefault")}return up.on("up:framework:reset",Y),{config:i,compiler:u,macro:c,attrCompiler:d,destructor:b,hello:m,clean:S,data:k,findAssets:L,assertAssetsOK:_,block:A,adoptNewFragment:P,adoptRenderOptionsFromHeader:V,adoptDetachedHeadAsset:z,parseCallback:X,cspNonce:$,warnOfUnsafeCSP:K,callbackAttr:G,isScript:T,findScripts:R}}(),up.compiler=up.script.compiler,up.destructor=up.script.destructor,up.macro=up.script.macro,up.data=up.script.data,up.hello=up.script.hello,up.attribute=up.script.attrCompiler},()=>{up.history=function(){const n=up.util,a=up.element,i=new up.Config(()=>({enabled:!0,updateMetaTags:!0,restoreTargets:["body"],metaTagSelectors:["meta","link[rel=alternate]","link[rel=canonical]","link[rel=icon]","[up-meta]",'script[type="application/ld+json"]'],noMetaTagSelectors:["meta[http-equiv]","[up-meta=false]","meta[name=csp-nonce]"]}));let r,o,l,u=new up.FIFOCache({capacity:100,normalizeKey:b});function c(){r=void 0,o=void 0,l=void 0,u.clear(),g({reason:null,alreadyHandled:!0}),L()}function d($,K){return $===!1||n.isString($)?$:K}function f($){return n.pick($,["location","title","metaTags","lang"])}function p(){return n.normalizeURL(location.href)}function h($,K){try{l=$,K()}finally{l=void 0}}function g($){var N,j;let{reason:K,alreadyHandled:Y,pauseTracking:I}=l||$;if(I)return;let H=p();if(_()?L(H):C(H)&&E(),o!==H){r=o,o=H,K==="detect"&&(K=b(H)===b(r)?"hash":"pop");let Z=!Y&&C(H),Q=up.event.build("up:location:changed",{reason:K,location:H,previousLocation:r,alreadyHandled:Y,willHandle:Z,log:`New location is ${H}`});(j=(N=up.migrate).prepareLocationChangedEvent)==null||j.call(N,Q),K&&(up.emit(Q),A(Q))}}function v($){return($==null?void 0:$.split(/(?=#)/))||[]}function b($){return v($)[0]}function y($,K){return n.matchURLs($,location.href,{hash:!0,...K})}function m($,K){k("replaceState",$,K)}function S($,K){y($)||k("pushState",$,K)}function k($,K,Y){L(K),i.enabled&&h(Y,function(){history[$](null,{up:!0},K)})}function C($){return!!u.get($)}function L($=p()){$=n.normalizeURL($),u.set($,!0)}function _(){var $;return($=history.state)==null?void 0:$.up}function E(){let{state:$}=history;_()||(n.isBlank($)||n.isObject($))&&h({pauseTracking:!0},function(){history.replaceState({...$,up:!0},"")})}function q($){up.error.muteUncriticalRejection(up.render({guardEvent:up.event.build("up:location:restore",{location:$,log:`Restoring location ${$}`}),url:$,target:i.restoreTargets,fail:!1,history:!0,location:$,peel:!0,layer:"root",cache:"auto",revalidate:"auto",saveScroll:!1,scroll:["restore","auto"],saveFocus:!1,focus:["restore","auto"]}))}function A($){if(!$.alreadyHandled){if(!$.willHandle){up.puts("up.history","Ignoring history entry owned by foreign script");return}$.reason==="pop"?(up.viewport.saveFocus({location:$.previousLocation}),up.viewport.saveScroll({location:$.previousLocation}),q($.location)):$.reason==="hash"&&up.viewport.revealHash(location.hash,{strong:!0})}}function R($=document.head){return $.querySelectorAll(i.selector("metaTagSelectors"))}function T($){let K=R();for(let Y of K)Y.remove();for(let Y of $)document.head.append(Y)}function P($=document){let{documentElement:K}=$;if(K.matches("html"))return $.documentElement.lang}function z($){a.setAttrPresence(a.root,"lang",$,!!$)}function V(){const $=history.pushState;history.pushState=function(...Y){$.apply(this,Y),g({reason:"push",alreadyHandled:!0})};const K=history.replaceState;history.replaceState=function(...Y){K.apply(this,Y),g({reason:"replace",alreadyHandled:!0})}}function G(){up.protocol.initialRequestMethod()==="GET"&&(E(),L())}up.on("up:framework:boot",function({mode:$}){g({reason:null,alreadyHandled:!0}),V(),G(),$==="auto"&&up.viewport.revealHash(location.hash,{strong:!0,focus:!0})}),up.on(window,"hashchange, popstate",()=>{g({reason:"detect",alreadyHandled:!1})});function X($,K){if($.defaultPrevented||up.event.isModified($))return;let[Y,I]=v(up.layer.current.location),[H,N]=v(n.normalizeURL(K)),j=K.getAttribute("href");
16if(!(Y===H||j.startsWith("#")))return;let Q=K.getAttribute("up-scroll-behavior")??"auto",se=up.layer.get(K),de=up.viewport.revealHashFn(N,{layer:se,behavior:Q,focus:!0});if(de){if(up.event.halt($),up.log.putsEvent($),N!==I&&se.showsLiveHistory()){let x=Y+N;S(x,{reason:"hash",alreadyHandled:!0})}de()}}return up.on("up:click",'a[href*="#"]',X),up.macro("[up-back]",function($){r&&(a.setMissingAttrs($,{"up-href":r,"up-scroll":"restore"}),$.removeAttribute("up-back"),up.link.makeFollowable($))}),up.on("up:framework:reset",c),{config:i,push:S,replace:m,get location(){return p()},get previousLocation(){return r},isLocation:y,findMetaTags:R,updateMetaTags:T,getLang:P,updateLang:z,refineOption:d,options:f}}()},(n,a,i)=>{i(92);const r=up.util,o=up.element;up.fragment=function(){function l(M){let U=o.tagName(M);if(U.startsWith("up-"))return U}const u=["[up-id]","[id]","html","head","body"],c=new up.Config(()=>({badTargetClasses:[/^up-/],strongTargetDerivers:u,targetDerivers:[...u,"main","[up-main]",l,"link[rel][type]","link[rel=preload][href]","link[rel=preconnect][href]","link[rel=prefetch][href]","link[rel]","meta[property]","*[name]","form[action]","a[href]","[class]","[up-flashes]","form"],verifyDerivedTarget:!0,renderOptions:{hungry:!0,keep:!0,saveScroll:!0,saveFocus:!0,focusVisible:"auto",abort:"target",failOptions:!0,feedback:!0},navigateOptions:{cache:"auto",revalidate:"auto",fallback:!0,focus:"auto",scroll:"auto",history:"auto",peel:"dismiss"},reloadOptions:{target:":main",scroll:"keep",focus:"keep"},match:"region",autoHistoryTargets:[":main"],autoFocus:["hash","autofocus","main-if-main","keep","target-if-lost"],autoScroll:["hash","layer-if-main"],autoRevalidate:M=>M.expired,skipResponse:d,renderableResponse:M=>M.isHTML(),normalizeKeepHTML:C}));r.delegate(c,["mainTargets"],()=>up.layer.config.any);function d({response:M,expiredResponse:U}){return!M.text||M.text===(U==null?void 0:U.text)}function f(M,U={}){return M=T(M,U),o.closestAttr(M,"up-source")}function p(M){return r.normalizeURL(M,{hash:!1})}function h(M){let U=o.closestAttr(M,"up-time");if(U&&U!=="false")return/^\d+$/.test(U)&&(U=Number(U)*1e3),new Date(U)}function g(M){let U=o.closestAttr(M,"up-etag");if(U&&U!=="false")return U}const v=up.mockable((...M)=>{let U=Y(M);return new up.RenderJob(U).execute()}),b=up.mockable((...M)=>{const U=Y(M);return v({...U,navigate:!0})});function y({oldElement:M,newElement:U,newData:ee,renderOptions:ie}){const ae=["Keeping fragment %o",M],me=up.script.callbackAttr(M,"up-on-keep",{expandObject:["newFragment","newData"]});return up.emit(M,"up:fragment:keep",{log:ae,callback:me,newFragment:U,newData:ee,renderOptions:ie})}function m({oldElement:M,newElement:U,newData:ee}){return up.emit(M,"up:fragment:kept",{log:!1,newFragment:U,newData:ee})}function S(M){if(M.keep===!1)return;const{oldElement:U,newElement:ee}=M;let ie=_(U);if(!ie)return;let ae,me=up.fragment.tryToTarget(U);me||up.warn("[up-keep]","Cannot keep untargetable %o",U);const ye={layer:M.layer};if(M.descendantsOnly?ae=up.fragment.get(ee,me,ye):ae=o.subtreeFirst(ee,me,ye),!ae||_(ae)===!1)return;let B=k(U,ie),re=k(ae,ie);if(!r.isEqual(B,re))return;const fe={oldElement:U,newElement:ae,newData:up.script.data(ae),renderOptions:M};if(!y(fe).defaultPrevented)return fe}function k(M,U=_(M)){return M.upKeepIdentity??(M.upKeepIdentity=r.copy(L(M,U)))}function C(M){return M=o.removeAttrsFromHTML(M,["up-etag","up-source","up-time","nonce",...up.script.config.nonceableAttributes]),M=M.replace(/^[ \t]+/mg,""),M}function L(M,U){return U==="same-html"?c.normalizeKeepHTML(M.outerHTML):U==="same-data"?up.data(M):!0}up.macro("[up-keep]",M=>k(M));function _(M){return o.booleanOrStringAttr(M,"up-keep")}function E(M,U){if(M.upInserted)return;M.upInserted=!0;const ee=["Inserted fragment %o",M];return kt(()=>up.emit(M,"up:fragment:inserted",{...U,log:ee}))}function q(M,U){const ee=U.log??["Destroyed fragment %o",M],ie=U.parent||document;return kt(()=>up.emit(ie,"up:fragment:destroyed",{fragment:M,parent:ie,log:ee}))}function A(M){return!M.closest(".up-destroying")}function R(M){return M.isConnected&&A(M)}function T(...M){let[U,ee,ie]=z(M);return r.isElementLike(ee)?o.get(ee):U?P(U,ee,ie):new up.FragmentFinder({selector:ee,...r.pick(ie,["layer","match","origin","destroying"])}).find()}function P(...M){let[U,ee,ie]=z(M);return new up.Selector(ee,U,ie).firstDescendant(U)}function z(M){return r.args(M,"val","val","options")}function V(...M){let[U,ee,ie]=z(M);return r.isElement(ee)?[ee]:r.isList(ee)?ee:new up.Selector(ee,U,ie).descendants(U)}function G(M,U,ee={}){return new up.Selector(U,M,ee).subtree(M)}function X(M,U){return r.isElement(U)?o.contains(M,U)&&up.layer.get(M).contains(U):G(M,U).length>0}function $(M,U,ee){return new up.Selector(U,M,ee).closest(M)}function K(...M){var ie,ae;const U=Y(M),ee=T(U.target,U);return ee&&new up.Change.DestroyFragment({...U,element:ee}).execute(),(ae=(ie=up.migrate).formerlyAsync)==null?void 0:ae.call(ie,"up.destroy()")}function Y(M){const U=r.parseArgIntoOptions(M,"target");return r.isElement(U.target)&&(U.origin||(U.origin=U.target)),U}function I(M){M.classList.add("up-destroying"),M.setAttribute("inert","")}function H(...M){var ie,ae;const U={...c.reloadOptions,...Y(M)};U.target||(U.target=":main");const ee=T(U.target,U);return U.url||(U.url=f(ee)),U.headers=r.merge(U.headers,N(ee)),(U.keepData||o.booleanAttr(ee,"up-keep-data"))&&(U.data=up.data(ee)),(ae=(ie=up.migrate).postprocessReloadOptions)==null||ae.call(ie,U),v(U)}function N(M){let U={},ee=h(M);ee&&(U["If-Modified-Since"]=ee.toUTCString());let ie=g(M);return ie&&(U["If-None-Match"]=ie),U}function j(M,U){return b({...U,url:M})}const Z=/^(onFail|on|fail)?(.+)$/;function Q(M){let U=Z.exec(M);if(U){let[ee,ie,ae]=U;switch(ie){case"onFail":return"on"+r.upperCaseFirst(ae);case"fail":return r.lowerCaseFirst(ae)}}}function se(M){let U=Z.exec(M);if(U){let[ee,ie,ae]=U;switch(ie){case"on":return"onFail"+r.upperCaseFirst(ae);case void 0:return"fail"+r.upperCaseFirst(ae)}}}function de(M,U){return r.presence(M,r.isString)||te(M,U)||J(M)}function x(M,U){return!!te(M,U)}function F(M){return`Cannot derive good target selector from a <${o.tagName(M)}> element without identifying attributes. Try setting an [id] or configure up.fragment.config.targetDerivers.`}function J(M){throw new up.CannotTarget(F(M))}function te(M,U={}){let ee=U.strong?c.strongTargetDerivers:c.targetDerivers;return r.findResult(ee,function(ie){let ae=oe(M,ie);if(ae&&ge(ae,M,U))return ae})}function oe(M,U){if(r.isFunction(U))return U(M);if(M.matches(U))try{return pe(M,U)}catch(ee){if(ee instanceof up.CannotParse)return U;throw ee}}function pe(M,U){let{includePath:ee,excludeRaw:ie}=o.parseSelector(U);if(ee.length!==1)throw new up.CannotParse(U);let{tagName:ae,id:me,classNames:ye,attributes:O}=ee[0],B="";ae==="*"?B+=o.tagName(M):ae&&(B+=ae);for(let re of ye)B+=o.classSelector(re);me&&(B+=o.idSelector(me));for(let re in O){let fe=O[re]||M.getAttribute(re);if(re==="id")B+=o.idSelector(fe);else if(re==="class")for(let be of Ie(M))B+=o.classSelector(be);else B+=o.attrSelector(re,fe)}return ie&&(B+=ie),B}function ge(M,U,ee={}){let ie=ee.verify??c.verifyDerivedTarget;return!R(U)||!ie||up.fragment.get(M,{layer:U,...ee})===U}function Se(M,U){return r.isRegExp(M)?M.test(U):M===U}function Ie(M){let U=ee=>!r.some(c.badTargetClasses,ie=>Se(ie,ee));return r.filter(M.classList,U)}const Te=/:main\b/,De=/:layer\b/,je=/:origin\b/;function rt(M){return Te.test(M)}function $e(M,U={}){const{layer:ee}=U;ee!=="new"&&!(ee instanceof up.Layer)&&up.fail("Must pass an up.Layer as { layer } option, but got %o",ee),M=r.copy(r.wrapList(M));const ie=[];for(;M.length;){let ae=M.shift();if(ae===!0&&(ae=":main"),rt(ae)){let me=Ke(U),ye=up.layer.mainTargets(me).map(O=>ae.replace(Te,O));M.unshift(...ye)}else if(De.test(ae)){if(ee==="new"||ee.state==="opening")continue;let me=de(ee.getFirstSwappableElement(),U);M.unshift(ae.replace(De,me))}else r.isElementLike(ae)?ie.push(de(ae,U)):r.isString(ae)&&ie.pu
16sh(st(ae,U))}return r.uniq(ie)}function Ke({layer:M,mode:U}){return M==="new"?U||up.fail('Must pass a { mode } option together with { layer: "new" }'):M.mode}function _t(M,{origin:U}={}){return M.replace(je,function(ee){if(U)return de(U);up.fail('Missing { origin } element to resolve "%s" reference (found in %s)',ee,M)})}function st(M,U){return r.isString(M)?(up.migrate.resolveOrigin||_t)(M,U):M}function Ne(M){return r.getComplexTokens(M)}function nt(M,U={}){let ee=U.defaultPlacement||"swap",ie=U.defaultMaybe??!1,ae=[],me=Ne(M);for(let ye of me){if(ye===":none")continue;let O=ee,B=ie;ye=ye.replace(/::?(before|after|content)\b/,(fe,be)=>(O=be,"")),ye=ye.replace(/:maybe\b/,()=>(B=!0,""));const re={...U,selector:ye,placement:O,maybe:B,originalRenderOptions:U};ae.push(re)}return ae}function Xe(M,U){let ee=$e(c.autoHistoryTargets,{layer:U}).join();for(let ie of M)if(o.subtree(ie,ee).length)return!0;return up.puts("up.render()","Will not auto-update history because fragment doesn't contain a selector from up.fragment.config.autoHistoryTargets"),!1}function ze(M,U,ee={}){if(M=o.get(M),r.isElement(U)){let ie=te(U);return ie&&M.matches(ie)}else return new up.Selector(U,M,ee).matches(M)}function dt(M,U,{layer:ee=M}={}){let ie=[];if(U&&M)for(let[ae,me]of Object.entries(U))r.isDefined(me)&&ze(M,ae,{layer:ee})&&ie.push(me);return ie}function St(M,U,ee={}){return M.fromCache&&r.evalAutoOption(ee.revalidate,c.autoRevalidate,U)}function ir(M,U){return r.some(M,function(ee){return ee!==U&&(ee.placement==="swap"||ee.placement==="content")&&ee.oldElement.contains(U.oldElement)})}function ar(M){if(M.length<2)return M;let U=r.uniqBy(M,"oldElement");return U=r.reject(U,ee=>ir(U,ee)),U}function it(...M){let U=Y(M),ee,{reason:ie,newLayer:ae,jid:me}=U,ye;if(U.target)ye=V(U.target,U),ee=B=>B.isBoundToSubtrees(ye),ie||(ie="Aborting requests within fragment");else{let B=up.layer.getAll(U);ye=r.map(B,"element"),ee=re=>re.isBoundToLayers(B),ie||(ie="Aborting requests within "+B.join(", "))}let O=B=>B.abortable&&ee(B);up.network.abort(O,{...U,reason:ie});for(let B of ye)up.emit(B,"up:fragment:aborted",{reason:ie,newLayer:ae,jid:me,log:ie})}function at(M,U){return up.event.onClosest(M,"up:fragment:aborted",U)}function Et(M,U){return up.event.onClosest(M,"up:fragment:kept",U)}function jt(M,U,{margin:ee=0}={}){if(o.isIntersectingWindow(M,{margin:ee})){U();return}function ie(ye){for(let O of ye)if(O.isIntersecting){me(),U();return}}let ae=new IntersectionObserver(ie,{rootMargin:`${ee}px`}),me=()=>ae.disconnect();ae.observe(M),up.destructor(M,me)}const xt=/^([\w-]+|\*)?(#|\.|[:[][a-z-]{3,})/;function Ye(M,{origin:U,originLayer:ee,data:ie,htmlParser:ae=o.createNodesFromHTML}={}){if(r.isString(M)&&xt.test(M)){let[me,ye]=r.parseScalarJSONPairs(M)[0];ie={...ie,...ye},M=up.fragment.get(me,{layer:"closest",origin:U,originLayer:ee})||up.fail('Cannot find template "%s"',M)}return r.isString(M)&&(M=ae(M)),or(M)&&(M=ht(M,ie,{htmlParser:ae})),r.wrapList(M)}function or(M){return r.isElement(M)&&M.matches("template, script[type]")&&!up.script.isScript(M)}function ht(M,U={},{origin:ee,htmlParser:ie}={}){let ae=T(M,{origin:ee})||up.fail("Template not found: %o",M),ye=up.emit(ae,"up:template:clone",{data:U,nodes:null,log:["Using template %o",M]}).nodes??Nt(ae,ie);for(let O of ye)O.upTemplateData=U;return ye}function Nt(M,U=o.createNodesFromHTML){let ee=M.innerHTML;return U(ee)}function ft(...M){let[U,ee="beforeend",ie]=r.args(M,"val",r.isAdjacentPosition,"val"),ae=Ye(ie,{origin:U}),me=o.wrapIfRequired(ae),ye=document.contains(me)&&o.documentPosition(me);return U.insertAdjacentElement(ee,me),ye?()=>{ye[0].insertAdjacentElement(ye[1],me)}:(up.hello(me),()=>up.destroy(me))}function lr(...M){let U=r.args(M,"val","options","callback");return new up.SelectorTracker(...U).start()}let Tt=0,zt=r.cleaner("fifo");function kt(M){try{return Tt++,M()}finally{--Tt===0&&zt.clean()}}function Bt(M){Tt===0?M():zt(M)}return up.on("up:framework:boot",function(){const{documentElement:M}=document;if(up.hello(M),M.setAttribute("up-source",p(location.href)),!up.browser.canPushState())return up.warn("Cannot push history changes. Next render pass with history will load a full page.")}),{config:c,reload:H,destroy:K,render:v,navigate:b,get:T,getFirstDescendant:P,all:V,subtree:G,contains:X,closest:$,source:f,normalizeSource:p,visit:j,markAsDestroying:I,emitInserted:E,emitDestroyed:q,emitKeep:y,emitKept:m,keepPlan:S,defaultNormalizeKeepHTML:C,successKey:Q,failKey:se,expandTargets:$e,resolveOrigin:st,toTarget:de,tryToTarget:te,isTargetable:x,matches:ze,matchSelectorMap:dt,hasAutoHistory:Xe,time:h,etag:g,shouldRevalidate:St,abort:it,onAborted:at,onKept:Et,onFirstIntersect:jt,splitTarget:Ne,parseTargetSteps:nt,isAlive:R,isNotDestroying:A,compressNestedSteps:ar,containsMainPseudo:rt,insertTemp:ft,provideNodes:Ye,cloneTemplate:ht,trackSelector:lr,mutate:kt,afterMutate:Bt}}(),up.reload=up.fragment.reload,up.destroy=up.fragment.destroy,up.render=up.fragment.render,up.navigate=up.fragment.navigate,up.visit=up.fragment.visit,up.template={clone:up.fragment.cloneTemplate},r.delegate(up,["context"],()=>up.layer.current)},(n,a,i)=>{i.r(a)},(n,a,i)=>{i(94),up.viewport=function(){const r=up.util,o=up.element,l=up.fragment,u=new up.Config(()=>({viewportSelectors:["[up-viewport]","[up-fixed]"],fixedTopSelectors:["[up-fixed~=top]"],fixedBottomSelectors:["[up-fixed~=bottom]"],anch
16oredRightSelectors:["[up-anchored~=right]","[up-fixed~=top]","[up-fixed~=bottom]","[up-fixed~=right]"],revealSnap:200,revealPadding:0,revealTop:!1,revealMax(){return .5*window.innerHeight},autoFocusVisible({element:x,inputDevice:F}){return F==="key"||up.form.isField(x)}})),c=new up.BodyShifter;up.compiler(u.selectorFn("anchoredRightSelectors"),function(x){return c.onAnchoredElementInserted(x)});const d=up.mockable(function(x,F){var te,oe;return F=r.options(F),x=l.get(x,F),(F.layer=up.layer.get(x))||up.fail("Cannot reveal a detached element"),F.peel&&F.layer.peel(),new up.RevealMotion(x,F).start(),F.focus&&h(x,{force:!0,preventScroll:!0}),((oe=(te=up.migrate).formerlyAsync)==null?void 0:oe.call(te,"up.reveal()"))||!0});function f(x,{preventScroll:F,force:J,inputDevice:te,focusVisible:oe}={}){if(J&&!x.hasAttribute("tabindex")&&x.tabIndex===-1&&x.setAttribute("tabindex","-1"),te??(te=up.event.inputDevice),oe??(oe="auto"),oe=r.evalAutoOption(oe,u.autoFocusVisible,{element:x,inputDevice:te}),x.focus({preventScroll:!0,focusVisible:oe}),p(x),x.classList.add(oe?"up-focus-visible":"up-focus-hidden"),!F)return d(x)}function p(x){x==null||x.classList.remove("up-focus-hidden","up-focus-visible")}up.on("focusin",function({relatedTarget:x}){p(x)});function h(x,F){return f(x,F),x===document.activeElement}function g(...x){var F;return(F=v(...x))==null?void 0:F()}function v(x,{strong:F,layer:J,origin:te,behavior:oe="instant",focus:pe=!1}={}){if(!x)return;let ge=j(x,{layer:J,origin:te});if(ge)return()=>{let Se=()=>d(ge,{top:!0,behavior:oe,focus:pe});return F&&r.fastTask(Se),Se()};if(x==="#top")return()=>I(0,{behavior:oe})}function b(){return[C(),...u.viewportSelectors].join()}function y(x,F={}){return l.get(x,F).closest(b())}function m(x,F={}){return x=l.get(x,F),o.subtree(x,b())}function S(x,F={}){return x=l.get(x,F),o.around(x,b())}function k(x={}){return l.all(b(),x)}function C(){return L().tagName}function L(){return document.scrollingElement}function _(){return o.root.clientWidth}function E(){return o.root.clientHeight}function q(x){return x===L()}function A(){return window.innerWidth-_()}function R(x){return up.fragment.tryToTarget(x)}function T(x=document){const F=["[up-fixed]"].concat(u.fixedTopSelectors).concat(u.fixedBottomSelectors);return x.querySelectorAll(F.join())}function P(...x){const[F,J]=Y(x),te=J.location||J.layer.location;if(te){const oe=z(F);J.layer.lastScrollTops.set(te,oe)}}function z(x){let F={};for(let J of x){let te=R(J);te?F[te]=J.scrollTop:up.warn("up.viewport.saveScroll()","Cannot save scroll positions for untargetable viewport %o",J)}return F}function V(...x){let F=k(...x);return z(F)}function G(...x){const[F,J]=Y(x),te=J.scrollTops??J.layer.lastScrollTops.get(J.layer.location);return te?(H(F,te,0),up.puts("up.viewport.restoreScroll()","Restored scroll positions to %o",te),!0):!1}function X(x={}){const F=up.layer.get(x),J=x.location||F.location;if(J){const te=up.FocusCapsule.preserve(F);F.lastFocusCapsules.set(J,te)}}function $(x={}){const F=up.layer.get(x),J=x.location||F.location,te=x.layer.lastFocusCapsules.get(J);return te&&te.restore(F)?(up.puts("up.viewport.restoreFocus()",'Restored focus to "%s"',te.target),!0):!1}function K(){return new up.FIFOCache({capacity:30,normalizeKey:r.matchableURL})}function Y(x){const[F,J]=r.args(x,"val","options");J.layer=up.layer.get(J);let te;return F?te=[y(F,J)]:J.around?te=S(J.around,J):te=k(J),[te,J]}function I(x,...F){const[J,te]=Y(F);return H(J,{},x,te.behavior),!0}function H(x,F,J,te="instant"){for(let oe of x){const pe=R(oe);let ge=F[pe]||J;(ge<0||Object.is(ge,-0))&&(ge+=oe.scrollHeight-oe.clientHeight),oe.scrollTo({top:ge,behavior:te})}}function N(x,F={}){var Te;const te=y(x).getBoundingClientRect(),oe=x.getBoundingClientRect(),pe=new up.Rect({left:oe.left-te.left,top:oe.top-te.top,width:oe.width,height:oe.height});(Te=F.afterMeasure)==null||Te.call(F),o.setStyle(x,{position:x.style.position==="static"?"static":"relative",top:"auto",right:"auto",bottom:"auto",left:"auto",width:"100%",height:"100%"});const ge=o.createFromSelector("up-bounds");o.insertBefore(x,ge),ge.appendChild(x);const Se=function(De,je){return pe.left+=De,pe.top+=je,o.setStyle(ge,pe,"px")};Se(0,0);const Ie=x.getBoundingClientRect();return Se(oe.left-Ie.left,oe.top-Ie.top),r.each(T(x),o.fixedToAbsolute),{bounds:ge,moveBounds:Se}}function j(x,F={}){if(x=Z(x),x){const J=[o.idSelector(x),"a"+o.attrSelector("name",x)].join();return l.get(J,F)}}function Z(x){return x==null?void 0:x.replace(/^#/,"")}function Q(x){const F=document.activeElement;if(up.fragment.contains(x,F))return F}const se=["selectionStart","selectionEnd","scrollLeft","scrollTop"];function de(x,F={}){for(let J of se)try{F[J]=x[J]}catch{}return F}return{reveal:d,revealHash:g,revealHashFn:v,firstHashTarget:j,config:u,get:y,subtree:m,around:S,getScrollTops:V,get root(){return L()},rootWidth:_,rootHeight:E,isRoot:q,rootScrollbarWidth:A,saveScroll:P,restoreScroll:G,scrollTo:I,saveFocus:X,restoreFocus:$,absolutize:N,focus:f,tryFocus:h,newStateCache:K,focusedElementWithin:Q,copyCursorProps:de,bodyShifter:c}}(),up.focus=up.viewport.focus,up.reveal=up.viewport.reveal},(n,a,i)=>{i.r(a)},()=>{up.motion=function(){const n=up.util,a=up.element,i=new up.MotionController("motion"),r=new up.Config(()=>({duration:175,easing:"ease",enabled:!matchMedia("(prefers-reduced-motion: reduce)").matches}));let o=new up.Registry("animation",y),l=new up.Registry("transition",v);function u(){i.reset()}async function c(R,T,{duration:P,easing:z,onFinished:V}={}){R=up.fragment.get(R);const G=up.error.guardFn(y(T)),X=f({duration:P,easing:z});let $=async function(){if(G&&d(R))try{await G(R,X)}finally{V==null||V()}else V==null||V()};await i.startFunction([R],$)}function d(R){return!a.isSingleton(R)}function f({duration:R,easing:T}){return{duration:r.enabled?R??r.duration:0,easing:T??r.easing}}async function p(R,T,{duration:P,easing:z,finishedFrame:V}){let G=n.withRenamedKeys(T,n.kebabToCamelCase),X=R.animate([G],{duration:P,easing:z,fill:"forwards"}),$,K=()=>{X.finish(),a.setStyle(R,V??T),X.cancel(),$()};$=up.on(R,"up:motion:finish",K),await X.finished,K()}function h(R){var T,P;return R=up.fragment.get(R),i.finish(R),(P=(T=up.migrate).formerlyAsync)==null?void 0:P.call(T,"up.motion.finish()")}async function g(R,T,P,{duration:z,easing:V,afterInsert:G,beforeRemove:X,afterRemove:$}={}){R=up.fragment.get(R),T=up.fragment.get(T);const K=up.error.guardFn(v(P)),Y=f({duration:z,easing:V}),I=async function({nested:H}){if(K&&d(R))if(H)await K(R,T,Y);else{const N=up.viewport.get(R),j=N.scrollTop,Z=up.viewport.absolutize(R,{afterMeasure:()=>a.insertBefore(R,T)});G==null||G();const Q=N.scrollTop;Z.moveBounds(0,Q-j),await K(R,T,Y),X==null||X(),Z.bounds.remove(),$==null||$()}else X==null||X(),m(R,T),G==null||G(),$==null||$()};await i.startFunction([T,R],I)}function v(R){if(!k(R))return n.isFunction(R)?R:n.isArray(R)?b(...R):n.isString(R)&&R.includes("/")?b(...R.split("/")):l.get(R)}function b(R,T){if(!k(R)&&!k(T)){const P=y(R)||n.asyncNoop,z=y(T)||n.asyncNoop;return(V,G,X)=>Promise.all([P(V,X),z(G,X)])}}function y(R){if(!k(R))return n.isFunction(R)?R:n.isOptions(R)?(T,P)=>p(T,R,P):o.get(R)}const m=up.mockable(function(R,T){R.replaceWith(T)});function S(R,T,P){T=n.options(T);let z=new up.OptionsParser(R,T,P);return z.booleanOrString("animation"),z.booleanOrString("transition"),z.string("easing"),z.number("duration"),T}up.on("up:framework:boot",function(){r.enabled||up.puts("up.motion","Animations are disabled")});function k(R){return!R||R==="none"}function C(R,T,P){o.put(R,function(z,V){return z.style.opacity=n.evalOption(T,z),p(z,{opacity:P}
16,V)})}function L(R){return a.style(R,"opacity")}C("fade-in",0,1),C("fade-out",L,0);function _(R,T){return{transform:`translate(${R}px, ${T}px)`}}function E(){return{transform:"translate(0, 0)"}}function q(R){return a.setStyle(R,E()),R.getBoundingClientRect()}function A(R,T){const P=`move-to-${R}`,z=`move-from-${R}`;o.put(P,function(V,G){const X=q(V),$=T(X);return p(V,$,G)}),o.put(z,function(V,G){const X=q(V),$=T(X);return a.setStyle(V,$),p(V,E(),{...G,finishedFrame:{transform:""}})})}return A("top",function(R){const T=R.top+R.height;return _(0,-T)}),A("bottom",function(R){const T=up.viewport.rootHeight()-R.top;return _(0,T)}),A("left",function(R){const T=R.left+R.width;return _(-T,0)}),A("right",function(R){const T=up.viewport.rootWidth()-R.left;return _(T,0)}),l.put("cross-fade",["fade-out","fade-in"]),l.put("move-left",["move-to-left","move-from-right"]),l.put("move-right",["move-to-right","move-from-left"]),l.put("move-up",["move-to-top","move-from-bottom"]),l.put("move-down",["move-to-bottom","move-from-top"]),up.on("up:framework:reset",u),{morph:g,animate:c,finish:h,transition:l.put,animation:o.put,config:r,isNone:k,swapElementsDirectly:m,motionOptions:S}}(),up.transition=up.motion.transition,up.animation=up.motion.animation,up.morph=up.motion.morph,up.animate=up.motion.animate},(n,a,i)=>{i(97);const r=up.util;up.network=function(){const o=new up.Config(()=>({concurrency:6,wrapMethod:!0,cacheSize:70,cacheExpireAge:15e3,cacheEvictAge:54e5,lateDelay:400,fail(_){return(_.status<200||_.status>299)&&_.status!==304},autoCache(_){return _.isSafe()},expireCache(_){return!_.isSafe()},evictCache:!1,progressBar:!0,timeout:9e4})),l=new up.Request.Queue,u=new up.Request.Cache;let c=null;function d(){S(),l.reset(),u.reset(),c==null||c.destroy(),c=null}function f(..._){const E=p(_),q=new up.Request(E);return h(q),q}function p(_){var q,A;let E=r.parseArgIntoOptions(_,"url");return(A=(q=up.migrate).handleRequestOptions)==null||A.call(q,E),E}function h(_){u.expire(_.expireCache??r.evalOption(o.expireCache,_)??!1),u.evict(_.evictCache??r.evalOption(o.evictCache,_)??!1),g(_)||v(_)}function g(_){let E;if(_.willCache()&&(E=u.get(_)))return up.puts("up.request()","Re-using previous request to %s",_.description),_.background||l.promoteToForeground(E),E.mergeIfUnsent(_),u.track(E,_,{onIncompatible:h}),!0}function v(_){return b(_),l.asap(_),!0}function b(_){_.willCache()&&(u.put(_),_.onLoading=()=>u.reindex(_)),r.always(_,function(E){u.expire(E.expireCache??!1,{except:_}),u.evict(E.evictCache??!1,{except:_});let q=E instanceof up.Response,A=!q,R=q&&E.ok,T=q&&!E.ok,P=q&&E.none,z=q&&E.redirectRequest;T?u.evict(_.url):A||P?u.evict(_):R&&(u.get(_)&&u.put(_),z&&(z.willCache()||u.get(z))&&u.put(z))})}function y(){return l.isBusy()}function m(_){new up.Request(_).loadPage()}function S(..._){var E,q;(q=(E=up.migrate).preprocessAbortArgs)==null||q.call(E,_),l.abort(..._)}function k(_){return r.contains(["GET","OPTIONS","HEAD"],r.normalizeMethod(_))}function C(){r.evalOption(o.progressBar)&&(c=new up.ProgressBar)}function L(){c==null||c.conclude()}return up.on("up:network:late",C),up.on("up:network:recover",L),up.on("up:framework:reset",d),{request:f,cache:u,isBusy:y,isSafeMethod:k,config:o,abort:S,queue:l,loadPage:m}}(),up.request=up.network.request,up.cache=up.network.cache},(n,a,i)=>{i.r(a)},(n,a,i)=>{i(99);const r=up.util;up.layer=function(){const o=[up.Layer.Root,up.Layer.Modal,up.Layer.Popup,up.Layer.Drawer,up.Layer.Cover],l=new up.Config(function(){const _={mode:"modal",any:{mainTargets:["[up-main='']","main",":layer"]},root:{mainTargets:["[up-main~=root]"],history:!0},overlay:{mainTargets:["[up-main~=overlay]"],openAnimation:"fade-in",closeAnimation:"fade-out",dismissLabel:"×",dismissARIALabel:"Dismiss dialog",dismissible:!0,history:"auto",trapFocus:!0},cover:{mainTargets:["[up-main~=cover]"]},drawer:{mainTargets:["[up-main~=drawer]"],backdrop:!0,position:"left",size:"medium",openAnimation(E){switch(E.position){case"left":return"move-from-left";case"right":return"move-from-right"}},closeAnimation(E){switch(E.position){case"left":return"move-to-left";case"right":return"move-to-right"}}},modal:{mainTargets:["[up-main~=modal]"],backdrop:!0,size:"medium"},popup:{mainTargets:["[up-main~=popup]"],position:"bottom",size:"medium",align:"left",dismissible:"outside key",trapFocus:!1},foreignOverlaySelectors:["dialog"]};for(let E of o)_[E.mode].Class=E;return _});let u=null,c=[];function d(_){return r.flatMap(f(_),"mainTargets")}function f(_){return _==="root"?[l.root,l.any]:[l[_],l.overlay,l.any]}function p(_){var E,q;if(!(_.layer instanceof up.Layer))if((q=(E=up.migrate).handleLayerOptions)==null||q.call(E,_),r.isGiven(_.layer)){let A=String(_.layer).match(/^(new|shatter|swap)( (\w+))?/);if(A){_.layer="new";const R=A[1],T=A[3];_.mode||(_.mode=T||l.mode),R==="swap"?up.layer.isOverlay()&&(_.baseLayer="parent"):R==="shatter"&&(_.baseLayer="root")}}else r.isElementLike(_.target)?_.layer=u.get(_.target,{normalizeLayerOptions:!1}):_.origin?_.layer="origin":_.layer="current"}function h(_){_.baseLayer instanceof up.Layer||(_.baseLayer=u.get("current",{..._,normalizeLayerOptions:!1}))}function g(_){p(_),_.context??(_.context={}),h(_)}function v(_,E){const{mode:q}=_,{Class:A}=l[q],R=f(q).toReversed();let T=up.migrate.handleLayerConfig;return T&&R.forEach(T),_.openAnimation??(_.openAnimation=r.pluckKey(_,"animation")),_=r.mergeDefined(...R,{mode:q,stack:u},_),E&&(_=E(_)),new A(_)}function b(){u.reset(),c=r.filter(c,"isDefault")}async function y(_){return _=r.options(_,{layer:"new",defaultToEmptyContent:!0,navigate:!0}),(await up.render(_)).layer}function m(_){return new Promise(function(E,q){_={..._,onAccepted:A=>E(A.value),onDismissed:A=>q(A.value)},y(_)})}function S(){return r.map(o,_=>_.selector()).join()}function k(_){return r.isString(_)?`layer "${_}"`:_.toString()}function C(_){let E=l.selector("foreignOverlaySelectors");return!!(E&&_.closest(E))}up.on("up:fragment:destroyed",function(){u.sync()}),up.on("up:framework:evaled",function(){u=new up.LayerStack}),up.on("up:framework:reset",b);const L={config:l,mainTargets:d,open:y,build:v,ask:m,normalizeOptions:g,anySelector:S,optionToString:k,get stack(){return u.layers},isWithinForeignOverlay:C};return r.delegate(L,["get","getAll","root","overlays","current","front","sync","count","dismissOverlays"],()=>u),r.delegate(L,["accept","dismiss","isRoot","isOverlay","isFront","on","off","emit","parent","history","location","mode","context","element","contains","size","affix"],()=>u.current),L}()},(n,a,i)=>{i.r(a)},(n,a,i)=>{i(101),up.link=function(){const r=up.util,o=up.element;let l=null,u=null,c=null;const d="[up-content], [up-fragment], [up-document]",f=`${d}, [up-target], [up-layer], [up-transition], [up-preload]`,p="a[href], button",h=new up.Config(()=>({followSelectors:["[up-follow]",`a:is(${f})`],noFollowSelectors:["[up-follow=false]","a[download]","a[target]",'a[href^="javascript:"]','a[href^="mailto:"]','a[href^="tel:"]',`a[href^="#"]:not(${d})`,o.crossOriginSelector("href"),o.crossOriginSelector("up-href")],instantSelectors:["[up-instant]"],noInstantSelectors:["[up-instant=false]","[onclick]"],preloadSelectors:["[up-preload]"],noPreloadSelectors:["[up-preload=false]"],clickableSelectors:["[up-clickable]","[up-follow]","[up-emit]","[up-accept]","[up-dismiss]",`a:is(${f})`],noClickableSelectors:["[up-clickable=false]",p],preloadDelay:90}));function g(I){return!up.browser.canPushState()||!E(I)||!v(I)}
16function v(I){const H=m(I);if(H.url)return H.cache==null&&(H.cache="auto"),H.basic=!0,new up.Request(H).willCache()}function b(){l=null,u=null,c=null}const y=up.mockable(function(I,H,N){return up.render(S(I,H,N))});function m(I,H,N){H=r.options(H);const j=new up.OptionsParser(I,H,{...N,fail:!1});return H.url=_(I,H),H.method=L(I,H),j.json("headers"),j.json("params"),j.booleanOrString("cache"),j.booleanOrString("expireCache"),j.booleanOrString("evictCache"),j.booleanOrString("revalidate"),j.booleanOrString("abort"),j.boolean("abortable"),j.boolean("background"),j.string("contentType"),j.booleanOrNumber("lateDelay"),j.number("timeout"),j.booleanOrString("fail"),H}function S(I,H,N){I=up.fragment.get(I),H=r.options(H);const j=new up.OptionsParser(I,H,{fail:!0,...N});return j.include(m),H.origin||(H.origin=I),j.boolean("navigate",{default:!0}),j.string("confirm",{attr:["up-confirm","data-confirm"]}),j.string("target"),j.booleanOrString("fallback"),j.string("match"),j.string("document"),j.string("fragment"),j.string("content"),j.boolean("keep",{attr:"up-use-keep"}),j.boolean("hungry",{attr:"up-use-hungry"}),j.json("data",{attr:"up-use-data"}),j.json("dataMap",{attr:"up-use-data-map"}),j.renderCallback("onLoaded"),j.renderCallback("onRendered"),j.renderCallback("onFinished"),j.renderCallback("onOffline"),j.renderCallback("onError"),j.booleanOrString("peel"),j.string("layer"),j.string("baseLayer"),j.json("context"),j.string("mode"),j.string("align"),j.string("position"),j.string("class"),j.string("size"),j.booleanOrString("dismissible"),j.renderCallback("onOpened"),j.renderCallback("onAccepted"),j.renderCallback("onDismissed"),j.string("acceptEvent"),j.string("dismissEvent"),j.string("acceptFragment"),j.string("dismissFragment"),j.string("acceptLocation"),j.string("dismissLocation"),j.booleanOrString("closeAnimation"),j.string("closeEasing"),j.number("closeDuration"),j.include(up.status.statusOptions),j.booleanOrString("focus"),j.booleanOrString("focusVisible"),j.boolean("saveScroll"),j.boolean("saveFocus"),j.booleanOrNumberOrString("scroll"),j.json("scrollMap"),j.boolean("revealTop"),j.number("revealMax"),j.number("revealPadding"),j.number("revealSnap"),j.string("scrollBehavior"),j.booleanOrString("history"),j.booleanOrString("location"),j.booleanOrString("title"),j.boolean("metaTags"),j.booleanOrString("lang"),j.include(up.motion.motionOptions),H.guardEvent??(H.guardEvent=up.event.build("up:link:follow",{log:["Following link %o",I]})),H}function k(I,H){I=up.fragment.get(I);let N=C(I);if(N)return Promise.reject(new up.Error(N));const j=up.event.build("up:link:preload",{log:["Preloading link %o",I]});return y(I,{abort:!1,abortable:!1,background:!0,cache:!0,...H,...up.RenderOptions.NO_INPUT_INTERFERENCE,...up.RenderOptions.NO_PREVIEWS,guardEvent:j,preload:!0})}function C(I){if(!$(I))return"Will not preload an unsafe link"}function L(I,H={}){return r.normalizeMethod(H.method||I.getAttribute("up-method")||I.getAttribute("data-method"))}function _(I,H={}){const N=H.url||I.getAttribute("up-href")||I.getAttribute("href");if(N!=="#")return N}function E(I){return I=up.fragment.get(I),h.matches(I,"followSelectors")}function q(I){E(I)||I.setAttribute("up-follow","")}function A(I){let H=I.matches("a, [up-follow]")?"link":"button";o.setMissingAttrs(I,{tabindex:"0",role:H,"up-clickable":""}),I.addEventListener("keydown",function(N){if(N.key==="Enter"||I.role==="button"&&N.key==="Space")return X(N)})}up.macro(h.selectorFn("clickableSelectors"),A);function R(I,H){if(I.defaultPrevented)return!1;const N=`a, [up-follow], ${up.form.fieldSelector()}`,j=I.target.closest(N);return!j||j===H}function T(I){const H=I.closest(h.selector("instantSelectors"));return H&&!P(H)}function P(I){return h.matches(I,"noInstantSelectors")||h.matches(I,"noFollowSelectors")}function z(I){I.on("click",function(H,N){up.event.isModified(H)||(T(N)&&c===N?up.event.halt(H):(up.event.inputDevice==="key"||up.event.isSyntheticClick(H)||I.wasHitByMouseEvent(H)&&!G(H))&&X(H),u=null,c=null)}),I.on("touchstart",{passive:!0},function(H,N){l=N}),I.on("mousedown",function(H,N){up.event.isModified(H)||(u=N,T(N)&&!V(H)&&(c=N,X(H)),l=null)})}function V(I){let H=I.target;return l===H&&H.closest("[href]")}function G(I){return u&&u!==I.target}function X(I){let H=["clientX","clientY","button",...up.event.keyModifiers];
16const N=up.event.fork(I,"up:click",H);up.emit(I.target,N,{log:!1})}function $(I){const H=L(I);return up.network.isSafeMethod(H)}function K(I,H,N){switch(I){case"insert":N();break;case"reveal":{let j=o.numberAttr(H,"up-intersect-margin");up.fragment.onFirstIntersect(H,N,{margin:j});break}case"hover":new up.LinkFollowIntent(H,N);break}}function Y(I,H){let j={navigate:!1,guardEvent:up.event.build("up:deferred:load",{log:["Loading deferred %o",I]}),...H};return y(I,j,{defaults:{target:":origin",cache:"auto",revalidate:"auto",feedback:!0}})}return up.attribute("up-defer",{defaultValue:"insert"},function(I,H){K(H,I,j=>up.error.muteUncriticalRejection(Y(I,j)))}),up.on("up:click",h.selectorFn("followSelectors"),function(I,H){R(I,H)&&(up.event.halt(I,{log:!0}),up.focus(H,{preventScroll:!0}),up.error.muteUncriticalRejection(y(H)))}),up.attribute("up-expand",{defaultValue:"a, [up-href]",macro:!0},function(I,H){let N=o.get(I,H);N&&(o.setMissingAttrs(I,{"up-href":o.attr(N,"href"),...o.upAttrs(N)}),N.upExpandedPair=I.upExpandedPair=[I,N],o.addClasses(I,o.upClasses(N)),q(I))}),up.compiler(h.selectorFn("preloadSelectors"),function(I){if(!g(I)){let H=j=>up.error.muteUncriticalRejection(k(I,j)),N=o.booleanOrStringAttr(I,"up-preload");(N===!0||r.isUndefined(N))&&(N="hover"),K(N,I,H)}}),up.on("up:framework:reset",b),{follow:y,followOptions:S,requestOptions:m,preload:k,makeFollowable:q,isSafe:$,isFollowable:E,shouldFollowEvent:R,convertClicks:z,config:h,loadDeferred:Y}}(),up.follow=up.link.follow,up.deferred={load:up.link.loadDeferred}},(n,a,i)=>{i.r(a)},()=>{up.form=function(){const n=up.util,a=up.element,i=new up.Config(()=>({groupSelectors:["[up-form-group]","fieldset","label","form"],fieldSelectors:["select","input:not([type=submit], [type=image], [type=button])","button[type]:not([type=submit], [type=button])","textarea"],submitSelectors:["form:is([up-submit], [up-target], [up-layer], [up-transition])"],noSubmitSelectors:["[up-submit=false]","[target]",a.crossOriginSelector("action")],submitButtonSelectors:["input[type=submit]","input[type=image]","button[type=submit]","button:not([type])"],genericButtonSelectors:["input[type=button]","button[type=button]"],validateBatch:!0,watchInputEvents:["input","change"],watchInputDelay:0,watchChangeEvents:["change"],watchableEvents:["input","change"],arrayParam:x=>x.endsWith("[]")}));function r(x,F){x=a.get(x);let J=a.subtree(x,F());if(x.matches("form[id]")){const te=a.attrSelector("form",x.getAttribute("id")),oe=F(te),pe=up.fragment.all(oe,{layer:x});J=n.uniq([...J,...pe])}return J}const[o,l]=i.selectorFns("fieldSelectors");function u(x){return r(x,o)}function c(x){return[...u(x),...p(x),...g(x)]}const[d,f]=i.selectorFns("submitButtonSelectors");function p(x){return r(x,d)}const h=i.selectorFn("genericButtonSelectors");function g(x){return r(x,h)}const v=up.mockable((x,F)=>up.render(b(x,F)));function b(x,F,J){x=up.fragment.get(x),x=$(x),F=n.options(F);let te=new up.OptionsParser(x,F,J);return te.include(E),te.string("failTarget",{default:up.fragment.tryToTarget(x)}),F.guardEvent||(F.guardEvent=up.event.build("up:form:submit",{submitButton:F.submitButton,log:"Submitting form",params:F.params,form:x})),F.origin||(F.origin=up.viewport.focusedElementWithin(x)||F.submitButton||x),F.activeElements=n.uniq([F.origin,F.submitButton,x].filter(n.isElement)),te.include(up.link.followOptions),Object.assign(F,q(F.submitButton)),F}function y(x,F,J={}){F=n.options(F),J.closest??(J.closest=!0),J.attrPrefix??(J.attrPrefix="up-watch-");let te=new up.OptionsParser(x,F,J);te.include(up.status.statusOptions,J),te.string("event"),te.number("delay");let oe=up.form.config;return F.event==="input"?(F.event=n.evalOption(oe.watchInputEvents,x),F.delay??(F.delay=oe.watchInputDelay)):F.event==="change"&&(F.event=n.evalOption(oe.watchChangeEvents,x)),F.origin||(F.origin=x),F}function m(x,F,J={}){F=n.options(F);let te=new up.OptionsParser(x,F,{...J,closest:!0,attrPrefix:"up-validate-"});return te.string("url"),te.string("method",{normalize:n.normalizeMethod}),te.boolean("batch",{default:i.validateBatch}),te.json("params"),te.json("headers"),te.include(y,{defaults:{event:"change"}}),F}function S(x){let F=c(x);return n.sequence(n.map(F,k))}
16function k(x){if(x.disabled)return;let F;return document.activeElement===x?(F=z(x),x.disabled=!0,up.focus(F,{force:!0,preventScroll:!0})):x.disabled=!0,()=>{x.disabled=!1}}function C(x,F){let J=()=>j(F);return x===!0?[J()]:n.isElement(x)?[x]:n.isString(x)?up.fragment.subtree(J(),x,{origin:F}):n.isArray(x)?n.flatMap(x,te=>C(te,F)):[]}function L(x,F){return function(J){let te=C(x,F);for(let oe of te)J.disable(oe)}}function _(x,F){for(let J of c(x))J.disabled=F}function E(x,F,J){F=n.options(F),x=$(x);const te=new up.OptionsParser(x,F,J);te.string("contentType",{attr:"enctype"}),te.json("headers");const oe=[up.Params.fromForm(x),a.jsonAttr(x,"up-params")],pe=[a.jsonAttr(x,"up-headers")],ge=F.submitButton??(F.submitButton=p(x)[0]);return ge&&(oe.push(up.Params.fromFields(ge),a.jsonAttr(ge,"up-params")),pe.push(a.jsonAttr(ge,"up-headers")),F.method||(F.method=ge.getAttribute("formmethod")),F.url||(F.url=ge.getAttribute("formaction"))),F.params=up.Params.merge(...oe,F.params),F.headers=n.merge(...pe,F.headers),te.string("url",{attr:"action",default:up.fragment.source(x)}),te.string("method",{attr:["up-method","data-method","method"],default:"GET",normalize:n.normalizeMethod}
16),F.method==="GET"&&(F.url=up.Params.stripURL(F.url)),F}function q(x){if(!x)return{};let F=up.link.followOptions(x,{},{defaults:!1});return n.omit(F,["method","url","guardEvent","origin","params","headers"])}function A(...x){let[F,J,te]=n.args(x,"val","options","callback");return F=up.element.get(F),te||(te=R(F)||up.fail("No callback given for up.watch()")),new up.FieldWatcher(F,J,te).start()}function R(x){return up.script.callbackAttr(x,"up-watch",{argNames:["value","name","options"]})}function T(x,F={}){const J=(te,oe)=>v(x,oe);return A(x,{logPrefix:"up.autosubmit()",...F,batch:!0},J)}function P(){var x,F;return((F=(x=up.migrate).migratedFormGroupSelectors)==null?void 0:F.call(x))||i.groupSelectors}function z(x){return V(x).element}function V(x){return n.findResult(P(),function(F){let J=x.closest(F);if(J){let te=up.fragment.tryToTarget(J,{strong:!0}),oe=up.fragment.tryToTarget(x),pe=oe&&J!==x&&`${F}:has(${oe})`,ge=te||pe;if(ge)return{target:ge,element:J,origin:x}}})}function G(...x){let F=X(...x),J=$(F.origin);return H(J).validate(F)}function X(x,...F){const J=n.extractOptions(F);return J.origin?J.target||(J.target=up.fragment.toTarget(x)):J.origin||(J.origin=up.fragment.get(x)),J}function $(x){return K(x)||Y(x)||I(x)}function K(x){if(x instanceof HTMLFormElement)return x}function Y(x){return x.closest("form")}function I(x){let F=x.getAttribute("form");if(F){let J="form"+a.idSelector(F);return up.fragment.get(J,{layer:x})}}function H(x){return x.upFormValidator||(x.upFormValidator=N(x))}
16function N(x){const F=new up.FormValidator(x),J=F.start();return up.destructor(x,J),F}function j(x){return Z(x)||up.layer.current.element}function Z(x){var F;if(x)return $(x)||((F=up.layer.get(x))==null?void 0:F.element)}const Q=up.mockable(function(...x){let[F,{guard:J},te]=n.args(x,"val","options","callback"),oe=function(pe){let ge=j(F);return n.filter(pe,function(Se){return(F===ge||F.contains(Se))&&j(Se)===ge&&(!J||J(Se))})};return up.fragment.trackSelector(o(),{filter:oe},te)});function se(){return n.presence(document.activeElement,l)}function de(x){return x=up.fragment.get(x),i.matches(x,"submitSelectors")}return up.on("submit",i.selectorFn("submitSelectors"),function(x,F){const J=n.presence(x.submitter,f);(J==null?void 0:J.getAttribute("up-submit"))!=="false"&&(x.defaultPrevented||(up.event.halt(x,{log:!0}),up.error.muteUncriticalRejection(v(F,{submitButton:J}))))}),up.compiler("[up-switch]",x=>new up.Switcher(x).start()),up.attribute("up-watch",x=>A(x)),up.compiler("[up-validate]",{rerun:!0},function(x){let F=$(x);F&&H(F)}),up.attribute("up-autosubmit",x=>T(x,{logPrefix:"[up-autosubmit]"})),{config:i,submit:v,submitOptions:b,destinationOptions:E,submitButtonOverrides:q,watchOptions:y,validateOptions:m,isSubmittable:de,watch:A,validate:G,autosubmit:T,fieldSelector:o,fields:u,trackFields:Q,isField:l,submitButtons:p,focusedField:se,disableTemp:S,setDisabled:_,getDisablePreviewFn:L,group:z,groupSolution:V,groupSelectors:P,get:$,getRegion:j}}(),up.submit=up.form.submit,up.watch=up.form.watch,up.autosubmit=up.form.autosubmit,up.validate=up.form.validate},()=>{up.status=function(){const n=up.util,a=up.element,i=new up.Config(()=>({currentClasses:["up-current"],activeClasses:["up-active"],loadingClasses:["up-loading"],revalidatingClasses:["up-revalidating"],navSelectors:["[up-nav]","nav"],noNavSelectors:["[up-nav=false]"]}));let r=new up.Registry("preview");const o="a, [up-href]";function l(C){return C.upCurrentURLs||(C.upCurrentURLs=new up.LinkCurrentURLs(C))}function u(C){let L=a.attr(C,"up-layer")||"origin",_=up.layer.getAll(L,{origin:C});return n.compact(_.map(f))}function c(C,L,{newLinks:_,anyLocationChanged:E}){let q=!E&&C.upNavLocations||u(C);if(_||!n.isEqual(C.upNavLocations,q)){for(let A of L){const R=l(A).isAnyCurrent(q);for(let T of i.currentClasses)A.classList.toggle(T,R);a.setAttrPresence(A,"aria-current","page",R)}C.upNavLocations=q}}function d(C,L){const _=i.selector("navSelectors"),E=a.around(C,_);for(let q of E){let A=a.subtree(q,o);c(q,A,L)}}function f(C){return n.matchableURL(C.location)}function p(C){return C.upExpandedPair||[C]}function h(C,L){let{bindLayer:_}=C,E=up.FocusCapsule.preserve(_),q=()=>g(C,L),A=_.asCurrent(q);return E==null||E.autoVoid(),()=>{_.asCurrent(A),E==null||E.restore(_,{preventScroll:!0})}}function g(C,L){let{fragment:_,fragments:E,origin:q}=C,A=n.cleaner(),R=P=>new up.Preview({fragment:P,request:C,renderOptions:L,cleaner:A}),T=R(_);T.run(b(L.preview)),T.run(v(L.placeholder)),T.run(S(L.feedback,E)),T.run(up.form.getDisablePreviewFn(L.disable,q));for(let P of E){let z=R(P);z.run(up.fragment.matchSelectorMap(P,L.previewMap)),z.run(up.fragment.matchSelectorMap(P,L.placeholderMap).flatMap(v))}return A.clean}function v(C){if(C)return function(L){L.showPlaceholder(C)}}function b(C){return n.isFunction(C)?[C]:n.isString(C)?y(C):n.isArray(C)?C.flatMap(b):[]}function y(C){return n.map(n.parseScalarJSONPairs(C),([L,_])=>{let E=r.get(L);return function(q,A){return up.puts("[up-preview]","Showing preview %o",L),E(q,_||A)}})}function m({origin:C,activeElements:L}){return L||(L=n.wrapList(C)),n.flatMap(L,p)}function S(C,L){if(C)return function(_){const{renderOptions:E}=_;E.expiredResponse?_.addClassBatch(L,i.revalidatingClasses):(_.addClassBatch(m(E),i.activeClasses),_.addClassBatch(L,i.loadingClasses))}}function k(C,L,_){L=n.options(L);const E=new up.OptionsParser(C,L,_);return E.booleanOrString("disable"),E.boolean("feedback"),E.string("preview"),E.booleanOrString("revalidatePreview"),E.string("placeholder"),L}return up.on("up:compilers:before",(C,L)=>{d(L,{newLinks:!0,anyLocationChanged:!1})}),up.on("up:layer:location:changed up:layer:opened up:layer:dismissed up:layer:
16accepted",()=>{d(document.body,{newLinks:!1,anyLocationChanged:!0})}),{config:i,preview:r.put,resolvePreviewFns:b,runPreviews:h,statusOptions:k}}(),up.preview=up.status.preview},()=>{up.radio=function(){const n=up.element,a=new up.Config(()=>({hungrySelectors:["[up-hungry]"],noHungrySelectors:["[up-hungry=false]"],pollInterval:3e4}));function i(u){let{hungry:c,origin:d,layer:f,meta:p}=u,h={current:[],other:[]};if(!c)return h;let g=a.selector("hungrySelectors");const v=[f,...f.ancestors,...f.descendants];for(let b of v){let y=up.fragment.all(b.element,g,{layer:b});for(let m of y){let S=up.fragment.tryToTarget(m,{origin:d});if(!S){up.warn("[up-hungry]","Ignoring untargetable fragment %o",m);continue}let k=n.attr(m,"up-if-layer"),C=k?up.layer.getAll(k,{baseLayer:b}):[b],L=up.motion.motionOptions(m),_=up.event.build("up:fragment:hungry",{log:!1}),E=up.script.callbackAttr(m,"up-on-hungry",{expandObject:["newFragment","renderOptions"]}),q={selector:S,oldElement:m,layer:b,origin:d,...L,placement:"swap",keep:!0,maybe:!0,meta:p,selectEvent:_,selectCallback:E,originalRenderOptions:u};C.includes(f)&&(f===b?h.current:h.other).push(q)}}return h.other=up.fragment.compressNestedSteps(h.other),h}function r(u,c={}){up.FragmentPolling.forFragment(u).forceStart(c)}function o(u){up.FragmentPolling.forFragment(u).forceStop()}function l(u,c={}){const d={background:!0},f=new up.OptionsParser(u,c,{defaults:d});return f.number("interval",{default:a.pollInterval}),f.string("ifLayer",{default:"front"}),f.include(up.link.requestOptions),f.include(up.status.statusOptions),c}return up.attribute("up-poll",function(u){up.FragmentPolling.forFragment(u).onPollAttributeObserved()}),up.macro("[up-flashes]",function(u){n.setMissingAttrs(u,{"up-hungry":"","up-if-layer":"subtree","up-keep":"",role:"alert"}),u.addEventListener("up:fragment:keep",function(c){n.isEmpty(c.newFragment)||c.preventDefault()})}),{config:a,hungrySteps:i,startPolling:r,stopPolling:o,pollOptions:l}}()},()=>{(function(){function n(){var r;return window.Rails||((r=window.jQuery)==null?void 0:r.rails)}function a(r,o,l){if(r.hasAttribute(o)){let u=r.getAttribute(o);up.element.setMissingAttr(r,l,u),r.removeAttribute(o)}}function i(r,o){up.macro(`:is([data-confirm], [data-method]):is(${r})`,function(l){n()&&o(l)&&(a(l,"data-confirm","up-confirm"),a(l,"data-method","up-method"))})}i("a[href], [up-href]",r=>up.link.isFollowable(r)),i("form, input[type=submit], button[type=submit], button:not([type])",r=>up.form.isSubmittable(up.form.get(r)))})()}],t={};function s(n){var a=t[n];if(a!==void 0)return a.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,s),i.exports}s.r=n=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},s(1),s(2),s(3),s(4),s(5),s(6),s(7),s(9),s(10),s(11),s(12),s(13),s(14),s(15),s(16),s(17),s(18),s(19),s(20),s(21),s(22),s(23),s(24),s(25),s(26),s(27),s(28),s(29),s(30),s(31),s(32),s(33),s(34),s(35),s(36),s(37),s(38),s(39),s(40),s(41),s(42),s(43),s(44),s(45),s(46),s(47),s(48),s(49),s(50),s(51),s(52),s(53),s(54),s(55),s(56),s(57),s(58),s(59),s(60),s(61),s(62),s(63),s(64),s(65),s(66),s(67),s(68),s(69),s(70),s(71),s(72),s(73),s(74),s(75),s(76),s(77),s(78),s(79),s(80),s(81),s(82),s(83),s(84),s(85),s(86),s(87),s(88),s(89),s(90),s(91),s(93),s(95),s(96),s(98),s(100),s(102),s(103),s(104),s(105),up.framework.onEvaled()})()})();function mt(e=""){return e.trim().split(" ").filter(t=>!!t.trim())}function io(e){Object.keys(e).forEach(t=>{try{e[t]=null}catch{}try{delete e[t]}catch{}})}function Jt(e,t=0){return setTimeout(e,t)}function Ue(){return Date.now()}function ao(e){return window.getComputedStyle(e,null)}function Ps(e,t="x"){const s=ao(e),n=s.transform||s.webkitTransform;if(!n||n==="none")return 0;const a=new DOMMatrixReadOnly(n);return t==="x"?a.m41:a.m42}function fr(e){return typeof e=="object"&&e!==null&&!!e.constructor&&Object.prototype.toString.call(e).slice(8,-1)==="Object"}function oo(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:!!e&&typeof e=="object"&&(e.nodeType===1||e.nodeType===11)}function He(e,...t){const s=Object(e);for(let n=0;n<t.length;n+=1){const a=t[n];if(a==null||oo(a))continue;const i=a,r=Object.keys(Object(i));for(let o=0,l=r.length;o<l;o+=1){const u=r[o];if(u==="__proto__"||u==="constructor"||u==="prototype")continue;const c=Object.getOwnPropertyDescriptor(i,u);if(!c||!c.enumerable)continue;const d=i[u];fr(s[u])&&fr(d)?d.__swiper__?s[u]=d:He(s[u],d):!fr(s[u])&&fr(d)?(s[u]={},d.__swiper__?s[u]=d:He(s[u],d)):s[u]=d}}return s}
16function Rt(e,t,s){e.style.setProperty(t,s)}function $t(e){const t=e.querySelector(".swiper-slide-transform");if(t)return t;if(e.shadowRoot){const s=e.shadowRoot.querySelector(".swiper-slide-transform");if(s)return s}return e}function Ae(e,t=""){const s=[...e.children];return e instanceof HTMLSlotElement&&s.push(...e.assignedElements()),t?s.filter(n=>n.matches(t)):s}function lo(e,t){const s=[t];for(;s.length>0;){const n=s.shift();if(e===n)return!0;s.push(...n.children,...n.shadowRoot?n.shadowRoot.children:[],...n.assignedElements?n.assignedElements():[])}return!1}function uo(e,t){let s=t.contains(e);return!s&&t instanceof HTMLSlotElement&&(s=[...t.assignedElements()].includes(e),s||(s=lo(e,t))),s}function Gr(e){try{console.warn(e)}catch{}}function Ge(e,t=[]){const s=document.createElement(e);return s.classList.add(...Array.isArray(t)?t:mt(t)),s}function Wr(e){const t=e.getBoundingClientRect();return{top:t.top-(e.clientTop||0),left:t.left-(e.clientLeft||0)}}function co(e,t){const s=[];let n=e.previousElementSibling;for(;n;)(!t||n.matches(t))&&s.push(n),n=n.previousElementSibling;return s}function ho(e,t){const s=[];let n=e.nextElementSibling;for(;n;)(!t||n.matches(t))&&s.push(n),n=n.nextElementSibling;return s}function yt(e,t){return window.getComputedStyle(e,null).getPropertyValue(t)}function wr(e){if(!(!e||!e.parentNode))return[...e.parentNode.children].indexOf(e)}function Dt(e,t){const s=[];let n=e.parentElement;for(;n;)(!t||n.matches(t))&&s.push(n),n=n.parentElement;return s}function gr(e,t){t&&e.addEventListener("transitionend",function(n){n.target===e&&t.call(e,n)},{once:!0})}function Os(e,t,s){{const n=window.getComputedStyle(e,null);return e[t==="width"?"offsetWidth":"offsetHeight"]+parseFloat(n.getPropertyValue(t==="width"?"margin-right":"margin-top"))+parseFloat(n.getPropertyValue(t==="width"?"margin-left":"margin-bottom"))}}function ve(e){return(Array.isArray(e)?e:[e]).filter(t=>!!t)}function Zr(e){return t=>Math.abs(t)>0&&e.browser&&e.browser.need3dFix&&Math.abs(t)%90===0?t+.001:t}function We(e,t=""){const s=globalThis.trustedTypes;typeof s<"u"?e.innerHTML=s.createPolicy("html",{createHTML:n=>n}).createHTML(t):e.innerHTML=t}let hs;function fo(){return typeof window>"u"?{touch:!1}:{touch:"ontouchstart"in window||navigator.maxTouchPoints>0}}function oi(){return hs||(hs=fo()),hs}let fs;function po({userAgent:e}={}){if(typeof window>"u")return{ios:!1,android:!1};const t=oi(),s=navigator.platform,n=e||navigator.userAgent,a={ios:!1,android:!1},i=/(Android);?[\s/]+([\d.]+)?/.test(n),r=/(iPhone\sOS|iOS|iPod)/.test(n),o=/iPad/.test(n),l=s==="MacIntel"&&t.touch&&navigator.maxTouchPoints>1,u=o||l;return i&&!(s==="Win32")&&(a.os="android",a.android=!0),(u||r)&&(a.os="ios",a.ios=!0),a}function li(e={}){return fs||(fs=po(e)),fs}let ps;function go(){if(typeof window>"u")return{isSafari:!1,isWebView:!1,need3dFix:!1};const e=li(),t=navigator.userAgent,s=t.toLowerCase(),n=s.includes("safari")&&!s.includes("chrome")&&!s.includes("android"),a=/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(t),i=n||a&&e.ios;return{isSafari:n,isWebView:a,need3dFix:i}}function ui(){return ps||(ps=go()),ps}const Ur=(e,t)=>{if(!e||e.destroyed||!e.params||!e.params.lazyPreload)return;const s=()=>e.isElement?"swiper-slide":`.${e.params.slideClass}`,n=t.closest(s());if(n){let a=n.querySelector(`.${e.params.lazyPreloaderClass}`);!a&&e.isElement&&(n.shadowRoot?a=n.shadowRoot.querySelector(`.${e.params.lazyPreloaderClass}`):requestAnimationFrame(()=>{if(n.shadowRoot){const i=n.shadowRoot.querySelector(`.${e.params.lazyPreloaderClass}`);i&&!i.lazyPreloaderManaged&&i.remove()}})),a&&!a.lazyPreloaderManaged&&a.remove()}},gs=(e,t)=>{if(!e.slides[t])return;const s=e.slides[t].querySelector('[loading="lazy"]');s&&s.removeAttribute("loading")},ci=e=>{if(!e||e.destroyed||!e.params||!e.params.lazyPreload)return;let t=e.params.lazyPreloadPrevNext;const s=e.slides.length;if(!s||!t||t<0)return;t=Math.min(t,s);const n=e.params.slidesPerView==="auto"?e.slidesPerViewDynamic():Math.ceil(e.params.slidesPerView),a=e.activeIndex;if(e.params.grid&&(e.params.grid.rows??1)>1){const r=a,o=[r-t];o.push(...Array.from({length:t}).map((l,u)=>
16r+n+u)),e.slides.forEach((l,u)=>{l.column!==void 0&&o.includes(l.column)&&gs(e,u)});return}const i=a+n-1;if(e.params.rewind||e.params.loop)for(let r=a-t;r<=i+t;r+=1){const o=(r%s+s)%s;(o<a||o>i)&&gs(e,o)}else for(let r=Math.max(a-t,0);r<=Math.min(i+t,s-1);r+=1)r!==a&&(r>i||r<a)&&gs(e,r)};function mo(e,t="window",s){if(!e||t==="container"&&!s)return;let n=!1;const a=t==="window"?window.innerHeight:s.clientHeight,i=Object.keys(e).map(r=>{if(typeof r=="string"&&r.indexOf("@")===0){const o=parseFloat(r.substr(1));return{value:a*o,point:r}}return{value:r,point:r}});i.sort((r,o)=>parseInt(String(r.value),10)-parseInt(String(o.value),10));for(let r=0;r<i.length;r+=1){const{point:o,value:l}=i[r];t==="window"?window.matchMedia(`(min-width: ${l}px)`).matches&&(n=o):l<=s.clientWidth&&(n=o)}return n||"max"}const yn=(e,t)=>!!(e.grid&&t.grid&&t.grid.rows>1);function vo(){const e=this,{realIndex:t,initialized:s,params:n,el:a}=e,i=n.breakpoints;if(!i||i&&Object.keys(i).length===0)return;const r=n.breakpointsBase==="window"||!n.breakpointsBase?n.breakpointsBase:"container",o=["window","container"].includes(n.breakpointsBase)||!n.breakpointsBase?e.el:document.querySelector(n.breakpointsBase),l=e.getBreakpoint(i,r,o);if(!l||e.currentBreakpoint===l)return;const u=i,d=(l in u?u[l]:void 0)||e.originalParams,f=yn(e,n),p=yn(e,d),h=e.params.grabCursor,g=d.grabCursor,v=n.enabled;f&&!p?(a.classList.remove(`${n.containerModifierClass}grid`,`${n.containerModifierClass}grid-column`),e.emitContainerClasses()):!f&&p&&(a.classList.add(`${n.containerModifierClass}grid`),(d.grid.fill&&d.grid.fill==="column"||!d.grid.fill&&n.grid.fill==="column")&&a.classList.add(`${n.containerModifierClass}grid-column`),e.emitContainerClasses()),h&&!g?e.unsetGrabCursor():!h&&g&&e.setGrabCursor();const b=(L,_)=>L[_];["navigation","pagination","scrollbar"].forEach(L=>{var T,P;const _=b(d,L);if(typeof _>"u")return;const E=b(n,L),q=typeof E=="object"&&E!==null&&E.enabled,A=typeof _=="object"&&_!==null&&_.enabled,R=e[L];q&&!A&&((T=R==null?void 0:R.disable)==null||T.call(R)),!q&&A&&((P=R==null?void 0:R.enable)==null||P.call(R))});const y=d.direction&&d.direction!==n.direction,m=n.loop&&(d.slidesPerView!==n.slidesPerView||y),S=n.loop;y&&s&&e.changeDirection(),He(e.params,d);const k=e.params.enabled,C=e.params.loop;Object.assign(e,{allowTouchMove:e.params.allowTouchMove,allowSlideNext:e.params.allowSlideNext,allowSlidePrev:e.params.allowSlidePrev}),v&&!k?e.disable():!v&&k&&e.enable(),e.currentBreakpoint=l,e.emit("_beforeBreakpoint",d),s&&(m?(e.loopDestroy(),e.loopCreate(t),e.updateSlides()):!S&&C?(e.loopCreate(t),e.updateSlides()):S&&!C&&e.loopDestroy()),e.emit("breakpoint",d)}var yo={setBreakpoint:vo,getBreakpoint:mo};function bo(){const e=this,{isLocked:t,params:s}=e,{slidesOffsetBefore:n}=s;if(n){const a=e.slides.length-1,i=e.slidesGrid[a]+e.slidesSizesGrid[a]+n*2;e.isLocked=e.size>i}else e.isLocked=e.snapGrid.length===1;s.allowSlideNext===!0&&(e.allowSlideNext=!e.isLocked),s.allowSlidePrev===!0&&(e.allowSlidePrev=!e.isLocked),t&&t!==e.isLocked&&(e.isEnd=!1),t!==e.isLocked&&e.emit(e.isLocked?"lock":"unlock")}var wo={checkOverflow:bo};function _o(e,t){const s=[];return e.forEach(n=>{typeof n=="object"?Object.keys(n).forEach(a=>{n[a]&&s.push(t+a)}):typeof n=="string"&&s.push(t+n)}),s}function So(){const e=this,{classNames:t,params:s,rtl:n,el:a,device:i}=e,r=_o(["initialized",s.direction,{"free-mode":e.params.freeMode&&s.freeMode.enabled},{autoheight:s.autoHeight},{rtl:n},{grid:s.grid&&s.grid.rows>1},{"grid-column":s.grid&&s.grid.rows>1&&s.grid.fill==="column"},{android:i.android},{ios:i.ios},{"css-mode":s.cssMode},{centered:s.cssMode&&s.centeredSlides},{"watch-progress":s.watchSlidesProgress}],s.containerModifierClass);t.push(...r),a.classList.add(...t),e.emitContainerClasses()}function Eo(){const e=this,{el:t,classNames:s}=e;!t||typeof t=="string"||(t.classList.remove(...s),e.emitContainerClasses())}var xo={addClasses:So,removeClasses:Eo};const Ks={init:!0,direction:"horizontal",oneWayMovement:!1,swiperElementNodeName:"SWIPER-CONTAINER",touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,eventsPrefix:"swiper",enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",
16spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,snapToSlideEdge:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopAddBlankSlides:!0,loopAdditionalSlides:0,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-blank",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideFullyVisibleClass:"swiper-slide-fully-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreload:!0,lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};var To={on(e,t,s){const n=this;if(!n.eventsListeners||n.destroyed||typeof t!="function")return n;const a=s?"unshift":"push";return e.split(" ").forEach(i=>{n.eventsListeners[i]||(n.eventsListeners[i]=[]),n.eventsListeners[i][a](t)}),n},once(e,t,s){const n=this;if(!n.eventsListeners||n.destroyed||typeof t!="function")return n;const a=function(...r){n.off(e,a),a.__emitterProxy&&delete a.__emitterProxy,t.apply(n,r)};return a.__emitterProxy=t,n.on(e,a,s)},onAny(e,t){const s=this;if(!s.eventsListeners||s.destroyed||typeof e!="function")return s;const n=t?"unshift":"push";return s.eventsAnyListeners.indexOf(e)<0&&s.eventsAnyListeners[n](e),s},offAny(e){const t=this;if(!t.eventsListeners||t.destroyed||!t.eventsAnyListeners)return t;const s=t.eventsAnyListeners.indexOf(e);return s>=0&&t.eventsAnyListeners.splice(s,1),t},off(e,t){const s=this;return!s.eventsListeners||s.destroyed||!s.eventsListeners||e.split(" ").forEach(n=>{typeof t>"u"?s.eventsListeners[n]=[]:s.eventsListeners[n]&&s.eventsListeners[n].forEach((a,i)=>{(a===t||a.__emitterProxy&&a.__emitterProxy===t)&&s.eventsListeners[n].splice(i,1)})}),s},emit(...e){const t=this;if(!t.eventsListeners||t.destroyed||!t.eventsListeners)return t;let s,n,a;if(typeof e[0]=="string"||Array.isArray(e[0]))s=e[0],n=e.slice(1,e.length),a=t;else{const r=e[0];s=r.events,n=r.data??[],a=r.context||t}return n.unshift(a),(Array.isArray(s)?s:s.split(" ")).forEach(r=>{t.eventsAnyListeners&&t.eventsAnyListeners.length&&t.eventsAnyListeners.forEach(o=>{o.apply(a,[r,...n])}),t.eventsListeners&&t.eventsListeners[r]&&t.eventsListeners[r].forEach(o=>{o.apply(a,n)})}),t}};function ko(e){const t=this;t.destroyed||t.enabled&&(t.allowClick||(t.params.preventClicks&&e.preventDefault(),t.params.preventClicksPropagation&&t.animating&&(e.stopPropagation(),e.stopImmediatePropagation())))}function Co(){const e=this;e.destroyed||e.documentTouchHandlerProceeded||(e.documentTouchHandlerProceeded=!0,e.params.touchReleaseOnEdges&&(e.el.style.touchAction="auto"))}function Po(e){const t=this;t.destroyed||(Ur(t,e.target),!(t.params.cssMode||t.params.slidesPerView!=="auto"&&!t.params.autoHeight)&&t.update())}function Oo(){var l;const e=this,{params:t,el:s}=e;if(s&&s.offsetWidth===0)return;t.breakpoints&&e.setBreakpoint();const{allowSlideNext:n,allowSlidePrev:a,snapGrid:i}=e,r=e.virtual&&((l=e.params.virtual)==null?void 0:l.enabled);e.allowSlideNext=!0,e.allowSlidePrev=!0,e.updateSize(),e.updateSlides(),e.updateSlidesClasses();const o=r&&t.loop;if((t.slidesPerView==="auto"||t.slidesPerView>1)&&e.isEnd&&!e.isBeginning&&!e.params.centeredSlides&&!o){const u=r?e.virtual.slides.length:e.slides.length;e.slideTo(u-1,0,!1,!0)}else e.params.loop&&!r?e.slideToLoop(e.realIndex,0,!1,!0):e.slideTo(e.activeIndex,0,!1,!0);if(e.autoplay&&e.autoplay.running&&e.autoplay.paused){const u=e.autoplay;clearTimeout(u.resizeTimeout),u.resizeTimeout=setTimeout(()=>{e.autoplay&&e.autoplay.running&&e.autoplay.paused&&e.autoplay.resume()},500)}e.allowSlidePrev=a,e.allowSlideNext=n,e.params.watchOverflow&&i!==e.snapGrid&&e.checkOverflow()}function Ao(){const e=this;if(e.destroyed)return;const{wrapperEl:t,rtlTranslate:s,enabled:n}=e;if(!n)return;e.previousTranslate=e.translate,e.isHorizontal()?e.translate=-t.scrollLeft:e.translate=-t.scrollTop,e.translate===0&&(e.translate=0),e.updateActiveIndex(),e.updateSlidesClasses();let a;const i=e.maxTranslate()-e.minTranslate();i===0?a=0:a=(e.translate-e.minTranslate())/i,a!==e.progress&&e.updateProgress(s?-e.translate:e.translate),e.emit("setTranslate",e.translate,!1)}function Ro(e){var S;const t=this;if(t.destroyed)return;const s=t.touchEventsData;let n=e.originalEvent??e;if(n.type==="touchend"||n.type==="touchcancel"){const C=[...n.changedTouches].find(L=>L.identifier===s.touchId);if(!C||C.identifier!==s.touchId)return}else if(s.touchId!==null||n.pointerId!==s.pointerId)return;if(["pointercancel","pointerout","pointerleave","contextmenu"].includes(n.t
16ype)&&!(["pointercancel","contextmenu"].includes(n.type)&&(t.browser.isSafari||t.browser.isWebView)))return;s.pointerId=null,s.touchId=null;const{params:i,touches:r,rtlTranslate:o,slidesGrid:l,enabled:u}=t;if(!u||!i.simulateTouch&&n.pointerType==="mouse")return;if(s.allowTouchCallbacks&&t.emit("touchEnd",n),s.allowTouchCallbacks=!1,!s.isTouched){s.isMoved&&i.grabCursor&&t.setGrabCursor(!1),s.isMoved=!1,s.startMoving=!1;return}i.grabCursor&&s.isMoved&&s.isTouched&&(t.allowSlideNext===!0||t.allowSlidePrev===!0)&&t.setGrabCursor(!1);const c=Ue(),d=c-s.touchStartTime;if(t.allowClick){const k=n.path??(n.composedPath&&n.composedPath());t.updateClickedSlide(k&&k[0],k),t.emit("tap click",n),d<300&&c-s.lastClickTime<300&&t.emit("doubleTap doubleClick",n)}if(s.lastClickTime=Ue(),Jt(()=>{t.destroyed||(t.allowClick=!0)}),!s.isTouched||!s.isMoved||!t.swipeDirection||r.diff===0&&!s.loopSwapReset||s.currentTranslate===s.startTranslate&&!s.loopSwapReset){s.isTouched=!1,s.isMoved=!1,s.startMoving=!1;return}s.isTouched=!1,s.isMoved=!1,s.startMoving=!1;let f;if(i.followFinger?f=o?t.translate:-t.translate:f=-(s.currentTranslate??0),i.cssMode)return;if(i.freeMode&&i.freeMode.enabled){t.freeMode.onTouchEnd({currentPos:f});return}const p=f>=-t.maxTranslate()&&!t.params.loop;let h=0,g=t.slidesSizesGrid[0];for(let k=0;k<l.length;k+=k<i.slidesPerGroupSkip?1:i.slidesPerGroup){const C=k<i.slidesPerGroupSkip-1?1:i.slidesPerGroup;typeof l[k+C]<"u"?(p||f>=l[k]&&f<l[k+C])&&(h=k,g=l[k+C]-l[k]):(p||f>=l[k])&&(h=k,g=l[l.length-1]-l[l.length-2])}let v=null,b=null;i.rewind&&(t.isBeginning?b=(S=i.virtual)!=null&&S.enabled&&t.virtual?t.virtual.slides.length-1:t.slides.length-1:t.isEnd&&(v=0));const y=(f-l[h])/g,m=h<i.slidesPerGroupSkip-1?1:i.slidesPerGroup;if(d>i.longSwipesMs){if(!i.longSwipes){t.slideTo(t.activeIndex);return}t.swipeDirection==="next"&&(y>=i.longSwipesRatio?t.slideTo(i.rewind&&t.isEnd?v:h+m):t.slideTo(h)),t.swipeDirection==="prev"&&(y>1-i.longSwipesRatio?t.slideTo(h+m):b!==null&&y<0&&Math.abs(y)>i.longSwipesRatio?t.slideTo(b):t.slideTo(h))}else{if(!i.shortSwipes){t.slideTo(t.activeIndex);return}t.navigation&&(n.target===t.navigation.nextEl||n.target===t.navigation.prevEl)?n.target===t.navigation.nextEl?t.slideTo(h+m):t.slideTo(h):(t.swipeDirection==="next"&&t.slideTo(v!==null?v:h+m),t.swipeDirection==="prev"&&t.slideTo(b!==null?b:h))}}function Lo(e){const t=this;if(t.destroyed)return;const s=t.touchEventsData,{params:n,touches:a,rtlTranslate:i,enabled:r}=t;if(!r||!n.simulateTouch&&e.pointerType==="mouse")return;const o=e,l=o.originalEvent??o;if(l.type==="pointermove"&&(s.touchId!==null||l.pointerId!==s.pointerId))return;let u;if(l.type==="touchmove"){const L=[...l.changedTouches].find(_=>_.identifier===s.touchId);if(!L||L.identifier!==s.touchId)return;u=L}else u=l;if(!s.isTouched){s.startMoving&&s.isScrolling&&t.emit("touchMoveOpposite",l);return}const c=u.pageX,d=u.pageY;if(l.preventedByNestedSwiper){a.startX=c,a.startY=d;return}if(!t.allowTouchMove){l.target.matches(s.focusableElements)||(t.allowClick=!1),s.isTouched&&(Object.assign(a,{startX:c,startY:d,currentX:c,currentY:d}),s.touchStartTime=Ue());return}if(n.touchReleaseOnEdges&&!n.loop)if(t.isVertical()){if(d<a.startY&&t.translate<=t.maxTranslate()||d>a.startY&&t.translate>=t.minTranslate()){s.isTouched=!1,s.isMoved=!1;return}}else{if(i&&(c>a.startX&&-t.translate<=t.maxTranslate()||c<a.startX&&-t.translate>=t.minTranslate()))return;if(!i&&(c<a.startX&&t.translate<=t.maxTranslate()||c>a.startX&&t.translate>=t.minTranslate()))return}if(document.activeElement&&document.activeElement.matches(s.focusableElements)&&document.activeElement!==l.target&&l.pointerType!=="mouse"&&document.activeElement.blur(),document.activeElement&&l.target===document.activeElement&&l.target.matches(s.focusableElements)){s.isMoved=!0,t.allowClick=!1;return}s.allowTouchCallbacks&&t.emit("touchMove",l),a.previousX=a.currentX,a.previousY=a.currentY,a.currentX=c,a.currentY=d;const f=a.currentX-a.startX,p=a.currentY-a.startY;if(t.params.threshold&&Math.sqrt(f**2+p**2)<t.params.threshold)return;if(typeof s.isScrolling>"u"){let C;t.isHorizontal()&&a.currentY===a.startY||t.isVertical()&&a.currentX===a.startX?s.isScrolling=!1:f*f+p*p>=25&&(C=Math.atan2(Math.abs(p),Math.abs(f))*180/Math.PI,s.isScrolling=t.isHorizontal()?C>n.touchAngle:90-C>n.touchAngle)}if(s.isScrolling&&t.emit("touchMoveOpposite",l),typeof s.startMoving>"u"&&(a.currentX!==a.startX||a.currentY!==a.startY)&&(s.startMoving=!0),s.isScrolling||l.type==="touchmove"&&s.preventTouchMoveFromPointerMove){s.isTouched=!1;return}if(!s.startMoving)return;t.allowClick=!1,!n.cssMode&&l.cancelable&&l.preventDefault(),n.touchMoveStopPropagation&&!n.nested&&l.stopPropagation();let h=t.isHorizontal()?f:p,g=t.isHorizontal()?a.currentX-a.previousX:a.currentY-a.previousY;n.oneWayMovement&&(h=Math.abs(h)*(i?1:-1),g=Math.abs(g)*(i?1:-1)),a.diff=h,h*=n.touchRatio,i&&(h=-h,g=-g);const v=t.touchesDirection;t.swipeDirection=h>0?"prev":"next",t.touchesDirection=g>0?"prev":"next";const b=t.params.loop&&!n.cssMode,y=t.touchesDirection==="next"&&t.allowSlideNext||t.touchesDirection==="prev"&&t.allowSlidePrev;if(!s.isMoved){if(b&&y&&t.loopFix({direction:t.swipeDirection}),s.startTranslate=t.getTranslate(),t.setTransition(0),t.animating){const C=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0,detail:{bySwiperTouchMove:!0}});
16t.wrapperEl.dispatchEvent(C)}s.allowMomentumBounce=!1,n.grabCursor&&(t.allowSlideNext===!0||t.allowSlidePrev===!0)&&t.setGrabCursor(!0),t.emit("sliderFirstMove",l)}if(new Date().getTime(),n._loopSwapReset!==!1&&s.isMoved&&s.allowThresholdMove&&v!==t.touchesDirection&&b&&y&&Math.abs(h)>=1){Object.assign(a,{startX:c,startY:d,currentX:c,currentY:d,startTranslate:s.currentTranslate}),s.loopSwapReset=!0,s.startTranslate=s.currentTranslate;return}t.emit("sliderMove",l),s.isMoved=!0;const m=s.startTranslate??0;s.currentTranslate=h+m;let S=!0,k=n.resistanceRatio;if(n.touchReleaseOnEdges&&(k=0),h>0?(b&&y&&s.allowThresholdMove&&s.currentTranslate>(n.centeredSlides?t.minTranslate()-t.slidesSizesGrid[t.activeIndex+1]-(n.slidesPerView!=="auto"&&t.slides.length-n.slidesPerView>=2?t.slidesSizesGrid[t.activeIndex+1]+t.params.spaceBetween:0)-t.params.spaceBetween:t.minTranslate())&&t.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),s.currentTranslate>t.minTranslate()&&(S=!1,n.resistance&&(s.currentTranslate=t.minTranslate()-1+(-t.minTranslate()+m+h)**k))):h<0&&(b&&y&&s.allowThresholdMove&&s.currentTranslate<(n.centeredSlides?t.maxTranslate()+t.slidesSizesGrid[t.slidesSizesGrid.length-1]+t.params.spaceBetween+(n.slidesPerView!=="auto"&&t.slides.length-n.slidesPerView>=2?t.slidesSizesGrid[t.slidesSizesGrid.length-1]+t.params.spaceBetween:0):t.maxTranslate())&&t.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:t.slides.length-(n.slidesPerView==="auto"?t.slidesPerViewDynamic():Math.ceil(parseFloat(String(n.slidesPerView))))}),s.currentTranslate<t.maxTranslate()&&(S=!1,n.resistance&&(s.currentTranslate=t.maxTranslate()+1-(t.maxTranslate()-m-h)**k))),S&&(l.preventedByNestedSwiper=!0),!t.allowSlideNext&&t.swipeDirection==="next"&&(s.currentTranslate??0)<m&&(s.currentTranslate=m),!t.allowSlidePrev&&t.swipeDirection==="prev"&&(s.currentTranslate??0)>m&&(s.currentTranslate=m),!t.allowSlidePrev&&!t.allowSlideNext&&(s.currentTranslate=m),n.threshold>0)if(Math.abs(h)>n.threshold||s.allowThresholdMove){if(!s.allowThresholdMove){s.allowThresholdMove=!0,a.startX=a.currentX,a.startY=a.currentY,s.currentTranslate=s.startTranslate,a.diff=t.isHorizontal()?a.currentX-a.startX:a.currentY-a.startY;return}}else{s.currentTranslate=s.startTranslate;return}!n.followFinger||n.cssMode||((n.freeMode&&n.freeMode.enabled&&t.freeMode||n.watchSlidesProgress)&&(t.updateActiveIndex(),t.updateSlidesClasses()),n.freeMode&&n.freeMode.enabled&&t.freeMode&&t.freeMode.onTouchMove(),t.updateProgress(s.currentTranslate),t.setTranslate(s.currentTranslate??0))}function Io(e,t){function s(n){if(!n||n===document||n===window)return null;let a=n;a.assignedSlot&&(a=a.assignedSlot);const i=a.closest(e);if(!i&&!a.getRootNode)return null;const r=a.getRootNode();return i||s(r.host)}return s(t)}function bn(e,t,s){const{params:n}=e,a=n.edgeSwipeDetection,i=n.edgeSwipeThreshold;return a&&(s<=i||s>=window.innerWidth-i)?a==="prevent"?(t.preventDefault(),!0):!1:!0}function Mo(e){const t=this;if(t.destroyed)return;const s=e.originalEvent??e,n=t.touchEventsData;if(s.type==="pointerdown"){const y=s;if(n.pointerId!==null&&n.pointerId!==y.pointerId)return;n.pointerId=y.pointerId}else s.type==="touchstart"&&s.targetTouches.length===1&&(n.touchId=s.targetTouches[0].identifier);if(s.type==="touchstart"){bn(t,s,s.targetTouches[0].pageX);return}const{params:a,touches:i,enabled:r}=t;if(!r||!a.simulateTouch&&s.pointerType==="mouse"||t.animating&&a.preventInteractionOnTransition)return;!t.animating&&a.cssMode&&a.loop&&t.loopFix();let o=s.target;if(a.touchEventsTarget==="wrapper"&&!uo(o,t.wrapperEl))return;const l=s;if(typeof l.which=="number"&&l.which===3||typeof l.button=="number"&&l.button>0||n.isTouched&&n.isMoved)return;const u=!!a.noSwipingClass&&a.noSwipingClass!=="",c=s.composedPath?s.composedPath():s.path;u&&s.target&&s.target.shadowRoot&&c&&(o=c[0]);const d=a.noSwipingSelector?a.noSwipingSelector:`.${a.noSwipingClass}`,f=!!(s.target&&s.target.shadowRoot);if(a.noSwiping&&(f?Io(d,o):o.closest(d))){t.allowClick=!0;return}if(a.swipeHandler&&typeof a.swipeHandler=="string"&&!o.closest(a.swipeHandler))return;const p=s;i.currentX=p.pageX,i.currentY=p.pageY;const h=i.currentX,g=i.currentY;if(!bn(t,s,h))return;Object.assign(n,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),i.startX=h,i.startY=g,n.touchStartTime=Ue(),t.allowClick=!0,t.updateSize(),t.swipeDirection=void 0,a.threshold>0&&(n.allowThresholdMove=!1);let v=!0;o.matches(n.focusableElements)&&(v=!1,o.nodeName==="SELECT"&&(n.isTouched=!1)),document.activeElement&&document.activeElement.matches(n.focusableElements)&&document.activeElement!==o&&(p.pointerType==="mouse"||p.pointerType!=="mouse"&&!o.matches(n.focusableElements))&&document.activeElement.blur();const b=v&&t.allowTouchMove&&a.touchStartPreventDefault;(a.touchStartForcePreventDefault||b)&&!o.isContentEditable&&s.preventDefault(),a.freeMode&&a.freeMode.enabled&&t.freeMode&&t.animating&&!a.cssMode&&t.freeMode.onTouchStart(),t.emit("touchStart",s)}const di=(e,t)=>{const{params:s,el:n,wrapperEl:a,device:i}=e,r=!!s.nested,o=t==="on"?"addEventListener":"removeEventListener",l=t;if(!n||typeof n=="string")return;document[o]("touchstart",e.onDocumentTouchStart,{passive:!1,capture:r}),n[o]("touchstart",e.onTouchStart,{passive:!1}),n[o]("pointerdown",e.onTouchStart,{passive:!1}),document[o]("touchmove",e.onTouchMove,{passive:!1,capture:r}),document[o]("pointermove",e.onTouchMove,{passive:!1,capture:r}),document[o]("touchend",e.onTouchEnd,{passive:!0}),document[o]("pointerup",e.onTouchEnd,{passive:!0}),document[o]("pointercancel",e.onTouchEnd,{passive:!0}),document[o]("touchcancel",e.onTouchEnd,{passive:!0}),document[o]("pointerout",e.onTouchEnd,{passive:!0}),document[o]("pointerleave",e.onTouchEnd,{passive:!0}),document[o]("contextmenu",e.onTouchEnd,{passive:!0}),(s.preventClicks||s.preventClicksPropagation)&&n[o]("click",e.onClick,!0),s.cssMode&&a[o]("scroll",e.onScroll);const u=c=>{e[l](c,Oo,!0)};s.updateOnWindowResize?u(i.ios||i.android?"resize orientationchange observerUpdate":"resize observerUpdate"):u("observerUpdate"),s.lazyPreload&&n[o]("load",e.onLoad,{capture:!0})};function Fo(){const e=this,{params:t}=e;e.onTouchStart=Mo.bind(e),e.onTouchMove=Lo.bind(e),e.onTouchEnd=Ro.bind(e),e.onDocumentTouchStart=Co.bind(e),t.cssMode&&(e.onScroll=Ao.bind(e)),e.onClick=ko.bind(e),e.onLoad=Po.bind(e),di(e,"on")}function Do(){di(this,"off")}var $o={attachEvents:Fo,detachEvents:Do};function jo(e){const t=this;if(!t.params.simulateTouch||t.params.watchOverflow&&t.isLocked||t.params.cssMode)return;const s=t.params.touchEventsTarget==="container"?t.el:t.wrapperEl;t.isElement&&(t.__preventObserver__=!0),s.style.cursor="move",s.style.cursor=e?"grabbing":"grab",t.isElement&&requestAnimationFrame(()=>{t.__preventObserver__=!1})}function No(){const e=this;e.params.watchOverflow&&e.isLocked||e.params.cssMode||(e.isElement&&(e.__preventObserver__=!0),e[e.params.touchEventsTarget==="container"?"el":"wrapperEl"].style.cursor="",e.isElement&&requestAnimationFrame(()=>{e.__preventObserver__=!1}))}var zo={setGrabCursor:jo,unsetGrabCursor:No};function Bo(e,t){var p;const s=this,{params:n,slidesEl:a}=s;
16if(!n.loop||s.virtual&&((p=s.params.virtual)!=null&&p.enabled))return;const i=()=>{Ae(a,`.${n.slideClass}, swiper-slide`).forEach((g,v)=>{g.setAttribute("data-swiper-slide-index",String(v))})},r=()=>{const h=Ae(a,`.${n.slideBlankClass}`);h.forEach(g=>{g.remove()}),h.length>0&&(s.recalcSlides(),s.updateSlides())},o=s.grid&&n.grid&&n.grid.rows>1;n.loopAddBlankSlides&&(n.slidesPerGroup>1||o)&&r();const l=n.slidesPerGroup*(o?n.grid.rows:1),u=s.slides.length%l!==0,c=o&&s.slides.length%n.grid.rows!==0,d=h=>{for(let g=0;g<h;g+=1){const v=s.isElement?Ge("swiper-slide",[n.slideBlankClass]):Ge("div",[n.slideClass,n.slideBlankClass]);s.slidesEl.append(v)}};if(u){if(n.loopAddBlankSlides){const h=l-s.slides.length%l;d(h),s.recalcSlides(),s.updateSlides()}else Gr("Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");i()}else if(c){if(n.loopAddBlankSlides){const h=n.grid.rows-s.slides.length%n.grid.rows;d(h),s.recalcSlides(),s.updateSlides()}else Gr("Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");i()}else i();const f=n.centeredSlides||!!n.slidesOffsetBefore||!!n.slidesOffsetAfter;s.loopFix({slideRealIndex:e,direction:f?void 0:"next",initial:t})}function Ho(){var a;const e=this,{params:t,slidesEl:s}=e;if(!t.loop||!s||e.virtual&&((a=e.params.virtual)!=null&&a.enabled))return;e.recalcSlides();const n=[];e.slides.forEach(i=>{const r=i,o=typeof r.swiperSlideIndex>"u"?Number(i.getAttribute("data-swiper-slide-index")):r.swiperSlideIndex;n[o]=i}),e.slides.forEach(i=>{i.removeAttribute("data-swiper-slide-index")}),n.forEach(i=>{s.append(i)}),e.recalcSlides(),e.slideTo(e.realIndex,0)}function Uo(e={}){var j,Z;const{slideRealIndex:t,slideTo:s=!0,direction:n,setTranslate:a,activeSlideIndex:i,initial:r,byController:o,byMousewheel:l}=e;let u=i;const c=this;if(!c.params.loop)return;c.emit("beforeLoopFix"),c.__loopFixInProgress__=!0;const{slides:d,allowSlidePrev:f,allowSlideNext:p,slidesEl:h,params:g}=c,{centeredSlides:v,slidesOffsetBefore:b,slidesOffsetAfter:y,initialSlide:m}=g,S=v||!!b||!!y;if(c.allowSlidePrev=!0,c.allowSlideNext=!0,c.virtual&&((j=g.virtual)!=null&&j.enabled)){if(s){const Q=c.virtual.slides.length,se=c.virtual.slidesBefore??0;!S&&c.snapIndex===0?c.slideTo(Q,0,!1,!0):S&&c.snapIndex<g.slidesPerView?c.slideTo(Q+c.snapIndex,0,!1,!0):c.snapIndex===c.snapGrid.length-1&&c.slideTo(se,0,!1,!0)}c.allowSlidePrev=f,c.allowSlideNext=p,c.__loopFixInProgress__=!1,c.emit("loopFix");return}let k=g.slidesPerView;k==="auto"?k=c.slidesPerViewDynamic():(k=Math.ceil(parseFloat(String(g.slidesPerView))),S&&k%2===0&&(k=k+1));const C=g.slidesPerGroupAuto?k:g.slidesPerGroup,L=Q=>(typeof Q=="function"?Q.call(c):Q)||0,_=c.slidesGrid.length>1?(c.slidesGrid[c.slidesGrid.length-1]-c.slidesGrid[0])/(c.slidesGrid.length-1):c.size,E=_>0?L(b)/_:0,q=_>0?L(y)/_:0;let A=S?Math.max(C,(v?Math.ceil(k/2):0)+Math.ceil(Math.max(E,q))):C;A%C!==0&&(A+=C-A%C),A+=g.loopAdditionalSlides,c.loopedSlides=A;const R=c.grid&&g.grid&&g.grid.rows>1;d.length<k+A||c.params.effect==="cards"&&d.length<k+A*2?Gr("Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled or not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters"):R&&g.grid.fill==="row"&&Gr("Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`");const T=[],P=[],z=R?Math.ceil(d.length/g.grid.rows):d.length,V=r&&z-m<k&&!S;let G=V?m:c.activeIndex;typeof u>"u"?u=c.getSlideIndex(d.find(Q=>Q.classList.contains(g.slideActiveClass))):G=u;const X=n==="next"||!n,$=n==="prev"||!n;let K=0,Y=0;const H=(R?d[u].column??0:u)+(S&&typeof a>"u"?(v?-k/2+.5:0)-E:0);if(H<A){K=Math.max(A-H,C);for(let Q=0;Q<A-H;Q+=1){const se=Q-Math.floor(Q/z)*z;if(R){const de=z-se-1;for(let x=d.length-1;x>=0;x-=1)d[x].column===de&&T.push(x)}else T.push(z-se-1)}}else if(H+k>z-A){Y=Math.max(H-(z-A*2),C),V&&(Y=Math.max(Y,k-z+m+1));for(let Q=0;Q<Y;Q+=1){const se=Q-Math.floor(Q/z)*z;R?d.forEach((de,x)=>{de.column===se&&P.push(x)}):P.push(se)}}if(c.__preventObserver__=!0,requestAnimationFrame(()=>{c.__preventObserver__=!1}),c.params.effect==="cards"&&d.length<k+A*2&&(P.includes(u)&&P.splice(P.indexOf(u),1),T.includes(u)&&T.splice(T.indexOf(u),1)),$&&T.forEach(Q=>{const se=d[Q];se.swiperLoopMoveDOM=!0,h.prepend(se),se.swiperLoopMoveDOM=!1}),X&&P.forEach(Q=>{const se=d[Q];se.swiperLoopMoveDOM=!0,h.append(se),se.swiperLoopMoveDOM=!1}),c.recalcSlides(),g.slidesPerView==="auto"?c.updateSlides():R&&(T.length>0&&$||P.length>
160&&X)&&c.slides.forEach((Q,se)=>{c.grid.updateSlide(se,Q,c.slides)}),g.watchSlidesProgress&&c.updateSlidesOffset(),s){if(T.length>0&&$){if(typeof t>"u"){const Q=c.slidesGrid[G],de=c.slidesGrid[G+K]-Q;l?c.setTranslate(c.translate-de):(c.slideTo(G+Math.ceil(K),0,!1,!0),a&&(c.touchEventsData.startTranslate=c.touchEventsData.startTranslate-de,c.touchEventsData.currentTranslate=c.touchEventsData.currentTranslate-de))}else if(a){const Q=R?T.length/g.grid.rows:T.length;c.slideTo(c.activeIndex+Q,0,!1,!0),c.touchEventsData.currentTranslate=c.translate}}else if(P.length>0&&X)if(typeof t>"u"){const Q=c.slidesGrid[G],de=c.slidesGrid[G-Y]-Q;l?c.setTranslate(c.translate-de):(c.slideTo(G-Y,0,!1,!0),a&&(c.touchEventsData.startTranslate=c.touchEventsData.startTranslate-de,c.touchEventsData.currentTranslate=c.touchEventsData.currentTranslate-de))}else{const Q=R?P.length/g.grid.rows:P.length;c.slideTo(c.activeIndex-Q,0,!1,!0)}}c.allowSlidePrev=f,c.allowSlideNext=p;const N=(Z=c.controller)==null?void 0:Z.control;if(N&&!o){const Q={slideRealIndex:t,direction:n,setTranslate:a,activeSlideIndex:u,byController:!0};Array.isArray(N)?N.forEach(se=>{!se.destroyed&&se.params.loop&&se.loopFix({...Q,slideTo:se.params.slidesPerView===g.slidesPerView?s:!1})}):N instanceof c.constructor&&N.params.loop&&N.loopFix({...Q,slideTo:N.params.slidesPerView===g.slidesPerView?s:!1})}c.__loopFixInProgress__=!1,c.emit("loopFix")}var qo={loopCreate:Bo,loopFix:Uo,loopDestroy:Ho};function Vo(e,t){return function(n={}){const a=Object.keys(n)[0],i=n[a];if(typeof i!="object"||i===null){He(t,n);return}if(e[a]===!0&&(e[a]={enabled:!0}),a==="navigation"&&e[a]&&e[a].enabled&&!e[a].prevEl&&!e[a].nextEl&&(e[a].auto=!0),["pagination","scrollbar"].indexOf(a)>=0&&e[a]&&e[a].enabled&&!e[a].el&&(e[a].auto=!0),!(a in e&&"enabled"in i)){He(t,n);return}typeof e[a]=="object"&&!("enabled"in e[a])&&(e[a].enabled=!0),e[a]||(e[a]={enabled:!1}),He(t,n)}}const Go=({swiper:e,extendParams:t,on:s})=>{const n=[],a=(o,l={})=>{const u=window.MutationObserver||window.WebkitMutationObserver;if(!u)return;const c=new u(d=>{if(e.__preventObserver__)return;if(d.length===1){e.emit("observerUpdate",d[0]);return}const f=function(){e.emit("observerUpdate",d[0])};window.requestAnimationFrame?window.requestAnimationFrame(f):window.setTimeout(f,0)});c.observe(o,{attributes:typeof l.attributes>"u"?!0:l.attributes,childList:e.isElement||(typeof l.childList>"u"?!0:l.childList),characterData:typeof l.characterData>"u"?!0:l.characterData}),n.push(c)},i=()=>{if(e.params.observer){if(e.params.observeParents){const o=Dt(e.hostEl);for(let l=0;l<o.length;l+=1)a(o[l])}a(e.hostEl,{childList:e.params.observeSlideChildren}),a(e.wrapperEl,{attributes:!1})}},r=()=>{n.forEach(o=>{o.disconnect()}),n.splice(0,n.length)};t({observer:!1,observeParents:!1,observeSlideChildren:!1}),s("init",i),s("destroy",r)},Wo=({swiper:e,on:t,emit:s})=>{let n=null,a=null;const i=()=>{!e||e.destroyed||!e.initialized||(s("beforeResize"),s("resize"))},r=()=>{!e||e.destroyed||!e.initialized||(n=new ResizeObserver(u=>{a=window.requestAnimationFrame(()=>{const{width:c,height:d}=e;let f=c,p=d;u.forEach(({contentBoxSize:h,contentRect:g,target:v})=>{if(v&&v!==e.el)return;const b=Array.isArray(h)?h[0]:h;f=g?g.width:b.inlineSize,p=g?g.height:b.blockSize}),(f!==c||p!==d)&&i()})}),n.observe(e.el))},o=()=>{a&&window.cancelAnimationFrame(a),n&&n.unobserve&&e.el&&(n.unobserve(e.el),n=null)},l=()=>{!e||e.destroyed||!e.initialized||s("orientationchange")};t("init",()=>{if(e.params.resizeObserver&&typeof window.ResizeObserver<"u"){r();return}window.addEventListener("resize",i),window.addEventListener("orientationchange",l)}),t("destroy",()=>{o(),window.removeEventListener("resize",i),window.removeEventListener("orientationchange",l)})};function Ko(e,t=!0,s){var c;const n=this,{enabled:a,params:i,animating:r}=n;if(!a||n.destroyed)return n;typeof e>"u"&&(e=n.params.speed);let o=i.slidesPerGroup;i.slidesPerView==="auto"&&i.slidesPerGroup===1&&i.slidesPerGroupAuto&&(o=Math.max(n.slidesPerViewDynamic("current",!0),1));const l=n.activeIndex<i.slidesPerGroupSkip?1:o,u=n.virtual&&((c=i.virtual)==null?void 0:c.enabled);if(i.loop){if(r&&!u&&i.loopPreventsSliding)return!1;if(n.loopFix({direction:"next"}),n._clientLeft=n.wrapperEl.clientLeft,n.activeIndex===n.slides.length-1&&i.cssMode)return requestAnimationFrame(()=>{n.slideTo(n.activeIndex+l,e,t,s)}),!0}return i.rewind&&n.isEnd?n.slideTo(0,e,t,s):n.slideTo(n.activeIndex+l,e,t,s)}function Xo(e,t=!0,s){var y,m;const n=this,{params:a,snapGrid:i,slidesGrid:r,rtlTranslate:o,enabled:l,animating:u}=n;if(!l||n.destroyed)return n;typeof e>"u"&&(e=n.params.speed);const c=n.virtual&&((y=a.virtual)==null?void 0:y.enabled);if(a.loop){if(u&&!c&&a.loopPreventsSliding)return!1;n.loopFix({direction:"prev"}),n._clientLeft=n.wrapperEl.clientLeft}const d=o?n.translate:-n.translate;function f(S){return S<0?-Math.floor(Math.abs(S)):Math.floor(S)}const p=f(d),h=i.map(S=>f(S)),g=a.freeMode&&a.freeMode.enabled;let v=i[h.indexOf(p)-1];if(typeof v>"u"&&(a.cssMode||g)){let S;
16i.forEach((k,C)=>{p>=k&&(S=C)}),typeof S<"u"&&(v=g?i[S]:i[S>0?S-1:S])}let b=0;if(typeof v<"u"&&(b=r.indexOf(v),b<0&&(b=n.activeIndex-1),a.slidesPerView==="auto"&&a.slidesPerGroup===1&&a.slidesPerGroupAuto&&(b=b-n.slidesPerViewDynamic("previous",!0)+1,b=Math.max(b,0))),a.rewind&&n.isBeginning){const S=(m=n.params.virtual)!=null&&m.enabled&&n.virtual?n.virtual.slides.length-1:n.slides.length-1;return n.slideTo(S,e,t,s)}else if(a.loop&&n.activeIndex===0&&a.cssMode)return requestAnimationFrame(()=>{n.slideTo(b,e,t,s)}),!0;return n.slideTo(b,e,t,s)}function Yo(e,t=!0,s){const n=this;if(!n.destroyed)return typeof e>"u"&&(e=n.params.speed),n.slideTo(n.activeIndex,e,t,s)}function Jo(e=0,t,s=!0,n,a){var L;typeof e=="string"&&(e=parseInt(e,10));const i=this;let r=e;r<0&&(r=0);const{params:o,snapGrid:l,slidesGrid:u,previousIndex:c,activeIndex:d,rtlTranslate:f,wrapperEl:p,enabled:h}=i;if(!h&&!n&&!a||i.destroyed||i.animating&&o.preventInteractionOnTransition)return!1;typeof t>"u"&&(t=i.params.speed);const g=Math.min(i.params.slidesPerGroupSkip,r);let v=g+Math.floor((r-g)/i.params.slidesPerGroup);v>=l.length&&(v=l.length-1);const b=-l[v];if(o.normalizeSlideIndex)for(let _=0;_<u.length;_+=1){const E=-Math.floor(b*100),q=Math.floor(u[_]*100),A=Math.floor(u[_+1]*100);typeof u[_+1]<"u"?E>=q&&E<A-(A-q)/2?r=_:E>=q&&E<A&&(r=_+1):E>=q&&(r=_)}if(i.initialized&&r!==d&&(!i.allowSlideNext&&(f?b>i.translate&&b>i.minTranslate():b<i.translate&&b<i.minTranslate())||!i.allowSlidePrev&&b>i.translate&&b>i.maxTranslate()&&(d||0)!==r))return!1;r!==(c||0)&&s&&i.emit("beforeSlideChangeStart"),i.updateProgress(b);let y;r>d?y="next":r<d?y="prev":y="reset";const m=i.virtual&&((L=i.params.virtual)==null?void 0:L.enabled);if(!(m&&a)&&(f&&-b===i.translate||!f&&b===i.translate))return i.updateActiveIndex(r),o.autoHeight&&i.updateAutoHeight(),i.updateSlidesClasses(),o.effect!=="slide"&&i.setTranslate(b),y!=="reset"&&(i.transitionStart(s,y),i.transitionEnd(s,y)),!1;if(o.cssMode){const _=i.isHorizontal(),E=f?b:-b;return t===0?(m&&(i.wrapperEl.style.scrollSnapType="none",i._immediateVirtual=!0),m&&!i._cssModeVirtualInitialSet&&(i.params.initialSlide??0)>0?(i._cssModeVirtualInitialSet=!0,requestAnimationFrame(()=>{p[_?"scrollLeft":"scrollTop"]=E})):p[_?"scrollLeft":"scrollTop"]=E,m&&requestAnimationFrame(()=>{i.wrapperEl.style.scrollSnapType="",i._immediateVirtual=!1})):p.scrollTo({[_?"left":"top"]:E,behavior:"smooth"}),!0}const C=ui().isSafari;return m&&!a&&C&&i.isElement&&i.virtual.update(!1,!1,r),i.setTransition(t),i.setTranslate(b),i.updateActiveIndex(r),i.updateSlidesClasses(),i.emit("beforeTransitionStart",t,n),i.transitionStart(s,y),t===0?i.transitionEnd(s,y):i.animating||(i.animating=!0,i.onSlideToWrapperTransitionEnd||(i.onSlideToWrapperTransitionEnd=function(E){!i||i.destroyed||E.target===this&&(i.wrapperEl.removeEventListener("transitionend",i.onSlideToWrapperTransitionEnd),i.onSlideToWrapperTransitionEnd=null,delete i.onSlideToWrapperTransitionEnd,i.transitionEnd(s,y))}),i.wrapperEl.addEventListener("transitionend",i.onSlideToWrapperTransitionEnd)),!0}function Qo(){const e=this;if(e.destroyed)return;const{params:t,slidesEl:s,clickedSlide:n,clickedIndex:a}=e;if(n===void 0||a===void 0)return;const i=t.slidesPerView==="auto"?e.slidesPerViewDynamic():t.slidesPerView;let r=e.getSlideIndexWhenGrid(a),o;const l=e.isElement?"swiper-slide":`.${t.slideClass}`,u=e.grid&&e.params.grid&&e.params.grid.rows>1;if(t.loop){if(e.animating)return;o=parseInt(n.getAttribute("data-swiper-slide-index"),10),t.centeredSlides?e.slideToLoop(o):r>(u?(e.slides.length-i)/2-(e.params.grid.rows-1):e.slides.length-i)?(e.loopFix(),r=e.getSlideIndex(Ae(s,`${l}[data-swiper-slide-index="${o}"]`)[0]),Jt(()=>{e.slideTo(r)})):e.slideTo(r)}else e.slideTo(r)}function Zo(e,t=!0,s,n=.5){const a=this;if(a.destroyed)return;typeof e>"u"&&(e=a.params.speed);let i=a.activeIndex;const r=Math.min(a.params.slidesPerGroupSkip,i),o=r+Math.floor((i-r)/a.params.slidesPerGroup),l=a.rtlTranslate?a.translate:-a.translate;if(l>=a.snapGrid[o]){const u=a.snapGrid[o],c=a.snapGrid[o+1];l-u>(c-u)*n&&(i+=a.params.slidesPerGroup)}else{const u=a.snapGrid[o-1],c=a.snapGrid[o];l-u<=(c-u)*n&&(i-=a.params.slidesPerGroup)}return i=Math.max(i,0),i=Math.min(i,a.slidesGrid.length-1),a.slideTo(i,e,t,s)}function el(e=0,t,s=!0,n){var o;typeof e=="string"&&(e=parseInt(e,10));const a=this;if(a.destroyed)return;typeof t>"u"&&(t=a.params.speed);const i=a.grid&&a.params.grid&&a.params.grid.rows>1;let r=e;if(a.params.loop)if(a.virtual&&((o=a.params.virtual)!=null&&o.enabled))r=r+(a.virtual.slidesBefore??0);else{let l;if(i){const v=r*a.params.grid.rows,b=a.slides.find(y=>Number(y.getAttribute("data-swiper-slide-index"))===v);l=(b==null?void 0:b.column)??0}else l=a.getSlideIndexByData(r);const u=i?Math.ceil(a.slides.length/a.params.grid.rows):a.slides.length,{centeredSlides:c,slidesOffsetBefore:d,slidesOffsetAfter:f}
16=a.params,p=c||!!d||!!f;let h;a.params.slidesPerView==="auto"?h=a.slidesPerViewDynamic():(h=Math.ceil(parseFloat(String(a.params.slidesPerView))),p&&h%2===0&&(h=h+1));let g=u-l<h;if(p&&(g=g||l<Math.ceil(h/2)),n&&p&&a.params.slidesPerView!=="auto"&&!i&&(g=!1),g){const v=p?l<a.activeIndex?"prev":"next":l-a.activeIndex-1<a.params.slidesPerView?"next":"prev";a.loopFix({direction:v,slideTo:!0,activeSlideIndex:v==="next"?l+1:l-u+1,slideRealIndex:v==="next"?a.realIndex:void 0})}if(i){const v=r*a.params.grid.rows,b=a.slides.find(y=>Number(y.getAttribute("data-swiper-slide-index"))===v);r=(b==null?void 0:b.column)??0}else r=a.getSlideIndexByData(r)}return requestAnimationFrame(()=>{a.slideTo(r,t,s,n)}),a}var tl={slideTo:Jo,slideToLoop:el,slideNext:Ko,slidePrev:Xo,slideReset:Yo,slideToClosest:Zo,slideToClickedSlide:Qo};function rl(e,t){const s=this;s.params.cssMode||(s.wrapperEl.style.transitionDuration=`${e}ms`,s.wrapperEl.style.transitionDelay=e===0?"0ms":""),s.emit("setTransition",e,t)}function hi({swiper:e,runCallbacks:t,direction:s,step:n}){const{activeIndex:a,previousIndex:i}=e;let r=s;r||(a>i?r="next":a<i?r="prev":r="reset"),e.emit(`transition${n}`),t&&r==="reset"?e.emit(`slideResetTransition${n}`):t&&a!==i&&(e.emit(`slideChangeTransition${n}`),r==="next"?e.emit(`slideNextTransition${n}`):e.emit(`slidePrevTransition${n}`))}function sl(e=!0,t){const s=this,{params:n}=s;s.animating=!1,!n.cssMode&&(s.setTransition(0),hi({swiper:s,runCallbacks:e,direction:t,step:"End"}))}function nl(e=!0,t){const s=this,{params:n}=s;n.cssMode||(n.autoHeight&&s.updateAutoHeight(),hi({swiper:s,runCallbacks:e,direction:t,step:"Start"}))}var il={setTransition:rl,transitionStart:nl,transitionEnd:sl};function al(e=this.isHorizontal()?"x":"y"){const t=this,{params:s,rtlTranslate:n,translate:a,wrapperEl:i}=t;if(s.virtualTranslate)return n?-a:a;if(s.cssMode)return a;let r=Ps(i,e);return r+=t.cssOverflowAdjustment(),n&&(r=-r),r||0}function ol(){return-this.snapGrid[this.snapGrid.length-1]}function ll(){return-this.snapGrid[0]}function ul(e,t){const s=this,{rtlTranslate:n,params:a,wrapperEl:i,progress:r}=s;let o=0,l=0;const u=0;s.isHorizontal()?o=n?-e:e:l=e,a.roundLengths&&(o=Math.floor(o),l=Math.floor(l)),s.previousTranslate=s.translate,s.translate=s.isHorizontal()?o:l,a.cssMode?i[s.isHorizontal()?"scrollLeft":"scrollTop"]=s.isHorizontal()?-o:-l:a.virtualTranslate||(s.isHorizontal()?o-=s.cssOverflowAdjustment():l-=s.cssOverflowAdjustment(),i.style.transform=`translate3d(${o}px, ${l}px, ${u}px)`);let c;const d=s.maxTranslate()-s.minTranslate();d===0?c=0:c=(e-s.minTranslate())/d,c!==r&&s.updateProgress(e),s.emit("setTranslate",s.translate,t)}function cl(e=0,t=this.params.speed,s=!0,n=!0,a){const i=this,{params:r,wrapperEl:o}=i;if(i.animating&&r.preventInteractionOnTransition)return!1;const l=i.minTranslate(),u=i.maxTranslate();let c;if(n&&e>l?c=l:n&&e<u?c=u:c=e,i.updateProgress(c),r.cssMode){const d=i.isHorizontal();return t===0?o[d?"scrollLeft":"scrollTop"]=-c:o.scrollTo({[d?"left":"top"]:-c,behavior:"smooth"}),!0}return t===0?(i.setTransition(0),i.setTranslate(c),s&&(i.emit("beforeTransitionStart",t,a),i.emit("transitionEnd"))):(i.setTransition(t),i.setTranslate(c),s&&(i.emit("beforeTransitionStart",t,a),i.emit("transitionStart")),i.animating||(i.animating=!0,i.onTranslateToWrapperTransitionEnd||(i.onTranslateToWrapperTransitionEnd=function(f){!i||i.destroyed||f.target===this&&(i.wrapperEl.removeEventListener("transitionend",i.onTranslateToWrapperTransitionEnd),i.onTranslateToWrapperTransitionEnd=null,delete i.onTranslateToWrapperTransitionEnd,i.animating=!1,s&&i.emit("transitionEnd"))}),i.wrapperEl.addEventListener("transitionend",i.onTranslateToWrapperTransitionEnd))),!0}var dl={getTranslate:al,setTranslate:ul,minTranslate:ll,maxTranslate:ol,translateTo:cl};function hl(e){const{slidesGrid:t,params:s}=e,n=e.rtlTranslate?e.translate:-e.translate;let a;for(let i=0;i<t.length;i+=1)typeof t[i+1]<"u"?n>=t[i]&&n<t[i+1]-(t[i+1]-t[i])/2?a=i:n>=t[i]&&n<t[i+1]&&(a=i+1):n>=t[i]&&(a=i);return s.normalizeSlideIndex&&(a<0||typeof a>"u")&&(a=0),a}function fl(e){var p,h;const t=this,s=t.rtlTranslate?t.translate:-t.translate,{snapGrid:n,params:a,activeIndex:i,realIndex:r,snapIndex:o}=t;let l=e,u;const c=g=>{const v=t.virtual.slides;let b=g-(t.virtual.slidesBefore??0);return b<0&&(b=v.length+b),b>=v.length&&(b-=v.length),b};if(typeof l>"u"&&(l=hl(t)),n.indexOf(s)>=0)u=n.indexOf(s);else{const g=Math.min(a.slidesPerGroupSkip,l);u=g+Math.floor((l-g)/a.slidesPerGroup)}if(u>=n.length&&(u=n.length-1),l===i&&!t.params.loop){u!==o&&(t.snapIndex=u,t.emit("snapIndexChange"));return}if(l===i&&t.params.loop&&t.virtual&&((p=t.params.virtual)!=null&&p.enabled)){t.realIndex=c(l);return}const d=t.grid&&a.grid&&a.grid.rows>1;let f;if(t.virtual&&((h=a.virtual)!=null&&h.enabled))a.loop?f=c(l):f=l;else if(d){const g=t.slides.find(b=>b.column===l);let v=parseInt(g.getAttribute("data-swiper-slide-index"),10);Number.isNaN(v)&&(v=Math.max(t.slides.indexOf(g),0)),f=Math.floor(v/a.grid.rows)}else if(t.slides[l]){const g=t.slides[l].getAttribute("data-swiper-slide-index");g?f=parseInt(g,10):f=l}else f=l;Object.assign(t,{previousSnapIndex:o,snapIndex:u,previousRealIndex:r,realIndex:f,previousIndex:i,activeIndex:l}),t.initialized&&ci(t),!t.__loopFixInProgress__&&(t.emit("activeIndexChange"),t.emit("snapIndexChange"),(t.initialized||t.params.runCallbacksOnInit)&&((t.__lastEmittedRealIndex__??r)!==f&&t.emit("realIndexChange"),t.emit("slideChange")),t.__lastEmittedRealIndex__=f)}function pl(e){var o;const t=this,s=[],n=t.virtual&&((o=t.params.virtual)==null?void 0:o.enabled);let a=0,i;typeof e=="number"?t.setTransition(e):e===!0&&t.setTransition(t.params.speed);const r=l=>n?t.slides[t.getSlideIndexByData(l)]:t.slides[l];if(t.params.slidesPerView!=="auto"&&t.params.slidesPerView>
161)if(t.params.centeredSlides)(t.visibleSlides||[]).forEach(l=>{s.push(l)});else for(i=0;i<Math.ceil(t.params.slidesPerView);i+=1){const l=t.activeIndex+i;if(l>t.slides.length&&!n)break;const u=r(l);u&&s.push(u)}else{const l=r(t.activeIndex);l&&s.push(l)}for(i=0;i<s.length;i+=1)if(typeof s[i]<"u"){const l=s[i].offsetHeight;a=l>a?l:a}(a||a===0)&&(t.wrapperEl.style.height=`${a}px`)}function gl(e,t){var o;const s=this,n=s.params;let a=e.closest(`.${n.slideClass}, swiper-slide`);!a&&s.isElement&&t&&t.length>1&&t.includes(e)&&[...t.slice(t.indexOf(e)+1,t.length)].forEach(l=>{!a&&l.matches&&l.matches(`.${n.slideClass}, swiper-slide`)&&(a=l)});let i=!1,r;if(a){for(let l=0;l<s.slides.length;l+=1)if(s.slides[l]===a){i=!0,r=l;break}}if(a&&i)s.clickedSlide=a,s.virtual&&((o=s.params.virtual)!=null&&o.enabled)?s.clickedIndex=parseInt(a.getAttribute("data-swiper-slide-index"),10):s.clickedIndex=r;else{s.clickedSlide=void 0,s.clickedIndex=void 0;return}n.slideToClickedSlide&&s.clickedIndex!==void 0&&s.clickedIndex!==s.activeIndex&&s.slideToClickedSlide()}function ml(e){const t=this;if(typeof e>"u"){const c=t.rtlTranslate?-1:1;e=t&&t.translate&&t.translate*c||0}const s=t.params,n=t.maxTranslate()-t.minTranslate();let{progress:a,isBeginning:i,isEnd:r}=t,o=t.progressLoop;const l=i,u=r;if(n===0)a=0,i=!0,r=!0;else{a=(e-t.minTranslate())/n;const c=Math.abs(e-t.minTranslate())<1,d=Math.abs(e-t.maxTranslate())<1;i=c||a<=0,r=d||a>=1,c&&(a=0),d&&(a=1)}if(s.loop){const c=t.getSlideIndexByData(0),d=t.getSlideIndexByData(t.slides.length-1),f=t.slidesGrid[c],p=t.slidesGrid[d],h=t.slidesGrid[t.slidesGrid.length-1],g=Math.abs(e);g>=f?o=(g-f)/h:o=(g+h-p)/h,o>1&&(o-=1)}Object.assign(t,{progress:a,progressLoop:o,isBeginning:i,isEnd:r}),(s.watchSlidesProgress||s.centeredSlides&&s.autoHeight)&&t.updateSlidesProgress(e),i&&
16!l&&t.emit("reachBeginning toEdge"),r&&!u&&t.emit("reachEnd toEdge"),(l&&!i||u&&!r)&&t.emit("fromEdge"),t.emit("progress",a)}function vl(){const e=this;let t,s;const n=e.el;typeof e.params.width<"u"&&e.params.width!==null?t=e.params.width:t=n.clientWidth,typeof e.params.height<"u"&&e.params.height!==null?s=e.params.height:s=n.clientHeight,!(t===0&&e.isHorizontal()||s===0&&e.isVertical())&&(t=t-parseInt(yt(n,"padding-left")||"0",10)-parseInt(yt(n,"padding-right")||"0",10),s=s-parseInt(yt(n,"padding-top")||"0",10)-parseInt(yt(n,"padding-bottom")||"0",10),Number.isNaN(t)&&(t=0),Number.isNaN(s)&&(s=0),Object.assign(e,{width:t,height:s,size:e.isHorizontal()?t:s}))}function yl(){var A,R;const e=this;function t(T,P){return parseFloat(T.getPropertyValue(e.getDirectionLabel(P))||"0")}const s=e.params,{wrapperEl:n,slidesEl:a,rtlTranslate:i,wrongRTL:r}=e,o=!!(e.virtual&&((A=s.virtual)!=null&&A.enabled)),l=o?e.virtual.slides.length:e.slides.length,u=Ae(a,`.${e.params.slideClass}, swiper-slide`),c=o?e.virtual.slides.length:u.length;let d=[];const f=[],p=[],h=T=>typeof T=="function"?T.call(e):T,g=h(s.slidesOffsetBefore),v=h(s.slidesOffsetAfter),b=e.snapGrid.length,y=e.slidesGrid.length,m=e.size-g-v;let S=s.spaceBetween,k=-g,C=0,L=0;if(typeof m>"u")return;typeof S=="string"&&S.indexOf("%")>=0?S=parseFloat(S.replace("%",""))/100*m:typeof S=="string"&&(S=parseFloat(S)),e.virtualSize=-S-g-v,u.forEach(T=>{i?T.style.marginLeft="":T.style.marginRight="",T.style.marginBottom="",T.style.marginTop=""}),s.centeredSlides&&s.cssMode&&(Rt(n,"--swiper-centered-offset-before",""),Rt(n,"--swiper-centered-offset-after","")),s.cssMode&&(Rt(n,"--swiper-slides-offset-before",`${g}px`),Rt(n,"--swiper-slides-offset-after",`${v}px`));const _=s.grid&&s.grid.rows>1&&e.grid;_?e.grid.initSlides(u):e.grid&&e.grid.unsetSlides();let E=0;const q=s.slidesPerView==="auto"&&s.breakpoints&&Object.keys(s.breakpoints).filter(T=>{const P=s.breakpoints[T];return typeof(P==null?void 0:P.slidesPerView)<"u"}).length>0;for(let T=0;T<c;T+=1){E=0;const P=u[T];if(!(P&&(_&&e.grid.updateSlide(T,P,u),yt(P,"display")==="none"))){if(o&&s.slidesPerView==="auto")(R=s.virtual)!=null&&R.slidesPerViewAutoSlideSize&&(E=s.virtual.slidesPerViewAutoSlideSize),E&&P&&(s.roundLengths&&(E=Math.floor(E)),P.style[e.getDirectionLabel("width")]=`${E}px`);else if(s.slidesPerView==="auto"){q&&(P.style[e.getDirectionLabel("width")]="");const z=getComputedStyle(P),V=P.style.transform,G=P.style.webkitTransform;if(V&&(P.style.transform="none"),G&&(P.style.webkitTransform="none"),s.roun
16dLengths)E=e.isHorizontal()?Os(P,"width"):Os(P,"height");else{const X=t(z,"width"),$=t(z,"padding-left"),K=t(z,"padding-right"),Y=t(z,"margin-left"),I=t(z,"margin-right"),H=z.getPropertyValue("box-sizing");if(H&&H==="border-box")E=X+Y+I;else{const{clientWidth:N,offsetWidth:j}=P;E=X+$+K+Y+I+(j-N)}}V&&(P.style.transform=V),G&&(P.style.webkitTransform=G),s.roundLengths&&(E=Math.floor(E))}else E=(m-(s.slidesPerView-1)*S)/s.slidesPerView,s.roundLengths&&(E=Math.floor(E)),P&&(P.style[e.getDirectionLabel("width")]=`${E}px`);P&&(P.swiperSlideSize=E),p.push(E),s.centeredSlides?(k=k+E/2+C/2+S,C===0&&T!==0&&(k=k-m/2-S),T===0&&(k=k-m/2-S),Math.abs(k)<1/1e3&&(k=0),s.roundLengths&&(k=Math.floor(k)),L%s.slidesPerGroup===0&&d.push(k),f.push(k)):(s.roundLengths&&(k=Math.floor(k)),(L-Math.min(e.params.slidesPerGroupSkip,L))%e.params.slidesPerGroup===0&&d.push(k),f.push(k),k=k+E+S),e.virtualSize+=E+S,C=E,L+=1}}if(e.virtualSize=Math.max(e.virtualSize,m)+v,i&&r&&(s.effect==="slide"||s.effect==="coverflow")&&(n.style.width=`${e.virtualSize+S}px`),s.setWrapperSize&&(n.style[e.getDirectionLabel("width")]=`${e.virtualSize+S}px`),_&&e.grid.updateWrapperSize(E,d),!s.centeredSlides){const T=s.slidesPerView!=="auto"&&s.slidesPerView%1!==0,P=s.snapToSlideEdge&&!s.loop&&(s.slidesPerView==="auto"||T);let z=d.length;if(P){let G;if(s.slidesPerView==="auto"){G=1;let X=0;for(let $=p.length-1;$>=0&&(X+=p[$]+($<p.length-1?S:0),X<=m);$-=1)G=p.length-$}else G=Math.floor(s.slidesPerView);z=Math.max(c-G,0)}const V=[];for(let G=0;G<d.length;G+=1){let X=d[G];s.roundLengths&&(X=Math.floor(X)),P?G<=z&&V.push(X):d[G]<=e.virtualSize-m&&V.push(X)}d=V,Math.floor(e.virtualSize-m)-Math.floor(d[d.length-1])>1&&(P||d.push(e.virtualSize-m))}if(o&&s.loop){const T=p[0]+S,P=e.virtual.slidesBefore??0,z=e.virtual.slidesAfter??0,V=P+z;if(s.slidesPerGroup>1){const G=Math.ceil(V/s.slidesPerGroup),X=T*s.slidesPerGroup;for(let $=0;$<G;$+=1)d.push(d[d.length-1]+X)}for(let G=0;G<V;G+=1)s.slidesPerGroup===1&&d.push(d[d.length-1]+T),f.push(f[f.length-1]+T),e.virtualSize+=T}if(d.length===0&&(d=[0]),S!==0){const T=e.isHorizontal()&&i?"marginLeft":e.getDirectionLabel("marginRight");u.filter((P,z)=>!s.cssMode||s.loop?!0:z!==u.length-1).forEach(P=>{P.style[T]=`${S}px`})}if(s.centeredSlides&&s.centeredSlidesBounds){let T=0;p.forEach(z=>{T+=z+(S||0)}),T-=S;const P=T>m?T-m:0;d=d.map(z=>z<=0?-g:z>P?P+v:z)}if(s.centerInsufficientSlides){let T=0;if(p.forEach(P=>{T+=P+(S||0)}),T-=S,T<m){const P=(m-T)/2;d.forEach((z,V)=>{d[V]=z-P}),f.forEach((z,V)=>{f[V]=z+P})}}if(Object.assign(e,{slides:u,snapGrid:d,slidesGrid:f,slidesSizesGrid:p}),s.centeredSlides&&s.cssMode&&!s.centeredSlidesBounds){Rt(n,"--swiper-centered-offset-before",`${-d[0]}px`),Rt(n,"--swiper-centered-offset-after",`${e.size/2-p[p.length-1]/2}px`);const T=-e.snapGrid[0],P=-e.slidesGrid[0];e.snapGrid=e.snapGrid.map(z=>z+T),e.slidesGrid=e.slidesGrid.map(z=>z+P)}if(c!==l&&e.emit("slidesLengthChange"),d.length!==b&&(e.params.watchOverflow&&e.checkOverflow(),e.emit("snapGridLengthChange")),f.length!==y&&e.emit("slidesGridLengthChange"),s.watchSlidesProgress&&e.updateSlidesOffset(),e.emit("slidesUpdated"),!o&&!s.cssMode&&(s.effect==="slide"||s.effect==="fade")){const T=`${s.containerModifierClass}backface-hidden`,P=e.el.classList.contains(T);c<=s.maxBackfaceHiddenSlides?P||e.el.classList.add(T):P&&e.el.classList.remove(T)}}const ms=(e,t,s)=>{t&&!e.classList.contains(s)?e.classList.add(s):!t&&e.classList.contains(s)&&e.classList.remove(s)};function bl(){var d;const e=this,{slides:t,params:s,slidesEl:n,activeIndex:a}=e,i=!!(e.virtual&&((d=s.virtual)!=null&&d.enabled)),r=e.grid&&s.grid&&s.grid.rows>1,o=f=>Ae(n,`.${s.slideClass}${f}, swiper-slide${f}`)[0];let l,u,c;if(i)if(s.loop){const f=e.virtual.slides;let p=a-(e.virtual.slidesBefore??0);p<0&&(p=f.length+p),p>=f.length&&(p-=f.length),l=o(`[data-swiper-slide-index="${p}"]`)}else l=o(`[data-swiper-slide-index="${a}"]`);else r?(l=t.find(f=>f.column===a),c=t.find(f=>f.column===a+1),u=t.find(f=>f.column===a-1)):l=t[a];l&&(r||(c=ho(l,`.${s.slideClass}, swiper-slide`)[0],s.loop&&!c&&(c=t[0]),u=co(l,`.${s.slideClass}, swiper-slide`)[0],s.loop&&!u===0&&(u=t[t.length-1]))),t.forEach(f=>
16{ms(f,f===l,s.slideActiveClass),ms(f,f===c,s.slideNextClass),ms(f,f===u,s.slidePrevClass)}),e.emitSlidesClasses()}function wl(){const e=this,t=e.slides,s=e.isElement?e.isHorizontal()?e.wrapperEl.offsetLeft:e.wrapperEl.offsetTop:0;for(let n=0;n<t.length;n+=1)t[n].swiperSlideOffset=(e.isHorizontal()?t[n].offsetLeft:t[n].offsetTop)-s-e.cssOverflowAdjustment()}const wn=(e,t,s)=>{t&&!e.classList.contains(s)?e.classList.add(s):!t&&e.classList.contains(s)&&e.classList.remove(s)};function _l(e=this&&this.translate||0){const t=this,s=t.params,{slides:n,rtlTranslate:a,snapGrid:i}=t;if(n.length===0)return;typeof n[0].swiperSlideOffset>"u"&&t.updateSlidesOffset();let r=-e;a&&(r=e),t.visibleSlidesIndexes=[],t.visibleSlides=[];let o=s.spaceBetween;typeof o=="string"&&o.indexOf("%")>=0?o=parseFloat(o.replace("%",""))/100*t.size:typeof o=="string"&&(o=parseFloat(o));for(let l=0;l<n.length;l+=1){const u=n[l];let c=u.swiperSlideOffset??0;s.cssMode&&s.centeredSlides&&(c-=n[0].swiperSlideOffset??0);const d=u.swiperSlideSize??0,f=(r+(s.centeredSlides?t.minTranslate():0)-c)/(d+o),p=(r-i[0]+(s.centeredSlides?t.minTranslate():0)-c)/(d+o),h=-(r-c),g=h+t.slidesSizesGrid[l],v=h>=0&&h<=t.size-t.slidesSizesGrid[l],b=h>=0&&h<t.size-1||g>1&&g<=t.size||h<=0&&g>=t.size;b&&(t.visibleSlides.push(u),t.visibleSlidesIndexes.push(l)),wn(u,b,s.slideVisibleClass),wn(u,v,s.slideFullyVisibleClass),u.progress=a?-f:f,u.originalProgress=a?-p:p}}var Sl={updateSize:vl,updateSlides:yl,updateAutoHeight:pl,updateSlidesOffset:wl,updateSlidesProgress:_l,updateProgress:ml,updateSlidesClasses:bl,updateActiveIndex:fl,updateClickedSlide:gl};const El={eventsEmitter:To,update:Sl,translate:dl,transition:il,slide:tl,loop:qo,grabCursor:zo,events:$o,breakpoints:yo,checkOverflow:wo,classes:xo},As={},Je=class Je{constructor(...t){let s,n;if(t.length===1&&t[0]!==null&&typeof t[0]=="object"&&Object.prototype.toString.call(t[0]).slice(8,-1)==="Object"?n=t[0]:[s,n]=t,n||(n={}),n=He({},n),s&&!n.el&&(n.el=s),n.el&&typeof n.el=="string"&&typeof document<"u"&&document.querySelectorAll(n.el).length>1){const o=[];return document.querySelectorAll(n.el).forEach(l=>{const u=He({},n,{el:l});o.push(new Je(u))}),o}const a=this;a.__swiper__=!0,a.support=oi(),a.device=li({userAgent:n.userAgent??void 0}),a.browser=ui(),a.eventsListeners={},a.eventsAnyListeners=[],a.modules=[...a.__modules__||[]],n.modules&&Array.isArray(n.modules)&&n.modules.forEach(o=>{const l=o;typeof l=="function"&&a.modules.indexOf(l)<0&&a.modules.push(l)});const i={};a.modules.forEach(o=>{o({params:n,swiper:a,extendParams:Vo(n,i),on:a.on.bind(a),once:a.once.bind(a),off:a.off.bind(a),emit:a.emit.bind(a)})});const r=He({},Ks,i);if(a.params=He({},r,As,n),a.originalParams=He({},a.params),a.passedParams=He({},n),a.params&&a.params.on){const o=a.params.on;Object.keys(o).forEach(l=>{const u=o[l];u&&a.on(l,u)})}return a.params&&a.params.onAny&&a.onAny(a.params.onAny),Object.assign(a,{enabled:a.params.enabled,el:s,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal(){return a.params.direction==="horizontal"},isVertical(){return a.params.direction==="vertical"},activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:a.params.allowSlideNext,allowSlidePrev:a.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:a.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,pointerId:null,touchId:null},allowClick:!0,allowTouchMove:a.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),a.emit("_swiper"),a.params.init&&a.init(),a}getDirectionLabel(t){return this.isHorizontal()?t:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[t]}isHorizontal(){return this.params.direction==="horizontal"}isVertical(){return this.params.direction==="vertical"}cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23}getSlideIndex(t){const{slidesEl:s,params:n}=this,a=Ae(s,`.${n.slideClass}, swiper-slide`),i=wr(a[0]);return wr(t)-(i??0)}
16getSlideIndexByData(t){return this.getSlideIndex(this.slides.find(s=>Number(s.getAttribute("data-swiper-slide-index"))===t))}getSlideIndexWhenGrid(t){return this.grid&&this.params.grid&&this.params.grid.rows>1&&(this.params.grid.fill==="column"?t=Math.floor(t/this.params.grid.rows):this.params.grid.fill==="row"&&(t=t%Math.ceil(this.slides.length/this.params.grid.rows))),t}recalcSlides(){const{slidesEl:t,params:s}=this;this.slides=Ae(t,`.${s.slideClass}, swiper-slide`)}enable(){this.enabled||(this.enabled=!0,this.params.grabCursor&&this.setGrabCursor(),this.emit("enable"))}disable(){this.enabled&&(this.enabled=!1,this.params.grabCursor&&this.unsetGrabCursor(),this.emit("disable"))}setProgress(t,s){t=Math.min(Math.max(t,0),1);const n=this.minTranslate(),i=(this.maxTranslate()-n)*t+n;this.translateTo(i,typeof s>"u"?0:s),this.updateActiveIndex(),this.updateSlidesClasses()}emitContainerClasses(){if(!this.params._emitClasses||!this.el)return;const t=this.el.className.split(" ").filter(s=>s.indexOf("swiper")===0||s.indexOf(this.params.containerModifierClass)===0);this.emit("_containerClasses",t.join(" "))}getSlideClasses(t){return this.destroyed?"":t.className.split(" ").filter(s=>s.indexOf("swiper-slide")===0||s.indexOf(this.params.slideClass)===0).join(" ")}emitSlidesClasses(){if(!this.params._emitClasses||!this.el)return;const t=[];this.slides.forEach(s=>{const n=this.getSlideClasses(s);t.push({slideEl:s,classNames:n}),this.emit("_slideClass",s,n)}),this.emit("_slideClasses",t)}slidesPerViewDynamic(t="current",s=!1){const{params:n,slides:a,slidesGrid:i,slidesSizesGrid:r,size:o,activeIndex:l}=this;let u=1;if(typeof n.slidesPerView=="number")return n.slidesPerView;if(!o)return u;if(n.centeredSlides){let c=a[l]?Math.ceil(a[l].swiperSlideSize??0):0,d=!1;for(let f=l+1;f<a.length;f+=1)a[f]&&!d&&(c+=Math.ceil(a[f].swiperSlideSize??0),u+=1,c>o&&(d=!0));for(let f=l-1;f>=0;f-=1)a[f]&&!d&&(c+=a[f].swiperSlideSize??0,u+=1,c>o&&(d=!0))}else if(t==="current")for(let c=l+1;c<a.length;c+=1)(s?i[c]+r[c]-i[l]<o:i[c]-i[l]<o)&&(u+=1);else for(let c=l-1;c>=0;c-=1)i[l]-i[c]<o&&(u+=1);return u}update(){var r,o;const t=this;if(!t||t.destroyed)return;const{snapGrid:s,params:n}=t;n.breakpoints&&t.setBreakpoint(),n.lazyPreload&&[...t.el.querySelectorAll('[loading="lazy"]')].forEach(l=>{l.complete&&Ur(t,l)}),t.updateSize(),t.updateSlides(),t.updateProgress(),t.updateSlidesClasses();function a(){const l=t.rtlTranslate?t.translate*-1:t.translate,u=Math.min(Math.max(l,t.maxTranslate()),t.minTranslate());t.setTranslate(u),t.updateActiveIndex(),t.updateSlidesClasses()}let i;if((r=n.freeMode)!=null&&r.enabled&&!n.cssMode)a(),n.autoHeight&&t.updateAutoHeight();else{if((n.slidesPerView==="auto"||n.slidesPerView>1)&&t.isEnd&&!n.centeredSlides){const l=t.virtual&&((o=n.virtual)!=null&&o.enabled)?t.virtual.slides.length:t.slides.length;i=t.slideTo(l-1,0,!1,!0)}else i=t.slideTo(t.activeIndex,0,!1,!0);i||a()}n.watchOverflow&&s!==t.snapGrid&&t.checkOverflow(),t.emit("update")}changeDirection(t,s=!0){const n=this,a=n.params.direction;return t||(t=a==="horizontal"?"vertical":"horizontal"),t===a||t!=="horizontal"&&t!=="vertical"||(n.el.classList.remove(`${n.params.containerModifierClass}${a}`),n.el.classList.add(`${n.params.containerModifierClass}${t}`),n.emitContainerClasses(),n.params.direction=t,n.rtlTranslate=t==="horizontal"&&n.rtl,n.slides.forEach(i=>{t==="vertical"?i.style.width="":i.style.height=""}),n.emit("changeDirection"),s&&n.update()),n}changeLanguageDirection(t){const s=this;s.rtl&&t==="rtl"||!s.rtl&&t==="ltr"||(s.rtl=t==="rtl",s.rtlTranslate=s.params.direction==="horizontal"&&s.rtl,s.rtl?(s.el.classList.add(`${s.params.containerModifierClass}rtl`),s.el.dir="rtl"):(s.el.classList.remove(`${s.params.containerModifierClass}rtl`),s.el.dir="ltr"),s.update())}mount(t){const s=this;if(s.mounted)return!0;if(typeof document>"u")return!1;const n=t??s.params.el;let a=null;if(typeof n=="string"?a=document.querySelector(n):n instanceof HTMLElement&&(a=n),!a)return!1;a.swiper=s;const i=a.parentNode;i&&i.host&&i.host.nodeName===s.params.swiperElementNodeName.toUpperCase()&&(s.isElement=!0);const r=()=>`.${(s.params.wrapperClass||"").trim().split(" ").join(".")}`;let l=(()=>a&&a.shadowRoot?a.shadowRoot.querySelector(r()):Ae(a,r())[0])();!l&&s.params.createElements&&(l=Ge("div",s.params.wrapperClass),a.append(l),Ae(a,`.${s.params.slideClass}`).forEach(c=>{l.append(c)}));const u=s.isElement?a.parentNode.host:null;return Object.assign(s,{el:a,wrapperEl:l,slidesEl:s.isElement&&!u.slideSlots?u:l,hostEl:s.isElement?u:a,mounted:!0,rtl:a.dir.toLowerCase()==="rtl"||yt(a,"direction")==="rtl",rtlTranslate:s.params.direction==="horizontal"&&(a.dir.toLowerCase()==="rtl"||yt(a,"direction")==="rtl"),wrongRTL:yt(l,"display")==="-webkit-box"}),!0}init(t){var a;const s=this;if(s.initialized||s.mount(t)===!1)return s;if(s.emit("beforeInit"),s.params.breakpoints&&s.setBreakpoint(),s.addClasses(),s.updateSize(),s.updateSlides(),s.params.watchOverflow&&s.checkOverflow(),s.params.grabCursor&&s.enabled&&s.setGrabCursor(
16),s.params.loop&&s.virtual&&((a=s.params.virtual)!=null&&a.enabled)?s.slideTo((s.params.initialSlide??0)+(s.virtual.slidesBefore??0),0,s.params.runCallbacksOnInit,!1,!0):s.slideTo(s.params.initialSlide,0,s.params.runCallbacksOnInit,!1,!0),s.params.loop&&s.loopCreate(void 0,!0),s.attachEvents(),s.params.lazyPreload){const i=[...s.el.querySelectorAll('[loading="lazy"]')];s.isElement&&i.push(...s.hostEl.querySelectorAll('[loading="lazy"]')),i.forEach(r=>{r.complete?Ur(s,r):r.addEventListener("load",o=>{Ur(s,o.target)})})}return s.initialized=!0,ci(s),s.emit("init"),s.emit("afterInit"),s}destroy(t=!0,s=!0){const n=this,{params:a,el:i,wrapperEl:r,slides:o}=n;return typeof n.params>"u"||n.destroyed||(n.emit("beforeDestroy"),n.initialized=!1,n.detachEvents(),a.loop&&n.loopDestroy(),s&&(n.removeClasses(),i&&typeof i!="string"&&i.removeAttribute("style"),r&&r.removeAttribute("style"),o&&o.length&&o.forEach(l=>{l.classList.remove(a.slideVisibleClass,a.slideFullyVisibleClass,a.slideActiveClass,a.slideNextClass,a.slidePrevClass),l.removeAttribute("style"),l.removeAttribute("data-swiper-slide-index")})),n.emit("destroy"),Object.keys(n.eventsListeners).forEach(l=>{n.off(l)}),t!==!1&&(n.el&&typeof n.el!="string"&&(n.el.swiper=null),io(n)),n.destroyed=!0),null}static extendDefaults(t){He(As,t)}static installModule(t){Je.prototype.__modules__||(Je.prototype.__modules__=[]);const s=Je.prototype.__modules__;typeof t=="function"&&s.indexOf(t)<0&&s.push(t)}static use(t){return Array.isArray(t)?(t.forEach(s=>Je.installModule(s)),Je):(Je.installModule(t),Je)}};Oe(Je,"extendedDefaults"),Oe(Je,"defaults");let bt=Je;Object.defineProperty(bt,"extendedDefaults",{get(){return As}});Object.defineProperty(bt,"defaults",{get(){return Ks}});const _n=El,xl=bt.prototype;Object.keys(_n).forEach(e=>{const t=_n[e];Object.keys(t).forEach(s=>{xl[s]=t[s]})});bt.use([Wo,Go]);const es=["eventsPrefix","injectStyles","injectStylesUrls","modules","init","_direction","oneWayMovement","swiperElementNodeName","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_enabled","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","breakpointsBase","_spaceBetween","_slidesPerView","maxBackfaceHiddenSlides","_grid","_slidesPerGroup","_slidesPerGroupSkip","_slidesPerGroupAuto","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_snapToSlideEdge","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_loop","loopAdditionalSlides","loopAddBlankSlides","loopPreventsSliding","_rewind","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideActiveClass","slideVisibleClass","slideFullyVisibleClass","slideNextClass","slidePrevClass","slideBlankClass","wrapperClass","lazyPreload","lazyPreloaderClass","lazyPreloadPrevNext","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","_autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","creativeEffect","cardsEffect","hashNavigation","history","keyboard","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom","control"];function ke(e){if(typeof e!="object"||e===null)return!1;const t=e;return!!t.constructor&&Object.prototype.toString.call(t).slice(8,-1)==="Object"&&!t.__swiper__}function Rs(e,t){const s=e,n=t,a=Object.keys(n);for(let i=0,r=a.length;i<r;i+=1){const o=a[i];if(o==="__proto__"||o==="constructor"||o==="prototype")continue;const l=n[o],u=s[o];typeof u>"u"?s[o]=l:ke(l)&&ke(u)&&Object.keys(l).length>0?l.__swiper__?s[o]=l:Rs(u,l):s[o]=l}return e}function Tl(e={}){const t=e.navigation;return t?t===!0?!0:typeof t.nextEl>"u"&&typeof t.prevEl>"u":!1}function kl(e={}){const t=e.pagination;return t?t===!0?!0:typeof t.el>"u":!1}function Cl(e={}){const t=e.scrollbar;return t?t===!0?!0:typeof t.el>"u":!1}function qr(e=""){return e.replace(/-[a-z]/g,t=>t.toUpperCase().replace("-",""))}function Pl(e){var X,$;let{nextEl:t,prevEl:s,scrollbarEl:n,paginationEl:a}=e;const{swiper:i,slides:r,passedParams:o,changedParams:l}=e,u=l.filter(K=>K!=="children"&&K!=="direction"&&K!=="wrapperClass"),{params:c,pagination:d,navigation:f,scrollbar:p,virtual:h,thumbs:g}=i,v=o,b=c;let y,m,S,k,C,L,_,E;const q=v.thumbs,A=b.thumbs;l.includes("thumbs")&&ke(q)&&q.swiper&&!q.swiper.destroyed&&ke(A)&&(!A.swiper||A.swiper.destroyed)&&(y=!0);const R=v.controller,T=b.controller;l.includes("controller")&&ke(R)&&R.control&&ke(T)&&!T.control&&(m=!0);const P=v.pagination;l.includes("pagination")&&ke(P)&&(P.el||a)&&(b.pagination||b.pagination===!1)&&d&&!d.el&&(S=!0);const z=v.scrollbar;l.includes("scrollbar")&&ke(z)&&(z.el||n)&&(b.scrollbar||b.scrollbar===!1)&&p&&!p.el&&(k=!0);const V=v.navigation;l.includes("navigation")&&ke(V)&&(V.prevEl||s)&&(V.nextEl||t)&&(b.navigation||b.navigation===!1)&&f&&!f.prevEl&&!f.nextEl&&(C=!0);const G=K=>{var N,j,Z;const Y=i[K];if(!Y)return;Y.destroy();const I=b[K],H=ke(I)?I:void 0;K==="navigation"?(i.isElement&&((N=Y.prevEl)==null||N.remove(),(j=Y.nextEl)==null||j.remove()),H&&(H.prevEl=void 0,H.nextEl=void 0),Y.prevEl=void 0,Y.nextEl=void 0):(i.isElement&&((Z=Y.el)==null||Z.remove()),H&&(H.el=void 0),Y.el=void 0)};if(l.includes("loop")&&i.isElement&&(c.loop&&!o.loop?L=!0:!c.loop&&o.loop?_=!0:E=!0),u.forEach(K=>{const Y=b[K],I=v[K];ke(Y)&&ke(I)?(Object.assign(Y,I),(K==="navigation"||K==="pagination"||K==="scrollbar")&&"enabled"in I&&!I.enabled&&G(K)):(I===!0||I===!1)&&(K==="navigation"||K==="pagination"||K==="scrollbar")?I===!1&&G(K):b[K]=I}),u.includes("controller")&&!m&&i.controller&&i.controller.control&&ke(T)&&T.control&&(i.controller.control=T.control),l.includes("children")&&r&&h&&((X=c.virtual)!=null&&X.enabled)?(h.slides=r,h.update(!0)):l.includes("virtual")&&h&&(($=c.virtual)!=null&&$.enabled)&&(r&&(h.slides=r),h.update(!0)),l.includes("children")&&r&&c.loop&&(E=!0),y&&g&&g.init()&&g.update(!0),m&&i.controller&&ke(T)&&(i.controller.control=T.control),S&&d){if(i.isElement&&(!a||typeof a=="str
16ing")){const Y=document.createElement("div");Y.classList.add("swiper-pagination"),Y.part.add("pagination"),i.el.appendChild(Y),a=Y}const K=b.pagination;a&&ke(K)&&(K.el=a),d.init(),d.render(),d.update()}if(k&&p){if(i.isElement&&(!n||typeof n=="string")){const Y=document.createElement("div");Y.classList.add("swiper-scrollbar"),Y.part.add("scrollbar"),i.el.appendChild(Y),n=Y}const K=b.scrollbar;n&&ke(K)&&(K.el=n),p.init(),p.updateSize(),p.setTranslate()}if(C&&f){if(i.isElement){if(!t||typeof t=="string"){const Y=document.createElement("div");Y.classList.add("swiper-button-next"),We(Y,f.arrowSvg),Y.part.add("button-next"),i.el.appendChild(Y),t=Y}if(!s||typeof s=="string"){const Y=document.createElement("div");Y.classList.add("swiper-button-prev"),We(Y,f.arrowSvg),Y.part.add("button-prev"),i.el.appendChild(Y),s=Y}}const K=b.navigation;t&&ke(K)&&(K.nextEl=t),s&&ke(K)&&(K.prevEl=s),f.init(),f.update()}l.includes("allowSlideNext")&&(i.allowSlideNext=v.allowSlideNext),l.includes("allowSlidePrev")&&(i.allowSlidePrev=v.allowSlidePrev),l.includes("direction")&&i.changeDirection(v.direction,!1),(L||E)&&i.loopDestroy(),(_||E)&&i.loopCreate(),i.update()}const Sn=e=>{if(typeof e!="string")return e==null||typeof e=="number"||typeof e=="boolean"||ke(e),e;if(parseFloat(e)===Number(e))return Number(e);if(e==="true"||e==="")return!0;if(e==="false")return!1;if(e==="null")return null;if(e!=="undefined"){if(e.includes("{")&&e.includes("}")&&e.includes('"'))try{return JSON.parse(e)}catch{return e}return e}},En=["a11y","autoplay","controller","cards-effect","coverflow-effect","creative-effect","cube-effect","fade-effect","flip-effect","free-mode","grid","hash-navigation","history","keyboard","mousewheel","navigation","pagination","parallax","scrollbar","thumbs","virtual","zoom"];function xn(e,t,s){const n={},a={};Rs(n,Ks);const i=[...es,"on"],r=i.map(l=>l.replace(/_/,""));i.forEach(l=>{const u=l.replace("_","");typeof e[u]<"u"&&(a[u]=e[u])});const o=[...e.attributes];return typeof t=="string"&&typeof s<"u"&&o.push({name:t,value:ke(s)?{...s}:s}),o.forEach(l=>{const u=En.find(c=>l.name.startsWith(`${c}-`));if(u){const c=qr(u),d=qr(l.name.split(`${u}-`)[1]);typeof a[c]>"u"&&(a[c]={}),a[c]===!0&&(a[c]={enabled:!0}),a[c]===!1&&(a[c]={enabled:!1}),a[c][d]=Sn(l.value)}else{const c=qr(l.name);if(!r.includes(c))return;const d=Sn(l.value),f=a[c];if(f&&En.includes(l.name)&&!ke(d)){const p=ke(f)?f:{};p.enabled=!!d,a[c]=p}else a[c]=d}}),Rs(n,a),n.navigation?n.navigation={prevEl:".swiper-button-prev",nextEl:".swiper-button-next",...n.navigation!==!0?n.navigation:{}}:n.navigation===!1&&delete n.navigation,n.scrollbar?n.scrollbar={el:".swiper-scrollbar",...n.scrollbar!==!0?n.scrollbar:{}}:n.scrollbar===!1&&delete n.scrollbar,n.pagination?n.pagination={el:".swiper-pagination",...n.pagination!==!0?n.pagination:{}}:n.pagination===!1&&delete n.pagination,{params:n,passedParams:a}}const Ol=({swiper:e,extendParams:t,on:s,emit:n})=>{t({virtual:{enabled:!1,slides:[],cache:!0,slidesPerViewAutoSlideSize:320,renderSlide:null,renderExternal:null,renderExternalUpdate:!0,addSlidesBefore:0,addSlidesAfter:0}});let a;e.virtual={cache:{},from:0,to:-1,slides:[],offset:0,slidesGrid:[]};function i(){return e.params.virtual}let r;const o=()=>r??(r=document.createElement("div"));function l(h,g){const v=i();if(v.cache&&e.virtual.cache[g])return e.virtual.cache[g];let b;if(v.renderSlide){const y=v.renderSlide.call(e,h,g);if(typeof y=="string"){const m=o();We(m,y),b=m.children[0]}else b=y}else e.isElement?b=Ge("swiper-slide"):b=Ge("div",e.params.slideClass);return b.setAttribute("data-swiper-slide-index",String(g)),v.renderSlide||We(b,h),v.cache&&(e.virtual.cache[g]=b),b}function u(h,g,v){const{slidesPerGroup:b,centeredSlides:y,slidesPerView:m,loop:S,initialSlide:k}=e.params;if(g&&!S&&(k??0)>0)return;const{addSlidesBefore:C,addSlidesAfter:L,slidesPerViewAutoSlideSize:_}=i(),{from:E,to:q,slides:A,slidesGrid:R,offset:T}=e.virtual;e.params.cssMode||e.updateActiveIndex();const P=typeof v>"u"?e.activeIndex||0:v;let z;e.rtlTranslate?z="right":z=e.isHorizontal()?"left":"top";let V;if(m==="auto")if(_){let x=e.size;x||(x=e.isHorizontal()?e.el.getBoundingClientRect().width:e.el.getBoundingClientRect().height),V=Math.max(1,Math.ceil(x/_))}else V=1;else V=m??1;const G=b??1;let X,$;y?(X=Math.floor(V/2)+G+L,$=Math.floor(V/2)+G+C):(X=V+(G-1)+L,$=(S?V:G)+C);let K=P-$,Y=P+X;S||(K=Math.max(K,0),Y=Math.min(Y,A.length-1));let I=(e.slidesGrid[K]||0)-(e.slidesGrid[0]||0);S&&P>=$?(K-=$,y||(I+=e.slidesGrid[0])):S&&P<$&&(K=-$,y&&(I+=e.slidesGrid[0])),Object.assign(e.virtual,{from:K,to:Y,offset:I,slidesGrid:e.slidesGrid,slidesBefore:$,slidesAfter:X});function H(){e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),n("virtualUpdate")}
16if(E===K&&q===Y&&!h){e.slidesGrid!==R&&I!==T&&e.slides.forEach(x=>{x.style.setProperty(z,`${I-Math.abs(e.cssOverflowAdjustment())}px`)}),e.updateProgress(),n("virtualUpdate");return}const N=i();if(N.renderExternal){const x=[];for(let F=K;F<=Y;F+=1)x.push(A[F]);N.renderExternal.call(e,{offset:I,from:K,to:Y,slides:x}),N.renderExternalUpdate?H():n("virtualUpdate");return}const j=[],Z=[],Q=x=>{let F=x;return x<0?F=A.length+x:F>=A.length&&(F=F-A.length),F};if(h)e.slides.filter(x=>x.matches(`.${e.params.slideClass}, swiper-slide`)).forEach(x=>{x.remove()});else for(let x=E;x<=q;x+=1)if(x<K||x>Y){const F=Q(x);e.slides.filter(J=>J.matches(`.${e.params.slideClass}[data-swiper-slide-index="${F}"], swiper-slide[data-swiper-slide-index="${F}"]`)).forEach(J=>{J.remove()})}const se=S?-A.length:0,de=S?A.length*2:A.length;for(let x=se;x<de;x+=1)if(x>=K&&x<=Y){const F=Q(x);typeof q>"u"||h?Z.push(F):(x>q&&Z.push(F),x<E&&j.push(F))}if(Z.forEach(x=>{e.slidesEl.append(l(A[x],x))}),S)for(let x=j.length-1;x>=0;x-=1){const F=j[x];e.slidesEl.prepend(l(A[F],F))}else j.sort((x,F)=>F-x),j.forEach(x=>{e.slidesEl.prepend(l(A[x],x))});Ae(e.slidesEl,".swiper-slide, swiper-slide").forEach(x=>{x.style.setProperty(z,`${I-Math.abs(e.cssOverflowAdjustment())}px`)}),H()}function c(h){if(h!==null&&typeof h=="object"&&"length"in h){const g=h;for(let v=0;v<g.length;v+=1)g[v]&&e.virtual.slides.push(g[v])}else e.virtual.slides.push(h);u(!0)}function d(h){const g=e.activeIndex;let v=g+1,b=1;if(Array.isArray(h)){for(let y=0;y<h.length;y+=1)h[y]&&e.virtual.slides.unshift(h[y]);v=g+h.length,b=h.length}else e.virtual.slides.unshift(h);if(i().cache){const y=e.virtual.cache,m={};Object.keys(y).forEach(S=>{const k=y[Number(S)],C=k.getAttribute("data-swiper-slide-index");C&&k.setAttribute("data-swiper-slide-index",String(parseInt(C,10)+b)),m[parseInt(S,10)+b]=k}),e.virtual.cache=m}u(!0),e.slideTo(v,0)}function f(h){if(typeof h>"u"||h===null)return;let g=e.activeIndex;const v=b=>{Object.keys(e.virtual.cache).forEach(y=>{const m=Number(y);if(m>b){const S=e.virtual.cache[m];e.virtual.cache[m-1]=S,S.setAttribute("data-swiper-slide-index",String(m-1)),delete e.virtual.cache[m]}})};if(Array.isArray(h))for(let b=h.length-1;b>=0;b-=1)i().cache&&(delete e.virtual.cache[h[b]],v(h[b])),e.virtual.slides.splice(h[b],1),h[b]<g&&(g-=1),g=Math.max(g,0);else i().cache&&(delete e.virtual.cache[h],v(h)),e.virtual.slides.splice(h,1),h<g&&(g-=1),g=Math.max(g,0);u(!0),e.slideTo(g,0)}function p(){e.virtual.slides=[],i().cache&&(e.virtual.cache={}),u(!0),e.slideTo(0,0)}s("beforeInit",()=>{if(!i().enabled)return;let h=!1;const g=e.passedParams.virtual;if(!g||typeof g!="object"||g.slides===void 0){const b=[...e.slidesEl.children].filter(y=>y.matches(`.${e.params.slideClass}, swiper-slide`));b&&b.length&&(e.virtual.slides=[...b],h=!0,b.forEach((y,m)=>{y.setAttribute("data-swiper-slide-index",String(m)),e.virtual.cache[m]=y,y.remove()}))}h||(e.virtual.slides=i().slides),e.classNames.push(`${e.params.containerModifierClass}virtual`),e.params.watchSlidesProgress=!0,e.originalParams.watchSlidesProgress=!0,u(!1,!0)}),s("setTranslate",()=>{i().enabled&&(e.params.cssMode&&!e._immediateVirtual?(clearTimeout(a),a=setTimeout(()=>{u()},100)):u())}),s("init update resize",()=>{i().enabled&&e.params.cssMode&&Rt(e.wrapperEl,"--swiper-virtual-size",`${e.virtualSize}px`)}),Object.assign(e.virtual,{appendSlide:c,prependSlide:d,removeSlide:f,removeAllSlides:p,update:u})},Al=({swiper:e,extendParams:t,on:s,emit:n})=>{t({keyboard:{enabled:!1,onlyInViewport:!0,pageUpDown:!0,speed:void 0}});function a(){return e.params.keyboard}function i(l){if(!e.enabled)return;const{rtlTranslate:u}=e,c="originalEvent"in l&&l.originalEvent?l.originalEvent:l,d=c.keyCode||c.charCode,f=a(),p=!!f.pageUpDown,h=p&&d===33,g=p&&d===34,v=d===37,b=d===39,y=d===38,m=d===40;if(!e.allowSlideNext&&(e.isHorizontal()&&b||e.isVertical()&&m||g)||!e.allowSlidePrev&&(e.isHorizontal()&&v||e.isVertical()&&y||h))return!1;if(c.shiftKey||c.altKey||c.ctrlKey||c.metaKey)return;const S=document.activeElement;if(S&&(S.isContentEditable||S.nodeName&&(S.nodeName.toLowerCase()==="input"||S.nodeName.toLowerCase()==="textarea")))return;if(f.onlyInViewport&&(h||g||v||b||y||m)){let C=!1;if(Dt(e.el,`.${e.params.slideClass}, swiper-slide`).length>0&&Dt(e.el,`.${e.params.slideActiveClass}`).length===0)return;const L=e.el,_=L.clientWidth,E=L.clientHeight,q=window.innerWidth,A=window.innerHeight,R=Wr(L);u&&(R.left-=L.scrollLeft);const T=[[R.left,R.top],[R.left+_,R.top],[R.left,R.top+E],[R.left+_,R.top+E]];for(let P=0;P<T.length;P+=1){const z=T[P];if(z[0]>=0&&z[0]<=q&&z[1]>=0&&z[1]<=A){if(z[0]===0&&z[1]===0)continue;C=!0}}if(!C)return}const k=f.speed;e.isHorizontal()?((h||g||v||b)&&c.cancelable&&c.preventDefault(),((g||b)&&!u||(h||v)&&u)&&e.slideNext(k),((h||v)&&!u||(g||b)&&u)&&e.slidePrev(k)):((h||g||y||m)&&c.cancelable&&c.preventDefault(),(g||m)&&e.slideNext(k),(h||y)&&e.slidePrev(k)),n("keyPress",d)}function r(){e.keyboard.enabled||(document.addEventListener("keydown",i),e.keyboard.enabled=!0)}function o(){e.keyboard.enabled&&(document.removeEventListener("keydown",i),e.keyboard.enabled=!1)}e.keyboard={enabled:!1,enable:r,disable:o},s("init",()=>{a().enabled&&r()}),s("destroy",()=>{e.keyboard.enabled&&o()})},Rl=({swiper:e,extendParams:t,on:s,emit:n})=>{t({mousewheel:{enabled:!1,releaseOnEdges:!1,invert:!1,forceToAxis:!1,sensitivity:1,eventsTarget:"container",thresholdDelta:null,thresholdTime:null,noMousewheelClass:"swiper-no-mousewheel"}});let a,i=Ue(),r,o=!1;const l=[];function u(){return e.params.mousewheel}function c(m){const L=m;let _=0,E=0,q=0,A=0;return L.detail!==void 0&&(E=L.detail),L.wheelDelta!==void 0&&(E=-L.wheelDelta/120),L.wheelDeltaY!==void 0&&(E=-L.wheelDeltaY/120
16),L.wheelDeltaX!==void 0&&(_=-L.wheelDeltaX/120),L.axis!==void 0&&L.HORIZONTAL_AXIS!==void 0&&L.axis===L.HORIZONTAL_AXIS&&(_=E,E=0),q=_*10,A=E*10,L.deltaY!==void 0&&(A=L.deltaY),L.deltaX!==void 0&&(q=L.deltaX),L.shiftKey&&!q&&(q=A,A=0),(q||A)&&L.deltaMode&&(L.deltaMode===1?(q*=40,A*=40):(q*=800,A*=800)),q&&!_&&(_=q<1?-1:1),A&&!E&&(E=A<1?-1:1),{spinX:_,spinY:E,pixelX:q,pixelY:A}}function d(){e.enabled&&(o=!0)}function f(){e.enabled&&(o=!1)}function p(m){const S=u();return S.thresholdDelta&&m.delta<S.thresholdDelta||S.thresholdTime&&Ue()-i<S.thresholdTime?!1:m.delta>=6&&Ue()-i<60?!0:(m.direction<0?(!e.isEnd||e.params.loop)&&!e.animating&&(e.slideNext(),n("scroll",m.raw)):(!e.isBeginning||e.params.loop)&&!e.animating&&(e.slidePrev(),n("scroll",m.raw)),i=new window.Date().getTime(),!1)}function h(m){const S=u();if(m.direction<0){if(e.isEnd&&!e.params.loop&&S.releaseOnEdges)return!0}else if(e.isBeginning&&!e.params.loop&&S.releaseOnEdges)return!0;return!1}function g(m){let S="originalEvent"in m&&m.originalEvent?m.originalEvent:m,k=!0;if(!e.enabled)return!1;const C=u();if(m.target.closest(`.${C.noMousewheelClass}`))return!1;e.params.cssMode&&S.preventDefault();let L=e.el;C.eventsTarget!=="container"&&(L=document.querySelector(C.eventsTarget));const _=L&&L.contains(S.target);if(!o&&!_&&!C.releaseOnEdges)return!0;let E=0;const q=e.rtlTranslate?-1:1,A=c(S);if(C.forceToAxis)if(e.isHorizontal())if(Math.abs(A.pixelX)>Math.abs(A.pixelY))E=-A.pixelX*q;else return!0;else if(Math.abs(A.pixelY)>Math.abs(A.pixelX))E=-A.pixelY;else return!0;else E=Math.abs(A.pixelX)>Math.abs(A.pixelY)?-A.pixelX*q:-A.pixelY;if(E===0)return!0;C.invert&&(E=-E);let R=e.getTranslate()+E*(C.sensitivity??1);R>=e.minTranslate()&&(R=e.minTranslate()),R<=e.maxTranslate()&&(R=e.maxTranslate()),k=e.params.loop?!0:!(R===e.minTranslate()||R===e.maxTranslate()),k&&e.params.nested&&S.stopPropagation();const T=e.params.freeMode;if(!e.params.freeMode||!(T!=null&&T.enabled)){const P={time:Ue(),delta:Math.abs(E),direction:Math.sign(E),raw:m};l.length>=2&&l.shift();const z=l.length?l[l.length-1]:void 0;if(l.push(P),z?(P.direction!==z.direction||P.delta>z.delta||P.time>z.time+150)&&p(P):p(P),h(P))return!0}else{const P={time:Ue(),delta:Math.abs(E),direction:Math.sign(E)},z=r&&P.time<r.time+500&&P.delta<=r.delta&&P.direction===r.direction;if(!z){r=void 0;let V=e.getTranslate()+E*(C.sensitivity??1);const G=e.isBeginning,X=e.isEnd;if(V>=e.minTranslate()&&(V=e.minTranslate()),V<=e.maxTranslate()&&(V=e.maxTranslate()),e.setTransition(0),e.setTranslate(V),e.updateProgress(),e.updateActiveIndex(),e.updateSlidesClasses(),(!G&&e.isBeginning||!X&&e.isEnd)&&e.updateSlidesClasses(),e.params.loop&&e.loopFix({direction:P.direction<0?"next":"prev",byMousewheel:!0}),T!=null&&T.sticky){clearTimeout(a),a=void 0,l.length>=15&&l.shift();const K=l.length?l[l.length-1]:void 0,Y=l[0];if(l.push(P),K&&(P.delta>K.delta||P.direction!==K.direction))l.splice(0);else if(l.length>=15&&Y&&P.time-Y.time<500&&Y.delta-P.delta>=1&&P.delta<=6){const I=E>0?.8:.2;r=P,l.splice(0),a=Jt(()=>{e.destroyed||!e.params||e.slideToClosest(e.params.speed,!0,void 0,I)},0)}a||(a=Jt(()=>{if(e.destroyed||!e.params)return;const I=.5;r=P,l.splice(0),e.slideToClosest(e.params.speed,!0,void 0,I)},500))}z||n("scroll",S);const $=e.params.autoplay;if(e.params.autoplay&&($!=null&&$.disableOnInteraction)&&e.autoplay.stop(),C.releaseOnEdges&&(V===e.minTranslate()||V===e.maxTranslate()))return!0}}return S.cancelable&&S.preventDefault(),!1}function v(m){const S=u();let k=e.el;S.eventsTarget!=="container"&&(k=document.querySelector(S.eventsTarget)),k[m]("mouseenter",d),k[m]("mouseleave",f),k[m]("wheel",g)}function b(){return e.params.cssMode?(e.wrapperEl.removeEventListener("wheel",g),!0):e.mousewheel.enabled?!1:(v("addEventListener"),e.mousewheel.enabled=!0,!0)}function y(){return e.params.cssMode?(e.wrapperEl.addEventListener("wheel",g),!0):e.mousewheel.enabled?(v("removeEventListener"),e.mousewheel.enabled=!1,!0):!1}s("init",()=>{const m=u();!m.enabled&&e.params.cssMode&&y(),m.enabled&&b()}),e.mousewheel={enabled:!1,enable:b,disable:y},s("destroy",()=>{e.params.cssMode&&b(),e.mousewheel.enabled&&y()})};function Xs(e,t,s,n){const a=s??{},i=t??{};
16return e.params.createElements&&Object.keys(n).forEach(r=>{if(!a[r]&&a.auto===!0){let o=Ae(e.el,`.${n[r]}`)[0];o||(o=Ge("div",n[r]),o.className=n[r],e.el.append(o)),a[r]=o,i[r]=o}}),a}const Tn='<svg class="swiper-navigation-icon" width="11" height="20" viewBox="0 0 11 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0.38296 20.0762C0.111788 19.805 0.111788 19.3654 0.38296 19.0942L9.19758 10.2796L0.38296 1.46497C0.111788 1.19379 0.111788 0.754138 0.38296 0.482966C0.654131 0.211794 1.09379 0.211794 1.36496 0.482966L10.4341 9.55214C10.8359 9.9539 10.8359 10.6053 10.4341 11.007L1.36496 20.0762C1.09379 20.3474 0.654131 20.3474 0.38296 20.0762Z" fill="currentColor"/></svg>',Ll=({swiper:e,extendParams:t,on:s,emit:n})=>{t({navigation:{nextEl:null,prevEl:null,addIcons:!0,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock",navigationDisabledClass:"swiper-navigation-disabled"}}),e.navigation={nextEl:null,prevEl:null,arrowSvg:Tn};function a(){return e.params.navigation}function i(h){let g;return h&&typeof h=="string"&&e.isElement&&(g=e.el.querySelector(h)||e.hostEl.querySelector(h),g)?g:(h&&(typeof h=="string"&&(g=[...document.querySelectorAll(h)]),e.params.uniqueNavElements&&typeof h=="string"&&g&&g.length>1&&e.el.querySelectorAll(h).length===1?g=e.el.querySelector(h):g&&g.length===1&&(g=g[0])),h&&!g?h:g)}function r(h,g){const v=a();ve(h).forEach(y=>{y&&(y.classList[g?"add":"remove"](...v.disabledClass.split(" ")),y.tagName==="BUTTON"&&(y.disabled=g),e.params.watchOverflow&&e.enabled&&y.classList[e.isLocked?"add":"remove"](v.lockClass))})}function o(){const{nextEl:h,prevEl:g}=e.navigation;if(e.params.loop){r(g,!1),r(h,!1);return}r(g,e.isBeginning&&!e.params.rewind),r(h,e.isEnd&&!e.params.rewind)}function l(h){h.preventDefault(),!(e.isBeginning&&!e.params.loop&&!e.params.rewind)&&(e.slidePrev(),n("navigationPrev"))}function u(h){h.preventDefault(),!(e.isEnd&&!e.params.loop&&!e.params.rewind)&&(e.slideNext(),n("navigationNext"))}function c(){e.params.navigation=Xs(e,e.originalParams.navigation,e.params.navigation,{nextEl:"swiper-button-next",prevEl:"swiper-button-prev"});const h=a();if(!(h.nextEl||h.prevEl))return;const g=i(h.nextEl),v=i(h.prevEl);Object.assign(e.navigation,{nextEl:g,prevEl:v});const b=ve(g),y=ve(v),m=(S,k)=>{if(S){if(h.addIcons&&S.matches(".swiper-button-next,.swiper-button-prev")&&!S.querySelector("svg")){const C=document.createElement("div");We(C,Tn);const L=C.querySelector("svg");L&&S.appendChild(L),C.remove()}S.addEventListener("click",k==="next"?u:l)}!e.enabled&&S&&S.classList.add(...h.lockClass.split(" "))};b.forEach(S=>m(S,"next")),y.forEach(S=>m(S,"prev"))}function d(){const h=a(),{nextEl:g,prevEl:v}=e.navigation,b=ve(g),y=ve(v),m=(S,k)=>{S.removeEventListener("click",k==="next"?u:l),S.classList.remove(...h.disabledClass.split(" "))};b.forEach(S=>m(S,"next")),y.forEach(S=>m(S,"prev"))}s("init",()=>{a().enabled===!1?p():(c(),o())}),s("toEdge fromEdge lock unlock",()=>{o()}),s("destroy",()=>{d()}),s("enable disable",()=>{const h=a(),{nextEl:g,prevEl:v}=e.navigation,b=ve(g),y=ve(v);if(e.enabled){o();return}[...b,...y].filter(m=>!!m).forEach(m=>m.classList.add(h.lockClass))}),s("click",(h,g)=>{const v=a(),{nextEl:b,prevEl:y}=e.navigation,m=ve(b),S=ve(y),k=g.target;let C=S.includes(k)||m.includes(k);if(e.isElement&&!C){const L=g.composedPath?g.composedPath():[];L.length&&(C=L.find(_=>m.includes(_)||S.includes(_)))}if(v.hideOnClick&&!C){if(e.pagination&&e.params.pagination&&e.params.pagination.clickable&&(e.pagination.el===k||e.pagination.el.contains(k)))return;let L;m.length?L=m[0].classList.contains(v.hiddenClass):S.length&&(L=S[0].classList.contains(v.hiddenClass)),n(L===!0?"navigationShow":"navigationHide"),[...m,...S].filter(_=>!!_).forEach(_=>_.classList.toggle(v.hiddenClass))}});const f=()=>{const h=a();e.el.classList.remove(...h.navigationDisabledClass.split(" ")),c(),o()},p=()=>{const h=a();e.el.classList.add(...h.navigationDisabledClass.split(" ")),d()};Object.assign(e.navigation,{enable:f,disable:p,update:o,init:c,destroy:d})};function ut(e=""){return`.${e.trim().replace(/([.:!+/()[\]#>~*^$|=,'"@{}\\])/g,"\\$1").replace(/ /g,".")}`}const Il=e=>{var t;return!!e.virtual&&!!((t=e.params.virtual)!=null&&t.enabled)},Ml=e=>{var t;return!!((t=e.params.freeMode)!=null&&t.enabled)},kn=e=>{var s;if(Il(e))return e.virtual.slides.length;const t=(s=e.params.grid)==null?void 0:s.rows;return e.grid&&t&&t>1?e.slides.length/Math.ceil(t):e.slides.length},Fl=({swiper:e,extendParams:t,on:s,emit:n})=>{const a="swiper-pagination";t({pagination:{el:null,bulletElement:"span",clickable:!1,hideOnClick:!1,renderBullet:null,renderProgressbar:null,renderFraction:null,renderCustom:null,progressbarOpposite:!1,type:"bullets",dynamicBullets:!1,dynamicMainBullets:1,formatFractionCurrent:y=>y,formatFractionTotal:y=>y,bulletClass:`${a}-bullet`,bulletActiveClass:`${a}-bullet-active`,modifierClass:`${a}-`,currentClass:`${a}-current`,totalClass:`${a}-total`,hiddenClass:`${a}-hidden`,progressbarFillClass:`${a}-progressbar-fill`,progressbarOppositeClass:`${a}-progressbar-opposite`,clickableClass:`${a}-clickable`,lockClass:`${a}-lock`,horizontalClass:`${a}
16-horizontal`,verticalClass:`${a}-vertical`,paginationDisabledClass:`${a}-disabled`}}),e.pagination={el:null,bullets:[]};let i,r=0;function o(){return e.params.pagination}function l(){return!o().el||!e.pagination.el||Array.isArray(e.pagination.el)&&e.pagination.el.length===0}function u(y,m){const{bulletActiveClass:S}=o();if(!y)return;let k=y[`${m==="prev"?"previous":"next"}ElementSibling`];k&&(k.classList.add(`${S}-${m}`),k=k[`${m==="prev"?"previous":"next"}ElementSibling`],k&&k.classList.add(`${S}-${m}-${m}`))}function c(y,m,S){if(y=y%S,m=m%S,m===y+1)return"next";if(m===y-1)return"previous"}function d(y){const S=y.target.closest(ut(o().bulletClass));if(!S)return;y.preventDefault();const k=(wr(S)??0)*(e.params.slidesPerGroup??1);if(e.params.loop){if(e.realIndex===k)return;const C=c(e.realIndex,k,e.slides.length);C==="next"?e.slideNext():C==="previous"?e.slidePrev():e.slideToLoop(k)}else e.slideTo(k)}function f(){const y=e.rtl,m=o();if(l())return;const S=ve(e.pagination.el);let k,C;const L=kn(e),_=e.params.loop?Math.ceil(L/(e.params.slidesPerGroup??1)):e.snapGrid.length;if(e.params.loop?(C=e.previousRealIndex||0,k=(e.params.slidesPerGroup??1)>1?Math.floor(e.realIndex/(e.params.slidesPerGroup??1)):e.realIndex):typeof e.snapIndex<"u"?(k=e.snapIndex,C=e.previousSnapIndex):(C=e.previousIndex||0,k=e.activeIndex||0),m.type==="bullets"&&e.pagination.bullets&&e.pagination.bullets.length>0){const E=e.pagination.bullets;let q=0,A=0,R=0;if(m.dynamicBullets){i=Os(E[0],e.isHorizontal()?"width":"height");const T=e.isHorizontal()?"width":"height";S.forEach(P=>{P.style[T]=`${(i??0)*(m.dynamicMainBullets+4)}px`}),m.dynamicMainBullets>1&&C!==void 0&&(r+=k-(C||0),r>m.dynamicMainBullets-1?r=m.dynamicMainBullets-1:r<0&&(r=0)),q=Math.max(k-r,0),A=q+(Math.min(E.length,m.dynamicMainBullets)-1),R=(A+q)/2}if(E.forEach(T=>{const P=["","-next","-next-next","-prev","-prev-prev","-main"].map(z=>`${m.bulletActiveClass}${z}`).flatMap(z=>typeof z=="string"&&z.includes(" ")?z.split(" "):[z]);T.classList.remove(...P)}),S.length>1)E.forEach(T=>{const P=wr(T);P===k?T.classList.add(...m.bulletActiveClass.split(" ")):e.isElement&&T.setAttribute("part","bullet"),m.dynamicBullets&&P!==void 0&&(P>=q&&P<=A&&T.classList.add(...`${m.bulletActiveClass}-main`.split(" ")),P===q&&u(T,"prev"),P===A&&u(T,"next"))});else{const T=E[k];if(T&&T.classList.add(...m.bulletActiveClass.split(" ")),e.isElement&&E.forEach((P,z)=>{P.setAttribute("part",z===k?"bullet-active":"bullet")}),m.dynamicBullets){const P=E[q],z=E[A];for(let V=q;V<=A;V+=1)E[V]&&E[V].classList.add(...`${m.bulletActiveClass}-main`.split(" "));u(P,"prev"),u(z,"next")}}if(m.dynamicBullets){const T=Math.min(E.length,m.dynamicMainBullets+4),P=((i??0)*T-(i??0))/2-R*(i??0),z=y?"right":"left",V=e.isHorizontal()?z:"top";E.forEach(G=>{G.style[V]=`${P}px`})}}S.forEach((E,q)=>{if(m.type==="fraction"&&(E.querySelectorAll(ut(m.currentClass)).forEach(A=>{A.textContent=String(m.formatFractionCurrent(k+1))}),E.querySelectorAll(ut(m.totalClass)).forEach(A=>{A.textContent=String(m.formatFractionTotal(_))})),m.type==="progressbar"){let A;m.progressbarOpposite?A=e.isHorizontal()?"vertical":"horizontal":A=e.isHorizontal()?"horizontal":"vertical";const R=(k+1)/_;let T=1,P=1;A==="horizontal"?T=R:P=R,E.querySelectorAll(ut(m.progressbarFillClass)).forEach(z=>{z.style.transform=`translate3d(0,0,0) scaleX(${T}) scaleY(${P})`,z.style.transitionDuration=`${e.params.speed}ms`})}m.type==="custom"&&m.renderCustom?(We(E,m.renderCustom(e,k+1,_)),q===0&&n("paginationRender",E)):(q===0&&n("paginationRender",E),n("paginationUpdate",E)),e.params.watchOverflow&&e.enabled&&E.classList[e.isLocked?"add":"remove"](m.lockClass)})}function p(){const y=o();if(l())return;const m=kn(e),S=ve(e.pagination.el);let k="";if(y.type==="bullets"){let C=e.params.loop?Math.ceil(m/(e.params.slidesPerGroup??1)):e.snapGrid.length;e.params.freeMode&&Ml(e)&&C>m&&(C=m);for(let L=0;L<C;L+=1)y.renderBullet?k+=y.renderBullet.call(e,L,y.bulletClass):k+=`<${y.bulletElement} ${e.isElement?'part="bullet"':""} class="${y.bulletClass}"></${y.bulletElement}>`}y.type==="fraction"&&(y.renderFraction?k=y.renderFraction.call(e,y.currentClass,y.totalClass):k=`<span class="${y.currentClass}"></span> / <span class="${y.totalClass}"></span>`),y.type==="progressbar"&&(y.renderProgressbar?k=y.renderProgressbar.call(e,y.progressbarFillClass):k=`<span class="${y.progressbarFillClass}"></span>
16`),e.pagination.bullets=[],S.forEach(C=>{y.type!=="custom"&&We(C,k||""),y.type==="bullets"&&e.pagination.bullets.push(...Array.from(C.querySelectorAll(ut(y.bulletClass))))}),y.type!=="custom"&&n("paginationRender",S[0])}function h(){e.params.pagination=Xs(e,e.originalParams.pagination,e.params.pagination,{el:"swiper-pagination"});const y=o();if(!y.el)return;let m;if(typeof y.el=="string"&&e.isElement&&(m=e.el.querySelector(y.el)),!m&&typeof y.el=="string"&&(m=[...document.querySelectorAll(y.el)]),m||(m=y.el),!m||Array.isArray(m)&&m.length===0)return;if(e.params.uniqueNavElements&&typeof y.el=="string"&&Array.isArray(m)&&m.length>1&&(m=[...e.el.querySelectorAll(y.el)],m.length>1)){const k=m.find(C=>Dt(C,".swiper")[0]===e.el);k&&(m=k)}Array.isArray(m)&&m.length===1&&(m=m[0]),Object.assign(e.pagination,{el:m}),ve(m).forEach(k=>{y.type==="bullets"&&y.clickable&&k.classList.add(...(y.clickableClass||"").split(" ")),k.classList.add(y.modifierClass+y.type),k.classList.add(e.isHorizontal()?y.horizontalClass:y.verticalClass),y.type==="bullets"&&y.dynamicBullets&&(k.classList.add(`${y.modifierClass}${y.type}-dynamic`),r=0,y.dynamicMainBullets<1&&(y.dynamicMainBullets=1)),y.type==="progressbar"&&y.progressbarOpposite&&k.classList.add(y.progressbarOppositeClass),y.clickable&&k.addEventListener("click",d),e.enabled||k.classList.add(y.lockClass)})}function g(){const y=o();if(l())return;const m=e.pagination.el;m&&ve(m).forEach(k=>{k.classList.remove(y.hiddenClass),k.classList.remove(y.modifierClass+y.type),k.classList.remove(e.isHorizontal()?y.horizontalClass:y.verticalClass),y.clickable&&(k.classList.remove(...(y.clickableClass||"").split(" ")),k.removeEventListener("click",d))}),e.pagination.bullets&&e.pagination.bullets.forEach(S=>S.classList.remove(...y.bulletActiveClass.split(" ")))}s("changeDirection",()=>{if(!e.pagination||!e.pagination.el)return;const y=o();ve(e.pagination.el).forEach(S=>{S.classList.remove(y.horizontalClass,y.verticalClass),S.classList.add(e.isHorizontal()?y.horizontalClass:y.verticalClass)})}),s("init",()=>{o().enabled===!1?b():(h(),p(),f())}),s("activeIndexChange",()=>{typeof e.snapIndex>"u"&&f()}),s("snapIndexChange",()=>{f()}),s("snapGridLengthChange",()=>{p(),f()}),s("destroy",()=>{g()}),s("enable disable",()=>{const{el:y}=e.pagination;if(y){const m=o();ve(y).forEach(k=>k.classList[e.enabled?"remove":"add"](m.lockClass))}}),s("lock unlock",()=>{f()}),s("click",(y,m)=>{const S=m.target,k=ve(e.pagination.el),C=o();if(C.el&&C.hideOnClick&&k&&k.length>0&&!S.classList.contains(C.bulletClass)){if(e.navigation&&(e.navigation.nextEl&&S===e.navigation.nextEl||e.navigation.prevEl&&S===e.navigation.prevEl))return;const L=k[0].classList.contains(C.hiddenClass);n(L===!0?"paginationShow":"paginationHide"),k.forEach(_=>_.classList.toggle(C.hiddenClass))}});const v=()=>{const y=o();e.el.classList.remove(y.paginationDisabledClass);const{el:m}=e.pagination;m&&ve(m).forEach(k=>k.classList.remove(y.paginationDisabledClass)),h(),p(),f()},b=()=>{const y=o();e.el.classList.add(y.paginationDisabledClass);const{el:m}=e.pagination;m&&ve(m).forEach(k=>k.classList.add(y.paginationDisabledClass)),g()};Object.assign(e.pagination,{enable:v,disable:b,render:p,update:f,init:h,destroy:g})},Dl=({swiper:e,extendParams:t,on:s,emit:n})=>{let a=!1,i=null,r=null,o=0,l=0,u=0,c=0;t({scrollbar:{el:null,dragSize:"auto",hide:!1,draggable:!1,snapOnRelease:!0,lockClass:"swiper-scrollbar-lock",dragClass:"swiper-scrollbar-drag",scrollbarDisabledClass:"swiper-scrollbar-disabled",horizontalClass:"swiper-scrollbar-horizontal",verticalClass:"swiper-scrollbar-vertical"}}),e.scrollbar={el:null,dragEl:null};function d(){return e.params.scrollbar}function f(){const A=d();if(!A.el||!e.scrollbar.el)return;const{scrollbar:R,rtlTranslate:T}=e,{dragEl:P,el:z}=R,V=e.params.loop?e.progressLoop??0:e.progress;let G=l,X=(u-l)*V;T?(X=-X,X>0?(G=l-X,X=0):-X+l>u&&(G=u+X)):X<0?(G=l+X,X=0):X+l>u&&(G=u-X),e.isHorizontal()?(P.style.transform=`translate3d(${X}px, 0, 0)`,P.style.width=`${G}px`):(P.style.transform=`translate3d(0px, ${X}px, 0)`,P.style.height=`${G}px`),A.hide&&(i&&clearTimeout(i),z.style.opacity="1",i=setTimeout(()=>{z.style.opacity="0",z.style.transitionDuration="400ms"},1e3))}function p(A){!d().el||!e.scrollbar.el||(e.scrollbar.dragEl.style.transitionDuration=`${A}ms`)}function h(){const A=d();if(!A.el||!e.scrollbar.el)return;const{scrollbar:R}=e,{dragEl:T,el:P}=R;T.style.width="",T.style.height="",u=e.isHorizontal()?P.offsetWidth:P.offsetHeight,c=e.size/(e.virtualSize+(e.params.slidesOffsetBefore??0)-(e.params.centeredSlides?e.snapGrid[0]:0)),A.dragSize==="auto"?l=u*c:l=parseInt(String(A.dragSize),10),e.isHorizontal()?T.style.width=`${l}px`:T.style.height=`${l}px`,c>=1?P.style.display="none":P.style.display="",A.hide&&(P.style.opacity="0"),e.params.watchOverflow&&e.enabled&&R.el.classList[e.isLocked?"add":"remove"](A.lockClass)}function g(A){var R,T,P,z;return e.isHorizontal()?A.clientX??((T=(R=A.touches)==null?void 0:R[0])==null?void 0:T.clientX)??0:A.clientY??((z=(P=A.touches)==null?void 0:P[0])==null?void 0:z.clientY)??0}function v(A){const{scrollbar:R,rtlTranslate:T}=e,{el:P}=R;let z;z=(g(A)-Wr(P)[e.isHorizontal()?"left":"top"]-(o!==null?o:l/2))/(u-l),z=Math.max(Math.min(z,1),0),T&&(z=1-z);const V=e.minTranslate()+(e.maxTranslate()-e.minTranslate())*z;e.updateProgress(V),e.setTranslate(V),e.updateActiveIndex(),e.updateSlidesClasses()}function b(A){const R=d(),{scrollbar:T,wrapperEl:P}=e,{el:z,dragEl:V}=T;a=!0,o=A.target===V?g(A)-A.target.getBoundingClientRect()[e.isHorizontal()?"left":"top"]:null,A.preventDefault(),A.stopPropagation(),P.style.transitionDuration="100ms",V.style.transitionDuration="100ms",v(A),r&&clearTimeout(r),z.style.transitionDuration="0ms",R.hide&&(z.style.opacity="1"),e.params.cssMode&&(e.wrapperEl.style.scrollSnapType="none"),n("scrollbarDragStart",A)}function y(A){const{scrollbar:R,wrapperEl:T}=e,{el:P,dragEl:z}=R;a&&(A.cancelable&&A.preventDefault(),v(A),T.style.transitionDuration="0ms",P.style.transitionDuration="0ms",z.style.transitionDuration="0ms",n("scrollbarDragMove",A))}function m(A){const R=d(),{scrollbar:T,wrapperEl:P}=e,{el:z}=T;a&&(a=!1,e.params.cssMode&&(e.wrapperEl.style.scrollSnapType="",P.style.transitionDuration=""),R.hide&&(r&&clearTimeout(r),r=Jt(()=>{z.style.opacity="0",z.style.transitionDuration="400ms"},1e3)),n("scrollbarDragEnd",A),R.snapOnRelease&&e.slideToClosest())}function S(A){const{scrollbar:R,params:T}=e,P=R.el;if(!P)return;const z=T.passiveListeners?{passive:!1,capture:!1}:!1,V=T.passiveListeners?{passive:!0,capture:!1}:!1,G=A==="on"?"addEventListener":"removeEventListener";P[G]("pointerdown",b,z),document[G]("pointermove",y,z),document[G]("pointerup",m,V)}function k(){!d().el||!e.scrollbar.el||S("on")}function C(){!d().el||!e.scrollbar.el||S("off")}function L(){const{scrollbar:A,el:R}=e;e.params.scrollbar=Xs(e,e.originalParams.scrollbar,e.params.scrollbar,{el:"swiper-scrollbar"});const T=d();if(!T.el)return;let P;if(typeof T.el=="string"&&e.isElement&&(P=e.el.querySelector(T.el)),!P&&typeof T.el=="string"){if(P=document.querySelectorAll(T.el),!P.length)return}else P||(P=T.el);e.params.uniqueNavElements&&typeof T.el=="string"&&P.length>1&&R.querySelectorAll(T.el).length===1&&(P=R.querySelector(T.el)),P.length>0&&(P=P[0]);const z=P;z.classList.add(e.isHorizontal()?T.horizontalClass:T.verticalClass);let V=null;z&&(V=z.querySelector(ut(T.dragClass)),V||(V=Ge("div",T.dragClass),z.append(V))),Object.assign(A,{el:z,dragEl:V}),T.draggable&&k(),z&&z.classList[e.enabled?"remove":"add"](...mt(T.lockClass))}function _(){const A=d(),R=e.scrollbar.el;R&&R.classList.remove(...mt(e.isHorizontal()?A.horizontalClass:A.verticalClass)),C()}s("changeDirection",()=>{if(!e.scrollbar||!e.scrollbar.el)return;const A=d();ve(e.scrollbar.el).forEach(T=>{T.classList.remove(A.horizontalClass,A.verticalClass),T.classList.add(e.isHorizontal()?A.horizontalClass:A.verticalClass)})}),s("init",()=>{d().enabled===!1?q():(L(),h(),f())}),s("update resize observerUpdate lock unlock changeDirection",()=>{h()}),s("setTranslate",()=>{f()}),s("setTransition",(A,R)=>{p(R)}),s("enable disable",()=>{const{el:A}=e.scrollbar;A&&A.classList[e.enabled?"remove":"add"](...mt(d().lockClass))}),s("destroy",()=>{_()});const E=()=>{const A=d();e.el.classList.remove(...mt(A.scrollbarDisabledClass)),e.scrollbar.el&&e.scrollbar.el.classList.remove(...mt(A.scrollbarDisabledClass)),L(),h(),f()},q=()=>{const A=d();e.el.classList.add(...mt(A.scrollbarDisabledClass)),e.scrollbar.el&&e.scrollbar.el.classList.add(...mt(A.scrollbarDisabledClass)),_()};Object.assign(e.scrollbar,{enable:E,disable:q,updateSize:h,setTranslate:f,init:L,destroy:_})},$l=({swiper:e,extendParams:t,on:s})=>{t({parallax:{enabled:!1}});function n(){return e.params.parallax}const a="[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]",i=(l,u)=>{const{rtl:c}=e,d=c?-1:1,f=l.getAttribute("data-swiper-parallax")||"0";let p=l.getAttribute("data-swiper-parallax-x"),h=l.getAttribute("data-swiper-parallax-y");const g=l.getAttribute("data-swiper-parallax-scale"),v=l.getAttribute("data-swiper-parallax-opacity"),b=l.getAttribute("data-swiper-parallax-rotate");if(p||h?(p=p||"0",h=h||"0"):e.isHorizontal()?(p=f,h="0"):(h=f,p="0"),p.indexOf("%")>=0?p=`${parseInt(p,10)*u*d}%`:p=`${Number(p)*u*d}px`,h.indexOf("%")>=0?h=`${parseInt(h,10)*u}%`:h=`${Number(h)*u}px`,typeof v<"u"&&v!==null){const m=Number(v),S=m-(m-1)*(1-Math.abs(u));l.style.opacity=String(S)}let y=`translate3d(${p}, ${h}, 0px)`;if(typeof g<"u"&&g!==null){const m=Number(g),S=m-(m-1)*(1-Math.abs(u));y+=` scale(${S})`}if(b&&typeof b<"u"&&b!==null){const m=Number(b)*u*-1;y+=` rotate(${m}deg)`}l.style.transform=y},r=()=>{const{el:l,slides:u,progress:c,snapGrid:d}=e,f=Ae(l,a);e.isElement&&f.push(...Ae(e.hostEl,a)),f.forEach(p=>{i(p,c)}),u.forEach((p,h)=>{let g=p.progress??0;(e.params.slidesPerGroup??1)>1&&e.params.slidesPerView!=="auto"&&(g+=Math.ceil(h/2)-c*(d.length-1)),g=Math.min(Math.max(g,-1),1),p.querySelectorAll(`${a}, [data-swiper-parallax-rotate]`).forEach(b=>{i(b,g)})})},o=(l=e.params.speed??300)=>{const{el:u,hostEl:c}=e,d=[...u.querySelectorAll(a)];e.isElement&&d.push(...c.querySelectorAll(a)),d.forEach(f=>{const p=f.getAttribute("data-swiper-parallax-duration");let h=(p?parseInt(p,10):0)||l;l===0&&(h=0),f.style.transitionDuration=`${h}ms`})};s("beforeInit",()=>{n().enabled&&(e.params.watchSlidesProgress=!0,e.originalParams.watchSlidesProgress=!0)}),s("init",()=>{n().enabled&&r()}),s("setTranslate",()=>{n().enabled&&r()}),s("setTransition",(l,u)=>{n().enabled&&o(u)})},jl=({swiper:e,extendParams:t,on:s,emit:n})=>{t({zoom:{enabled:!1,limitToOriginalSize:!1,maxRatio:3,minRatio:1,panOnMouseMove:!1,toggle:!0,containerClass:"swiper-zoom-container",zoomedSlideClass:"swiper-slide-zoomed"}}),e.zoom={enabled:!1};function a(){return e.params.zoom}let i=1,r=!1,o=!1,l={x:0,y:0};const u=-3;let c=!1,d=!1;const f=[],p={originX:0,originY:0,slideEl:void 0,slideWidth:void 0,slideHeight:void 0,imageEl:void 0,imageWrapEl:void 0,maxRatio:3},h={isTouched:void 0,isMoved:void 0,currentX:void 0,currentY:void 0,minX:void 0,minY:void 0,maxX:void 0,maxY:void 0,width:void 0,height:void 0,startX:void 0,startY:void 0,touchesStart:{},touchesCurrent:{}},g={x:void 0,y:void 0,prevPositionX:void 0,prevPositionY:void 0,prevTime:void 0};let v=1;Object.defineProperty(e.zoom,"scale",{get(){return v},set(N){if(v!==N){const j=p.imageEl,Z=p.slideEl;n("zoomChange",N,j,Z)}v=N}});function b(){if(f.length<2)return 1;const N=f[0].pageX,j=f[0].pageY,Z=f[1].pageX,Q=f[1].pageY;return Math.sqrt((Z-N)**2+(Q-j)**2)}function y(){var se;const N=a(),j=(se=p.imageWrapEl)==null?void 0:se.getAttribute("data-swiper-zoom"),Z=j!=null?Number(j):N.maxRatio,Q=p.imageEl;
16if(N.limitToOriginalSize&&Q&&Q.naturalWidth){const de=Q.naturalWidth/Q.offsetWidth;return Math.min(de,Z)}return Z}function m(){if(f.length<2||!p.imageEl)return[null,null];const N=p.imageEl.getBoundingClientRect();return[(f[0].pageX+(f[1].pageX-f[0].pageX)/2-N.x-window.scrollX)/i,(f[0].pageY+(f[1].pageY-f[0].pageY)/2-N.y-window.scrollY)/i]}function S(){return e.isElement?"swiper-slide":`.${e.params.slideClass}`}function k(N){const j=S(),Z=N.target;return Z?!!(Z.matches(j)||e.slides.filter(Q=>Q.contains(Z)).length>0):!1}function C(N){const j=`.${a().containerClass}`,Z=N.target;return Z?!!(Z.matches(j)||[...e.hostEl.querySelectorAll(j)].filter(Q=>Q.contains(Z)).length>0):!1}function L(N){var Z;if(N.pointerType==="mouse"&&f.splice(0,f.length),!k(N))return;const j=a();if(c=!1,d=!1,f.push(N),!(f.length<2)){if(c=!0,p.scaleStart=b(),!p.slideEl){const Q=N.target;p.slideEl=(Q==null?void 0:Q.closest(`.${e.params.slideClass}, swiper-slide`))??void 0,p.slideEl||(p.slideEl=e.slides[e.activeIndex]);let se=((Z=p.slideEl)==null?void 0:Z.querySelector(`.${j.containerClass}`))??null;if(se&&(se=se.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]??null),p.imageEl=se??void 0,se?p.imageWrapEl=Dt(se,`.${j.containerClass}`)[0]??void 0:p.imageWrapEl=void 0,!p.imageWrapEl){p.imageEl=void 0;return}p.maxRatio=y()}if(p.imageEl){const[Q,se]=m();p.originX=Q??0,p.originY=se??0,p.imageEl.style.transitionDuration="0ms"}r=!0}}function _(N){if(!k(N))return;const j=a(),Z=e.zoom,Q=f.findIndex(se=>se.pointerId===N.pointerId);Q>=0&&(f[Q]=N),!(f.length<2)&&(d=!0,p.scaleMove=b(),p.imageEl&&(Z.scale=p.scaleMove/(p.scaleStart??1)*i,Z.scale>p.maxRatio&&(Z.scale=p.maxRatio-1+(Z.scale-p.maxRatio+1)**.5),Z.scale<j.minRatio&&(Z.scale=j.minRatio+1-(j.minRatio-Z.scale+1)**.5),p.imageEl.style.transform=`translate3d(0,0,0) scale(${Z.scale})`))}function E(N){if(!k(N)||N.pointerType==="mouse"&&N.type==="pointerout")return;const j=a(),Z=e.zoom,Q=f.findIndex(se=>se.pointerId===N.pointerId);Q>=0&&f.splice(Q,1),!(!c||!d)&&(c=!1,d=!1,p.imageEl&&(Z.scale=Math.max(Math.min(Z.scale,p.maxRatio),j.minRatio),p.imageEl.style.transitionDuration=`${e.params.speed}ms`,p.imageEl.style.transform=`translate3d(0,0,0) scale(${Z.scale})`,i=Z.scale,r=!1,Z.scale>1&&p.slideEl?p.slideEl.classList.add(`${j.zoomedSlideClass}`):Z.scale<=1&&p.slideEl&&p.slideEl.classList.remove(`${j.zoomedSlideClass}`),Z.scale===1&&(p.originX=0,p.originY=0,p.slideEl=void 0)))}let q;function A(){e.touchEventsData.preventTouchMoveFromPointerMove=!1}function R(){q!==void 0&&clearTimeout(q),e.touchEventsData.preventTouchMoveFromPointerMove=!0,q=setTimeout(()=>{e.destroyed||A()})}function T(N){const j=e.device;if(h.isTouched)return;const Z=f.length>0?f[0]:N;h.touchesStart.x=Z.pageX,h.touchesStart.y=Z.pageY,p.imageEl&&(j.android&&N.cancelable&&N.preventDefault(),h.isTouched=!0)}function P(N){const Z=N.pointerType==="mouse"&&a().panOnMouseMove;if(!k(N)||!C(N))return;const Q=e.zoom;if(!p.imageEl)return;if(!h.isTouched||!p.slideEl){Z&&G(N);return}if(Z){G(N);return}h.isMoved||(h.width=p.imageEl.offsetWidth||p.imageEl.clientWidth,h.height=p.imageEl.offsetHeight||p.imageEl.clientHeight,h.startX=Ps(p.imageWrapEl,"x")||0,h.startY=Ps(p.imageWrapEl,"y")||0,p.slideWidth=p.slideEl.offsetWidth,p.slideHeight=p.slideEl.offsetHeight,p.imageWrapEl.style.transitionDuration="0ms");const se=h.width*Q.scale,de=h.height*Q.scale;h.minX=Math.min(p.slideWidth/2-se/2,0),h.maxX=-h.minX,h.minY=Math.min(p.slideHeight/2-de/2,0),h.maxY=-h.minY,h.touchesCurrent.x=f.length>0?f[0].pageX:N.pageX,h.touchesCurrent.y=f.length>0?f[0].pageY:N.pageY,Math.max(Math.abs(h.touchesCurrent.x-(h.touchesStart.x??0)),Math.abs(h.touchesCurrent.y-(h.touchesStart.y??0)))>5&&(e.allowClick=!1);const F=h.startX??0,J=h.startY??0;if(!h.isMoved&&!r){if(e.isHorizontal()&&(Math.floor(h.minX)===Math.floor(F)&&h.touchesCurrent.x<(h.touchesStart.x??0)||Math.floor(h.maxX)===Math.floor(F)&&h.touchesCurrent.x>(h.touchesStart.x??0))){h.isTouched=!1,A();return}if(!e.isHorizontal()&&(Math.floor(h.minY)===Math.floor(J)&&h.touchesCurrent.y<(h.touchesStart.y??0)||Math.floor(h.maxY)===Math.floor(J)&&h.touchesCurrent.y>(h.touchesStart.y??0))){h.isTouched=!1,A();return}}N.cancelable&&N.preventDefault(),N.stopPropagation(),R(),h.isMoved=!0;const te=(Q.scale-i)/(p.maxRatio-a().minRatio),{originX:oe,originY:pe}=p;h.currentX=h.touchesCurrent.x-(h.touchesStart.x??0)+F+te*(h.width-oe*2),h.currentY=h.touchesCurrent.y-(h.touchesStart.y??0)+J+te*(h.height-pe*2),h.currentX<h.minX&&(h.currentX=h.minX+1-(h.minX-h.currentX+1)**.8),h.currentX>h.maxX&&(h.currentX=h.maxX-1+(h.currentX-h.maxX+1)**.8),h.currentY<h.minY&&(h.currentY=h.minY+1-(h.minY-h.currentY+1)**.8),h.currentY>h.maxY&&(h.currentY=h.maxY-1+(h.currentY-h.maxY+1)**.8),g.prevPositionX||(g.prevPositionX=h.touchesCurrent.x),g.prevPositionY||(g.prevPositionY=h.touchesCurrent.y),g.prevTime||(g.prevTime=Date.now()),g.x=(h.touchesCurrent.x-g.prevPositionX)/(Date.now()-g.prevTime)/2,g.y=(h.touchesCurrent.y-g.prevPositionY)/(Date.now()-g.prevTime)/2,Math.abs(h.touchesCurrent.x-g.prevPositionX)<2&&(g.x=0),Math.abs(h.touchesCurrent.y-g.prevPositionY)<2&&(g.y=0),g.prevPositionX=h.touchesCurrent.x,g.prevPositionY=h.touchesCurrent.y,g.prevTime=Date.now(),p.imageWrapEl.style.transform=`translate3d(${h.currentX}px, ${h.currentY}px,0)`}function z(){const N=e.zoom;if(f.length=0,!p.imageEl)return;if(!h.isTouched||!h.isMoved){h.isTouched=!1,h.isMoved=!1;return}h.isTouched=!1,h.isMoved=!1;let j=300,Z=300;const Q=g.x??0,se=g.y??0,de=Q*j,x=h.currentX+de,F=se*Z,J=h.currentY+F;Q!==0&&(j=Math.abs((x-h.currentX)/Q)),se!==0&&(Z=Math.abs((J-h.currentY)/se));const te=Math.max(j,Z);h.currentX=x,h.currentY=J;const oe=h.width*N.scale,pe=h.height*N.scale;h.minX=Math.min(p.slideWidth/2-oe/2,0),h.maxX=-h.minX,h.minY=Math.min(p.slideHeight/2-pe/2,0),h.maxY=-h.minY,h.currentX=Math.max(Math.min(h.currentX,h.maxX),h.minX),h.currentY=Math.max(Math.min(h.currentY,h.maxY),h.minY),p.imageWrapEl.style.transitionDuration=`${te}ms`,p.imageWrapEl.style.transform=`translate3d(${h.currentX}px, ${h.currentY}px,0)`}function V(){const N=e.zoom;p.slideEl&&e.activeIndex!==e.slides.indexOf(p.slideEl)&&(p.imageEl&&(p.imageEl.style.transform="translate3d(0,
160,0) scale(1)"),p.imageWrapEl&&(p.imageWrapEl.style.transform="translate3d(0,0,0)"),p.slideEl.classList.remove(`${a().zoomedSlideClass}`),N.scale=1,i=1,p.slideEl=void 0,p.imageEl=void 0,p.imageWrapEl=void 0,p.originX=0,p.originY=0)}function G(N){if(i<=1||!p.imageWrapEl||!k(N)||!C(N))return;const j=window.getComputedStyle(p.imageWrapEl).transform,Z=new window.DOMMatrix(j);if(!o){o=!0,l.x=N.clientX,l.y=N.clientY,h.startX=Z.e,h.startY=Z.f,h.width=p.imageEl.offsetWidth||p.imageEl.clientWidth,h.height=p.imageEl.offsetHeight||p.imageEl.clientHeight,p.slideWidth=p.slideEl.offsetWidth,p.slideHeight=p.slideEl.offsetHeight;return}const Q=(N.clientX-l.x)*u,se=(N.clientY-l.y)*u,de=h.width*i,x=h.height*i,F=p.slideWidth,J=p.slideHeight,te=Math.min(F/2-de/2,0),oe=-te,pe=Math.min(J/2-x/2,0),ge=-pe,Se=Math.max(Math.min(h.startX+Q,oe),te),Ie=Math.max(Math.min(h.startY+se,ge),pe);p.imageWrapEl.style.transitionDuration="0ms",p.imageWrapEl.style.transform=`translate3d(${Se}px, ${Ie}px, 0)`,l.x=N.clientX,l.y=N.clientY,h.startX=Se,h.startY=Ie,h.currentX=Se,h.currentY=Ie}function X(N){var Xe;const j=e.zoom,Z=a();if(!p.slideEl){if(N&&typeof N!="number"&&"target"in N&&N.target&&(p.slideEl=N.target.closest(`.${e.params.slideClass}, swiper-slide`)??void 0),!p.slideEl){const dt=e.params.virtual;dt&&dt.enabled&&e.virtual?p.slideEl=Ae(e.slidesEl,`.${e.params.slideActiveClass}`)[0]??void 0:p.slideEl=e.slides[e.activeIndex]}let ze=((Xe=p.slideEl)==null?void 0:Xe.querySelector(`.${Z.containerClass}`))??null;ze&&(ze=ze.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]??null),p.imageEl=ze??void 0,ze?p.imageWrapEl=Dt(ze,`.${Z.containerClass}`)[0]??void 0:p.imageWrapEl=void 0}if(!p.imageEl||!p.imageWrapEl||!p.slideEl)return;p.maxRatio=y(),e.params.cssMode&&(e.wrapperEl.style.overflow="hidden",e.wrapperEl.style.touchAction="none"),p.slideEl.classList.add(`${Z.zoomedSlideClass}`);let Q,se,de,x,F,J,te,oe,pe,ge,Se,Ie,Te,De,je,rt,$e,Ke;const _t=N&&typeof N!="number";typeof h.touchesStart.x>"u"&&_t?(Q=N.pageX,se=N.pageY):(Q=h.touchesStart.x,se=h.touchesStart.y);const st=i,Ne=typeof N=="number"?N:null;i===1&&Ne&&(Q=void 0,se=void 0,h.touchesStart.x=void 0,h.touchesStart.y=void 0);const nt=y();j.scale=Ne||nt,i=Ne||nt,N&&!(i===1&&Ne)?($e=p.slideEl.offsetWidth,Ke=p.slideEl.offsetHeight,de=Wr(p.slideEl).left+window.scrollX,x=Wr(p.slideEl).top+window.scrollY,F=de+$e/2-(Q??0),J=x+Ke/2-(se??0),pe=p.imageEl.offsetWidth||p.imageEl.clientWidth,ge=p.imageEl.offsetHeight||p.imageEl.clientHeight,Se=pe*j.scale,Ie=ge*j.scale,Te=Math.min($e/2-Se/2,0),De=Math.min(Ke/2-Ie/2,0),je=-Te,rt=-De,st>0&&Ne&&typeof h.currentX=="number"&&typeof h.currentY=="number"?(te=h.currentX*j.scale/st,oe=h.currentY*j.scale/st):(te=F*j.scale,oe=J*j.scale),te<Te&&(te=Te),te>je&&(te=je),oe<De&&(oe=De),oe>rt&&(oe=rt)):(te=0,oe=0),Ne&&j.scale===1&&(p.originX=0,p.originY=0),h.currentX=te,h.currentY=oe,p.imageWrapEl.style.transitionDuration="300ms",p.imageWrapEl.style.transform=`translate3d(${te}px, ${oe}px,0)`,p.imageEl.style.transitionDuration="300ms",p.imageEl.style.transform=`translate3d(0,0,0) scale(${j.scale})`}function $(){var Z;const N=e.zoom,j=a();if(!p.slideEl){const Q=e.params.virtual;Q&&Q.enabled&&e.virtual?p.slideEl=Ae(e.slidesEl,`.${e.params.slideActiveClass}`)[0]??void 0:p.slideEl=e.slides[e.activeIndex];let se=((Z=p.slideEl)==null?void 0:Z.querySelector(`.${j.containerClass}`))??null;se&&(se=se.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]??null),p.imageEl=se??void 0,se?p.imageWrapEl=Dt(se,`.${j.containerClass}`)[0]??void 0:p.imageWrapEl=void 0}!p.imageEl||!p.imageWrapEl||!p.slideEl||(p.maxRatio=y(),e.params.cssMode&&(e.wrapperEl.style.overflow="",e.wrapperEl.style.touchAction=""),N.scale=1,i=1,h.currentX=void 0,h.currentY=void 0,h.touchesStart.x=void 0,h.touchesStart.y=void 0,p.imageWrapEl.style.transitionDuration="300ms",p.imageWrapEl.style.transform="translate3d(0,0,0)",p.imageEl.style.transitionDuration="300ms",p.imageEl.style.transform="translate3d(0,0,0) scale(1)",p.slideEl.classList.remove(`${j.zoomedSlideClass}`),p.slideEl=void 0,p.originX=0,p.originY=0,j.panOnMouseMove&&(l={x:0,y:0},o&&(o=!1,h.startX=0,h.startY=0)))}function K(N){const j=e.zoom;j.scale&&j.scale!==1?$():X(N)}function Y(){const N=e.params.passiveListeners?{passive:!0,capture:!1}:!1,j=e.params.passiveListeners?{passive:!1,capture:!0}:!0;return{passiveListener:N,activeListenerWithCapture:j}}function I(){const N=e.zoom;if(N.enabled)return;N.enabled=!0;const{passiveListener:j,activeListenerWithCapture:Z}=Y();e.wrapperEl.addEventListener("pointerdown",L,j),e.wrapperEl.addEventListener("pointermove",_,Z),["pointerup","pointercancel","pointerout"].forEach(Q=>{e.wrapperEl.addEventListener(Q,E,j)}),e.wrapperEl.addEventListener("pointermove",P,Z)}function H(){const N=e.zoom;if(!N.enabled)return;N.enabled=!1;const{passiveListener:j,activeListenerWithCapture:Z}=Y();e.wrapperEl.removeEventListener("pointerdown",L,j),e.wrapperEl.removeEventListener("pointermove",_,Z),["pointerup","pointercancel","pointerout"].forEach(Q=>{e.wrapperEl.removeEventListener(Q,E,j)}),e.wrapperEl.removeEventListener("pointermove",P,Z)}s("init",()=>{a().enabled&&I()}),s("destroy",()=>{H()}),s("touchStart",(N,j)=>{e.zoom.enabled&&T(j)}),s("touchEnd",()=>{e.zoom.enabled&&z()}),s("doubleTap",(N,j)=>{!e.animating&&a().enabled&&e.zoom.enabled&&a().toggle&&K(j)}),s("transitionEnd",()=>{e.zoom.enabled&&a().enabled&&V()}),s("slideChange",()=>{e.zoom.enabled&&a().enabled&&e.params.cssMode&&V()}),Object.assign(e.zoom,{enable:I,disable:H,in:X,out:$,toggle:K})};class Cn{constructor(t,s){Oe(this,"x");Oe(this,"y");Oe(this,"lastIndex");Oe(this,"binarySearch");let n,a,i;this.binarySearch=(r,o)=>{for(a=-1,n=r.length;n-a>1;)i=n+a>>1,r[i]<=o?a=i:n=i;return n},this.x=t,this.y=s,this.lastIndex=t.length-1}interpolate(t){if(!t)return 0;const s=this.binarySearch(this.x,t),n=s-1;return(t-this.x[n])*(this.y[s]-this.y[n])/(this.x[s]-this.x[n])+this.y[n]}}const Nl=({swiper:e,extendParams:t,on:s})=>{t({controller:{control:void 0,inverse:!1,by:"slide"}}),e.controller={control:void 0};function n(){return e.params.controller}function a(l){e.controller.spline=e.params.loop?new Cn(e.slidesGrid,l.slidesGrid):new Cn(e.snapGrid,l.snapGrid)}function i(l,u){const c=e.controller.control;let d,f;const p=e.constructor;function h(g){if(g.destroyed)return;const v=e.rtlTranslate?-e.translate:e.translate,b=n();b.by==="slide"?(a(g),f=-e.controller.spline.interpolate(-v)):f=0,(!f||b.by==="container")&&(d=(g.maxTranslate()-g.minTranslate())/(e.maxTranslate()-e.minTranslate()),(Number.isNaN(d)||!Number.isFinite(d))&&(d=1),f=(v-e.minTranslate())*d+g.minTranslate()),b.inverse&&(f=g.maxTranslate()-f),g.updateProgress(f),g.setTranslate(f,e),g.updateActiveIndex(),g.updateSlidesClasses()}if(Array.isArray(c))for(let g=0;g<c.length;g+=1){const v=c[g];v&&v!==u&&v instanceof p&&h(v)}else c instanceof p&&u!==c&&h(c)}function r(l,u){const c=e.constructor,d=e.controller.control;function f(p){p.destroyed||(p.setTransition(l,e),l!==0&&(p.transitionStart(),p.params.autoHeight&&Jt(()=>{p.updateAutoHeight()}),gr(p.wrapperEl,()=>{d&&p.transitionEnd()})))}if(Array.isArray(d))for(let p=0;p<d.length;p+=1){const h=d[p];h&&h!==u&&h instanceof c&&f(h)}else d instanceof c&&u!==d&&f(d)}function o(){e.controller.control&&e.controller.spline&&(e.controller.spline=void 0,delete e.controller.spline)}s("beforeInit",()=>{const l=n().control;if(typeof window<"u"&&(typeof l=="string"||l instanceof HTMLElement)){(typeof l=="string"?[...document.querySelectorAll(l)]:[l]).forEac
16h(c=>{e.controller.control||(e.controller.control=[]);const d=e.controller.control;if(c&&c.swiper)d.push(c.swiper);else if(c){const f=`${e.params.eventsPrefix}init`,p=h=>{const g=h.detail;g&&g[0]&&d.push(g[0]),e.update(),c.removeEventListener(f,p)};c.addEventListener(f,p)}});return}e.controller.control=l}),s("update",()=>{o()}),s("resize",()=>{o()}),s("observerUpdate",()=>{o()}),s("setTranslate",(l,u,c)=>{e.controller.control&&(!Array.isArray(e.controller.control)&&e.controller.control.destroyed||e.controller.setTranslate(u,c))}),s("setTransition",(l,u,c)=>{e.controller.control&&(!Array.isArray(e.controller.control)&&e.controller.control.destroyed||e.controller.setTransition(u,c))}),Object.assign(e.controller,{setTranslate:i,setTransition:r})},zl=e=>{var t;return!!e.virtual&&!!((t=e.params.virtual)!=null&&t.enabled)},Bl=({swiper:e,extendParams:t,on:s})=>{t({a11y:{enabled:!0,notificationClass:"swiper-notification",prevSlideMessage:"Previous slide",nextSlideMessage:"Next slide",firstSlideMessage:"This is the first slide",lastSlideMessage:"This is the last slide",paginationBulletMessage:"Go to slide {{index}}",slideLabelMessage:"{{index}} / {{slidesLength}}",containerMessage:null,containerRoleDescriptionMessage:null,containerRole:null,itemRoleDescriptionMessage:null,slideRole:"group",id:null,scrollOnFocus:!0,wrapperLiveRegion:!0}}),e.a11y={clicked:!1};let n=null,a=!1,i,r=new Date().getTime();function o(){return e.params.a11y}function l(V){const G=n;!G||!V||We(G,V)}function u(V=16){const G=()=>Math.round(16*Math.random()).toString(16);return"x".repeat(V).replace(/x/g,G)}function c(V){ve(V).forEach(X=>{X.setAttribute("tabIndex","0")})}function d(V){ve(V).forEach(X=>{X.setAttribute("tabIndex","-1")})}function f(V,G){ve(V).forEach($=>{$.setAttribute("role",G)})}function p(V,G){ve(V).forEach($=>{$.setAttribute("aria-roledescription",G)})}function h(V,G){ve(V).forEach($=>{$.setAttribute("aria-label",G)})}function g(V,G){ve(V).forEach($=>{$.setAttribute("id",G)})}function v(V,G){ve(V).forEach($=>{$.setAttribute("aria-live",G)})}function b(V){ve(V).forEach(X=>{X.setAttribute("aria-disabled","true")})}function y(V){ve(V).forEach(X=>{X.removeAttribute("aria-disabled")})}function m(V){if(V.keyCode!==13&&V.keyCode!==32)return;const G=o(),X=e.params.pagination,$=V.target;if(!(e.pagination&&e.pagination.el&&($===e.pagination.el||e.pagination.el.contains($))&&!$.matches(ut(X==null?void 0:X.bulletClass)))){if(e.navigation&&e.navigation.prevEl&&e.navigation.nextEl){const K=ve(e.navigation.prevEl);ve(e.navigation.nextEl).includes($)&&(e.isEnd&&!e.params.loop||e.slideNext(),e.isEnd?l(G.lastSlideMessage):l(G.nextSlideMessage)),K.includes($)&&(e.isBeginning&&!e.params.loop||e.slidePrev(),e.isBeginning?l(G.firstSlideMessage):l(G.prevSlideMessage))}e.pagination&&$.matches(ut(X==null?void 0:X.bulletClass))&&$.click()}}function S(){if(e.params.loop||e.params.rewind||!e.navigation)return;const{nextEl:V,prevEl:G}=e.navigation;G&&(e.isBeginning?(b(G),d(G)):(y(G),c(G))),V&&(e.isEnd?(b(V),d(V)):(y(V),c(V)))}function k(){return!!(e.pagination&&e.pagination.bullets&&e.pagination.bullets.length)}function C(){const V=e.params.pagination;return k()&&!!(V!=null&&V.clickable)}function L(){const V=o();if(!k())return;const G=e.params.pagination;e.pagination.bullets.forEach(X=>{G.clickable&&(c(X),G.renderBullet||(f(X,"button"),h(X,V.paginationBulletMessage.replace(/\{\{index\}\}/,String((wr(X)??0)+1))))),X.matches(ut(G.bulletActiveClass))?X.setAttribute("aria-current","true"):X.removeAttribute("aria-current")})}const _=(V,G,X)=>{c(V),V.tagName!=="BUTTON"&&(f(V,"button"),V.addEventListener("keydown",m)),h(V,X)},E=V=>{i&&i!==V.target&&!i.contains(V.target)&&(a=!0),e.a11y.clicked=!0},q=()=>{a=!1,requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.destroyed||(e.a11y.clicked=!1)})})},A=V=>{r=new Date().getTime()},R=V=>{const G=o();if(e.a11y.clicked||!G.scrollOnFocus||new Date().getTime()-r<100)return;const $=V.target.closest(`.${e.params.slideClass}, swiper-slide`);if(!$||!e.slides.includes($))return;i=$;const K=zl(e),Y=(K?parseInt($.getAttribute("data-swiper-slide-index")||"0",10):e.slides.indexOf($))===e.activeIndex,I=e.params.watchSlidesProgress&&e.visibleSlides&&e.visibleSlides.includes($);if(Y||I)return;const H=V.sourceCapabilities;H&&H.firesTouchEvents||(e.isHorizontal()?e.el.scrollLeft=0:e.el.scrollTop=0,requestAnimationFrame(()=>
16{a||(e.params.loop?e.slideToLoop(e.getSlideIndexWhenGrid(parseInt($.getAttribute("data-swiper-slide-index")||"0",10)),0):K?e.slideTo(e.getSlideIndexWhenGrid(parseInt($.getAttribute("data-swiper-slide-index")||"0",10)),0):e.slideTo(e.getSlideIndexWhenGrid(e.slides.indexOf($)),0),a=!1)}))},T=()=>{const V=o();V.itemRoleDescriptionMessage&&p(e.slides,V.itemRoleDescriptionMessage),V.slideRole&&f(e.slides,V.slideRole);const G=e.slides.length,X=V.slideLabelMessage;X&&e.slides.forEach(($,K)=>{const Y=e.params.loop?parseInt($.getAttribute("data-swiper-slide-index")||"0",10):K,I=X.replace(/\{\{index\}\}/,String(Y+1)).replace(/\{\{slidesLength\}\}/,String(G));h($,I)})},P=()=>{const V=o();n&&e.el.append(n);const G=e.el;V.containerRoleDescriptionMessage&&p(G,V.containerRoleDescriptionMessage),V.containerMessage&&h(G,V.containerMessage),V.containerRole&&f(G,V.containerRole);const X=e.wrapperEl,$=String(V.id||X.getAttribute("id")||`swiper-wrapper-${u(16)}`);if(g(X,$),V.wrapperLiveRegion){const H=e.params.autoplay,N=e.params.autoplay&&(H!=null&&H.enabled)?"off":"polite";v(X,N)}T();const K=e.navigation?e.navigation:{nextEl:void 0,prevEl:void 0},Y=ve(K.nextEl),I=ve(K.prevEl);Y&&Y.forEach(H=>_(H,$,V.nextSlideMessage)),I&&I.forEach(H=>_(H,$,V.prevSlideMessage)),C()&&ve(e.pagination.el).forEach(N=>{N.addEventListener("keydown",m)}),document.addEventListener("visibilitychange",A),e.el.addEventListener("focus",R,!0),e.el.addEventListener("pointerdown",E,!0),e.el.addEventListener("pointerup",q,!0)};function z(){n&&n.remove();const V=e.navigation?e.navigation:{nextEl:void 0,prevEl:void 0},G=ve(V.nextEl),X=ve(V.prevEl);G&&G.forEach($=>$.removeEventListener("keydown",m)),X&&X.forEach($=>$.removeEventListener("keydown",m)),C()&&ve(e.pagination.el).forEach(K=>{K.removeEventListener("keydown",m)}),document.removeEventListener("visibilitychange",A),e.el&&typeof e.el!="string"&&(e.el.removeEventListener("focus",R,!0),e.el.removeEventListener("pointerdown",E,!0),e.el.removeEventListener("pointerup",q,!0))}s("beforeInit",()=>{n=Ge("span",o().notificationClass),n.setAttribute("aria-live","assertive"),n.setAttribute("aria-atomic","true")}),s("afterInit",()=>{o().enabled&&P()}),s("slidesLengthChange snapGridLengthChange slidesGridLengthChange",()=>{o().enabled&&T()}),s("fromEdge toEdge afterInit lock unlock",()=>{o().enabled&&S()}),s("paginationUpdate",()=>{o().enabled&&L()}),s("destroy",()=>{o().enabled&&z()})},Hl=({swiper:e,extendParams:t,on:s})=>{t({history:{enabled:!1,root:"",replaceState:!1,key:"slides",keepQuery:!1}});let n=!1,a={key:void 0,value:void 0};function i(){return e.params.history}const r=p=>p.toString().replace(/\s+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-").replace(/^-+/,"").replace(/-+$/,""),o=p=>{let h;p?h=new URL(p):h=window.location;const g=h.pathname.slice(1).split("/").filter(m=>m!==""),v=g.length,b=g[v-2],y=g[v-1];return{key:b,value:y}},l=(p,h)=>{var C;const g=i();if(!n||!g.enabled)return;let v;e.params.url?v=new URL(e.params.url):v=window.location;const b=!!((C=e.params.virtual)!=null&&C.enabled),y=e.virtual&&b?e.slidesEl.querySelector(`[data-swiper-slide-index="${h}"]`):e.slides[h];if(!y)return;let m=r(y.getAttribute("data-history")||"");const S=g.root;S.length>0?m=`${S[S.length-1]==="/"?S.slice(0,S.length-1):S}/${p?`${p}/`:""}${m}`:v.pathname.includes(p||"")||(m=`${p?`${p}/`:""}${m}`),g.keepQuery&&(m+=v.search);const k=window.history.state;k&&k.value===m||(g.replaceState?window.history.replaceState({value:m},"",m):window.history.pushState({value:m},"",m))},u=(p,h,g)=>{if(h)for(let v=0,b=e.slides.length;v<b;v+=1){const y=e.slides[v];if(r(y.getAttribute("data-history")||"")===h){const S=e.getSlideIndex(y);e.slideTo(S,p,g)}}else e.slideTo(0,p,g)},c=()=>{a=o(e.params.url),u(e.params.speed,a.value,!1)},d=()=>{const p=e.params.history;if(p){if(!window.history||!window.history.pushState){p.enabled=!1;const h=e.params.hashNavigation;h&&(h.enabled=!0);return}if(n=!0,a=o(e.params.url),!a.key&&!a.value){p.replaceState||window.addEventListener("popstate",c);return}u(0,a.value,e.params.runCallbacksOnInit),p.replaceState||window.addEventListener("popstate",c)}},f=()=>{i().replaceState||window.removeEventListener("popstate",c)};s("init",()=>{i().enabled&&d()}),s("destroy",()=>{i().enabled&&f()}),s("transitionEnd _freeModeNoMomentumRelease",()=>{n&&l(i().key,e.activeIndex)}),s("slideChange",()=>{n&&e.params.cssMode&&l(i().key,e.activeIndex)})},vs=e=>{var t;return!!e.virtual&&!!((t=e.params.virtual)!=null&&t.enabled)},Ul=({swiper:e,extendParams:t,emit:s,on:n})=>{let a=!1;t({hashNavigation:{enabled:!1,replaceState:!1,watchState:!1,getSlideIndex(c,d){if(vs(e)){const p=e.slides.find(g=>g.getAttribute("data-hash")===d);return p?parseInt(p.getAttribute("data-swiper-slide-index")||"0",10):0}const f=Ae(e.slidesEl,`.${e.params.slideClass}[data-hash="${d}"], swiper-slide[data-hash="${d}"]`)[0];return f?e.getSlideIndex(f):0}}});function i(){return e.params.hashNavigation}const r=()=>{s("hashChange");const c=document.location.hash.replace("#",""),d=vs(e)?e.slidesEl.querySelector(`[data-swiper-slide-index="${e.activeIndex}"]`):e.slides[e.activeIndex],f=d?d.getAttribute("data-hash"):"";if(c!==f){const p=i().getSlideIndex(e,c);if(typeof p>"u"||Number.isNaN(p))return;e.slideTo(p)}},o=()=>{const c=i();if(!a||!c.enabled)return;const d=vs(e)?e.slidesEl.querySelector(`[data-swiper-slide-index="${e.activeIndex}"]`):e.slides[e.activeIndex],f=d?d.getAttribute("data-hash")||d.getAttribute("data-history"):"";c.replaceState&&window.history&&window.history.replaceState?(window.history.replaceState(null,"",`#${f}`||""),s("hashSet")):(document.location.hash=f||"",s("hashSet"))},l=()=>{const c=i(),d=e.params.history;if(!c.enabled||d&&d.enabled)return;a=!0;const f=document.location.hash.replace("#","");if(f){const h=c.getSlideIndex(e,f);e.slideTo(h||0,0,e.params.runCallbacksOnInit,!0)}c.watchState&&window.addEventListener("hashchange",r)},u=()=>{i().watchState&&window.removeEventListener("hashchange",r)};n("init",()=>{i().enabled&&l()}),n("destroy",()=>{i().enabled&&u()}),n("transitionEnd _freeModeNoMomentumRelease",()=>{a&&o()}),n("slideChange",()=>{a&&e.params.cssMode&&o()})},ql=({swiper:e,extendParams:t,on:s,emit:n,params:a})=>{e.autoplay={running:!1,paused:!1,timeLeft:0},t({autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!1,stopOnLastSlide:!1,reverseDirection:!1,pauseOnMouseEnter:!1}});function i(){return e.params.autoplay}const r=typeof a.autoplay=="object"&&a.autoplay&&typeof a.autoplay.delay=="number"?a.autoplay.delay:3e3;let o,l,u=r,c=r,d=0,f=new Date().getTime(),p=!1,h=!1,g=!1,v,b=!1,y=!1;function m($){if(!e||e.destroyed||!e.wrapperEl||$.target!==e.wrapperEl)return;e.wrapperEl.removeEventListener("transitionend",m);const K=$.detail;y||K&&K.bySwiperTouchMove||A()}const S=()=>
16{if(e.destroyed||!e.autoplay.running)return;e.autoplay.paused?p=!0:p&&(c=d,p=!1);const $=e.autoplay.paused?d:f+c-new Date().getTime();e.autoplay.timeLeft=$,n("autoplayTimeLeft",$,$/u),l=requestAnimationFrame(()=>{S()})},k=()=>{var I;let $;const K=!!((I=e.params.virtual)!=null&&I.enabled);if(e.virtual&&K?$=e.slides.find(H=>H.classList.contains("swiper-slide-active")):$=e.slides[e.activeIndex],!$)return;const Y=$.getAttribute("data-swiper-autoplay");if(Y!=null)return parseInt(Y,10)},C=()=>{let $=i().delay;const K=k();return typeof K=="number"&&!Number.isNaN(K)&&K>0&&($=K),$},L=$=>{if(e.destroyed||!e.autoplay.running)return 0;l!==void 0&&cancelAnimationFrame(l),S();let K=$;typeof K>"u"&&(K=C(),u=K,c=K),d=K;const Y=e.params.speed,I=()=>{if(!e||e.destroyed)return;const H=i();H.reverseDirection?!e.isBeginning||e.params.loop||e.params.rewind?(e.slidePrev(Y,!0,!0),n("autoplay")):H.stopOnLastSlide||(e.slideTo(e.slides.length-1,Y,!0,!0),n("autoplay")):!e.isEnd||e.params.loop||e.params.rewind?(e.slideNext(Y,!0,!0),n("autoplay")):H.stopOnLastSlide||(e.slideTo(0,Y,!0,!0),n("autoplay")),e.params.cssMode&&(f=new Date().getTime(),requestAnimationFrame(()=>{L()}))};return K>0?(o!==void 0&&clearTimeout(o),o=setTimeout(()=>{I()},K)):requestAnimationFrame(()=>{I()}),K},_=()=>(f=new Date().getTime(),e.autoplay.running=!0,L(),n("autoplayStart"),!0),E=()=>(e.autoplay.running=!1,o!==void 0&&clearTimeout(o),l!==void 0&&cancelAnimationFrame(l),n("autoplayStop"),!0),q=($,K)=>{if(e.destroyed||!e.autoplay.running)return;o!==void 0&&clearTimeout(o),$||(b=!0);const Y=()=>{n("autoplayPause"),i().waitForTransition?e.wrapperEl.addEventListener("transitionend",m):A()};if(e.autoplay.paused=!0,K){Y();return}d=(d||i().delay)-(new Date().getTime()-f),!(e.isEnd&&d<0&&!e.params.loop)&&(d<0&&(d=0),Y())},A=()=>{e.isEnd&&d<0&&!e.params.loop||e.destroyed||!e.autoplay.running||(f=new Date().getTime(),b?(b=!1,L(d)):L(),e.autoplay.paused=!1,n("autoplayResume"))},R=()=>{e.destroyed||!e.autoplay.running||(document.visibilityState==="hidden"&&(b=!0,q(!0)),document.visibilityState==="visible"&&A())},T=$=>{$.pointerType==="mouse"&&(b=!0,y=!0,!(e.animating||e.autoplay.paused)&&q(!0))},P=$=>{$.pointerType==="mouse"&&(y=!1,e.autoplay.paused&&A())},z=()=>{i().pauseOnMouseEnter&&(e.el.addEventListener("pointerenter",T),e.el.addEventListener("pointerleave",P))},V=()=>{e.el&&typeof e.el!="string"&&(e.el.removeEventListener("pointerenter",T),e.el.removeEventListener("pointerleave",P))},G=()=>{document.addEventListener("visibilitychange",R)},X=()=>{document.removeEventListener("visibilitychange",R)};s("init",()=>{i().enabled&&(z(),G(),_())}),s("destroy",()=>{V(),X(),e.autoplay.running&&E()}),s("_freeModeStaticRelease",()=>{(g||b)&&A()}),s("_freeModeNoMomentumRelease",()=>{i().disableOnInteraction?E():q(!0,!0)}),s("beforeTransitionStart",($,K,Y)=>{e.destroyed||!e.autoplay.running||(Y||!i().disableOnInteraction?q(!0,!0):E())}),s("sliderFirstMove",()=>{if(!(e.destroyed||!e.autoplay.running)){if(i().disableOnInteraction){E();return}h=!0,g=!1,b=!1,v=setTimeout(()=>{b=!0,g=!0,q(!0)},200)}}),s("touchEnd",()=>{if(!(e.destroyed||!e.autoplay.running||!h)){if(v!==void 0&&clearTimeout(v),o!==void 0&&clearTimeout(o),i().disableOnInteraction){g=!1,h=!1;return}g&&e.params.cssMode&&A(),g=!1,h=!1}}),s("slideChange",()=>{e.destroyed||!e.autoplay.running||e.autoplay.paused&&(d=C(),u=C())}),Object.assign(e.autoplay,{start:_,stop:E,pause:q,resume:A})},Vl=({swiper:e,extendParams:t,on:s})=>{t({thumbs:{swiper:null,multipleActiveThumbs:!0,autoScrollOffset:0,slideThumbActiveClass:"swiper-slide-thumb-active",thumbsContainerClass:"swiper-thumbs"}});let n=!1,a=!1;e.thumbs={swiper:null};function i(){return e.params.thumbs}function r(){const d=e.thumbs.swiper;if(!d||d.destroyed)return!1;const f=d.params.virtual;return!!f&&!!f.enabled}function o(){var v;const d=e.thumbs.swiper;if(!d||d.destroyed)return;const f=d.clickedIndex,p=d.clickedSlide,h=i();if(p&&p.classList.contains(h.slideThumbActiveClass)||typeof f>"u"||f===null)return;let g;if(d.params.loop){const b=(v=d.clickedSlide)==null?void 0:v.getAttribute("data-swiper-slide-index");g=b==null?f:parseInt(b,10)}else g=f;e.params.loop?e.slideToLoop(g):e.slideTo(g)}function l(){const d=i();if(n)return!1;n=!0;const f=e.constructor;if(d.swiper instanceof f){if(d.swiper.destroyed)return n=!1,!1;const h=d.swiper;e.thumbs.swiper=h,Object.assign(h.originalParams,{watchSlidesProgress:!0,slideToClickedSlide:!1}),Object.assign(h.params,{watchSlidesProgress:!0,slideToClickedSlide:!1}),h.update()}else if(fr(d.swiper)){const h=Object.assign({},d.swiper);Object.assign(h,{watchSlidesProgress:!0,slideToClickedSlide:!1}),e.thumbs.swiper=new f(h),a=!0}const p=e.thumbs.swiper;return p?(p.el.classList.add(d.thumbsContainerClass),p.on("tap",o),r()&&p.on("virtualUpdate",()=>{u(!1,{autoScroll:!1})}),!0):!1}function u(d,f){const p=e.thumbs.swiper;if(!p||p.destroyed)return;let h=1;const g=i(),v=g.slideThumbActiveClass,b=e.params.slidesPerView;if(typeof b=="number"&&b>1&&!e.params.centeredSlides&&(h=b),g.multipleActiveThumbs||(h=1),h=Math.floor(h),p.slides.forEac
16h(y=>y.classList.remove(v)),p.params.loop||r())for(let y=0;y<h;y+=1)Ae(p.slidesEl,`[data-swiper-slide-index="${e.realIndex+y}"]`).forEach(m=>{m.classList.add(v)});else for(let y=0;y<h;y+=1){const m=p.slides[e.realIndex+y];m&&m.classList.add(v)}((f==null?void 0:f.autoScroll)??!0)&&c(d?0:void 0)}function c(d){const f=e.thumbs.swiper;if(!f||f.destroyed)return;const p=f.params.slidesPerView,h=p==="auto"?f.slidesPerViewDynamic():p??1,g=i().autoScrollOffset,v=g&&!f.params.loop;if(e.realIndex!==f.realIndex||v){const b=f.activeIndex;let y,m;if(f.params.loop){const S=f.slides.find(k=>k.getAttribute("data-swiper-slide-index")===`${e.realIndex}`);y=S?f.slides.indexOf(S):-1,m=e.activeIndex>e.previousIndex?"next":"prev"}else y=e.realIndex,m=y>e.previousIndex?"next":"prev";v&&(y+=m==="next"?g:-1*g),f.visibleSlidesIndexes&&f.visibleSlidesIndexes.indexOf(y)<0&&(f.params.centeredSlides?y>b?y=y-Math.floor(h/2)+1:y=y+Math.floor(h/2)-1:y>b&&f.params.slidesPerGroup,f.slideTo(y,d))}}s("beforeInit",()=>{const d=e.params.thumbs;if(!(!d||!d.swiper))if(typeof d.swiper=="string"||d.swiper instanceof HTMLElement){const f=()=>{const h=typeof d.swiper=="string"?document.querySelector(d.swiper):d.swiper;if(h&&h.swiper)d.swiper=h.swiper,l(),u(!0);else if(h){const g=`${e.params.eventsPrefix}init`,v=b=>{const y=b.detail;d.swiper=y[0],h.removeEventListener(g,v),l(),u(!0),d.swiper.update(),e.update()};h.addEventListener(g,v)}return h},p=()=>{if(e.destroyed)return;f()||requestAnimationFrame(p)};requestAnimationFrame(p)}else l(),u(!0)}),s("slideChange update resize observerUpdate",()=>{u()}),s("setTransition",(d,f)=>{const p=e.thumbs.swiper;!p||p.destroyed||p.setTransition(f)}),s("beforeDestroy",()=>{const d=e.thumbs.swiper;!d||d.destroyed||a&&d.destroy()}),Object.assign(e.thumbs,{init:l,update:u})},Gl=({swiper:e,extendParams:t,emit:s,once:n})=>{t({freeMode:{enabled:!1,momentum:!0,momentumRatio:1,momentumBounce:!0,momentumBounceRatio:1,momentumVelocityRatio:1,sticky:!1,minimumVelocity:.02}});function a(){return e.params.freeMode}function i(){if(e.params.cssMode)return;const l=e.getTranslate();e.setTranslate(l),e.setTransition(0),e.touchEventsData.velocities.length=0,e.freeMode.onTouchEnd({currentPos:e.rtl?e.translate:-e.translate})}function r(){if(e.params.cssMode)return;const{touchEventsData:l,touches:u}=e;l.velocities.length===0&&l.velocities.push({position:u[e.isHorizontal()?"startX":"startY"],time:l.touchStartTime??Ue()}),l.velocities.push({position:u[e.isHorizontal()?"currentX":"currentY"],time:Ue()})}function o({currentPos:l}){if(e.params.cssMode)return;const{wrapperEl:u,rtlTranslate:c,snapGrid:d,touchEventsData:f}=e,p=e.params,h=a(),g=Ue(),v=g-(f.touchStartTime??g);if(l<-e.minTranslate()){e.slideTo(e.activeIndex);return}if(l>-e.maxTranslate()){e.slides.length<d.length?e.slideTo(d.length-1):e.slideTo(e.slides.length-1);return}if(h.momentum){if(f.velocities.length>1){const _=f.velocities.pop(),E=f.velocities.pop(),q=_.position-E.position,A=_.time-E.time;e.velocity=q/A,e.velocity/=2,Math.abs(e.velocity)<h.minimumVelocity&&(e.velocity=0),(A>150||Ue()-_.time>300)&&(e.velocity=0)}else e.velocity=0;e.velocity*=h.momentumVelocityRatio,f.velocities.length=0;let b=1e3*h.momentumRatio;const y=e.velocity*b;let m=e.translate+y;c&&(m=-m);let S=!1,k;const C=Math.abs(e.velocity)*20*h.momentumBounceRatio;let L=!1;if(m<e.maxTranslate())h.momentumBounce?(m+e.maxTranslate()<-C&&(m=e.maxTranslate()-C),k=e.maxTranslate(),S=!0,f.allowMomentumBounce=!0):m=e.maxTranslate(),p.loop&&p.centeredSlides&&(L=!0);else if(m>e.minTranslate())h.momentumBounce?(m-e.minTranslate()>C&&(m=e.minTranslate()+C),k=e.minTranslate(),S=!0,f.allowMomentumBounce=!0):m=e.minTranslate(),p.loop&&p.centeredSlides&&(L=!0);else if(h.sticky){let _=0;for(let E=0;E<d.length;E+=1)if(d[E]>-m){_=E;break}Math.abs(d[_]-m)<Math.abs((d[_-1]??d[_])-m)||e.swipeDirection==="next"?m=d[_]:m=d[_-1],m=-m}if(L&&n("transitionEnd",()=>{e.loopFix()}),e.velocity!==0){if(c?b=Math.abs((-m-e.translate)/e.velocity):b=Math.abs((m-e.translate)/e.velocity),h.sticky){const _=Math.abs((c?-m:m)-e.translate),E=e.slidesSizesGrid[e.activeIndex],q=p.speed;_<E?b=q:_<2*E?b=q*1.5:b=q*2.5}}else if(h.sticky){e.slideToClosest();return}h.momentumBounce&&S&&k!==void 0?(e.updateProgress(k),e.setTransition(b),e.setTranslate(m),e.transitionStart(!0,e.swipeDirection),e.animating=!0,gr(u,()=>{!e||e.destroyed||!f.allowMomentumBounce||(s("momentumBounce"),e.setTransition(p.speed),setTimeout(()=>{e.setTranslate(k),gr(u,()=>{!e||e.destroyed||e.transitionEnd()})},0))})):e.velocity?(s("_freeModeNoMomentumRelease"),e.updateProgress(m),e.setTransition(b),e.setTranslate(m),e.transitionStart(!0,e.swipeDirection),e.animating||(e.animating=!0,gr(u,()=>{!e||e.destroyed||e.transitionEnd()}))):e.updateProgress(m),e.updateActiveIndex(),e.updateSlidesClasses()}else if(h.sticky){e.slideToClosest();return}else s("_freeModeNoMomentumRelease");(!h.momentum||v>=p.longSwipesMs)&&(s("_freeModeStaticRelease"),e.updateProgress(),e.updateActiveIndex(),e.updateSlidesClasses())}e.freeMode={onTouchStart:i,onTouchMove:r,onTouchEnd:o}},Wl=({swiper:e,extendParams:t,on:s})=>{t({grid:{rows:1,fill:"column"}});function n(){return e.params.grid}let a,i,r,o;const l=()=>{let v=e.params.spaceBetween??0;return typeof v=="string"&&v.indexOf("%")>=0?v=parseFloat(v.replace("%",""))/100*e.size:typeof v=="string"&&(v=parseFloat(v)),v},u=()=>{const v=e.params.virtual;return!!e.virtual&&typeof v=="object"&&v!==null&&!!v.enabled},c=v=>{const{slidesPerView:b}=e.params,{rows:y,fill:m}=n(),S=u()?e.virtual.slides.length:v.length;r=Math.floor(S/y),Math.floor(S/y)===S/y?a=S:a=Math.ceil(S/y)*y,b!=="auto"&&m==="row"&&(a=Math.max(a,Math.floor(b??1)*y)),i=a/y},d=()=>
16{e.slides&&e.slides.forEach(v=>{v.swiperSlideGridSet&&(v.style.height="",v.style.setProperty(e.getDirectionLabel("margin-top"),""))})},f=(v,b,y)=>{const{slidesPerGroup:m}=e.params,S=l(),{rows:k,fill:C}=n(),L=u()?e.virtual.slides.length:y.length;let _,E,q;if(C==="row"&&(m??1)>1){const R=m??1,T=Math.floor(v/(R*k)),P=v-k*R*T,z=T===0?R:Math.min(Math.ceil((L-T*k*R)/k),R);q=Math.floor(P/z),E=P-q*z+T*R,_=E+q*a/k,b.style.order=String(_)}else C==="column"?(E=Math.floor(v/k),q=v-E*k,(E>r||E===r&&q===k-1)&&(q+=1,q>=k&&(q=0,E+=1))):(q=Math.floor(v/i),E=v-q*i);const A=b;A.row=q,A.column=E,b.style.height=`calc((100% - ${(k-1)*S}px) / ${k})`,b.style.setProperty(e.getDirectionLabel("margin-top"),q!==0&&S?`${S}px`:""),A.swiperSlideGridSet=!0},p=(v,b)=>{const{centeredSlides:y,roundLengths:m}=e.params,S=l(),{rows:k}=n();if(e.virtualSize=(v+S)*a,e.virtualSize=Math.ceil(e.virtualSize/k)-S,e.params.cssMode||e.wrapperEl.style.setProperty(e.getDirectionLabel("width"),`${e.virtualSize+S}px`),y){const C=[];for(let L=0;L<b.length;L+=1){let _=b[L];m&&(_=Math.floor(_)),b[L]<e.virtualSize+b[0]&&C.push(_)}b.splice(0,b.length),b.push(...C)}},h=()=>{const v=e.params.grid;o=!!(v&&(v.rows??1)>1)},g=()=>{const{params:v,el:b}=e,y=v.grid,m=!!(y&&(y.rows??1)>1);o&&!m?(b.classList.remove(`${v.containerModifierClass}grid`,`${v.containerModifierClass}grid-column`),r=1,e.emitContainerClasses()):!o&&m&&(b.classList.add(`${v.containerModifierClass}grid`),y.fill==="column"&&b.classList.add(`${v.containerModifierClass}grid-column`),e.emitContainerClasses()),o=m};s("init",h),s("update",g),e.grid={initSlides:c,unsetSlides:d,updateSlide:f,updateWrapperSize:p}};function Kl(e,t){const s=this,{params:n,activeIndex:a,slidesEl:i}=s;let r=a;n.loop&&(r-=s.loopedSlides??0,s.loopDestroy(),s.recalcSlides());const o=s.slides.length;if(e<=0){s.prependSlide(t);return}if(e>=o){s.appendSlide(t);return}let l=r>e?r+1:r;const u=[];for(let c=o-1;c>=e;c-=1){const d=s.slides[c];d&&(d.remove(),u.unshift(d))}if(Array.isArray(t)){for(let c=0;c<t.length;c+=1){const d=t[c];d&&i.append(d)}l=r>e?r+t.length:r}else i.append(t);for(let c=0;c<u.length;c+=1)i.append(u[c]);s.recalcSlides(),n.loop&&s.loopCreate(),(!n.observer||s.isElement)&&s.update(),n.loop?s.slideTo(l+(s.loopedSlides??0),0,!1):s.slideTo(l,0,!1)}function Xl(e){const t=this,{params:s,slidesEl:n}=t;s.loop&&t.loopDestroy();const a=i=>{if(typeof i=="string"){const r=document.createElement("div");We(r,i);const o=r.children[0];o&&n.append(o),We(r,"")}else n.append(i)};if(Array.isArray(e))for(let i=0;i<e.length;i+=1){const r=e[i];r&&a(r)}else a(e);t.recalcSlides(),s.loop&&t.loopCreate(),(!s.observer||t.isElement)&&t.update()}function Yl(e){const t=this,{params:s,activeIndex:n,slidesEl:a}=t;s.loop&&t.loopDestroy();let i=n+1;const r=o=>{if(typeof o=="string"){const l=document.createElement("div");We(l,o);const u=l.children[0];u&&a.prepend(u),We(l,"")}else a.prepend(o)};if(Array.isArray(e)){for(let o=0;o<e.length;o+=1){const l=e[o];l&&r(l)}i=n+e.length}else r(e);t.recalcSlides(),s.loop&&t.loopCreate(),(!s.observer||t.isElement)&&t.update(),t.slideTo(i,0,!1)}function Jl(){const e=this,t=[];for(let s=0;s<e.slides.length;s+=1)t.push(s);e.removeSlide(t)}function Ql(e){const t=this,{params:s,activeIndex:n}=t;let a=n;s.loop&&(a-=t.loopedSlides??0,t.loopDestroy());let i=a;if(Array.isArray(e)){for(let r=0;r<e.length;r+=1){const o=e[r];t.slides[o]&&t.slides[o].remove(),o<i&&(i-=1)}i=Math.max(i,0)}else{const r=e;t.slides[r]&&t.slides[r].remove(),r<i&&(i-=1),i=Math.max(i,0)}t.recalcSlides(),s.loop&&t.loopCreate(),(!s.observer||t.isElement)&&t.update(),s.loop?t.slideTo(i+(t.loopedSlides??0),0,!1):t.slideTo(i,0,!1)}const Zl=({swiper:e})=>{Object.assign(e,{appendSlide:Xl.bind(e),prependSlide:Yl.bind(e),addSlide:Kl.bind(e),removeSlide:Ql.bind(e),removeAllSlides:Jl.bind(e)})};function er(e){const{effect:t,swiper:s,on:n,setTranslate:a,setTransition:i,overwriteParams:r,perspective:o,recreateShadows:l,getEffectParams:u}=e;n("beforeInit",()=>{if(s.params.effect!==t)return;s.classNames.push(`${s.params.containerModifierClass}${t}`),o&&o()&&s.classNames.push(`${s.params.containerModifierClass}3d`);const d=r?r():{};Object.assign(s.params,d),Object.assign(s.originalParams,d)}),n("setTranslate _virtualUpdated",()=>{s.params.effect===t&&a()}),n("setTransition",(d,f)=>{s.params.effect===t&&i(f)}),n("transitionEnd",()=>{if(s.params.effect===t&&l){const d=u?u():void 0;if(!d||!d.slideShadows)return;
16s.slides.forEach(f=>{f.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach(p=>p.remove())}),l()}});let c=!1;n("virtualUpdate",()=>{s.params.effect===t&&(s.slides.length||(c=!0),requestAnimationFrame(()=>{c&&s.slides&&s.slides.length&&(a(),c=!1)}))})}function kr(e,t){const s=$t(t);return s!==t&&(s.style.backfaceVisibility="hidden",s.style.setProperty("-webkit-backface-visibility","hidden")),s}function _r({swiper:e,duration:t,transformElements:s,allSlides:n}){const{activeIndex:a}=e,i=r=>{if(!r.parentElement)return e.slides.find(o=>o.shadowRoot&&o.shadowRoot===r.parentNode);if(r.parentElement instanceof HTMLElement)return r.parentElement};if(e.params.virtualTranslate&&t!==0){let r=!1,o;n?o=s:o=s.filter(l=>{const u=l.classList.contains("swiper-slide-transform")?i(l):l;return!!u&&e.getSlideIndex(u)===a}),o.forEach(l=>{gr(l,()=>{if(r||!e||e.destroyed)return;r=!0,e.animating=!1;const u=new CustomEvent("transitionend",{bubbles:!0,cancelable:!0});e.wrapperEl.dispatchEvent(u)})})}}const eu=({swiper:e,extendParams:t,on:s})=>{t({fadeEffect:{crossFade:!1,mode:"default"}});let n=0;function a(){return e.params.fadeEffect}function i(){const l=a();return l.mode==="default"&&l.crossFade?"cross-fade":l.mode}er({effect:"fade",swiper:e,on:s,setTranslate:()=>{const{slides:l}=e,u=a(),c=i(),d=c==="out-in"&&n>0,f=n;n=0;const p=[],h=[];let g=!1;for(let v=0;v<l.length;v+=1){const b=l[v];let m=-(b.swiperSlideOffset??0);e.params.virtualTranslate||(m-=e.translate);let S=0;e.isHorizontal()||(S=m,m=0);const k=b.progress??0;let C;c==="cross-fade"?C=Math.max(1-Math.abs(k),0):c==="out-in"?C=Math.max(1-2*Math.abs(k),0):C=1+Math.min(Math.max(k,-1),0);const L=kr(u,b);if(d){const _=parseFloat(L.style.opacity);C===0&&_>0&&(g=!0),C>0&&h.push(L),p.push(L)}L.style.opacity=String(C),L.style.transform=`translate3d(${m}px, ${S}px, 0px)`}d&&(p.forEach(v=>{const b=g&&h.includes(v);v.style.transitionDuration=`${f/2}ms`,v.style.transitionDelay=b?`${f/2}ms`:"0ms"}),_r({swiper:e,duration:f,transformElements:h,allSlides:!0}))},setTransition:l=>{const u=i(),c=e.slides.map(d=>$t(d));if(c.forEach(d=>{d.style.transitionDuration=`${l}ms`,u==="out-in"&&l===0&&(d.style.transitionDelay="")}),u==="out-in"&&l>0&&!e.params.cssMode){n=l;return}_r({swiper:e,duration:l,transformElements:c,allSlides:!0})},overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!e.params.cssMode})})},tu=({swiper:e,extendParams:t,on:s})=>{t({cubeEffect:{slideShadows:!0,shadow:!0,shadowOffset:20,shadowScale:.94}});function n(){return e.params.cubeEffect}const a=(l,u,c)=>{let d=c?l.querySelector(".swiper-slide-shadow-left"):l.querySelector(".swiper-slide-shadow-top"),f=c?l.querySelector(".swiper-slide-shadow-right"):l.querySelector(".swiper-slide-shadow-bottom");d||(d=Ge("div",`swiper-slide-shadow-cube swiper-slide-shadow-${c?"left":"top"}`.split(" ")),l.append(d)),f||(f=Ge("div",`swiper-slide-shadow-cube swiper-slide-shadow-${c?"right":"bottom"}`.split(" ")),l.append(f)),d&&(d.style.opacity=String(Math.max(-u,0))),f&&(f.style.opacity=String(Math.max(u,0)))};er({effect:"cube",swiper:e,on:s,setTranslate:()=>{var k;const{el:l,wrapperEl:u,slides:c,width:d,height:f,rtlTranslate:p,size:h}=e,g=Zr(e),v=n(),b=e.isHorizontal(),y=!!(e.virtual&&((k=e.params.virtual)!=null&&k.enabled));let m=0,S=null;v.shadow&&(b?(S=e.wrapperEl.querySelector(".swiper-cube-shadow"),S||(S=Ge("div","swiper-cube-shadow"),e.wrapperEl.append(S)),S.style.height=`${d}px`):(S=l.querySelector(".swiper-cube-shadow"),S||(S=Ge("div","swiper-cube-shadow"),l.append(S))));for(let C=0;C<c.length;C+=1){const L=c[C];let _=C;y&&(_=parseInt(L.getAttribute("data-swiper-slide-index")??"0",10));let E=_*90,q=Math.floor(E/360);p&&(E=-E,q=Math.floor(-E/360));const A=Math.max(Math.min(L.progress??0,1),-1);let R=0,T=0,P=0;_%4===0?(R=-q*4*h,P=0):(_-1)%4===0?(R=0,P=-q*4*h):(_-2)%4===0?(R=h+q*4*h,P=h):(_-3)%4===0&&(R=-h,P=3*h+h*4*q),p&&(R=-R),b||(T=R,R=0);const z=`rotateX(${g(b?0:-E)}deg) rotateY(${g(b?E:0)}deg) translate3d(${R}px, ${T}px, ${P}px)`;A<=1&&A>-1&&(m=_*90+A*90,p&&(m=-_*90-A*90)),L.style.transform=z,v.slideShadows&&a(L,A,b)}if(u.style.transformOrigin=`50% 50% -${h/2}px`,u.style.setProperty("-webkit-transform-origin",`50% 50% -${h/2}px`),v.shadow&&S)if(b)S.style.transform=`translate3d(0px, ${d/2+v.shadowOffset}px, ${-d/2}px) rotateX(89.99deg) rotateZ(0deg) scale(${v.shadowScale})`;else{const C=Math.abs(m)-Math.floor(Math.abs(m)/90)*90,L=1.5-(Math.sin(C*2*Math.PI/360)/2+Math.cos(C*2*Math.PI/360)/2),_=v.shadowScale,E=v.shadowScale/L,q=v.shadowOffset;S.style.transform=`scale3d(${_}, 1, ${E}) translate3d(0px, ${f/2+q}px, ${-f/2/E}px) rotateX(-89.99deg)`}u.style.transform=`translate3d(0px,0,0px) rotateX(${g(e.isHorizontal()?0:m)}deg) rotateY(${g(e.isHorizontal()?-m:0)}deg)`,u.style.setProperty("--swiper-cube-translate-z","0px")},setTransition:l=>{var d;const{el:u,slides:c}=e;if(c.forEach(f=>{f.style.transitionDuration=`${l}ms`,f.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach(p=>{p.style.transitionDuration=`${l}ms`})}),(d=e.params.cubeEffect)!=null&&d.shadow&&!e.isHorizontal()){const f=u.querySelector(".swiper-cube-shadow");f&&(f.style.transitionDuration=`${l}ms`)}},recreateShadows:()=>{const l=e.isHorizontal();
16e.slides.forEach(u=>{const c=Math.max(Math.min(u.progress??0,1),-1);a(u,c,l)})},getEffectParams:()=>e.params.cubeEffect,perspective:()=>!0,overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,resistanceRatio:0,spaceBetween:0,centeredSlides:!1,virtualTranslate:!0})})};function Qt(e,t,s){const n=`swiper-slide-shadow${s?`-${s}`:""}${e?` swiper-slide-shadow-${e}`:""}`,a=$t(t),i=`.${n.split(" ").join(".")}`,r=a.querySelector(i);if(r)return r;const o=Ge("div",n.split(" "));return a.append(o),o}const ru=({swiper:e,extendParams:t,on:s})=>{t({flipEffect:{slideShadows:!0,limitRotation:!0}});function n(){return e.params.flipEffect}const a=(l,u)=>{let c=e.isHorizontal()?l.querySelector(".swiper-slide-shadow-left"):l.querySelector(".swiper-slide-shadow-top"),d=e.isHorizontal()?l.querySelector(".swiper-slide-shadow-right"):l.querySelector(".swiper-slide-shadow-bottom");c||(c=Qt("flip",l,e.isHorizontal()?"left":"top")),d||(d=Qt("flip",l,e.isHorizontal()?"right":"bottom")),c&&(c.style.opacity=String(Math.max(-u,0))),d&&(d.style.opacity=String(Math.max(u,0)))};er({effect:"flip",swiper:e,on:s,setTranslate:()=>{const{slides:l,rtlTranslate:u}=e,c=n(),d=Zr(e);for(let f=0;f<l.length;f+=1){const p=l[f];let h=p.progress??0;c.limitRotation&&(h=Math.max(Math.min(h,1),-1));const g=p.swiperSlideOffset??0;let b=-180*h,y=0,m=e.params.cssMode?-g-e.translate:-g,S=0;e.isHorizontal()?u&&(b=-b):(S=m,m=0,y=-b,b=0),p.style.zIndex=String(-Math.abs(Math.round(h))+l.length),c.slideShadows&&a(p,h);const k=`translate3d(${m}px, ${S}px, 0px) rotateX(${d(y)}deg) rotateY(${d(b)}deg)`,C=kr(c,p);C.style.transform=k}},setTransition:l=>{const u=e.slides.map(c=>$t(c));u.forEach(c=>{c.style.transitionDuration=`${l}ms`,c.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach(d=>{d.style.transitionDuration=`${l}ms`})}),_r({swiper:e,duration:l,transformElements:u})},recreateShadows:()=>{const l=n();e.slides.forEach(u=>{let c=u.progress??0;l.limitRotation&&(c=Math.max(Math.min(c,1),-1)),a(u,c)})},getEffectParams:()=>e.params.flipEffect,perspective:()=>!0,overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!e.params.cssMode})})},su=({swiper:e,extendParams:t,on:s})=>{t({coverflowEffect:{rotate:50,stretch:0,depth:100,scale:1,modifier:1,slideShadows:!0}});function n(){return e.params.coverflowEffect}er({effect:"coverflow",swiper:e,on:s,setTranslate:()=>{const{width:r,height:o,slides:l,slidesSizesGrid:u}=e,c=n(),d=e.isHorizontal(),f=e.translate,p=d?-f+r/2:-f+o/2,h=d?c.rotate:-c.rotate,g=c.depth,v=Zr(e);for(let b=0,y=l.length;b<y;b+=1){const m=l[b],S=u[b],k=m.swiperSlideOffset??0,C=(p-k-S/2)/S,L=typeof c.modifier=="function"?c.modifier(C):C*c.modifier;let _=d?h*L:0,E=d?0:h*L,q=-g*Math.abs(L),A=typeof c.stretch=="string"&&c.stretch.indexOf("%")!==-1?parseFloat(c.stretch)/100*S:c.stretch,R=d?0:A*L,T=d?A*L:0,P=1-(1-c.scale)*Math.abs(L);Math.abs(T)<.001&&(T=0),Math.abs(R)<.001&&(R=0),Math.abs(q)<.001&&(q=0),Math.abs(_)<.001&&(_=0),Math.abs(E)<.001&&(E=0),Math.abs(P)<.001&&(P=0);const z=`translate3d(${T}px,${R}px,${q}px)  rotateX(${v(E)}deg) rotateY(${v(_)}deg) scale(${P})`,V=kr(c,m);if(V.style.transform=z,m.style.zIndex=String(-Math.abs(Math.round(L))+1),c.slideShadows){let G=d?m.querySelector(".swiper-slide-shadow-left"):m.querySelector(".swiper-slide-shadow-top"),X=d?m.querySelector(".swiper-slide-shadow-right"):m.querySelector(".swiper-slide-shadow-bottom");G||(G=Qt("coverflow",m,d?"left":"top")),X||(X=Qt("coverflow",m,d?"right":"bottom")),G&&(G.style.opacity=String(L>0?L:0)),X&&(X.style.opacity=String(-L>0?-L:0))}}},setTransition:r=>{e.slides.map(l=>$t(l)).forEach(l=>{l.style.transitionDuration=`${r}ms`,l.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach(u=>{u.style.transitionDuration=`${r}ms`})})},perspective:()=>!0,overwriteParams:()=>({watchSlidesProgress:!0})})},nu=({swiper:e,extendParams:t,on:s})=>{t({creativeEffect:{limitProgress:1,shadowPerProgress:!1,progressMultiplier:1,perspective:!0,prev:{translate:[0,0,0],rotate:[0,0,0],opacity:1,scale:1},next:{translate:[0,0,0],rotate:[0,0,0],opacity:1,scale:1}}});function n(){return e.params.creativeEffect}const a=o=>
16typeof o=="string"?o:`${o}px`;er({effect:"creative",swiper:e,on:s,setTranslate:()=>{const{slides:o,wrapperEl:l,slidesSizesGrid:u}=e,c=n(),{progressMultiplier:d}=c,f=e.params.centeredSlides,p=Zr(e);if(f){const h=u[0]/2-(e.params.slidesOffsetBefore??0);l.style.transform=`translateX(calc(50% - ${h}px))`}for(let h=0;h<o.length;h+=1){const g=o[h],v=g.progress??0,b=Math.min(Math.max(v,-c.limitProgress),c.limitProgress);let y=b;f||(y=Math.min(Math.max(g.originalProgress??0,-c.limitProgress),c.limitProgress));const m=g.swiperSlideOffset??0,S=[e.params.cssMode?-m-e.translate:-m,0,0],k=[0,0,0];let C=!1;e.isHorizontal()||(S[1]=S[0],S[0]=0);let L={translate:[0,0,0],rotate:[0,0,0],scale:1,opacity:1};b<0?(L=c.next,C=!0):b>0&&(L=c.prev,C=!0),S.forEach((P,z)=>{S[z]=`calc(${P}px + (${a(L.translate[z])} * ${Math.abs(b*d)}))`}),k.forEach((P,z)=>{k[z]=L.rotate[z]*Math.abs(b*d)}),g.style.zIndex=String(-Math.abs(Math.round(v))+o.length);const _=S.join(", "),E=`rotateX(${p(k[0])}deg) rotateY(${p(k[1])}deg) rotateZ(${p(k[2])}deg)`,q=y<0?`scale(${1+(1-L.scale)*y*d})`:`scale(${1-(1-L.scale)*y*d})`,A=y<0?1+(1-L.opacity)*y*d:1-(1-L.opacity)*y*d,R=`translate3d(${_}) ${E} ${q}`;if(C&&L.shadow||!C){let P=g.querySelector(".swiper-slide-shadow");if(!P&&L.shadow&&(P=Qt("creative",g)),P){const z=c.shadowPerProgress?b*(1/c.limitProgress):b;P.style.opacity=String(Math.min(Math.max(Math.abs(z),0),1))}}const T=kr(c,g);T.style.transform=R,T.style.opacity=String(A),L.origin&&(T.style.transformOrigin=L.origin)}},setTransition:o=>{const l=e.slides.map(u=>$t(u));l.forEach(u=>{u.style.transitionDuration=`${o}ms`,u.querySelectorAll(".swiper-slide-shadow").forEach(c=>{c.style.transitionDuration=`${o}ms`})}),_r({swiper:e,duration:o,transformElements:l,allSlides:!0})},perspective:()=>n().perspective,overwriteParams:()=>({watchSlidesProgress:!0,virtualTranslate:!e.params.cssMode})})},iu=({swiper:e,extendParams:t,on:s})=>{t({cardsEffect:{slideShadows:!0,rotate:!0,perSlideRotate:2,perSlideOffset:8}});function n(){return e.params.cardsEffect}er({effect:"cards",swiper:e,on:s,setTranslate:()=>{var p;const{slides:r,activeIndex:o,rtlTranslate:l}=e,u=n(),{startTranslate:c,isTouched:d}=e.touchEventsData,f=l?-e.translate:e.translate;for(let h=0;h<r.length;h+=1){const g=r[h],v=g.progress??0,b=Math.min(Math.max(v,-4),4);let y=g.swiperSlideOffset??0;e.params.centeredSlides&&!e.params.cssMode&&(e.wrapperEl.style.transform=`translateX(${e.minTranslate()}px)`),e.params.centeredSlides&&e.params.cssMode&&(y-=r[0].swiperSlideOffset??0);let m=e.params.cssMode?-y-e.translate:-y,S=0;const k=-100*Math.abs(b);let C=1,L=-u.perSlideRotate*b,_=u.perSlideOffset-Math.abs(b)*.75;const E=e.virtual&&((p=e.params.virtual)!=null&&p.enabled)?e.virtual.from+h:h,q=(E===o||E===o-1)&&b>0&&b<1&&(d||e.params.cssMode)&&(f??0)<(c??0),A=(E===o||E===o+1)&&b<0&&b>-1&&(d||e.params.cssMode)&&(f??0)>(c??0);if(q||A){const z=(1-Math.abs((Math.abs(b)-.5)/.5))**.5;L+=-28*b*z,C+=-.5*z,_+=96*z,S=`${(u.rotate||e.isHorizontal()?-25:0)*z*Math.abs(b)}%`}if(b<0?m=`calc(${m}px ${l?"-":"+"} (${_*Math.abs(b)}%))`:b>0?m=`calc(${m}px ${l?"-":"+"} (${-_*Math.abs(b)}%))`:m=`${m}px`,!e.isHorizontal()){const z=S;S=m,m=z}const R=b<0?`${1+(1-C)*b}`:`${1-(1-C)*b}`,T=`
17        translate3d(${m}, ${S}, ${k}px)
18        rotateZ(${u.rotate?l?-L:L:0}deg)
19        scale(${R})
20      `;if(u.slideShadows){let z=g.querySelector(".swiper-slide-shadow");z||(z=Qt("cards",g)),z&&(z.style.opacity=String(Math.min(Math.max((Math.abs(b)-.5)/.5,0),1)))}g.style.zIndex=String(-Math.abs(Math.round(v))+r.length);const P=kr(u,g);P.style.transform=T}},setTransition:r=>{const o=e.slides.map(l=>$t(l));o.forEach(l=>{l.style.transitionDuration=`${r}ms`,l.querySelectorAll(".swiper-slide-shadow").forEach(u=>{u.style.transitionDuration=`${r}ms`})}),_r({swiper:e,duration:r,transformElements:o})},perspective:()=>!0,overwriteParams:()=>({_loopSwapReset:!1,watchSlidesProgress:!0,loopAdditionalSlides:n().rotate?3:2,centeredSlides:!0,virtualTranslate:!e.params.cssMode})})},au=[Ol,Al,Rl,Ll,Fl,Dl,$l,jl,Nl,Bl,Hl,Ul,ql,Vl,Gl,Wl,Zl,eu,tu,ru,su,nu,iu];bt.use(au);const ou='
vendor: 8,129 bytes, line 20
20:host{--swiper-theme-color:#007aff}:host{display:block;margin-left:auto;margin-right:auto;position:relative;z-index:1}.swiper{display:block;height:100%;list-style:none;margin-left:auto;margin-right:auto;overflow:hidden;padding:0;position:relative;width:100%;z-index:1}.swiper-vertical>.swiper-wrapper{flex-direction:column}.swiper-wrapper{box-sizing:initial;display:flex;height:100%;position:relative;transition-property:transform;transition-timing-function:var(--swiper-wrapper-transition-timing-function,initial);width:100%;z-index:1}.swiper-android ::slotted(swiper-slide),.swiper-ios ::slotted(swiper-slide),.swiper-wrapper{transform:translateZ(0)}.swiper-horizontal{touch-action:pan-y}.swiper-vertical{touch-action:pan-x}::slotted(swiper-slide){display:block;flex-shrink:0;height:100%;position:relative;transition-property:transform;width:100%}::slotted(.swiper-slide-invisible-blank){visibility:hidden}.swiper-autoheight,.swiper-autoheight ::slotted(swiper-slide){height:auto}.swiper-autoheight .swiper-wrapper{align-items:flex-start;transition-property:transform,height}.swiper-backface-hidden ::slotted(swiper-slide){backface-visibility:hidden;transform:translateZ(0)}.swiper-3d.swiper-css-mode .swiper-wrapper{perspective:1200px}.swiper-3d .swiper-wrapper{transform-style:preserve-3d}.swiper-3d{perspective:1200px}.swiper-3d .swiper-cube-shadow,.swiper-3d ::slotted(swiper-slide){transform-style:preserve-3d}.swiper-css-mode>.swiper-wrapper{overflow:auto;scrollbar-width:none;-ms-overflow-style:none}.swiper-css-mode>.swiper-wrapper::-webkit-scrollbar{display:none}.swiper-css-mode ::slotted(swiper-slide){scroll-snap-align:start start}.swiper-css-mode.swiper-horizontal>.swiper-wrapper{scroll-snap-type:x mandatory}.swiper-css-mode.swiper-horizontal ::slotted(swiper-slide):first-child{margin-inline-start:var(--swiper-slides-offset-before);scroll-margin-inline-start:var(--swiper-slides-offset-before)}.swiper-css-mode.swiper-horizontal ::slotted(swiper-slide):last-child{margin-inline-end:var(--swiper-slides-offset-after)}.swiper-css-mode.swiper-vertical>.swiper-wrapper{scroll-snap-type:y mandatory}.swiper-css-mode.swiper-vertical ::slotted(swiper-slide):first-child{margin-block-start:var(--swiper-slides-offset-before);scroll-margin-block-start:var(--swiper-slides-offset-before)}.swiper-css-mode.swiper-vertical ::slotted(swiper-slide):last-child{margin-block-end:var(--swiper-slides-offset-after)}.swiper-css-mode.swiper-free-mode>.swiper-wrapper{scroll-snap-type:none}.swiper-css-mode.swiper-free-mode ::slotted(swiper-slide){scroll-snap-align:none}.swiper-css-mode.swiper-centered>.swiper-wrapper:before{content:"";flex-shrink:0;order:9999}.swiper-css-mode.swiper-centered ::slotted(swiper-slide){scroll-snap-align:center center;scroll-snap-stop:always}.swiper-css-mode.swiper-centered.swiper-horizontal ::slotted(swiper-slide):first-child{margin-inline-start:var(--swiper-centered-offset-before)}.swiper-css-mode.swiper-centered.swiper-horizontal>.swiper-wrapper:before{height:100%;min-height:1px;width:var(--swiper-centered-offset-after)}.swiper-css-mode.swiper-centered.swiper-vertical ::slotted(swiper-slide):first-child{margin-block-start:var(--swiper-centered-offset-before)}.swiper-css-mode.swiper-centered.swiper-vertical>.swiper-wrapper:before{height:var(--swiper-centered-offset-after);min-width:1px;width:100%}.swiper-virtual ::slotted(swiper-slide){-webkit-backface-visibility:hidden;transform:translateZ(0)}.swiper-virtual.swiper-css-mode .swiper-wrapper:after{content:"";left:0;pointer-events:none;position:absolute;top:0}.swiper-virtual.swiper-css-mode.swiper-horizontal .swiper-wrapper:after{height:1px;width:var(--swiper-virtual-size)}.swiper-virtual.swiper-css-mode.swiper-vertical .swiper-wrapper:after{height:var(--swiper-virtual-size);width:1px}:host{--swiper-navigation-size:44px}.swiper-button-next,.swiper-button-prev{align-items:center;color:var(--swiper-navigation-color,var(--swiper-theme-color));cursor:pointer;display:flex;height:var(--swiper-navigation-size);justify-content:center;position:absolute;width:var(--swiper-navigation-size);z-index:10}.swiper-button-next.swiper-button-disabled,.swiper-button-prev.swiper-button-disabled{cursor:auto;opacity:.35;pointer-events:none}.swiper-button-next.swiper-button-hidden,.swiper-button-prev.swiper-button-hidden{cursor:auto;opacity:0;pointer-events:none}.swiper-navigation-disabled .swiper-button-next,.swiper-navigation-disabled .swiper-button-prev{display:none!important}.swiper-button-next ::slotted(svg),.swiper-button-next svg,.swiper-button-prev ::slotted(svg),.swiper-button-prev svg{height:100%;object-fit:contain;transform-origin:center;width:100%;fill:currentColor;pointer-events:none}.swiper-button-lock{display:none}.swiper-button-next,.swiper-button-prev{margin-top:calc(0px - var(--swiper-navigation-size)/2);top:var(--swiper-navigation-top-offset,50%)}.swiper-button-prev{left:var(--swiper-navigation-sides-offset,4px);right:auto}.swiper-button-prev .swiper-navigation-icon,.swiper-button-prev ::slotted(.swiper-navigation-icon){transform:rotate(180deg)}.swiper-button-next{left:auto;right:var(--swiper-navigation-sides-offset,4px)}.swiper-horizontal .swiper-button-next,.swiper-horizontal .swiper-button-prev,.swiper-horizontal~.swiper-button-next,.swiper-horizontal~.swiper-button-prev{margin-left:0;margin-top:calc(0px - var(--swiper-navigation-size)/2);top:var(--swiper-navigation-top-offset,50%)}.swiper-horizontal .swiper-button-prev,.swiper-horizontal.swiper-rtl .swiper-button-next,.swiper-horizontal.swiper-rtl~.swiper-button-next,.swiper-horizontal~.swiper-button-prev{left:var(--swiper-navigation-sides-offset,4px);right:auto}.swiper-horizontal .swiper-button-next,.swiper-horizontal.swiper-rtl .swiper-button-prev,.swiper-horizontal.swiper-rtl~.swiper-button-prev,.swiper-horizontal~.swiper-button-next{left:auto;right:var(--swiper-navigation-sides-offset,4px)}.swiper-horizontal .swiper-button-prev .swiper-navigation-icon,.swiper-horizontal .swiper-button-prev ::slotted(.swiper-navigation-icon),.swiper-horizontal.swiper-rtl .swiper-button-next .swiper-navigation-icon,.swiper-horizontal.swiper-rtl .swiper-button-next ::slotted(.swiper-navigation-icon),.swiper-horizontal.swiper-rtl~.swiper-button-next .swiper-navigation-icon,.swiper-horizontal.swiper-rtl~.swiper-button-next ::slotted(.swiper-navigation-icon),.swiper-horizontal~.swiper-button-prev .swiper-navigation-icon,.swiper-horizontal~.swiper-button-prev ::slotted(.swiper-navigation-icon){transform:rotate(180deg)}.swiper-horizontal.swiper-rtl .swiper-button-prev .swiper-navigation-icon,.swiper-horizontal.swiper-rtl .swiper-button-prev ::slotted(.swiper-navigation-icon),.swiper-horizontal.swiper-rtl~.swiper-button-prev .swiper-navigation-icon,.swiper-horizontal.swiper-rtl~.swiper-button-prev ::slotted(.swiper-navigation-icon){transform:rotate(0deg)}.swiper-vertical .swiper-button-next,.swiper-vertical .swiper-button-prev,.swiper-vertical~.swiper-button-next,.swiper-vertical~.swiper-button-prev{left:var(--swiper-navigation-top-offset,50%);margin-left:calc(0px - var(--swiper-navigation-size)/2);margin-top:0;right:auto}.swiper-vertical .swiper-button-prev,.swiper-vertical~.swiper-button-prev{bottom:auto;top:var(--swiper-navigation-sides-offset,4px)}.swiper-vertical .swiper-button-prev .swiper-navigation-icon,.swiper-vertical .swiper-button-prev ::slotted(.swiper-navigation-icon),.swiper-vertical~.swiper-button-prev .swiper-navigation-icon,.swiper-vertical~.swiper-button-prev ::slotted(.swiper-navigation-icon){transform:rotate(-90deg)}.swiper-vertical .swiper-button-next,.swiper-vertical~.swiper-button-next{bottom:var(--swiper-navigation-sides-offset,4px);top:auto}.swiper-vertical .swiper-button-next .swiper-navigation-icon,.swiper-vertical .swiper-button-next ::slotted(.swiper-navigation-icon),.swiper-vertical~.swiper-button-next .swiper-navigation-icon,.swiper-vertical~.swiper-button-next ::slotted(.swiper-navigation-icon){transform:rotate(90deg)}.swiper-pagination{position:absolute;text-align:center;transform:translateZ(0);transition:opacity .3s;z-index:10}.swiper-pagination.swiper-pagination-hidden{opacity:0}
vendor: 8,569 bytes, line 20
20.swiper-pagination-disabled>.swiper-pagination,.swiper-pagination.swiper-pagination-disabled{display:none!important}.swiper-horizontal>.swiper-pagination-bullets,.swiper-pagination-bullets.swiper-pagination-horizontal,.swiper-pagination-custom,.swiper-pagination-fraction{bottom:var(--swiper-pagination-bottom,8px);left:0;top:var(--swiper-pagination-top,auto);width:100%}.swiper-pagination-bullets-dynamic{font-size:0;overflow:hidden}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{position:relative;transform:scale(.33)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active,.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-main{transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev{transform:scale(.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev-prev{transform:scale(.33)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next{transform:scale(.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next-next{transform:scale(.33)}.swiper-pagination-bullet{background:var(--swiper-pagination-bullet-inactive-color,#000);border-radius:var(--swiper-pagination-bullet-border-radius,50%);display:inline-block;height:var(--swiper-pagination-bullet-height,var(--swiper-pagination-bullet-size,8px));opacity:var(--swiper-pagination-bullet-inactive-opacity,.2);width:var(--swiper-pagination-bullet-width,var(--swiper-pagination-bullet-size,8px))}button.swiper-pagination-bullet{appearance:none;border:none;box-shadow:none;margin:0;padding:0}.swiper-pagination-clickable .swiper-pagination-bullet{cursor:pointer}.swiper-pagination-bullet:only-child{display:none!important}.swiper-pagination-bullet-active{background:var(--swiper-pagination-color,var(--swiper-theme-color));opacity:var(--swiper-pagination-bullet-opacity,1)}.swiper-pagination-vertical.swiper-pagination-bullets,.swiper-vertical>.swiper-pagination-bullets{left:var(--swiper-pagination-left,auto);right:var(--swiper-pagination-right,8px);top:50%;transform:translate3d(0,-50%,0)}.swiper-pagination-vertical.swiper-pagination-bullets .swiper-pagination-bullet,.swiper-vertical>.swiper-pagination-bullets .swiper-pagination-bullet{display:block;margin:var(--swiper-pagination-bullet-vertical-gap,6px) 0}.swiper-pagination-vertical.swiper-pagination-bullets.swiper-pagination-bullets-dynamic,.swiper-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{top:50%;transform:translateY(-50%);width:8px}.swiper-pagination-vertical.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,.swiper-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{display:inline-block;transition:transform .2s,top .2s}.swiper-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet,.swiper-pagination-horizontal.swiper-pagination-bullets .swiper-pagination-bullet{margin:0 var(--swiper-pagination-bullet-horizontal-gap,4px)}.swiper-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic,.swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{left:50%;transform:translateX(-50%);white-space:nowrap}.swiper-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,.swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transition:transform .2s,left .2s}.swiper-horizontal.swiper-rtl>.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transition:transform .2s,right .2s}.swiper-pagination-fraction{color:var(--swiper-pagination-fraction-color,inherit)}.swiper-pagination-progressbar{background:var(--swiper-pagination-progressbar-bg-color,#00000040);position:absolute}.swiper-pagination-progressbar .swiper-pagination-progressbar-fill{background:var(--swiper-pagination-color,var(--swiper-theme-color));height:100%;left:0;position:absolute;top:0;transform:scale(0);transform-origin:left top;width:100%}.swiper-rtl .swiper-pagination-progressbar .swiper-pagination-progressbar-fill{transform-origin:right top}.swiper-horizontal>.swiper-pagination-progressbar,.swiper-pagination-progressbar.swiper-pagination-horizontal,.swiper-pagination-progressbar.swiper-pagination-vertical.swiper-pagination-progressbar-opposite,.swiper-vertical>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite{height:var(--swiper-pagination-progressbar-size,4px);left:0;top:0;width:100%}.swiper-horizontal>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite,.swiper-pagination-progressbar.swiper-pagination-horizontal.swiper-pagination-progressbar-opposite,.swiper-pagination-progressbar.swiper-pagination-vertical,.swiper-vertical>.swiper-pagination-progressbar{height:100%;left:0;top:0;width:var(--swiper-pagination-progressbar-size,4px)}.swiper-pagination-lock{display:none}.swiper-scrollbar{background:var(--swiper-scrollbar-bg-color,#0000001a);border-radius:var(--swiper-scrollbar-border-radius,10px);position:relative;touch-action:none}.swiper-scrollbar-disabled>.swiper-scrollbar,.swiper-scrollbar.swiper-scrollbar-disabled{display:none!important}.swiper-horizontal>.swiper-scrollbar,.swiper-scrollbar.swiper-scrollbar-horizontal{bottom:var(--swiper-scrollbar-bottom,4px);height:var(--swiper-scrollbar-size,4px);left:var(--swiper-scrollbar-sides-offset,1%);position:absolute;top:var(--swiper-scrollbar-top,auto);width:calc(100% - var(--swiper-scrollbar-sides-offset, 1%)*2);z-index:50}.swiper-scrollbar.swiper-scrollbar-vertical,.swiper-vertical>.swiper-scrollbar{height:calc(100% - var(--swiper-scrollbar-sides-offset, 1%)*2);left:var(--swiper-scrollbar-left,auto);position:absolute;right:var(--swiper-scrollbar-right,4px);top:var(--swiper-scrollbar-sides-offset,1%);width:var(--swiper-scrollbar-size,4px);z-index:50}.swiper-scrollbar-drag{background:var(--swiper-scrollbar-drag-bg-color,#00000080);border-radius:var(--swiper-scrollbar-border-radius,10px);height:100%;left:0;position:relative;top:0;width:100%}.swiper-scrollbar-cursor-drag{cursor:move}.swiper-scrollbar-lock{display:none}::slotted(.swiper-slide-zoomed){cursor:move;touch-action:none}.swiper .swiper-notification{left:0;opacity:0;pointer-events:none;position:absolute;top:0;z-index:-1000}.swiper-free-mode>.swiper-wrapper{margin:0 auto;transition-timing-function:ease-out}.swiper-grid>.swiper-wrapper{flex-wrap:wrap}.swiper-grid-column>.swiper-wrapper{flex-direction:column;flex-wrap:wrap}.swiper-fade.swiper-free-mode ::slotted(swiper-slide){transition-timing-function:ease-out}.swiper-fade ::slotted(swiper-slide){pointer-events:none;transition-property:opacity}.swiper-fade ::slotted(swiper-slide) ::slotted(swiper-slide){pointer-events:none}.swiper-fade ::slotted(.swiper-slide-active){pointer-events:auto}.swiper-fade ::slotted(.swiper-slide-active) ::slotted(.swiper-slide-active){pointer-events:auto}.swiper.swiper-cube{overflow:visible}.swiper-cube ::slotted(swiper-slide){backface-visibility:hidden;height:100%;pointer-events:none;transform-origin:0 0;visibility:hidden;width:100%;z-index:1}.swiper-cube ::slotted(swiper-slide) ::slotted(swiper-slide){pointer-events:none}.swiper-cube.swiper-rtl ::slotted(swiper-slide){transform-origin:100% 0}.swiper-cube ::slotted(.swiper-slide-active),.swiper-cube ::slotted(.swiper-slide-active) ::slotted(.swiper-slide-active){pointer-events:auto}.swiper-cube ::slotted(.swiper-slide-active),.swiper-cube ::slotted(.swiper-slide-next),.swiper-cube ::slotted(.swiper-slide-prev){pointer-events:auto;visibility:visible}.swiper-cube .swiper-cube-shadow{bottom:0;height:100%;left:0;opacity:.6;position:absolute;width:100%;z-index:0}.swiper-cube .swiper-cube-shadow:before{background:#000;bottom:0;content:"";filter:blur(50px);left:0;position:absolute;right:0;top:0}.swiper-cube ::slotted(.swiper-slide-next)+::slotted(swiper-slide){pointer-events:auto;visibility:visible}.swiper.swiper-flip{overflow:visible}.swiper-flip ::slotted(swiper-slide){backface-visibility:hidden;pointer-events:none;z-index:1}.swiper-flip ::slotted(swiper-slide) ::slotted(swiper-slide){pointer-events:none}.swiper-flip ::slotted(.swiper-slide-active),.swiper-flip ::slotted(.swiper-slide-active) ::slotted(.swiper-slide-active){pointer-events:auto}.swiper-creative ::slotted(swiper-slide){backface-visibility:hidden;overflow:hidden;transition-property:transform,opacity,height}.swiper.swiper-cards{overflow:visible}.swiper-cards ::slotted(swiper-slide){backface-visibility:hidden;overflow:hidden;transform-origin:center bottom}
20',lu="::slotted(.swiper-slide-shadow),::slotted(.swiper-slide-shadow-bottom),::slotted(.swiper-slide-shadow-left),::slotted(.swiper-slide-shadow-right),::slotted(.swiper-slide-shadow-top){height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:10}::slotted(.swiper-slide-shadow){background:#00000026}::slotted(.swiper-slide-shadow-left){background-image:linear-gradient(270deg,#00000080,#0000)}::slotted(.swiper-slide-shadow-right){background-image:linear-gradient(90deg,#00000080,#0000)}::slotted(.swiper-slide-shadow-top){background-image:linear-gradient(0deg,#00000080,#0000)}::slotted(.swiper-slide-shadow-bottom){background-image:linear-gradient(180deg,#00000080,#0000)}.swiper-lazy-preloader{animation:swiper-preloader-spin 1s linear infinite;border:4px solid var(--swiper-preloader-color,var(--swiper-theme-color));border-radius:50%;border-top:4px solid #0000;box-sizing:border-box;height:42px;left:50%;margin-left:-21px;margin-top:-21px;position:absolute;top:50%;transform-origin:50%;width:42px;z-index:10}@keyframes swiper-preloader-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}::slotted(.swiper-slide-shadow-cube.swiper-slide-shadow-bottom),::slotted(.swiper-slide-shadow-cube.swiper-slide-shadow-left),::slotted(.swiper-slide-shadow-cube.swiper-slide-shadow-right),::slotted(.swiper-slide-shadow-cube.swiper-slide-shadow-top){backface-visibility:hidden;z-index:0}::slotted(.swiper-slide-shadow-flip.swiper-slide-shadow-bottom),::slotted(.swiper-slide-shadow-flip.swiper-slide-shadow-left),::slotted(.swiper-slide-shadow-flip.swiper-slide-shadow-right),::slotted(.swiper-slide-shadow-flip.swiper-slide-shadow-top){backface-visibility:hidden;z-index:0}::slotted(.swiper-zoom-container){align-items:center;display:flex;height:100%;justify-content:center;text-align:center;width:100%}::slotted(.swiper-zoom-container)>canvas,::slotted(.swiper-zoom-container)>img,::slotted(.swiper-zoom-container)>svg{max-height:100%;max-width:100%;object-fit:contain}";class uu{}const fi=typeof window>"u"||typeof HTMLElement>"u"?uu:HTMLElement,pi=(e,t)=>{if(typeof CSSStyleSheet<"u"&&e.adoptedStyleSheets){const s=new CSSStyleSheet;s.replaceSync(t),e.adoptedStyleSheets=[s]}else{const s=document.createElement("style");s.textContent=t,e.appendChild(s)}};class gi extends fi{constructor(){super();Oe(this,"swiper");Oe(this,"swiperParams",{});Oe(this,"passedParams",{});Oe(this,"injectStyles");Oe(this,"injectStylesUrls");Oe(this,"slideSlots",0);Oe(this,"rendered");Oe(this,"nested");Oe(this,"init");this.attachShadow({mode:"open"})}cssStyles(){return[ou,...this.injectStyles&&Array.isArray(this.injectStyles)?this.injectStyles:[]].join(`
21`)}cssLinks(){return this.injectStylesUrls||[]}calcSlideSlots(){const s=this.slideSlots||0,n=[...this.querySelectorAll("[slot^=slide-]")].map(a=>parseInt(a.getAttribute("slot").split("slide-")[1],10));if(this.slideSlots=n.length?Math.max(...n)+1:0,!!this.rendered){if(this.slideSlots>s)for(let a=s;a<this.slideSlots;a+=1){const i=document.createElement("swiper-slide");i.setAttribute("part",`slide slide-${a+1}`);const r=document.createElement("slot");r.setAttribute("name",`slide-${a+1}`),i.appendChild(r),this.shadowRoot.querySelector(".swiper-wrapper").appendChild(i)}else if(this.slideSlots<s){const a=this.swiper.slides;for(let i=a.length-1;i>=0;i-=1)i>this.slideSlots&&a[i].remove()}}}render(){if(this.rendered)return;this.calcSlideSlots();let s=this.cssStyles();this.slideSlots>0&&(s=s.replace(/::slotted\(([a-z-0-9.]*)\)/g,"$1")),s.length&&pi(this.shadowRoot,s),this.cssLinks().forEach(a=>{if(this.shadowRoot.querySelector(`link[href="${a}"]`))return;const r=document.createElement("link");r.rel="stylesheet",r.href=a,this.shadowRoot.appendChild(r)});const n=document.createElement("div");n.classList.add("swiper"),n.part.add("container"),We(n,`
22      <slot name="container-start"></slot>
23      <div class="swiper-wrapper" part="wrapper">
24        <slot></slot>
25        ${Array.from({length:this.slideSlots}).map((a,i)=>`
26        <swiper-slide part="slide slide-${i}">
27          <slot name="slide-${i}"></slot>
28        </swiper-slide>
29        `).join("")}
30      </div>
31      <slot name="container-end"></slot>
32      ${Tl(this.passedParams)?`
33        <div part="button-prev" class="swiper-button-prev"><slot name="button-prev"></slot></div>
34        <div part="button-next" class="swiper-button-next"><slot name="button-next"></slot></div>
35      `:""}
36      ${kl(this.passedParams)?`
37        <div part="pagination" class="swiper-pagination"></div>
38      `:""}
39      ${Cl(this.passedParams)?`
40        <div part="scrollbar" class="swiper-scrollbar"></div>
41      `:""}
42    `),this.shadowRoot.appendChild(n),this.rendered=!0}initialize(){if(this.swiper&&this.swiper.initialized)return;const{params:s,passedParams:n}=xn(this);this.swiperParams=s,this.passedParams=n,delete this.swiperParams.init,this.render(),this.swiper=new bt(this.shadowRoot.querySelector(".swiper"),{...s.virtual?{}:{observer:!0},...s,touchEventsTarget:"container",onAny:(a,...i)=>{a==="observerUpdate"&&this.calcSlideSlots();const r=s.eventsPrefix?`${s.eventsPrefix}${a.toLowerCase()}`:a.toLowerCase(),o=new CustomEvent(r,{detail:i,bubbles:a!=="hashChange",cancelable:!0});this.dispatchEvent(o)}})}connectedCallback(){const s=this.closest("swiper-slide");this.swiper&&this.swiper.initialized&&this.nested&&s&&s.swiperLoopMoveDOM||this.init===!1||this.getAttribute("init")==="false"||this.initialize()}disconnectedCallback(){const s=this.closest("swiper-slide");this.nested&&s&&s.swiperLoopMoveDOM||this.swiper&&this.swiper.destroy&&this.swiper.destroy()}updateSwiperOnPropChange(s,n){const{params:a,passedParams:i}=xn(this,s,n);this.passedParams=i,this.swiperParams=a,!(this.swiper&&this.swiper.params[s]===n)&&Pl({swiper:this.swiper,passedParams:this.passedParams,changedParams:[qr(s)],...s==="navigation"&&i[s]?{prevEl:".swiper-button-prev",nextEl:".swiper-button-next"}:{},...s==="pagination"&&i[s]?{paginationEl:".swiper-pagination"}:{},...s==="scrollbar"&&i[s]?{scrollbarEl:".swiper-scrollbar"}:{}})}attributeChangedCallback(s,n,a){if(!(this.swiper&&this.swiper.initialized))return;let i=a;n==="true"&&a===null&&(i=!1),this.updateSwiperOnPropChange(s,i)}static get observedAttributes(){return es.filter(s=>s.includes("_")).map(s=>s.replace(/[A-Z]/g,n=>`-${n}`).replace("_","").toLowerCase())}}es.forEach(e=>{if(e==="init")return;const t=e.replace("_","");Object.defineProperty(gi.prototype,t,{configurable:!0,get(){return(this.passedParams||{})[t]},set(s){this.passedParams||(this.passedParams={}),this.passedParams[t]=s,this.swiper&&this.swiper.initialized&&this.updateSwiperOnPropChange(t,s)}})});class cu extends fi{constructor(){super();Oe(this,"lazy");Oe(this,"swiperLoopMoveDOM");this.attachShadow({mode:"open"})}render(){const s=this.lazy||this.getAttribute("lazy")===""||this.getAttribute("lazy")==="true";if(pi(this.shadowRoot,lu),this.shadowRoot.appendChild(document.createElement("slot")),s){const n=document.createElement("div");n.classList.add("swiper-lazy-preloader"),n.part.add("preloader"),this.shadowRoot.appendChild(n)}}initialize(){this.render()}connectedCallback(){this.swiperLoopMoveDOM||this.initialize()}}const du=()=>{typeof window>"u"||(window.customElements.get("swiper-container")||window.customElements.define("swiper-container",gi),window.customElements.get("swiper-slide")||window.customElements.define("swiper-slide",cu))};typeof window<"u"&&(window.SwiperElementRegisterParams=e=>{es.push(...e)});var ys=null;function Ys(){return ys||(ys=crypto.randomUUID()),ys}function Js(){try{var e=sessionStorage.getItem("_grow_sid");return e||(e=crypto.randomUUID(),sessionStorage.setItem("_grow_sid",e)),e}catch{return null}}var Qs="_grow_uid",hu=60*60*24*365;function mi(){try{var e=vi(Qs);if(e)return Ls(e),e;var t=crypto.randomUUID();return Ls(t),t}catch{return null}}function vi(e){for(var t=document.cookie||"",s=e+"=",n=t.split(";"),a=0;a<n.length;a++){var i=n[a].trim();if(i.indexOf(s)===0)return i.slice(s.length)}return null}var fu=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function pu(e){e=e||{};try{var t=e.location||(typeof location<"u"?location:null),s=e.history||(typeof history<"u"?history:null),n=t&&t.search||"";if(!n)return{action:"none"};var a=new URLSearchParams(n),i=a.get("_g");if(!i)return{action:"none"};a.delete("_g");var r=a.toString(),o=(t&&t.pathname||"/")+(r?"?"+r:"");if(s&&typeof s.replaceState=="function"&&s.replaceState(null,"",o),!fu.test(i))return{action:"invalid"};var l=vi(Qs);return l?l===i?{action:"noop"}:{action:"stitch",incoming:i,existing:l}:(Ls(i),{action:"adopt",userId:i})}catch{return{action:"none"}}}function Ls(e){var t=typeof location<"u"&&location.protocol==="https:"?"; Secure":"";document.cookie=Qs+"="+e+"; Max-Age="+hu+"; path=/; SameSite=Lax"+t}let Lr=null,gu=Js,mu=()=>typeof window<"u"&&window.location&&window.location.search||"";function vu(){try{return JSON.parse(document.body.dataset.udArmRates||"{}")}catch{return{}}}function yu(e){let t=2166136261;for(let s=0;s<e.length;s++)t^=e.charCodeAt(s),t=t+((t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24))>>>0;return t}function bu(){const e=gu()||"";return yu(e)%100}function wu(e,t){return typeof e!="number"||!(e>0)?"false":e>=1||t<e*100?"true":"false"}function _u(e){const t=mu()||"";if(!t)return;const n=new URLSearchParams(t.startsWith("?")?t.slice(1):t).get(e);if(n==="1")return"true";if(n==="0")return"false"}
42function Su(){if(Lr)return Lr;const e=vu(),t=bu();return Lr={lb_sticky_t:_u("sticky")||wu(e.sticky,t)},Lr}function Eu(){const e=Su();return document.body.dataset.lbStickyT=e.lb_sticky_t,e}function xu(){const e=Eu();window.googletag=window.googletag||{cmd:[]},window.googletag.cmd.push(function(){window.googletag.setConfig({targeting:e})})}function Tu(){const e=document.querySelector('meta[name="udx"]');if(!e)return null;const t=e.getAttribute("content");if(!t)return null;let s;try{s=JSON.parse(atob(t))}catch{return null}return!s||typeof s!="object"?null:s}function ku(){const e=Tu();e&&(window.googletag=window.googletag||{cmd:[]},window.googletag.cmd.push(function(){window.googletag.setConfig({targeting:e})}))}var tr={},yi=Object.prototype;tr.isEmpty=Cu;tr.isArray=Array.isArray||bi;tr.isObject=Pu;tr.has=wi;function Cu(e){if(e==null)return!0;if(bi(e)||typeof e=="string")return e.length===0;for(var t in e)if(wi(e,t))return!1;return!0}function bi(e){return yi.toString.call(e)==="[object Array]"}function Pu(e){return typeof e=="function"||typeof e=="object"&&!!e}function wi(e,t){return yi.hasOwnProperty.call(e,t)}var Ou=tr,Au={",":1,"/":2,"(":3,")":4},Is="\\",mr="*",Ru=Lu;function Lu(e){return e?Mu(Iu(e)):null}function Iu(e){var t=0,s=e.length,n=[],a="",i;function r(){a&&(n.push({tag:"_n",value:a}),a="")}for(;t<s;t++)i=e.charAt(t),i===Is?(t++,i=e.charAt(t),a+=i===mr?Is+mr:i):Au[i]?(r(),n.push({tag:i})):a+=i;return r(),n}function Mu(e){return _i(e,{})}function _i(e,t){for(var s={},n;n=e.shift();){if(n.tag==="_n"){if(n.type="object",n.properties=_i(e,n),t.hasChild)return Pn(n,s),s}else{if(n.tag===",")return s;if(n.tag==="("){t.type="array";continue}else{if(n.tag===")")return s;if(n.tag==="/"){t.hasChild=!0;continue}}}Pn(n,s)}return s}function Pn(e,t){var s={type:e.type};e.value===mr?s.isWildcard=!0:e.value===Is+mr&&(e.value=mr),Ou.isEmpty(e.properties)||(s.properties=e.properties),t[e.value]=s}var ct=tr,Fu=Du;function Du(e,t){return ct.isArray(e)?$u(e,t):Sr(e,t)}function $u(e,t){var s=Sr({_:e},{_:{type:"array",properties:t}});return s&&s._}function Sr(e,t){var s,n,a,i,r,o;if(!e||!t)return e;ct.isArray(e)?s=[]:ct.isObject(e)&&(s={});for(n in t)if(ct.has(t,n))if(a=t[n],i=void 0,o=a.type==="object"?Nu:Si,a.isWildcard){i=ju(e,a.properties,o);for(r in i)ct.has(i,r)&&(s[r]=i[r])}else i=o(e,n,a.properties),typeof i<"u"&&(s[n]=i);return s}function ju(e,t,s){var n={},a,i;for(a in e)ct.has(e,a)&&(i=s(e,a,t),typeof i<"u"&&(n[a]=i));return n}function Nu(e,t,s){var n=e[t];return ct.isArray(n)?Si(e,t,s):s?Sr(n,s):n}function Si(e,t,s){var n=[],a=e[t],i,r,o,l;if(!ct.isArray(a))return Sr(a,s);if(ct.isEmpty(a))return a;for(o=0,l=a.length;o<l;o++)i=a[o],r=Sr(i,s),typeof r<"u"&&n.push(r);return n.length?n:void 0}var Ei=Ru,xi=Fu;function Zs(e,t){return xi(e,Ei(t))||null}Zs.compile=Ei;Zs.filter=xi;var zu=Zs;const Ti=so(zu),Bu=`auctionEnd,
43auctionId,
44bidderRequests(
45    bidderCode,
46    auctionStart,
47    bids(
48        __floor,
49        adUnitCode,
50        bidId
51    ),
52    uspConsent,
53    gdprConsent(
54        gdprApplies,
55        vendorData(
56            eventStatus
57        )
58    )
59),
60bidsReceived(
61    __floorStatus,
62    __originalCpm,
63    cpm,
64    meta(
65        advertiserDomains
66    ),
67    requestId,
68    requestTimestamp,
69    responseTimestamp,
70    size,
71    timeToRespond,
72    is_winning
73),
74timeout,
75timestamp`;function Hu(e){if(!Array.isArray(e))return e;if(e.length!==0)return e.length===1?e[0]:e.slice()}function Uu(e){if(!e||typeof e.pubads!="function")return null;try{var t=e.pubads();if(!t||typeof t.getTargetingKeys!="function")return null;for(var s=t.getTargetingKeys()||[],n={},a=0;a<s.length;a++){var i=Hu(t.getTargeting(s[a]));i!==void 0&&(n[s[a]]=i)}return n}catch{return null}}function qu(e){if(!e||typeof e.getUserIdsAsEids!="function")return null;try{for(var t=e.getUserIdsAsEids()||[],s=[],n=0;n<t.length;n++)t[n]&&t[n].source&&s.push(t[n].source);return s}catch{return null}}function ki(e,t){var s=t||(typeof window<"u"?window.googletag:null),n=Uu(s);return n&&Object.keys(n).length>0&&(e.targeting=n),e}function Vu(e,t){t=t||{};var s=t.googletag||(typeof window<"u"?window.googletag:null);if(!(!s||!s.cmd)){var n=Object.prototype.hasOwnProperty.call(t,"pbjs")?t.pbjs:typeof window<"u"?window.ot:null,a=!1;
75s.cmd.push(function(){try{s.pubads().addEventListener("slotRenderEnded",function(){if(!a){var i=qu(n);i!==null&&(a=!0,e({type:"ui.eid_sources",eidSources:i}))}})}catch{}})}}function en(e){var t=Js();t&&(e.sessionId=t),e.t=Math.round(performance.now()),ki(e),navigator.sendBeacon("https://grow.urbandictionary.network/e",JSON.stringify(e))}var Gu="https://grow.urbandictionary.network/e",Wu=3e3;function Ku(e,t,s){var n=[],a=null,i=s&&s.safety,r=s&&typeof s.loggedIn=="boolean"?s.loggedIn:void 0,o=s&&typeof s.userId=="string"&&s.userId?s.userId:void 0,l=Js();function u(){if(a&&(clearTimeout(a),a=null),n.length!==0){var d={type:"batch",pageUrl:t,pageViewId:e,events:n};i&&(d.safety=i),typeof r=="boolean"&&(d.loggedIn=r),typeof stickyAd=="boolean"&&(d.stickyAd=stickyAd),ki(d),o&&(d.userId=o),l&&(d.sessionId=l),window.__VERSION__&&(d.version=window.__VERSION__);var f=JSON.stringify(d);n=[],navigator.sendBeacon(Gu,f)}}function c(){a&&clearTimeout(a),a=setTimeout(u,Wu)}return{push:function(d){d.t=Math.round(performance.now()),n.push(d),c()},flush:function(){u()},destroy:function(){u()}}}function Xu(e){if(!e||typeof document>"u"||!document.addEventListener)return function(){};function t(l){var u=l.target.closest("[data-grow-track]");if(u){for(var c={type:u.dataset.growTrack},d=Object.keys(u.dataset),f=0;f<d.length;f++){var p=d[f];if(!(p==="growTrack"||p==="grow")&&p.indexOf("grow")===0){var h=p.charAt(4).toLowerCase()+p.slice(5);if(h==="type"){typeof console<"u"&&console.warn&&console.warn("[grow] data-grow-type is reserved (collides with the event type) and was ignored on",u);continue}c[h]=u.dataset[p]}}if(u.href&&(c.href=u.href),c.type==="select_autocomplete"){var g=document.getElementById("search-input");g&&g.value&&(c.query=g.value)}e.push(c)}}function s(l){var u=l.target.closest("[data-grow-track]");if(u){for(var c={type:u.dataset.growTrack},d=u.querySelectorAll("[data-grow-field]"),f=0;f<d.length;f++){var p=d[f];c[p.dataset.growField]=p.value}e.push(c)}}var n={};function a(){var l=window.scrollY||document.documentElement.scrollTop,u=document.documentElement.scrollHeight-window.innerHeight;if(!(u<=0))for(var c=Math.round(l/u*100),d=[25,50,75,100],f=0;f<d.length;f++){var p=d[f];c>=p&&!n[p]&&(n[p]=!0,e.push({type:"scroll_depth",percent:p,scrollTop:Math.round(l),scrollHeight:Math.round(u+window.innerHeight),windowHeight:Math.round(window.innerHeight)}))}}function i(l){if(l.key==="Enter"){var u=l.target.closest("[data-grow-track]");if(u){var c={type:u.dataset.growTrack};u.dataset.growField&&(c[u.dataset.growField]=u.value);for(var d=Object.keys(u.dataset),f=0;f<d.length;f++){var p=d[f];if(!(p==="growTrack"||p==="grow"||p==="growField")&&p.indexOf("grow")===0){var h=p.charAt(4).toLowerCase()+p.slice(5);c[h]=u.dataset[p]}}e.push(c)}}}function r(l){if(!l)return!1;if(l.indexOf("view_")===0)return!0;var u=l.lastIndexOf(".");return u>=0&&l.indexOf("view_",u+1)===u+1}var o=null;return typeof MutationObserver<"u"&&(o=new MutationObserver(function(l){for(var u=0;u<l.length;u++)for(var c=l[u].addedNodes,d=0;d<c.length;d++){var f=c[d];if(f.nodeType===1){f.dataset&&r(f.dataset.growTrack)&&e.push({type:f.dataset.growTrack});for(var p=f.querySelectorAll?f.querySelectorAll('[data-grow-track^="view_"], [data-grow-track*=".view_"]'):[],h=0;h<p.length;h++)e.push({type:p[h].dataset.growTrack})}}}),o.observe(document.body,{childList:!0,subtree:!0})),document.addEventListener("click",t),document.addEventListener("keydown",i),document.addEventListener("submit",s),window.addEventListener("scroll",a,{passive:!0}),function(){o&&o.disconnect(),document.removeEventListener("click",t),document.removeEventListener("keydown",i),document.removeEventListener("submit",s),typeof window<"u"&&window.removeEventListener&&window.removeEventListener("scroll",a)}}function Yu(e){var t=(e||"").toLowerCase();return t==="/"?"home":t==="/define.php"?"define":t==="/browse"||t==="/browse.php"||t.indexOf("/browse/")===0?"browse":t==="/author.php"?"author":t==="/random.php"?"random":t==="/search.php"?"search":"other"}function Ju(e,t){if(!e||typeof window>"u"||!window.up||!window.up.on)return function(){};var s=t||function(){return window.location.pathname};function n(a){e.push({type:"ui.page_view",page_type:Yu(a)})}return window.up.on("up:framework:booted",function(){n(s())}),window.up.on("up:location:changed",function(a){var i;
75try{var r=new URL(window.up.history.previousLocation,window.location.origin),o=new URL(a.location,window.location.origin);if(i=o.pathname,r.pathname+r.search===o.pathname+o.search)return}catch{}n(i||s())}),function(){}}function Qu(e){if(!e||typeof document>"u"||!document.addEventListener)return function(){};function t(){document.visibilityState==="hidden"&&(e.push({type:"ui.page_hidden"}),typeof e.flush=="function"&&e.flush())}function s(){typeof e.flush=="function"&&e.flush()}return document.addEventListener("visibilitychange",t),typeof window<"u"&&window.addEventListener&&window.addEventListener("pagehide",s),function(){document.removeEventListener("visibilitychange",t),typeof window<"u"&&window.removeEventListener&&window.removeEventListener("pagehide",s)}}function Zu(e){if(!e||typeof window>"u"||!window.up)return function(){};function t(){return typeof document<"u"&&document.getElementById?document.getElementById("definitions-feed"):null}function s(l){return l.getAttribute("ot-name")+"|"+(l.getAttribute("data-page-number")||"")}var n=new Set,a=new Set,i=0;function r(){var l=t();if(l){for(var u=l.querySelectorAll("[data-defid]"),c=0;c<u.length;c++)n.add(u[c].getAttribute("data-defid"));for(var d=l.querySelectorAll("[ot-name]"),f=0;f<d.length;f++)a.add(s(d[f]))}}r();function o(l){var u=l&&l.target;if(!(!u||!u.matches||!u.matches("#next-page"))){i+=1;var c=0,d=0,f=0,p=t();if(p){for(var h=p.querySelectorAll("[data-defid]"),g=0;g<h.length;g++){var v=h[g].getAttribute("data-defid");n.has(v)||(n.add(v),c+=1)}for(var b=p.querySelectorAll("[ot-name]"),y=0;y<b.length;y++){var m=s(b[y]);a.has(m)||(a.add(m),d+=1);var S=parseInt(b[y].getAttribute("data-page-number"),10);!isNaN(S)&&S>f&&(f=S)}}e.push({type:"ui.infinite_append",pageNumber:f>0?f:i+1,appendIndex:i,definitionCount:c,slotCount:d,href:u.getAttribute&&u.getAttribute("href")?u.getAttribute("href"):null})}}return window.up.on("up:fragment:inserted",o),function(){window.up&&window.up.off&&window.up.off("up:fragment:inserted",o)}}function ec(e,t){if(!e||typeof document>"u"||!document.addEventListener)return function(){};var s=t&&t.thresholdMs||6e4,n=t&&t.checkIntervalMs||5e3,a=Date.now(),i=!1;function r(){i&&(e.push({type:"ui.user_active",idle_duration_ms:Date.now()-a}),i=!1),a=Date.now()}for(var o={passive:!0,capture:!0},l=["mousedown","mousemove","keydown","click","touchstart","touchmove"],u=0;u<l.length;u++)document.addEventListener(l[u],r,o);typeof window<"u"&&window.addEventListener&&window.addEventListener("scroll",r,o);var c=setInterval(function(){document.visibilityState!=="hidden"&&!i&&Date.now()-a>=s&&(i=!0,e.push({type:"ui.user_idle"}))},n);return function(){clearInterval(c);for(var f=0;f<l.length;f++)document.removeEventListener(l[f],r,o);typeof window<"u"&&window.removeEventListener&&window.removeEventListener("scroll",r,o)}}var On={rootMargin:"200% 0px 200% 0px",threshold:0};function tc(){try{var e=new URLSearchParams(window.location.search||"").get("ad_recycle");return e==="1"?!0:e!=="0"}catch{return!1}}function rc(){var e=tc(),t=null,s=new IntersectionObserver(function(l){for(var u=0;u<l.length;u++){var c=l[u];if(!c.isIntersecting){var d=c.target;d.dataset.adDestroyed!=="1"&&(e?(d.dataset.adDestroyed="1",n(d)):d.id&&(d.dataset.adDestroyed="1",window.ot.destroySlot(d.id)))}}},On);e&&(t=new IntersectionObserver(function(l){for(var u=0;u<l.length;u++)l[u].isIntersecting&&a(l[u].target)},On));function n(l){var u=l.id,c=l.getAttribute("ot-name");u&&window.ot.removeSlotFromGPT(u);var d=document.createElement("div");u&&(d.dataset.recycledId=u),d.dataset.recycledOtName=c,d.style.height="0px",l.insertAdjacentElement("afterend",d),l.remove(),s.unobserve(l),t.observe(d)}function a(l){var u=document.createElement("div");u.setAttribute("ot-name",l.dataset.recycledOtName),l.dataset.recycledId&&(u.id=l.dataset.recycledId),l.insertAdjacentElement("afterend",u),l.remove(),t.unobserve(l),s.observe(u)}for(var i=document.querySelectorAll("[ot-name]"),r=0;r<i.length;r++)s.observe(i[r]);if(typeof MutationObserver<"u"){var o=new MutationObserver(function(l){for(var u=0;u<l.length;u++)for(var c=l[u].addedNodes,d=0;d<c.length;d++){var f=c[d];
75if(f.nodeType===1&&(f.hasAttribute&&f.hasAttribute("ot-name")&&s.observe(f),f.querySelectorAll))for(var p=f.querySelectorAll("[ot-name]"),h=0;h<p.length;h++)s.observe(p[h])}});o.observe(document.body,{childList:!0,subtree:!0})}}function sc(e){for(var t=Array.prototype.slice.call(e.children),s=t.length-1;s>0;s--){var n=Math.floor(Math.random()*(s+1));if(s!==n){var a=t[s];t[s]=t[n],t[n]=a}}e.replaceChildren.apply(e,t),e.scrollLeft=0}function nc(e,t){return t<=0?0:Math.round((e+1)/t*100)}function ic(e){return function(s,n){e.push({type:"ui.scroll_shelf",index:s,total:n,percent:nc(s,n)})}}var Vr=null;function ac(e){var t=document.createElement("swiper-container");t.setAttribute("space-between","8"),t.setAttribute("css-mode","false"),t.setAttribute("mousewheel","true"),t.setAttribute("mousewheel-force-to-axis","true"),t.setAttribute("mousewheel-release-on-edges","true"),t.breakpoints={0:{slidesPerView:2.27},640:{slidesPerView:3.57},1024:{slidesPerView:5.56}},t.style.display="block",t.style.width="100%",t.style.minWidth="0";for(var s=0;s<e.length;s++){var n=document.createElement("swiper-slide");n.appendChild(e[s]),t.appendChild(n)}return t}function An(e,t,s){e&&(e.style.display=s.isBeginning?"none":""),t&&(t.style.display=s.isEnd?"none":"")}function oc(e,t){var s=e.querySelector("[data-shelf-nav-prev]"),n=e.querySelector("[data-shelf-nav-next]");if(!s&&!n)return;function a(){if(!t.swiper){setTimeout(a,50);return}var i=t.swiper;s&&s.addEventListener("click",function(){i.slidePrev()}),n&&n.addEventListener("click",function(){i.slideNext()}),An(s,n,i),i.on("reachBeginning reachEnd fromEdge",function(){An(s,n,i)})}a()}function Rn(e){if(e=e||(typeof document<"u"?document:null),!e)return null;var t=e.querySelector("[data-curated-shelf]");if(!t)return null;var s=t.querySelector("[data-shelf-mount]");if(!s||typeof window>"u"||!window.customElements||!window.customElements.get("swiper-container"))return null;var n=Array.prototype.slice.call(s.children),a=document.createElement("div");n.forEach(function(o){a.appendChild(o)}),sc(a);var i=Array.prototype.slice.call(a.children),r=ac(i);return s.replaceChildren(r),Vr=r,oc(t,r),r}function lc(e){if(!Vr)return;var t=ic(e);function s(){if(!Vr.swiper){setTimeout(s,50);return}var n=Vr.swiper;n.on("slideChange",function(){t(n.activeIndex,n.slides.length)})}s()}var uc=/consentmanager\.net|doubleclick\.net|googlesyndication\.com|googletagservices\.com|hb\.urbandictionary\.com|cdn-cgi\/trace|id5-sync|criteo|intentiq|adnxs|pubmatic|rubicon|3lift\.com|sharethrough|media\.net|servenobid|cootlogix|kueezrtb|presage|yellowblue|4dex|bydata|gumgum|inmobi|seedtag|trustedstack|lijit|minutemedia|richaudience|postrelease|nexx360|nobid\.com|sonobi|33across|panxo-sys|cdn\.jsdelivr\.net|fonts\.googleapis\.com|fonts\.gstatic\.com/,cc="res(name,startTime,responseEnd,domainLookupStart,domainLookupEnd,connectStart,connectEnd,secureConnectionStart,requestStart,responseStart,transferSize)",Ln=["domainLookupStart","domainLookupEnd","connectStart","connectEnd","secureConnectionStart","requestStart","responseStart","transferSize"];function Ir(e,t){try{new PerformanceObserver(function(s){t(s.getEntries())}).observe({type:e,buffered:!0})}catch{}}function dc(e){try{var t=performance.getEntriesByType("navigation")[0];if(t&&t.domContentLoadedEventEnd>0)e.dcl=Math.round(t.domContentLoadedEventEnd);else{var s=performance.timing;if(s&&s.domContentLoadedEventEnd>0&&s.navigationStart>0){var n=s.domContentLoadedEventEnd-s.navigationStart;n>0&&(e.dcl=Math.round(n))}}}catch{}try{for(var a=performance.getEntriesByType("resource")||[],i=[],r=0;r<a.length;r++)uc.test(a[r].name)&&i.push(a[r]);if(i.length){var o=Ti(JSON.parse(JSON.stringify({res:i})),cc);o&&o.res&&o.res.length&&(e.res=o.res.map(function(p){var h={name:String(p.name).split("?")[0],startTime:Math.round(p.startTime),responseEnd:Math.round(p.responseEnd)};if(p.connectEnd>0)for(var g=0;g<Ln.length;g++){var v=Ln[g];typeof p[v]=="number"&&(h[v]=Math.round(p[v]))}return h}))}}catch{}try{var l=window.ot||window.pbjs;if(l&&typeof l.getEvents=="function")for(var u=performance.timeOrigin||0,c=l.getEvents(),d=0;d<c.length;d++){var f=c[d];!f||!f.args||(f.eventType==="auctionInit"&&e.auctionInit===void 0&&typeof f.args.timestamp=="number"&&(e.auctionInit=Math.round(f.args.timestamp-u)),f.eventType==="auctionEnd"&&typeof f.args.auctionEnd=="number"&&(e.auctionEnd=Math.round(f.args.auctionEnd-u)))}}catch{}}function hc(e){var t={},s=!1;try{var n=performance.getEntriesByType("navigation");n.length>0&&n[0].responseStart>0&&(t.ttfb=Math.round(n[0].responseStart))}catch{}try{var a="__skew_measured",i=!1;try{i=sessionStorage.getItem(a)==="1"}catch{}i||fetch("/skew.txt",{method:"HEAD",cache:"no-store"}).then(function(o){var l=Date.now(),u=o.headers.get("Date");if(u){var c=Date.parse(u);if(Number.isFinite(c)){t.clock_skew_ms=Math.round((l-c)/1e3)*1e3;try{sessionStorage.setItem(a,"1")}catch{}}}}).catch(function(){})}catch{}Ir("largest-contentful-paint",function(o){var l=o[o.length-1];l&&(t.lcp=Math.round(l.startTime))}),Ir("paint",function(o){for(var l=0;l<o.length;l++)if(o[l].name==="first-contentful-paint"){t.fcp=Math.round(o[l].startTime);break}}),Ir("layout-shift",function(o){for(var l=0;l<o.length;l++)o[l].hadRecentInput||(t.cls=Math.round(((t.cls||0)+o[l].value)*1e3)/1e3)}),Ir("event",function(o){for(var l=0;l<o.length;l++)(!t.inp||o[l].duration>t.inp)&&(t.inp=o[l].duration)});try{typeof window<"u"&&window.googletag&&window.googletag.cmd&&window.googletag.cmd.push(function(){try{window.googletag.pubads().addEventListener("slotRenderEnded",function(o){o&&o.isEmpty===!1&&t.firstAdRenderedMs===void 0&&(t.firstAdRenderedMs=Math.round(performance.now()))})}catch{}})}catch{}function r(){if(!s){var o=t.lcp!==void 0||t.fcp!==void 0||t.cls!==void 0||t.inp!==void 0||t.ttfb!==void 0||t.firstAdRenderedMs!==void 0;if(o){s=!0,dc(t);var l={type:"perf"};t.lcp!==void 0&&(l.lcp=t.lcp),t.fcp!==void 0&&(l.fcp=t.fcp),t.cls!==void 0&&(l.cls=t.cls),t.inp!==void 0&&(l.inp=t.inp),t.ttfb!==void 0&&(l.ttfb=t.ttfb),t.clock_skew_ms!==void 0&&(l.clock_skew_ms=t.clock_skew_ms);var u=typeof navigator<"u"&&navigator.connection;u&&(u.effectiveType&&(l.ect=u.effectiveType),u.downlink!==void 0&&(l.downlink=u.downlink),u.rtt!==void 0&&(l.rtt=u.rtt),typeof u.saveData=="boolean"&&(l.saveData=u.saveData)),typeof navigator<"u"&&(navigator.deviceMemory&&(l.mem=navigator.deviceMemory),navigator.hardwareConcurrency&&(l.cores=navigator.hardwareConcurrency)),typeof screen<"u"&&(screen.width&&(l.sw=screen.width),screen.height&&(l.sh=screen.height)),typeof devicePixelRatio<"u"&&(l.dpr=devicePixelRatio);for(var c=["dcl","res","auctionInit","auctionEnd","firstAdRenderedMs"],d=0;d<c.length;d++)t[c[d]]!==void 0&&(l[c[d]]=t[c[d]]);e(l)}}}return typeof document<"u"&&document.addEventListener&&document.addEventListener("visibilitychange",r),function(){typeof document<"u"&&document.removeEventListener&&document.removeEventListener("visibilitychange",r)}}var hr=pu();function Ci(){var e=document.body&&document.body.dataset&&document.body.dataset.cs;if(e){if(e=String(e).toLowerCase(),e==="fnsr")return"safe";if(e==="frafvgvir")return"sensitive";if(e==="zngher")return"mature"}}function Pi(){try{for(var e=0;e<localStorage.length;e++){var t=localStorage.key(e);if(t&&t.indexOf("-auth-token")!==-1){var s=JSON.parse(localStorage.getItem(t));if(s&&s.access_token)return!0}}}catch{}return!1}function fc(e){let t=0;const s=new Map;for(const n of e.bidderRequests||[])for(const a of n.bids||[]){const i=a.bidId;s.has(i)||s.set(i,t++),a.bidId=s.get(i)}for(const n of e.bidsReceived||[]){const a=n.requestId;s.has(a)&&(n.requestId=s.get(a))}return s}function pc(e,t,s){return function(n){const a=Bu.replace(/\s+/g,""),i=JSON.parse(JSON.stringify(n)),r=Ti(i,a),o=fc(r),l=s.getHighestCpmBids().map(h=>o.get(h.requestId)),u=Array.from(document.querySelectorAll("[data-defid]")).map(h=>h.dataset.defid),c=Ci(),d=Pi(),f=mi(),p={type:"auction",auction:r,auctionIndex:t.value++,highestCpmBids:l,language:navigator.language,pageUrl:window.location.href,pageViewId:e,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,version:window.__VERSION__,prebidVersion:s.version||"",defids:u,loggedIn:d};c&&(p.safety=c),f&&(p.userId=f),en(p)}}window.ot=window.ot||{};window.ot.que=window.ot.que||[];window.ot.que.push(function(){const e=Ys(),t={value:0};window.ot.onEvent("auctionEnd",pc(e,t,window.ot)),gc(e,window.location.href),rc()});function gc(e,t){var s=Ci(),n=mi(),a={loggedIn:Pi()};s&&(a.safety=s),n&&(a.userId=n);var i=Ku(e,t,a);hr&&hr.action==="stitch"&&(i.push({type:"ui.user_id_stitch",arrivedFromUserId:hr.incoming,visitingUserId:hr.existing}),hr=null),googletag.cmd.push(function(){googletag.pubads().addEventListener("slotRenderEnded",function(r){var o={};try{for(var l=function(h){return Array.isArray(h)?h[0]:h},u=["hb_pb","hb_bidder","hb_adid","hb_size","hb_format","hb_source","hb_deal"],c=0;c<u.length;c++){var d=l(r.slot.getTargeting(u[c]));d&&(o[u[c]]=d)}}catch{}var f={type:"gam_render",slotId:r.slot.getSlotElementId(),advertiserId:r.advertiserId,campaignId:r.campaignId,creativeId:r.creativeId,lineItemId:r.lineItemId,size:r.size?r.size[0]+"x"+r.size[1]:null,isEmpty:r.isEmpty};for(var p in o)Object.prototype.hasOwnProperty.call(o,p)&&(f[p]=o[p]);i.push(f)})}),Vu(i.push,{googletag}),Ju(i),Xu(i),Zu(i),hc(i.push),Qu(i),ec(i),lc(i),typeof window<"u"&&window.addEventListener("beforeunload",function(){i.destroy()})}const mc=[{code:"Half_Page",mediaTypes:{banner:{sizes:[[300,600]],sizeConfig:[{minViewPort:[0,0],sizes:[]},{minViewPort:[768,0],sizes:[[300,600]]}]}},sizes:[[300,600]],bids:[{bidder:"appnexus",params:{placementId:"24456965"}}
75,{bidder:"gumgum",params:{zone:"ry21fytd",slot:"1019094"}},{bidder:"ix",params:{siteId:"785497"}},{bidder:"medianet",params:{crid:"211017647",cid:"8CU4TR801"}},{bidder:"nobid",params:{placementId:"22790027258",siteId:"22789649152"}},{bidder:"pubmatic",params:{publisherId:"156796",adSlot:"4344908"}},{bidder:"rhythmone",params:{placementId:"246152"}},{bidder:"rubicon",params:{zoneId:"2330164",siteId:"126350",position:"ATF",accountId:"6317"}},{bidder:"sharethrough",params:{pkey:"ot4L99oxpMFiz3qQPbBoZXxR"}},{bidder:"sonobi",params:{placement_id:"54ab80ee9ae6d793a67f"}},{bidder:"sovrn",params:{tagid:"1005427"}},{bidder:"triplelift",params:{inventoryCode:"UD_Half_Page"}}]},{code:"Leaderboard",mediaTypes:{banner:{sizes:[[728,90],[970,90]],sizeConfig:[{minViewPort:[0,0],sizes:[]},{minViewPort:[768,0],sizes:[[728,90],[970,90]]}]}},sizes:[[728,90],[970,90]],bids:[{bidder:"appnexus",params:{placementId:"24456969"}},{bidder:"gumgum",params:{zone:"ry21fytd",slot:"1019095"}},{bidder:"ix",params:{siteId:"785499"}},{bidder:"medianet",params:{crid:"164754168",cid:"8CU4TR801"}},{bidder:"nobid",params:{siteId:"22789649152",placementId:"22790027267"}},{bidder:"pubmatic",params:{publisherId:"156796",adSlot:"4344910"}},{bidder:"pubmatic",params:{publisherId:"156796",adSlot:"4344954"}},{bidder:"rhythmone",params:{placementId:"246154"}},{bidder:"rubicon",params:{zoneId:"2330170",siteId:"126350",position:"ATF",accountId:"6317"}},{bidder:"sharethrough",params:{pkey:"KRbFHN6EZJQtWU2RxNAueZ7S"}},{bidder:"sonobi",params:{placement_id:"97d9f078583dbf0ca969"}},{bidder:"sovrn",params:{tagid:"1005429"}},{bidder:"triplelift",params:{inventoryCode:"UD_Leaderboard_728x90"}}]},{code:"Medium_Rectangle_1",mediaTypes:{banner:{sizes:[[300,250]],sizeConfig:[{minViewPort:[0,0],sizes:[[300,250]]}]}},sizes:[[300,250]],bids:[{bidder:"appnexus",params:{placementId:"24456961"}},{bidder:"gumgum",params:{zone:"ry21fytd",slot:"1019096"}},{bidder:"ix",params:{siteId:"785493"}},{bidder:"medianet",params:{crid:"546343016",cid:"8CU4TR801"}},{bidder:"nobid",params:{placementId:"22789573851",siteId:"22789649152"}},{bidder:"pubmatic",params:{publisherId:"156796",adSlot:"4344905"}},{bidder:"rhythmone",params:{placementId:"246149"}},{bidder:"rubicon",params:{zoneId:"2330156",siteId:"126350",position:"ATF",accountId:"6317"}},{bidder:"sharethrough",params:{pkey:"aShUdcWJTDFlc5tzAeI0BUCJ"}},{bidder:"sonobi",params:{placement_id:"f0fdb219dfadd597321f"}},{bidder:"sovrn",params:{tagid:"1005424"}},{bidder:"triplelift",params:{inventoryCode:"UD_Medium_Rectangle_1"}}]},{code:"Medium_Rectangle_2",mediaTypes:{banner:{sizes:[[300,250]],sizeConfig:[{minViewPort:[0,0],sizes:[[300,250]]}]}},sizes:[[300,250]],bids:[{bidder:"appnexus",params:{placementId:"24456963"}},{bidder:"gumgum",params:{zone:"ry21fytd",slot:"1019097"}},{bidder:"ix",params:{siteId:"785495"}},{bidder:"medianet",params:{crid:"953021726",cid:"8CU4TR801"}},{bidder:"nobid",params:{placementId:"22790026967",siteId:"22789649152"}},{bidder:"pubmatic",params:{publisherId:"156796",adSlot:"4344905"}},{bidder:"rhythmone",params:{placementId:"246150"}},{bidder:"rubicon",params:{zoneId:"2330158",siteId:"126350",position:"BTF",accountId:"6317"}},{bidder:"sharethrough",params:{pkey:"tFtMdAEn8cXK0EDkzj26E7z8"}},{bidder:"sonobi",params:{placement_id:"623932de08ed88c0be48"}},{bidder:"sovrn",params:{tagid:"1005425"}},{bidder:"triplelift",params:{inventoryCode:"UD_Medium_Rectangle_2"}}]},{code:"Medium_Rectangle_3",mediaTypes:{banner:{sizes:[[300,250]],sizeConfig:[{minViewPort:[0,0],sizes:[[300,250]]}]}},sizes:[[300,250]],bids:[{bidder:"appnexus",params:{placementId:"24456964"}},{bidder:"gumgum",params:{zone:"ry21fytd",slot:"1019098"}},{bidder:"ix",params:{siteId:"785496"}},{bidder:"medianet",params:{crid:"666572324",cid:"8CU4TR801"}},{bidder:"nobid",params:{placementId:"22790015714",siteId:"22789649152"}},{bidder:"pubmatic",params:{publisherId:"156796",adSlot:"4344905"}},{bidder:"rhythmone",params:{placementId:"246151"}},{bidder:"rubicon",params:{zoneId:"2330160",siteId:"126350",position:"BTF",accountId:"6317"}},{bidder:"sharethrough",params:{pkey:"G9u6SYgGDmIVHR3A2xz4hRfu"}},{bidder:"sonobi",params:{placement_id:"375a7b8f48559bb9e645"}},{bidder:"sovrn",params:{tagid:"1005426"}},{bidder:"triplelift",params:{inventoryCode:"UD_Medium_Rectangle_3"}}]},{code:"Mobile_Leaderboard",mediaTypes:{banner:{sizes:[[320,50]],sizeConfig:[{minViewPort:[0,0],sizes:[[320,50]]},{minViewPort:[768,0],sizes:[]}]}},sizes:[[320,50]],bids:[{bidder:"appnexus",params:{placementId:"24456967"}}
75,{bidder:"gumgum",params:{zone:"ry21fytd",slot:"1019099"}},{bidder:"ix",params:{siteId:"785498"}},{bidder:"medianet",params:{crid:"676753143",cid:"8CU4TR801"}},{bidder:"nobid",params:{siteId:"22789649152",placementId:"22790027279"}},{bidder:"pubmatic",params:{publisherId:"156796",adSlot:"4344909"}},{bidder:"rhythmone",params:{placementId:"246153"}},{bidder:"rubicon",params:{zoneId:"2330186",siteId:"414300",position:"ATF",accountId:"6317"}},{bidder:"sharethrough",params:{pkey:"KRbFHN6EZJQtWU2RxNAueZ7S"}},{bidder:"sonobi",params:{placement_id:"6f83082e50a39784fd2b"}},{bidder:"sovrn",params:{tagid:"1005428"}},{bidder:"triplelift",params:{inventoryCode:"UD_Mobile_Leaderboard"}}]}],vc={"300x250":[{id:"1.2",src:"/banners/1x/ud-1_2.webp",src2x:"/banners/2x/[email protected]"},{id:"10.2",src:"/banners/1x/ud-10_2.webp",src2x:"/banners/2x/[email protected]"},{id:"11.2",src:"/banners/1x/ud-11_2.webp",src2x:"/banners/2x/[email protected]"},{id:"12.2",src:"/banners/1x/ud-12_2.webp",src2x:"/banners/2x/[email protected]"},{id:"15.2",src:"/banners/1x/ud-15_2.webp",src2x:"/banners/2x/[email protected]"},{id:"16.2",src:"/banners/1x/ud-16_2.webp",src2x:"/banners/2x/[email protected]"},{id:"17.2",src:"/banners/1x/ud-17_2.webp",src2x:"/banners/2x/[email protected]"},{id:"18.2",src:"/banners/1x/ud-18_2.webp",src2x:"/banners/2x/[email protected]"},{id:"19.2",src:"/banners/1x/ud-19_2.webp",src2x:"/banners/2x/[email protected]"},{id:"2.2",src:"/banners/1x/ud-2_2.webp",src2x:"/banners/2x/[email protected]"},{id:"20.2",src:"/banners/1x/ud-20_2.webp",src2x:"/banners/2x/[email protected]"},{id:"20.2-1",src:"/banners/1x/ud-20_2-1.webp",src2x:"/banners/2x/[email protected]"},{id:"21.2",src:"/banners/1x/ud-21_2.webp",src2x:"/banners/2x/[email protected]"},{id:"3.2",src:"/banners/1x/ud-3_2.webp",src2x:"/banners/2x/[email protected]"},{id:"4.2",src:"/banners/1x/ud-4_2.webp",src2x:"/banners/2x/[email protected]"},{id:"5.2",src:"/banners/1x/ud-5_2.webp",src2x:"/banners/2x/[email protected]"},{id:"6.2",src:"/banners/1x/ud-6_2.webp",src2x:"/banners/2x/[email protected]"},{id:"7.2",src:"/banners/1x/ud-7_2.webp",src2x:"/banners/2x/[email protected]"},{id:"8.2",src:"/banners/1x/ud-8_2.webp",src2x:"/banners/2x/[email protected]"},{id:"9.2",src:"/banners/1x/ud-9_2.webp",src2x:"/banners/2x/[email protected]"}],"300x600":[{id:"1.1",src:"/banners/1x/ud-1_1.webp",src2x:"/banners/2x/[email protected]"},{id:"10.1",src:"/banners/1x/ud-10_1.webp",src2x:"/banners/2x/[email protected]"},{id:"11.1",src:"/banners/1x/ud-11_1.webp",src2x:"/banners/2x/[email protected]"},{id:"12.1",src:"/banners/1x/ud-12_1.webp",src2x:"/banners/2x/[email protected]"},{id:"13.1",src:"/banners/1x/ud-13_1.webp",src2x:"/banners/2x/[email protected]"},{id:"14.1",src:"/banners/1x/ud-14_1.webp",src2x:"/banners/2x/[email protected]"},{id:"15.1",src:"/banners/1x/ud-15_1.webp",src2x:"/banners/2x/[email protected]"},{id:"16.1",src:"/banners/1x/ud-16_1.webp",src2x:"/banners/2x/[email protected]"},{id:"17.1",src:"/banners/1x/ud-17_1.webp",src2x:"/banners/2x/[email protected]"},{id:"18.1",src:"/banners/1x/ud-18_1.webp",src2x:"/banners/2x/[email protected]"},{id:"19.1",src:"/banners/1x/ud-19_1.webp",src2x:"/banners/2x/[email protected]"},{id:"2.1",src:"/banners/1x/ud-2_1.webp",src2x:"/banners/2x/[email protected]"},{id:"20.1",src:"/banners/1x/ud-20_1.webp",src2x:"/banners/2x/[email protected]"},{id:"20.1-1",src:"/banners/1x/ud-20_1-1.webp",src2x:"/banners/2x/[email protected]"},{id:"21.1",src:"/banners/1x/ud-21_1.webp",src2x:"/banners/2x/[email protected]"},{id:"3.1",src:"/banners/1x/ud-3_1.webp",src2x:"/banners/2x/[email protected]"},{id:"4.1",src:"/banners/1x/ud-4_1.webp",src2x:"/banners/2x/[email protected]"},{id:"5.1",src:"/banners/1x/ud-5_1.webp",src2x:"/banners/2x/[email protected]"},{id:"6.1",src:"/banners/1x/ud-6_1.webp",src2x:"/banners/2x/[email protected]"},{id:"7.1",src:"/banners/1x/ud-7_1.webp",src2x:"/banners/2x/[email protected]"},{id:"8.1",src:"/banners/1x/ud-8_1.webp",src2x:"/banners/2x/[email protected]"},{id:"9.1",src:"/banners/1x/ud-9_1.webp",src2x:"/banners/2x/[email protected]"}],"320x50":[{id:"1.3",src:"/banners/1x/ud-1_3.webp",src2x:"/banners/2x/[email protected]"},{id:"16.3",src:"/banners/1x/ud-16_3.webp",src2x:"/banners/2x/[email protected]"},{id:"17.3",src:"/banners/1x/ud-17_3.webp",src2x:"/banners/2x/[email protected]"},{id:"6.3",src:"/banners/1x/ud-6_3.webp",src2x:"/banners/2x/[email protected]"},{id:"7.3",src:"/banners/1x/ud-7_3.webp",src2x:"/banners/2x/[email protected]"},{id:"8.3",src:"/banners/1x/ud-8_3.webp",src2x:"/banners/2x/[email protected]"},{id:"9.3",src:"/banners/1x/ud-9_3.webp",src2x:"/banners/2x/[email protected]"}],"728x90":[{id:"1.4",src:"/banners/1x/ud-1_4.webp",src2x:"/banners/2x/[email protected]"},{id:"16.4",src:"/banners/1x/ud-16_4.webp",src2x:"/banners/2x/[email protected]"},{id:"17.4",src:"/banners/1x/ud-17_4.webp",src2x:"/banners/2x/[email protected]"},{id:"6.4",src:"/banners/1x/ud-6_4.webp",src2x:"/banners/2x/[email protected]"},{id:"7.4",src:"/banners/1x/ud-7_4.webp",src2x:"/banners/2x/[email protected]"},{id:"8.4",src:"/banners/1x/ud-8_4.webp",src2x:"/banners/2x/[email protected]"},{id:"9.4",src:"/banners/1x/ud-9_4.webp",src2x:"/banners/2x/[email protected]"}],"970x90":[{id:"1.5",src:"/banners/1x/ud-1_5.webp",src2x:"/banners/2x/[email protected]"},{id:"16.5",src:"/banners/1x/ud-16_5.webp",src2x:"/banners/2x/[email protected]"},{id:"17.5",src:"/banners/1x/ud-17_5.webp",src2x:"/banners/2x/[email protected]"},{id:"6.5",src:"/banners/1x/ud-6_5.webp",src2x:"/banners/2x/[email protected]"},{id:"7.5",src:"/banners/1x/ud-7_5.webp",src2x:"/banners/2x/[email protected]"},{id:"8.5",src:"/banners/1x/ud-8_5.webp",src2x:"/banners/2x/[email protected]"},{id:"9.5",src:"/banners/1x/ud-9_5.webp",src2x:"/banners/2x/[email protected]"}]},yc="/go/store/",bc="/go/store/products/mug",wc={utm_source:"urbandictionary",utm_medium:"definition",utm_campaign:"ad_fallback"};function _c(e){var a;const t=new URLSearchParams({...wc,utm_content:`slot_${e||"fallback"}`}),s=document.querySelector("[data-defid]"),n=((a=s==null?void 0:s.dataset)==null?void 0:a.defid)??null;return n?(t.set("defid",n),`${bc}?${t.toString()}`):`${yc}?${t.toString()}`}window.udFallback=function(e,t){var u;en({type:"batch",pageUrl:window.location.href,pageViewId:Ys(),events:[{type:"ui.udfallback_render",adUnitCode:t}]});const s=mc.find(c=>c.code===t)??null,n=(u=s==null?void 0:s.sizes)==null?void 0:u[0];if(!e||!n){e&&(e.innerHTML="");return}const a=`${n[0]}x${n[1]}`,i=vc[a];if(!i||i.length===0){e.innerHTML="";return}const r=i[Math.floor(Math.random()*i.length)],o=document.createElement("a");o.href=_c(t),o.target="_blank",o.rel="noopener noreferrer sponsored",o.style.display="block";const l=document.createElement("img");l.src=r.src,r.src2x&&(l.srcset=`${r.src} 1x, ${r.src2x} 2x`),l.alt="Urban Dictionary Store",l.style.display="block",l.style.width="100%",l.style.height="auto",o.appendChild(l),e.innerHTML="",e.appendChild(o)};function ts(e,t){en({type:"batch",pageUrl:window.location.href,pageViewId:Ys(),events:[{type:e,...t}]})}function Sc(e){e.detail&&ts("ui.confiant_blocked",{args:e.detail.args})}function Ec(e){e.detail&&ts("ui.confiant_removed",{args:e.detail.args})}function xc(e){e.detail&&ts("ui.confiant_rendered",{adId:e.detail.adId})}function Tc(e){e.detail&&ts("ui.confiant_error",{args:e.detail.args})}window.addEventListener("ud:confiant:blocked",Sc);window.addEventListener("ud:confiant:removed",Ec);window.addEventListener("ud:confiant:rendered",xc);window.addEventListener("ud:confiant:error",Tc);function kc(e){var t=document.cookie.match(/(?:^|;\s*)_grow_uid=([^;
75]+)/);e.value=t?t[1]:""}function Cc(){window.up.compiler('input[name="_g"]',kc)}up.compiler("#search-input",function(e){var t=-1;function s(){var i=document.querySelector("#suggest-results");return i?i.querySelectorAll('[role="option"]'):[]}function n(i){var r=s();r.forEach(function(o,l){l===i?o.setAttribute("aria-selected","true"):o.setAttribute("aria-selected","false")}),i>=0&&r[i]?(r[i].scrollIntoView({block:"nearest"}),e.setAttribute("aria-activedescendant",r[i].id||"")):e.removeAttribute("aria-activedescendant")}function a(){t=-1,e.removeAttribute("aria-activedescendant")}e.addEventListener("keydown",function(i){var r=s();if(r.length!==0){if(i.key==="ArrowDown")i.preventDefault(),t=(t+1)%r.length,n(t);else if(i.key==="ArrowUp")i.preventDefault(),t=(t-1+r.length)%r.length,n(t);else if(i.key==="Home")i.preventDefault(),t=0,n(t);else if(i.key==="End")i.preventDefault(),t=r.length-1,n(t);else if(i.key==="Enter"&&t>=0){i.preventDefault();var o=r[t].querySelector("a");o&&o.click()}}}),e.addEventListener("input",a),up.on("up:fragment:inserted",function(i){i.target.matches&&i.target.matches("#suggest-results")&&a()})});var Ms=function(e,t){return Ms=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,n){s.__proto__=n}||function(s,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(s[a]=n[a])},Ms(e,t)};function Oi(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Ms(e,t);function s(){this.constructor=e}e.prototype=t===null?Object.create(t):(s.prototype=t.prototype,new s)}var Kr=function(){return Kr=Object.assign||function(t){for(var s,n=1,a=arguments.length;n<a;n++){s=arguments[n];for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(t[i]=s[i])}return t},Kr.apply(this,arguments)};function rr(e,t){var s={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(s[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(s[n[a]]=e[n[a]]);return s}function Ai(e,t,s,n){var a=arguments.length,i=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,s):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,s,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(i=(a<3?r(i):a>3?r(t,s,i):r(t,s))||i);return a>3&&i&&Object.defineProperty(t,s,i),i}function Ri(e,t){return function(s,n){t(s,n,e)}}function Li(e,t,s,n,a,i){function r(b){if(b!==void 0&&typeof b!="function")throw new TypeError("Function expected");return b}for(var o=n.kind,l=o==="getter"?"get":o==="setter"?"set":"value",u=!t&&e?n.static?e:e.prototype:null,c=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),d,f=!1,p=s.length-1;p>=0;p--){var h={};for(var g in n)h[g]=g==="access"?{}:n[g];for(var g in n.access)h.access[g]=n.access[g];h.addInitializer=function(b){if(f)throw new TypeError("Cannot add initializers after decoration has completed");i.push(r(b||null))};var v=(0,s[p])(o==="accessor"?{get:c.get,set:c.set}:c[l],h);if(o==="accessor"){if(v===void 0)continue;if(v===null||typeof v!="object")throw new TypeError("Object expected");(d=r(v.get))&&(c.get=d),(d=r(v.set))&&(c.set=d),(d=r(v.init))&&a.unshift(d)}else(d=r(v))&&(o==="field"?a.unshift(d):c[l]=d)}u&&Object.defineProperty(u,n.name,c),f=!0}function Ii(e,t,s){for(var n=arguments.length>2,a=0;a<t.length;
vendor: 8,069 bytes, line 75
75a++)s=n?t[a].call(e,s):t[a].call(e);return n?s:void 0}function Mi(e){return typeof e=="symbol"?e:"".concat(e)}function Fi(e,t,s){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:s?"".concat(s," ",t):t})}function Di(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function ue(e,t,s,n){function a(i){return i instanceof s?i:new s(function(r){r(i)})}return new(s||(s=Promise))(function(i,r){function o(c){try{u(n.next(c))}catch(d){r(d)}}function l(c){try{u(n.throw(c))}catch(d){r(d)}}function u(c){c.done?i(c.value):a(c.value).then(o,l)}u((n=n.apply(e,t||[])).next())})}function $i(e,t){var s={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,r=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return r.next=o(0),r.throw=o(1),r.return=o(2),typeof Symbol=="function"&&(r[Symbol.iterator]=function(){return this}),r;function o(u){return function(c){return l([u,c])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(s=0)),s;)try{if(n=1,a&&(i=u[0]&2?a.return:u[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,u[1])).done)return i;switch(a=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,a=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(i=s.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){s=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(u[0]===6&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(e,s)}catch(c){u=[6,c],a=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var rs=Object.create?function(e,t,s,n){n===void 0&&(n=s);var a=Object.getOwnPropertyDescriptor(t,s);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,n,a)}:function(e,t,s,n){n===void 0&&(n=s),e[n]=t[s]};function ji(e,t){for(var s in e)s!=="default"&&!Object.prototype.hasOwnProperty.call(t,s)&&rs(t,e,s)}function Xr(e){var t=typeof Symbol=="function"&&Symbol.iterator,s=t&&e[t],n=0;if(s)return s.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function tn(e,t){var s=typeof Symbol=="function"&&e[Symbol.iterator];if(!s)return e;var n=s.call(e),a,i=[],r;try{for(;(t===void 0||t-- >0)&&!(a=n.next()).done;)i.push(a.value)}catch(o){r={error:o}}finally{try{a&&!a.done&&(s=n.return)&&s.call(n)}finally{if(r)throw r.error}}return i}function Ni(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(tn(arguments[t]));return e}function zi(){for(var e=0,t=0,s=arguments.length;t<s;t++)e+=arguments[t].length;for(var n=Array(e),a=0,t=0;t<s;t++)for(var i=arguments[t],r=0,o=i.length;r<o;r++,a++)n[a]=i[r];return n}function Bi(e,t,s){if(s||arguments.length===2)for(var n=0,a=t.length,i;n<a;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}function Zt(e){return this instanceof Zt?(this.v=e,this):new Zt(e)}function Hi(e,t,s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=s.apply(e,t||[]),a,i=[];return a=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",r),a[Symbol.asyncIterator]=function(){return this},a;function r(p){return function(h){return Promise.resolve(h).then(p,d)}}function o(p,h){n[p]&&(a[p]=function(g){return new Promise(function(v,b){i.push([p,g,v,b])>1||l(p,g)})},h&&(a[p]=h(a[p])))}function l(p,h){try{u(n[p](h))}catch(g){f(i[0][3],g)}}function u(p){p.value instanceof Zt?Promise.resolve(p.value.v).then(c,d):f(i[0][2],p)}function c(p){l("next",p)}function d(p){l("throw",p)}function f(p,h){p(h),i.shift(),i.length&&l(i[0][0],i[0][1])}}function Ui(e){var t,s;return t={},n("next"),n("throw",function(a){throw a}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(a,i){t[a]=e[a]?function(r){return(s=!s)?{value:Zt(e[a](r)),done:!1}:i?i(r):r}:i}}function qi(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],s;return t?t.call(e):(e=typeof Xr=="function"?Xr(e):e[Symbol.iterator](),s={},n("next"),n("throw"),n("return"),s[Symbol.asyncIterator]=function(){return this},s);function n(i){s[i]=e[i]&&function(r){return new Promise(function(o,l){r=e[i](r),a(o,l,r.done,r.value)})}}function a(i,r,o,l){Promise.resolve(l).then(function(u){i({value:u,done:o})},r)}}function Vi(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var Pc=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},Fs=function(e){return Fs=Object.getOwnPropertyNames||function(t){var s=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(s[s.length]=n);return s},Fs(e)};function Gi(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var s=Fs(e),n=0;n<s.length;n++)s[n]!=="default"&&rs(t,e,s[n]);return Pc(t,e),t}function Wi(e){return e&&e.__esModule?e:{default:e}}function Ki(e,t,s,n){if(s==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?n:s==="a"?n.call(e):n?n.value:t.get(e)}function Xi(e,t,s,n,a){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?a.call(e,s):a?a.value=s:t.set(e,s),s}function Yi(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function Ji(e,t,s){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var n,a;if(s){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],s&&(a=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");a&&(n=function(){try{a.call(this)}catch(i){return Promise.reject(i)}}),e.stack.push({value:t,dispose:n,async:s})}else s&&e.stack.push({async:!0});return t}var Oc=typeof SuppressedError=="function"?SuppressedError:function(e,t,s){var n=new Error(s);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function Qi(e){function t(i){e.error=e.hasError?new Oc(i,e.error,"An error was suppressed during disposal."):i,e.hasError=!0}var s,n=0;function a(){for(;s=e.stack.pop();)try{if(!s.async&&n===1)return n=0,e.stack.push(s),Promise.resolve().then(a);if(s.dispose){var i=s.dispose.call(s.value);if(s.async)return n|=2,Promise.resolve(i).then(a,function(r){return t(r),a()})}else n|=1}catch(r){t(r)}if(n===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return a()}function Zi(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(s,n,a,i,r){return n?t?".jsx":".js":a&&(!i||!r)?s:a+i+"."+r.toLowerCase()+"js"}):e}const Ac={__extends:Oi,__assign:Kr,__rest:rr,__decorate:Ai,__param:Ri,__esDecorate:Li,__runInitializers:Ii,__propKey:Mi,__setFunctionName:Fi,__metadata:Di,__awaiter:ue,__generator:$i,__createBinding:rs,__exportStar:ji,__values:Xr,__read:tn,__spread:Ni,__spreadArrays:zi,__spreadArray:Bi,__await:Zt,__asyncGenerator:Hi,__asyncDelegator:Ui,__asyncValues:qi,__makeTemplateOb
75ject:Vi,__importStar:Gi,__importDefault:Wi,__classPrivateFieldGet:Ki,__classPrivateFieldSet:Xi,__classPrivateFieldIn:Yi,__addDisposableResource:Ji,__disposeResources:Qi,__rewriteRelativeImportExtension:Zi},Rc=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:Ji,get __assign(){return Kr},__asyncDelegator:Ui,__asyncGenerator:Hi,__asyncValues:qi,__await:Zt,__awaiter:ue,__classPrivateFieldGet:Ki,__classPrivateFieldIn:Yi,__classPrivateFieldSet:Xi,__createBinding:rs,__decorate:Ai,__disposeResources:Qi,__esDecorate:Li,__exportStar:ji,__extends:Oi,__generator:$i,__importDefault:Wi,__importStar:Gi,__makeTemplateObject:Vi,__metadata:Di,__param:Ri,__propKey:Mi,__read:tn,__rest:rr,__rewriteRelativeImportExtension:Zi,__runInitializers:Ii,__setFunctionName:Fi,__spread:Ni,__spreadArray:Bi,__spreadArrays:zi,__values:Xr,default:Ac},Symbol.toStringTag,{value:"Module"})),Lc=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class rn extends Error{constructor(t,s="FunctionsError",n){super(t),this.name=s,this.context=n}}class In extends rn{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class Mn extends rn{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class Fn extends rn{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var Ds;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(Ds||(Ds={}));class Ic{constructor(t,{headers:s={},customFetch:n,region:a=Ds.Any}={}){this.url=t,this.headers=s,this.region=a,this.fetch=Lc(n)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return ue(this,arguments,void 0,function*(s,n={}){var a;try{const{headers:i,method:r,body:o,signal:l}=n;let u={},{region:c}=n;c||(c=this.region);const d=new URL(`${this.url}/${s}`);c&&c!=="any"&&(u["x-region"]=c,d.searchParams.set("forceFunctionRegion",c));let f;o&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)?typeof Blob<"u"&&o instanceof Blob||o instanceof ArrayBuffer?(u["Content-Type"]="application/octet-stream",f=o):typeof o=="string"?(u["Content-Type"]="text/plain",f=o):typeof FormData<"u"&&o instanceof FormData?f=o:(u["Content-Type"]="application/json",f=JSON.stringify(o)):f=o;const p=yield this.fetch(d.toString(),{method:r||"POST",headers:Object.assign(Object.assign(Object.assign({},u),this.headers),i),body:f,signal:l}).catch(b=>{throw b.name==="AbortError"?b:new In(b)}),h=p.headers.get("x-relay-error");if(h&&h==="true")throw new Mn(p);if(!p.ok)throw new Fn(p);let g=((a=p.headers.get("Content-Type"))!==null&&a!==void 0?a:"text/plain").split(";")[0].trim(),v;return g==="application/json"?v=yield p.json():g==="application/octet-stream"||g==="application/pdf"?v=yield p.blob():g==="text/event-stream"?v=p:g==="multipart/form-data"?v=yield p.formData():v=yield p.text(),{data:v,error:null,response:p}}catch(i){return i instanceof Error&&i.name==="AbortError"?{data:null,error:new In(i)}:{data:null,error:i,response:i instanceof Fn||i instanceof Mn?i.context:void 0}}})}}var Fe={};const sr=no(Rc);var Mr={},Fr={},Dr={},$r={},jr={},Nr={},Dn;function ea(){if(Dn)return Nr;
75Dn=1,Object.defineProperty(Nr,"__esModule",{value:!0});class e extends Error{constructor(s){super(s.message),this.name="PostgrestError",this.details=s.details,this.hint=s.hint,this.code=s.code}}return Nr.default=e,Nr}var $n;function ta(){if($n)return jr;$n=1,Object.defineProperty(jr,"__esModule",{value:!0});const t=sr.__importDefault(ea());class s{constructor(a){var i,r;this.shouldThrowOnError=!1,this.method=a.method,this.url=a.url,this.headers=new Headers(a.headers),this.schema=a.schema,this.body=a.body,this.shouldThrowOnError=(i=a.shouldThrowOnError)!==null&&i!==void 0?i:!1,this.signal=a.signal,this.isMaybeSingle=(r=a.isMaybeSingle)!==null&&r!==void 0?r:!1,a.fetch?this.fetch=a.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(a,i){return this.headers=new Headers(this.headers),this.headers.set(a,i),this}then(a,i){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const r=this.fetch;let o=r(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async l=>{var u,c,d,f;let p=null,h=null,g=null,v=l.status,b=l.statusText;if(l.ok){if(this.method!=="HEAD"){const k=await l.text();k===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&(!((u=this.headers.get("Accept"))===null||u===void 0)&&u.includes("application/vnd.pgrst.plan+text"))?h=k:h=JSON.parse(k))}const m=(c=this.headers.get("Prefer"))===null||c===void 0?void 0:c.match(/count=(exact|planned|estimated)/),S=(d=l.headers.get("content-range"))===null||d===void 0?void 0:d.split("/");m&&S&&S.length>1&&(g=parseInt(S[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(h)&&(h.length>1?(p={code:"PGRST116",details:`Results contain ${h.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},h=null,g=null,v=406,b="Not Acceptable"):h.length===1?h=h[0]:h=null)}else{const m=await l.text();try{p=JSON.parse(m),Array.isArray(p)&&l.status===404&&(h=[],p=null,v=200,b="OK")}catch{l.status===404&&m===""?(v=204,b="No Content"):p={message:m}}if(p&&this.isMaybeSingle&&(!((f=p==null?void 0:p.details)===null||f===void 0)&&f.includes("0 rows"))&&(p=null,v=200,b="OK"),p&&this.shouldThrowOnError)throw new t.default(p)}return{error:p,data:h,count:g,status:v,statusText:b}});return this.shouldThrowOnError||(o=o.catch(l=>{var u,c,d;return{error:{message:`${(u=l==null?void 0:l.name)!==null&&u!==void 0?u:"FetchError"}: ${l==null?void 0:l.message}`,details:`${(c=l==null?void 0:l.stack)!==null&&c!==void 0?c:""}`,hint:"",code:`${(d=l==null?void 0:l.code)!==null&&d!==void 0?d:""}`},data:null,count:null,status:0,statusText:""}})),o.then(a,i)}returns(){return this}overrideTypes(){return this}}return jr.default=s,jr}var jn;function ra(){if(jn)return $r;jn=1,Object.defineProperty($r,"__esModule",{value:!0});const t=sr.__importDefault(ta());class s extends t.default{select(a){let i=!1;const r=(a??"*").split("").map(o=>/\s/.test(o)&&!i?"":(o==='"'&&(i=!i),o)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(a,{ascending:i=!0,nullsFirst:r,foreignTable:o,referencedTable:l=o}={}){const u=l?`${l}.order`:"order",c=this.url.searchParams.get(u);return this.url.searchParams.set(u,`${c?`${c},`:""}${a}.${i?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(a,{foreignTable:i,referencedTable:r=i}={}){const o=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(o,`${a}`),this}range(a,i,{foreignTable:r,referencedTable:o=r}={}){const l=typeof o>"u"?"offset":`${o}.offset`,u=typeof o>"u"?"limit":`${o}.limit`;return this.url.searchParams.set(l,`${a}`),this.url.searchParams.set(u,`${i-a+1}`),this}abortSignal(a){return this.signal=a,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}
75explain({analyze:a=!1,verbose:i=!1,settings:r=!1,buffers:o=!1,wal:l=!1,format:u="text"}={}){var c;const d=[a?"analyze":null,i?"verbose":null,r?"settings":null,o?"buffers":null,l?"wal":null].filter(Boolean).join("|"),f=(c=this.headers.get("Accept"))!==null&&c!==void 0?c:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${u}; for="${f}"; options=${d};`),u==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(a){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${a}`),this}}return $r.default=s,$r}var Nn;function sn(){if(Nn)return Dr;Nn=1,Object.defineProperty(Dr,"__esModule",{value:!0});const t=sr.__importDefault(ra()),s=new RegExp("[,()]");class n extends t.default{eq(i,r){return this.url.searchParams.append(i,`eq.${r}`),this}neq(i,r){return this.url.searchParams.append(i,`neq.${r}`),this}gt(i,r){return this.url.searchParams.append(i,`gt.${r}`),this}gte(i,r){return this.url.searchParams.append(i,`gte.${r}`),this}lt(i,r){return this.url.searchParams.append(i,`lt.${r}`),this}lte(i,r){return this.url.searchParams.append(i,`lte.${r}`),this}like(i,r){return this.url.searchParams.append(i,`like.${r}`),this}likeAllOf(i,r){return this.url.searchParams.append(i,`like(all).{${r.join(",")}}`),this}likeAnyOf(i,r){return this.url.searchParams.append(i,`like(any).{${r.join(",")}}`),this}ilike(i,r){return this.url.searchParams.append(i,`ilike.${r}`),this}ilikeAllOf(i,r){return this.url.searchParams.append(i,`ilike(all).{${r.join(",")}}`),this}ilikeAnyOf(i,r){return this.url.searchParams.append(i,`ilike(any).{${r.join(",")}}`),this}is(i,r){return this.url.searchParams.append(i,`is.${r}`),this}in(i,r){const o=Array.from(new Set(r)).map(l=>typeof l=="string"&&s.test(l)?`"${l}"`:`${l}`).join(",");return this.url.searchParams.append(i,`in.(${o})`),this}contains(i,r){return typeof r=="string"?this.url.searchParams.append(i,`cs.${r}`):Array.isArray(r)?this.url.searchParams.append(i,`cs.{${r.join(",")}}`):this.url.searchParams.append(i,`cs.${JSON.stringify(r)}`),this}containedBy(i,r){return typeof r=="string"?this.url.searchParams.append(i,`cd.${r}`):Array.isArray(r)?this.url.searchParams.append(i,`cd.{${r.join(",")}}`):this.url.searchParams.append(i,`cd.${JSON.stringify(r)}`),this}rangeGt(i,r){return this.url.searchParams.append(i,`sr.${r}`),this}rangeGte(i,r){return this.url.searchParams.append(i,`nxl.${r}`),this}rangeLt(i,r){return this.url.searchParams.append(i,`sl.${r}`),this}rangeLte(i,r){return this.url.searchParams.append(i,`nxr.${r}`),this}rangeAdjacent(i,r){return this.url.searchParams.append(i,`adj.${r}`),this}overlaps(i,r){return typeof r=="string"?this.url.searchParams.append(i,`ov.${r}`):this.url.searchParams.append(i,`ov.{${r.join(",")}}`),this}textSearch(i,r,{config:o,type:l}={}){let u="";l==="plain"?u="pl":l==="phrase"?u="ph":l==="websearch"&&(u="w");const c=o===void 0?"":`(${o})`;return this.url.searchParams.append(i,`${u}fts${c}.${r}`),this}match(i){return Object.entries(i).forEach(([r,o])=>{this.url.searchParams.append(r,`eq.${o}`)}),this}not(i,r,o){return this.url.searchParams.append(i,`not.${r}.${o}`),this}or(i,{foreignTable:r,referencedTable:o=r}={}){const l=o?`${o}.or`:"or";return this.url.searchParams.append(l,`(${i})`),this}filter(i,r,o){return this.url.searchParams.append(i,`${r}.${o}`),this}}return Dr.default=n,Dr}var zn;function sa(){if(zn)return Fr;zn=1,Object.defineProperty(Fr,"__esModule",{value:!0});const t=sr.__importDefault(sn());class s{constructor(a,{headers:i={},schema:r,fetch:o}){this.url=a,this.headers=new Headers(i),this.schema=r,this.fetch=o}select(a,i){const{head:r=!1,count:o}=i??{},l=r?"HEAD":"GET";let u=!1;const c=(a??"*").split("").map(d=>/\s/.test(d)&&!u?"":(d==='"'&&(u=!u),d)).join("");return this.url.searchParams.set("select",c),o&&this.headers.append("Prefer",`count=${o}`),new t.default({method:l,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(a,{count:i,defaultToNull:r=!0}={}){var o;const l="POST";if(i&&this.headers.append("Prefer",`count=${i}`),r||this.headers.append("Prefer","missing=default"),Array.isArray(a)){const u=a.reduce((c,d)=>c.concat(Object.keys(d)),[]);if(u.length>0){const c=[...new Set(u)].map(d=>`"${d}"`);this.url.searchParams.set("columns",c.join(","))}}return new t.default({method:l,url:this.url,headers:this.headers,schema:this.schema,body:a,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}upsert(a,{onConflict:i,ignoreDuplicates:r=!1,count:o,defaultToNull:l=!0}={}){var u;const c="POST";if(this.headers.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),i!==void 0&&this.url.searchParams.set("on_conflict",i),o&&this.headers.append("Prefer",`count=${o}`),l||this.headers.append("Prefer","missing=default"),Array.isArray(a)){const d=a.reduce((f,p)=>f.concat(Object.keys(p)),[]);if(d.length>0){const f=[...new Set(d)].map(p=>`"${p}"`);this.url.searchParams.set("columns",f.join(","))}}return new t.default({method:c,url:this.url,headers:this.headers,schema:this.schema,body:a,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch})}update(a,{count:i}={}){var r;const o="PATCH";return i&&this.headers.append("Prefer",`count=${i}`),new t.default({method:o,url:this.url,headers:this.headers,schema:this.schema,body:a,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch})}delete({count:a}={}){var i;const r="DELETE";return a&&this.headers.append("Prefer",`count=${a}`),new t.default({method:r,url:this.url,headers:this.headers,schema:this.schema,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch})}}return Fr.default=s,Fr}var Bn;function Mc(){if(Bn)return Mr;
75Bn=1,Object.defineProperty(Mr,"__esModule",{value:!0});const e=sr,t=e.__importDefault(sa()),s=e.__importDefault(sn());class n{constructor(i,{headers:r={},schema:o,fetch:l}={}){this.url=i,this.headers=new Headers(r),this.schemaName=o,this.fetch=l}from(i){const r=new URL(`${this.url}/${i}`);return new t.default(r,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(i){return new n(this.url,{headers:this.headers,schema:i,fetch:this.fetch})}rpc(i,r={},{head:o=!1,get:l=!1,count:u}={}){var c;let d;const f=new URL(`${this.url}/rpc/${i}`);let p;o||l?(d=o?"HEAD":"GET",Object.entries(r).filter(([g,v])=>v!==void 0).map(([g,v])=>[g,Array.isArray(v)?`{${v.join(",")}}`:`${v}`]).forEach(([g,v])=>{f.searchParams.append(g,v)})):(d="POST",p=r);const h=new Headers(this.headers);return u&&h.set("Prefer",`count=${u}`),new s.default({method:d,url:f,headers:h,schema:this.schemaName,body:p,fetch:(c=this.fetch)!==null&&c!==void 0?c:fetch})}}return Mr.default=n,Mr}Object.defineProperty(Fe,"__esModule",{value:!0});var na=Fe.PostgrestError=pa=Fe.PostgrestBuilder=ha=Fe.PostgrestTransformBuilder=ca=Fe.PostgrestFilterBuilder=la=Fe.PostgrestQueryBuilder=aa=Fe.PostgrestClient=void 0;const nr=sr,ia=nr.__importDefault(Mc());var aa=Fe.PostgrestClient=ia.default;const oa=nr.__importDefault(sa());var la=Fe.PostgrestQueryBuilder=oa.default;const ua=nr.__importDefault(sn());var ca=Fe.PostgrestFilterBuilder=ua.default;const da=nr.__importDefault(ra());var ha=Fe.PostgrestTransformBuilder=da.default;const fa=nr.__importDefault(ta());var pa=Fe.PostgrestBuilder=fa.default;const ga=nr.__importDefault(ea());na=Fe.PostgrestError=ga.default;var ma=Fe.default={PostgrestClient:ia.default,PostgrestQueryBuilder:oa.default,PostgrestFilterBuilder:ua.default,PostgrestTransformBuilder:da.default,PostgrestBuilder:fa.default,PostgrestError:ga.default};const Fc=ro({__proto__:null,get PostgrestBuilder(){return pa},get PostgrestClient(){return aa},get PostgrestError(){return na},get PostgrestFilterBuilder(){return ca},get PostgrestQueryBuilder(){return la},get PostgrestTransformBuilder(){return ha},default:ma},[Fe]),{PostgrestClient:Dc,PostgrestQueryBuilder:Uv,PostgrestFilterBuilder:qv,PostgrestTransformBuilder:Vv,PostgrestBuilder:Gv,PostgrestError:Wv}=ma||Fc;class $c{static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};if(typeof process<"u"){const s=process.versions;if(s&&s.node){const n=s.node,a=parseInt(n.replace(/^v/,"").split(".")[0]);return a>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${a} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${a} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
76import ws from "ws"
77new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.constructor)return t.constructor;let s=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(s+=`
78
79Suggested solution: ${t.workaround}`),new Error(s)}static createWebSocket(t,s){const n=this.getWebSocketConstructor();return new n(t,s)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const jc="2.79.0",Nc=`realtime-js/${jc}`,zc="1.0.0",$s=1e4,Bc=1e3,Hc=100;var vr;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(vr||(vr={}));var Pe;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(Pe||(Pe={}));var tt;(function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"})(tt||(tt={}));var js;(function(e){e.websocket="websocket"})(js||(js={}));var It;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(It||(It={}));class Uc{constructor(){this.HEADER_LENGTH=1}decode(t,s){return t.constructor===ArrayBuffer?s(this._binaryDecode(t)):s(typeof t=="string"?JSON.parse(t):{})}_binaryDecode(t){const s=new DataView(t),n=new TextDecoder;return this._decodeBroadcast(t,s,n)}_decodeBroadcast(t,s,n){const a=s.getUint8(1),i=s.getUint8(2);let r=this.HEADER_LENGTH+2;const o=n.decode(t.slice(r,r+a));r=r+a;const l=n.decode(t.slice(r,r+i));r=r+i;const u=JSON.parse(n.decode(t.slice(r,t.byteLength)));return{ref:null,topic:o,event:l,payload:u}}}class va{constructor(t,s){this.callback=t,this.timerCalc=s,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=s}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var we;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(we||(we={}));const Hn=(e,t,s={})=>{var n;const a=(n=s.skipTypes)!==null&&n!==void 0?n:[];return t?Object.keys(t).reduce((i,r)=>(i[r]=qc(r,e,t,a),i),{}):{}},qc=(e,t,s,n)=>{const a=t.find(o=>o.name===e),i=a==null?void 0:a.type,r=s[e];return i&&!n.includes(i)?ya(i,r):Ns(r)},ya=(e,t)=>{if(e.charAt(0)==="_"){const s=e.slice(1,e.length);return Kc(t,s)}switch(e){case we.bool:return Vc(t);case we.float4:case we.float8:case we.int2:case we.int4:case we.int8:case we.numeric:case we.oid:return Gc(t);case we.json:case we.jsonb:return Wc(t);case we.timestamp:return Xc(t);case we.abstime:case we.date:case we.daterange:case we.int4range:case we.int8range:case we.money:case we.reltime:case we.text:case we.time:case we.timestamptz:case we.timetz:case we.tsrange:case we.tstzrange:return Ns(t);default:return Ns(t)}},Ns=e=>e,Vc=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},Gc=e=>{if(typeof e=="string"){const t=parseFloat(e);
79if(!Number.isNaN(t))return t}return e},Wc=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch(t){return console.log(`JSON parse error: ${t}`),e}return e},Kc=(e,t)=>{if(typeof e!="string")return e;const s=e.length-1,n=e[s];if(e[0]==="{"&&n==="}"){let i;const r=e.slice(1,s);try{i=JSON.parse("["+r+"]")}catch{i=r?r.split(","):[]}return i.map(o=>ya(t,o))}return e},Xc=e=>typeof e=="string"?e.replace(" ","T"):e,ba=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};class bs{constructor(t,s,n={},a=$s){this.channel=t,this.event=s,this.payload=n,this.timeout=a,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(t){this.timeout=t,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(t){this.payload=Object.assign(Object.assign({},this.payload),t)}receive(t,s){var n;return this._hasReceived(t)&&s((n=this.receivedResp)===null||n===void 0?void 0:n.response),this.recHooks.push({status:t,callback:s}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const t=s=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=s,this._matchReceive(s)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,s){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:s})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:t,response:s}){this.recHooks.filter(n=>n.status===t).forEach(n=>n.callback(s))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}}var Un;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(Un||(Un={}));class yr{constructor(t,s){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const n=(s==null?void 0:s.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(n.state,{},a=>{const{onJoin:i,onLeave:r,onSync:o}=this.caller;this.joinRef=this.channel._joinRef(),this.state=yr.syncState(this.state,a,i,r),this.pendingDiffs.forEach(l=>{this.state=yr.syncDiff(this.state,l,i,r)}),this.pendingDiffs=[],o()}),this.channel._on(n.diff,{},a=>{const{onJoin:i,onLeave:r,onSync:o}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(a):(this.state=yr.syncDiff(this.state,a,i,r),o())}),this.onJoin((a,i,r)=>{this.channel._trigger("presence",{event:"join",key:a,currentPresences:i,newPresences:r})}),this.onLeave((a,i,r)=>{this.channel._trigger("presence",{event:"leave",key:a,currentPresences:i,leftPresences:r})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,s,n,a){const i=this.cloneDeep(t),r=this.transformState(s),o={},l={};return this.map(i,(u,c)=>{r[u]||(l[u]=c)}),this.map(r,(u,c)=>{const d=i[u];if(d){const f=c.map(v=>v.presence_ref),p=d.map(v=>v.presence_ref),h=c.filter(v=>p.indexOf(v.presence_ref)<0),g=d.filter(v=>f.indexOf(v.presence_ref)<0);h.length>0&&(o[u]=h),g.length>0&&(l[u]=g)}else o[u]=c}),this.syncDiff(i,{joins:o,leaves:l},n,a)}static syncDiff(t,s,n,a){const{joins:i,leaves:r}={joins:this.transformState(s.joins),leaves:this.transformState(s.leaves)};return n||(n=()=>{}),a||(a=()=>{}),this.map(i,(o,l)=>{var u;const c=(u=t[o])!==null&&u!==void 0?u:[];if(t[o]=this.cloneDeep(l),c.length>0){const d=t[o].map(p=>p.presence_ref),f=c.filter(p=>d.indexOf(p.presence_ref)<0);t[o].unshift(...f)}n(o,c,l)}),this.map(r,(o,l)=>{let u=t[o];if(!u)return;const c=l.map(d=>d.presence_ref);u=u.filter(d=>c.indexOf(d.presence_ref)<0),t[o]=u,a(o,u,l),u.length===0&&delete t[o]}),t}static map(t,s){return Object.getOwnPropertyNames(t).map(n=>s(n,t[n]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((s,n)=>{const a=t[n];return"metas"in a?s[n]=a.metas.map(i=>(i.presence_ref=i.phx_ref,delete i.phx_ref,delete i.phx_ref_prev,i)):s[n]=a,s},{})}static cloneDeep(t){return JSON.parse(JSON.stringify(t))}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var qn;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"}
79)(qn||(qn={}));var br;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(br||(br={}));var lt;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(lt||(lt={}));class nn{constructor(t,s={config:{}},n){var a,i;if(this.topic=t,this.params=s,this.socket=n,this.bindings={},this.state=Pe.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},s.config),this.timeout=this.socket.timeout,this.joinPush=new bs(this,tt.join,this.params,this.timeout),this.rejoinTimer=new va(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Pe.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(r=>r.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Pe.closed,this.socket._remove(this)}),this._onError(r=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,r),this.state=Pe.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Pe.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",r=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,r),this.state=Pe.errored,this.rejoinTimer.scheduleTimeout())}),this._on(tt.reply,{},(r,o)=>{this._trigger(this._replyEventName(o),r)}),this.presence=new yr(this),this.broadcastEndpointURL=ba(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((i=(a=this.params.config)===null||a===void 0?void 0:a.broadcast)===null||i===void 0)&&i.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(t,s=this.timeout){var n,a,i;if(this.socket.isConnected()||this.socket.connect(),this.state==Pe.closed){const{config:{broadcast:r,presence:o,private:l}}=this.params,u=(a=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(p=>p.filter))!==null&&a!==void 0?a:[],c=!!this.bindings[br.PRESENCE]&&this.bindings[br.PRESENCE].length>0||((i=this.params.config.presence)===null||i===void 0?void 0:i.enabled)===!0,d={},f={broadcast:r,presence:Object.assign(Object.assign({},o),{enabled:c}),postgres_changes:u,private:l};this.socket.accessTokenValue&&(d.access_token=this.socket.accessTokenValue),this._onError(p=>t==null?void 0:t(lt.CHANNEL_ERROR,p)),this._onClose(()=>t==null?void 0:t(lt.CLOSED)),this.updateJoinPayload(Object.assign({config:f},d)),this.joinedOnce=!0,this._rejoin(s),this.joinPush.receive("ok",async({postgres_changes:p})=>{var h;if(this.socket.setAuth(),p===void 0){t==null||t(lt.SUBSCRIBED);return}else{const g=this.bindings.postgres_changes,v=(h=g==null?void 0:g.length)!==null&&h!==void 0?h:0,b=[];for(let y=0;y<v;y++){const m=g[y],{filter:{event:S,schema:k,table:C,filter:L}}=m,_=p&&p[y];if(_&&_.event===S&&_.schema===k&&_.table===C&&_.filter===L)b.push(Object.assign(Object.assign({},m),{id:_.id}));else{this.unsubscribe(),this.state=Pe.errored,t==null||t(lt.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=b,t&&t(lt.SUBSCRIBED);return}}).receive("error",p=>{this.state=Pe.errored,t==null||t(lt.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(p).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(lt.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,s={}){return await this.send({type:"presence",event:"track",payload:t},s.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,s,n){return this.state===Pe.joined&&t===br.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(()=>this.subscribe())),this._on(t,s,n)}async httpSend(t,s,n={}){var a;const i=this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"";if(s==null)return Promise.reject("Payload is required for httpSend()");const r={method:"POST",headers:{Authorization:i,apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:s,private:this.private}]})},o=await this._fetchWithTimeout(this.broadcastEndpointURL,r,(a=n.timeout)!==null&&a!==void 0?a:this.timeout);if(o.status===202)return{success:!0};let l=o.statusText;
79try{const u=await o.json();l=u.error||u.message||l}catch{}return Promise.reject(new Error(l))}async send(t,s={}){var n,a;if(!this._canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:i,payload:r}=t,l={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:r,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(n=s.timeout)!==null&&n!==void 0?n:this.timeout);return await((a=u.body)===null||a===void 0?void 0:a.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var r,o,l;const u=this._push(t.type,t,s.timeout||this.timeout);t.type==="broadcast"&&!(!((l=(o=(r=this.params)===null||r===void 0?void 0:r.config)===null||o===void 0?void 0:o.broadcast)===null||l===void 0)&&l.ack)&&i("ok"),u.receive("ok",()=>i("ok")),u.receive("error",()=>i("error")),u.receive("timeout",()=>i("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=Pe.leaving;const s=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(tt.close,"leave",this._joinRef())};this.joinPush.destroy();let n=null;return new Promise(a=>{n=new bs(this,tt.leave,{},t),n.receive("ok",()=>{s(),a("ok")}).receive("timeout",()=>{s(),a("timed out")}).receive("error",()=>{a("error")}),n.send(),this._canPush()||n.trigger("ok",{})}).finally(()=>{n==null||n.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Pe.closed,this.bindings={}}async _fetchWithTimeout(t,s,n){const a=new AbortController,i=setTimeout(()=>a.abort(),n),r=await this.socket.fetch(t,Object.assign(Object.assign({},s),{signal:a.signal}));return clearTimeout(i),r}_push(t,s,n=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let a=new bs(this,t,s,n);return this._canPush()?a.send():this._addToPushBuffer(a),a}_addToPushBuffer(t){if(t.startTimeout(),this.pushBuffer.push(t),this.pushBuffer.length>Hc){const s=this.pushBuffer.shift();s&&(s.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${s.event}`,s.payload))}}_onMessage(t,s,n){return s}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,s,n){var a,i;const r=t.toLocaleLowerCase(),{close:o,error:l,leave:u,join:c}=tt;if(n&&[o,l,u,c].indexOf(r)>=0&&n!==this._joinRef())return;let f=this._onMessage(r,s,n);if(s&&!f)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(r)?(a=this.bindings.postgres_changes)===null||a===void 0||a.filter(p=>{var h,g,v;return((h=p.filter)===null||h===void 0?void 0:h.event)==="*"||((v=(g=p.filter)===null||g===void 0?void 0:g.event)===null||v===void 0?void 0:v.toLocaleLowerCase())===r}).map(p=>p.callback(f,n)):(i=this.bindings[r])===null||i===void 0||i.filter(p=>{var h,g,v,b,y,m;if(["broadcast","presence","postgres_changes"].includes(r))if("id"in p){const S=p.id,k=(h=p.filter)===null||h===void 0?void 0:h.event;return S&&((g=s.ids)===null||g===void 0?void 0:g.includes(S))&&(k==="*"||(k==null?void 0:k.toLocaleLowerCase())===((v=s.data)===null||v===void 0?void 0:v.type.toLocaleLowerCase()))}else{const S=(y=(b=p==null?void 0:p.filter)===null||b===void 0?void 0:b.event)===null||y===void 0?void 0:y.toLocaleLowerCase();return S==="*"||S===((m=s==null?void 0:s.event)===null||m===void 0?void 0:m.toLocaleLowerCase())}else return p.type.toLocaleLowerCase()===r}).map(p=>{if(typeof f=="object"&&"ids"in f){const h=f.data,{schema:g,table:v,commit_timestamp:b,type:y,errors:m}=h;f=Object.assign(Object.assign({},{schema:g,table:v,commit_timestamp:b,eventType:y,new:{},old:{},errors:m}),this._getPayloadRecords(h))}p.callback(f,n)})}_isClosed(){return this.state===Pe.closed}_isJoined(){return this.state===Pe.joined}_isJoining(){return this.state===Pe.joining}_isLeaving(){return this.state===Pe.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,s,n){const a=t.toLocaleLowerCase(),i={type:a,filter:s,callback:n};return this.bindings[a]?this.bindings[a].push(i):this.bindings[a]=[i],this}_off(t,s){const n=t.toLocaleLowerCase();return this.bindings[n]&&(this.bindings[n]=this.bindings[n].filter(a=>{var i;return!(((i=a.type)===null||i===void 0?void 0:i.toLocaleLowerCase())===n&&nn.isEqual(a.filter,s))})),this}static isEqual(t,s){if(Object.keys(t).length!==Object.keys(s).length)return!1;for(const n in t)if(t[n]!==s[n])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(tt.close,{},t)}_onError(t){this._on(tt.error,{},s=>t(s))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Pe.joining,this.joinPush.resend(t))}_getPayloadRecords(t){const s={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(s.new=Hn(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(s.old=Hn(t.columns,t.old_record)),s}}const ws=()=>{},zr={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},Yc=[1e3,2e3,5e3,1e4],Jc=1e4,Qc=`
80  addEventListener("message", (e) => {
81    if (e.data.event === "start") {
82      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
83    }
84  });`;class Zc{constructor(t,s){var n;if(this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=$s,this.transport=null,this.heartbeatIntervalMs=zr.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=ws,this.ref=0,this.reconnectTimer=null,this.logger=ws,this.conn=null,this.sendBuffer=[],this.serializer
84=new Uc,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._resolveFetch=a=>a?(...i)=>a(...i):(...i)=>fetch(...i),!(!((n=s==null?void 0:s.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=s.params.apikey,this.endPoint=`${t}/${js.websocket}`,this.httpEndpoint=ba(t),this._initializeOptions(s),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(s==null?void 0:s.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=$c.createWebSocket(this.endpointURL())}catch(t){this._setConnectionState("disconnected");const s=t.message;throw s.includes("Node.js")?new Error(`${s}
85
86To use Realtime in Node.js, you need to provide a WebSocket implementation:
87
88Option 1: Use Node.js 22+ which has native WebSocket support
89Option 2: Install and provide the "ws" package:
90
91  npm install ws
92
93  import ws from "ws"
94  const client = new RealtimeClient(url, {
95    ...options,
96    transport: ws
97  })`):new Error(`WebSocket not available: ${s}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:zc}))}disconnect(t,s){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const n=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(n),this._setConnectionState("disconnected")},t?this.conn.close(t,s??""):this.conn.close(),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(t){const s=await t.unsubscribe();return this.channels.length===0&&this.disconnect(),s}async removeAllChannels(){const t=await Promise.all(this.channels.map(s=>s.unsubscribe()));return this.channels=[],this.disconnect(),t}log(t,s,n){this.logger(t,s,n)}connectionState(){switch(this.conn&&this.conn.readyState){case vr.connecting:return It.Connecting;case vr.open:return It.Open;case vr.closing:return It.Closing;default:return It.Closed}}isConnected(){return this.connectionState()===It.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(t,s={config:{}}){const n=`realtime:${t}`,a=this.getChannels().find(i=>i.topic===n);if(a)return a;{const i=new nn(`realtime:${t}`,s,this);return this.channels.push(i),i}}push(t){const{topic:s,event:n,payload:a,ref:i}=t,r=()=>{this.encode(t,o=>{var l;(l=this.conn)===null||l===void 0||l.send(o)})};this.log("push",`${s} ${n} (${i})`,a),this.isConnected()?r():this.sendBuffer.push(r)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}async sendHeartbeat(){var t;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(s){this.log("error","error in heartbeat callback",s)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(s){this.log("error","error in heartbeat callback",s)}this._wasManualDisconnect=!1,(t=this.conn)===null||t===void 0||t.close(Bc,"heartbeat timeout"),setTimeout(()=>{var s;this.isConnected()||(s=this.reconnectTimer)===null||s===void 0||s.scheduleTimeout()},zr.HEARTBEAT_TIMEOUT_FALLBACK);return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(s){this.log("error","error in heartbeat callback",s)}this._setAuthSafely("heartbeat")}onHeartbeat(t){this.heartbeatCallback=t}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}_makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}_leaveOpenTopic(t){let s=this.channels.find(n=>n.topic===t&&(n._isJoined()||n._isJoining()));s&&(this.log("transport",`leaving duplicate topic "${t}"`),s.unsubscribe())}_remove(t){this.channels=this.channels.filter(s=>s.topic!==t.topic)}_onConnMessage(t){this.decode(t.data,s=>
97{if(s.topic==="phoenix"&&s.event==="phx_reply")try{this.heartbeatCallback(s.payload.status==="ok"?"ok":"error")}catch(u){this.log("error","error in heartbeat callback",u)}s.ref&&s.ref===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null);const{topic:n,event:a,payload:i,ref:r}=s,o=r?`(${r})`:"",l=i.status||"";this.log("receive",`${l} ${n} ${a} ${o}`.trim(),i),this.channels.filter(u=>u._isMember(n)).forEach(u=>u._trigger(a,i,r)),this._triggerStateCallbacks("message",s)})}_clearTimer(t){var s;t==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):t==="reconnect"&&((s=this.reconnectTimer)===null||s===void 0||s.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=t=>this._onConnError(t),this.conn.onmessage=t=>this._onConnMessage(t),this.conn.onclose=t=>this._onConnClose(t))}_teardownConnection(){this.conn&&(this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null),this._clearAllTimers(),this.channels.forEach(t=>t.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=s=>{this.log("worker","worker error",s.message),this.workerRef.terminate()},this.workerRef.onmessage=s=>{s.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_onConnClose(t){var s;this._setConnectionState("disconnected"),this.log("transport","close",t),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(s=this.reconnectTimer)===null||s===void 0||s.scheduleTimeout(),this._triggerStateCallbacks("close",t)}_onConnError(t){this._setConnectionState("disconnected"),this.log("transport",`${t}`),this._triggerChanError(),this._triggerStateCallbacks("error",t)}_triggerChanError(){this.channels.forEach(t=>t._trigger(tt.error))}_appendParams(t,s){if(Object.keys(s).length===0)return t;const n=t.match(/\?/)?"&":"?",a=new URLSearchParams(s);return`${t}${n}${a}`}_workerObjectUrl(t){let s;if(t)s=t;else{const n=new Blob([Qc],{type:"application/javascript"});s=URL.createObjectURL(n)}return s}_setConnectionState(t,s=!1){this._connectionState=t,t==="connecting"?this._wasManualDisconnect=!1:t==="disconnecting"&&(this._wasManualDisconnect=s)}async _performAuth(t=null){let s;t?s=t:this.accessToken?s=await this.accessToken():s=this.accessTokenValue,this.accessTokenValue!=s&&(this.accessTokenValue=s,this.channels.forEach(n=>{const a={access_token:s,version:Nc};s&&n.updateJoinPayload(a),n.joinedOnce&&n._isJoined()&&n._push(tt.access_token,{access_token:s})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this.setAuth().catch(s=>{this.log("error",`error setting auth in ${t}`,s)})}_triggerStateCallbacks(t,s){try{this.stateChangeCallbacks[t].forEach(n=>{try{n(s)}catch(a){this.log("error",`error in ${t} callback`,a)}})}catch(n){this.log("error",`error triggering ${t} callbacks`,n)}}_setupReconnectionTimer(){this.reconnectTimer=new va(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},zr.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(t){var s,n,a,i,r,o,l,u,c;if(this.transport=(s=t==null?void 0:t.transport)!==null&&s!==void 0?s:null,this.timeout=(n=t==null?void 0:t.t
97imeout)!==null&&n!==void 0?n:$s,this.heartbeatIntervalMs=(a=t==null?void 0:t.heartbeatIntervalMs)!==null&&a!==void 0?a:zr.HEARTBEAT_INTERVAL,this.worker=(i=t==null?void 0:t.worker)!==null&&i!==void 0?i:!1,this.accessToken=(r=t==null?void 0:t.accessToken)!==null&&r!==void 0?r:null,this.heartbeatCallback=(o=t==null?void 0:t.heartbeatCallback)!==null&&o!==void 0?o:ws,t!=null&&t.params&&(this.params=t.params),t!=null&&t.logger&&(this.logger=t.logger),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(l=t==null?void 0:t.reconnectAfterMs)!==null&&l!==void 0?l:d=>Yc[d-1]||Jc,this.encode=(u=t==null?void 0:t.encode)!==null&&u!==void 0?u:(d,f)=>f(JSON.stringify(d)),this.decode=(c=t==null?void 0:t.decode)!==null&&c!==void 0?c:this.serializer.decode.bind(this.serializer),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl}}}class an extends Error{constructor(t){super(t),this.__isStorageError=!0,this.name="StorageError"}}function xe(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}class ed extends an{constructor(t,s,n){super(t),this.name="StorageApiError",this.status=s,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class zs extends an{constructor(t,s){super(t),this.name="StorageUnknownError",this.originalError=s}}const on=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),td=()=>Response,Bs=e=>{if(Array.isArray(e))return e.map(s=>Bs(s));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([s,n])=>{const a=s.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));t[a]=Bs(n)}),t},rd=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},_s=e=>{var t;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(t=e.error)===null||t===void 0?void 0:t.message)||JSON.stringify(e)},sd=(e,t,s)=>ue(void 0,void 0,void 0,function*(){const n=yield td();e instanceof n&&!(s!=null&&s.noResolveJson)?e.json().then(a=>{const i=e.status||500,r=(a==null?void 0:a.statusCode)||i+"";t(new ed(_s(a),i,r))}).catch(a=>{t(new zs(_s(a),a))}):t(new zs(_s(e),e))}),nd=(e,t,s,n)=>{const a={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"||!n?a:(rd(n)?(a.headers=Object.assign({"Content-Type":"application/json"},t==null?void 0:t.headers),a.body=JSON.stringify(n)):a.body=n,t!=null&&t.duplex&&(a.duplex=t.duplex),Object.assign(Object.assign({},a),s))};function Cr(e,t,s,n,a,i){return ue(this,void 0,void 0,function*(){return new Promise((r,o)=>{e(s,nd(t,n,a,i)).then(l=>{if(!l.ok)throw l;return n!=null&&n.noResolveJson?l:l.json()}).then(l=>r(l)).catch(l=>sd(l,o,n))})})}function Er(e,t,s,n){return ue(this,void 0,void 0,function*(){return Cr(e,"GET",t,s,n)})}function et(e,t,s,n,a){return ue(this,void 0,void 0,function*(){return Cr(e,"POST",t,n,a,s)})}function Hs(e,t,s,n,a){return ue(this,void 0,void 0,function*(){return Cr(e,"PUT",t,n,a,s)})}function id(e,t,s,n){return ue(this,void 0,void 0,function*(){return Cr(e,"HEAD",t,Object.assign(Object.assign({},s),{noResolveJson:!0}),n)})}function ln(e,t,s,n,a){return ue(this,void 0,void 0,function*(){return Cr(e,"DELETE",t,n,a,s)})}class ad{constructor(t,s){this.downloadFn=t,this.shouldThrowOnError=s}then(t,s){return this.execute().then(t,s)}execute(){return ue(this,void 0,void 0,function*(){try{return{data:(yield this.downloadFn()).body,error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(xe(t))return{data:null,error:t};throw t}})}}var wa;class od{constructor(t,s){this.downloadFn=t,this.shouldThrowOnError=s,this[wa]="BlobDownloadBuilder",this.promise=null}asStream(){return new ad(this.downloadFn,this.shouldThrowOnError)}then(t,s){return this.getPromise().then(t,s)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}execute(){return ue(this,void 0,void 0,function*(){try{return{data:yield(yield this.downloadFn()).blob(),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(xe(t))return{data:null,error:t};throw t}})}}wa=Symbol.toStringTag;const ld=od,ud={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Vn={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class cd{constructor(t,s={},n,a){this.shouldThrowOnError=!1,this.url=t,this.headers=s,this.bucketId=n,this.fetch=on(a)}throwOnError(){return this.shouldThrowOnError=!0,this}uploadOrUpdate(t,s,n,a){return ue(this,void 0,void 0,function*(){try{let i;const r=Object.assign(Object.assign({},Vn),a);let o=Object.assign(Object.assign({},this.headers),t==="POST"&&{"x-upsert":String(r.upsert)});const l=r.metadata;typeof Blob<"u"&&n instanceof Blob?(i=new FormData,i.append("cacheControl",r.cacheControl),l&&i.append("metadata",this.encodeMetadata(l)),i.append("",n)):typeof FormData<"u"&&n instanceof FormData?(i=n,i.has("cacheControl")||i.append("cacheControl",r.cacheControl),l&&!i.has("metadata")&&i.append("metadata",this.encodeMetadata(l))):(i=n,o["cache-control"]=`max-age=${r.cacheControl}`,o["content-type"]=r.contentType,l&&(o["x-metadata"]=this.toBase64(this.encodeMetadata(l))),(typeof ReadableStream<"u"&&i instanceof ReadableStream||i&&typeof i=="object"&&"pipe"in i&&typeof i.pipe=="function")&&!r.duplex&&(r.duplex="half")),a!=null&&a.headers&&(o=Object.assign(Object.assign({},o),a.headers));const u=this._removeEmptyFolders(s),c=this._getFinalPath(u),d=yield(t=="PUT"?Hs:et)(this.fetch,`${this.url}/object/${c}`,i,Object.assign({headers:o},r!=null&&r.duplex?{duplex:r.duplex}:{}));return{data:{path:u,id:d.Id,fullPath:d.Key},error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(xe(i))return{data:null,error:i};throw i}})}upload(t,s,n){return ue(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",t,s,n)})}uploadToSignedUrl(t,s,n,a){return ue(this,void 0,void 0,function*(){const i=this._removeEmptyFolders(t),r=this._getFinalPath(i),o=new URL(this.url+`/object/upload/sign/${r}`);o.searchParams.set("token",s);try{let l;const u=Object.assign({upsert:Vn.upsert},a),c=Object.assign(Object.assign({},this.headers),{"x-upsert":String(u.upsert)});typeof Blob<"u"&&n instanceof Blob?(l=new FormData,l.append("cacheControl",u.cacheControl),l.append("",n)):typeof FormData<"u"&&n instanceof FormData?(l=n,l.append("cacheControl",u.cacheControl)):(l=n,c["cache-control"]=`max-age=${u.cacheControl}`,c["content-type"]=u.contentType);const d=yield Hs(this.fetch,o.toString(),l,{headers:c});return{data:{path:i,fullPath:d.Key},error:null}}catch(l){if(this.shouldThrowOnError)throw l;if(xe(l))return{data:null,error:l};throw l}})}createSignedUploadUrl(t,s){return ue(this,void 0,void 0,function*(){try{let n=this._getFinalPath(t);const a=Object.assign({},this.headers);s!=null&&s.upsert&&(a["x-upsert"]="true");const i=yield et(this.fetch,`${this.url}/object/upload/sign/${n}`,{},{headers:a}
97),r=new URL(this.url+i.url),o=r.searchParams.get("token");if(!o)throw new an("No token returned by API");return{data:{signedUrl:r.toString(),path:t,token:o},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(xe(n))return{data:null,error:n};throw n}})}update(t,s,n){return ue(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",t,s,n)})}move(t,s,n){return ue(this,void 0,void 0,function*(){try{return{data:yield et(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:t,destinationKey:s,destinationBucket:n==null?void 0:n.destinationBucket},{headers:this.headers}),error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(xe(a))return{data:null,error:a};throw a}})}copy(t,s,n){return ue(this,void 0,void 0,function*(){try{return{data:{path:(yield et(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:t,destinationKey:s,destinationBucket:n==null?void 0:n.destinationBucket},{headers:this.headers})).Key},error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(xe(a))return{data:null,error:a};throw a}})}createSignedUrl(t,s,n){return ue(this,void 0,void 0,function*(){try{let a=this._getFinalPath(t),i=yield et(this.fetch,`${this.url}/object/sign/${a}`,Object.assign({expiresIn:s},n!=null&&n.transform?{transform:n.transform}:{}),{headers:this.headers});const r=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return i={signedUrl:encodeURI(`${this.url}${i.signedURL}${r}`)},{data:i,error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(xe(a))return{data:null,error:a};throw a}})}createSignedUrls(t,s,n){return ue(this,void 0,void 0,function*(){try{const a=yield et(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:s,paths:t},{headers:this.headers}),i=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return{data:a.map(r=>Object.assign(Object.assign({},r),{signedUrl:r.signedURL?encodeURI(`${this.url}${r.signedURL}${i}`):null})),error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(xe(a))return{data:null,error:a};throw a}})}download(t,s){const a=typeof(s==null?void 0:s.transform)<"u"?"render/image/authenticated":"object",i=this.transformOptsToQueryString((s==null?void 0:s.transform)||{}),r=i?`?${i}`:"",o=this._getFinalPath(t),l=()=>Er(this.fetch,`${this.url}/${a}/${o}${r}`,{headers:this.headers,noResolveJson:!0});return new ld(l,this.shouldThrowOnError)}info(t){return ue(this,void 0,void 0,function*(){const s=this._getFinalPath(t);try{const n=yield Er(this.fetch,`${this.url}/object/info/${s}`,{headers:this.headers});return{data:Bs(n),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(xe(n))return{data:null,error:n};throw n}})}exists(t){return ue(this,void 0,void 0,function*(){const s=this._getFinalPath(t);try{return yield id(this.fetch,`${this.url}/object/${s}`,{headers:this.headers}),{data:!0,error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(xe(n)&&n instanceof zs){const a=n.originalError;if([400,404].includes(a==null?void 0:a.status))return{data:!1,error:n}}throw n}})}getPublicUrl(t,s){const n=this._getFinalPath(t),a=[],i=s!=null&&s.download?`download=${s.download===!0?"":s.download}`:"";i!==""&&a.push(i);const o=typeof(s==null?void 0:s.transform)<"u"?"render/image":"object",l=this.transformOptsToQueryString((s==null?void 0:s.transform)||{});l!==""&&a.push(l);let u=a.join("&");return u!==""&&(u=`?${u}`),{data:{publicUrl:encodeURI(`${this.url}/${o}/public/${n}${u}`)}}}remove(t){return ue(this,void 0,void 0,function*(){try{return{data:yield ln(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:t},{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(xe(s))return{data:null,error:s};throw s}})}list(t,s,n){return ue(this,void 0,void 0,function*(){try{const a=Object.assign(Object.assign(Object.assign({},ud),s),{prefix:t||""});return{data:yield et(this.fetch,`${this.url}/object/list/${this.bucketId}`,a,{headers:this.headers},n),error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(xe(a))return{data:null,error:a};throw a}})}listV2(t,s){return ue(this,void 0,void 0,function*(){try{const n=Object.assign({},t);return{data:yield et(this.fetch,`${this.url}/object/list-v2/${this.bucketId}`,n,{headers:this.headers},s),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(xe(n))return{data:null,error:n};throw n}})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(t){const s=[];return t.width&&s.push(`width=${t.width}`),t.height&&s.push(`height=${t.height}`),t.resize&&s.push(`resize=${t.resize}`),t.format&&s.push(`format=${t.format}`),t.quality&&s.push(`quality=${t.quality}`),s.join("&")}}const _a="2.79.0",Sa={"X-Client-Info":`storage-js/${_a}`};class dd{constructor(t,s={},n,a){this.shouldThrowOnError=!1;const i=new URL(t);a!=null&&a.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase.")),this.url=i.href.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},Sa),s),this.fetch=on(n)}throwOnError(){return this.shouldThrowOnError=!0,this}listBuckets(t){return ue(this,void 0,void 0,function*(){try{const s=this.listBucketOptionsToQueryString(t);return{data:yield Er(this.fetch,`${this.url}/bucket${s}`,{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(xe(s))return{data:null,error:s};throw s}})}getBucket(t){return ue(this,void 0,void 0,function*(){try{return{data:yield Er(this.fetch,`${this.url}/bucket/${t}`,{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(xe(s))return{data:null,error:s};throw s}})}createBucket(t){return ue(this,arguments,void 0,function*(s,n={public:!1}){try{return{data:yield et(this.fetch,`${this.url}/bucket`,{id:s,name:s,type:n.type,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(xe(a))return{data:null,error:a};throw a}})}updateBucket(t,s){return ue(this,void 0,void 0,function*(){try{return{data:yield Hs(this.fetch,`${this.url}/bucket/${t}`,{id:t,name:t,public:s.public,file_size_limit:s.fileSizeLimit,allowed_mime_types:s.allowedMimeTypes},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(xe(n))return{data:null,error:n};throw n}})}emptyBucket(t){return ue(this,void 0,void 0,function*(){try{return{data:yield et(this.fetch,`${this.url}/bucket/${t}/empty`,{},{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(xe(s))return{data:null,error:s};throw s}})}deleteBucket(t){return ue(this,void 0,void 0,function*(){try{return{data:yield ln(this.fetch,`${this.url}/bucket/${t}`,{},{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(xe(s))return{data:null,error:s};throw s}})}listBucketOptionsToQueryString(t){const s={};return t&&("limit"in t&&(s.limit=String(t.limit)),"offset"in t&&(s.offset=String(t.offset)),t.search&&(s.search=t.search),t.sortColumn&&(s.sortColumn=t.sortColumn),t.sortOrder&&(s.sortOrder=t.sortOrder)),Object.keys(s).length>0?"?"+new URLSearchParams(s).toString():""}}class hd{constructor(t,s={},n){this.shouldThrowOnError=!1,this.url=t.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},Sa),s),this.fetch=on(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(t){return ue(this,void 0,void 0,function*(){try{return{data:yield et(this.fetch,`${this.url}/bucket`,{name:t},{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(xe(s))return{data:null,error:s};throw s}})}listBuckets(t){return ue(this,void 0,void 0,function*(){try{const s=new URLSearchParams;(t==null?void 0:t.limit)!==void 0&&s.set("limit",t.limit.toString()),(t==null?void 0:t.offset)!==void 0&&s.set("offset",t.offset.toString()),t!=null&&t.sortColumn&&s.set("sortColumn",t.sortColumn),t!=null&&t.sortOrder&&s.set("sortOrder",t.sortOrder),t!=null&&t.search&&s.set("search",t.search);const n=s.toString(),a=n?`${this.url}/bucket?${n}`:`${this.url}/bucket`;return{data:yield Er(this.fetch,a,{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(xe(s))return{data:null,error:s};throw s}})}deleteBucket(t){return ue(this,void 0,void 0,function*(){try{return{data:yield ln(this.fetch,`${this.url}/bucket/${t}`,{},{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(xe(s))return{data:null,error:s};throw s}})}}const un={"X-Client-Info":`storage-js/${_a}`,"Content-Type":"application/json"};
97class Ea extends Error{constructor(t){super(t),this.__isStorageVectorsError=!0,this.name="StorageVectorsError"}}function qe(e){return typeof e=="object"&&e!==null&&"__isStorageVectorsError"in e}class Ss extends Ea{constructor(t,s,n){super(t),this.name="StorageVectorsApiError",this.status=s,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class fd extends Ea{constructor(t,s){super(t),this.name="StorageVectorsUnknownError",this.originalError=s}}var Gn;(function(e){e.InternalError="InternalError",e.S3VectorConflictException="S3VectorConflictException",e.S3VectorNotFoundException="S3VectorNotFoundException",e.S3VectorBucketNotEmpty="S3VectorBucketNotEmpty",e.S3VectorMaxBucketsExceeded="S3VectorMaxBucketsExceeded",e.S3VectorMaxIndexesExceeded="S3VectorMaxIndexesExceeded"})(Gn||(Gn={}));const cn=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),pd=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Wn=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),gd=(e,t,s)=>ue(void 0,void 0,void 0,function*(){if(e&&typeof e=="object"&&"status"in e&&"ok"in e&&typeof e.status=="number"&&!(s!=null&&s.noResolveJson)){const a=e.status||500,i=e;if(typeof i.json=="function")i.json().then(r=>{const o=(r==null?void 0:r.statusCode)||(r==null?void 0:r.code)||a+"";t(new Ss(Wn(r),a,o))}).catch(()=>{const r=a+"",o=i.statusText||`HTTP ${a} error`;t(new Ss(o,a,r))});else{const r=a+"",o=i.statusText||`HTTP ${a} error`;t(new Ss(o,a,r))}}else t(new fd(Wn(e),e))}),md=(e,t,s,n)=>{const a={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"||!n?a:(pd(n)?(a.headers=Object.assign({"Content-Type":"application/json"},t==null?void 0:t.headers),a.body=JSON.stringify(n)):a.body=n,Object.assign(Object.assign({},a),s))};function vd(e,t,s,n,a,i){return ue(this,void 0,void 0,function*(){return new Promise((r,o)=>{e(s,md(t,n,a,i)).then(l=>{if(!l.ok)throw l;if(n!=null&&n.noResolveJson)return l;const u=l.headers.get("content-type");return!u||!u.includes("application/json")?{}:l.json()}).then(l=>r(l)).catch(l=>gd(l,o,n))})})}function Ve(e,t,s,n,a){return ue(this,void 0,void 0,function*(){return vd(e,"POST",t,n,a,s)})}class yd{constructor(t,s={},n){this.shouldThrowOnError=!1,this.url=t.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},un),s),this.fetch=cn(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createIndex(t){return ue(this,void 0,void 0,function*(){try{return{data:(yield Ve(this.fetch,`${this.url}/CreateIndex`,t,{headers:this.headers}))||{},error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(qe(s))return{data:null,error:s};throw s}})}getIndex(t,s){return ue(this,void 0,void 0,function*(){try{return{data:yield Ve(this.fetch,`${this.url}/GetIndex`,{vectorBucketName:t,indexName:s},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(qe(n))return{data:null,error:n};throw n}})}listIndexes(t){return ue(this,void 0,void 0,function*(){try{return{data:yield Ve(this.fetch,`${this.url}/ListIndexes`,t,{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(qe(s))return{data:null,error:s};throw s}})}deleteIndex(t,s){return ue(this,void 0,void 0,function*(){try{return{data:(yield Ve(this.fetch,`${this.url}/DeleteIndex`,{vectorBucketName:t,indexName:s},{headers:this.headers}))||{},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(qe(n))return{data:null,error:n};throw n}})}}class bd{constructor(t,s={},n){this.shouldThrowOnError=!1,this.url=t.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},un),s),this.fetch=cn(n)}throwOnError(){return this.shouldThrowOnError=!0,this}putVectors(t){return ue(this,void 0,void 0,function*(){try{if(t.vectors.length<1||t.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return{data:(yield Ve(this.fetch,`${this.url}/PutVectors`,t,{headers:this.headers}))||{},error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(qe(s))return{data:null,error:s};throw s}})}getVectors(t){return ue(this,void 0,void 0,function*(){try{return{data:yield Ve(this.fetch,`${this.url}/GetVectors`,t,{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(qe(s))return{data:null,error:s};throw s}})}listVectors(t){return ue(this,void 0,void 0,function*(){try{if(t.segmentCount!==void 0){if(t.segmentCount<1||t.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");
97if(t.segmentIndex!==void 0&&(t.segmentIndex<0||t.segmentIndex>=t.segmentCount))throw new Error(`segmentIndex must be between 0 and ${t.segmentCount-1}`)}return{data:yield Ve(this.fetch,`${this.url}/ListVectors`,t,{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(qe(s))return{data:null,error:s};throw s}})}queryVectors(t){return ue(this,void 0,void 0,function*(){try{return{data:yield Ve(this.fetch,`${this.url}/QueryVectors`,t,{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(qe(s))return{data:null,error:s};throw s}})}deleteVectors(t){return ue(this,void 0,void 0,function*(){try{if(t.keys.length<1||t.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return{data:(yield Ve(this.fetch,`${this.url}/DeleteVectors`,t,{headers:this.headers}))||{},error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(qe(s))return{data:null,error:s};throw s}})}}class wd{constructor(t,s={},n){this.shouldThrowOnError=!1,this.url=t.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},un),s),this.fetch=cn(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(t){return ue(this,void 0,void 0,function*(){try{return{data:(yield Ve(this.fetch,`${this.url}/CreateVectorBucket`,{vectorBucketName:t},{headers:this.headers}))||{},error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(qe(s))return{data:null,error:s};throw s}})}getBucket(t){return ue(this,void 0,void 0,function*(){try{return{data:yield Ve(this.fetch,`${this.url}/GetVectorBucket`,{vectorBucketName:t},{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(qe(s))return{data:null,error:s};throw s}})}listBuckets(){return ue(this,arguments,void 0,function*(t={}){try{return{data:yield Ve(this.fetch,`${this.url}/ListVectorBuckets`,t,{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(qe(s))return{data:null,error:s};throw s}})}deleteBucket(t){return ue(this,void 0,void 0,function*(){try{return{data:(yield Ve(this.fetch,`${this.url}/DeleteVectorBucket`,{vectorBucketName:t},{headers:this.headers}))||{},error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(qe(s))return{data:null,error:s};throw s}})}}class _d extends wd{constructor(t,s={}){super(t,s.headers||{},s.fetch)}from(t){return new Sd(this.url,this.headers,t,this.fetch)}}class Sd extends yd{constructor(t,s,n,a){super(t,s,a),this.vectorBucketName=n}createIndex(t){const s=Object.create(null,{createIndex:{get:()=>super.createIndex}});return ue(this,void 0,void 0,function*(){return s.createIndex.call(this,Object.assign(Object.assign({},t),{vectorBucketName:this.vectorBucketName}))})}listIndexes(){const t=Object.create(null,{listIndexes:{get:()=>super.listIndexes}});return ue(this,arguments,void 0,function*(s={}){return t.listIndexes.call(this,Object.assign(Object.assign({},s),{vectorBucketName:this.vectorBucketName}))})}getIndex(t){const s=Object.create(null,{getIndex:{get:()=>super.getIndex}});return ue(this,void 0,void 0,function*(){return s.getIndex.call(this,this.vectorBucketName,t)})}deleteIndex(t){const s=Object.create(null,{deleteIndex:{get:()=>super.deleteIndex}});return ue(this,void 0,void 0,function*(){return s.deleteIndex.call(this,this.vectorBucketName,t)})}index(t){return new Ed(this.url,this.headers,this.vectorBucketName,t,this.fetch)}}class Ed extends bd{constructor(t,s,n,a,i){super(t,s,i),this.vectorBucketName=n,this.indexName=a}putVectors(t){const s=Object.create(null,{putVectors:{get:()=>super.putVectors}});return ue(this,void 0,void 0,function*(){return s.putVectors.call(this,Object.assign(Object.assign({},t),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}getVectors(t){const s=Object.create(null,{getVectors:{get:()=>super.getVectors}});return ue(this,void 0,void 0,function*(){return s.getVectors.call(this,Object.assign(Object.assign({},t),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}listVectors(){const t=Object.create(null,{listVectors:{get:()=>super.listVectors}});return ue(this,arguments,void 0,function*(s={}){return t.listVectors.call(this,Object.assign(Object.assign({},s),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}queryVectors(t){const s=Object.create(null,{queryVectors:{get:()=>super.queryVectors}});return ue(this,void 0,void 0,function*(){return s.queryVectors.call(this,Object.assign(Object.assign({},t),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}deleteVectors(t){const s=Object.create(null,{deleteVectors:{get:()=>super.deleteVectors}});return ue(this,void 0,void 0,function*(){return s.deleteVectors.call(this,Object.assign(Object.assign({},t),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}}class xd extends dd{constructor(t,s={},n,a){super(t,s,n,a)}from(t){return new cd(this.url,this.headers,t,this.fetch)}get vectors(){return new _d(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new hd(this.url+"/iceberg",this.headers,this.fetch)}}const Td="2.79.0";let pr="";typeof Deno<"u"?pr="deno":typeof document<"u"?pr="web":typeof navigator<"u"&&navigator.product==="ReactNative"?pr="react-native":pr="node";const kd={"X-Client-Info":`supabase-js-${pr}/${Td}`},Cd={headers:kd},Pd={schema:"public"},Od={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},Ad={},Rd=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),Ld=()=>Headers,Id=(e,t,s)=>{const n=Rd(s),a=Ld();return async(i,r)=>{var o;const l=(o=await t())!==null&&o!==void 0?o:e;let u=new a(r==null?void 0:r.headers);return u.has("apikey")||u.set("apikey",e),u.has("Authorization")||u.set("Authorization",`Bearer ${l}`),n(i,Object.assign(Object.assign({},r),{headers:u}))}};function Md(e){return e.endsWith("/")?e:e+"/"}function Fd(e,t){var s,n;const{db:a,auth:i,realtime:r,global:o}=e,{db:l,auth:u,realtime:c,global:d}=t,f={db:Object.assign(Object.assign({},l),a),auth:Object.assign(Object.assign({},u),i),realtime:Object.assign(Object.assign({},c),r),storage:{},global:Object.assign(Object.assign(Object.assign({},d),o),{headers:Object.assign(Object.assign({},(s=d==null?void 0:d.headers)!==null&&s!==void 0?s:{}),(n=o==null?void 0:o.headers)!==null&&n!==void 0?n:{})}),accessToken:async()=>""};return e.accessToken?f.accessToken=e.accessToken:delete f.accessToken,f}function Dd(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");
97if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(Md(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}const xa="2.79.0",Kt=30*1e3,Us=3,Es=Us*Kt,$d="http://localhost:9999",jd="supabase.auth.token",Nd={"X-Client-Info":`gotrue-js/${xa}`},qs="X-Supabase-Api-Version",Ta={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},zd=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,Bd=10*60*1e3;class xr extends Error{constructor(t,s,n){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=s,this.code=n}}function ce(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class Hd extends xr{constructor(t,s,n){super(t,s,n),this.name="AuthApiError",this.status=s,this.code=n}}function Ud(e){return ce(e)&&e.name==="AuthApiError"}class Mt extends xr{constructor(t,s){super(t),this.name="AuthUnknownError",this.originalError=s}}class wt extends xr{constructor(t,s,n,a){super(t,n,a),this.name=s,this.status=n}}class Qe extends wt{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function qd(e){return ce(e)&&e.name==="AuthSessionMissingError"}class Ut extends wt{constructor(){super("Auth session or user missing","AuthInvalidToken
97ResponseError",500,void 0)}}class Br extends wt{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class Hr extends wt{constructor(t,s=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=s}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function Vd(e){return ce(e)&&e.name==="AuthImplicitGrantRedirectError"}class Kn extends wt{constructor(t,s=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=s}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class Vs extends wt{constructor(t,s){super(t,"AuthRetryableFetchError",s,void 0)}}function xs(e){return ce(e)&&e.name==="AuthRetryableFetchError"}class Xn extends wt{constructor(t,s,n){super(t,"AuthWeakPasswordError",s,"weak_password"),this.reasons=n}}class Gs extends wt{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const Yr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Yn=` 	
98\r=`.split(""),Gd=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<Yn.length;t+=1)e[Yn[t].charCodeAt(0)]=-2;for(let t=0;t<Yr.length;t+=1)e[Yr[t].charCodeAt(0)]=t;return e})();function Jn(e,t,s){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const n=t.queue>>t.queuedBits-6&63;s(Yr[n]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const n=t.queue>>t.queuedBits-6&63;s(Yr[n]),t.queuedBits-=6}}function ka(e,t,s){const n=Gd[e];if(n>-1)for(t.queue=t.queue<<6|n,t.queuedBits+=6;t.queuedBits>=8;)s(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(n===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function Qn(e){const t=[],s=r=>{t.push(String.fromCodePoint(r))},n={utf8seq:0,codepoint:0},a={queue:0,queuedBits:0},i=r=>{Xd(r,n,s)};for(let r=0;r<e.length;r+=1)ka(e.charCodeAt(r),a,i);return t.join("")}function Wd(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function Kd(e,t){for(let s=0;s<e.length;s+=1){let n=e.charCodeAt(s);if(n>55295&&n<=56319){const a=(n-55296)*1024&65535;n=(e.charCodeAt(s+1)-56320&65535|a)+65536,s+=1}Wd(n,t)}}function Xd(e,t,s){if(t.utf8seq===0){if(e<=127){s(e);return}for(let n=1;n<6;n+=1)if(!(e>>7-n&1)){t.utf8seq=n;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&s(t.codepoint)}}function Yt(e){const t=[],s={queue:0,queuedBits:0},n=a=>{t.push(a)};for(let a=0;a<e.length;a+=1)ka(e.charCodeAt(a),s,n);return new Uint8Array(t)}function Yd(e){const t=[];return Kd(e,s=>t.push(s)),new Uint8Array(t)}function Ft(e){const t=[],s={queue:0,queuedBits:0},n=a=>{t.push(a)};return e.forEach(a=>Jn(a,s,n)),Jn(null,s,n),t.join("")}function Jd(e){return Math.round(Date.now()/1e3)+e}function Qd(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}const Le=()=>typeof window<"u"&&typeof document<"u",Ot={tested:!1,writable:!1},Ca=()=>{if(!Le())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Ot.tested)return Ot.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Ot.tested=!0,Ot.writable=!0}catch{Ot.tested=!0,Ot.writable=!1}return Ot.writable};function Zd(e){const t={},s=new URL(e);if(s.hash&&s.hash[0]==="#")try{new URLSearchParams(s.hash.substring(1)).forEach((a,i)=>{t[i]=a})}catch{}return s.searchParams.forEach((n,a)=>{t[a]=n}),t}const Pa=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),eh=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Xt=async(e,t,s)=>{await e.setItem(t,JSON.stringify(s))},At=async(e,t)=>{const s=await e.getItem(t);if(!s)return null;try{return JSON.parse(s)}catch{return s}},gt=async(e,t)=>{await e.removeItem(t)};class ss{constructor(){this.promise=new ss.promiseConstructor((t,s)=>{this.resolve=t,this.reject=s})}}ss.promiseConstructor=Promise;function Ts(e){const t=e.split(".");if(t.length!==3)throw new Gs("Invalid JWT structure");for(let n=0;n<t.length;n++)if(!zd.test(t[n]))throw new Gs("JWT not in base64url format");return{header:JSON.parse(Qn(t[0])),payload:JSON.parse(Qn(t[1])),signature:Yt(t[2]),raw:{header:t[0],payload:t[1]}}}async function th(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function rh(e,t){return new Promise((n,a)=>{(async()=>{for(let i=0;i<1/0;i++)try{const r=await e(i);if(!t(i,null,r)){n(r);return}}catch(r){if(!t(i,r)){a(r);return}}})()})}function sh(e){return("0"+e.toString(16)).substr(-2)}function nh(){const t=new Uint32Array(56);if(typeof crypto>"u"){const s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=s.length;let a="";for(let i=0;i<56;i++)a+=s.charAt(Math.floor(Math.random()*n));return a}return crypto.getRandomValues(t),Array.from(t,sh).join("")}async function ih(e){const s=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",s),a=new Uint8Array(n);return Array.from(a).map(i=>String.fromCharCode(i)).join("")}async function ah(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code 
98challenge method will default to use plain instead of sha256."),e;const s=await ih(e);return btoa(s).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function qt(e,t,s=!1){const n=nh();let a=n;s&&(a+="/PASSWORD_RECOVERY"),await Xt(e,`${t}-code-verifier`,a);const i=await ah(n);return[i,n===i?"plain":"s256"]}const oh=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function lh(e){const t=e.headers.get(qs);if(!t||!t.match(oh))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function uh(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function ch(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const dh=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Vt(e){if(!dh.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function ks(){const e={};return new Proxy(e,{get:(t,s)=>{if(s==="__isUserNotAvailableProxy")return!0;if(typeof s=="symbol"){const n=s.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${s}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,s)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${s}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,s)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${s}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function hh(e,t){return new Proxy(e,{get:(s,n,a)=>{if(n==="__isInsecureUserWarningProxy")return!0;if(typeof n=="symbol"){const i=n.toString();if(i==="Symbol(Symbol.toPrimitive)"||i==="Symbol(Symbol.toStringTag)"||i==="Symbol(util.inspect.custom)"||i==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(s,n,a)}return!t.value&&typeof n=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(s,n,a)}})}function Zn(e){return JSON.parse(JSON.stringify(e))}const Lt=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),fh=[502,503,504];async function ei(e){var t;if(!eh(e))throw new Vs(Lt(e),0);if(fh.includes(e.status))throw new Vs(Lt(e),e.status);let s;try{s=await e.json()}catch(i){throw new Mt(Lt(i),i)}let n;const a=lh(e);if(a&&a.getTime()>=Ta["2024-01-01"].timestamp&&typeof s=="object"&&s&&typeof s.code=="string"?n=s.code:typeof s=="object"&&s&&typeof s.error_code=="string"&&(n=s.error_code),n){if(n==="weak_password")throw new Xn(Lt(s),e.status,((t=s.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(n==="session_not_found")throw new Qe}else if(typeof s=="object"&&s&&typeof s.weak_password=="object"&&s.weak_password&&Array.isArray(s.weak_password.reasons)&&s.weak_password.reasons.length&&s.weak_password.reasons.reduce((i,r)=>i&&typeof r=="string",!0))throw new Xn(Lt(s),e.status,s.weak_password.reasons);throw new Hd(Lt(s),e.status||500,n)}const ph=(e,t,s,n)=>{const a={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?a:(a.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),a.body=JSON.stringify(n),Object.assign(Object.assign({},a),s))};async function he(e,t,s,n){var a;const i=Object.assign({},n==null?void 0:n.headers);i[qs]||(i[qs]=Ta["2024-01-01"].name),n!=null&&n.jwt&&(i.Authorization=`Bearer ${n.jwt}`);const r=(a=n==null?void 0:n.query)!==null&&a!==void 0?a:{};n!=null&&n.redirectTo&&(r.redirect_to=n.redirectTo);const o=Object.keys(r).length?"?"+new URLSearchParams(r).toString():"",l=await gh(e,t,s+o,{headers:i,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(l):{data:Object.assign({},l),error:null}}async function gh(e,t,s,n,a,i){const r=ph(t,n,a,i);let o;try{o=await e(s,Object.assign({},r))}catch(l){throw console.error(l),new Vs(Lt(l),0)}if(o.ok||await ei(o),n!=null&&n.noResolveJson)return o;try{return await o.json()}catch(l){await ei(l)}}function Ze(e){var t;let s=null;yh(e)&&(s=Object.assign({},e),e.expires_at||(s.expires_at=Jd(e.expires_in)));const n=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:s,user:n},error:null}}function ti(e){const t=Ze(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((s,n)=>s&&typeof n=="string",!0)&&(t.data.weak_password=e.weak_password),t}function vt(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function mh(e){return{data:e,error:null}}function vh(e){const{action_link:t,email_otp:s,hashed_token:n,redirect_to:a,verification_type:i}=e,r=rr(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),o={action_link:t,email_otp:s,hashed_token:n,redirect_to:a,verification_type:i},l=Object.assign({},r);return{data:{properties:o,user:l},error:null}}function ri(e){return e}function yh(e){return e.access_token&&e.refresh_token&&e.expires_in}const Cs=["global","local","others"];class bh{constructor({url:t="",headers:s={},fetch:n}){this.url=t,this.headers=s,this.fetch=Pa(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}async signOut(t,s=Cs[0]){if(Cs.indexOf(s)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Cs.join(", ")}`);try{return await he(this.fetch,"POST",`${this.url}/logout?scope=${s}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(n){if(ce(n))return{data:null,error:n};throw n}}async inviteUserByEmail(t,s={}){try{return await he(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:s.data},headers:this.headers,redirectTo:s.redirectTo,xform:vt})}catch(n){if(ce(n))return{data:{user:null},error:n};throw n}}async generateLink(t){try{const{options:s}=t,n=rr(t,["options"]),a=Object.assign(Object.assign({},n),s);return"newEmail"in n&&(a.new_email=n==null?void 0:n.newEmail,delete a.newEmail),await he(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:a,headers:this.headers,xform:vh,redirectTo:s==null?void 0:s.redirectTo})}catch(s){if(ce(s))return{data:{properties:null,user:null},error:s};throw s}}async createUser(t){try{return await he(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:vt})}catch(s){if(ce(s))return{data:{user:null},error:s};throw s}}async listUsers(t){var s,n,a,i,r,o,l;try{const u={nextPage:null,lastPage:0,total:0},c=await he(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(s=t==null?void 0:t.page)===null||s===void 0?void 0:s.toString())!==null&&n!==void 0?n:"",per_page:(i=(a=t==null?void 0:t.perPage)===null||a===void 0?void 0:a.toString())!==null&&i!==void 0?i:""},xform:ri});if(c.error)throw c.error;const d=await c.json(),f=(r=c.headers.get("x-total-count"))!==null&&r!==void 0?r:0,p=(l=(o=c.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&l!==void 0?l:[];return p.length>
980&&(p.forEach(h=>{const g=parseInt(h.split(";")[0].split("=")[1].substring(0,1)),v=JSON.parse(h.split(";")[1].split("=")[1]);u[`${v}Page`]=g}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},d),u),error:null}}catch(u){if(ce(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){Vt(t);try{return await he(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:vt})}catch(s){if(ce(s))return{data:{user:null},error:s};throw s}}async updateUserById(t,s){Vt(t);try{return await he(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:s,headers:this.headers,xform:vt})}catch(n){if(ce(n))return{data:{user:null},error:n};throw n}}async deleteUser(t,s=!1){Vt(t);try{return await he(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:s},xform:vt})}catch(n){if(ce(n))return{data:{user:null},error:n};throw n}}async _listFactors(t){Vt(t.userId);try{const{data:s,error:n}=await he(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:a=>({data:{factors:a},error:null})});return{data:s,error:n}}catch(s){if(ce(s))return{data:null,error:s};throw s}}async _deleteFactor(t){Vt(t.userId),Vt(t.id);try{return{data:await he(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(s){if(ce(s))return{data:null,error:s};throw s}}async _listOAuthClients(t){var s,n,a,i,r,o,l;try{const u={nextPage:null,lastPage:0,total:0},c=await he(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(s=t==null?void 0:t.page)===null||s===void 0?void 0:s.toString())!==null&&n!==void 0?n:"",per_page:(i=(a=t==null?void 0:t.perPage)===null||a===void 0?void 0:a.toString())!==null&&i!==void 0?i:""},xform:ri});if(c.error)throw c.error;const d=await c.json(),f=(r=c.headers.get("x-total-count"))!==null&&r!==void 0?r:0,p=(l=(o=c.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&l!==void 0?l:[];return p.length>0&&(p.forEach(h=>{const g=parseInt(h.split(";")[0].split("=")[1].substring(0,1)),v=JSON.parse(h.split(";")[1].split("=")[1]);u[`${v}Page`]=g}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},d),u),error:null}}catch(u){if(ce(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(t){try{return await he(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:s=>({data:s,error:null})})}catch(s){if(ce(s))return{data:null,error:s};throw s}}async _getOAuthClient(t){try{return await he(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:s=>({data:s,error:null})})}catch(s){if(ce(s))return{data:null,error:s};throw s}}async _updateOAuthClient(t,s){try{return await he(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:s,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ce(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(t){try{return await he(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(s){if(ce(s))return{data:null,error:s};throw s}}async _regenerateOAuthClientSecret(t){try{return await he(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:s=>({data:s,error:null})})}catch(s){if(ce(s))return{data:null,error:s};throw s}}}function si(e={}){return{getItem:t=>e[t]||null,setItem:(t,s)=>{e[t]=s},removeItem:t=>{delete e[t]}}}const Gt={debug:!!(globalThis&&Ca()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class Oa extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class wh extends Oa{}async function _h(e,t,s){Gt.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const n=new globalThis.AbortController;return t>0&&setTimeout(()=>{n.abort(),Gt.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async a=>{if(a){Gt.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,a.name);try{return await s()}finally{Gt.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,a.name)}}else{if(t===0)throw Gt.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new wh(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(Gt.debug)try{const i=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(i,null,"  "))}catch(i){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",i)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await s()}}))}function Sh(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function Aa(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}
98" is invalid.`);return e.toLowerCase()}function Eh(e){return parseInt(e,16)}function xh(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,n=>n.toString(16).padStart(2,"0")).join("")}function Th(e){var t;const{chainId:s,domain:n,expirationTime:a,issuedAt:i=new Date,nonce:r,notBefore:o,requestId:l,resources:u,scheme:c,uri:d,version:f}=e;{if(!Number.isInteger(s))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${s}`);if(!n)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(r&&r.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${r}`);if(!d)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(f!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${f}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(`
99`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const p=Aa(e.address),h=c?`${c}://${n}`:n,g=e.statement?`${e.statement}
100`:"",v=`${h} wants you to sign in with your Ethereum account:
101${p}
102
103${g}`;let b=`URI: ${d}
104Version: ${f}
105Chain ID: ${s}${r?`
106Nonce: ${r}`:""}
107Issued At: ${i.toISOString()}`;if(a&&(b+=`
108Expiration Time: ${a.toISOString()}`),o&&(b+=`
109Not Before: ${o.toISOString()}`),l&&(b+=`
110Request ID: ${l}`),u){let y=`
111Resources:`;for(const m of u){if(!m||typeof m!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${m}`);y+=`
112- ${m}`}b+=y}return`${v}
113${b}`}class Ce extends Error{constructor({message:t,code:s,cause:n,name:a}){var i;super(t,{cause:n}),this.__isWebAuthnError=!0,this.name=(i=a??(n instanceof Error?n.name:void 0))!==null&&i!==void 0?i:"Unknown Error",this.code=s}}class Jr extends Ce{constructor(t,s){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:s,message:t}),this.name="WebAuthnUnknownError",this.originalError=s}}function kh({error:e,options:t}){var s,n,a;const{publicKey:i}=t;if(!i)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Ce({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((s=i.authenticatorSelection)===null||s===void 0?void 0:s.requireResidentKey)===!0)return new Ce({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((n=i.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new Ce({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((a=i.authenticatorSelection)===null||a===void 0?void 0:a.userVerification)==="required")return new Ce({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new Ce({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new Ce({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return i.pubKeyCredParams.filter(o=>o.type==="public-key").length===0?new Ce({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new Ce({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const r=window.location.hostname;if(Ra(r)){if(i.rp.id!==r)return new Ce({message:`The RP ID "${i.rp.id}
113" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Ce({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new Ce({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new Ce({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Ce({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function Ch({error:e,options:t}){const{publicKey:s}=t;if(!s)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Ce({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new Ce({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const n=window.location.hostname;if(Ra(n)){if(s.rpId!==n)return new Ce({message:`The RP ID "${s.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Ce({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new Ce({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Ce({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class Ph{createNewAbortSignal(){if(this.controller){const s=new Error("Cancelling existing WebAuthn API call for new one");s.name="AbortError",this.controller.abort(s)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const Oh=new Ph;function Ah(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:s,excludeCredentials:n}=e,a=rr(e,["challenge","user","excludeCredentials"]),i=Yt(t).buffer,r=Object.assign(Object.assign({},s),{id:Yt(s.id).buffer}),o=Object.assign(Object.assign({},a),{challenge:i,user:r});if(n&&n.length>0){o.excludeCredentials=new Array(n.length);for(let l=0;l<n.length;l++){const u=n[l];o.excludeCredentials[l]=Object.assign(Object.assign({},u),{id:Yt(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return o}function Rh(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:s}=e,n=rr(e,["challenge","allowCredentials"]),a=Yt(t).buffer,i=Object.assign(Object.assign({},n),{challenge:a});if(s&&s.length>0){i.allowCredentials=new Array(s.length);for(let r=0;r<s.length;r++){const o=s[r];i.allowCredentials[r]=Object.assign(Object.assign({},o),{id:Yt(o.id).buffer,type:o.type||"public-key",transports:o.transports})}}return i}function Lh(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const s=e;return{id:e.id,rawId:e.id,response:{attestationObject:Ft(new Uint8Array(e.response.attestationObject)),clientDataJSON:Ft(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=s.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function Ih(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const s=e,n=e.getClientExtensionResults(),a=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:Ft(new Uint8Array(a.authenticatorData)),clientDataJSON:Ft(new Uint8Array(a.clientDataJSON)),signature:Ft(new 
113Uint8Array(a.signature)),userHandle:a.userHandle?Ft(new Uint8Array(a.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(t=s.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function Ra(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function ni(){var e,t;return!!(Le()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.get)=="function")}async function Mh(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Jr("Browser returned unexpected credential type",t)}:{data:null,error:new Jr("Empty credential response",t)}}catch(t){return{data:null,error:kh({error:t,options:e})}}}async function Fh(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Jr("Browser returned unexpected credential type",t)}:{data:null,error:new Jr("Empty credential response",t)}}catch(t){return{data:null,error:Ch({error:t,options:e})}}}const Dh={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"none"},$h={userVerification:"preferred",hints:["security-key"]};function Qr(...e){const t=a=>a!==null&&typeof a=="object"&&!Array.isArray(a),s=a=>a instanceof ArrayBuffer||ArrayBuffer.isView(a),n={};for(const a of e)if(a)for(const i in a){const r=a[i];if(r!==void 0)if(Array.isArray(r))n[i]=r;else if(s(r))n[i]=r;else if(t(r)){const o=n[i];t(o)?n[i]=Qr(o,r):n[i]=Qr(r)}else n[i]=r}return n}function jh(e,t){return Qr(Dh,e,t||{})}function Nh(e,t){return Qr($h,e,t||{})}class zh{constructor(t){this.client=t,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:s,friendlyName:n,signal:a},i){try{const{data:r,error:o}=await this.client.mfa.challenge({factorId:t,webauthn:s});if(!r)return{data:null,error:o};const l=a??Oh.createNewAbortSignal();if(r.webauthn.type==="create"){const{user:u}=r.webauthn.credential_options.publicKey;u.name||(u.name=`${u.id}:${n}`),u.displayName||(u.displayName=u.name)}switch(r.webauthn.type){case"create":{const u=jh(r.webauthn.credential_options.publicKey,i==null?void 0:i.create),{data:c,error:d}=await Mh({publicKey:u,signal:l});return c?{data:{factorId:t,challengeId:r.id,webauthn:{type:r.webauthn.type,credential_response:c}},error:null}:{data:null,error:d}}case"request":{const u=Nh(r.webauthn.credential_options.publicKey,i==null?void 0:i.request),{data:c,error:d}=await Fh(Object.assign(Object.assign({},r.webauthn.credential_options),{publicKey:u,signal:l}));return c?{data:{factorId:t,challengeId:r.id,webauthn:{type:r.webauthn.type,credential_response:c}},error:null}:{data:null,error:d}}}}catch(r){return ce(r)?{data:null,error:r}:{data:null,error:new Mt("Unexpected error in challenge",r)}}}async _verify({challengeId:t,factorId:s,webauthn:n}){return this.client.mfa.verify({factorId:s,challengeId:t,webauthn:n})}async _authenticate({factorId:t,webauthn:{rpId:s=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:a}},i){if(!s)return{data:null,error:new xr("rpId is required for WebAuthn authentication")};try{if(!ni())return{data:null,error:new Mt("Browser does not support WebAuthn",null)};const{data:r,error:o}=await this.challenge({factorId:t,webauthn:{rpId:s,rpOrigins:n},signal:a},{request:i});if(!r)return{data:null,error:o};const{webauthn:l}=r;return this._verify({factorId:t,challengeId:r.challengeId,webauthn:{type:l.type,rpId:s,rpOrigins:n,credential_response:l.credential_response}})}catch(r){return ce(r)?{data:null,error:r}:{data:null,error:new Mt("Unexpected error in authenticate",r)}}}async _register({friendlyName:t,rpId:s=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:a},i){if(!s)return{data:null,error:new xr("rpId is required for WebAuthn registration")};try{if(!ni())return{data:null,error:new Mt("Browser does not support WebAuthn",null)};const{data:r,error:o}=await this._enroll({friendlyName:t});if(!r)return await this.client.mfa.listFactors().then(c=>{var d;return(d=c.data)===null||d===void 0?void 0:d.all.find(f=>f.factor_type==="webauthn"&&f.friendly_name===t&&f.status!=="unverified")}).then(c=>c?this.client.mfa.unenroll({factorId:c==null?void 0:c.id}):void 0),{data:null,error:o};const{data:l,error:u}=await this._challenge({factorId:r.id,friendlyName:r.friendly_name,webauthn:{rpId:s,rpOrigins:n},signal:a},{create:i});return l?this._verify({factorId:r.id,challengeId:l.challengeId,webauthn:{rpId:s,rpOrigins:n,type:l.webauthn.type,credential_response:l.webauthn.credential_response}}):{data:null,error:u}}catch(r){return ce(r)?{data:null,error:r}:{data:null,error:new Mt("Unexpected error in register",r)}}}}Sh();const Bh={url:$d,storageKey:jd,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Nd,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1};async function ii(e,t,s){return await s()}const Wt={};class Tr{get jwks(){var t,s;return(s=(t=Wt[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&s!==void 0?s:{keys:[]}}set jwks(t){Wt[this.storageKey]=Object.assign(Object.assign({},Wt[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,s;return(s=(t=Wt[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&s!==void 0?s:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){Wt[this.storageKey]=Object.assign(Object.assign({},Wt[this.storageKey]),{cachedAt:t})}constructor(t){var s,n;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=Tr.nextInstanceID,Tr.nextInstanceID+=1,this.instanceID>0&&Le()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");const a=Object.assign(Object.assign({},Bh),t);if(this.logDebugMessages=!!a.debug,typeof a.debug=="function"&&(this.logger=a.debug),this.persistSession=a.persistSession,this.storageKey=a.storageKey,this.autoRefreshToken=a.autoRefreshToken,this.admin=new bh({url:a.url,headers:a.headers,fetch:a.fetch}),this.url=a.url,this.headers=a.headers,this.fetch=Pa(a.fetch),this.lock=a.lock||ii,this.detectSessionInUrl=a.detectSessionInUrl,this.flowType=a.flowType,this.hasCustomAuthorizationHeader=a.hasCustomAuthorizationHeader,this.throwOnError=a.throwOnError,a.lock?this.lock=a.lock:Le()&&(!((s=globalThis==null?void 0:globalThis.navigator)===null||s===void 0)&&s.locks)?this.lock=_h:this.lock=ii,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new zh(this)}
113,this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this)},this.persistSession?(a.storage?this.storage=a.storage:Ca()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=si(this.memoryStorage)),a.userStorage&&(this.userStorage=a.userStorage)):(this.memoryStorage={},this.storage=si(this.memoryStorage)),Le()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(i){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",i)}(n=this.broadcastChannel)===null||n===void 0||n.addEventListener("message",async i=>{this._debug("received broadcast notification from other tab or client",i),await this._notifyAllSubscribers(i.data.event,i.data.session,!1)})}this.initialize()}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_debug(...t){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${xa}) ${new Date().toISOString()}`,...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let s={},n="none";if(Le()&&(s=Zd(window.location.href),this._isImplicitGrantCallback(s)?n="implicit":await this._isPKCECallback(s)&&(n="pkce")),Le()&&this.detectSessionInUrl&&n!=="none"){const{data:a,error:i}=await this._getSessionFromURL(s,n);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),Vd(i)){const l=(t=i.details)===null||t===void 0?void 0:t.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:i}}return await this._removeSession(),{error:i}}const{session:r,redirectType:o}=a;return this._debug("#_initialize()","detected session in URL",r,"redirect type",o),await this._saveSession(r),setTimeout(async()=>{o==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",r):await this._notifyAllSubscribers("SIGNED_IN",r)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(s){return ce(s)?this._returnResult({error:s}):this._returnResult({error:new Mt("Unexpected error during initialization",s)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var s,n,a;try{const i=await he(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(s=t==null?void 0:t.options)===null||s===void 0?void 0:s.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(a=t==null?void 0:t.options)===null||a===void 0?void 0:a.captchaToken}},xform:Ze}),{data:r,error:o}=i;if(o||!r)return this._returnResult({data:{user:null,session:null},error:o});const l=r.session,u=r.user;return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(i){if(ce(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signUp(t){var s,n,a;try{let i;if("email"in t){const{email:c,password:d,options:f}=t;let p=null,h=null;this.flowType==="pkce"&&([p,h]=await qt(this.storage,this.storageKey)),i=await he(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f==null?void 0:f.emailRedirectTo,body:{email:c,password:d,data:(s=f==null?void 0:f.data)!==null&&s!==void 0?s:{},gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken},code_challenge:p,code_challenge_method:h},xform:Ze})}else if("phone"in t){const{phone:c,password:d,options:f}=t;i=await he(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:c,password:d,data:(n=f==null?void 0:f.data)!==null&&n!==void 0?n:{},channel:(a=f==null?void 0:f.channel)!==null&&a!==void 0?a:"sms",gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken}},xform:Ze})}else throw new Br("You must provide either an email or phone number and a password");const{data:r,error:o}=i;if(o||!r)return this._returnResult({data:{user:null,session:null},error:o});const l=r.session,u=r.user;return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(i){if(ce(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithPassword(t){try{let s;if("email"in t){const{email:i,password:r,options:o}=t;s=await he(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:r,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:ti})}else if("phone"in t){const{phone:i,password:r,options:o}=t;s=await he(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:r,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:ti})}else throw new Br("You must provide either an email or phone number and a password");const{data:n,error:a}=s;
113if(a)return this._returnResult({data:{user:null,session:null},error:a});if(!n||!n.session||!n.user){const i=new Ut;return this._returnResult({data:{user:null,session:null},error:i})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:a})}catch(s){if(ce(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithOAuth(t){var s,n,a,i;return await this._handleProviderSignIn(t.provider,{redirectTo:(s=t.options)===null||s===void 0?void 0:s.redirectTo,scopes:(n=t.options)===null||n===void 0?void 0:n.scopes,queryParams:(a=t.options)===null||a===void 0?void 0:a.queryParams,skipBrowserRedirect:(i=t.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:s}=t;switch(s){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${s}"`)}}async signInWithEthereum(t){var s,n,a,i,r,o,l,u,c,d,f;let p,h;if("message"in t)p=t.message,h=t.signature;else{const{chain:g,wallet:v,statement:b,options:y}=t;let m;if(Le())if(typeof v=="object")m=v;else{const E=window;if("ethereum"in E&&typeof E.ethereum=="object"&&"request"in E.ethereum&&typeof E.ethereum.request=="function")m=E.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof v!="object"||!(y!=null&&y.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");m=v}const S=new URL((s=y==null?void 0:y.url)!==null&&s!==void 0?s:window.location.href),k=await m.request({method:"eth_requestAccounts"}).then(E=>E).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!k||k.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const C=Aa(k[0]);let L=(n=y==null?void 0:y.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!L){const E=await m.request({method:"eth_chainId"});L=Eh(E)}const _={domain:S.host,address:C,statement:b,uri:S.href,version:"1",chainId:L,nonce:(a=y==null?void 0:y.signInWithEthereum)===null||a===void 0?void 0:a.nonce,issuedAt:(r=(i=y==null?void 0:y.signInWithEthereum)===null||i===void 0?void 0:i.issuedAt)!==null&&r!==void 0?r:new Date,expirationTime:(o=y==null?void 0:y.signInWithEthereum)===null||o===void 0?void 0:o.expirationTime,notBefore:(l=y==null?void 0:y.signInWithEthereum)===null||l===void 0?void 0:l.notBefore,requestId:(u=y==null?void 0:y.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(c=y==null?void 0:y.signInWithEthereum)===null||c===void 0?void 0:c.resources};p=Th(_),h=await m.request({method:"personal_sign",params:[xh(p),C]})}try{const{data:g,error:v}=await he(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:p,signature:h},!((d=t.options)===null||d===void 0)&&d.captchaToken?{gotrue_meta_security:{captcha_token:(f=t.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:Ze});if(v)throw v;if(!g||!g.session||!g.user){const b=new Ut;return this._returnResult({data:{user:null,session:null},error:b})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:Object.assign({},g),error:v})}catch(g){if(ce(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async signInWithSolana(t){var s,n,a,i,r,o,l,u,c,d,f,p;let h,g;if("message"in t)h=t.message,g=t.signature;else{const{chain:v,wallet:b,statement:y,options:m}=t;let S;if(Le())if(typeof b=="object")S=b;else{const C=window;if("solana"in C&&typeof C.solana=="object"&&("signIn"in C.solana&&typeof C.solana.signIn=="function"||"signMessage"in C.solana&&typeof C.solana.signMessage=="function"))S=C.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof b!="object"||!(m!=null&&m.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");S=b}const k=new URL((s=m==null?void 0:m.url)!==null&&s!==void 0?s:window.location.href);if("signIn"in S&&S.signIn){const C=await S.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},m==null?void 0:m.signInWithSolana),{version:"1",domain:k.host,uri:k.href}),y?{statement:y}:null));let L;if(Array.isArray(C)&&C[0]&&typeof C[0]=="object")L=C[0];else if(C&&typeof C=="object"&&"signedMessage"in C&&"signature"in C)L=C;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in L&&"signature"in L&&(typeof L.signedMessage=="string"||L.signedMessage instanceof Uint8Array)&&L.signature instanceof Uint8Array)h=typeof L.signedMessage=="string"?L.signedMessage:new TextDecoder().decode(L.signedMessage),g=L.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in S)||typeof S.signMessage!="function"||!("publicKey"in S)||typeof S!="object"||!S.publicKey||!("toBase58"in S.publicKey)||typeof S.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");h=[`${k.host} wants you to sign in with your Solana account:`,S.publicKey.toBase58(),...y?["",y,""]:[""],"Version: 1",`URI: ${k.href}`,`Issued At: ${(a=(n=m==null?void 0:m.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&a!==void 0?a:new Date().toISOString()}`,...!((i=m==null?void 0:m.signInWithSolana)===null||i===void 0)&&i.notBefore?[`Not Before: ${m.signInWithSolana.notBefore}`]:[],...!((r=m==null?void 0:m.signInWithSolana)===null||r===void 0)&&r.expirationTime?[`Expiration Time: ${m.signInWithSolana.expirationTime}`]:[],...!((o=m==null?void 0:m.signInWithSolana)===null||o===void 0)&&o.chainId?[`Chain ID: ${m.signInWithSolana.chainId}`]:[],...!((l=m==null?void 0:m.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${m.signInWithSolana.nonce}`]:[],...!((u=m==null?void 0:m.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${m.signInWithSolana.requestId}`]:[],...!((d=(c=m==null?void 0:m.signInWithSolana)===null||c===void 0?void 0:c.resources)===null||d===void 0)&&d.length?["Resources",...m.signInWithSolana.resources.map(L=>`- ${L}`)]:[]].join(`
114`);const C=await S.signMessage(new TextEncoder().encode(h),"utf8");if(!C||!(C instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");g=C}}try{const{data:v,error:b}=await he(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:h,signature:Ft(g)},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(p=t.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:Ze});if(b)throw b;if(!v||!v.session||!v.user){const y=new Ut;return this._returnResult({data:{user:null,session:null},error:y})}return v.session&&(await this._saveSession(v.session),await this._notifyAllSubscribers("SIGNED_IN",v.session)),this._returnResult({data:Object.assign({},v),error:b})}catch(v){if(ce(v))return this._returnResult({data:{user:null,session:null},error:v});throw v}}async _exchangeCodeForSession(t){const s=await At(this.storage,`${this.storageKey}-code-verifier`),[n,a]=(s??"").split("/");try{const{data:i,error:r}=await he(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:n},xform:Ze});if(await gt(this.storage,`${this.storageKey}-code-verifier`),r)throw r;if(!i||!i.session||!i.user){const o=new Ut;return this._returnResult({data:{user:null,session:null,redirectType:null},error:o})}return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),this._returnResult({data:Object.assign(Object.assign({},i),{redirectType:a??null}),error:r})}catch(i){if(ce(i))return this._returnResult({data:{user:null,session:null,redirectType:null},error:i});throw i}}async signInWithIdToken(t){try{const{options:s,provider:n,token:a,access_token:i,nonce:r}=t,o=await he(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:a,access_token:i,nonce:r,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}},xform:Ze}),{data:l,error:u}=o;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!l||!l.session||!l.user){const c=new Ut;return this._returnResult({data:{user:null,session:null},error:c})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:l,error:u})}catch(s){if(ce(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithOtp(t){var s,n,a,i,r;try{if("email"in t){const{email:o,options:l}=t;let u=null,c=null;this.flowType==="pkce"&&([u,c]=await qt(this.storage,this.storageKey));const{error:d}=await he(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:o,data:(s=l==null?void 0:l.data)!==null&&s!==void 0?s:{},create_user:(n=l==null?void 0:l.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},code_challenge:u,code_challenge_method:c},redirectTo:l==null?void 0:l.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:d})}if("phone"in t){const{phone:o,options:l}=t,{data:u,error:c}=await he(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:o,data:(a=l==null?void 0:l.data)!==null&&a!==void 0?a:{},create_user:(i=l==null?void 0:l.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},channel:(r=l==null?void 0:l.channel)!==null&&r!==void 0?r:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:c})}throw new Br("You must provide either an email or phone number.")}catch(o){if(ce(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async verifyOtp(t){var s,n;try{let a,i;"options"in t&&(a=(s=t.options)===null||s===void 0?void 0:s.redirectTo,i=(n=t.options)===null||n===void 0?void 0:n.captchaToken);const{data:r,error:o}=await he(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:i}}),redirectTo:a,xform:Ze});if(o)throw o;if(!r)throw new Error("An error occurred on token verification.");const l=r.session,u=r.user;return l!=null&&l.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(a){if(ce(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signInWithSSO(t){var s,n,a;try{let i=null,r=null;this.flowType==="pkce"&&([i,r]=await qt(this.storage,this.storageKey));const o=await he(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(n=(s=t.options)===null||s===void 0?void 0:s.redirectTo)!==null&&n!==void 0?n:void 0}),!((a=t==null?void 0:t.options)===null||a===void 0)&&a.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:i,code_challenge_method:r}),headers:this.headers,xform:mh});return this._returnResult(o)}catch(i){if(ce(i))return this._returnResult({data:null,error:i});throw i}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:s},error:n}=t;if(n)throw n;if(!s)throw new Qe;const{error:a}=await he(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:s.access_token});return this._returnResult({data:{user:null,session:null},error:a})})}catch(t){if(ce(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const s=`${this.url}/resend`;if("email"in t){const{email:n,type:a,options:i}=t,{error:r}=await he(this.fetch,"POST",s,{headers:this.headers,body:{email:n,type:a,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},redirectTo:i==null?void 0:i.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:r})}else if("phone"in t){const{phone:n,type:a,options:i}=t,{data:r,error:o}=await he(this.fetch,"POST",s,{headers:this.headers,body:{phone:n,type:a,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:r==null?void 0:r.message_id},error:o})}throw new Br("You must provide either an email or phone number and a type")}catch(s){if(ce(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async s=>s))}async _acquireLock(t,s){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),a=(async()=>(await n,await s()))();return this.pendingInLock.push((async()=>{try{await a}catch{}})()),a}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=s();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const a=[...this.pendingInLock];await Promise.all(a),this.pendingInLock.splice(0,a.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const s=await this.__loadSession();return await t(s)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const s=await At(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",s),s!==null&&(this._isValidSession(s)?t=s:(this._debug("#getSession()","session from storage is not val
114id"),await this._removeSession())),!t)return{data:{session:null},error:null};const n=t.expires_at?t.expires_at*1e3-Date.now()<Es:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",t.expires_at),!n){if(this.userStorage){const r=await At(this.userStorage,this.storageKey+"-user");r!=null&&r.user?t.user=r.user:t.user=ks()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const r={value:this.suppressGetSessionWarning};t.user=hh(t.user,r),r.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:a,error:i}=await this._callRefreshToken(t.refresh_token);return i?this._returnResult({data:{session:null},error:i}):this._returnResult({data:{session:a},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){return t?await this._getUser(t):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(t){try{return t?await he(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:vt}):await this._useSession(async s=>{var n,a,i;const{data:r,error:o}=s;if(o)throw o;return!(!((n=r.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Qe}:await he(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(a=r.session)===null||a===void 0?void 0:a.access_token)!==null&&i!==void 0?i:void 0,xform:vt})})}catch(s){if(ce(s))return qd(s)&&(await this._removeSession(),await gt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:s});throw s}}async updateUser(t,s={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(t,s))}async _updateUser(t,s={}){try{return await this._useSession(async n=>{const{data:a,error:i}=n;if(i)throw i;if(!a.session)throw new Qe;const r=a.session;let o=null,l=null;this.flowType==="pkce"&&t.email!=null&&([o,l]=await qt(this.storage,this.storageKey));const{data:u,error:c}=await he(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:s==null?void 0:s.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:o,code_challenge_method:l}),jwt:r.access_token,xform:vt});if(c)throw c;return r.user=u.user,await this._saveSession(r),await this._notifyAllSubscribers("USER_UPDATED",r),this._returnResult({data:{user:r.user},error:null})})}catch(n){if(ce(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new Qe;const s=Date.now()/1e3;let n=s,a=!0,i=null;const{payload:r}=Ts(t.access_token);if(r.exp&&(n=r.exp,a=n<=s),a){const{data:o,error:l}=await this._callRefreshToken(t.refresh_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!o)return{data:{user:null,session:null},error:null};i=o}else{const{data:o,error:l}=await this._getUser(t.access_token);if(l)throw l;i={access_token:t.access_token,refresh_token:t.refresh_token,user:o.user,token_type:"bearer",expires_in:n-s,expires_at:n},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return this._returnResult({data:{user:i.user,session:i},error:null})}catch(s){if(ce(s))return this._returnResult({data:{session:null,user:null},error:s});throw s}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async s=>{var n;if(!t){const{data:r,error:o}=s;if(o)throw o;t=(n=r.session)!==null&&n!==void 0?n:void 0}if(!(t!=null&&t.refresh_token))throw new Qe;const{data:a,error:i}=await this._callRefreshToken(t.refresh_token);return i?this._returnResult({data:{user:null,session:null},error:i}):a?this._returnResult({data:{user:a.user,session:a},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(s){if(ce(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async _getSessionFromURL(t,s){try{if(!Le())throw new Hr("No browser detected.");
114if(t.error||t.error_description||t.error_code)throw new Hr(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(s){case"implicit":if(this.flowType==="pkce")throw new Kn("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Hr("Not a valid implicit grant flow url.");break;default:}if(s==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new Kn("No code detected.");const{data:y,error:m}=await this._exchangeCodeForSession(t.code);if(m)throw m;const S=new URL(window.location.href);return S.searchParams.delete("code"),window.history.replaceState(window.history.state,"",S.toString()),{data:{session:y.session,redirectType:null},error:null}}const{provider_token:n,provider_refresh_token:a,access_token:i,refresh_token:r,expires_in:o,expires_at:l,token_type:u}=t;if(!i||!o||!r||!u)throw new Hr("No session defined in URL");const c=Math.round(Date.now()/1e3),d=parseInt(o);let f=c+d;l&&(f=parseInt(l));const p=f-c;p*1e3<=Kt&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${p}s, should have been closer to ${d}s`);const h=f-d;c-h>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",h,f,c):c-h<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",h,f,c);const{data:g,error:v}=await this._getUser(i);if(v)throw v;const b={provider_token:n,provider_refresh_token:a,access_token:i,expires_in:d,expires_at:f,refresh_token:r,token_type:u,user:g.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:b,redirectType:t.type},error:null})}catch(n){if(ce(n))return this._returnResult({data:{session:null,redirectType:null},error:n});throw n}}_isImplicitGrantCallback(t){return!!(t.access_token||t.error_description)}async _isPKCECallback(t){const s=await At(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&s)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async s=>{var n;const{data:a,error:i}=s;if(i)return this._returnResult({error:i});const r=(n=a.session)===null||n===void 0?void 0:n.access_token;if(r){const{error:o}=await this.admin.signOut(r,t);if(o&&!(Ud(o)&&(o.status===404||o.status===401||o.status===403)))return this._returnResult({error:o})}return t!=="others"&&(await this._removeSession(),await gt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const s=Qd(),n={id:s,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",s),this.stateChangeEmitters.delete(s)}};return this._debug("#onAuthStateChange()","registered callback with id",s),this.stateChangeEmitters.set(s,n),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(s)})))(),{data:{subscription:n}}}async _emitInitialSession(t){return await this._useSession(async s=>{var n,a;try{const{data:{session:i},error:r}=s;if(r)throw r;await((n=this.stateChangeEmitters.get(t))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",t,"session",i)}catch(i){await((a=this.stateChangeEmitters.get(t))===null||a===void 0?void 0:a.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",i),console.error(i)}})}async resetPasswordForEmail(t,s={}){let n=null,a=null;this.flowType==="pkce"&&([n,a]=await qt(this.storage,this.storageKey,!0));try{return await he(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:n,code_challenge_method:a,gotrue_meta_security:{captcha_token:s.captchaToken}},headers:this.headers,redirectTo:s.redirectTo})}catch(i){if(ce(i))return this._returnResult({data:null,error:i});throw i}}async getUserIdentities(){var t;try{const{data:s,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:(t=s.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(s){if(ce(s))return this._returnResult({data:null,error:s});throw s}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var s;try{const{data:n,error:a}=await this._useSession(async i=>{var r,o,l,u,c;const{data:d,error:f}=i;if(f)throw f;const p=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(r=t.options)===null||r===void 0?void 0:r.redirectTo,scopes:(o=t.options)===null||o===void 0?void 0:o.scopes,queryParams:(l=t.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await he(this.fetch,"GET",p,{headers:this.headers,jwt:(c=(u=d.session)===null||u===void 0?void 0:u.access_token)!==null&&c!==void 0?c:void 0})});if(a)throw a;return Le()&&!(!((s=t.options)===null||s===void 0)&&s.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),this._returnResult({data:{provider:t.provider,url:n==null?void 0:n.url},error:null})}catch(n){if(ce(n))return this._returnResult({data:{provider:t.provider,url:null},error:n});throw n}}async linkIdentityIdToken(t){return await this._useSession(async s=>{var n;try{const{error:a,data:{session:i}}=s;
114if(a)throw a;const{options:r,provider:o,token:l,access_token:u,nonce:c}=t,d=await he(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=i==null?void 0:i.access_token)!==null&&n!==void 0?n:void 0,body:{provider:o,id_token:l,access_token:u,nonce:c,link_identity:!0,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:Ze}),{data:f,error:p}=d;return p?this._returnResult({data:{user:null,session:null},error:p}):!f||!f.session||!f.user?this._returnResult({data:{user:null,session:null},error:new Ut}):(f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("USER_UPDATED",f.session)),this._returnResult({data:f,error:p}))}catch(a){if(ce(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}})}async unlinkIdentity(t){try{return await this._useSession(async s=>{var n,a;const{data:i,error:r}=s;if(r)throw r;return await he(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(a=(n=i.session)===null||n===void 0?void 0:n.access_token)!==null&&a!==void 0?a:void 0})})}catch(s){if(ce(s))return this._returnResult({data:null,error:s});throw s}}async _refreshAccessToken(t){const s=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(s,"begin");try{const n=Date.now();return await rh(async a=>(a>0&&await th(200*Math.pow(2,a-1)),this._debug(s,"refreshing attempt",a),await he(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:Ze})),(a,i)=>{const r=200*Math.pow(2,a);return i&&xs(i)&&Date.now()+r-n<Kt})}catch(n){if(this._debug(s,"error",n),ce(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}finally{this._debug(s,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,s){const n=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:s.redirectTo,scopes:s.scopes,queryParams:s.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",s,"url",n),Le()&&!s.skipBrowserRedirect&&window.location.assign(n),{data:{provider:t,url:n},error:null}}async _recoverAndRefresh(){var t,s;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const a=await At(this.storage,this.storageKey);if(a&&this.userStorage){let r=await At(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!r&&(r={user:a.user},await Xt(this.userStorage,this.storageKey+"-user",r)),a.user=(t=r==null?void 0:r.user)!==null&&t!==void 0?t:ks()}else if(a&&!a.user&&!a.user){const r=await At(this.storage,this.storageKey+"-user");r&&(r!=null&&r.user)?(a.user=r.user,await gt(this.storage,this.storageKey+"-user"),await Xt(this.storage,this.storageKey,a)):a.user=ks()}if(this._debug(n,"session from storage",a),!this._isValidSession(a)){this._debug(n,"session is not valid"),a!==null&&await this._removeSession();return}const i=((s=a.expires_at)!==null&&s!==void 0?s:1/0)*1e3-Date.now()<Es;if(this._debug(n,`session has${i?"":" not"} expired with margin of ${Es}s`),i){if(this.autoRefreshToken&&a.refresh_token){const{error:r}=await this._callRefreshToken(a.refresh_token);r&&(console.error(r),xs(r)||(this._debug(n,"refresh failed with a non-retryable error, removing the session",r),await this._removeSession()))}}else if(a.user&&a.user.__isUserNotAvailableProxy===!0)try{const{data:r,error:o}=await this._getUser(a.access_token);!o&&(r!=null&&r.user)?(a.user=r.user,await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(r){console.error("Error getting user data:",r),this._debug(n,"error getting user data, skipping SIGNED_IN notification",r)}else await this._notifyAllSubscribers("SIGNED_IN",a)}catch(a){this._debug(n,"error",a),console.error(a);return}finally{this._debug(n,"end")}}async _callRefreshToken(t){var s,n;if(!t)throw new Qe;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const a=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(a,"begin");try{this.refreshingDeferred=new ss;const{data:i,error:r}=await this._refreshAccessToken(t);if(r)throw r;if(!i.session)throw new Qe;await this._saveSession(i.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const o={data:i.session,error:null};return this.refreshingDeferred.resolve(o),o}catch(i){if(this._debug(a,"error",i),ce(i)){const r={data:null,error:i};return xs(i)||await this._removeSession(),(s=this.refreshingDeferred)===null||s===void 0||s.resolve(r),r}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(i),i}finally{this.refreshingDeferred=null,this._debug(a,"end")}}async _notifyAllSubscribers(t,s,n=!0){const a=`#_notifyAllSubscribers(${t})`;this._debug(a,"begin",s,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:t,session:s});const i=[],r=Array.from(this.stateChangeEmitters.values()).map(async o=>{try{await o.callback(t,s)}catch(l){i.push(l)}});if(await Promise.all(r),i.length>0){for(let o=0;o<i.length;o+=1)console.error(i[o]);throw i[0]}}finally{this._debug(a,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0;const s=Object.assign({},t),n=s.user&&s.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&s.user&&await Xt(this.userStorage,this.storageKey+"-user",{user:s.user});const a=Object.assign({},s);delete a.user;const i=Zn(a);await Xt(this.storage,this.storageKey,i)}else{const a=Zn(s);await Xt(this.storage,this.storageKey,a)}}async _removeSession(){this._debug("#_removeSession()"),await gt(this.storage,this.storageKey),await gt(this.storage,this.storageKey+"-code-verifier"),await gt(this.storage,this.storageKey+"-user"),this.userStorage&&await gt(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&Le()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}
114catch(s){console.error("removing visibilitychange callback failed",s)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),Kt);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async s=>{const{data:{session:n}}=s;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const a=Math.floor((n.expires_at*1e3-t)/Kt);this._debug("#_autoRefreshTokenTick()",`access token expires in ${a} ticks, a tick lasts ${Kt}ms, refresh threshold is ${Us} ticks`),a<=Us&&await this._callRefreshToken(n.refresh_token)})}catch(s){console.error("Auto refresh tick failed with error. This is likely a transient error.",s)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof Oa)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Le()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const s=`#_onVisibilityChanged(${t})`;this._debug(s,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(s,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,s,n){const a=[`provider=${encodeURIComponent(s)}`];if(n!=null&&n.redirectTo&&a.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&a.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[i,r]=await qt(this.storage,this.storageKey),o=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(r)}`});a.push(o.toString())}if(n!=null&&n.queryParams){const i=new URLSearchParams(n.queryParams);a.push(i.toString())}return n!=null&&n.skipBrowserRedirect&&a.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${t}?${a.join("&")}`}async _unenroll(t){try{return await this._useSession(async s=>{var n;const{data:a,error:i}=s;return i?this._returnResult({data:null,error:i}):await he(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(n=a==null?void 0:a.session)===null||n===void 0?void 0:n.access_token})})}catch(s){if(ce(s))return this._returnResult({data:null,error:s});throw s}}async _enroll(t){try{return await this._useSession(async s=>{var n,a;const{data:i,error:r}=s;if(r)return this._returnResult({data:null,error:r});const o=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:l,error:u}=await he(this.fetch,"POST",`${this.url}/factors`,{body:o,headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token});return u?this._returnResult({data:null,error:u}):(t.factorType==="totp"&&l.type==="totp"&&(!((a=l==null?void 0:l.totp)===null||a===void 0)&&a.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),this._returnResult({data:l,error:null}))})}catch(s){if(ce(s))return this._returnResult({data:null,error:s});throw s}}async _verify(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async s=>{var n;const{data:a,error:i}=s;if(i)return this._returnResult({data:null,error:i});const r=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?Lh(t.webauthn.credential_response):Ih(t.webauthn.credential_response)})}:{code:t.code}),{data:o,error:l}=await he(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:r,headers:this.headers,jwt:(n=a==null?void 0:a.session)===null||n===void 0?void 0:n.access_token});return l?this._returnResult({data:null,error:l}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),this._returnResult({data:o,error:l}))})}catch(s){if(ce(s))return this._returnResult({data:null,error:s});throw s}})}async _challenge(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async s=>{var n;const{data:a,error:i}=s;if(i)return this._returnResult({data:null,error:i});const r=await he(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(n=a==null?void 0:a.session)===null||n===void 0?void 0:n.access_token});if(r.error)return r;const{data:o}=r;if(o.type!=="webauthn")return{data:o,error:null};switch(o.webauthn.type){case"create":return{data:Object.assign(Object.assign({},o),{webauthn:Object.assign(Object.assign({},o.webauthn),{credential_options:Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:Ah(o.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},o),{webauthn:Object.assign(Object.assign({},o.webauthn),{credential_options:Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:Rh(o.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(s){if(ce(s))return this._returnResult({data:null,error:s});throw s}})}async _challengeAndVerify(t){const{data:s,error:n}=await this._challenge({factorId:t.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:t.factorId,challengeId:s.id,code:t.code})}async _listFactors(){var t;const{data:{user:s},error:n}=await this.getUser();if(n)return{data:null,error:n};const a={all:[],phone:[],totp:[],webauthn:[]};for(const i of(t=s==null?void 0:s.factors)!==null&&t!==void 0?t:[])a.all.push(i),i.status==="verified"&&a[i.factor_type].push(i);return{data:a,error:null}}async _getAuthenticatorAssuranceLevel(){var t,s;const{data:{session:n},error:a}
114=await this.getSession();if(a)return this._returnResult({data:null,error:a});if(!n)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:i}=Ts(n.access_token);let r=null;i.aal&&(r=i.aal);let o=r;((s=(t=n.user.factors)===null||t===void 0?void 0:t.filter(c=>c.status==="verified"))!==null&&s!==void 0?s:[]).length>0&&(o="aal2");const u=i.amr||[];return{data:{currentLevel:r,nextLevel:o,currentAuthenticationMethods:u},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async s=>{const{data:{session:n},error:a}=s;return a?this._returnResult({data:null,error:a}):n?await he(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:n.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new Qe})})}catch(s){if(ce(s))return this._returnResult({data:null,error:s});throw s}}async _approveAuthorization(t,s){try{return await this._useSession(async n=>{const{data:{session:a},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!a)return this._returnResult({data:null,error:new Qe});const r=await he(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:a.access_token,body:{action:"approve"},xform:o=>({data:o,error:null})});return r.data&&r.data.redirect_url&&Le()&&!(s!=null&&s.skipBrowserRedirect)&&window.location.assign(r.data.redirect_url),r})}catch(n){if(ce(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(t,s){try{return await this._useSession(async n=>{const{data:{session:a},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!a)return this._returnResult({data:null,error:new Qe});const r=await he(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:a.access_token,body:{action:"deny"},xform:o=>({data:o,error:null})});return r.data&&r.data.redirect_url&&Le()&&!(s!=null&&s.skipBrowserRedirect)&&window.location.assign(r.data.redirect_url),r})}catch(n){if(ce(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(t,s={keys:[]}){let n=s.keys.find(o=>o.kid===t);if(n)return n;const a=Date.now();if(n=this.jwks.keys.find(o=>o.kid===t),n&&this.jwks_cached_at+Bd>a)return n;const{data:i,error:r}=await he(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(r)throw r;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=a,n=i.keys.find(o=>o.kid===t),!n)?null:n}async getClaims(t,s={}){try{let n=t;if(!n){const{data:p,error:h}
114=await this.getSession();if(h||!p.session)return this._returnResult({data:null,error:h});n=p.session.access_token}const{header:a,payload:i,signature:r,raw:{header:o,payload:l}}=Ts(n);s!=null&&s.allowExpired||uh(i.exp);const u=!a.alg||a.alg.startsWith("HS")||!a.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(a.kid,s!=null&&s.keys?{keys:s.keys}:s==null?void 0:s.jwks);if(!u){const{error:p}=await this.getUser(n);if(p)throw p;return{data:{claims:i,header:a,signature:r},error:null}}const c=ch(a.alg),d=await crypto.subtle.importKey("jwk",u,c,!0,["verify"]);if(!await crypto.subtle.verify(c,d,r,Yd(`${o}.${l}`)))throw new Gs("Invalid JWT signature");return{data:{claims:i,header:a,signature:r},error:null}}catch(n){if(ce(n))return this._returnResult({data:null,error:n});throw n}}}Tr.nextInstanceID=0;const Hh=Tr;class Uh extends Hh{constructor(t){super(t)}}class qh{constructor(t,s,n){var a,i,r;this.supabaseUrl=t,this.supabaseKey=s;const o=Dd(t);if(!s)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",o),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",o),this.storageUrl=new URL("storage/v1",o),this.functionsUrl=new URL("functions/v1",o);const l=`sb-${o.hostname.split(".")[0]}-auth-token`,u={db:Pd,realtime:Ad,auth:Object.assign(Object.assign({},Od),{storageKey:l}),global:Cd},c=Fd(n??{},u);this.storageKey=(a=c.auth.storageKey)!==null&&a!==void 0?a:"",this.headers=(i=c.global.headers)!==null&&i!==void 0?i:{},c.accessToken?(this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(d,f)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(f)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((r=c.auth)!==null&&r!==void 0?r:{},this.headers,c.global.fetch),this.fetch=Id(s,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},c.realtime)),this.rest=new Dc(new URL("rest/v1",o).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch}),this.storage=new xd(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new Ic(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,s={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(t,s,n)}channel(t,s={config:{}}){return this.realtime.channel(t,s)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var t,s;if(this.accessToken)return await this.accessToken();const{data:n}=await this.auth.getSession();return(s=(t=n.session)===null||t===void 0?void 0:t.access_token)!==null&&s!==void 0?s:this.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:s,detectSessionInUrl:n,storage:a,userStorage:i,storageKey:r,flowType:o,lock:l,debug:u,throwOnError:c},d,f){const p={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new Uh({url:this.authUrl.href,headers:Object.assign(Object.assign({},p),d),storageKey:r,autoRefreshToken:t,persistSession:s,detectSessionInUrl:n,storage:a,userStorage:i,flowType:o,lock:l,debug:u,throwOnError:c,fetch:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(h=>h.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new Zc(this.realtimeUrl.href,Object.assign(Object.assign({},t),{params:Object.assign({apikey:this.supabaseKey},t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((s,n)=>{this._handleTokenChanged(s,"CLIENT",n==null?void 0:n.access_token)})}_handleTokenChanged(t,s,n){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):t==="SIGNED_OUT"&&(this.realtime.setAuth(),s=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const Vh=(e,t,s)=>new qh(e,t,s);function Gh(){if(typeof window<"u"||typeof process>"u")return!1;const e=process.version;if(e==null)return!1;const t=e.match(/^v(\d+)\./);return t?parseInt(t[1],10)<=18:!1}Gh()&&console.warn("⚠️  Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to N
114ode.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");if(!window.supabase){const e=document.body.dataset.supabaseConfig;if(!e)throw console.error("Supabase config not found on body tag"),new Error("Supabase config missing");const t=JSON.parse(e);window.supabase=Vh(t.url,t.anonKey),window.supabase.auth.onAuthStateChange(async(s,n)=>{var a;console.log("[auth.js] Auth state changed:",s,((a=n==null?void 0:n.user)==null?void 0:a.email)||"null"),n!=null&&n.user&&window.dispatchEvent(new CustomEvent("hideLoginModal"))})}up.compiler("#magic-link-form",function(e){e.addEventListener("submit",async function(t){t.preventDefault();var s=e.querySelector('input[name="email"]').value,n=document.getElementById("login-error"),a=e.querySelector('button[type="submit"]');a.disabled=!0,n&&n.classList.add("hidden");try{var i=await window.supabase.auth.signInWithOtp({email:s,options:{emailRedirectTo:window.location.origin}});if(i.error){n&&(n.textContent=i.error.message,n.classList.remove("hidden"));return}e.innerHTML='<p class="text-center text-green-600 dark:text-green-400 font-medium">Check your email for a sign-in link.</p>'}catch{n&&(n.textContent="Something went wrong. Please try again.",n.classList.remove("hidden"))}finally{a.disabled=!1}})});up.compiler("#google-signin-btn",function(e){e.addEventListener("click",async function(){await window.supabase.auth.signInWithOAuth({provider:"google",options:{redirectTo:window.location.origin}})})});up.on("up:request:load",function(e){if(e.request.url.includes("/ui/vote")){for(var t=Object.keys(localStorage),s=0;s<t.length;s++)if(t[s].indexOf("-auth-token")!==-1){try{var n=JSON.parse(localStorage.getItem(t[s]));n&&n.access_token&&(e.request.headers.Authorization="Bearer "+n.access_token)}catch{}break}}});up.on("up:framework:booted",function(){var e=document.querySelectorAll('[id^="vote-buttons-"]');if(e.length!==0){var t=[];e.forEach(function(n){t.push(n.id.replace("vote-buttons-",""))});var s=t.map(function(n){return"#vote-buttons-"+n}).join(", ");up.render({url:"/ui/votes?defids="+t.join(","),target:s,cache:!1}).catch(function(n){console.warn("[vote-unpoly] Failed to load votes:",n.message)})}});up.compiler("#brand-safety-preview-placeholder",function(e){document.cookie.match(/(^|; )bsp=/)&&up.render({url:"/brand-safety/panel?defids="+encodeURIComponent(e.dataset.defids),target:"#brand-safety-preview-panel",cache:!1}).catch(function(t){t&&t.response&&t.response.status!==404&&console.warn("[brand-safety-preview] Failed to load panel:",t.message)})});const Wh="Wadaan",Kh="Ари аилыхь",Xh="Verduidelik dit",Yh="Kyerɛ mu",Jh="ይህን አብራራ",Qh="Explica esto",Zh="اشرح هذا",ef="এই ব্যাখ্যা কৰক",tf="Гьаб бихьизабизе",rf="Aka yatiyäwi",sf="Bunu izah et",nf="Был аңлатманы аңлат",af="Тлумач гэта",of="Обясни това",lf="एकरा समझाव",uf="Saposem yu",cf="Sàgòrò nin kɛ",df="এটি ব্যাখ্যা করুন",hf="འདི་བཤད་",ff="Displegañ kement-mañ",pf="Objasni ovo",gf="Explica això",mf="ХӀокху маьӀан",vf="Ayuda este",yf="Spiega questu",bf="ᐁᑲ ᐃᑕᐦᑲᒥᐦᐟ",wf="Vysvětli to",_f="Слово сие истолкуй",Sf="Куна ăнлантар",Ef="Esboniwch hwn",xf="Forklar dette",Tf="Erkläre das",kf="މި މާނަ ކިޔާދީ",Cf="འདི་བཤད།",Pf="Ŋlɔe me",Of="Εξήγησε το",Af="Klarigu ĉi tion",Rf="Explica esto",Lf="Selgita seda",If="Azaldu hau",Mf="توضیح بده",Ff="Fasno ndee",Df="Selitä tämä",$f="Vakamacalataka oqo",jf="Greitt hetta",Nf="Explique ceci",zf="Ferliz dit",Bf="Mínigh é seo",Hf="Mìnich seo",Uf="Explica isto",qf="Ko mba’e rehechauka",Vf="આ સમજાવો",Gf="Minsh shoh",Wf="Fassara wannan",Kf="הסבר את זה",Xf="यह समझाएं",Yf="Anda here",Jf="Objasni ovo",Qf="Eksplike sa",Zf="Magyarázd el",ep="Բացատրիր սա",tp="Tjanga apa",rp="Explica isto",sp="Jelaskan ini",np="Explica to",ip="Kọwaa nke a",ap="ꋍꃅꐥꌠꐮꁮ",op="ᐅᓂᑦᑎᑦᑎᓐᓂᐊᖅᑕ",lp="Explikez ico",cp="Skýrðu þetta",d
114p="Spiega questo",hp="ᐅᓂᑦᓯᐊᕐᓗᒍ",fp="これを説明",pp="Jelasna iki",gp="ახსენი ეს",mp="Sobula",vp="Tega ũhoro",yp="Shi yelitha",bp="Мынаны түсіндір",wp="Tassu",_p="ពន្យល់នេះ",Sp="ಇದನ್ನು ವಿವರಿಸಿ",Ep="이거 설명해 줘",xp="Wannan bayyana",Tp="یہِ وضاحت کٔرِو",kp="ڤەباس بکە",Cp="Гиж",Pp="Dishergha hemma",Op="Муну түшүндүр",Ap="Explica hoc",Rp="Erklär dat",Lp="Nnyonyola kino",Ip="Leg dit oet",Mp="Loba ndimbola",Fp="ອະທິບາຍນີ້",Dp="Paaiškink tai",$p="Nkambwe uno",jp="Izskaidro šo",Np="Hazavao izany",zp="Kaalikkar",Bp="Whakamārama",Hp="Објасни го ова",Up="ഇത് വിശദീകരിക്കുക",qp="Үүнийг тайлбарла",Vp="हे स्पष्ट करा",Gp="Terangkan ini",Wp="Spjega dan",Kp="ဒီအဓိပ္ပာယ်ကိုရှင်းပြပါ",Xp="Ekadae",Yp="Forklar dette",Jp="Chaza lokhu",Qp="यो व्याख्या गर्नुहोस्",Zp="Shi shi",eg="Leg dit uit",tg="Forklar dette",rg="Forklar dette",sg="Chaza lokhu",ng="Díí baa hane’",ig="Fotokozani izi",ag="Explica aquò",og="Wiindan",lg="Kana ibsi",ug="ଏହାକୁ ବୁଝାନ୍ତୁ",cg="Ацы ныхас равзар",dg="ਇਸ ਦੀ ਵਿਆਖਿਆ ਕਰੋ",hg="Etaṃ pakāseyya",fg="Wyjaśnij to",pg="دا تشریح کړه",gg="Explique isto",mg="Kayta willapay",vg="Spiega quai",yg="Sobanura ibi",bg="Explică asta",wg="Объясни это",_g="Sobanura ibi",Sg="एतद् व्याख्यातु",Eg="Ispiega custu",xg="هن جي وضاحت ڪريو",Tg="Čilge dán",kg="Fâ tënë",Cg="මෙය පැහැදිලි කරන්න",Pg="Vysvetli toto",Og="Pojasni to",Ag="Faamatala lenei",Rg="Tsanangura izvi",Lg="Sharax",Ig="Shpjego këtë",Mg="Објасни ово",Fg="Chaza lokhu",Dg="Hlalosa sena",$g="Jelaskeun ieu",jg="Förklara detta",Ng="Eleza hili",zg="இதை விளக்கு",Bg="దీనిని వివరించండి",Hg="Инро шарҳ диҳед",Ug="อธิบายสิ่งนี้",qg="ነዚ ግለጽ",Vg="Bu düşündiriş",Gg="Ipaliwanag ito",Wg="Tlhalosa se",Kg="Fakamatala‘i eni",Xg="Bunu açıkla",Yg="Hlamusela leswi",Jg="Аңлат",Qg="Kyerɛ mu",Zg="Fa'ata'ara",em="بۇنى چۈشەندۈر",tm="Поясни це",rm="یہ سمجھائیں",sm="Buni tushuntir",nm="Tikedzani izwi",im="Giải thích",am="Penisön atosi",om="Spårdoz ciste",lm="Nuyu ko",um="Cacisa oku",cm="דערקלער דאס",dm="Ṣàlàyé èyí",hm="Gangj neix",fm="解释这个",pm="Chaza lokhu",Ws={aa:Wh,ab:Kh,af:Xh,ak:Yh,am:Jh,an:Qh,ar:Zh,as:ef,av:tf,ay:rf,az:sf,ba:nf,be:af,bg:of,bh:lf,bi:uf,bm:cf,bn:df,bo:hf,br:ff,bs:pf,ca:gf,ce:mf,ch:vf,co:yf,cr:bf,cs:wf,cu:_f,cv:Sf,cy:Ef,da:xf,de:Tf,dv:kf,dz:Cf,ee:Pf,el:Of,eo:Af,es:Rf,et:Lf,eu:If,fa:Mf,ff:Ff,fi:Df,fj:$f,fo:jf,fr:Nf,fy:zf,ga:Bf,gd:Hf,gl:Uf,gn:qf,gu:Vf,gv:Gf,ha:Wf,he:Kf,hi:Xf,ho:Yf,hr:Jf,ht:Qf,hu:Zf,hy:ep,hz:tp,ia:rp,id:sp,ie:np,ig:ip,ii:ap,ik:op,io:lp,is:cp,it:dp,iu:hp,ja:fp,jv:pp,ka:gp,kg:mp,ki:vp,kj:yp,kk:bp,kl:wp,km:_p,kn:Sp,ko:Ep,kr:xp,ks:Tp,ku:kp,kv:Cp,kw:Pp,ky:Op,la:Ap,lb:Rp,lg:Lp,li:Ip,ln:Mp,lo:Fp,lt:Dp,lu:$p,lv:jp,mg:Np,mh:zp,mi:Bp,mk:Hp,ml:Up,mn:qp,mr:Vp,ms:Gp,mt:Wp,my:Kp,na:Xp,nb:Yp,nd:Jp,ne:Qp,ng:Zp,nl:eg,nn:tg,no:rg,nr:sg,nv:ng,ny:ig,oc:ag,oj:og,om:lg,or:ug,os:cg,pa:dg,pi:hg,pl:fg,ps:pg,pt:gg,qu:mg,rm:vg,rn:yg,ro:bg,ru:wg,rw:_g,sa:Sg,sc:Eg,sd:xg,se:Tg,sg:kg,si:Cg,sk:Pg,sl:Og,sm:Ag,sn:Rg,so:Lg,sq:Ig,sr:Mg,ss:Fg,st:Dg,su:$g,sv:jg,sw:Ng,ta:zg,te:Bg,tg:Hg,th:Ug,ti:qg,tk:Vg,tl:Gg,tn:Wg,to:Kg,tr:Xg,ts:Yg,tt:Jg,tw:Qg,ty:Zg,ug:em,uk:tm,ur:rm,uz:sm,ve:nm,vi:im,vo:am,wa:om,wo:lm,xh:um,yi:cm,yo:dm,za:hm,zh:fm,zu:pm};function gm(e){var t=La(e);return t?Ws[t]:null}function La(e){var t=(e||"").trim().toLowerCase();if(!t)return null;if(Ws[t])return t;var s=t.split("-")[0];return Ws[s]?s:null}function mm(e,t){if(e=(e||"").trim(),!e)return!1;var s=window.udChat;return!s||typeof s.ask!="function"?!1:(s.ask({word:e,intent:t||"define"}),!0)}var vm="ud-chat-ready";function ym(){var e=function(){document.documentElement.classList.add(vm)};if(window.udChat&&window.udChat.ready)return e();window.addEventListener("udchat:ready",e,{once:!0})}function ai(e){if(typeof document>"u")return!1;var t=gm(e);if(!t)return!1;for(var s=La(e),n=document.querySelectorAll("[data-ask-ud-label]"),a=0;a<n.length;a++){n[a].textContent=t,n[a].setAttribute("lang",s);var i=n[a].closest?n[a].closest("[data-ask-intent]"):null;i&&i.setAttribute("data-ask-intent","define")}return n.length>0}function bm(e){var t=e.target&&e.target.closest&&e.target.closest("[data-ask-ud]");t&&(e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),mm(t.getAttribute("data-ask-ud")||"",t.getAttribute("data-ask-intent")||""))}typeof document<"u"&&typeof window<"u"&&window.__askUDBound!==!0&&(window.__askUDBound=!0,document.addEventListener("click",bm),ym(),ai(navigator.language),window.up&&window.up.on&&window.up.on("up:fragment:inserted",function(){ai(navigator.language)}));up.on("up:form:submit",function(e){var t=e.form||e.target.closest("form"),s=t.querySelector('[name="recaptcha_token"]');if(!(!s||s.value)){e.preventDefault();var n=document.body.dataset.recaptchaSiteKey;if(!(!n||!window.grecaptcha)){var a=s.dataset.recaptchaAction||"vote";
114grecaptcha.enterprise.ready(function(){grecaptcha.enterprise.execute(n,{action:a}).then(function(i){s.value=i,up.submit(t)}).catch(function(){s.value="error",up.submit(t)})})}}});xu();ku();du();document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){Rn()}):Rn();Cc();up.log.config.banner=!1;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.