hashquiz 1.0.0-beta.8 → 1.0.0-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/hashquiz.js +10 -1
- package/package.json +1 -1
- package/supabase/migrations/20261130190000_lead_segments_speaker_workshop.sql +8 -0
- package/web/assets/LeadForm-CEtFDKUS.js +1 -0
- package/web/assets/LeadForm-CcX9an89.css +1 -0
- package/web/assets/{SoloCatalog-N7vmcKBX.js → SoloCatalog-BQSbd-wT.js} +1 -1
- package/web/assets/{SoloEndView-1nOIZgLK.js → SoloEndView-BUcP4RWT.js} +1 -1
- package/web/assets/{SoloIntroView-D1lYB8yi.js → SoloIntroView-T-Jpx0e3.js} +1 -1
- package/web/assets/{SoloLeaderboard-Cnw01tuX.js → SoloLeaderboard-DpPQFmyt.js} +1 -1
- package/web/assets/{SoloQuestionView-BhuykIzF.js → SoloQuestionView-CcFu43-z.js} +1 -1
- package/web/assets/{decks-VuEnO8Am.js → decks-ByuTg813.js} +1 -1
- package/web/assets/{decks-BNiNpRoi.js → decks-XbGFyNo9.js} +1 -1
- package/web/assets/{deps-BokiFfKQ.js → deps-AJH7wiX7.js} +1 -1
- package/web/assets/{index-t6uIRzOv.js → index-CC4u6JVh.js} +2 -2
- package/web/assets/solo-backend-C3QJkkz_.js +1 -0
- package/web/index.html +1 -1
- package/web/assets/LeadForm-BqFRKn77.css +0 -1
- package/web/assets/LeadForm-CyU9p-NC.js +0 -1
- package/web/assets/solo-backend-CBEhye1F.js +0 -1
package/bin/hashquiz.js
CHANGED
|
@@ -4103,7 +4103,16 @@ function verifySoloRun(quiz, sub) {
|
|
|
4103
4103
|
}
|
|
4104
4104
|
// packages/core/src/solo-backend.ts
|
|
4105
4105
|
var EMAIL_RE = /^[^@\s]+@[^@\s]+\.[^@\s]+$/;
|
|
4106
|
-
var LEAD_SEGMENTS = [
|
|
4106
|
+
var LEAD_SEGMENTS = [
|
|
4107
|
+
"tech-trainer",
|
|
4108
|
+
"non-tech-trainer",
|
|
4109
|
+
"training-org",
|
|
4110
|
+
"company",
|
|
4111
|
+
"teacher",
|
|
4112
|
+
"speaker",
|
|
4113
|
+
"workshop-host",
|
|
4114
|
+
"other"
|
|
4115
|
+
];
|
|
4107
4116
|
var LEAD_SOURCES = ["solo-end", "gallery", "podium"];
|
|
4108
4117
|
var isLeadSegment = (v) => LEAD_SEGMENTS.includes(v);
|
|
4109
4118
|
var isLeadSource = (v) => LEAD_SOURCES.includes(v);
|
package/package.json
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
-- Three more lead segments: conference or meetup speaker, workshop host, and "other".
|
|
2
|
+
-- Same list as LEAD_SEGMENTS in @hashquiz/core.
|
|
3
|
+
|
|
4
|
+
alter table public.leads drop constraint if exists leads_segment_check;
|
|
5
|
+
alter table public.leads
|
|
6
|
+
add constraint leads_segment_check
|
|
7
|
+
check (segment in ('tech-trainer', 'non-tech-trainer', 'training-org', 'company', 'teacher', 'speaker',
|
|
8
|
+
'workshop-host', 'other'));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e,C as t,E as n,I as r,N as i,P as a,S as o,_ as s,b as c,d as l,g as u,h as d,j as f,m as p,n as m,r as h,v as g,y as _,z as v}from"./index-CC4u6JVh.js";import{n as y,r as b,t as x}from"./solo-backend-C3QJkkz_.js";/* empty css */var S={class:`lead`,"aria-labelledby":`lead-title`},C={key:0,class:`lead__thanks`,role:`status`},w=[`aria-invalid`],T=[`value`],E={class:`lead__consent`},D={class:`lead__consent`},O=[`disabled`],k={key:0,class:`lead__error`,role:`status`},A=l(n({__name:`LeadForm`,props:{source:{default:`solo-end`}},setup(n){let l=n,A={"tech-trainer":`Formateur·rice tech`,"non-tech-trainer":`Formateur·rice non tech`,"training-org":`Organisme de formation`,company:`Entreprise`,teacher:`Enseignant·e`,speaker:`Speaker (conférence, meetup)`,"workshop-host":`Animateur·rice d'atelier`,other:`Autre`},j=h(),M=a(``),N=a(``),P=a(!1),F=a(!1),I=a(`idle`),L=_(()=>x.test(M.value.trim())),R=_(()=>L.value&&b(N.value)&&F.value&&I.value!==`sending`);async function z(){if(!R.value||!b(N.value))return;I.value=`sending`,await m();let e=await j.submitLead(M.value,{segment:N.value,founders:P.value,source:l.source});I.value=e.ok?`done`:`error`}return(n,a)=>(e(),t(`section`,S,[I.value===`done`?(e(),t(`p`,C,`Merci, vous serez prévenu·e du lancement !`)):(e(),t(`form`,{key:1,class:`lead__form`,novalidate:``,onSubmit:s(z,[`prevent`])},[a[7]||=c(`h3`,{id:`lead-title`,class:`lead__title`},`Créez vos propres quiz : bientôt disponible`,-1),a[8]||=c(`label`,{class:`solo-label`,for:`lead-email`},`Email`,-1),i(c(`input`,{id:`lead-email`,"onUpdate:modelValue":a[0]||=e=>M.value=e,class:`solo-input`,type:`email`,autocomplete:`email`,inputmode:`email`,required:``,"aria-invalid":M.value!==``&&!L.value},null,8,w),[[u,M.value]]),a[9]||=c(`label`,{class:`solo-label`,for:`lead-segment`},`Vous êtes`,-1),i(c(`select`,{id:`lead-segment`,"onUpdate:modelValue":a[1]||=e=>N.value=e,class:`solo-input`,required:``},[a[4]||=c(`option`,{value:``,disabled:``},`Choisir…`,-1),(e(!0),t(g,null,f(r(y),n=>(e(),t(`option`,{key:n,value:n},v(A[n]),9,T))),128))],512),[[d,N.value]]),c(`label`,E,[i(c(`input`,{"onUpdate:modelValue":a[2]||=e=>P.value=e,type:`checkbox`},null,512),[[p,P.value]]),a[5]||=c(`span`,null,`Je veux l'offre fondateurs (prévente)`,-1)]),c(`label`,D,[i(c(`input`,{"onUpdate:modelValue":a[3]||=e=>F.value=e,type:`checkbox`,required:``},null,512),[[p,F.value]]),a[6]||=c(`span`,null,`J'accepte d'être recontacté·e au sujet de HashQuiz`,-1)]),c(`button`,{class:`solo-btn solo-btn--ghost hq-press`,type:`submit`,disabled:!R.value},`Me prévenir`,8,O),I.value===`error`?(e(),t(`p`,k,`Oups, réessayez.`)):o(``,!0)],32))]))}}),[[`__scopeId`,`data-v-43cbf6ae`]]);export{A as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.lead[data-v-43cbf6ae]{background:var(--hq-surface);border:1px solid var(--hq-border);border-radius:var(--hq-radius);width:100%;padding:1rem}.lead__form[data-v-43cbf6ae]{flex-direction:column;gap:.6rem;display:flex}.lead__title[data-v-43cbf6ae]{margin:0 0 .25rem;font-size:1.05rem}.lead__consent[data-v-43cbf6ae]{color:var(--hq-text-muted);cursor:pointer;align-items:flex-start;gap:.6rem;font-size:.9rem;display:flex}.lead__consent input[data-v-43cbf6ae]{accent-color:var(--hq-accent);flex-shrink:0;width:1.1rem;height:1.1rem;margin-top:.2rem}.lead__error[data-v-43cbf6ae]{color:var(--hq-wrong);margin:0;font-size:.9rem}.lead__thanks[data-v-43cbf6ae]{text-align:center;color:var(--hq-correct);margin:0;font-weight:600}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,C as t,E as n,F as r,I as i,O as a,P as o,S as s,T as c,b as l,d as u,j as d,s as f,t as p,v as m,x as h}from"./index-
|
|
1
|
+
import{A as e,C as t,E as n,F as r,I as i,O as a,P as o,S as s,T as c,b as l,d as u,j as d,s as f,t as p,v as m,x as h}from"./index-CC4u6JVh.js";import{t as g}from"./decks-XbGFyNo9.js";import{n as _}from"./decks-ByuTg813.js";import{t as v}from"./LeadForm-CEtFDKUS.js";var y={key:0,class:`solo-catalog`,"aria-labelledby":`solo-catalog-title`},b={class:`solo-catalog__list`},x=[`aria-expanded`],S=[`href`,`aria-label`],C=u(n({__name:`SoloCatalog`,setup(n){let u=o(!1),C=r([]);return a(async()=>{try{C.value=(await _()).map(e=>({id:e.id,info:g(e)}))}catch(e){console.error(`Solo quizzes unavailable:`,e)}}),(n,r)=>C.value.length?(e(),t(`section`,y,[r[2]||=l(`h2`,{id:`solo-catalog-title`,class:`solo-catalog__title`},`Ou jouez en solo`,-1),l(`ul`,b,[l(`li`,null,[u.value?(e(),h(v,{key:0,source:`gallery`})):(e(),t(`button`,{key:1,type:`button`,class:`solo-catalog__create`,"aria-expanded":u.value,onClick:r[0]||=e=>u.value=!0},[...r[1]||=[l(`span`,{class:`solo-catalog__create-badge`},`Bientôt`,-1),l(`span`,{class:`solo-catalog__create-title`},`Créer mon quiz`,-1),l(`span`,{class:`solo-catalog__create-skeleton`,"aria-hidden":`true`},[l(`i`),l(`i`),l(`i`)],-1)]],8,x))]),(e(!0),t(m,null,d(C.value,n=>(e(),t(`li`,{key:n.id},[l(`a`,{class:`solo-catalog__card`,href:i(p)(n.id),"aria-label":`Jouer en solo : ${n.info.title}`},[c(i(f),{"quiz-info":n.info,compact:``},null,8,[`quiz-info`])],8,S)]))),128))])])):s(``,!0)}}),[[`__scopeId`,`data-v-ec33f116`]]);export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,C as t,E as n,I as r,P as i,S as a,T as o,b as s,d as c,r as l,t as u,v as d,w as f,z as p}from"./index-
|
|
1
|
+
import{A as e,C as t,E as n,I as r,P as i,S as a,T as o,b as s,d as c,r as l,t as u,v as d,w as f,z as p}from"./index-CC4u6JVh.js";import{n as m,t as h}from"./format-5Txm-oDf.js";import{t as g}from"./SoloLeaderboard-DpPQFmyt.js";import{t as _}from"./LeadForm-CEtFDKUS.js";/* empty css */function v(e,t){return`${t.origin}${t.pathname}${u(e)}`}function y(e){let t=e.rank===null?``:` (${m(e.rank)} au classement)`;return`J'ai fait ${e.score.toLocaleString(`fr-FR`)} pts sur le quiz « ${e.title} »${t}. À toi de jouer !`}async function b(e,t){if(t.share)try{return await t.share(e),`shared`}catch(e){if(e?.name===`AbortError`)return`cancelled`}if(!t.clipboard)return`failed`;try{return await t.clipboard.writeText(`${e.text} ${e.url}`),`copied`}catch{return`failed`}}var x={class:`solo-end`},S={class:`solo-end__summary`},C={class:`solo-end__name`},w={class:`solo-end__score`},T={class:`solo-end__meta`},E={key:0,class:`solo-end__rank`},D={class:`solo-end__status`,role:`status`},O={class:`solo-end__actions`},k=[`href`],A={key:0,class:`solo-end__share-note`,role:`status`},j=c(n({__name:`SoloEndView`,setup(n){let c=l(),u={copied:`Lien copié !`,failed:`Partage indisponible sur ce navigateur.`},m=i(``);async function j(){let e=c.deck;if(!e)return;let t=e.quiz.meta.title||e.name,n=await b({title:t,text:y({title:t,score:c.score,rank:c.myRank}),url:v(e.id,location)},navigator);m.value=n===`copied`||n===`failed`?u[n]:``}return(n,i)=>(e(),t(`div`,x,[s(`div`,S,[s(`p`,C,p(r(c).pseudo),1),s(`p`,w,p(r(c).score.toLocaleString(`fr-FR`))+` pts`,1),s(`p`,T,p(r(c).correctCount)+`/`+p(r(c).total)+` bonnes réponses · `+p(r(h)(r(c).totalTimeMs)),1),r(c).myRank===null?a(``,!0):(e(),t(`p`,E,[f(` #`+p(r(c).myRank),1),r(c).runCount===null?a(``,!0):(e(),t(d,{key:0},[f(` sur `+p(r(c).runCount),1)],64))]))]),s(`div`,D,[r(c).submitState===`saving`?(e(),t(d,{key:0},[f(`Enregistrement du score…`)],64)):r(c).submitState===`error`?(e(),t(`button`,{key:1,class:`solo-end__retry`,onClick:i[0]||=e=>r(c).retrySubmit()},` Score non enregistré — réessayer `)):r(c).submitState===`stale`?(e(),t(d,{key:2},[f(` Score non enregistré : ce quiz a été mis à jour. Rejouez pour utiliser la nouvelle version. `)],64)):a(``,!0)]),s(`div`,O,[s(`button`,{class:`solo-btn hq-press`,onClick:i[1]||=e=>r(c).playAgain()},`Rejouer`),s(`a`,{class:`solo-btn solo-btn--ghost hq-press`,href:r(`#/`)},`Menu`,8,k),s(`button`,{class:`solo-btn solo-btn--ghost hq-press`,onClick:j},`Partager`)]),m.value?(e(),t(`p`,A,p(m.value),1)):a(``,!0),o(g,{live:r(c).liveOthers,rows:r(c).board},null,8,[`live`,`rows`]),o(_)]))}}),[[`__scopeId`,`data-v-c555ea86`]]);export{j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,C as t,E as n,I as r,N as i,P as a,T as o,_ as s,b as c,d as l,g as u,r as d,s as f,v as p,y as m}from"./index-
|
|
1
|
+
import{A as e,C as t,E as n,I as r,N as i,P as a,T as o,_ as s,b as c,d as l,g as u,r as d,s as f,v as p,y as m}from"./index-CC4u6JVh.js";import{t as h}from"./decks-XbGFyNo9.js";import{t as g}from"./SoloLeaderboard-DpPQFmyt.js";/* empty css */var _={class:`solo-intro`},v={key:0,class:`solo-intro__unavailable`,role:`status`},y={key:1,class:`solo-intro__unavailable`,role:`status`},b=[`maxlength`],x=[`disabled`],S=l(n({__name:`SoloIntroView`,setup(n){let l=d(),S=a(l.pseudo),C=m(()=>l.deck?h(l.deck):null);return(n,a)=>(e(),t(`div`,_,[r(l).phase===`loading`?(e(),t(`p`,v,`Chargement du quiz…`)):r(l).phase===`unavailable`||!r(l).deck?(e(),t(`p`,y,` Ce quiz n'est pas disponible en solo. `)):(e(),t(p,{key:2},[o(r(f),{"quiz-info":C.value,"play-count":r(l).runCount??void 0,compact:``},null,8,[`quiz-info`,`play-count`]),c(`form`,{class:`solo-intro__form`,onSubmit:a[1]||=s(e=>r(l).start(S.value),[`prevent`])},[a[2]||=c(`label`,{class:`solo-label`,for:`solo-pseudo`},`Votre pseudo`,-1),i(c(`input`,{id:`solo-pseudo`,"onUpdate:modelValue":a[0]||=e=>S.value=e,class:`solo-input`,autocomplete:`nickname`,required:``,maxlength:r(24)},null,8,b),[[u,S.value]]),c(`button`,{class:`solo-btn hq-press`,type:`submit`,disabled:!S.value.trim()},`Commencer`,8,x)],32),o(g,{live:r(l).liveOthers,rows:r(l).board},null,8,[`live`,`rows`])],64))]))}}),[[`__scopeId`,`data-v-67931efa`]]);export{S as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,C as t,E as n,I as r,L as i,S as a,b as o,d as s,j as c,v as l,w as u,z as d}from"./index-
|
|
1
|
+
import{A as e,C as t,E as n,I as r,L as i,S as a,b as o,d as s,j as c,v as l,w as u,z as d}from"./index-CC4u6JVh.js";import{t as f}from"./format-5Txm-oDf.js";var p={class:`solo-board`,"aria-labelledby":`solo-board-title`},m={key:0,class:`solo-board__list`},h={class:`solo-board__name`},g={class:`solo-board__meta`},_={class:`solo-board__score`},v=[`aria-current`],y={class:`solo-board__rank`},b={class:`solo-board__name`},x={key:0,class:`hq-sr-only`},S={class:`solo-board__meta`},C={class:`solo-board__score`},w={key:1,class:`solo-board__empty`},T=s(n({__name:`SoloLeaderboard`,props:{live:{},rows:{}},setup(n){return(s,T)=>(e(),t(`section`,p,[T[2]||=o(`h3`,{id:`solo-board-title`,class:`solo-board__title hq-label`},`Classement`,-1),n.live.length||n.rows.length?(e(),t(`ol`,m,[(e(!0),t(l,null,c(n.live,n=>(e(),t(`li`,{key:`live-`+n.key,class:`solo-board__row solo-board__row--live`},[T[1]||=o(`span`,{class:`solo-board__rank solo-board__dot`,"aria-hidden":`true`},null,-1),o(`span`,h,d(n.pseudo),1),o(`span`,g,[T[0]||=o(`span`,{class:`solo-board__badge`},`en cours`,-1),u(` · Q`+d(Math.min(n.index+1,n.total))+`/`+d(n.total),1)]),o(`span`,_,d(n.score),1)]))),128)),(e(!0),t(l,null,c(n.rows,s=>(e(),t(`li`,{key:s.id,class:i([`solo-board__row`,{"solo-board__row--mine":s.mine,"solo-board__row--gap":s.mine&&s.rank>n.rows.length}]),"aria-current":s.mine?`true`:void 0},[o(`span`,y,d(s.rank),1),o(`span`,b,[u(d(s.pseudo),1),s.mine?(e(),t(`span`,x,` (vous)`)):a(``,!0)]),o(`span`,S,d(r(f)(s.totalTimeMs)),1),o(`span`,C,d(s.score),1)],10,v))),128))])):(e(),t(`p`,w,`Aucun score pour l'instant. Soyez le premier !`))]))}}),[[`__scopeId`,`data-v-bddd0413`]]);export{T as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A as e,C as t,D as n,E as r,I as i,L as a,M as o,P as s,R as c,S as l,T as u,b as d,c as ee,d as f,j as p,k as te,l as ne,r as re,u as ie,v as m,w as ae,x as oe,y as h,z as g}from"./index-
|
|
1
|
+
import{A as e,C as t,D as n,E as r,I as i,L as a,M as o,P as s,R as c,S as l,T as u,b as d,c as ee,d as f,j as p,k as te,l as ne,r as re,u as ie,v as m,w as ae,x as oe,y as h,z as g}from"./index-CC4u6JVh.js";import{n as se}from"./format-5Txm-oDf.js";/* empty css */function _(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var v=_();function y(e){v=e}var b={exec:()=>null};function x(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function S(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(w.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var C=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),w={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:x(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:x(e=>RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:x(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:x(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:x(e=>RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,`i`)),blockquoteBeginRegex:x(e=>RegExp(`^ {0,${e}}>`))},T=/^(?:[ \t]*(?:\n|$))+/,E=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,D=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,O=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ce=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,k=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,A=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,le=S(A).replace(/bull/g,k).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),ue=S(A).replace(/bull/g,k).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),j=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,de=/^[^\n]+/,M=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,fe=S(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,M).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),pe=S(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,k).getRegex(),N=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,P=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,me=S(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,P).replace(`tag`,N).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),he=e=>S(j).replace(`hr`,O).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,N).getRegex(),ge=he(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),_e=he(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),F={blockquote:S(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,_e).getRegex(),code:E,def:fe,fences:D,heading:ce,hr:O,html:me,lheading:le,list:pe,newline:T,paragraph:ge,table:b,text:de},ve=S(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,O).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,N).getRegex(),ye={...F,lheading:ue,table:ve,paragraph:S(j).replace(`hr`,O).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,ve).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,N).getRegex()},be={...F,html:S(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,P).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:b,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:S(j).replace(`hr`,O).replace(`heading`,` *#{1,6} *[^
|
|
2
2
|
]`).replace(`lheading`,le).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},xe=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Se=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ce=/^( {2,}|\\)\n(?!\s*$)/,we=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,I=/[\p{P}\p{S}]/u,L=/[\s\p{P}\p{S}]/u,R=/[^\s\p{P}\p{S}]/u,Te=S(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,L).getRegex(),Ee=/[\p{Pi}\p{Ps}"']/u,De=/(?!~)[\p{P}\p{S}]/u,Oe=/(?!~)[\s\p{P}\p{S}]/u,ke=/(?:[^\s\p{P}\p{S}]|~)/u,Ae=S(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,C?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),je=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Me=S(je,`u`).replace(/punct/g,I).getRegex(),Ne=S(je,`u`).replace(/punct/g,De).getRegex(),Pe=S(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,Ee).replace(/punct/g,I).getRegex(),Fe=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,Ie=S(Fe,`gu`).replace(/notPunctSpace/g,R).replace(/punctSpace/g,L).replace(/punct/g,I).getRegex(),Le=S(Fe,`gu`).replace(/notPunctSpace/g,ke).replace(/punctSpace/g,Oe).replace(/punct/g,De).getRegex(),Re=S(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,R).replace(/punctSpace/g,L).replace(/punct/g,I).getRegex(),ze=S(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,R).replace(/punctSpace/g,L).replace(/punct/g,I).getRegex(),Be=S(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,R).replace(/punctSpace/g,L).replace(/punct/g,I).getRegex(),Ve=S(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,I).getRegex(),He=S(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,R).replace(/punctSpace/g,L).replace(/punct/g,I).getRegex(),Ue=S(/\\(punct)/,`gu`).replace(/punct/g,I).getRegex(),We=S(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ge=S(P).replace(`(?:-->|$)`,`-->`).getRegex(),Ke=S(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,Ge).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),z=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,qe=S(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,z).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Je=S(/^!?\[(label)\]\[(ref)\]/).replace(`label`,z).replace(`ref`,M).getRegex(),Ye=S(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,M).getRegex(),Xe=S(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Je).replace(`nolink`,Ye).getRegex(),Ze=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,B={_backpedal:b,anyPunctuation:Ue,autolink:We,blockSkip:Ae,br:Ce,code:Se,del:b,delLDelim:b,delRDelim:b,emStrongLDelim:Me,emStrongRDelimAst:Ie,emStrongRDelimUnd:ze,escape:xe,link:qe,nolink:Ye,punctuation:Te,reflink:Je,reflinkSearch:Xe,tag:Ke,text:we,url:b},Qe={...B,emStrongLDelim:Pe,emStrongRDelimAst:Re,emStrongRDelimUnd:Be,link:S(/^!?\[(label)\]\((.*?)\)/).replace(`label`,z).getRegex(),reflink:S(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,z).getRegex()},V={...B,emStrongRDelimAst:Le,emStrongLDelim:Ne,delLDelim:Ve,delRDelim:He,url:S(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,Ze).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:S(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,Ze).getRegex()},$e={...V,br:S(Ce).replace(`{2,}`,`*`).getRegex(),text:S(V.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},H={normal:F,gfm:ye,pedantic:be},U={normal:B,gfm:V,breaks:$e,pedantic:Qe},et={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},tt=e=>et[e];function W(e,t){if(t){if(w.escapeTest.test(e))return e.replace(w.escapeReplace,tt)}else if(w.escapeTestNoEncode.test(e))return e.replace(w.escapeReplaceNoEncode,tt);return e}function nt(e){try{e=encodeURI(e).replace(w.percentDecode,`%`)}catch{return null}return e}function rt(e,t){let n=e.replace(w.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(w.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(w.slashPipe,`|`);return n}function G(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function it(e){let t=e.split(`
|
|
3
3
|
`),n=t.length-1;for(;n>=0&&w.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
|
|
4
4
|
`)}function at(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function ot(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function st(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),ee=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(ee){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function ct(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./decks-
|
|
1
|
+
import{n as e}from"./decks-XbGFyNo9.js";function t(e){return e.filter(e=>e.quiz.meta.solo)}var n=null;function r(t=`/decks.json`){return n??=e(t).catch(e=>{throw n=null,e}),n}function i(){n=null}async function a(){return t(await r())}async function o(e){return(await r()).find(t=>t.id===e)}export{a as n,i as r,o as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{B as __commonJSMin,V as __toESM,f as Buffer,p as init_dist}from"./index-
|
|
1
|
+
import{B as __commonJSMin,V as __toESM,f as Buffer,p as init_dist}from"./index-CC4u6JVh.js";init_dist();function quizFormat(e,t){return{poolSize:t,randomDraw:e.maxQuestions!==void 0||e.maxTimeSec!==void 0||e.targetDifficulty!==void 0,oneShoot:e.oneShoot??!0}}function splitBlocks(e){let t=e.split(/(^|\n)---(\n|$)/g).filter((e,t)=>t%3==0).map(e=>e.trim()).filter(e=>e.length>0);if(t.length===0)return[];let n=t[0],r=t.slice(1);if(r.length%2!=0)throw Error(`Malformed .hashquiz.md file: expected an even number of blocks after the meta section, got ${r.length}`);let i=[];for(let e=0;e<r.length;e+=2){let t=r[e],n=r[e+1];i.push(`---\n${t}\n---\n\n${n}`)}return[n,...i]}var require___vite_browser_external=__commonJSMin(((e,t)=>{t.exports={}})),require_kind_of=__commonJSMin(((e,t)=>{var n=Object.prototype.toString;t.exports=function(e){if(e===void 0)return`undefined`;if(e===null)return`null`;var t=typeof e;if(t===`boolean`)return`boolean`;if(t===`string`)return`string`;if(t===`number`)return`number`;if(t===`symbol`)return`symbol`;if(t===`function`)return c(e)?`generatorfunction`:`function`;if(i(e))return`array`;if(d(e))return`buffer`;if(u(e))return`arguments`;if(o(e))return`date`;if(a(e))return`error`;if(s(e))return`regexp`;switch(r(e)){case`Symbol`:return`symbol`;case`Promise`:return`promise`;case`WeakMap`:return`weakmap`;case`WeakSet`:return`weakset`;case`Map`:return`map`;case`Set`:return`set`;case`Int8Array`:return`int8array`;case`Uint8Array`:return`uint8array`;case`Uint8ClampedArray`:return`uint8clampedarray`;case`Int16Array`:return`int16array`;case`Uint16Array`:return`uint16array`;case`Int32Array`:return`int32array`;case`Uint32Array`:return`uint32array`;case`Float32Array`:return`float32array`;case`Float64Array`:return`float64array`}if(l(e))return`generator`;switch(t=n.call(e),t){case`[object Object]`:return`object`;case`[object Map Iterator]`:return`mapiterator`;case`[object Set Iterator]`:return`setiterator`;case`[object String Iterator]`:return`stringiterator`;case`[object Array Iterator]`:return`arrayiterator`}return t.slice(8,-1).toLowerCase().replace(/\s/g,``)};function r(e){return typeof e.constructor==`function`?e.constructor.name:null}function i(e){return Array.isArray?Array.isArray(e):e instanceof Array}function a(e){return e instanceof Error||typeof e.message==`string`&&e.constructor&&typeof e.constructor.stackTraceLimit==`number`}function o(e){return e instanceof Date||typeof e.toDateString==`function`&&typeof e.getDate==`function`&&typeof e.setDate==`function`}function s(e){return e instanceof RegExp||typeof e.flags==`string`&&typeof e.ignoreCase==`boolean`&&typeof e.multiline==`boolean`&&typeof e.global==`boolean`}function c(e,t){return r(e)===`GeneratorFunction`}function l(e){return typeof e.throw==`function`&&typeof e.return==`function`&&typeof e.next==`function`}function u(e){try{if(typeof e.length==`number`&&typeof e.callee==`function`)return!0}catch(e){if(e.message.indexOf(`callee`)!==-1)return!0}return!1}function d(e){return e.constructor&&typeof e.constructor.isBuffer==`function`?e.constructor.isBuffer(e):!1}})),require_is_extendable=__commonJSMin(((e,t)=>{t.exports=function(e){return e!=null&&(typeof e==`object`||typeof e==`function`)}})),require_extend_shallow=__commonJSMin(((e,t)=>{var n=require_is_extendable();t.exports=function(e){n(e)||(e={});for(var t=arguments.length,i=1;i<t;i++){var a=arguments[i];n(a)&&r(e,a)}return e};function r(e,t){for(var n in t)i(t,n)&&(e[n]=t[n])}function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}})),require_section_matter=__commonJSMin(((e,t)=>{var n=require_kind_of(),r=require_extend_shallow();t.exports=function(e,t){typeof t==`function`&&(t={parse:t});var n=a(e),l=r({},{section_delimiter:`---`,parse:c},t),u=l.section_delimiter,d=n.content.split(/\r?\n/),f=null,p=s(),m=[],h=[];function g(e){n.content=e,f=[],m=[]}function _(e){h.length&&(p.key=o(h[0],u),p.content=e,l.parse(p,f),f.push(p),p=s(),m=[],h=[])}for(var v=0;v<d.length;v++){var y=d[v],b=h.length,x=y.trim();if(i(x,u)){if(x.length===3&&v!==0){if(b===0||b===2){m.push(y);continue}h.push(x),p.data=m.join(`
|
|
2
2
|
`),m=[];continue}f===null&&g(m.join(`
|
|
3
3
|
`)),b===2&&_(m.join(`
|
|
4
4
|
`)),h.push(x)}else m.push(y)}return f===null?g(m.join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./solo-backend-CBEhye1F.js";import{a as t,i as n,o as r}from"./index-t6uIRzOv.js";import{r as i,t as a}from"./decks-VuEnO8Am.js";var o=e=>({ok:!1,reason:e});function s(e,t){let n=t;if(typeof n!=`object`||!n)return o(`invalid submission`);let{deckId:i,deckVersion:a,pseudo:s,answers:c}=n;if(typeof i!=`string`||i.length<1||i.length>200)return o(`invalid deckId`);if(typeof a!=`string`||a.length<1||a.length>64)return o(`invalid deckVersion`);if(typeof s!=`string`)return o(`pseudo must be 1-24 characters`);if(!Array.isArray(c))return o(`invalid answers`);for(let e of c)if(typeof e!=`object`||!e||!Array.isArray(e.choices))return o(`invalid answer`);let l=s.trim();if(l.length<1||l.length>24)return o(`pseudo must be 1-24 characters`);let u=e.questions,d=c;if(d.length<1)return o(`no answers`);let f=new Set;for(let e of d){if(!Number.isInteger(e.deckIndex)||e.deckIndex<0||e.deckIndex>=u.length)return o(`unknown question`);if(f.has(e.deckIndex))return o(`duplicate question`);f.add(e.deckIndex)}for(let e of d){let t=u[e.deckIndex];if(!Number.isInteger(e.answerTimeMs)||e.answerTimeMs<0||e.answerTimeMs>Math.round(t.timer*1e3))return o(`invalid answer time`);let n=new Set;for(let r of e.choices){if(!Number.isInteger(r)||r<0||r>=t.choices.length||n.has(r))return o(`invalid choice`);n.add(r)}}let{maxQuestions:p,maxTimeSec:m,targetDifficulty:h}=e.meta;if(m&&d.reduce((e,t)=>e+u[t.deckIndex].timer,0)>m)return o(`over max time`);let g=u.length,_=p?Math.min(p,g):g;if(p&&d.length>_)return o(`too many answers`);if(!m&&!h&&d.length!==_)return o(`wrong answer count`);let v=0,y=0,b=0,x=d.map((e,t)=>{let n=u[e.deckIndex],i=new Set;n.choices.forEach((e,t)=>{e.isCorrect&&i.add(t)});let a=e.choices.length===i.size&&e.choices.every(e=>i.has(e)),o=r(Math.max(0,n.timer-e.answerTimeMs/1e3),a);return v+=o,a&&y++,b+=e.answerTimeMs,{deckIndex:e.deckIndex,choices:[...e.choices],answerTimeMs:e.answerTimeMs,position:t,isCorrect:a,points:o}});return{ok:!0,run:{deckId:i,deckVersion:a,pseudo:l,score:v,correctCount:y,questionCount:d.length,totalTimeMs:b,answers:x}}}var c=`solo`;function l(e){return`http://${e}:3030`}var u=2e3,d=e=>e instanceof Error?e.message:String(e),f=e=>({ok:!1,error:e}),p=encodeURIComponent,m=()=>Math.random().toString(36).slice(2,12).padEnd(6,`0`),h=e=>typeof e==`object`&&!!e&&!Array.isArray(e),g=class{ctx;constructor(e){this.ctx=e}async call(e,t){try{let n=t===void 0?{method:`GET`}:{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)},r=await this.ctx.fetch(`${this.ctx.baseUrl}${e}`,n);if(r.status===204)return{ok:!0,value:void 0};let i;try{i=await r.json()}catch{i=void 0}return r.ok?{ok:!0,value:i}:f(h(i)&&typeof i.reason==`string`?i.reason:`HTTP ${r.status}`)}catch(e){return f(d(e))}}async submitRun(e){let t=await this.call(`/solo/runs`,e);if(!t.ok)return t;let n=t.value;return!h(n)||typeof n.runId!=`string`?f(`invalid response`):{ok:!0,value:{runId:n.runId,rank:typeof n.rank==`number`?n.rank:null}}}async fetchTop(e,t=20){let n=await this.call(`/solo/runs?deck=${p(e)}&limit=${t}`);return n.ok?Array.isArray(n.value)?{ok:!0,value:n.value}:f(`invalid response`):n}async fetchRun(e){let t=await this.call(`/solo/runs/${p(e)}`);return t.ok?h(t.value)?{ok:!0,value:t.value}:f(`invalid response`):t}async fetchCount(e){let t=await this.call(`/solo/count?deck=${p(e)}`);if(!t.ok)return t;let n=t.value;return h(n)&&typeof n.count==`number`?{ok:!0,value:n.count}:f(`invalid response`)}async fetchRank(e){let t=await this.call(`/solo/rank/${p(e)}`);if(!t.ok)return t;let n=t.value;return h(n)&&typeof n.rank==`number`?{ok:!0,value:n.rank}:f(`invalid response`)}async submitLead(t,n,r={}){let i=t.trim();if(!e.test(i))return f(`invalid email`);let a=await this.call(`/solo/leads`,{email:i,deckId:n,...r});return a.ok?{ok:!0,value:void 0}:a}onNewRun(e,t){let n=!1,r=new _(this.ctx,e,m(),{open:()=>{n&&t(),n=!0},message:n=>{n.type===`solo_new_run`&&n.deckId===e&&t()}});return()=>r.stop()}},_=class{ctx;on;ws=null;timer=null;stopped=!1;url;constructor(e,t,n,r){this.ctx=e,this.on=r;let i=e.baseUrl.replace(/^http/,`ws`);this.url=`${i}/ws?role=${c}&deck=${p(t)}&key=${p(n)}`,this.connect()}connect(){if(this.timer=null,this.stopped)return;let e;try{e=new this.ctx.WebSocket(this.url)}catch{this.retry();return}this.ws=e,e.onopen=()=>{e===this.ws&&this.on.open()},e.onmessage=t=>{if(e!==this.ws)return;let n;try{n=JSON.parse(String(t.data))}catch{return}h(n)&&typeof n.type==`string`&&this.on.message(n)},e.onclose=()=>{e===this.ws&&(this.ws=null,this.retry())},e.onerror=()=>{}}retry(){this.stopped||this.timer||(this.timer=setTimeout(()=>this.connect(),this.ctx.reconnectMs))}send(e){let t=this.ws;t&&t.readyState===this.ctx.WebSocket.OPEN&&t.send(JSON.stringify(e))}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null;let e=this.ws;this.ws=null;try{e?.close()}catch{}}},v=class{deckId;key=m();sock;listeners=[];me=null;resolveWatch;watched=new Promise(e=>{this.resolveWatch=e});constructor(e,t){this.deckId=t,this.sock=new _(e,t,this.key,{open:()=>{this.me&&this.sock.send({type:`solo_track`,state:this.me})},message:e=>{if(e.type===`solo_presence`&&e.deckId===this.deckId&&Array.isArray(e.players)){this.resolveWatch();for(let t of this.listeners)t(e.players)}}})}watch(){return this.watched}async join(e){this.track(e)}async update(e){this.track(e)}track(e){this.me={...e},this.sock.send({type:`solo_track`,state:this.me})}async untrack(){this.me=null,this.sock.send({type:`solo_untrack`})}async leave(){this.me=null,this.sock.stop()}onChange(e){return this.listeners.push(e),()=>{this.listeners=this.listeners.filter(t=>t!==e)}}};function y(e){let t={baseUrl:e.baseUrl.replace(/\/+$/,``),fetch:e.fetch??((e,t)=>globalThis.fetch(e,t)),WebSocket:e.WebSocket??globalThis.WebSocket,reconnectMs:e.reconnectMs??u};return{api:new g(t),live:e=>new v(t,e)}}async function b(e,t=3e3,n=50){for(let r=0;r<t;r+=n){let t=e.realtime.connectionState();if(t!==`connecting`&&t!==`closing`)return;await new Promise(e=>setTimeout(e,n))}}var x=class{client;key=Math.random().toString(36).slice(2,12);topic;channel;listeners=[];subscribed=null;me=null;left=!1;rebuilding=!1;lastRebuild=-1/0;rows=new Map;joinedInDiff=new Set;constructor(e,t){if(this.client=e,this.topic=`solo:${t}`,e.getChannels().some(e=>e.topic===`realtime:${this.topic}`))throw Error(`presence channel ${this.topic} is still open`);this.open()}open(){let e=this.client.channel(this.topic,{config:{presence:{key:this.key}}});this.channel=e,e.on(`presence`,{event:`join`},({key:t,newPresences:n})=>{if(e!==this.channel)return;let r=n.at(-1);r&&(this.rows.set(t,{pseudo:r.pseudo,index:r.index,total:r.total,score:r.score}),this.joinedInDiff.add(t))}).on(`presence`,{event:`leave`},({key:t})=>{e===this.channel&&(this.joinedInDiff.has(t)||this.rows.delete(t))}).on(`presence`,{event:`sync`},()=>{e===this.channel&&(this.joinedInDiff.clear(),this.emit())})}emit(){let e=[...this.rows].map(([e,t])=>({key:e,...t}));for(let t of this.listeners)t(e)}watch(){let e=this.channel;return this.subscribed??=new Promise((t,n)=>{e.subscribe(r=>{e===this.channel&&(r===`SUBSCRIBED`?t():(r===`CHANNEL_ERROR`||r===`TIMED_OUT`)&&n(Error(`presence ${r}`)),r===`CHANNEL_ERROR`&&this.rebuild())})}),this.subscribed}async rebuild(){if(!(this.left||this.rebuilding||Date.now()-this.lastRebuild<2e3)){this.rebuilding=!0,this.lastRebuild=Date.now();try{let e=this.channel;try{await this.client.removeChannel(e)}catch{}if(await b(this.client),this.left)return;this.rows.clear(),this.joinedInDiff.clear(),this.subscribed=null,this.open(),await this.watch(),this.me&&await this.channel.track(this.me)}catch{}finally{this.rebuilding=!1}}}async join(e){this.me=e,await this.watch(),await this.track(e)}async update(e){this.me=e,await this.track(e)}async track(e){await this.channel.track(e)===`error`&&await this.rebuild()}async untrack(){this.me=null,await this.channel.untrack()}async leave(){this.left=!0,this.me=null;try{await this.client.removeChannel(this.channel)}catch{}}onChange(e){return this.listeners.push(e),()=>{this.listeners=this.listeners.filter(t=>t!==e)}}};function S(e){return{deck_id:e.deckId,deck_version:e.deckVersion,pseudo:e.pseudo,score:e.score,correct_count:e.correctCount,question_count:e.questionCount,total_time_ms:e.totalTimeMs,answers:e.answers.map(e=>({position:e.position,deck_index:e.deckIndex,choices:e.choices,is_correct:e.isCorrect,answer_time_ms:e.answerTimeMs,points:e.points}))}}var C=`id, pseudo, score, total_time_ms, finished_at`,w=e=>({id:e.id,pseudo:e.pseudo,score:e.score,totalTimeMs:e.total_time_ms,finishedAt:e.finished_at}),T=e=>e instanceof Error?e.message:String(e),E=e=>({ok:!1,error:e}),D=class{client;mode;constructor(e,t){this.client=e,this.mode=t}async submitRun(e,t){try{return this.mode===`edge`?await this.submitEdge(e):await this.submitBrowser(e,t)}catch(e){return E(T(e))}}async submitEdge(e){let{data:t,error:n}=await this.client.functions.invoke(`solo-submit`,{body:e});if(n){let e=n.context,t;if(e instanceof Response)try{t=(await e.json()).reason}catch{}else t=e?.reason;return E(t??n.message)}let r=t;return r?.runId?{ok:!0,value:{runId:r.runId,rank:r.rank??null}}:E(`invalid response`)}async submitBrowser(e,t){let n=s(t,e);if(!n.ok)return E(n.reason);let{data:r,error:i}=await this.client.rpc(`submit_solo_run`,{p_run:S(n.run)});if(i)return E(i.message);if(typeof r!=`string`)return E(`invalid response`);let{data:a,error:o}=await this.client.rpc(`solo_rank`,{p_run_id:r});return{ok:!0,value:{runId:r,rank:o||typeof a!=`number`?null:a}}}async fetchTop(e,t=20){try{let{data:n,error:r}=await this.client.from(`solo_runs`).select(C).eq(`deck_id`,e).order(`score`,{ascending:!1}).order(`total_time_ms`,{ascending:!0}).order(`finished_at`,{ascending:!0}).limit(t);return r?E(r.message):{ok:!0,value:(n??[]).map(w)}}catch(e){return E(T(e))}}async fetchRun(e){try{let{data:t,error:n}=await this.client.from(`solo_runs`).select(C).eq(`id`,e).maybeSingle();return n?E(n.message):t?{ok:!0,value:w(t)}:E(`run not found`)}catch(e){return E(T(e))}}async fetchCount(e){try{let{count:t,error:n}=await this.client.from(`solo_runs`).select(`id`,{count:`exact`,head:!0}).eq(`deck_id`,e);return n?E(n.message):{ok:!0,value:t??0}}catch(e){return E(T(e))}}async fetchRank(e){try{let{data:t,error:n}=await this.client.rpc(`solo_rank`,{p_run_id:e});return n?E(n.message):typeof t==`number`?{ok:!0,value:t}:E(`run not found`)}catch(e){return E(T(e))}}async submitLead(t,n,r={}){let i=t.trim();if(!e.test(i))return E(`invalid email`);try{let{error:e}=await this.client.from(`leads`).insert({email:i,consent:!0,deck_id:n,segment:r.segment??null,founders:r.founders===!0,source:r.source??null});return e?E(e.message):{ok:!0,value:void 0}}catch(e){return E(T(e))}}onNewRun(e,t){let n=`solo-runs:${e}`;try{if(this.client.getChannels().some(e=>e.topic===`realtime:${n}`))throw Error(`${n} is still open`);let r,i=!1,a=-1/0,o=()=>{let s=this.client.channel(n).on(`postgres_changes`,{event:`INSERT`,schema:`public`,table:`solo_runs`,filter:`deck_id=eq.${e}`},()=>t());r=s,s.subscribe(e=>{e!==`CHANNEL_ERROR`||s!==r||i||Date.now()-a<2e3||(a=Date.now(),(async()=>{try{await this.client.removeChannel(s)}catch{}await b(this.client),!i&&s===r&&(o(),t())})())})};return o(),async()=>{i=!0;try{await this.client.removeChannel(r)}catch{}}}catch{return async()=>{}}}};function O(e){let t=e.client??n(e.url,e.anonKey);return{api:new D(t,e.scoring),live:e=>new x(t,e)}}function k(e=t,n=location.hostname){if(e.transport===`local`)return{findDeck:a,reloadDecks:i,backend:y({baseUrl:l(n)})};let{supabaseUrl:r,supabaseAnonKey:o,soloScoring:s}=e;return!r||!o?{findDeck:a,reloadDecks:i,backend:null}:{findDeck:a,reloadDecks:i,backend:O({url:r,anonKey:o,scoring:s})}}export{k as defaultSoloDeps};
|
|
1
|
+
import{t as e}from"./solo-backend-C3QJkkz_.js";import{a as t,i as n,o as r}from"./index-CC4u6JVh.js";import{r as i,t as a}from"./decks-ByuTg813.js";var o=e=>({ok:!1,reason:e});function s(e,t){let n=t;if(typeof n!=`object`||!n)return o(`invalid submission`);let{deckId:i,deckVersion:a,pseudo:s,answers:c}=n;if(typeof i!=`string`||i.length<1||i.length>200)return o(`invalid deckId`);if(typeof a!=`string`||a.length<1||a.length>64)return o(`invalid deckVersion`);if(typeof s!=`string`)return o(`pseudo must be 1-24 characters`);if(!Array.isArray(c))return o(`invalid answers`);for(let e of c)if(typeof e!=`object`||!e||!Array.isArray(e.choices))return o(`invalid answer`);let l=s.trim();if(l.length<1||l.length>24)return o(`pseudo must be 1-24 characters`);let u=e.questions,d=c;if(d.length<1)return o(`no answers`);let f=new Set;for(let e of d){if(!Number.isInteger(e.deckIndex)||e.deckIndex<0||e.deckIndex>=u.length)return o(`unknown question`);if(f.has(e.deckIndex))return o(`duplicate question`);f.add(e.deckIndex)}for(let e of d){let t=u[e.deckIndex];if(!Number.isInteger(e.answerTimeMs)||e.answerTimeMs<0||e.answerTimeMs>Math.round(t.timer*1e3))return o(`invalid answer time`);let n=new Set;for(let r of e.choices){if(!Number.isInteger(r)||r<0||r>=t.choices.length||n.has(r))return o(`invalid choice`);n.add(r)}}let{maxQuestions:p,maxTimeSec:m,targetDifficulty:h}=e.meta;if(m&&d.reduce((e,t)=>e+u[t.deckIndex].timer,0)>m)return o(`over max time`);let g=u.length,_=p?Math.min(p,g):g;if(p&&d.length>_)return o(`too many answers`);if(!m&&!h&&d.length!==_)return o(`wrong answer count`);let v=0,y=0,b=0,x=d.map((e,t)=>{let n=u[e.deckIndex],i=new Set;n.choices.forEach((e,t)=>{e.isCorrect&&i.add(t)});let a=e.choices.length===i.size&&e.choices.every(e=>i.has(e)),o=r(Math.max(0,n.timer-e.answerTimeMs/1e3),a);return v+=o,a&&y++,b+=e.answerTimeMs,{deckIndex:e.deckIndex,choices:[...e.choices],answerTimeMs:e.answerTimeMs,position:t,isCorrect:a,points:o}});return{ok:!0,run:{deckId:i,deckVersion:a,pseudo:l,score:v,correctCount:y,questionCount:d.length,totalTimeMs:b,answers:x}}}var c=`solo`;function l(e){return`http://${e}:3030`}var u=2e3,d=e=>e instanceof Error?e.message:String(e),f=e=>({ok:!1,error:e}),p=encodeURIComponent,m=()=>Math.random().toString(36).slice(2,12).padEnd(6,`0`),h=e=>typeof e==`object`&&!!e&&!Array.isArray(e),g=class{ctx;constructor(e){this.ctx=e}async call(e,t){try{let n=t===void 0?{method:`GET`}:{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)},r=await this.ctx.fetch(`${this.ctx.baseUrl}${e}`,n);if(r.status===204)return{ok:!0,value:void 0};let i;try{i=await r.json()}catch{i=void 0}return r.ok?{ok:!0,value:i}:f(h(i)&&typeof i.reason==`string`?i.reason:`HTTP ${r.status}`)}catch(e){return f(d(e))}}async submitRun(e){let t=await this.call(`/solo/runs`,e);if(!t.ok)return t;let n=t.value;return!h(n)||typeof n.runId!=`string`?f(`invalid response`):{ok:!0,value:{runId:n.runId,rank:typeof n.rank==`number`?n.rank:null}}}async fetchTop(e,t=20){let n=await this.call(`/solo/runs?deck=${p(e)}&limit=${t}`);return n.ok?Array.isArray(n.value)?{ok:!0,value:n.value}:f(`invalid response`):n}async fetchRun(e){let t=await this.call(`/solo/runs/${p(e)}`);return t.ok?h(t.value)?{ok:!0,value:t.value}:f(`invalid response`):t}async fetchCount(e){let t=await this.call(`/solo/count?deck=${p(e)}`);if(!t.ok)return t;let n=t.value;return h(n)&&typeof n.count==`number`?{ok:!0,value:n.count}:f(`invalid response`)}async fetchRank(e){let t=await this.call(`/solo/rank/${p(e)}`);if(!t.ok)return t;let n=t.value;return h(n)&&typeof n.rank==`number`?{ok:!0,value:n.rank}:f(`invalid response`)}async submitLead(t,n,r={}){let i=t.trim();if(!e.test(i))return f(`invalid email`);let a=await this.call(`/solo/leads`,{email:i,deckId:n,...r});return a.ok?{ok:!0,value:void 0}:a}onNewRun(e,t){let n=!1,r=new _(this.ctx,e,m(),{open:()=>{n&&t(),n=!0},message:n=>{n.type===`solo_new_run`&&n.deckId===e&&t()}});return()=>r.stop()}},_=class{ctx;on;ws=null;timer=null;stopped=!1;url;constructor(e,t,n,r){this.ctx=e,this.on=r;let i=e.baseUrl.replace(/^http/,`ws`);this.url=`${i}/ws?role=${c}&deck=${p(t)}&key=${p(n)}`,this.connect()}connect(){if(this.timer=null,this.stopped)return;let e;try{e=new this.ctx.WebSocket(this.url)}catch{this.retry();return}this.ws=e,e.onopen=()=>{e===this.ws&&this.on.open()},e.onmessage=t=>{if(e!==this.ws)return;let n;try{n=JSON.parse(String(t.data))}catch{return}h(n)&&typeof n.type==`string`&&this.on.message(n)},e.onclose=()=>{e===this.ws&&(this.ws=null,this.retry())},e.onerror=()=>{}}retry(){this.stopped||this.timer||(this.timer=setTimeout(()=>this.connect(),this.ctx.reconnectMs))}send(e){let t=this.ws;t&&t.readyState===this.ctx.WebSocket.OPEN&&t.send(JSON.stringify(e))}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null;let e=this.ws;this.ws=null;try{e?.close()}catch{}}},v=class{deckId;key=m();sock;listeners=[];me=null;resolveWatch;watched=new Promise(e=>{this.resolveWatch=e});constructor(e,t){this.deckId=t,this.sock=new _(e,t,this.key,{open:()=>{this.me&&this.sock.send({type:`solo_track`,state:this.me})},message:e=>{if(e.type===`solo_presence`&&e.deckId===this.deckId&&Array.isArray(e.players)){this.resolveWatch();for(let t of this.listeners)t(e.players)}}})}watch(){return this.watched}async join(e){this.track(e)}async update(e){this.track(e)}track(e){this.me={...e},this.sock.send({type:`solo_track`,state:this.me})}async untrack(){this.me=null,this.sock.send({type:`solo_untrack`})}async leave(){this.me=null,this.sock.stop()}onChange(e){return this.listeners.push(e),()=>{this.listeners=this.listeners.filter(t=>t!==e)}}};function y(e){let t={baseUrl:e.baseUrl.replace(/\/+$/,``),fetch:e.fetch??((e,t)=>globalThis.fetch(e,t)),WebSocket:e.WebSocket??globalThis.WebSocket,reconnectMs:e.reconnectMs??u};return{api:new g(t),live:e=>new v(t,e)}}async function b(e,t=3e3,n=50){for(let r=0;r<t;r+=n){let t=e.realtime.connectionState();if(t!==`connecting`&&t!==`closing`)return;await new Promise(e=>setTimeout(e,n))}}var x=class{client;key=Math.random().toString(36).slice(2,12);topic;channel;listeners=[];subscribed=null;me=null;left=!1;rebuilding=!1;lastRebuild=-1/0;rows=new Map;joinedInDiff=new Set;constructor(e,t){if(this.client=e,this.topic=`solo:${t}`,e.getChannels().some(e=>e.topic===`realtime:${this.topic}`))throw Error(`presence channel ${this.topic} is still open`);this.open()}open(){let e=this.client.channel(this.topic,{config:{presence:{key:this.key}}});this.channel=e,e.on(`presence`,{event:`join`},({key:t,newPresences:n})=>{if(e!==this.channel)return;let r=n.at(-1);r&&(this.rows.set(t,{pseudo:r.pseudo,index:r.index,total:r.total,score:r.score}),this.joinedInDiff.add(t))}).on(`presence`,{event:`leave`},({key:t})=>{e===this.channel&&(this.joinedInDiff.has(t)||this.rows.delete(t))}).on(`presence`,{event:`sync`},()=>{e===this.channel&&(this.joinedInDiff.clear(),this.emit())})}emit(){let e=[...this.rows].map(([e,t])=>({key:e,...t}));for(let t of this.listeners)t(e)}watch(){let e=this.channel;return this.subscribed??=new Promise((t,n)=>{e.subscribe(r=>{e===this.channel&&(r===`SUBSCRIBED`?t():(r===`CHANNEL_ERROR`||r===`TIMED_OUT`)&&n(Error(`presence ${r}`)),r===`CHANNEL_ERROR`&&this.rebuild())})}),this.subscribed}async rebuild(){if(!(this.left||this.rebuilding||Date.now()-this.lastRebuild<2e3)){this.rebuilding=!0,this.lastRebuild=Date.now();try{let e=this.channel;try{await this.client.removeChannel(e)}catch{}if(await b(this.client),this.left)return;this.rows.clear(),this.joinedInDiff.clear(),this.subscribed=null,this.open(),await this.watch(),this.me&&await this.channel.track(this.me)}catch{}finally{this.rebuilding=!1}}}async join(e){this.me=e,await this.watch(),await this.track(e)}async update(e){this.me=e,await this.track(e)}async track(e){await this.channel.track(e)===`error`&&await this.rebuild()}async untrack(){this.me=null,await this.channel.untrack()}async leave(){this.left=!0,this.me=null;try{await this.client.removeChannel(this.channel)}catch{}}onChange(e){return this.listeners.push(e),()=>{this.listeners=this.listeners.filter(t=>t!==e)}}};function S(e){return{deck_id:e.deckId,deck_version:e.deckVersion,pseudo:e.pseudo,score:e.score,correct_count:e.correctCount,question_count:e.questionCount,total_time_ms:e.totalTimeMs,answers:e.answers.map(e=>({position:e.position,deck_index:e.deckIndex,choices:e.choices,is_correct:e.isCorrect,answer_time_ms:e.answerTimeMs,points:e.points}))}}var C=`id, pseudo, score, total_time_ms, finished_at`,w=e=>({id:e.id,pseudo:e.pseudo,score:e.score,totalTimeMs:e.total_time_ms,finishedAt:e.finished_at}),T=e=>e instanceof Error?e.message:String(e),E=e=>({ok:!1,error:e}),D=class{client;mode;constructor(e,t){this.client=e,this.mode=t}async submitRun(e,t){try{return this.mode===`edge`?await this.submitEdge(e):await this.submitBrowser(e,t)}catch(e){return E(T(e))}}async submitEdge(e){let{data:t,error:n}=await this.client.functions.invoke(`solo-submit`,{body:e});if(n){let e=n.context,t;if(e instanceof Response)try{t=(await e.json()).reason}catch{}else t=e?.reason;return E(t??n.message)}let r=t;return r?.runId?{ok:!0,value:{runId:r.runId,rank:r.rank??null}}:E(`invalid response`)}async submitBrowser(e,t){let n=s(t,e);if(!n.ok)return E(n.reason);let{data:r,error:i}=await this.client.rpc(`submit_solo_run`,{p_run:S(n.run)});if(i)return E(i.message);if(typeof r!=`string`)return E(`invalid response`);let{data:a,error:o}=await this.client.rpc(`solo_rank`,{p_run_id:r});return{ok:!0,value:{runId:r,rank:o||typeof a!=`number`?null:a}}}async fetchTop(e,t=20){try{let{data:n,error:r}=await this.client.from(`solo_runs`).select(C).eq(`deck_id`,e).order(`score`,{ascending:!1}).order(`total_time_ms`,{ascending:!0}).order(`finished_at`,{ascending:!0}).limit(t);return r?E(r.message):{ok:!0,value:(n??[]).map(w)}}catch(e){return E(T(e))}}async fetchRun(e){try{let{data:t,error:n}=await this.client.from(`solo_runs`).select(C).eq(`id`,e).maybeSingle();return n?E(n.message):t?{ok:!0,value:w(t)}:E(`run not found`)}catch(e){return E(T(e))}}async fetchCount(e){try{let{count:t,error:n}=await this.client.from(`solo_runs`).select(`id`,{count:`exact`,head:!0}).eq(`deck_id`,e);return n?E(n.message):{ok:!0,value:t??0}}catch(e){return E(T(e))}}async fetchRank(e){try{let{data:t,error:n}=await this.client.rpc(`solo_rank`,{p_run_id:e});return n?E(n.message):typeof t==`number`?{ok:!0,value:t}:E(`run not found`)}catch(e){return E(T(e))}}async submitLead(t,n,r={}){let i=t.trim();if(!e.test(i))return E(`invalid email`);try{let{error:e}=await this.client.from(`leads`).insert({email:i,consent:!0,deck_id:n,segment:r.segment??null,founders:r.founders===!0,source:r.source??null});return e?E(e.message):{ok:!0,value:void 0}}catch(e){return E(T(e))}}onNewRun(e,t){let n=`solo-runs:${e}`;try{if(this.client.getChannels().some(e=>e.topic===`realtime:${n}`))throw Error(`${n} is still open`);let r,i=!1,a=-1/0,o=()=>{let s=this.client.channel(n).on(`postgres_changes`,{event:`INSERT`,schema:`public`,table:`solo_runs`,filter:`deck_id=eq.${e}`},()=>t());r=s,s.subscribe(e=>{e!==`CHANNEL_ERROR`||s!==r||i||Date.now()-a<2e3||(a=Date.now(),(async()=>{try{await this.client.removeChannel(s)}catch{}await b(this.client),!i&&s===r&&(o(),t())})())})};return o(),async()=>{i=!0;try{await this.client.removeChannel(r)}catch{}}}catch{return async()=>{}}}};function O(e){let t=e.client??n(e.url,e.anonKey);return{api:new D(t,e.scoring),live:e=>new x(t,e)}}function k(e=t,n=location.hostname){if(e.transport===`local`)return{findDeck:a,reloadDecks:i,backend:y({baseUrl:l(n)})};let{supabaseUrl:r,supabaseAnonKey:o,soloScoring:s}=e;return!r||!o?{findDeck:a,reloadDecks:i,backend:null}:{findDeck:a,reloadDecks:i,backend:O({url:r,anonKey:o,scoring:s})}}export{k as defaultSoloDeps};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/deps-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/deps-AJH7wiX7.js","assets/solo-backend-C3QJkkz_.js","assets/decks-ByuTg813.js","assets/decks-XbGFyNo9.js","assets/SoloCatalog-BQSbd-wT.js","assets/LeadForm-CEtFDKUS.js","assets/LeadForm-CcX9an89.css","assets/solo-8S92cge3.css","assets/SoloCatalog-BCqcjepQ.css","assets/SoloIntroView-T-Jpx0e3.js","assets/SoloLeaderboard-DpPQFmyt.js","assets/format-5Txm-oDf.js","assets/SoloLeaderboard-CZv7b2Vs.css","assets/SoloIntroView-tHv4f8e_.css","assets/SoloQuestionView-CcFu43-z.js","assets/SoloQuestionView-Cf0mhxPN.css","assets/SoloEndView-BUcP4RWT.js","assets/SoloEndView-C8NIAqeJ.css"])))=>i.map(i=>d[i]);
|
|
2
2
|
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(let c of r(i))!a.call(e,c)&&c!==o&&(s=n(i,c),t(e,c,{get:s&&s.get&&!s.configurable?s.get:()=>i[c],enumerable:!s||s.enumerable}));return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=globalThis||self;function d(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var f={},p=[],m=()=>{},h=()=>!1,g=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),_=e=>e.startsWith(`onUpdate:`),v=Object.assign,y=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},b=Object.prototype.hasOwnProperty,x=(e,t)=>b.call(e,t),S=Array.isArray,C=e=>ne(e)===`[object Map]`,w=e=>ne(e)===`[object Set]`,T=e=>ne(e)===`[object Date]`,E=e=>typeof e==`function`,D=e=>typeof e==`string`,O=e=>typeof e==`symbol`,k=e=>typeof e==`object`&&!!e,ee=e=>(k(e)||E(e))&&E(e.then)&&E(e.catch),te=Object.prototype.toString,ne=e=>te.call(e),re=e=>ne(e).slice(8,-1),ie=e=>ne(e)===`[object Object]`,A=e=>D(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,ae=d(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),oe=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},se=/-\w/g,ce=oe(e=>e.replace(se,e=>e.slice(1).toUpperCase())),j=/\B([A-Z])/g,M=oe(e=>e.replace(j,`-$1`).toLowerCase()),le=oe(e=>e.charAt(0).toUpperCase()+e.slice(1)),ue=oe(e=>e?`on${le(e)}`:``),de=(e,t)=>!Object.is(e,t),fe=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},pe=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},me=e=>{let t=parseFloat(e);return isNaN(t)?e:t},he=e=>{let t=D(e)?Number(e):NaN;return isNaN(t)?e:t},ge,_e=()=>ge||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:u===void 0?{}:u;function ve(e){if(S(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=D(r)?Se(r):ve(r);if(i)for(let e in i)t[e]=i[e]}return t}if(D(e)||k(e))return e}var ye=/;(?![^(]*\))/g,be=/:([^]+)/,xe=/\/\*[^]*?\*\//g;function Se(e){let t={};return e.replace(xe,``).split(ye).forEach(e=>{if(e){let n=e.split(be);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function N(e){let t=``;if(D(e))t=e;else if(S(e))for(let n=0;n<e.length;n++){let r=N(e[n]);r&&(t+=r+` `)}else if(k(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}var Ce=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,we=d(Ce);Ce+``;function Te(e){return!!e||e===``}function Ee(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=De(e[r],t[r]);return n}function De(e,t){if(e===t)return!0;let n=T(e),r=T(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=O(e),r=O(t),n||r)return e===t;if(n=S(e),r=S(t),n||r)return n&&r?Ee(e,t):!1;if(n=k(e),r=k(t),n||r){if(!n||!r||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e){let r=e.hasOwnProperty(n),i=t.hasOwnProperty(n);if(r&&!i||!r&&i||!De(e[n],t[n]))return!1}}return String(e)===String(t)}function Oe(e,t){return e.findIndex(e=>De(e,t))}var ke=e=>!!(e&&e.__v_isRef===!0),P=e=>D(e)?e:e==null?``:S(e)||k(e)&&(e.toString===te||!E(e.toString))?ke(e)?P(e.value):JSON.stringify(e,Ae,2):String(e),Ae=(e,t)=>ke(t)?Ae(e,t.value):C(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[je(t,r)+` =>`]=n,e),{})}:w(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>je(e))}:O(t)?je(t):k(t)&&!S(t)&&!ie(t)?String(t):t,je=(e,t=``)=>O(e)?`Symbol(${e.description??t})`:e,Me,Ne=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=Me,!e&&Me&&(this.index=(Me.scopes||(Me.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){let t=Me;try{return Me=this,e()}finally{Me=t}}}on(){++this._on===1&&(this.prevScope=Me,Me=this)}off(){this._on>0&&--this._on===0&&(Me=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}};function Pe(e){return new Ne(e)}function Fe(){return Me}function Ie(e,t=!1){Me&&Me.cleanups.push(e)}var F,Le=new WeakSet,Re=class{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Me&&Me.active&&Me.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Le.has(this)&&(Le.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||He(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,tt(this),Ge(this);let e=F,t=Ze;F=this,Ze=!0;try{return this.fn()}finally{Ke(this),F=e,Ze=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Ye(e);this.deps=this.depsTail=void 0,tt(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Le.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){qe(this)&&this.run()}get dirty(){return qe(this)}},ze=0,Be,Ve;function He(e,t=!1){e.flags|=8,t?(e.next=Ve,Ve=e):(e.next=Be,Be=e)}function Ue(){ze++}function We(){if(--ze>0)return;if(Ve){let e=Ve;for(Ve=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;Be;){let t=Be;for(Be=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function Ge(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ke(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),Ye(r),Xe(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function qe(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Je(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Je(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===nt)||(e.globalVersion=nt,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!qe(e))))return;e.flags|=2;let t=e.dep,n=F,r=Ze;F=e,Ze=!0;try{Ge(e);let n=e.fn(e._value);(t.version===0||de(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{F=n,Ze=r,Ke(e),e.flags&=-3}}function Ye(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)Ye(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Xe(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}var Ze=!0,Qe=[];function $e(){Qe.push(Ze),Ze=!1}function et(){let e=Qe.pop();Ze=e===void 0||e}function tt(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=F;F=void 0;try{t()}finally{F=e}}}var nt=0,rt=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},it=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!F||!Ze||F===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==F)t=this.activeLink=new rt(F,this),F.deps?(t.prevDep=F.depsTail,F.depsTail.nextDep=t,F.depsTail=t):F.deps=F.depsTail=t,at(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=F.depsTail,t.nextDep=void 0,F.depsTail.nextDep=t,F.depsTail=t,F.deps===t&&(F.deps=e)}return t}trigger(e){this.version++,nt++,this.notify(e)}notify(e){Ue();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{We()}}};function at(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)at(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}var ot=new WeakMap,st=Symbol(``),ct=Symbol(``),lt=Symbol(``);function ut(e,t,n){if(Ze&&F){let t=ot.get(e);t||ot.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new it),r.map=t,r.key=n),r.track()}}function dt(e,t,n,r,i,a){let o=ot.get(e);if(!o){nt++;return}let s=e=>{e&&e.trigger()};if(Ue(),t===`clear`)o.forEach(s);else{let i=S(e),a=i&&A(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===lt||!O(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(lt)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(st)),C(e)&&s(o.get(ct)));break;case`delete`:i||(s(o.get(st)),C(e)&&s(o.get(ct)));break;case`set`:C(e)&&s(o.get(st))}}We()}function ft(e,t){let n=ot.get(e);return n&&n.get(t)}function pt(e){let t=I(e);return t===e?t:(ut(t,`iterate`,lt),$t(e)?t:t.map(nn))}function mt(e){return ut(e=I(e),`iterate`,lt),e}function ht(e,t){return Qt(e)?rn(Zt(e)?nn(t):t):nn(t)}var gt={__proto__:null,[Symbol.iterator](){return _t(this,Symbol.iterator,e=>ht(this,e))},concat(...e){return pt(this).concat(...e.map(e=>S(e)?pt(e):e))},entries(){return _t(this,`entries`,e=>(e[1]=ht(this,e[1]),e))},every(e,t){return yt(this,`every`,e,t,void 0,arguments)},filter(e,t){return yt(this,`filter`,e,t,e=>e.map(e=>ht(this,e)),arguments)},find(e,t){return yt(this,`find`,e,t,e=>ht(this,e),arguments)},findIndex(e,t){return yt(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return yt(this,`findLast`,e,t,e=>ht(this,e),arguments)},findLastIndex(e,t){return yt(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return yt(this,`forEach`,e,t,void 0,arguments)},includes(...e){return xt(this,`includes`,e)},indexOf(...e){return xt(this,`indexOf`,e)},join(e){return pt(this).join(e)},lastIndexOf(...e){return xt(this,`lastIndexOf`,e)},map(e,t){return yt(this,`map`,e,t,void 0,arguments)},pop(){return St(this,`pop`)},push(...e){return St(this,`push`,e)},reduce(e,...t){return bt(this,`reduce`,e,t)},reduceRight(e,...t){return bt(this,`reduceRight`,e,t)},shift(){return St(this,`shift`)},some(e,t){return yt(this,`some`,e,t,void 0,arguments)},splice(...e){return St(this,`splice`,e)},toReversed(){return pt(this).toReversed()},toSorted(e){return pt(this).toSorted(e)},toSpliced(...e){return pt(this).toSpliced(...e)},unshift(...e){return St(this,`unshift`,e)},values(){return _t(this,`values`,e=>ht(this,e))}};function _t(e,t,n){let r=mt(e),i=r[t]();return r!==e&&!$t(e)&&(i._next=i.next,i.next=()=>{let e=i._next();return e.done||(e.value=n(e.value)),e}),i}var vt=Array.prototype;function yt(e,t,n,r,i,a){let o=mt(e),s=o!==e&&!$t(e),c=o[t];if(c!==vt[t]){let t=c.apply(e,a);return s?nn(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,ht(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function bt(e,t,n,r){let i=mt(e),a=i!==e&&!$t(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=ht(e,t)),n.call(this,t,ht(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?ht(e,c):c}function xt(e,t,n){let r=I(e);ut(r,`iterate`,lt);let i=r[t](...n);return(i===-1||i===!1)&&en(n[0])?(n[0]=I(n[0]),r[t](...n)):i}function St(e,t,n=[]){$e(),Ue();let r=I(e)[t].apply(e,n);return We(),et(),r}var Ct=d(`__proto__,__v_isRef,__isVue`),wt=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(O));function Tt(e){O(e)||(e=String(e));let t=I(this);return ut(t,`has`,e),t.hasOwnProperty(e)}var Et=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?Wt:Ut:i?Ht:Vt).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=S(e);if(!r){let e;if(a&&(e=gt[t]))return e;if(t===`hasOwnProperty`)return Tt}let o=Reflect.get(e,t,L(e)?e:n);if((O(t)?wt.has(t):Ct(t))||(r||ut(e,`get`,t),i))return o;if(L(o)){let e=a&&A(t)?o:o.value;return r&&k(e)?Yt(e):e}return k(o)?r?Yt(o):qt(o):o}},Dt=class extends Et{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=S(e)&&A(t);if(!this._isShallow){let e=Qt(i);if(!$t(n)&&!Qt(n)&&(i=I(i),n=I(n)),!a&&L(i)&&!L(n))return e||(i.value=n),!0}let o=a?Number(t)<e.length:x(e,t),s=Reflect.set(e,t,n,L(e)?e:r);return e===I(r)&&(o?de(n,i)&&dt(e,`set`,t,n,i):dt(e,`add`,t,n)),s}deleteProperty(e,t){let n=x(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&dt(e,`delete`,t,void 0,r),i}has(e,t){let n=Reflect.has(e,t);return O(t)&&wt.has(t)||ut(e,`has`,t),n}ownKeys(e){return ut(e,`iterate`,S(e)?`length`:st),Reflect.ownKeys(e)}},Ot=class extends Et{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}},kt=new Dt,At=new Ot,jt=new Dt(!0),Mt=e=>e,Nt=e=>Reflect.getPrototypeOf(e);function Pt(e,t,n){return function(...r){let i=this.__v_raw,a=I(i),o=C(a),s=e===`entries`||e===Symbol.iterator&&o,c=e===`keys`&&o,l=i[e](...r),u=n?Mt:t?rn:nn;return!t&&ut(a,`iterate`,c?ct:st),v(Object.create(l),{next(){let{value:e,done:t}=l.next();return t?{value:e,done:t}:{value:s?[u(e[0]),u(e[1])]:u(e),done:t}}})}}function Ft(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function It(e,t){let n={get(n){let r=this.__v_raw,i=I(r),a=I(n);e||(de(n,a)&&ut(i,`get`,n),ut(i,`get`,a));let{has:o}=Nt(i),s=t?Mt:e?rn:nn;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&ut(I(t),`iterate`,st),t.size},has(t){let n=this.__v_raw,r=I(n),i=I(t);return e||(de(t,i)&&ut(r,`has`,t),ut(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=I(a),s=t?Mt:e?rn:nn;return!e&&ut(o,`iterate`,st),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return v(n,e?{add:Ft(`add`),set:Ft(`set`),delete:Ft(`delete`),clear:Ft(`clear`)}:{add(e){let n=I(this),r=Nt(n),i=I(e),a=!t&&!$t(e)&&!Qt(e)?i:e;return r.has.call(n,a)||de(e,a)&&r.has.call(n,e)||de(i,a)&&r.has.call(n,i)||(n.add(a),dt(n,`add`,a,a)),this},set(e,n){t||$t(n)||Qt(n)||(n=I(n));let r=I(this),{has:i,get:a}=Nt(r),o=i.call(r,e);o||=(e=I(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?de(n,s)&&dt(r,`set`,e,n,s):dt(r,`add`,e,n),this},delete(e){let t=I(this),{has:n,get:r}=Nt(t),i=n.call(t,e);i||=(e=I(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&dt(t,`delete`,e,void 0,a),o},clear(){let e=I(this),t=e.size!==0,n=e.clear();return t&&dt(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=Pt(r,e,t)}),n}function Lt(e,t){let n=It(e,t);return(t,r,i)=>r===`__v_isReactive`?!e:r===`__v_isReadonly`?e:r===`__v_raw`?t:Reflect.get(x(n,r)&&r in t?n:t,r,i)}var Rt={get:Lt(!1,!1)},zt={get:Lt(!1,!0)},Bt={get:Lt(!0,!1)},Vt=new WeakMap,Ht=new WeakMap,Ut=new WeakMap,Wt=new WeakMap;function Gt(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function Kt(e){return e.__v_skip||!Object.isExtensible(e)?0:Gt(re(e))}function qt(e){return Qt(e)?e:Xt(e,!1,kt,Rt,Vt)}function Jt(e){return Xt(e,!1,jt,zt,Ht)}function Yt(e){return Xt(e,!0,At,Bt,Ut)}function Xt(e,t,n,r,i){if(!k(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;let a=Kt(e);if(a===0)return e;let o=i.get(e);if(o)return o;let s=new Proxy(e,a===2?r:n);return i.set(e,s),s}function Zt(e){return Qt(e)?Zt(e.__v_raw):!!(e&&e.__v_isReactive)}function Qt(e){return!!(e&&e.__v_isReadonly)}function $t(e){return!!(e&&e.__v_isShallow)}function en(e){return e?!!e.__v_raw:!1}function I(e){let t=e&&e.__v_raw;return t?I(t):e}function tn(e){return!x(e,`__v_skip`)&&Object.isExtensible(e)&&pe(e,`__v_skip`,!0),e}var nn=e=>k(e)?qt(e):e,rn=e=>k(e)?Yt(e):e;function L(e){return e?e.__v_isRef===!0:!1}function R(e){return on(e,!1)}function an(e){return on(e,!0)}function on(e,t){return L(e)?e:new sn(e,t)}var sn=class{constructor(e,t){this.dep=new it,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:I(e),this._value=t?e:nn(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||$t(e)||Qt(e);e=n?e:I(e),de(e,t)&&(this._rawValue=e,this._value=n?e:nn(e),this.dep.trigger())}};function cn(e){e.dep&&e.dep.trigger()}function z(e){return L(e)?e.value:e}var ln={get:(e,t,n)=>t===`__v_raw`?e:z(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return L(i)&&!L(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function un(e){return Zt(e)?e:new Proxy(e,ln)}function dn(e){let t=S(e)?Array(e.length):{};for(let n in e)t[n]=pn(e,n);return t}var fn=class{constructor(e,t,n){this._object=e,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0,this._key=O(t)?t:String(t),this._raw=I(e);let r=!0,i=e;if(!S(e)||O(this._key)||!A(this._key))do r=!en(i)||$t(i);while(r&&(i=i.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=z(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&L(this._raw[this._key])){let t=this._object[this._key];if(L(t)){t.value=e;return}}this._object[this._key]=e}get dep(){return ft(this._raw,this._key)}};function pn(e,t,n){return new fn(e,t,n)}var mn=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new it(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=nt-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&F!==this)return He(this,!0),!0}get value(){let e=this.dep.track();return Je(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}};function hn(e,t,n=!1){let r,i;return E(e)?r=e:(r=e.get,i=e.set),new mn(r,i,n)}var gn={},_n=new WeakMap,vn=void 0;function yn(e,t=!1,n=vn){if(n){let t=_n.get(n);t||_n.set(n,t=[]),t.push(e)}}function bn(e,t,n=f){let{immediate:r,deep:i,once:a,scheduler:o,augmentJob:s,call:c}=n,l=e=>i?e:$t(e)||i===!1||i===0?xn(e,1):xn(e),u,d,p,h,g=!1,_=!1;if(L(e)?(d=()=>e.value,g=$t(e)):Zt(e)?(d=()=>l(e),g=!0):S(e)?(_=!0,g=e.some(e=>Zt(e)||$t(e)),d=()=>e.map(e=>{if(L(e))return e.value;if(Zt(e))return l(e);if(E(e))return c?c(e,2):e()})):d=E(e)?t?c?()=>c(e,2):e:()=>{if(p){$e();try{p()}finally{et()}}let t=vn;vn=u;try{return c?c(e,3,[h]):e(h)}finally{vn=t}}:m,t&&i){let e=d,t=i===!0?1/0:i;d=()=>xn(e(),t)}let v=Fe(),b=()=>{u.stop(),v&&v.active&&y(v.effects,u)};if(a&&t){let e=t;t=(...t)=>{e(...t),b()}}let x=_?Array(e.length).fill(gn):gn,C=e=>{if(u.flags&1&&(u.dirty||e)){if(t){let e=u.run();if(i||g||(_?e.some((e,t)=>de(e,x[t])):de(e,x))){p&&p();let n=vn;vn=u;try{let n=[e,x===gn?void 0:_&&x[0]===gn?[]:x,h];x=e,c?c(t,3,n):t(...n)}finally{vn=n}}}else u.run()}};return s&&s(C),u=new Re(d),u.scheduler=o?()=>o(C,!1):C,h=e=>yn(e,!1,u),p=u.onStop=()=>{let e=_n.get(u);if(e){if(c)c(e,4);else for(let t of e)t();_n.delete(u)}},t?r?C(!0):x=u.run():o?o(C.bind(null,!0),!0):u.run(),b.pause=u.pause.bind(u),b.resume=u.resume.bind(u),b.stop=b,b}function xn(e,t=1/0,n){if(t<=0||!k(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,L(e))xn(e.value,t,n);else if(S(e))for(let r=0;r<e.length;r++)xn(e[r],t,n);else if(w(e)||C(e))e.forEach(e=>{xn(e,t,n)});else if(ie(e)){for(let r in e)xn(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&xn(e[r],t,n)}return e}function Sn(e,t,n,r){try{return r?e(...r):e()}catch(e){wn(e,t,n)}}function Cn(e,t,n,r){if(E(e)){let i=Sn(e,t,n,r);return i&&ee(i)&&i.catch(e=>{wn(e,t,n)}),i}if(S(e)){let i=[];for(let a=0;a<e.length;a++)i.push(Cn(e[a],t,n,r));return i}}function wn(e,t,n,r=!0){let i=t?t.vnode:null,{errorHandler:a,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||f;if(t){let r=t.parent,i=t.proxy,o=`https://vuejs.org/error-reference/#runtime-${n}`;for(;r;){let t=r.ec;if(t){for(let n=0;n<t.length;n++)if(t[n](e,i,o)===!1)return}r=r.parent}if(a){$e(),Sn(a,null,10,[e,i,o]),et();return}}Tn(e,n,i,r,o)}function Tn(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}var En=[],Dn=-1,On=[],kn=null,An=0,jn=Promise.resolve(),Mn=null;function Nn(e){let t=Mn||jn;return e?t.then(this?e.bind(this):e):t}function Pn(e){let t=Dn+1,n=En.length;for(;t<n;){let r=t+n>>>1,i=En[r],a=Bn(i);a<e||a===e&&i.flags&2?t=r+1:n=r}return t}function Fn(e){if(!(e.flags&1)){let t=Bn(e),n=En[En.length-1];!n||!(e.flags&2)&&t>=Bn(n)?En.push(e):En.splice(Pn(t),0,e),e.flags|=1,In()}}function In(){Mn||=jn.then(Vn)}function Ln(e){S(e)?On.push(...e):kn&&e.id===-1?kn.splice(An+1,0,e):e.flags&1||(On.push(e),e.flags|=1),In()}function Rn(e,t,n=Dn+1){for(;n<En.length;n++){let t=En[n];if(t&&t.flags&2){if(e&&t.id!==e.uid)continue;En.splice(n,1),n--,t.flags&4&&(t.flags&=-2),t(),t.flags&4||(t.flags&=-2)}}}function zn(e){if(On.length){let e=[...new Set(On)].sort((e,t)=>Bn(e)-Bn(t));if(On.length=0,kn){kn.push(...e);return}for(kn=e,An=0;An<kn.length;An++){let e=kn[An];e.flags&4&&(e.flags&=-2),e.flags&8||e(),e.flags&=-2}kn=null,An=0}}var Bn=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Vn(e){try{for(Dn=0;Dn<En.length;Dn++){let e=En[Dn];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),Sn(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;Dn<En.length;Dn++){let e=En[Dn];e&&(e.flags&=-2)}Dn=-1,En.length=0,zn(e),Mn=null,(En.length||On.length)&&Vn(e)}}var Hn=null,Un=null;function Wn(e){let t=Hn;return Hn=e,Un=e&&e.type.__scopeId||null,t}function Gn(e,t=Hn,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&ga(-1);let i=Wn(t),a;try{a=e(...n)}finally{Wn(i),r._d&&ga(1)}return a};return r._n=!0,r._c=!0,r._d=!0,r}function Kn(e,t){if(Hn===null)return e;let n=Ya(Hn),r=e.dirs||=[];for(let e=0;e<t.length;e++){let[i,a,o,s=f]=t[e];i&&(E(i)&&(i={mounted:i,updated:i}),i.deep&&xn(a),r.push({dir:i,instance:n,value:a,oldValue:void 0,arg:o,modifiers:s}))}return e}function qn(e,t,n,r){let i=e.dirs,a=t&&t.dirs;for(let o=0;o<i.length;o++){let s=i[o];a&&(s.oldValue=a[o].value);let c=s.dir[r];c&&($e(),Cn(c,n,8,[e.el,s,e,t]),et())}}function Jn(e,t){if(Fa){let n=Fa.provides,r=Fa.parent&&Fa.parent.provides;r===n&&(n=Fa.provides=Object.create(r)),n[e]=t}}function Yn(e,t,n=!1){let r=Ia();if(r||yi){let i=yi?yi._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&E(t)?t.call(r&&r.proxy):t}}function Xn(){return!!(Ia()||yi)}var Zn=Symbol.for(`v-scx`),Qn=()=>Yn(Zn);function $n(e,t,n){return er(e,t,n)}function er(e,t,n=f){let{immediate:r,deep:i,flush:a,once:o}=n,s=v({},n),c=t&&r||!t&&a!==`post`,l;if(Ha){if(a===`sync`){let e=Qn();l=e.__watcherHandles||=[]}else if(!c){let e=()=>{};return e.stop=m,e.resume=m,e.pause=m,e}}let u=Fa;s.call=(e,t,n)=>Cn(e,u,t,n);let d=!1;a===`post`?s.scheduler=e=>{Xi(e,u&&u.suspense)}:a!==`sync`&&(d=!0,s.scheduler=(e,t)=>{t?e():Fn(e)}),s.augmentJob=e=>{t&&(e.flags|=4),d&&(e.flags|=2,u&&(e.id=u.uid,e.i=u))};let p=bn(e,t,s);return Ha&&(l?l.push(p):c&&p()),p}function tr(e,t,n){let r=this.proxy,i=D(e)?e.includes(`.`)?nr(r,e):()=>r[e]:e.bind(r,r),a;E(t)?a=t:(a=t.handler,n=t);let o=za(this),s=er(i,a.bind(r),n);return o(),s}function nr(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}var rr=Symbol(`_vte`),ir=e=>e.__isTeleport,ar=Symbol(`_leaveCb`),or=Symbol(`_enterCb`);function sr(){let e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return zr(()=>{e.isMounted=!0}),Hr(()=>{e.isUnmounting=!0}),e}var cr=[Function,Array],lr={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:cr,onEnter:cr,onAfterEnter:cr,onEnterCancelled:cr,onBeforeLeave:cr,onLeave:cr,onAfterLeave:cr,onLeaveCancelled:cr,onBeforeAppear:cr,onAppear:cr,onAfterAppear:cr,onAppearCancelled:cr},ur=e=>{let t=e.subTree;return t.component?ur(t.component):t},dr={name:`BaseTransition`,props:lr,setup(e,{slots:t}){let n=Ia(),r=sr();return()=>{let i=t.default&&yr(t.default(),!0);if(!i||!i.length)return;let a=fr(i),o=I(e),{mode:s}=o;if(r.isLeaving)return gr(a);let c=_r(a);if(!c)return gr(a);let l=hr(c,o,r,n,e=>l=e);c.type!==ua&&vr(c,l);let u=n.subTree&&_r(n.subTree);if(u&&u.type!==ua&&!ba(u,c)&&ur(n).type!==ua){let e=hr(u,o,r,n);if(vr(u,e),s===`out-in`&&c.type!==ua)return r.isLeaving=!0,e.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete e.afterLeave,u=void 0},gr(a);s===`in-out`&&c.type!==ua?e.delayLeave=(e,t,n)=>{let i=mr(r,u);i[String(u.key)]=u,e[ar]=()=>{t(),e[ar]=void 0,delete l.delayedLeave,u=void 0},l.delayedLeave=()=>{n(),delete l.delayedLeave,u=void 0}}:u=void 0}else u&&=void 0;return a}}};function fr(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==ua){t=n;break}}return t}var pr=dr;function mr(e,t){let{leavingVNodes:n}=e,r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function hr(e,t,n,r,i){let{appear:a,mode:o,persisted:s=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:p,onAfterLeave:m,onLeaveCancelled:h,onBeforeAppear:g,onAppear:_,onAfterAppear:v,onAppearCancelled:y}=t,b=String(e.key),x=mr(n,e),C=(e,t)=>{e&&Cn(e,r,9,t)},w=(e,t)=>{let n=t[1];C(e,t),S(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},T={mode:o,persisted:s,beforeEnter(t){let r=c;if(!n.isMounted){if(a)r=g||c;else return}t[ar]&&t[ar](!0);let i=x[b];i&&ba(e,i)&&i.el[ar]&&i.el[ar](),C(r,[t])},enter(t){if(x[b]===e)return;let r=l,i=u,o=d;if(!n.isMounted){if(a)r=_||l,i=v||u,o=y||d;else return}let s=!1;t[or]=e=>{s||(s=!0,C(e?o:i,[t]),T.delayedLeave&&T.delayedLeave(),t[or]=void 0)};let c=t[or].bind(null,!1);r?w(r,[t,c]):c()},leave(t,r){let i=String(e.key);if(t[or]&&t[or](!0),n.isUnmounting)return r();C(f,[t]);let a=!1;t[ar]=n=>{a||(a=!0,r(),C(n?h:m,[t]),t[ar]=void 0,x[i]===e&&delete x[i])};let o=t[ar].bind(null,!1);x[i]=e,p?w(p,[t,o]):o()},clone(e){let a=hr(e,t,n,r,i);return i&&i(a),a}};return T}function gr(e){if(jr(e))return e=Ta(e),e.children=null,e}function _r(e){if(!jr(e))return ir(e.type)&&e.children?fr(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&E(n.default))return n.default()}}function vr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,vr(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function yr(e,t=!1,n){let r=[],i=0;for(let a=0;a<e.length;a++){let o=e[a],s=n==null?o.key:String(n)+String(o.key==null?a:o.key);o.type===B?(o.patchFlag&128&&i++,r=r.concat(yr(o.children,t,s))):(t||o.type!==ua)&&r.push(s==null?o:Ta(o,{key:s}))}if(i>1)for(let e=0;e<r.length;e++)r[e].patchFlag=-2;return r}function br(e,t){return E(e)?v({name:e.name},t,{setup:e}):e}function xr(e){e.ids=[e.ids[0]+e.ids[2]+++`-`,0,0]}function Sr(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}var Cr=new WeakMap;function wr(e,t,n,r,i=!1){if(S(e)){e.forEach((e,a)=>wr(e,t&&(S(t)?t[a]:t),n,r,i));return}if(Or(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&wr(e,t,n,r.component.subTree);return}let a=r.shapeFlag&4?Ya(r.component):r.el,o=i?null:a,{i:s,r:c}=e,l=t&&t.r,u=s.refs===f?s.refs={}:s.refs,d=s.setupState,p=I(d),m=d===f?h:e=>!Sr(u,e)&&x(p,e),g=(e,t)=>!(t&&Sr(u,t));if(l!=null&&l!==c){if(Tr(t),D(l))u[l]=null,m(l)&&(d[l]=null);else if(L(l)){let e=t;g(l,e.k)&&(l.value=null),e.k&&(u[e.k]=null)}}if(E(c))Sn(c,s,12,[o,u]);else{let t=D(c),r=L(c);if(t||r){let s=()=>{if(e.f){let n=t?m(c)?d[c]:u[c]:g(c)||!e.k?c.value:u[e.k];if(i)S(n)&&y(n,a);else if(S(n))n.includes(a)||n.push(a);else if(t)u[c]=[a],m(c)&&(d[c]=u[c]);else{let t=[a];g(c,e.k)&&(c.value=t),e.k&&(u[e.k]=t)}}else t?(u[c]=o,m(c)&&(d[c]=o)):r&&(g(c,e.k)&&(c.value=o),e.k&&(u[e.k]=o))};if(o){let t=()=>{s(),Cr.delete(e)};t.id=-1,Cr.set(e,t),Xi(t,n)}else Tr(e),s()}}}function Tr(e){let t=Cr.get(e);t&&(t.flags|=8,Cr.delete(e))}var Er=e=>e.nodeType===8;_e().requestIdleCallback,_e().cancelIdleCallback;function Dr(e,t){if(Er(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(Er(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Or=e=>!!e.type.__asyncLoader;function kr(e){E(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return br({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=!1;(t.bu||=[]).push(()=>r=!0);let i=()=>{r||n()},o=a?()=>{let n=a(i,t=>Dr(e,t));n&&(t.bum||=[]).push(n)}:i;u?o():p().then(()=>!t.isUnmounted&&o())},get __asyncResolved(){return u},setup(){let e=Fa;if(xr(e),u)return()=>Ar(u,e);let t=t=>{l=null,wn(t,e,13,!r)};if(s&&e.suspense||Ha)return p().then(t=>()=>Ar(t,e)).catch(e=>(t(e),()=>r?W(r,{error:e}):null));let a=R(!1),c=R(),d=R(!!i);return i&&setTimeout(()=>{d.value=!1},i),o!=null&&setTimeout(()=>{if(!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o),p().then(()=>{a.value=!0,e.parent&&jr(e.parent.vnode)&&e.parent.update()}).catch(e=>{t(e),c.value=e}),()=>{if(a.value&&u)return Ar(u,e);if(c.value&&r)return W(r,{error:c.value});if(n&&!d.value)return Ar(n,e)}}})}function Ar(e,t){let{ref:n,props:r,children:i,ce:a}=t.vnode,o=W(e,r,i);return o.ref=n,o.ce=a,delete t.vnode.ce,o}var jr=e=>e.type.__isKeepAlive;function Mr(e,t){Pr(e,`a`,t)}function Nr(e,t){Pr(e,`da`,t)}function Pr(e,t,n=Fa){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(Ir(t,r,n),n){let e=n.parent;for(;e&&e.parent;)jr(e.parent.vnode)&&Fr(r,t,n,e),e=e.parent}}function Fr(e,t,n,r){let i=Ir(t,e,r,!0);Ur(()=>{y(r[t],i)},n)}function Ir(e,t,n=Fa,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{$e();let i=za(n),a=Cn(t,n,e,r);return i(),et(),a};return r?i.unshift(a):i.push(a),a}}var Lr=e=>(t,n=Fa)=>{Ha&&e!==`sp`||Ir(e,(...e)=>t(...e),n)},Rr=Lr(`bm`),zr=Lr(`m`),Br=Lr(`bu`),Vr=Lr(`u`),Hr=Lr(`bum`),Ur=Lr(`um`),Wr=Lr(`sp`),Gr=Lr(`rtg`),Kr=Lr(`rtc`);function qr(e,t=Fa){Ir(`ec`,e,t)}var Jr=Symbol.for(`v-ndc`);function Yr(e,t,n,r){let i,a=n&&n[r],o=S(e);if(o||D(e)){let n=o&&Zt(e),r=!1,s=!1;n&&(r=!$t(e),s=Qt(e),e=mt(e)),i=Array(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=t(r?s?rn(nn(e[n])):nn(e[n]):e[n],n,void 0,a&&a[n])}else if(typeof e==`number`){i=Array(e);for(let n=0;n<e;n++)i[n]=t(n+1,n,void 0,a&&a[n])}else if(k(e)){if(e[Symbol.iterator])i=Array.from(e,(e,n)=>t(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;r<o;r++){let o=n[r];i[r]=t(e[o],o,r,a&&a[r])}}}else i=[];return n&&(n[r]=i),i}var Xr=e=>e?Va(e)?Ya(e):Xr(e.parent):null,Zr=v(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Xr(e.parent),$root:e=>Xr(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>oi(e),$forceUpdate:e=>e.f||=()=>{Fn(e.update)},$nextTick:e=>e.n||=Nn.bind(e.proxy),$watch:e=>tr.bind(e)}),Qr=(e,t)=>e!==f&&!e.__isScriptSetup&&x(e,t),$r={get({_:e},t){if(t===`__v_skip`)return!0;let{ctx:n,setupState:r,data:i,props:a,accessCache:o,type:s,appContext:c}=e;if(t[0]!==`$`){let e=o[t];if(e!==void 0)switch(e){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return a[t]}else if(Qr(r,t))return o[t]=1,r[t];else if(i!==f&&x(i,t))return o[t]=2,i[t];else if(x(a,t))return o[t]=3,a[t];else if(n!==f&&x(n,t))return o[t]=4,n[t];else ti&&(o[t]=0)}let l=Zr[t],u,d;if(l)return t===`$attrs`&&ut(e.attrs,`get`,``),l(e);if((u=s.__cssModules)&&(u=u[t]))return u;if(n!==f&&x(n,t))return o[t]=4,n[t];if(d=c.config.globalProperties,x(d,t))return d[t]},set({_:e},t,n){let{data:r,setupState:i,ctx:a}=e;return Qr(i,t)?(i[t]=n,!0):r!==f&&x(r,t)?(r[t]=n,!0):x(e.props,t)||t[0]===`$`&&t.slice(1)in e?!1:(a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,props:a,type:o}},s){let c;return!!(n[s]||e!==f&&s[0]!==`$`&&x(e,s)||Qr(t,s)||x(a,s)||x(r,s)||x(Zr,s)||x(i.config.globalProperties,s)||(c=o.__cssModules)&&c[s])},defineProperty(e,t,n){return n.get==null?x(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}};function ei(e){return S(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}var ti=!0;function ni(e){let t=oi(e),n=e.proxy,r=e.ctx;ti=!1,t.beforeCreate&&ii(t.beforeCreate,e,`bc`);let{data:i,computed:a,methods:o,watch:s,provide:c,inject:l,created:u,beforeMount:d,mounted:f,beforeUpdate:p,updated:h,activated:g,deactivated:_,beforeDestroy:v,beforeUnmount:y,destroyed:b,unmounted:x,render:C,renderTracked:w,renderTriggered:T,errorCaptured:D,serverPrefetch:O,expose:ee,inheritAttrs:te,components:ne,directives:re,filters:ie}=t;if(l&&ri(l,r,null),o)for(let e in o){let t=o[e];E(t)&&(r[e]=t.bind(n))}if(i){let t=i.call(n,n);k(t)&&(e.data=qt(t))}if(ti=!0,a)for(let e in a){let t=a[e],i=K({get:E(t)?t.bind(n,n):E(t.get)?t.get.bind(n,n):m,set:!E(t)&&E(t.set)?t.set.bind(n):m});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e})}if(s)for(let e in s)ai(s[e],r,n,e);if(c){let e=E(c)?c.call(n):c;Reflect.ownKeys(e).forEach(t=>{Jn(t,e[t])})}u&&ii(u,e,`c`);function A(e,t){S(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(A(Rr,d),A(zr,f),A(Br,p),A(Vr,h),A(Mr,g),A(Nr,_),A(qr,D),A(Kr,w),A(Gr,T),A(Hr,y),A(Ur,x),A(Wr,O),S(ee)){if(ee.length){let t=e.exposed||={};ee.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={}}C&&e.render===m&&(e.render=C),te!=null&&(e.inheritAttrs=te),ne&&(e.components=ne),re&&(e.directives=re),O&&xr(e)}function ri(e,t,n=m){S(e)&&(e=di(e));for(let n in e){let r=e[n],i;i=k(r)?`default`in r?Yn(r.from||n,r.default,!0):Yn(r.from||n):Yn(r),L(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function ii(e,t,n){Cn(S(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function ai(e,t,n,r){let i=r.includes(`.`)?nr(n,r):()=>n[r];if(D(e)){let n=t[e];E(n)&&$n(i,n)}else if(E(e))$n(i,e.bind(n));else if(k(e)){if(S(e))e.forEach(e=>ai(e,t,n,r));else{let r=E(e.handler)?e.handler.bind(n):t[e.handler];E(r)&&$n(i,r,e)}}}function oi(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>si(c,e,o,!0)),si(c,t,o)),k(t)&&a.set(t,c),c}function si(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&si(e,a,n,!0),i&&i.forEach(t=>si(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=ci[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var ci={data:li,props:mi,emits:mi,methods:pi,computed:pi,beforeCreate:fi,created:fi,beforeMount:fi,mounted:fi,beforeUpdate:fi,updated:fi,beforeDestroy:fi,beforeUnmount:fi,destroyed:fi,unmounted:fi,activated:fi,deactivated:fi,errorCaptured:fi,serverPrefetch:fi,components:pi,directives:pi,watch:hi,provide:li,inject:ui};function li(e,t){return t?e?function(){return v(E(e)?e.call(this,this):e,E(t)?t.call(this,this):t)}:t:e}function ui(e,t){return pi(di(e),di(t))}function di(e){if(S(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function fi(e,t){return e?[...new Set([].concat(e,t))]:t}function pi(e,t){return e?v(Object.create(null),e,t):t}function mi(e,t){return e?S(e)&&S(t)?[...new Set([...e,...t])]:v(Object.create(null),ei(e),ei(t??{})):t}function hi(e,t){if(!e)return t;if(!t)return e;let n=v(Object.create(null),e);for(let r in t)n[r]=fi(e[r],t[r]);return n}function gi(){return{app:null,config:{isNativeTag:h,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}var _i=0;function vi(e,t){return function(n,r=null){E(n)||(n=v({},n)),r!=null&&!k(r)&&(r=null);let i=gi(),a=new WeakSet,o=[],s=!1,c=i.app={_uid:_i++,_component:n,_props:r,_container:null,_context:i,_instance:null,version:Qa,get config(){return i.config},set config(e){},use(e,...t){return a.has(e)||(e&&E(e.install)?(a.add(e),e.install(c,...t)):E(e)&&(a.add(e),e(c,...t))),c},mixin(e){return i.mixins.includes(e)||i.mixins.push(e),c},component(e,t){return t?(i.components[e]=t,c):i.components[e]},directive(e,t){return t?(i.directives[e]=t,c):i.directives[e]},mount(a,o,l){if(!s){let u=c._ceVNode||W(n,r);return u.appContext=i,l===!0?l=`svg`:l===!1&&(l=void 0),o&&t?t(u,a):e(u,a,l),s=!0,c._container=a,a.__vue_app__=c,Ya(u.component)}},onUnmount(e){o.push(e)},unmount(){s&&(Cn(o,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(e,t){return i.provides[e]=t,c},runWithContext(e){let t=yi;yi=c;try{return e()}finally{yi=t}}};return c}}var yi=null,bi=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${ce(t)}Modifiers`]||e[`${M(t)}Modifiers`];function xi(e,t,...n){if(e.isUnmounted)return;let r=e.vnode.props||f,i=n,a=t.startsWith(`update:`),o=a&&bi(r,t.slice(7));o&&(o.trim&&(i=n.map(e=>D(e)?e.trim():e)),o.number&&(i=n.map(me)));let s,c=r[s=ue(t)]||r[s=ue(ce(t))];!c&&a&&(c=r[s=ue(M(t))]),c&&Cn(c,e,6,i);let l=r[s+`Once`];if(l){if(!e.emitted)e.emitted={};else if(e.emitted[s])return;e.emitted[s]=!0,Cn(l,e,6,i)}}var Si=new WeakMap;function Ci(e,t,n=!1){let r=n?Si:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},s=!1;if(!E(e)){let r=e=>{let n=Ci(e,t,!0);n&&(s=!0,v(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!s?(k(e)&&r.set(e,null),null):(S(a)?a.forEach(e=>o[e]=null):v(o,a),k(e)&&r.set(e,o),o)}function wi(e,t){return!e||!g(t)?!1:(t=t.slice(2).replace(/Once$/,``),x(e,t[0].toLowerCase()+t.slice(1))||x(e,M(t))||x(e,t))}function Ti(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:o,attrs:s,emit:c,render:l,renderCache:u,props:d,data:f,setupState:p,ctx:m,inheritAttrs:h}=e,g=Wn(e),v,y;try{if(n.shapeFlag&4){let e=i||r,t=e;v=Da(l.call(t,e,u,d,p,f,m)),y=s}else{let e=t;v=Da(e.length>1?e(d,{attrs:s,slots:o,emit:c}):e(d,null)),y=t.props?s:Ei(s)}}catch(t){fa.length=0,wn(t,e,1),v=W(ua)}let b=v;if(y&&h!==!1){let e=Object.keys(y),{shapeFlag:t}=b;e.length&&t&7&&(a&&e.some(_)&&(y=Di(y,a)),b=Ta(b,y,!1,!0))}return n.dirs&&(b=Ta(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&vr(b,n.transition),v=b,Wn(g),v}var Ei=e=>{let t;for(let n in e)(n===`class`||n===`style`||g(n))&&((t||={})[n]=e[n]);return t},Di=(e,t)=>{let n={};for(let r in e)_(r)&&r.slice(9)in t||(n[r]=e[r]);return n};function Oi(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?ki(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(Ai(o,r,n)&&!wi(l,n))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===o?!1:r?!o||ki(r,o,l):!!o;return!1}function ki(e,t,n){let r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){let a=r[i];if(Ai(t,e,a)&&!wi(n,a))return!0}return!1}function Ai(e,t,n){let r=e[n],i=t[n];return n===`style`&&k(r)&&k(i)?!De(r,i):r!==i}function ji({vnode:e,parent:t,suspense:n},r){for(;t;){let n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.suspense.vnode.el=n.el=r,e=n),n===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}var Mi={},Ni=()=>Object.create(Mi),Pi=e=>Object.getPrototypeOf(e)===Mi;function Fi(e,t,n,r=!1){let i={},a=Ni();e.propsDefaults=Object.create(null),Li(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);e.props=n?r?i:Jt(i):e.type.props?i:a,e.attrs=a}function Ii(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=I(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let o=n[r];if(wi(e.emitsOptions,o))continue;let u=t[o];if(c){if(x(a,o))u!==a[o]&&(a[o]=u,l=!0);else{let t=ce(o);i[t]=Ri(c,s,t,u,e,!1)}}else u!==a[o]&&(a[o]=u,l=!0)}}}else{Li(e,t,i,a)&&(l=!0);let r;for(let a in s)t&&(x(t,a)||(r=M(a))!==a&&x(t,r))||(c?n&&(n[a]!==void 0||n[r]!==void 0)&&(i[a]=Ri(c,s,a,void 0,e,!0)):delete i[a]);if(a!==s)for(let e in a)t&&x(t,e)||(delete a[e],l=!0)}l&&dt(e.attrs,`set`,``)}function Li(e,t,n,r){let[i,a]=e.propsOptions,o=!1,s;if(t)for(let c in t){if(ae(c))continue;let l=t[c],u;i&&x(i,u=ce(c))?!a||!a.includes(u)?n[u]=l:(s||={})[u]=l:wi(e.emitsOptions,c)||c in r&&l===r[c]||(r[c]=l,o=!0)}if(a){let t=I(n),r=s||f;for(let o=0;o<a.length;o++){let s=a[o];n[s]=Ri(i,t,s,r[s],e,!x(r,s))}}return o}function Ri(e,t,n,r,i,a){let o=e[n];if(o!=null){let e=x(o,`default`);if(e&&r===void 0){let e=o.default;if(o.type!==Function&&!o.skipFactory&&E(e)){let{propsDefaults:a}=i;if(n in a)r=a[n];else{let o=za(i);r=a[n]=e.call(null,t),o()}}else r=e;i.ce&&i.ce._setProp(n,r)}o[0]&&(a&&!e?r=!1:o[1]&&(r===``||r===M(n))&&(r=!0))}return r}var zi=new WeakMap;function Bi(e,t,n=!1){let r=n?zi:t.propsCache,i=r.get(e);if(i)return i;let a=e.props,o={},s=[],c=!1;if(!E(e)){let r=e=>{c=!0;let[n,r]=Bi(e,t,!0);v(o,n),r&&s.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!a&&!c)return k(e)&&r.set(e,p),p;if(S(a))for(let e=0;e<a.length;e++){let t=ce(a[e]);Vi(t)&&(o[t]=f)}else if(a)for(let e in a){let t=ce(e);if(Vi(t)){let n=a[e],r=o[t]=S(n)||E(n)?{type:n}:v({},n),i=r.type,c=!1,l=!0;if(S(i))for(let e=0;e<i.length;++e){let t=i[e],n=E(t)&&t.name;if(n===`Boolean`){c=!0;break}n===`String`&&(l=!1)}else c=E(i)&&i.name===`Boolean`;r[0]=c,r[1]=l,(c||x(r,`default`))&&s.push(t)}}let l=[o,s];return k(e)&&r.set(e,l),l}function Vi(e){return e[0]!==`$`&&!ae(e)}var Hi=e=>e===`_`||e===`_ctx`||e===`$stable`,Ui=e=>S(e)?e.map(Da):[Da(e)],Wi=(e,t,n)=>{if(t._n)return t;let r=Gn((...e)=>Ui(t(...e)),n);return r._c=!1,r},Gi=(e,t,n)=>{let r=e._ctx;for(let n in e){if(Hi(n))continue;let i=e[n];if(E(i))t[n]=Wi(n,i,r);else if(i!=null){let e=Ui(i);t[n]=()=>e}}},Ki=(e,t)=>{let n=Ui(t);e.slots.default=()=>n},qi=(e,t,n)=>{for(let r in t)(n||!Hi(r))&&(e[r]=t[r])},Ji=(e,t,n)=>{let r=e.slots=Ni();if(e.vnode.shapeFlag&32){let e=t._;e?(qi(r,t,n),n&&pe(r,`_`,e,!0)):Gi(t,r)}else t&&Ki(e,t)},Yi=(e,t,n)=>{let{vnode:r,slots:i}=e,a=!0,o=f;if(r.shapeFlag&32){let e=t._;e?n&&e===1?a=!1:qi(i,t,n):(a=!t.$stable,Gi(t,i)),o=t}else t&&(Ki(e,t),o={default:1});if(a)for(let e in i)!Hi(e)&&o[e]==null&&delete i[e]},Xi=ca;function Zi(e){return Qi(e)}function Qi(e,t){let n=_e();n.__VUE__=!0;let{insert:r,remove:i,patchProp:a,createElement:o,createText:s,createComment:c,setText:l,setElementText:u,parentNode:d,nextSibling:h,setScopeId:g=m,insertStaticContent:_}=e,v=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!ba(e,t)&&(r=he(e),le(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case la:y(e,t,n,r);break;case ua:b(e,t,n,r);break;case da:e??x(t,n,r,o);break;case B:te(e,t,n,r,i,a,o,s,c);break;default:d&1?w(e,t,n,r,i,a,o,s,c):d&6?ne(e,t,n,r,i,a,o,s,c):(d&64||d&128)&&l.process(e,t,n,r,i,a,o,s,c,ye)}u!=null&&i?wr(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&wr(e.ref,null,a,e,!0)},y=(e,t,n,i)=>{if(e==null)r(t.el=s(t.children),n,i);else{let n=t.el=e.el;t.children!==e.children&&l(n,t.children)}},b=(e,t,n,i)=>{e==null?r(t.el=c(t.children||``),n,i):t.el=e.el},x=(e,t,n,r)=>{[e.el,e.anchor]=_(e.children,t,n,r,e.el,e.anchor)},S=({el:e,anchor:t},n,i)=>{let a;for(;e&&e!==t;)a=h(e),r(e,n,i),e=a;r(t,n,i)},C=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),i(e),e=n;i(t)},w=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)T(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),O(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},T=(e,t,n,i,s,c,l,d)=>{let f,p,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(f=e.el=o(e.type,c,m&&m.is,m),h&8?u(f,e.children):h&16&&D(e.children,f,null,i,s,$i(e,c),l,d),_&&qn(e,null,i,`created`),E(f,e,e.scopeId,l,i),m){for(let e in m)e!==`value`&&!ae(e)&&a(f,e,null,m[e],c,i);`value`in m&&a(f,`value`,null,m.value,c),(p=m.onVnodeBeforeMount)&&ja(p,i,e)}_&&qn(e,null,i,`beforeMount`);let v=ta(s,g);v&&g.beforeEnter(f),r(f,t,n),((p=m&&m.onVnodeMounted)||v||_)&&Xi(()=>{try{p&&ja(p,i,e),v&&g.enter(f),_&&qn(e,null,i,`mounted`)}finally{}},s)},E=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t<r.length;t++)g(e,r[t]);if(i){let n=i.subTree;if(t===n||sa(n.type)&&(n.ssContent===t||n.ssFallback===t)){let t=i.vnode;E(e,t,t.scopeId,t.slotScopeIds,i.parent)}}},D=(e,t,n,r,i,a,o,s,c=0)=>{for(let l=c;l<e.length;l++){let c=e[l]=s?Oa(e[l]):Da(e[l]);v(null,c,t,n,r,i,a,o,s)}},O=(e,t,n,r,i,o,s)=>{let c=t.el=e.el,{patchFlag:l,dynamicChildren:d,dirs:p}=t;l|=e.patchFlag&16;let m=e.props||f,h=t.props||f,g;if(n&&ea(n,!1),(g=h.onVnodeBeforeUpdate)&&ja(g,n,t,e),p&&qn(t,e,n,`beforeUpdate`),n&&ea(n,!0),(m.innerHTML&&h.innerHTML==null||m.textContent&&h.textContent==null)&&u(c,``),d?k(e.dynamicChildren,d,c,n,r,$i(t,i),o):s||se(e,t,c,null,n,r,$i(t,i),o,!1),l>0){if(l&16)ee(c,m,h,n,i);else if(l&2&&m.class!==h.class&&a(c,`class`,null,h.class,i),l&4&&a(c,`style`,m.style,h.style,i),l&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let r=e[t],o=m[r],s=h[r];(s!==o||r===`value`)&&a(c,r,o,s,i,n)}}l&1&&e.children!==t.children&&u(c,t.children)}else!s&&d==null&&ee(c,m,h,n,i);((g=h.onVnodeUpdated)||p)&&Xi(()=>{g&&ja(g,n,t,e),p&&qn(t,e,n,`updated`)},r)},k=(e,t,n,r,i,a,o)=>{for(let s=0;s<t.length;s++){let c=e[s],l=t[s],u=c.el&&(c.type===B||!ba(c,l)||c.shapeFlag&198)?d(c.el):n;v(c,l,u,null,r,i,a,o,!0)}},ee=(e,t,n,r,i)=>{if(t!==n){if(t!==f)for(let o in t)!ae(o)&&!(o in n)&&a(e,o,t[o],null,i,r);for(let o in n){if(ae(o))continue;let s=n[o],c=t[o];s!==c&&o!==`value`&&a(e,o,c,s,i,r)}`value`in n&&a(e,`value`,t.value,n.value,i)}},te=(e,t,n,i,a,o,c,l,u)=>{let d=t.el=e?e.el:s(``),f=t.anchor=e?e.anchor:s(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(l=l?l.concat(h):h),e==null?(r(d,n,i),r(f,n,i),D(t.children||[],n,f,a,o,c,l,u)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(k(e.dynamicChildren,m,n,a,o,c,l),(t.key!=null||a&&t===a.subTree)&&na(e,t,!0)):se(e,t,n,f,a,o,c,l,u)},ne=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):re(t,n,r,i,a,o,c):ie(e,t,c)},re=(e,t,n,r,i,a,o)=>{let s=e.component=Pa(e,r,i);if(jr(e)&&(s.ctx.renderer=ye),Ua(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,A,o),!e.el){let r=s.subTree=W(ua);b(null,r,t,n),e.placeholder=r.el}}else A(s,e,t,n,i,a,o)},ie=(e,t,n)=>{let r=t.component=e.component;if(Oi(e,t,n)){if(r.asyncDep&&!r.asyncResolved){oe(r,t,n);return}r.next=t,r.update()}else t.el=e.el,r.vnode=t},A=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=ia(e);if(n){t&&(t.el=c.el,oe(e,t,o)),n.asyncDep.then(()=>{Xi(()=>{e.isUnmounted||l()},i)});return}}let u=t,f;ea(e,!1),t?(t.el=c.el,oe(e,t,o)):t=c,n&&fe(n),(f=t.props&&t.props.onVnodeBeforeUpdate)&&ja(f,s,t,c),ea(e,!0);let p=Ti(e),m=e.subTree;e.subTree=p,v(m,p,d(m.el),he(m),e,i,a),t.el=p.el,u===null&&ji(e,p.el),r&&Xi(r,i),(f=t.props&&t.props.onVnodeUpdated)&&Xi(()=>ja(f,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=Or(t);if(ea(e,!1),l&&fe(l),!m&&(o=c&&c.onVnodeBeforeMount)&&ja(o,d,t),ea(e,!0),s&&xe){let t=()=>{e.subTree=Ti(e),xe(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);let o=e.subTree=Ti(e);v(null,o,n,r,e,i,a),t.el=o.el}if(u&&Xi(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;Xi(()=>ja(o,d,e),i)}(t.shapeFlag&256||d&&Or(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&Xi(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new Re(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>Fn(u),ea(e,!0),l()},oe=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,Ii(e,t.props,r,n),Yi(e,t.children,n),$e(),Rn(e),et()},se=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,d=e?e.shapeFlag:0,f=t.children,{patchFlag:p,shapeFlag:m}=t;if(p>0){if(p&128){j(l,f,n,r,i,a,o,s,c);return}if(p&256){ce(l,f,n,r,i,a,o,s,c);return}}m&8?(d&16&&me(l,i,a),f!==l&&u(n,f)):d&16?m&16?j(l,f,n,r,i,a,o,s,c):me(l,i,a,!0):(d&8&&u(n,``),m&16&&D(f,n,r,i,a,o,s,c))},ce=(e,t,n,r,i,a,o,s,c)=>{e||=p,t||=p;let l=e.length,u=t.length,d=Math.min(l,u),f=0;for(;f<d;f++){let r=t[f]=c?Oa(t[f]):Da(t[f]);v(e[f],r,n,null,i,a,o,s,c)}l>u?me(e,i,a,!0,!1,d):D(t,n,r,i,a,o,s,c,d)},j=(e,t,n,r,i,a,o,s,c)=>{let l=0,u=t.length,d=e.length-1,f=u-1;for(;l<=d&&l<=f;){let r=e[l],u=t[l]=c?Oa(t[l]):Da(t[l]);if(ba(r,u))v(r,u,n,null,i,a,o,s,c);else break;l++}for(;l<=d&&l<=f;){let r=e[d],l=t[f]=c?Oa(t[f]):Da(t[f]);if(ba(r,l))v(r,l,n,null,i,a,o,s,c);else break;d--,f--}if(l>d){if(l<=f){let e=f+1,d=e<u?t[e].el:r;for(;l<=f;)v(null,t[l]=c?Oa(t[l]):Da(t[l]),n,d,i,a,o,s,c),l++}}else if(l>f)for(;l<=d;)le(e[l],i,a,!0),l++;else{let m=l,h=l,g=new Map;for(l=h;l<=f;l++){let e=t[l]=c?Oa(t[l]):Da(t[l]);e.key!=null&&g.set(e.key,l)}let _,y=0,b=f-h+1,x=!1,S=0,C=Array(b);for(l=0;l<b;l++)C[l]=0;for(l=m;l<=d;l++){let r=e[l];if(y>=b){le(r,i,a,!0);continue}let u;if(r.key!=null)u=g.get(r.key);else for(_=h;_<=f;_++)if(C[_-h]===0&&ba(r,t[_])){u=_;break}u===void 0?le(r,i,a,!0):(C[u-h]=l+1,u>=S?S=u:x=!0,v(r,t[u],n,null,i,a,o,s,c),y++)}let w=x?ra(C):p;for(_=w.length-1,l=b-1;l>=0;l--){let e=h+l,d=t[e],f=t[e+1],p=e+1<u?f.el||oa(f):r;C[l]===0?v(null,d,n,p,i,a,o,s,c):x&&(_<0||l!==w[_]?M(d,n,p,2):_--)}}},M=(e,t,n,a,o=null)=>{let{el:s,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6)M(e.component.subTree,t,n,a);else if(d&128)e.suspense.move(t,n,a);else if(d&64)c.move(e,t,n,ye);else if(c===B){r(s,t,n);for(let e=0;e<u.length;e++)M(u[e],t,n,a);r(e.anchor,t,n)}else if(c===da)S(e,t,n);else if(a!==2&&d&1&&l){if(a===0)l.beforeEnter(s),r(s,t,n),Xi(()=>l.enter(s),o);else{let{leave:a,delayLeave:o,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?i(s):r(s,t,n)},d=()=>{s._isLeaving&&s[ar](!0),a(s,()=>{u(),c&&c()})};o?o(s,u,d):d()}}else r(s,t,n)},le=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if(d===-2&&(i=!1),s!=null&&($e(),wr(s,null,n,e,!0),et()),p!=null&&(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let h=u&1&&f,g=!Or(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&ja(_,t,e),u&6)pe(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&qn(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,ye,r):l&&!l.hasOnce&&(a!==B||d>0&&d&64)?me(l,t,n,!1,!0):(a===B&&d&384||!i&&u&16)&&me(c,t,n),r&&ue(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&Xi(()=>{_&&ja(_,t,e),h&&qn(e,null,t,`unmounted`),v&&(e.el=null)},n)},ue=e=>{let{type:t,el:n,anchor:r,transition:a}=e;if(t===B){de(n,r);return}if(t===da){C(e);return}let o=()=>{i(n),a&&!a.persisted&&a.afterLeave&&a.afterLeave()};if(e.shapeFlag&1&&a&&!a.persisted){let{leave:t,delayLeave:r}=a,i=()=>t(n,o);r?r(e.el,o,i):i()}else o()},de=(e,t)=>{let n;for(;e!==t;)n=h(e),i(e),e=n;i(t)},pe=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;aa(c),aa(l),r&&fe(r),i.stop(),a&&(a.flags|=8,le(o,e,t,n)),s&&Xi(s,t),Xi(()=>{e.isUnmounted=!0},t)},me=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o<e.length;o++)le(e[o],t,n,r,i)},he=e=>{if(e.shapeFlag&6)return he(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=h(e.anchor||e.el),n=t&&t[rr];return n?h(n):t},ge=!1,ve=(e,t,n)=>{let r;e==null?t._vnode&&(le(t._vnode,null,null,!0),r=t._vnode.component):v(t._vnode||null,e,t,null,null,null,n),t._vnode=e,ge||=(ge=!0,Rn(r),zn(),!1)},ye={p:v,um:le,m:M,r:ue,mt:re,mc:D,pc:se,pbc:k,n:he,o:e},be,xe;return t&&([be,xe]=t(ye)),{render:ve,hydrate:be,createApp:vi(ve,be)}}function $i({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function ea({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function ta(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function na(e,t,n=!1){let r=e.children,i=t.children;if(S(r)&&S(i))for(let e=0;e<r.length;e++){let t=r[e],a=i[e];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[e]=Oa(i[e]),a.el=t.el),!n&&a.patchFlag!==-2&&na(t,a)),a.type===la&&(a.patchFlag===-1&&(a=i[e]=Oa(a)),a.el=t.el),a.type===ua&&!a.el&&(a.el=t.el)}}function ra(e){let t=e.slice(),n=[0],r,i,a,o,s,c=e.length;for(r=0;r<c;r++){let c=e[r];if(c!==0){if(i=n[n.length-1],e[i]<c){t[r]=i,n.push(r);continue}for(a=0,o=n.length-1;a<o;)s=a+o>>1,e[n[s]]<c?a=s+1:o=s;c<e[n[a]]&&(a>0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-->0;)n[a]=o,o=t[o];return n}function ia(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ia(t)}function aa(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function oa(e){if(e.placeholder)return e.placeholder;let t=e.component;return t?oa(t.subTree):null}var sa=e=>e.__isSuspense;function ca(e,t){t&&t.pendingBranch?S(e)?t.effects.push(...e):t.effects.push(e):Ln(e)}var B=Symbol.for(`v-fgt`),la=Symbol.for(`v-txt`),ua=Symbol.for(`v-cmt`),da=Symbol.for(`v-stc`),fa=[],pa=null;function V(e=!1){fa.push(pa=e?null:[])}function ma(){fa.pop(),pa=fa[fa.length-1]||null}var ha=1;function ga(e,t=!1){ha+=e,e<0&&pa&&t&&(pa.hasOnce=!0)}function _a(e){return e.dynamicChildren=ha>0?pa||p:null,ma(),ha>0&&pa&&pa.push(e),e}function H(e,t,n,r,i,a){return _a(U(e,t,n,r,i,a,!0))}function va(e,t,n,r,i){return _a(W(e,t,n,r,i,!0))}function ya(e){return e?e.__v_isVNode===!0:!1}function ba(e,t){return e.type===t.type&&e.key===t.key}var xa=({key:e})=>e??null,Sa=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:D(e)||L(e)||E(e)?{i:Hn,r:e,k:t,f:!!n}:e);function U(e,t=null,n=null,r=0,i=null,a=e===B?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&xa(t),ref:t&&Sa(t),scopeId:Un,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Hn};return s?(ka(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=D(n)?8:16),ha>0&&!o&&pa&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&pa.push(c),c}var W=Ca;function Ca(e,t=null,n=null,r=0,i=null,a=!1){if(e&&e!==Jr||(e=ua),ya(e)){let r=Ta(e,t,!0);return n&&ka(r,n),ha>0&&!a&&pa&&(r.shapeFlag&6?pa[pa.indexOf(e)]=r:pa.push(r)),r.patchFlag=-2,r}if(Xa(e)&&(e=e.__vccOpts),t){t=wa(t);let{class:e,style:n}=t;e&&!D(e)&&(t.class=N(e)),k(n)&&(en(n)&&!S(n)&&(n=v({},n)),t.style=ve(n))}let o=D(e)?1:sa(e)?128:ir(e)?64:k(e)?4:E(e)?2:0;return U(e,t,n,r,i,o,a,!0)}function wa(e){return e?en(e)||Pi(e)?v({},e):e:null}function Ta(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?Aa(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&xa(l),ref:t&&t.ref?n&&a?S(a)?a.concat(Sa(t)):[a,Sa(t)]:Sa(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==B?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ta(e.ssContent),ssFallback:e.ssFallback&&Ta(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&vr(u,c.clone(u)),u}function Ea(e=` `,t=0){return W(la,null,e,t)}function G(e=``,t=!1){return t?(V(),va(ua,null,e)):W(ua,null,e)}function Da(e){return e==null||typeof e==`boolean`?W(ua):S(e)?W(B,null,e.slice()):ya(e)?Oa(e):W(la,null,String(e))}function Oa(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Ta(e)}function ka(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(S(t))n=16;else if(typeof t==`object`){if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),ka(e,n()),n._c&&(n._d=!0));return}{n=32;let r=t._;!r&&!Pi(t)?t._ctx=Hn:r===3&&Hn&&(Hn.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}}else E(t)?(t={default:t,_ctx:Hn},n=32):(t=String(t),r&64?(n=16,t=[Ea(t)]):n=8);e.children=t,e.shapeFlag|=n}function Aa(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];for(let e in r)if(e===`class`)t.class!==r.class&&(t.class=N([t.class,r.class]));else if(e===`style`)t.style=ve([t.style,r.style]);else if(g(e)){let n=t[e],i=r[e];i&&n!==i&&!(S(n)&&n.includes(i))?t[e]=n?[].concat(n,i):i:i==null&&n==null&&!_(e)&&(t[e]=i)}else e!==``&&(t[e]=r[e])}return t}function ja(e,t,n,r=null){Cn(e,t,7,[n,r])}var Ma=gi(),Na=0;function Pa(e,t,n){let r=e.type,i=(t?t.appContext:e.appContext)||Ma,a={uid:Na++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Ne(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:[``,0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Bi(r,i),emitsOptions:Ci(r,i),emit:null,emitted:null,propsDefaults:f,inheritAttrs:r.inheritAttrs,ctx:f,data:f,props:f,attrs:f,slots:f,refs:f,setupState:f,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return a.ctx={_:a},a.root=t?t.root:a,a.emit=xi.bind(null,a),e.ce&&e.ce(a),a}var Fa=null,Ia=()=>Fa||Hn,La,Ra;{let e=_e(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};La=t(`__VUE_INSTANCE_SETTERS__`,e=>Fa=e),Ra=t(`__VUE_SSR_SETTERS__`,e=>Ha=e)}var za=e=>{let t=Fa;return La(e),e.scope.on(),()=>{e.scope.off(),La(t)}},Ba=()=>{Fa&&Fa.scope.off(),La(null)};function Va(e){return e.vnode.shapeFlag&4}var Ha=!1;function Ua(e,t=!1,n=!1){t&&Ra(t);let{props:r,children:i}=e.vnode,a=Va(e);Fi(e,r,a,t),Ji(e,i,n||t);let o=a?Wa(e,t):void 0;return t&&Ra(!1),o}function Wa(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,$r);let{setup:r}=n;if(r){$e();let n=e.setupContext=r.length>1?Ja(e):null,i=za(e),a=Sn(r,e,0,[e.props,n]),o=ee(a);if(et(),i(),(o||e.sp)&&!Or(e)&&xr(e),o){if(a.then(Ba,Ba),t)return a.then(n=>{Ga(e,n,t)}).catch(t=>{wn(t,e,0)});e.asyncDep=a}else Ga(e,a,t)}else Ka(e,t)}function Ga(e,t,n){E(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:k(t)&&(e.setupState=un(t)),Ka(e,n)}function Ka(e,t,n){let r=e.type;e.render||=r.render||m;{let t=za(e);$e();try{ni(e)}finally{et(),t()}}}var qa={get(e,t){return ut(e,`get`,``),e[t]}};function Ja(e){return{attrs:new Proxy(e.attrs,qa),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function Ya(e){return e.exposed?e.exposeProxy||=new Proxy(un(tn(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Zr)return Zr[n](e)},has(e,t){return t in e||t in Zr}}):e.proxy}function Xa(e){return E(e)&&`__vccOpts`in e}var K=(e,t)=>hn(e,t,Ha);function Za(e,t,n){try{ga(-1);let r=arguments.length;return r===2?k(t)&&!S(t)?ya(t)?W(e,null,[t]):W(e,t):W(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&ya(n)&&(n=[n]),W(e,t,n))}finally{ga(1)}}var Qa=`3.5.31`,$a=void 0,eo=typeof window<`u`&&window.trustedTypes;if(eo)try{$a=eo.createPolicy(`vue`,{createHTML:e=>e})}catch{}var to=$a?e=>$a.createHTML(e):e=>e,no=`http://www.w3.org/2000/svg`,ro=`http://www.w3.org/1998/Math/MathML`,io=typeof document<`u`?document:null,ao=io&&io.createElement(`template`),oo={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?io.createElementNS(no,e):t===`mathml`?io.createElementNS(ro,e):n?io.createElement(e,{is:n}):io.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>io.createTextNode(e),createComment:e=>io.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>io.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==a&&(i=i.nextSibling););else{ao.innerHTML=to(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=ao.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},so=`transition`,co=`animation`,lo=Symbol(`_vtc`),uo={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},fo=v({},lr,uo),po=(e=>(e.displayName=`Transition`,e.props=fo,e))((e,{slots:t})=>Za(pr,go(e),t)),mo=(e,t=[])=>{S(e)?e.forEach(e=>e(...t)):e&&e(...t)},ho=e=>e?S(e)?e.some(e=>e.length>1):e.length>1:!1;function go(e){let t={};for(let n in e)n in uo||(t[n]=e[n]);if(e.css===!1)return t;let{name:n=`v`,type:r,duration:i,enterFromClass:a=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:s=`${n}-enter-to`,appearFromClass:c=a,appearActiveClass:l=o,appearToClass:u=s,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,m=_o(i),h=m&&m[0],g=m&&m[1],{onBeforeEnter:_,onEnter:y,onEnterCancelled:b,onLeave:x,onLeaveCancelled:S,onBeforeAppear:C=_,onAppear:w=y,onAppearCancelled:T=b}=t,E=(e,t,n,r)=>{e._enterCancelled=r,bo(e,t?u:s),bo(e,t?l:o),n&&n()},D=(e,t)=>{e._isLeaving=!1,bo(e,d),bo(e,p),bo(e,f),t&&t()},O=e=>(t,n)=>{let i=e?w:y,o=()=>E(t,e,n);mo(i,[t,o]),xo(()=>{bo(t,e?c:a),yo(t,e?u:s),ho(i)||Co(t,r,h,o)})};return v(t,{onBeforeEnter(e){mo(_,[e]),yo(e,a),yo(e,o)},onBeforeAppear(e){mo(C,[e]),yo(e,c),yo(e,l)},onEnter:O(!1),onAppear:O(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>D(e,t);yo(e,d),e._enterCancelled?(yo(e,f),Do(e)):(Do(e),yo(e,f)),xo(()=>{e._isLeaving&&(bo(e,d),yo(e,p),ho(x)||Co(e,r,g,n))}),mo(x,[e,n])},onEnterCancelled(e){E(e,!1,void 0,!0),mo(b,[e])},onAppearCancelled(e){E(e,!0,void 0,!0),mo(T,[e])},onLeaveCancelled(e){D(e),mo(S,[e])}})}function _o(e){if(e==null)return null;if(k(e))return[vo(e.enter),vo(e.leave)];{let t=vo(e);return[t,t]}}function vo(e){return he(e)}function yo(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[lo]||(e[lo]=new Set)).add(t)}function bo(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[lo];n&&(n.delete(t),n.size||(e[lo]=void 0))}function xo(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var So=0;function Co(e,t,n,r){let i=e._endId=++So,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=wo(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u<c&&d()},s+1),e.addEventListener(l,f)}function wo(e,t){let n=window.getComputedStyle(e),r=e=>(n[e]||``).split(`, `),i=r(`${so}Delay`),a=r(`${so}Duration`),o=To(i,a),s=r(`${co}Delay`),c=r(`${co}Duration`),l=To(s,c),u=null,d=0,f=0;t===so?o>0&&(u=so,d=o,f=a.length):t===co?l>0&&(u=co,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?so:co:null,f=u?u===so?a.length:c.length:0);let p=u===so&&/\b(?:transform|all)(?:,|$)/.test(r(`${so}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function To(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,n)=>Eo(t)+Eo(e[n])))}function Eo(e){return e===`auto`?0:Number(e.slice(0,-1).replace(`,`,`.`))*1e3}function Do(e){return(e?e.ownerDocument:document).body.offsetHeight}function Oo(e,t,n){let r=e[lo];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var ko=Symbol(`_vod`),Ao=Symbol(`_vsh`),jo=Symbol(``),Mo=/(?:^|;)\s*display\s*:/;function No(e,t,n){let r=e.style,i=D(n),a=!1;if(n&&!i){if(t){if(D(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Fo(r,t,``)}else for(let e in t)n[e]??Fo(r,e,``)}for(let e in n)e===`display`&&(a=!0),Fo(r,e,n[e])}else if(i){if(t!==n){let e=r[jo];e&&(n+=`;`+e),r.cssText=n,a=Mo.test(n)}}else t&&e.removeAttribute(`style`);ko in e&&(e[ko]=a?r.display:``,e[Ao]&&(r.display=`none`))}var Po=/\s*!important$/;function Fo(e,t,n){if(S(n))n.forEach(n=>Fo(e,t,n));else if(n??=``,t.startsWith(`--`))e.setProperty(t,n);else{let r=Ro(e,t);Po.test(n)?e.setProperty(M(r),n.replace(Po,``),`important`):e[r]=n}}var Io=[`Webkit`,`Moz`,`ms`],Lo={};function Ro(e,t){let n=Lo[t];if(n)return n;let r=ce(t);if(r!==`filter`&&r in e)return Lo[t]=r;r=le(r);for(let n=0;n<Io.length;n++){let i=Io[n]+r;if(i in e)return Lo[t]=i}return t}var zo=`http://www.w3.org/1999/xlink`;function Bo(e,t,n,r,i,a=we(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(zo,t.slice(6,t.length)):e.setAttributeNS(zo,t,n):n==null||a&&!Te(n)?e.removeAttribute(t):e.setAttribute(t,a?``:O(n)?String(n):n)}function Vo(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?to(n):n);return}let a=e.tagName;if(t===`value`&&a!==`PROGRESS`&&!a.includes(`-`)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);r===i&&`_value`in e||(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=Te(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function Ho(e,t,n,r){e.addEventListener(t,n,r)}function Uo(e,t,n,r){e.removeEventListener(t,n,r)}var Wo=Symbol(`_vei`);function Go(e,t,n,r,i=null){let a=e[Wo]||(e[Wo]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=qo(t);r?Ho(e,n,a[t]=Zo(r,i),s):o&&(Uo(e,n,o,s),a[t]=void 0)}}var Ko=/(?:Once|Passive|Capture)$/;function qo(e){let t;if(Ko.test(e)){t={};let n;for(;n=e.match(Ko);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[e[2]===`:`?e.slice(3):M(e.slice(2)),t]}var Jo=0,Yo=Promise.resolve(),Xo=()=>Jo||=(Yo.then(()=>Jo=0),Date.now());function Zo(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;Cn(Qo(e,n.value),t,5,[e])};return n.value=e,n.attached=Xo(),n}function Qo(e,t){if(S(t)){let n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}return t}var $o=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,es=(e,t,n,r,i,a)=>{let o=i===`svg`;t===`class`?Oo(e,r,o):t===`style`?No(e,n,r):g(t)?_(t)||Go(e,t,n,r,a):(t[0]===`.`?(t=t.slice(1),1):t[0]===`^`?(t=t.slice(1),0):ts(e,t,r,o))?(Vo(e,t,r),e.tagName.includes(`-`)||t!==`value`&&t!==`checked`&&t!==`selected`||Bo(e,t,r,o,a,t!==`value`)):e._isVueCE&&(ns(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!D(r)))?Vo(e,ce(t),r,a,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),Bo(e,t,r,o))};function ts(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&$o(t)&&E(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return $o(t)&&D(n)?!1:t in e}function ns(e,t){let n=e._def.props;if(!n)return!1;let r=ce(t);return Array.isArray(n)?n.some(e=>ce(e)===r):Object.keys(n).some(e=>ce(e)===r)}var rs=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return S(t)?e=>fe(t,e):t};function is(e){e.target.composing=!0}function as(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}var os=Symbol(`_assign`);function ss(e,t,n){return t&&(e=e.trim()),n&&(e=me(e)),e}var cs={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[os]=rs(i);let a=r||i.props&&i.props.type===`number`;Ho(e,t?`change`:`input`,t=>{t.target.composing||e[os](ss(e.value,n,a))}),(n||a)&&Ho(e,`change`,()=>{e.value=ss(e.value,n,a)}),t||(Ho(e,`compositionstart`,is),Ho(e,`compositionend`,as),Ho(e,`change`,as))},mounted(e,{value:t}){e.value=t??``},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[os]=rs(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?me(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},ls={deep:!0,created(e,t,n){e[os]=rs(n),Ho(e,`change`,()=>{let t=e._modelValue,n=ps(e),r=e.checked,i=e[os];if(S(t)){let e=Oe(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(w(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(ms(e,r))})},mounted:us,beforeUpdate(e,t,n){e[os]=rs(n),us(e,t,n)}};function us(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(S(t))i=Oe(t,r.props.value)>-1;else if(w(t))i=t.has(r.props.value);else{if(t===n)return;i=De(t,ms(e,!0))}e.checked!==i&&(e.checked=i)}var ds={deep:!0,created(e,{value:t,modifiers:{number:n}},r){let i=w(t);Ho(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?me(ps(e)):ps(e));e[os](e.multiple?i?new Set(t):t:t[0]),e._assigning=!0,Nn(()=>{e._assigning=!1})}),e[os]=rs(r)},mounted(e,{value:t}){fs(e,t)},beforeUpdate(e,t,n){e[os]=rs(n)},updated(e,{value:t}){e._assigning||fs(e,t)}};function fs(e,t){let n=e.multiple,r=S(t);if(!n||r||w(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=ps(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):Oe(t,o)>-1}else a.selected=t.has(o)}else if(De(ps(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function ps(e){return`_value`in e?e._value:e.value}function ms(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var hs=[`ctrl`,`shift`,`alt`,`meta`],gs={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>hs.some(n=>e[`${n}Key`]&&!t.includes(n))},_s=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=gs[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},vs=v({patchProp:es},oo),ys;function bs(){return ys||=Zi(vs)}var xs=((...e)=>{let t=bs().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=Cs(e);if(!r)return;let i=t._component;E(i)||i.render||i.template||(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,Ss(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t});function Ss(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function Cs(e){return D(e)?document.querySelector(e):e}function ws(e){var t=e.length;if(t%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function Ts(e){var t=ws(e),n=t[0],r=t[1];return(n+r)*3/4-r}function Es(e,t,n){return(t+n)*3/4-n}function Ds(e){for(var t,n=ws(e),r=n[0],i=n[1],a=new Ps(Es(e,r,i)),o=0,s=i>0?r-4:r,c=0;c<s;c+=4)t=Ns[e.charCodeAt(c)]<<18|Ns[e.charCodeAt(c+1)]<<12|Ns[e.charCodeAt(c+2)]<<6|Ns[e.charCodeAt(c+3)],a[o++]=t>>16&255,a[o++]=t>>8&255,a[o++]=t&255;return i===2&&(t=Ns[e.charCodeAt(c)]<<2|Ns[e.charCodeAt(c+1)]>>4,a[o++]=t&255),i===1&&(t=Ns[e.charCodeAt(c)]<<10|Ns[e.charCodeAt(c+1)]<<4|Ns[e.charCodeAt(c+2)]>>2,a[o++]=t>>8&255,a[o++]=t&255),a}function Os(e){return Ms[e>>18&63]+Ms[e>>12&63]+Ms[e>>6&63]+Ms[e&63]}function ks(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&0xff0000)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(Os(r));return i.join(``)}function As(e){for(var t,n=e.length,r=n%3,i=[],a=16383,o=0,s=n-r;o<s;o+=a)i.push(ks(e,o,o+a>s?s:o+a));return r===1?(t=e[n-1],i.push(Ms[t>>2]+Ms[t<<4&63]+`==`)):r===2&&(t=(e[n-2]<<8)+e[n-1],i.push(Ms[t>>10]+Ms[t>>4&63]+Ms[t<<2&63]+`=`)),i.join(``)}var q,js,Ms,Ns,Ps,Fs,Is,Ls,Rs,zs,Bs=o((()=>{for(q={},js={},js.byteLength=Ts,js.toByteArray=Ds,js.fromByteArray=As,Ms=[],Ns=[],Ps=typeof Uint8Array<`u`?Uint8Array:Array,Fs=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Is=0,Ls=Fs.length;Is<Ls;++Is)Ms[Is]=Fs[Is],Ns[Fs.charCodeAt(Is)]=Is;Ns[45]=62,Ns[95]=63,Rs={},Rs.read=function(e,t,n,r,i){var a,o,s=i*8-r-1,c=(1<<s)-1,l=c>>1,u=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=a*256+e[t+d],d+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=o*256+e[t+d],d+=f,u-=8);if(a===0)a=1-l;else if(a===c)return o?NaN:(p?-1:1)*(1/0);else o+=2**r,a-=l;return(p?-1:1)*o*2**(a-r)},Rs.write=function(e,t,n,r,i,a){var o,s,c,l=a*8-i-1,u=(1<<l)-1,d=u>>1,f=i===23?2**-24-2**-77:0,p=r?0:a-1,m=r?1:-1,h=+(t<0||t===0&&1/t<0);for(t=Math.abs(t),isNaN(t)||t===1/0?(s=+!!isNaN(t),o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=2**-o)<1&&(o--,c*=2),o+d>=1?t+=f/c:t+=f*2**(1-d),t*c>=2&&(o++,c/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*c-1)*2**i,o+=d):(s=t*2**(d-1)*2**i,o=0));i>=8;e[n+p]=s&255,p+=m,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+p]=o&255,p+=m,o/=256,l-=8);e[n+p-m]|=h*128},(function(e){let t=js,n=Rs,r=typeof Symbol==`function`&&typeof Symbol.for==`function`?Symbol.for(`nodejs.util.inspect.custom`):null;e.Buffer=u,e.SlowBuffer=x,e.INSPECT_MAX_BYTES=50;let i=0x7fffffff;e.kMaxLength=i;let{Uint8Array:a,ArrayBuffer:o,SharedArrayBuffer:s}=globalThis;u.TYPED_ARRAY_SUPPORT=c(),!u.TYPED_ARRAY_SUPPORT&&typeof console<`u`&&typeof console.error==`function`&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function c(){try{let e=new a(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,a.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}});function l(e){if(e>i)throw RangeError(`The value "`+e+`" is invalid for option "size"`);let t=new a(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,n){if(typeof e==`number`){if(typeof t==`string`)throw TypeError(`The "string" argument must be of type string. Received type number`);return m(e)}return d(e,t,n)}u.poolSize=8192;function d(e,t,n){if(typeof e==`string`)return h(e,t);if(o.isView(e))return _(e);if(e==null)throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e);if(De(e,o)||e&&De(e.buffer,o)||s!==void 0&&(De(e,s)||e&&De(e.buffer,s)))return v(e,t,n);if(typeof e==`number`)throw TypeError(`The "value" argument must not be of type number. Received type number`);let r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return u.from(r,t,n);let i=y(e);if(i)return i;if(typeof Symbol<`u`&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]==`function`)return u.from(e[Symbol.toPrimitive](`string`),t,n);throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e)}u.from=function(e,t,n){return d(e,t,n)},Object.setPrototypeOf(u.prototype,a.prototype),Object.setPrototypeOf(u,a);function f(e){if(typeof e!=`number`)throw TypeError(`"size" argument must be of type number`);if(e<0)throw RangeError(`The value "`+e+`" is invalid for option "size"`)}function p(e,t,n){return f(e),e<=0||t===void 0?l(e):typeof n==`string`?l(e).fill(t,n):l(e).fill(t)}u.alloc=function(e,t,n){return p(e,t,n)};function m(e){return f(e),l(e<0?0:b(e)|0)}u.allocUnsafe=function(e){return m(e)},u.allocUnsafeSlow=function(e){return m(e)};function h(e,t){if((typeof t!=`string`||t===``)&&(t=`utf8`),!u.isEncoding(t))throw TypeError(`Unknown encoding: `+t);let n=S(e,t)|0,r=l(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function g(e){let t=e.length<0?0:b(e.length)|0,n=l(t);for(let r=0;r<t;r+=1)n[r]=e[r]&255;return n}function _(e){if(De(e,a)){let t=new a(e);return v(t.buffer,t.byteOffset,t.byteLength)}return g(e)}function v(e,t,n){if(t<0||e.byteLength<t)throw RangeError(`"offset" is outside of buffer bounds`);if(e.byteLength<t+(n||0))throw RangeError(`"length" is outside of buffer bounds`);let r;return r=t===void 0&&n===void 0?new a(e):n===void 0?new a(e,t):new a(e,t,n),Object.setPrototypeOf(r,u.prototype),r}function y(e){if(u.isBuffer(e)){let t=b(e.length)|0,n=l(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!=`number`||Oe(e.length)?l(0):g(e);if(e.type===`Buffer`&&Array.isArray(e.data))return g(e.data)}function b(e){if(e>=i)throw RangeError(`Attempt to allocate Buffer larger than maximum size: 0x`+i.toString(16)+` bytes`);return e|0}function x(e){return+e!=e&&(e=0),u.alloc(+e)}u.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==u.prototype},u.compare=function(e,t){if(De(e,a)&&(e=u.from(e,e.offset,e.byteLength)),De(t,a)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw TypeError(`The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array`);if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:+(r<n)},u.isEncoding=function(e){switch(String(e).toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`latin1`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw TypeError(`"list" argument must be an Array of Buffers`);if(e.length===0)return u.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;let r=u.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){let t=e[n];if(De(t,a))i+t.length>r.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(r,i)):a.prototype.set.call(r,t,i);else if(u.isBuffer(t))t.copy(r,i);else throw TypeError(`"list" argument must be an Array of Buffers`);i+=t.length}return r};function S(e,t){if(u.isBuffer(e))return e.length;if(o.isView(e)||De(e,o))return e.byteLength;if(typeof e!=`string`)throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type `+typeof e);let n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;let i=!1;for(;;)switch(t){case`ascii`:case`latin1`:case`binary`:return n;case`utf8`:case`utf-8`:return N(e).length;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return n*2;case`hex`:return n>>>1;case`base64`:return Te(e).length;default:if(i)return r?-1:N(e).length;t=(``+t).toLowerCase(),i=!0}}u.byteLength=S;function C(e,t,n){let r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return``;for(e||=`utf8`;;)switch(e){case`hex`:return se(this,t,n);case`utf8`:case`utf-8`:return re(this,t,n);case`ascii`:return ae(this,t,n);case`latin1`:case`binary`:return oe(this,t,n);case`base64`:return ne(this,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return ce(this,t,n);default:if(r)throw TypeError(`Unknown encoding: `+e);e=(e+``).toLowerCase(),r=!0}}u.prototype._isBuffer=!0;function w(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}u.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError(`Buffer size must be a multiple of 16-bits`);for(let t=0;t<e;t+=2)w(this,t,t+1);return this},u.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError(`Buffer size must be a multiple of 32-bits`);for(let t=0;t<e;t+=4)w(this,t,t+3),w(this,t+1,t+2);return this},u.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError(`Buffer size must be a multiple of 64-bits`);for(let t=0;t<e;t+=8)w(this,t,t+7),w(this,t+1,t+6),w(this,t+2,t+5),w(this,t+3,t+4);return this},u.prototype.toString=function(){let e=this.length;return e===0?``:arguments.length===0?re(this,0,e):C.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw TypeError(`Argument must be a Buffer`);return this===e||u.compare(this,e)===0},u.prototype.inspect=function(){let t=``,n=e.INSPECT_MAX_BYTES;return t=this.toString(`hex`,0,n).replace(/(.{2})/g,`$1 `).trim(),this.length>n&&(t+=` ... `),`<Buffer `+t+`>`},r&&(u.prototype[r]=u.prototype.inspect),u.prototype.compare=function(e,t,n,r,i){if(De(e,a)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw TypeError(`The "target" argument must be one of type Buffer or Uint8Array. Received type `+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError(`out of range index`);if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;let o=i-r,s=n-t,c=Math.min(o,s),l=this.slice(r,i),d=e.slice(t,n);for(let e=0;e<c;++e)if(l[e]!==d[e]){o=l[e],s=d[e];break}return o<s?-1:+(s<o)};function T(e,t,n,r,i){if(e.length===0)return-1;if(typeof n==`string`?(r=n,n=0):n>0x7fffffff?n=0x7fffffff:n<-0x80000000&&(n=-0x80000000),n=+n,Oe(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(i)n=0;else return-1}if(typeof t==`string`&&(t=u.from(t,r)),u.isBuffer(t))return t.length===0?-1:E(e,t,n,r,i);if(typeof t==`number`)return t&=255,typeof a.prototype.indexOf==`function`?i?a.prototype.indexOf.call(e,t,n):a.prototype.lastIndexOf.call(e,t,n):E(e,[t],n,r,i);throw TypeError(`val must be string, number or Buffer`)}function E(e,t,n,r,i){let a=1,o=e.length,s=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r===`ucs2`||r===`ucs-2`||r===`utf16le`||r===`utf-16le`)){if(e.length<2||t.length<2)return-1;a=2,o/=2,s/=2,n/=2}function c(e,t){return a===1?e[t]:e.readUInt16BE(t*a)}let l;if(i){let r=-1;for(l=n;l<o;l++)if(c(e,l)===c(t,r===-1?0:l-r)){if(r===-1&&(r=l),l-r+1===s)return r*a}else r!==-1&&(l-=l-r),r=-1}else for(n+s>o&&(n=o-s),l=n;l>=0;l--){let n=!0;for(let r=0;r<s;r++)if(c(e,l+r)!==c(t,r)){n=!1;break}if(n)return l}return-1}u.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},u.prototype.indexOf=function(e,t,n){return T(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return T(this,e,t,n,!1)};function D(e,t,n,r){n=Number(n)||0;let i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;let a=t.length;r>a/2&&(r=a/2);let o=0;for(;o<r;++o){let r=parseInt(t.substr(o*2,2),16);if(Oe(r))return o;e[n+o]=r}return o}function O(e,t,n,r){return Ee(N(t,e.length-n),e,n,r)}function k(e,t,n,r){return Ee(Ce(t),e,n,r)}function ee(e,t,n,r){return Ee(Te(t),e,n,r)}function te(e,t,n,r){return Ee(we(t,e.length-n),e,n,r)}u.prototype.write=function(e,t,n,r){if(t===void 0)r=`utf8`,n=this.length,t=0;else if(n===void 0&&typeof t==`string`)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,r===void 0&&(r=`utf8`)):(r=n,n=void 0);else throw Error(`Buffer.write(string, encoding, offset[, length]) is no longer supported`);let i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError(`Attempt to write outside buffer bounds`);r||=`utf8`;let a=!1;for(;;)switch(r){case`hex`:return D(this,e,t,n);case`utf8`:case`utf-8`:return O(this,e,t,n);case`ascii`:case`latin1`:case`binary`:return k(this,e,t,n);case`base64`:return ee(this,e,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return te(this,e,t,n);default:if(a)throw TypeError(`Unknown encoding: `+r);r=(``+r).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}};function ne(e,n,r){return n===0&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function re(e,t,n){n=Math.min(e.length,n);let r=[],i=t;for(;i<n;){let t=e[i],a=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=n){let n,r,s,c;switch(o){case 1:t<128&&(a=t);break;case 2:n=e[i+1],(n&192)==128&&(c=(t&31)<<6|n&63,c>127&&(a=c));break;case 3:n=e[i+1],r=e[i+2],(n&192)==128&&(r&192)==128&&(c=(t&15)<<12|(n&63)<<6|r&63,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],(n&192)==128&&(r&192)==128&&(s&192)==128&&(c=(t&15)<<18|(n&63)<<12|(r&63)<<6|s&63,c>65535&&c<1114112&&(a=c))}}a===null?(a=65533,o=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),i+=o}return A(r)}let ie=4096;function A(e){let t=e.length;if(t<=ie)return String.fromCharCode.apply(String,e);let n=``,r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=ie));return n}function ae(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]&127);return r}function oe(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function se(e,t,n){let r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i=``;for(let r=t;r<n;++r)i+=ke[e[r]];return i}function ce(e,t,n){let r=e.slice(t,n),i=``;for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+r[e+1]*256);return i}u.prototype.slice=function(e,t){let n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);let r=this.subarray(e,t);return Object.setPrototypeOf(r,u.prototype),r};function j(e,t,n){if(e%1!=0||e<0)throw RangeError(`offset is not uint`);if(e+t>n)throw RangeError(`Trying to access beyond buffer length`)}u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||j(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return r},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||j(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||j(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||j(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||j(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||j(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||j(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=P(function(e){e>>>=0,ye(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&be(e,this.length-8);let r=t+this[++e]*256+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*256+this[++e]*2**16+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))}),u.prototype.readBigUInt64BE=P(function(e){e>>>=0,ye(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&be(e,this.length-8);let r=t*2**24+this[++e]*2**16+this[++e]*256+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*256+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),u.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||j(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return i*=128,r>=i&&(r-=2**(8*t)),r},u.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||j(e,t,this.length);let r=t,i=1,a=this[e+--r];for(;r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=2**(8*t)),a},u.prototype.readInt8=function(e,t){return e>>>=0,t||j(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||j(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|0xffff0000:n},u.prototype.readInt16BE=function(e,t){e>>>=0,t||j(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|0xffff0000:n},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||j(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||j(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=P(function(e){e>>>=0,ye(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&be(e,this.length-8);let r=this[e+4]+this[e+5]*256+this[e+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+this[++e]*256+this[++e]*2**16+this[++e]*2**24)}),u.prototype.readBigInt64BE=P(function(e){e>>>=0,ye(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&be(e,this.length-8);let r=(t<<24)+this[++e]*2**16+this[++e]*256+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*256+n)}),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||j(e,4,this.length),n.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||j(e,4,this.length),n.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||j(e,8,this.length),n.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||j(e,8,this.length),n.read(this,e,!1,52,8)};function M(e,t,n,r,i,a){if(!u.isBuffer(e))throw TypeError(`"buffer" argument must be a Buffer instance`);if(t>i||t<a)throw RangeError(`"value" argument is out of bounds`);if(n+r>e.length)throw RangeError(`Index out of range`)}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;M(this,e,t,n,r,0)}let i=1,a=0;for(this[t]=e&255;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;M(this,e,t,n,r,0)}let i=n-1,a=1;for(this[t+i]=e&255;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,1,255,0),this[t]=e&255,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function le(e,t,n,r,i){ve(t,r,i,e,n,7);let a=Number(t&BigInt(0xffffffff));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;let o=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function ue(e,t,n,r,i){ve(t,r,i,e,n,7);let a=Number(t&BigInt(0xffffffff));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;let o=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}u.prototype.writeBigUInt64LE=P(function(e,t=0){return le(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),u.prototype.writeBigUInt64BE=P(function(e,t=0){return ue(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);M(this,e,t,n,r-1,-r)}let i=0,a=1,o=0;for(this[t]=e&255;++i<n&&(a*=256);)e<0&&o===0&&this[t+i-1]!==0&&(o=1),this[t+i]=(e/a|0)-o&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);M(this,e,t,n,r-1,-r)}let i=n-1,a=1,o=0;for(this[t+i]=e&255;--i>=0&&(a*=256);)e<0&&o===0&&this[t+i+1]!==0&&(o=1),this[t+i]=(e/a|0)-o&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,4,0x7fffffff,-0x80000000),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},u.prototype.writeBigInt64LE=P(function(e,t=0){return le(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))}),u.prototype.writeBigInt64BE=P(function(e,t=0){return ue(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))});function de(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError(`Index out of range`)}function fe(e,t,r,i,a){return t=+t,r>>>=0,a||de(e,t,r,4),n.write(e,t,r,i,23,4),r+4}u.prototype.writeFloatLE=function(e,t,n){return fe(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return fe(this,e,t,!1,n)};function pe(e,t,r,i,a){return t=+t,r>>>=0,a||de(e,t,r,8),n.write(e,t,r,i,52,8),r+8}u.prototype.writeDoubleLE=function(e,t,n){return pe(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return pe(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(!u.isBuffer(e))throw TypeError(`argument should be a Buffer`);if(n||=0,!r&&r!==0&&(r=this.length),t>=e.length&&(t=e.length),t||=0,r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(t<0)throw RangeError(`targetStart out of bounds`);if(n<0||n>=this.length)throw RangeError(`Index out of range`);if(r<0)throw RangeError(`sourceEnd out of bounds`);r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);let i=r-n;return this===e&&typeof a.prototype.copyWithin==`function`?this.copyWithin(t,n,r):a.prototype.set.call(e,this.subarray(n,r),t),i},u.prototype.fill=function(e,t,n,r){if(typeof e==`string`){if(typeof t==`string`?(r=t,t=0,n=this.length):typeof n==`string`&&(r=n,n=this.length),r!==void 0&&typeof r!=`string`)throw TypeError(`encoding must be a string`);if(typeof r==`string`&&!u.isEncoding(r))throw TypeError(`Unknown encoding: `+r);if(e.length===1){let t=e.charCodeAt(0);(r===`utf8`&&t<128||r===`latin1`)&&(e=t)}}else typeof e==`number`?e&=255:typeof e==`boolean`&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError(`Out of range index`);if(n<=t)return this;t>>>=0,n=n===void 0?this.length:n>>>0,e||=0;let i;if(typeof e==`number`)for(i=t;i<n;++i)this[i]=e;else{let a=u.isBuffer(e)?e:u.from(e,r),o=a.length;if(o===0)throw TypeError(`The value "`+e+`" is invalid for argument "value"`);for(i=0;i<n-t;++i)this[i+t]=a[i%o]}return this};let me={};function he(e,t,n){me[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}he(`ERR_BUFFER_OUT_OF_BOUNDS`,function(e){return e?`${e} is outside of buffer bounds`:`Attempt to access memory outside buffer bounds`},RangeError),he(`ERR_INVALID_ARG_TYPE`,function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),he(`ERR_OUT_OF_RANGE`,function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=ge(String(n)):typeof n==`bigint`&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=ge(i)),i+=`n`),r+=` It must be ${t}. Received ${i}`,r},RangeError);function ge(e){let t=``,n=e.length,r=+(e[0]===`-`);for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function _e(e,t,n){ye(t,`offset`),(e[t]===void 0||e[t+n]===void 0)&&be(t,e.length-(n+1))}function ve(e,t,n,r,i,a){if(e>n||e<t){let r=typeof t==`bigint`?`n`:``,i;throw i=a>3?t===0||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${(a+1)*8}${r}`:`>= -(2${r} ** ${(a+1)*8-1}${r}) and < 2 ** ${(a+1)*8-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new me.ERR_OUT_OF_RANGE(`value`,i,e)}_e(r,i,a)}function ye(e,t){if(typeof e!=`number`)throw new me.ERR_INVALID_ARG_TYPE(t,`number`,e)}function be(e,t,n){throw Math.floor(e)===e?t<0?new me.ERR_BUFFER_OUT_OF_BOUNDS:new me.ERR_OUT_OF_RANGE(n||`offset`,`>= ${+!!n} and <= ${t}`,e):(ye(e,n),new me.ERR_OUT_OF_RANGE(n||`offset`,`an integer`,e))}let xe=/[^+/0-9A-Za-z-_]/g;function Se(e){if(e=e.split(`=`)[0],e=e.trim().replace(xe,``),e.length<2)return``;for(;e.length%4!=0;)e+=`=`;return e}function N(e,t){t||=1/0;let n,r=e.length,i=null,a=[];for(let o=0;o<r;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!i){if(n>56319||o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if(--t<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw Error(`Invalid code point`)}return a}function Ce(e){let t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function we(e,t){let n,r,i,a=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}function Te(e){return t.toByteArray(Se(e))}function Ee(e,t,n,r){let i=0;for(;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function De(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Oe(e){return e!==e}let ke=(function(){let e=`0123456789abcdef`,t=Array(256);for(let n=0;n<16;++n){let r=n*16;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t})();function P(e){return typeof BigInt>`u`?Ae:e}function Ae(){throw Error(`BigInt not supported`)}})(q),zs=q.Buffer,q.Blob,q.BlobOptions,q.Buffer,q.File,q.FileOptions,q.INSPECT_MAX_BYTES,q.SlowBuffer,q.TranscodeEncoding,q.atob,q.btoa,q.constants,q.isAscii,q.isUtf8,q.kMaxLength,q.kStringMaxLength,q.resolveObjectURL,q.transcode})),Vs=typeof window<`u`,Hs,Us=e=>Hs=e,Ws=Symbol();function Gs(e){return e&&typeof e==`object`&&Object.prototype.toString.call(e)===`[object Object]`&&typeof e.toJSON!=`function`}var Ks=typeof window==`object`&&window.window===window?window:typeof self==`object`&&self.self===self?self:typeof u==`object`&&u.global===u?u:typeof globalThis==`object`?globalThis:{HTMLElement:null};function qs(e,{autoBom:t=!1}={}){return t&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([``,e],{type:e.type}):e}function Js(e,t,n){let r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){$s(r.response,t,n)},r.onerror=function(){console.error(`could not download file`)},r.send()}function Ys(e){let t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function Xs(e){try{e.dispatchEvent(new MouseEvent(`click`))}catch{let t=new MouseEvent(`click`,{bubbles:!0,cancelable:!0,view:window,detail:0,screenX:80,screenY:20,clientX:80,clientY:20,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null});e.dispatchEvent(t)}}var Zs=typeof navigator==`object`?navigator:{userAgent:``},Qs=/Macintosh/.test(Zs.userAgent)&&/AppleWebKit/.test(Zs.userAgent)&&!/Safari/.test(Zs.userAgent),$s=Vs?typeof HTMLAnchorElement<`u`&&`download`in HTMLAnchorElement.prototype&&!Qs?ec:`msSaveOrOpenBlob`in Zs?tc:nc:()=>{};function ec(e,t=`download`,n){let r=document.createElement(`a`);r.download=t,r.rel=`noopener`,typeof e==`string`?(r.href=e,r.origin===location.origin?Xs(r):Ys(r.href)?Js(e,t,n):(r.target=`_blank`,Xs(r))):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){Xs(r)},0))}function tc(e,t=`download`,n){if(typeof e==`string`){if(Ys(e))Js(e,t,n);else{let t=document.createElement(`a`);t.href=e,t.target=`_blank`,setTimeout(function(){Xs(t)})}}else navigator.msSaveOrOpenBlob(qs(e,n),t)}function nc(e,t,n,r){if(r||=open(``,`_blank`),r&&(r.document.title=r.document.body.innerText=`downloading...`),typeof e==`string`)return Js(e,t,n);let i=e.type===`application/octet-stream`,a=/constructor/i.test(String(Ks.HTMLElement))||`safari`in Ks,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&a||Qs)&&typeof FileReader<`u`){let t=new FileReader;t.onloadend=function(){let e=t.result;if(typeof e!=`string`)throw r=null,Error(`Wrong reader.result type`);e=o?e:e.replace(/^data:[^;]*;/,`data:attachment/file;`),r?r.location.href=e:location.assign(e),r=null},t.readAsDataURL(e)}else{let t=URL.createObjectURL(e);r?r.location.assign(t):location.href=t,r=null,setTimeout(function(){URL.revokeObjectURL(t)},4e4)}}var{assign:rc}=Object;function ic(){let e=Pe(!0),t=e.run(()=>R({})),n=[],r=[],i=tn({install(e){Us(i),i._a=e,e.provide(Ws,i),e.config.globalProperties.$pinia=i,r.forEach(e=>n.push(e)),r=[]},use(e){return this._a?n.push(e):r.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}var ac=()=>{};function oc(e,t,n,r=ac){e.add(t);let i=()=>{e.delete(t)&&r()};return!n&&Fe()&&Ie(i),i}function sc(e,...t){e.forEach(e=>{e(...t)})}var cc=e=>e(),lc=Symbol(),uc=Symbol();function dc(e,t){e instanceof Map&&t instanceof Map?t.forEach((t,n)=>e.set(n,t)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(let n in t){if(!Object.hasOwn(t,n))continue;let r=t[n],i=e[n];if(Gs(i)&&Gs(r)&&Object.hasOwn(e,n)&&!L(r)&&!Zt(r)){e[n]=dc(i,r);let t=I(e)[n];L(t)&&$t(t)&&cn(t)}else e[n]=r}return e}var fc=Symbol();function pc(e){return!e||typeof e!=`object`||!Object.hasOwn(e,fc)}var{assign:mc}=Object;function hc(e){return!!(L(e)&&e.effect)}function gc(e,t,n,r){let{state:i,actions:a,getters:o}=t,s=n.state.value[e],c;function l(){return s||(n.state.value[e]=i?i():{}),mc(dn(n.state.value[e]),a,Object.keys(o||{}).reduce((t,r)=>(t[r]=tn(K(()=>{Us(n);let t=n._s.get(e);return o[r].call(t,t)})),t),{}))}return c=_c(e,l,t,n,r,!0),c}function _c(e,t,n={},r,i,a){let o,s=mc({actions:{}},n),c={deep:!0},l,u,d=new Set,f=new Set,p,m=r.state.value[e];!a&&!m&&(r.state.value[e]={});let h;function g(t){let n;l=u=!1,typeof t==`function`?(t(r.state.value[e]),n={type:`patch function`,storeId:e,events:p}):(dc(r.state.value[e],t),n={type:`patch object`,payload:t,storeId:e,events:p});let i=h=Symbol();Nn().then(()=>{h===i&&(l=!0)}),u=!0,sc(d,n,r.state.value[e])}let _=a?function(){let{state:e}=n,t=e?e():{};this.$patch(e=>{mc(e,t)})}:ac;function v(){o.stop(),d.clear(),f.clear(),r._s.delete(e)}let y=(t,n=``)=>{if(lc in t)return t[uc]=n,t;let i=function(){Us(r);let n=Array.from(arguments),a=new Set,o=new Set;function s(e){a.add(e)}function c(e){o.add(e)}sc(f,{args:n,name:i[uc],store:b,after:s,onError:c});let l;try{l=t.apply(this&&this.$id===e?this:b,n)}catch(e){throw sc(o,e),e}return l instanceof Promise?l.then(e=>(sc(a,e),e)).catch(e=>(sc(o,e),Promise.reject(e))):(sc(a,l),l)};return i[lc]=!0,i[uc]=n,i},b=qt({_p:r,$id:e,$onAction:oc.bind(null,f),$patch:g,$reset:_,$subscribe(t,n={}){if(d.has(t))return ac;let i=oc(d,t,n.detached,()=>a()),a=o.run(()=>$n(()=>r.state.value[e],r=>{(n.flush===`sync`?u:l)&&t({storeId:e,type:`direct`,events:p},r)},mc({},c,n)));return i},$dispose:v});r._s.set(e,b);let x=(r._a&&r._a.runWithContext||cc)(()=>r._e.run(()=>(o=Pe()).run(()=>t({action:y}))));for(let t in x){let n=x[t];L(n)&&!hc(n)||Zt(n)?a||(m&&pc(n)&&(L(n)?n.value=m[t]:((n instanceof Set||n instanceof Map)&&n.clear(),dc(n,m[t]))),r.state.value[e][t]=n):typeof n==`function`&&(x[t]=y(n,t),s.actions[t]=n)}return mc(b,x),mc(I(b),x),Object.defineProperty(b,"$state",{get:()=>r.state.value[e],set:e=>{g(t=>{mc(t,e)})}}),r._p.forEach(e=>{let t=o.run(()=>e({store:b,app:r._a,pinia:r,options:s}));mc(b,t)}),m&&a&&n.hydrate&&n.hydrate(b.$state,m),l=!0,u=!0,b}function vc(e,t,n){let r,i=typeof t==`function`;r=i?n:t;function a(n,a){let o=Xn();return n||=o?Yn(Ws,null):null,n&&Us(n),n=Hs,n._s.has(e)||(i?_c(e,t,r,n):gc(e,r,n)),n._s.get(e)}return a.$id=e,a}function yc(e,t){let n=e.trim();if(n===``)return t;let r=Number(n);return Number.isFinite(r)?r:t}function bc(e){let t=t=>(e(t)??``).trim();return{dot:t(`--hq-fx-dot`),text:t(`--hq-text`),muted:t(`--hq-text-muted`),accent:t(`--hq-accent`),ok:t(`--hq-correct`),ko:t(`--hq-wrong`),choices:[t(`--hq-choice-a`),t(`--hq-choice-b`),t(`--hq-choice-c`),t(`--hq-choice-d`)],lineOpacity:yc(t(`--hq-fx-line-opacity`),.2),glow:yc(t(`--hq-fx-glow`),.3),dustDensity:yc(t(`--hq-fx-dust-density`),1),dustAlpha:yc(t(`--hq-fx-dust-alpha`),1),speed:yc(t(`--hq-fx-speed`),1),pixel:yc(t(`--hq-fx-pixel`),0)>0,fontLabel:t(`--hq-font-label`),fontDisplay:t(`--hq-font-display`),labelSpacing:t(`--hq-label-spacing`)}}function xc(e){let t=getComputedStyle(e);return bc(e=>t.getPropertyValue(e))}var Sc=.05,Cc=`(prefers-reduced-motion: reduce)`;function wc(e,t,n){let r=e.getContext(`2d`);if(!r)throw Error(`mountScene: 2D canvas context unavailable`);let i=typeof matchMedia==`function`?matchMedia(Cc):null,a={ctx:r,w:0,h:0,t:0,dt:0,theme:xc(e),reduced:i?.matches??!1},o,s=0,c=0,l=0,u=!1,d=!1;function f(){let t=e.clientWidth,n=e.clientHeight,i=window.devicePixelRatio||1;return t===a.w&&n===a.h&&i===l?!1:(a.w=t,a.h=n,l=i,e.width=Math.round(t*i),e.height=Math.round(n*i),r.setTransform(i,0,0,i,0,0),!0)}function p(){a.t=0,a.dt=0,o=t.init(a,n())}function m(e){s=0,a.dt=Math.min(Math.max((e-c)/1e3,0),Sc)*a.theme.speed,c=e,a.t+=a.dt,r.clearRect(0,0,a.w,a.h);try{t.draw(a,o,n())}catch(e){d||console.error(`fx scene draw failed`,e),d=!0}h()}function h(){u||s||document.visibilityState===`hidden`||(s=requestAnimationFrame(m))}function g(){s&&cancelAnimationFrame(s),s=0}function _(){document.visibilityState===`hidden`?g():(c=performance.now(),h())}function v(e){a.reduced=e.matches}let y=new ResizeObserver(()=>{let e=a.w===0||a.h===0;f()&&e&&p()});return f(),p(),c=performance.now(),y.observe(e),document.addEventListener(`visibilitychange`,_),i?.addEventListener(`change`,v),h(),{restart(){u||(f(),p())},refreshTheme(){u||(a.theme=xc(e))},destroy(){u||(u=!0,g(),y.disconnect(),document.removeEventListener(`visibilitychange`,_),i?.removeEventListener(`change`,v))}}}var Tc=30,Ec=4;function Dc(e,t){let n=Math.max(0,Math.min(Math.floor(t),Tc)),r=t>0?e/t:0,i=Math.min(Math.max(r,0),1);return{dots:n,lit:Math.ceil(i*n),danger:e>0&&e<=Ec,fraction:i,seconds:Math.max(0,Math.ceil(e))}}var Oc=2.39996,kc=1.35,Ac=.75,jc=(e,t)=>t*1.3*Math.sqrt(e+.6);function Mc(e,t,n,r){let i=e*Oc+.5,a=jc(e,r);return{x:t+Math.cos(i)*a*kc,y:n+Math.sin(i)*a*Ac}}function Nc(e,t,n,r=.05){let i=r*Math.max(Math.min(t,n),0),a=jc(Math.max(e-1,0),1),o=.45*Math.max(t,0)/(a*kc),s=.45*Math.max(n,0)/(a*Ac);return Math.min(i,o,s)}var Pc=[[-.5,0],[-.15,.35],[.5,-.4]];function Fc(e,t,n,r){let i=[],a=0;for(let e=0;e<Pc.length-1;e++){let[t,n]=Pc[e],[r,o]=Pc[e+1],s=Math.hypot(r-t,o-n);i.push(s),a+=s}return Array.from({length:Math.max(e,0)},(o,s)=>{let c=(e<=1?0:s/(e-1))*a,l=0;for(;l<i.length-1&&c>i[l];)c-=i[l],l++;let u=i[l]>0?c/i[l]:0,[d,f]=Pc[l],[p,m]=Pc[l+1];return{x:t+(d+(p-d)*u)*r,y:n+(f+(m-f)*u)*r}})}function Ic(e,t,n,r){let i=Math.max(e,0),a=Math.ceil(i/2),o=r/2,s=(e,r,i)=>Array.from({length:e},(a,s)=>{let c=e<=1?0:s/(e-1);return{x:t+r+(i-r)*c,y:n-o+2*o*c}});return[...s(a,-o,o),...s(i-a,o,-o)]}function Lc(e,t){let n=Math.max(t,0),r=(e,t)=>Array.from({length:Math.max(t-e-1,0)},(t,n)=>[e+n,e+n+1]);if(e===`check`)return r(0,n);let i=Math.ceil(n/2);return[...r(0,i),...r(i,n)]}function Rc(e){return .06+.74*Math.min(Math.abs(e),1)}function zc(e){let t=.15,n=[];for(let r=0;n.length<Math.max(e,0)&&r<40;r++){let i=.92-r*t*.9;if(i<=.08)break;let a=Rc(i)-.07,o=Math.max(Math.floor(2*a/t)+1,1);for(let r=0;r<o&&n.length<e;r++)n.push({x:(r-(o-1)/2)*t,y:i})}return n}var Bc=[.5,.3,.7];function Vc(e,t=45,n=6){let r=e[0]??0;return e.slice(0,3).map(e=>r>0?Math.max(Math.round(t*e/r),n):n)}var Hc=Math.PI*2,Uc=e=>Math.min(Math.max(e,0),1),Wc=(e,t)=>e+Math.random()*(t-e);function Gc(e,t,n,r,i,a){let{ctx:o}=e;if(o.globalAlpha=Uc(i),o.fillStyle=a??e.theme.dot,e.theme.pixel){let e=Math.max(Math.round(r*2),1);o.fillRect(Math.round(t-e/2),Math.round(n-e/2),e,e)}else o.beginPath(),o.arc(t,n,Math.max(r,0),0,Hc),o.fill();o.globalAlpha=1}function Kc(e,t,n,r,i,a){if(r<=0)return;let{ctx:o}=e,s=o.createRadialGradient(t,n,0,t,n,r);s.addColorStop(0,a),s.addColorStop(1,`transparent`),o.globalAlpha=Uc(i*e.theme.glow),o.fillStyle=s,o.fillRect(t-r,n-r,r*2,r*2),o.globalAlpha=1}function qc(e,t,n,r,i,a,o=.6,s){let{ctx:c}=e;c.globalAlpha=Uc(a*e.theme.lineOpacity),c.strokeStyle=s??e.theme.dot,c.lineWidth=o,c.beginPath(),c.moveTo(t,n),c.lineTo(r,i),c.stroke(),c.globalAlpha=1}function Jc(e,t){let n=parseFloat(e);return Number.isFinite(n)?e.endsWith(`em`)&&!e.endsWith(`rem`)?n*t:n:0}function Yc(e,t,n,r,i){let{ctx:a}=e;a.font=`${i}px ${e.theme.fontLabel}`;let o=Jc(e.theme.labelSpacing,i),s=[...t],c=s.map(e=>a.measureText(e).width),l=c.reduce((e,t)=>e+t,0)+o*Math.max(s.length-1,0),u=a.textAlign;a.textAlign=`left`;let d=n-l/2;s.forEach((e,t)=>{a.fillText(e,d,r),d+=c[t]+o}),a.textAlign=u}function Xc(e,t,n){return Array.from({length:Math.max(0,Math.round(e))},()=>({x:Wc(0,t),y:Wc(0,n),vx:Wc(-6,6),vy:Wc(-6,6),r:Wc(.4,1),a:Wc(.06,.25)}))}var Zc=(e,t)=>Math.min(Math.max(Math.min(e,t)/480,1),2.2);function Qc(e,t){let{w:n,h:r,dt:i}=e,a=Zc(n,r),o=e.theme.dustAlpha;for(let s of t)!e.reduced&&n>0&&r>0&&(s.x=((s.x+s.vx*i)%n+n)%n,s.y=((s.y+s.vy*i)%r+r)%r),Gc(e,s.x,s.y,s.r*a,s.a*o)}var $c=Math.PI*2,el=-Math.PI/2,tl=(e,t)=>e+Math.random()*(t-e);function nl(e){return Array.from({length:e},()=>({off:!1,x:0,y:0,vx:0,vy:0,a:1}))}var rl={init(e,t){let{dots:n}=Dc(t.remaining,t.total);return{sparks:nl(n)}},draw(e,t,n){let{ctx:r,theme:i,dt:a}=e,o=Dc(n.remaining,n.total);t.sparks.length!==o.dots&&(t.sparks=nl(o.dots));let s=e.w/2,c=e.h/2,l=Math.min(e.w,e.h)*.42,u=l/100,d=Math.min(Math.max(o.seconds-n.remaining,0),1),f=l*(o.danger&&!e.reduced?1+.035*(1-d)**4:1),p=o.danger?i.ko:i.dot;o.danger&&Kc(e,s,c,f*1.5,.2*(1-(e.reduced?0:d))**2,i.ko),r.lineWidth=1,r.strokeStyle=i.dot,r.globalAlpha=Math.min(i.lineOpacity*.4,1),r.beginPath(),r.arc(s,c,f,0,$c),r.stroke(),o.fraction>0&&(r.strokeStyle=p,r.lineWidth=1.4,r.globalAlpha=o.danger?.65:Math.min(i.lineOpacity*2,1),r.beginPath(),r.arc(s,c,f,el,el+$c*o.fraction),r.stroke()),r.globalAlpha=1;for(let n=0;n<o.dots;n++){let r=t.sparks[n],i=el+n/o.dots*$c,l=s+Math.cos(i)*f,d=c+Math.sin(i)*f;if(n<o.lit)r.off=!1,r.a=1,Kc(e,l,d,Math.max(7,10*u),.8,p),Gc(e,l,d,Math.max(1.8,2.6*u),1,p);else{if(!r.off){r.off=!0,r.x=l,r.y=d;let e=tl(25,45)*u;r.vx=Math.cos(i)*e+tl(-8,8)*u,r.vy=Math.sin(i)*e+tl(-8,8)*u}e.reduced?(r.a=Math.max(0,r.a-a*1.5),Gc(e,l,d,Math.max(1.8,2.6*u),r.a,p)):(r.x+=r.vx*a,r.y+=r.vy*a,r.vx*=.985,r.vy*=.985,r.a=Math.max(0,r.a-a*.45),Gc(e,r.x,r.y,Math.max(1,1.4*u),r.a*.6,p))}}}},il=[`aria-label`],al={class:`fx-countdown__num`,"aria-hidden":`true`},ol=br({__name:`FxCountdown`,props:{total:{},remaining:{},size:{}},setup(e){let t=e,n=R(null),r=K(()=>Dc(t.remaining,t.total)),i=null;return zr(()=>{n.value&&(i=wc(n.value,rl,()=>({total:t.total,remaining:t.remaining})))}),$n(()=>t.total,()=>i?.restart()),Hr(()=>i?.destroy()),(t,i)=>(V(),H(`div`,{class:N([`fx-countdown`,[`fx-countdown--${e.size??`compact`}`,{"fx-countdown--danger":r.value.danger}]]),role:`timer`,"aria-live":`off`,"aria-label":`${e.remaining.toFixed(1)} seconds remaining`},[U(`canvas`,{ref_key:`canvas`,ref:n,class:`fx-countdown__canvas`,"aria-hidden":`true`},null,512),U(`span`,al,P(r.value.seconds),1)],10,il))}}),sl=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},cl=sl(ol,[[`__scopeId`,`data-v-80535576`]]),ll=sl(br({__name:`BrandLogo`,props:{centered:{type:Boolean}},setup(e){return(t,n)=>(V(),H(`svg`,{class:N([`hq-logo`,{"hq-logo--center":e.centered}]),viewBox:`0 0 1952 832`,role:`img`,"aria-label":`HashQuiz`},[...n[0]||=[U(`path`,{class:`hq-logo__hash-back`,d:`M544 407 517 532 645 532 672 407ZM27 407 0 532 129 533 102 659 230 659 285 406ZM82 154 55 279 183 279 210 154ZM497 27 470 153 597 154 570 280 700 279 727 154 598 153 625 27ZM239 27 212 153 340 153 367 27Z`},null,-1),U(`path`,{class:`hq-logo__hash-front`,d:`M1840 419 1816 526 1927 526 1951 419ZM212 154 157 405 285 405 313 280 438 280 412 406 286 407 258 532 386 532 360 659 480 659 464 741 581 741 562 830 691 830 718 705 601 705 619 615 498 614 596 154Z`},null,-1),U(`path`,{class:`hq-logo__text`,d:`M1400 149 1399 248 1597 248 1598 280 1552 281 1551 315 1510 315 1508 351 1469 351 1467 386 1434 387 1432 420 1398 421 1399 525 1741 526 1765 418 1597 417 1596 390 1598 387 1642 387 1644 350 1684 349 1687 314 1725 314 1727 279 1762 279 1762 149ZM1234 149 1231 153 1231 526 1346 526 1349 524 1350 500 1349 150ZM782 149 781 458 817 459 818 492 850 493 850 526 1109 526 1109 494 1141 492 1141 460 1177 458 1177 149 1059 149 1058 414 901 414 900 150ZM1231 1 1233 108 1349 109 1349 1Z`},null,-1)]],2))}}),[[`__scopeId`,`data-v-317b1291`]]),ul=e=>Xc(70*Math.min(Math.max(e.w*e.h/921600,.3),1.6)*e.theme.dustDensity,e.w,e.h),dl={init(e){return{dust:ul(e),w:e.w,h:e.h}},draw(e,t){(e.w!==t.w||e.h!==t.h)&&(t.dust=ul(e),t.w=e.w,t.h=e.h),Qc(e,t.dust)}},fl=sl(br({__name:`FxBackdrop`,setup(e){let t=R(null),n=null;return zr(()=>{t.value&&(n=wc(t.value,dl,()=>({})))}),Hr(()=>n?.destroy()),(e,n)=>(V(),H(`canvas`,{ref_key:`canvas`,ref:t,class:`fx-backdrop`,"aria-hidden":`true`},null,512))}}),[[`__scopeId`,`data-v-b3f1f5c8`]]),pl=18,ml=3.4,hl=.9,gl=4.9,_l=.8,vl=5.8,yl=e=>1-(1-Uc(e))**3,bl=e=>Uc(e)*Uc(e),xl=[[-.8,-1],[.8,-1],[.06,0],[.8,1],[-.8,1],[-.06,0]],Sl={init(){return null},draw(e){let{w:t,h:n,theme:r,reduced:i}=e,a=Math.min(t*.5,n*.5)*.92,o=t/2,s=n/2,c=i?0:e.t%vl,l=i?0:Math.PI*yl((c-gl)/_l),u=Math.cos(l),d=Math.sin(l),f=(e,t)=>[o+(e*u-t*d)*a,s+(e*d+t*u)*a],p=xl.map(([e,t])=>f(e,t));for(let t=0;t<p.length;t++){let n=p[t],r=p[(t+1)%p.length];qc(e,n[0],n[1],r[0],r[1],2.5,1)}for(let t of p)Gc(e,t[0],t[1],1.6,.7);let m=zc(pl),h=Math.max(a*.07,1.2);for(let t=0;t<pl;t++){let n=m[t],a=m[17-t],o,s;if(i){let e=t<pl/2;o=e?n.x:-a.x,s=e?n.y:-a.y}else{let e=(c-t/17*ml)/hl;if(e<=0)o=-a.x,s=-a.y;else if(e>=1)o=n.x,s=n.y;else if(e<.3){let t=bl(e/.3);o=-a.x*(1-t),s=-a.y*(1-t)}else{let t=bl((e-.3)/.7);o=n.x*t,s=n.y*t}}let[l,u]=f(o,s);Kc(e,l,u,h*3,.5,r.dot),Gc(e,l,u,h,.95)}}},Cl=sl(br({__name:`FxHourglass`,setup(e){let t=R(null),n=null;return zr(()=>{t.value&&(n=wc(t.value,Sl,()=>({})))}),Hr(()=>n?.destroy()),(e,n)=>(V(),H(`canvas`,{ref_key:`canvas`,ref:t,class:`fx-hourglass`,"aria-hidden":`true`},null,512))}}),[[`__scopeId`,`data-v-faf42b14`]]),wl=2,Tl=3.2,El=1.1,Dl=.8,Ol=.8,kl=.6,Al=4,jl=(e,t)=>e+Math.random()*(t-e),Ml=e=>1-(1-Uc(e))**3,Nl=e=>Math.min(Math.max(Math.min(e.w,e.h)/370,.8),2.6);function Pl(e){let t=new Set;for(let n of e.values())n.leaving===null&&t.add(n.slot);let n=0;for(;t.has(n);)n++;return n}function Fl(e,t,n){let r=0;for(let e of t.values())r=Math.max(r,e.slot+1);return Nc(Math.max(r,1),e.w,e.h,n)}function Il(e,t,n){return Mc(t.slot,e.w/2,e.h/2,n)}function Ll(e,t,n,r){let i=Pl(t.dots),a={id:n.id,pseudo:n.pseudo,slot:i,seq:t.seq++,x:0,y:0,link:null,born:e.t,landed:null,leaving:null,label:0};t.dots.set(n.id,a);let o=Fl(e,t.dots,t.spread),s=Il(e,a,o),c=1/0;for(let n of t.dots.values()){if(n===a||n.leaving!==null)continue;let t=Il(e,n,o),r=(t.x-s.x)**2+(t.y-s.y)**2;r<c&&(c=r,a.link=n.id)}if(r&&!e.reduced){let t=jl(0,Math.PI*2),n=Math.max(e.w,e.h)*.7;a.x=e.w/2+Math.cos(t)*n,a.y=e.h/2+Math.sin(t)*n}else a.x=s.x,a.y=s.y,a.landed=r?e.t:e.t-El}var Rl={init(e,t){let n={dots:new Map,seq:0,spread:t.spread};for(let r of t.players)Ll(e,n,r,r.id===t.highlightId);return n},draw(e,t,n){let{ctx:r,theme:i,t:a,dt:o}=e,s=new Set;for(let r of n.players){s.add(r.id);let n=t.dots.get(r.id);n?(n.pseudo=r.pseudo,n.leaving!==null&&(n.leaving=null)):Ll(e,t,r,!0)}for(let e of t.dots.values())!s.has(e.id)&&e.leaving===null&&(e.leaving=a),e.leaving!==null&&a-e.leaving>Ol&&t.dots.delete(e.id);let c=Nl(e);t.spread=n.spread;let l=Fl(e,t.dots,t.spread),u=Math.round(Math.min(Math.max(e.h*.024,11),28)),d=[...t.dots.values()].filter(e=>e.leaving===null).sort((e,t)=>t.seq-e.seq),f=d[0],p=new Set(d.slice(0,Math.max(n.labels,0)).map(e=>e.id)),m=t=>{let n=t.leaving===null?1:1-(a-t.leaving)/Ol,r=e.reduced?(a-t.born)/kl:1;return Uc(n)*Uc(r)},h=1-Math.exp(-o*Tl),g=new Map;for(let n of t.dots.values()){let t=Il(e,n,l),r=e.reduced?t.x:t.x+Math.sin(a*.7+n.slot)*1.5,i=e.reduced?t.y:t.y+Math.cos(a*.6+n.slot*1.3)*1.5;g.set(n.id,{x:n.x,y:n.y}),e.reduced?(n.x=r,n.y=i):(n.x+=(r-n.x)*h,n.y+=(i-n.y)*h),n.landed===null&&Math.hypot(r-n.x,i-n.y)<wl&&(n.landed=a)}for(let n of t.dots.values()){if(!n.link||n.landed===null)continue;let r=t.dots.get(n.link);if(!r||r.landed===null)continue;let i=Ml((a-n.landed)/Dl)*Math.min(m(n),m(r));qc(e,n.x,n.y,r.x,r.y,i,.6*c)}r.textAlign=`center`,r.textBaseline=`top`,r.font=`${u}px ${i.fontLabel}`;for(let s of t.dots.values()){let t=m(s);if(t<=0)continue;let d=s.id===n.highlightId,h=d?i.accent:i.dot;if(s.landed===null){let n=g.get(s.id),i=s.x-n.x,a=s.y-n.y,o=Math.hypot(i,a)||1,u=Il(e,s,l),d=Math.min(Math.hypot(u.x-s.x,u.y-s.y)*.25,60*c),f=s.x-i/o*d,p=s.y-a/o*d,m=r.createLinearGradient(s.x,s.y,f,p);m.addColorStop(0,h),m.addColorStop(1,`transparent`),r.globalAlpha=.6*t,r.strokeStyle=m,r.lineWidth=1.2*c,r.beginPath(),r.moveTo(s.x,s.y),r.lineTo(f,p),r.stroke(),r.globalAlpha=1}else if(!e.reduced){let e=(a-s.landed)/El;e<1&&(r.globalAlpha=Uc((1-e)*.5*t),r.strokeStyle=h,r.lineWidth=c,r.beginPath(),r.arc(s.x,s.y,(4+Ml(e)*26)*c,0,Math.PI*2),r.stroke(),r.globalAlpha=1)}d?(Kc(e,s.x,s.y,36*c,t,h),Kc(e,s.x,s.y,14*c,t,h)):s===f&&s.landed!==null&&Kc(e,s.x,s.y,18*c,t,h),Gc(e,s.x,s.y,(d?3.8:s===f?2.8:2.1)*c,t,h);let _=s.landed!==null&&s.pseudo&&p.has(s.id)?s===f?.95:.4:0;s.label+=(_-s.label)*(1-Math.exp(-o*Al)),s.pseudo&&s.label>.01&&(r.globalAlpha=Uc(s.label*t),r.fillStyle=d?i.accent:i.text,r.fillText(s.pseudo,s.x,s.y+5*c+u*.3),r.globalAlpha=1)}}},zl={class:`fx-lobby`},Bl=sl(br({__name:`FxLobby`,props:{players:{},highlightId:{},labels:{default:8},spread:{}},setup(e){let t=e,n=R(null),r=null;return zr(()=>{n.value&&(r=wc(n.value,Rl,()=>({players:t.players,highlightId:t.highlightId,labels:t.labels,spread:t.spread})))}),Hr(()=>r?.destroy()),(e,t)=>(V(),H(`div`,zl,[U(`canvas`,{ref_key:`canvas`,ref:n,class:`fx-lobby__canvas`,"aria-hidden":`true`},null,512)]))}}),[[`__scopeId`,`data-v-b52d79da`]]);function Vl(e){return e===1?`1er`:`${e}e`}var Hl=[5,3.3,1.6],Ul=.9,Wl=[.8,1.6],Gl=1.4,Kl=5,ql=70,Jl=.74,Yl=(e,t)=>e+Math.random()*(t-e),Xl=e=>1-(1-Uc(e))**3,Zl=(e,t)=>Math.min(t*.04,e*.045);function Ql(e,t,n,r){return{rank:t,k:n,x:Yl(0,e.w),y:Yl(0,e.h),vx:Yl(-12,12),vy:Yl(-12,12),r}}var $l={init(e,t){let n=Vc(t.scores),r=[];return n.forEach((t,n)=>{for(let i=0;i<t;i++)r.push(Ql(e,n,i,Yl(1.1,1.9)))}),{dots:r,counts:n,me:t.outsideRank===null?null:Ql(e,-1,0,3),bursts:[],fired:!1,nextAt:0,shown:[]}},draw(e,t,n){let{w:r,h:i,t:a,dt:o,theme:s,reduced:c}=e,l=Zl(r,i),u=i*Jl,d=e=>u-Math.ceil((t.counts[e]??0)/Kl)*l,f=e=>r*Bc[e],p=e=>c?0:Hl[e],m=c?Uc(a/.6):1,h=Math.max(l*.16,1.8),g=t.counts.length>0;g&&a>p(0)+1.2&&Kc(e,f(0),(d(0)+u)/2,i*.35,(.2+.08*Math.sin(a*2))*m,s.accent);for(let d of t.dots){let t=p(d.rank)+d.k*.015,g=d.rank===0?1:.8;if(a<t){c||(d.x=(d.x+d.vx*o+r)%r,d.y=(d.y+d.vy*o+i)%i,Gc(e,d.x,d.y,d.r*.7,.35));continue}let _=f(d.rank)+(d.k%Kl-2)*l,v=u-Math.floor(d.k/Kl)*l;if(c)d.x=_,d.y=v;else{let e=1-Math.exp(-4.5*o);d.x+=(_-d.x)*e,d.y+=(v-d.y)*e}Gc(e,d.x,d.y,h,g*m,n.highlight===d.rank?s.accent:void 0)}if(t.me&&(c?(t.me.x=r*.5,t.me.y=i*.3):(t.me.x=(t.me.x+t.me.vx*o+r)%r,t.me.y=(t.me.y+t.me.vy*o+i)%i),Kc(e,t.me.x,t.me.y,l*1.8,.5*m,s.accent),Gc(e,t.me.x,t.me.y,Math.max(h*1.5,3),m,s.accent)),g&&!c){let n=()=>t.bursts.reduce((e,t)=>e+t.sparks.length,0),c=(e,r,o,s,c)=>{let l=Math.min(Math.round(c),250-n());if(l<=0)return;let u=Array.from({length:l},()=>{let t=Yl(0,Math.PI*2),n=Yl(60,200)*Math.max(i/1080,.5)*1.6*o;return{x:e,y:r,vx:Math.cos(t)*n,vy:Math.sin(t)*n-40*o,a:1}});t.bursts.push({x:e,y:r,at:a,scale:o,color:s,sparks:u})};if(!t.fired&&a>p(0)+1.2&&(c(f(0),d(0)-i*.02,1,s.accent,ql),t.fired=!0,t.nextAt=a+Yl(...Wl)),t.fired&&a>=t.nextAt){let e=Math.min(d(0),d(1),d(2))-i*.08,n=Yl(.45,.85),o=Math.random()<.25?s.accent:s.dot;c(Yl(r*.15,r*.85),Yl(i*.2,Math.max(i*.22,e)),n,o,ql*n*.8),t.nextAt=a+Yl(...Wl)}for(let n of t.bursts){let t=(a-n.at)/Gl;if(t<1){let r=Xl(t)*i*(n.scale<1?.28:.4)*n.scale;for(let i=0;i<48;i++){let a=i/48*Math.PI*2,o=(i+1)/48*Math.PI*2;qc(e,n.x+Math.cos(a)*r,n.y+Math.sin(a)*r,n.x+Math.cos(o)*r,n.y+Math.sin(o)*r,2.5*(1-t),1.5,n.color)}}for(let t of n.sparks)t.x+=t.vx*o,t.y+=t.vy*o,t.vx*=.97,t.vy=t.vy*.97+30*o,t.a-=o*.4,t.a>0&&Gc(e,t.x,t.y,h*.9*Math.max(n.scale,.7),t.a,n.color);n.sparks=n.sparks.filter(e=>e.a>0)}t.bursts=t.bursts.filter(e=>e.sparks.length>0||a-e.at<Gl)}e.ctx.fillStyle=s.muted;for(let n=0;n<t.counts.length;n++){let t=c?m:Xl((a-p(n)-Ul)/.6);t<=0||(e.ctx.globalAlpha=t,Yc(e,`0${n+1}`,f(n),d(n)-Math.max(i*.03,8),Math.max(i*.026,10)),e.ctx.globalAlpha=1)}let _=[0,1,2].map(e=>e<t.counts.length&&a>=p(e)+.9);_.push(t.me!==null),(_.length!==t.shown.length||_.some((e,n)=>e!==t.shown[n]))&&(t.shown=_,n.onShown?.(_))}},eu=[`aria-label`],tu={class:`fx-podium__name`},nu={class:`fx-podium__score`},ru=sl(br({__name:`FxPodium`,props:{podium:{},highlightId:{}},setup(e){let t=e,n=R(null),r=R([]),i=null,a=K(()=>t.podium.slice(0,3)),o=K(()=>{let e=a.value.findIndex(e=>e.playerId===t.highlightId);return e>=0?e:null}),s=K(()=>!t.highlightId||o.value!==null?null:t.podium.find(e=>e.playerId===t.highlightId)?.rank??null),c=K(()=>a.value.map(e=>`${e.rank}. ${e.pseudo} ${e.score}`).join(`, `));return zr(()=>{n.value&&(i=wc(n.value,$l,()=>({scores:a.value.map(e=>e.score),highlight:o.value,outsideRank:s.value,onShown:e=>{r.value=e}})))}),$n(()=>t.podium.map(e=>`${e.playerId}:${e.score}`).join(`|`),()=>i?.restart()),Hr(()=>i?.destroy()),(t,i)=>(V(),H(`div`,{class:`fx-podium`,role:`img`,"aria-label":c.value},[U(`canvas`,{ref_key:`canvas`,ref:n,class:`fx-podium__canvas`,"aria-hidden":`true`},null,512),(V(!0),H(B,null,Yr(a.value,(t,n)=>(V(),H(`div`,{key:t.playerId,class:N([`fx-podium__label`,{"fx-podium__label--on":r.value[n],"fx-podium__label--me":t.playerId===e.highlightId,"fx-podium__label--first":n===0}]),style:ve({left:`${z(Bc)[n]*100}%`})},[U(`span`,tu,P(t.pseudo),1),U(`span`,nu,P(t.score.toLocaleString())+` pts`,1)],6))),128)),s.value===null?G(``,!0):(V(),H(`p`,{key:0,class:N([`fx-podium__outside`,{"fx-podium__outside--on":r.value[3]}])},P(z(Vl)(s.value))+` / `+P(e.podium.length),3))],8,eu))}}),[[`__scopeId`,`data-v-d5e3b296`]]),iu=13,au=1.1,ou=.35,su=1.2,cu=.5,lu=1.4500000000000002,uu=3.45,du=1,fu=1.8,pu=3.6000000000000005,mu=e=>1-(1-Uc(e))**3,hu=(e,t)=>e+Math.random()*(t-e);function gu(){return Array.from({length:iu},(e,t)=>({ang:t/iu*Math.PI*2+Math.random()*.6,dist:.55+Math.random()*.5,delay:Math.random()*ou,x:0,y:0,vx:0,vy:0,rest:!1,sx:0,sy:0}))}var _u={init(e,t){let n=gu();if(!t.correct){let t=2.2,r=Math.min(e.w,e.h*1.5)*.5*.7*1.4-t;n.forEach((n,i)=>{n.x=e.w/2+((i+.5)/iu-.5)*2*r*.9,n.y=e.h-t-2-i%2*t*1.8,n.sx=n.x,n.sy=n.y,n.rest=!0})}return{motes:n,cycle:0,broken:!1,piles:new Map}},draw(e,t,n){let{theme:r,reduced:i,dt:a}=e,o=n.correct?uu:pu,s=i?0:Math.floor(e.t/o);if(s!==t.cycle){if(n.correct)t.motes=gu();else for(let e of t.motes)e.sx=e.x,e.sy=e.y,e.rest=!1;t.cycle=s,t.broken=!1,t.piles.clear()}let c=i?e.t:e.t-s*o,l=e.w/2,u=Math.min(e.w,e.h*1.5)*.5,d=n.correct?r.ok:r.ko,f=Uc(e.t/.6),p=(t,n)=>{let r=u*t.dist*1.3;return{x:l+Math.cos(t.ang)*r,y:n+Math.sin(t.ang)*r*Math.min(1,e.h*.42/(u*1.4))}},m=(t,n,r,i,a)=>{for(let[o,s]of Lc(t,iu))qc(e,n[o],r[o],n[s],r[s],Math.min(i[o],i[s])*a,1,d)};if(n.correct){let n=e.h/2,r=Fc(iu,l,n,u),a=i?1:1-Uc((c-lu-su)/cu),o=i?f:mu(c/au);Kc(e,l,n,u*(i?.9:.6+.4*o),.35*o*a,d);let s=[],h=[],g=[];for(let e=0;e<iu;e++){let o=t.motes[e],l=i?1:mu((c-o.delay)/au),u=p(o,n);s.push(u.x+(r[e].x-u.x)*l),h.push(u.y+(r[e].y-u.y)*l),g.push(i?f:(.25+.75*l)*a)}m(`check`,s,h,g.map((e,n)=>i?e:e*mu((c-t.motes[n].delay)/au)**2),4);for(let t=0;t<iu;t++)Kc(e,s[t],h[t],9,g[t]*.8,d),Gc(e,s[t],h[t],2.4,g[t],d);return}let h=2.2,g=u*.7,_=e.h*.4,v=e.h-h-2,y=Ic(iu,l,_,g);if(i){let t=y.map(e=>e.x),n=y.map(e=>e.y);m(`cross`,t,n,t.map(()=>f*.9),4);for(let r=0;r<iu;r++)Kc(e,t[r],n[r],8,f*.7,d),Gc(e,t[r],n[r],h,f*.9,d);return}if(c<fu){let n=c>1.6?.8:0,r=t.cycle===0?Uc(e.t/.4):1,i=[],a=[],o=[],s=[];for(let e=0;e<iu;e++){let l=t.motes[e],u=mu((c-l.delay)/du);l.x=l.sx+(y[e].x-l.sx)*u,l.y=l.sy+(y[e].y-l.sy)*u,i.push(l.x+hu(-n,n)),a.push(l.y+hu(-n,n)),o.push((.65+.25*u)*r),s.push(u*u*r)}m(`cross`,i,a,s,4);for(let t=0;t<iu;t++)Kc(e,i[t],a[t],8,o[t]*.7*s[t],d),Gc(e,i[t],a[t],h,o[t],d);return}let b=Math.max(e.h,60)*9;t.broken||=(t.motes.forEach((t,n)=>{let r=y[n];t.x=r.x,t.y=r.y,t.vx=(r.x-l)*hu(1,2.6)+hu(-20,20),t.vy=hu(-e.h*.9,-e.h*.1),t.rest=!1}),!0);let x=h*2.2,S=g*1.4-h;for(let n of t.motes){if(!n.rest){n.vy+=b*a,n.x=Math.min(Math.max(n.x+n.vx*a,l-S),l+S),n.y+=n.vy*a,n.vx*=1-1.5*a;let r=Math.round((n.x-l)/x),i=t.piles.get(r)??0,o=v-i*h*1.8;n.y>=o&&(n.y=o,Math.abs(n.vy)<e.h*.6?(n.x=l+(r+i%2*.5)*x,n.vy=0,n.rest=!0,t.piles.set(r,i+1)):(n.vy=-n.vy*.3,n.vx*=.5))}Gc(e,n.x,n.y,h,n.rest?.65:.85,d)}}},vu=sl(br({__name:`FxVerdict`,props:{correct:{type:Boolean},delta:{},answered:{type:Boolean}},setup(e){let t=e,n=R(null),r=null;return zr(()=>{n.value&&(r=wc(n.value,_u,()=>({correct:t.correct,delta:t.delta,answered:t.answered})))}),$n(()=>t.correct,()=>r?.restart()),Hr(()=>r?.destroy()),(e,t)=>(V(),H(`canvas`,{ref_key:`canvas`,ref:n,class:`fx-verdict`,"aria-hidden":`true`},null,512))}}),[[`__scopeId`,`data-v-0e882c37`]]),yu=[`disabled`],bu={class:`hq-btn__badge`},xu={class:`hq-btn__text`},Su=sl(br({__name:`AnswerButton`,props:{id:{},text:{},state:{},colorId:{}},emits:[`select`],setup(e,{emit:t}){let n=t;return(t,r)=>(V(),H(`button`,{class:N([`hq-btn`,`hq-btn--${e.colorId}`,`hq-btn--${e.state}`]),disabled:e.state!==`idle`&&e.state!==`selected`,onClick:r[0]||=t=>n(`select`,e.id)},[U(`span`,bu,P(e.id.toUpperCase()),1),U(`span`,xu,P(e.text),1)],10,yu))}}),[[`__scopeId`,`data-v-ce737272`]]),Cu={class:`hq-podium`},wu={class:`hq-podium__rank`},Tu={class:`hq-podium__name`},Eu={class:`hq-podium__score`},Du=sl(br({__name:`Podium`,props:{podium:{}},setup(e){function t(e){return e===1?`🥇`:e===2?`🥈`:e===3?`🥉`:`#${e}`}function n(e){return e<=3?`hq-podium__row--top${e}`:``}return(r,i)=>(V(),H(`ol`,Cu,[(V(!0),H(B,null,Yr(e.podium,e=>(V(),H(`li`,{key:e.rank,class:N([`hq-podium__row`,n(e.rank)])},[U(`span`,wu,P(t(e.rank)),1),U(`span`,Tu,P(e.pseudo),1),U(`span`,Eu,P(e.score.toLocaleString())+` pts`,1)],2))),128))]))}}),[[`__scopeId`,`data-v-8d79b015`]]),Ou=s(((e,t)=>{t.exports=function(){return typeof Promise==`function`&&Promise.prototype&&Promise.prototype.then}})),ku=s((e=>{var t,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(e){if(!e)throw Error(`"version" cannot be null or undefined`);if(e<1||e>40)throw Error(`"version" should be in range from 1 to 40`);return e*4+17},e.getSymbolTotalCodewords=function(e){return n[e]},e.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t},e.setToSJISFunction=function(e){if(typeof e!=`function`)throw Error(`"toSJISFunc" is not a valid function.`);t=e},e.isKanjiModeEnabled=function(){return t!==void 0},e.toSJIS=function(e){return t(e)}})),Au=s((e=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`l`:case`low`:return e.L;case`m`:case`medium`:return e.M;case`q`:case`quartile`:return e.Q;case`h`:case`high`:return e.H;default:throw Error(`Unknown EC Level: `+t)}}e.isValid=function(e){return e&&e.bit!==void 0&&e.bit>=0&&e.bit<4},e.from=function(n,r){if(e.isValid(n))return n;try{return t(n)}catch{return r}}})),ju=s(((e,t)=>{function n(){this.buffer=[],this.length=0}n.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=n})),Mu=s(((e,t)=>{function n(e){if(!e||e<1)throw Error(`BitMatrix size must be defined and greater than 0`);this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}n.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=n})),Nu=s((e=>{var t=ku().getSymbolSize;e.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,r=t(e),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,a=[r-7];for(let e=1;e<n-1;e++)a[e]=a[e-1]-i;return a.push(6),a.reverse()},e.getPositions=function(t){let n=[],r=e.getRowColCoords(t),i=r.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)e===0&&t===0||e===0&&t===i-1||e===i-1&&t===0||n.push([r[e],r[t]]);return n}})),Pu=s((e=>{var t=ku().getSymbolSize,n=7;e.getPositions=function(e){let r=t(e);return[[0,0],[r-n,0],[0,r-n]]}})),Fu=s((e=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(e){return e!=null&&e!==``&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){let n=e.size,r=0,i=0,a=0,o=null,s=null;for(let c=0;c<n;c++){i=a=0,o=s=null;for(let l=0;l<n;l++){let n=e.get(c,l);n===o?i++:(i>=5&&(r+=t.N1+(i-5)),o=n,i=1),n=e.get(l,c),n===s?a++:(a>=5&&(r+=t.N1+(a-5)),s=n,a=1)}i>=5&&(r+=t.N1+(i-5)),a>=5&&(r+=t.N1+(a-5))}return r},e.getPenaltyN2=function(e){let n=e.size,r=0;for(let t=0;t<n-1;t++)for(let i=0;i<n-1;i++){let n=e.get(t,i)+e.get(t,i+1)+e.get(t+1,i)+e.get(t+1,i+1);(n===4||n===0)&&r++}return r*t.N2},e.getPenaltyN3=function(e){let n=e.size,r=0,i=0,a=0;for(let t=0;t<n;t++){i=a=0;for(let o=0;o<n;o++)i=i<<1&2047|e.get(t,o),o>=10&&(i===1488||i===93)&&r++,a=a<<1&2047|e.get(o,t),o>=10&&(a===1488||a===93)&&r++}return r*t.N3},e.getPenaltyN4=function(e){let n=0,r=e.data.length;for(let t=0;t<r;t++)n+=e.data[t];return Math.abs(Math.ceil(n*100/r/5)-10)*t.N4};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw Error(`bad maskPattern:`+t)}}e.applyMask=function(e,t){let r=t.size;for(let i=0;i<r;i++)for(let a=0;a<r;a++)t.isReserved(a,i)||t.xor(a,i,n(e,a,i))},e.getBestMask=function(t,n){let r=Object.keys(e.Patterns).length,i=0,a=1/0;for(let o=0;o<r;o++){n(o),e.applyMask(o,t);let r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(o,t),r<a&&(a=r,i=o)}return i}})),Iu=s((e=>{var t=Au(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(e,r){switch(r){case t.L:return n[(e-1)*4+0];case t.M:return n[(e-1)*4+1];case t.Q:return n[(e-1)*4+2];case t.H:return n[(e-1)*4+3];default:return}},e.getTotalCodewordsCount=function(e,n){switch(n){case t.L:return r[(e-1)*4+0];case t.M:return r[(e-1)*4+1];case t.Q:return r[(e-1)*4+2];case t.H:return r[(e-1)*4+3];default:return}}})),Lu=s((e=>{var t=new Uint8Array(512),n=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)t[r]=e,n[e]=r,e<<=1,e&256&&(e^=285);for(let e=255;e<512;e++)t[e]=t[e-255]})(),e.log=function(e){if(e<1)throw Error(`log(`+e+`)`);return n[e]},e.exp=function(e){return t[e]},e.mul=function(e,r){return e===0||r===0?0:t[n[e]+n[r]]}})),Ru=s((e=>{var t=Lu();e.mul=function(e,n){let r=new Uint8Array(e.length+n.length-1);for(let i=0;i<e.length;i++)for(let a=0;a<n.length;a++)r[i+a]^=t.mul(e[i],n[a]);return r},e.mod=function(e,n){let r=new Uint8Array(e);for(;r.length-n.length>=0;){let e=r[0];for(let i=0;i<n.length;i++)r[i]^=t.mul(n[i],e);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r},e.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=e.mul(r,new Uint8Array([1,t.exp(i)]));return r}})),zu=s(((e,t)=>{var n=Ru();function r(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}r.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},r.prototype.encode=function(e){if(!this.genPoly)throw Error(`Encoder not initialized`);let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},t.exports=r})),Bu=s((e=>{e.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}})),Vu=s((e=>{var t=`[0-9]+`,n=`[A-Z $%*+\\-./:]+`,r=`(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+`;r=r.replace(/u/g,`\\u`);var i=`(?:(?![A-Z0-9 $%*+\\-./:]|`+r+`)(?:.|[\r
|
|
3
3
|
]))+`;e.KANJI=new RegExp(r,`g`),e.BYTE_KANJI=RegExp(`[^A-Z0-9 $%*+\\-./:]+`,`g`),e.BYTE=new RegExp(i,`g`),e.NUMERIC=new RegExp(t,`g`),e.ALPHANUMERIC=new RegExp(n,`g`);var a=RegExp(`^`+r+`$`),o=RegExp(`^[0-9]+$`),s=RegExp(`^[A-Z0-9 $%*+\\-./:]+$`);e.testKanji=function(e){return a.test(e)},e.testNumeric=function(e){return o.test(e)},e.testAlphanumeric=function(e){return s.test(e)}})),Hu=s((e=>{var t=Bu(),n=Vu();e.NUMERIC={id:`Numeric`,bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:`Alphanumeric`,bit:2,ccBits:[9,11,13]},e.BYTE={id:`Byte`,bit:4,ccBits:[8,16,16]},e.KANJI={id:`Kanji`,bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(e,n){if(!e.ccBits)throw Error(`Invalid mode: `+e);if(!t.isValid(n))throw Error(`Invalid version: `+n);return n>=1&&n<10?e.ccBits[0]:n<27?e.ccBits[1]:e.ccBits[2]},e.getBestModeForData=function(t){return n.testNumeric(t)?e.NUMERIC:n.testAlphanumeric(t)?e.ALPHANUMERIC:n.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(e){if(e&&e.id)return e.id;throw Error(`Invalid mode`)},e.isValid=function(e){return e&&e.bit&&e.ccBits};function r(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`numeric`:return e.NUMERIC;case`alphanumeric`:return e.ALPHANUMERIC;case`kanji`:return e.KANJI;case`byte`:return e.BYTE;default:throw Error(`Unknown mode: `+t)}}e.from=function(t,n){if(e.isValid(t))return t;try{return r(t)}catch{return n}}})),Uu=s((e=>{var t=ku(),n=Iu(),r=Au(),i=Hu(),a=Bu(),o=7973,s=t.getBCHDigit(o);function c(t,n,r){for(let i=1;i<=40;i++)if(n<=e.getCapacity(i,r,t))return i}function l(e,t){return i.getCharCountIndicator(e,t)+4}function u(e,t){let n=0;return e.forEach(function(e){let r=l(e.mode,t);n+=r+e.getBitsLength()}),n}function d(t,n){for(let r=1;r<=40;r++)if(u(t,r)<=e.getCapacity(r,n,i.MIXED))return r}e.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},e.getCapacity=function(e,r,o){if(!a.isValid(e))throw Error(`Invalid QR Code version`);o===void 0&&(o=i.BYTE);let s=(t.getSymbolTotalCodewords(e)-n.getTotalCodewordsCount(e,r))*8;if(o===i.MIXED)return s;let c=s-l(o,e);switch(o){case i.NUMERIC:return Math.floor(c/10*3);case i.ALPHANUMERIC:return Math.floor(c/11*2);case i.KANJI:return Math.floor(c/13);case i.BYTE:default:return Math.floor(c/8)}},e.getBestVersionForData=function(e,t){let n,i=r.from(t,r.M);if(Array.isArray(e)){if(e.length>1)return d(e,i);if(e.length===0)return 1;n=e[0]}else n=e;return c(n.mode,n.getLength(),i)},e.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw Error(`Invalid QR Code version`);let n=e<<12;for(;t.getBCHDigit(n)-s>=0;)n^=o<<t.getBCHDigit(n)-s;return e<<12|n}})),Wu=s((e=>{var t=ku(),n=1335,r=21522,i=t.getBCHDigit(n);e.getEncodedBits=function(e,a){let o=e.bit<<3|a,s=o<<10;for(;t.getBCHDigit(s)-i>=0;)s^=n<<t.getBCHDigit(s)-i;return(o<<10|s)^r}})),Gu=s(((e,t)=>{var n=Hu();function r(e){this.mode=n.NUMERIC,this.data=e.toString()}r.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);let i=this.data.length-t;i>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,i*3+1))},t.exports=r})),Ku=s(((e,t)=>{var n=Hu(),r=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.split(``);function i(e){this.mode=n.ALPHANUMERIC,this.data=e}i.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t=0;for(;t+2<=this.data.length;t+=2){let n=r.indexOf(this.data[t])*45;n+=r.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(r.indexOf(this.data[t]),6)},t.exports=i})),qu=s(((e,t)=>{var n=Hu();function r(e){this.mode=n.BYTE,this.data=typeof e==`string`?new TextEncoder().encode(e):new Uint8Array(e)}r.getBitsLength=function(e){return e*8},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)},t.exports=r})),Ju=s(((e,t)=>{var n=Hu(),r=ku();function i(e){this.mode=n.KANJI,this.data=e}i.getBitsLength=function(e){return e*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t=0;for(;t<this.data.length;t++){let n=r.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw Error(`Invalid SJIS character: `+this.data[t]+`
|
|
4
4
|
Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}},t.exports=i})),Yu=s(((e,t)=>{var n={single_source_shortest_paths:function(e,t,r){var i={},a={};a[t]=0;var o=n.PriorityQueue.make();o.push(t,0);for(var s,c,l,u,d,f,p,m,h;!o.empty();)for(l in s=o.pop(),c=s.value,u=s.cost,d=e[c]||{},d)d.hasOwnProperty(l)&&(f=d[l],p=u+f,m=a[l],h=a[l]===void 0,(h||m>p)&&(a[l]=p,o.push(l,p),i[l]=c));if(r!==void 0&&a[r]===void 0){var g=[`Could not find a path from `,t,` to `,r,`.`].join(``);throw Error(g)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t;r;)n.push(r),e[r],r=e[r];return n.reverse(),n},find_path:function(e,t,r){var i=n.single_source_shortest_paths(e,t,r);return n.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(e){var t=n.PriorityQueue,r={},i;for(i in e||={},t)t.hasOwnProperty(i)&&(r[i]=t[i]);return r.queue=[],r.sorter=e.sorter||t.default_sorter,r},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t!==void 0&&(t.exports=n)})),Xu=s((e=>{var t=Hu(),n=Gu(),r=Ku(),i=qu(),a=Ju(),o=Vu(),s=ku(),c=Yu();function l(e){return unescape(encodeURIComponent(e)).length}function u(e,t,n){let r=[],i;for(;(i=e.exec(n))!==null;)r.push({data:i[0],index:i.index,mode:t,length:i[0].length});return r}function d(e){let n=u(o.NUMERIC,t.NUMERIC,e),r=u(o.ALPHANUMERIC,t.ALPHANUMERIC,e),i,a;return s.isKanjiModeEnabled()?(i=u(o.BYTE,t.BYTE,e),a=u(o.KANJI,t.KANJI,e)):(i=u(o.BYTE_KANJI,t.BYTE,e),a=[]),n.concat(r,i,a).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function f(e,o){switch(o){case t.NUMERIC:return n.getBitsLength(e);case t.ALPHANUMERIC:return r.getBitsLength(e);case t.KANJI:return a.getBitsLength(e);case t.BYTE:return i.getBitsLength(e)}}function p(e){return e.reduce(function(e,t){let n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}function m(e){let n=[];for(let r=0;r<e.length;r++){let i=e[r];switch(i.mode){case t.NUMERIC:n.push([i,{data:i.data,mode:t.ALPHANUMERIC,length:i.length},{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.ALPHANUMERIC:n.push([i,{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.KANJI:n.push([i,{data:i.data,mode:t.BYTE,length:l(i.data)}]);break;case t.BYTE:n.push([{data:i.data,mode:t.BYTE,length:l(i.data)}])}}return n}function h(e,n){let r={},i={start:{}},a=[`start`];for(let o=0;o<e.length;o++){let s=e[o],c=[];for(let e=0;e<s.length;e++){let l=s[e],u=``+o+e;c.push(u),r[u]={node:l,lastCount:0},i[u]={};for(let e=0;e<a.length;e++){let o=a[e];r[o]&&r[o].node.mode===l.mode?(i[o][u]=f(r[o].lastCount+l.length,l.mode)-f(r[o].lastCount,l.mode),r[o].lastCount+=l.length):(r[o]&&(r[o].lastCount=l.length),i[o][u]=f(l.length,l.mode)+4+t.getCharCountIndicator(l.mode,n))}}a=c}for(let e=0;e<a.length;e++)i[a[e]].end=0;return{map:i,table:r}}function g(e,o){let c,l=t.getBestModeForData(e);if(c=t.from(o,l),c!==t.BYTE&&c.bit<l.bit)throw Error(`"`+e+`" cannot be encoded with mode `+t.toString(c)+`.
|
|
@@ -29,4 +29,4 @@ Option 2: Install and provide the "ws" package:
|
|
|
29
29
|
\r=`.split(``),Km=(()=>{let e=Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<Gm.length;t+=1)e[Gm[t].charCodeAt(0)]=-2;for(let t=0;t<Wm.length;t+=1)e[Wm[t].charCodeAt(0)]=t;return e})();function qm(e,t,n){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;)n(Wm[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6;else if(t.queuedBits>0)for(t.queue<<=6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;)n(Wm[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6}function Jm(e,t,n){let r=Km[e];if(r>-1)for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else if(r===-2)return;else throw Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}function Ym(e){let t=[],n=e=>{t.push(String.fromCodePoint(e))},r={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},a=e=>{Qm(e,r,n)};for(let t=0;t<e.length;t+=1)Jm(e.charCodeAt(t),i,a);return t.join(``)}function Xm(e,t){if(e<=127)t(e);else if(e<=2047)t(192|e>>6),t(128|e&63);else if(e<=65535)t(224|e>>12),t(128|e>>6&63),t(128|e&63);else if(e<=1114111)t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);else throw Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function Zm(e,t){for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r>55295&&r<=56319){let t=(r-55296)*1024&65535;r=(e.charCodeAt(n+1)-56320&65535|t)+65536,n+=1}Xm(r,t)}}function Qm(e,t,n){if(t.utf8seq===0){if(e<=127){n(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 Error(`Invalid UTF-8 sequence`);--t.utf8seq}else if(t.utf8seq>0){if(e<=127)throw Error(`Invalid UTF-8 sequence`);t.codepoint=t.codepoint<<6|e&63,--t.utf8seq,t.utf8seq===0&&n(t.codepoint)}}function $m(e){let t=[],n={queue:0,queuedBits:0},r=e=>{t.push(e)};for(let t=0;t<e.length;t+=1)Jm(e.charCodeAt(t),n,r);return new Uint8Array(t)}function eh(e){let t=[];return Zm(e,e=>t.push(e)),new Uint8Array(t)}function th(e){let t=[],n={queue:0,queuedBits:0},r=e=>{t.push(e)};return e.forEach(e=>qm(e,n,r)),qm(null,n,r),t.join(``)}function nh(e){return Math.round(Date.now()/1e3)+e}function rh(){return Symbol(`auth-callback`)}var ih=()=>typeof window<`u`&&typeof document<`u`,ah={tested:!1,writable:!1},oh=()=>{if(!ih())return!1;try{if(typeof globalThis.localStorage!=`object`)return!1}catch{return!1}if(ah.tested)return ah.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),ah.tested=!0,ah.writable=!0}catch{ah.tested=!0,ah.writable=!1}return ah.writable};function sh(e){let t={},n=new URL(e);if(n.hash&&n.hash[0]===`#`)try{new URLSearchParams(n.hash.substring(1)).forEach((e,n)=>{t[n]=e})}catch{}return n.searchParams.forEach((e,n)=>{t[n]=e}),t}var ch=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),lh=e=>typeof e==`object`&&!!e&&`status`in e&&`ok`in e&&`json`in e&&typeof e.json==`function`,uh=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},dh=async(e,t)=>{let n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return null}},fh=async(e,t)=>{await e.removeItem(t)},ph=class e{constructor(){this.promise=new e.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}};ph.promiseConstructor=Promise;function mh(e){let t=e.split(`.`);if(t.length!==3)throw new Um(`Invalid JWT structure`);for(let e=0;e<t.length;e++)if(!Em.test(t[e]))throw new Um(`JWT not in base64url format`);return{header:JSON.parse(Ym(t[0])),payload:JSON.parse(Ym(t[1])),signature:$m(t[2]),raw:{header:t[0],payload:t[1]}}}async function hh(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function gh(e,t){return new Promise((n,r)=>{(async()=>{for(let i=0;i<1/0;i++)try{let r=await e(i);if(!t(i,null,r)){n(r);return}}catch(e){if(!t(i,e)){r(e);return}}})()})}function _h(e){return(`0`+e.toString(16)).substr(-2)}function vh(){let e=new Uint32Array(56);if(typeof crypto>`u`){let e=``;for(let t=0;t<56;t++)e+=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~`.charAt(Math.floor(Math.random()*66));return e}return crypto.getRandomValues(e),Array.from(e,_h).join(``)}async function yh(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest(`SHA-256`,t),r=new Uint8Array(n);return Array.from(r).map(e=>String.fromCharCode(e)).join(``)}async function bh(e){if(typeof crypto>`u`||crypto.subtle===void 0||typeof TextEncoder>`u`)return console.warn(`WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256.`),e;let t=await yh(e);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}async function xh(e,t,n=!1){let r=vh(),i=r;n&&(i+=`/recovery`),await uh(e,`${t}-code-verifier`,i);let a=await bh(r);return[a,r===a?`plain`:`s256`]}var Sh=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function Ch(e){let t=e.headers.get(wm);if(!t||!t.match(Sh))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function wh(e){if(!e)throw Error(`Missing exp claim`);if(e<=Math.floor(Date.now()/1e3))throw Error(`JWT has expired`)}function Th(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 Error(`Invalid alg claim`)}}var Eh=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Dh(e){if(!Eh.test(e))throw Error(`@supabase/auth-js: Expected parameter to be UUID but is not`)}function Oh(e){if(!e.passkey)throw Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function kh(){return new Proxy({},{get:(e,t)=>{if(t===`__isUserNotAvailableProxy`)return!0;if(typeof t==`symbol`){let e=t.toString();if(e===`Symbol(Symbol.toPrimitive)`||e===`Symbol(Symbol.toStringTag)`||e===`Symbol(util.inspect.custom)`)return}throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${t}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,t)=>{throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,t)=>{throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function Ah(e,t){return new Proxy(e,{get:(e,n,r)=>{if(n===`__isInsecureUserWarningProxy`)return!0;if(typeof n==`symbol`){let t=n.toString();if(t===`Symbol(Symbol.toPrimitive)`||t===`Symbol(Symbol.toStringTag)`||t===`Symbol(util.inspect.custom)`||t===`Symbol(nodejs.util.inspect.custom)`)return Reflect.get(e,n,r)}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(e,n,r)}})}function jh(e){return JSON.parse(JSON.stringify(e))}var Mh=e=>{if(typeof e==`object`&&e){let t=e;if(typeof t.msg==`string`)return t.msg;if(typeof t.message==`string`)return t.message;if(typeof t.error_description==`string`)return t.error_description;if(typeof t.error==`string`)return t.error}return JSON.stringify(e)},Nh=[502,503,504,520,521,522,523,524,530];async function Ph(e){if(!lh(e))throw new Bm(Mh(e),0);if(Nh.includes(e.status))throw new Bm(Mh(e),e.status);let t;try{t=await e.json()}catch(e){throw new Am(Mh(e),e)}let n,r=Ch(e);if(r&&r.getTime()>=Tm[`2024-01-01`].timestamp&&typeof t==`object`&&t&&typeof t.code==`string`?n=t.code:typeof t==`object`&&t&&typeof t.error_code==`string`&&(n=t.error_code),!n){if(typeof t==`object`&&t&&typeof t.weak_password==`object`&&t.weak_password&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.reasons.reduce((e,t)=>e&&typeof t==`string`,!0))throw new Hm(Mh(t),e.status,t.weak_password.reasons)}else if(n===`weak_password`)throw new Hm(Mh(t),e.status,t.weak_password?.reasons||[]);else if(n===`session_not_found`)throw new Mm;throw new Om(Mh(t),e.status||500,n)}var Fh=(e,t,n,r)=>{let i={method:e,headers:t?.headers||{}};return e===`GET`?i:(i.headers=Object.assign({"Content-Type":`application/json;charset=UTF-8`},t?.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),n))};async function Z(e,t,n,r){let i=Object.assign({},r?.headers);i[`X-Supabase-Api-Version`]||(i[wm]=Tm[`2024-01-01`].name),r?.jwt&&(i.Authorization=`Bearer ${r.jwt}`);let a=r?.query??{};r?.redirectTo&&(a.redirect_to=r.redirectTo);let o=await Ih(e,t,n+(Object.keys(a).length?`?`+new URLSearchParams(a).toString():``),{headers:i,noResolveJson:r?.noResolveJson},{},r?.body);return r?.xform?r?.xform(o):{data:Object.assign({},o),error:null}}async function Ih(e,t,n,r,i,a){let o=Fh(t,r,i,a),s;try{s=await e(n,Object.assign({},o))}catch(e){throw console.error(e),new Bm(Mh(e),0)}if(s.ok||await Ph(s),r?.noResolveJson)return s;try{return await s.json()}catch(e){await Ph(e)}}function Lh(e){let t=null;Uh(e)&&(t=Object.assign({},e),e.expires_at||(t.expires_at=nh(e.expires_in)));let n=e.user??null;return{data:{session:t,user:n},error:null}}function Rh(e){let t=Lh(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((e,t)=>e&&typeof t==`string`,!0)&&(t.data.weak_password=e.weak_password),t}function zh(e){return{data:{user:e.user??e},error:null}}function Bh(e){return{data:e,error:null}}function Vh(e){let{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:a}=e,o=Pd(e,[`action_link`,`email_otp`,`hashed_token`,`redirect_to`,`verification_type`]);return{data:{properties:{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:a},user:Object.assign({},o)},error:null}}function Hh(e){return e}function Uh(e){return!!e.access_token&&!!e.refresh_token&&!!e.expires_in}var Wh=[`global`,`local`,`others`],Gh=class{_encodePathSegment(e){if(e===`.`||e===`..`)throw new Dm(`Invalid path segment`);return encodeURIComponent(e)}constructor({url:e=``,headers:t={},fetch:n,experimental:r}){this.url=e,this.headers=t,this.fetch=ch(n),this.experimental=r??{},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)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(e,t=Wh[0]){if(Wh.indexOf(t)<0)throw Error(`@supabase/auth-js: Parameter scope must be one of ${Wh.join(`, `)}`);try{return await Z(this.fetch,`POST`,`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(e){if(X(e))return{data:null,error:e};throw e}}async inviteUserByEmail(e,t={}){try{return await Z(this.fetch,`POST`,`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:zh})}catch(e){if(X(e))return{data:{user:null},error:e};throw e}}async generateLink(e){try{let{options:t}=e,n=Pd(e,[`options`]),r=Object.assign(Object.assign({},n),t);return`newEmail`in n&&(r.new_email=n?.newEmail,delete r.newEmail),await Z(this.fetch,`POST`,`${this.url}/admin/generate_link`,{body:r,headers:this.headers,xform:Vh,redirectTo:t?.redirectTo})}catch(e){if(X(e))return{data:{properties:null,user:null},error:e};throw e}}async createUser(e){try{return await Z(this.fetch,`POST`,`${this.url}/admin/users`,{body:e,headers:this.headers,xform:zh})}catch(e){if(X(e))return{data:{user:null},error:e};throw e}}async listUsers(e){try{let t={nextPage:null,lastPage:0,total:0},n=await Z(this.fetch,`GET`,`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(e?.page)?.toString()??``,per_page:(e?.perPage)?.toString()??``},xform:Hh});if(n.error)throw n.error;let r=await n.json(),i=n.headers.get(`x-total-count`)??0,a=n.headers.get(`link`)?.split(`,`)??[];return a.length>0&&(a.forEach(e=>{let n=parseInt(e.split(`;`)[0].split(`=`)[1].substring(0,1)),r=JSON.parse(e.split(`;`)[1].split(`=`)[1]);t[`${r}Page`]=n}),t.total=parseInt(i)),{data:Object.assign(Object.assign({},r),t),error:null}}catch(e){if(X(e))return{data:{users:[]},error:e};throw e}}async getUserById(e){Dh(e);try{return await Z(this.fetch,`GET`,`${this.url}/admin/users/${e}`,{headers:this.headers,xform:zh})}catch(e){if(X(e))return{data:{user:null},error:e};throw e}}async updateUserById(e,t){Dh(e);try{return await Z(this.fetch,`PUT`,`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:zh})}catch(e){if(X(e))return{data:{user:null},error:e};throw e}}async deleteUser(e,t=!1){Dh(e);try{return await Z(this.fetch,`DELETE`,`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:zh})}catch(e){if(X(e))return{data:{user:null},error:e};throw e}}async _listFactors(e){Dh(e.userId);try{let{data:t,error:n}=await Z(this.fetch,`GET`,`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:e=>({data:{factors:e},error:null})});return{data:t,error:n}}catch(e){if(X(e))return{data:null,error:e};throw e}}async _deleteFactor(e){Dh(e.userId),Dh(e.id);try{return{data:await Z(this.fetch,`DELETE`,`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(e){if(X(e))return{data:null,error:e};throw e}}async _listOAuthClients(e){try{let t={nextPage:null,lastPage:0,total:0},n=await Z(this.fetch,`GET`,`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(e?.page)?.toString()??``,per_page:(e?.perPage)?.toString()??``},xform:Hh});if(n.error)throw n.error;let r=await n.json(),i=n.headers.get(`x-total-count`)??0,a=n.headers.get(`link`)?.split(`,`)??[];return a.length>0&&(a.forEach(e=>{let n=parseInt(e.split(`;`)[0].split(`=`)[1].substring(0,1)),r=JSON.parse(e.split(`;`)[1].split(`=`)[1]);t[`${r}Page`]=n}),t.total=parseInt(i)),{data:Object.assign(Object.assign({},r),t),error:null}}catch(e){if(X(e))return{data:{clients:[]},error:e};throw e}}async _createOAuthClient(e){try{return await Z(this.fetch,`POST`,`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(X(e))return{data:null,error:e};throw e}}async _getOAuthClient(e){try{let t=this._encodePathSegment(e);return await Z(this.fetch,`GET`,`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(X(e))return{data:null,error:e};throw e}}async _updateOAuthClient(e,t){try{let n=this._encodePathSegment(e);return await Z(this.fetch,`PUT`,`${this.url}/admin/oauth/clients/${n}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(X(e))return{data:null,error:e};throw e}}async _deleteOAuthClient(e){try{let t=this._encodePathSegment(e);return await Z(this.fetch,`DELETE`,`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(X(e))return{data:null,error:e};throw e}}async _regenerateOAuthClientSecret(e){try{let t=this._encodePathSegment(e);return await Z(this.fetch,`POST`,`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(X(e))return{data:null,error:e};throw e}}async _listCustomProviders(e){try{let t={};return e?.type&&(t.type=e.type),await Z(this.fetch,`GET`,`${this.url}/admin/custom-providers`,{headers:this.headers,query:t,xform:e=>({data:{providers:e?.providers??[]},error:null})})}catch(e){if(X(e))return{data:{providers:[]},error:e};throw e}}async _createCustomProvider(e){try{return await Z(this.fetch,`POST`,`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(X(e))return{data:null,error:e};throw e}}async _getCustomProvider(e){try{let t=this._encodePathSegment(e);return await Z(this.fetch,`GET`,`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(X(e))return{data:null,error:e};throw e}}async _updateCustomProvider(e,t){try{let n=this._encodePathSegment(e);return await Z(this.fetch,`PUT`,`${this.url}/admin/custom-providers/${n}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(X(e))return{data:null,error:e};throw e}}async _deleteCustomProvider(e){try{let t=this._encodePathSegment(e);return await Z(this.fetch,`DELETE`,`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(X(e))return{data:null,error:e};throw e}}async _adminListPasskeys(e){Oh(this.experimental),Dh(e.userId);try{return await Z(this.fetch,`GET`,`${this.url}/admin/users/${e.userId}/passkeys`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(X(e))return{data:null,error:e};throw e}}async _adminDeletePasskey(e){Oh(this.experimental),Dh(e.userId),Dh(e.passkeyId);try{return await Z(this.fetch,`DELETE`,`${this.url}/admin/users/${e.userId}/passkeys/${e.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(X(e))return{data:null,error:e};throw e}}};function Kh(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}var qh={debug:!!(globalThis&&oh()&&globalThis.localStorage&&globalThis.localStorage.getItem(`supabase.gotrue-js.locks.debug`)===`true`)},Jh=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}},Yh=class extends Jh{};async function Xh(e,t,n){qh.debug&&console.log(`@supabase/gotrue-js: navigatorLock: acquire lock`,e,t);let r=new globalThis.AbortController,i;t>0&&(i=setTimeout(()=>{r.abort(),qh.debug&&console.log(`@supabase/gotrue-js: navigatorLock acquire timed out`,e)},t)),await Promise.resolve();try{return await globalThis.navigator.locks.request(e,t===0?{mode:`exclusive`,ifAvailable:!0}:{mode:`exclusive`,signal:r.signal},async r=>{if(r){clearTimeout(i),qh.debug&&console.log(`@supabase/gotrue-js: navigatorLock: acquired`,e,r.name);try{return await n()}finally{qh.debug&&console.log(`@supabase/gotrue-js: navigatorLock: released`,e,r.name)}}else if(t===0)throw qh.debug&&console.log(`@supabase/gotrue-js: navigatorLock: not immediately available`,e),new Yh(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);else{if(qh.debug)try{let e=await globalThis.navigator.locks.query();console.log(`@supabase/gotrue-js: Navigator LockManager state`,JSON.stringify(e,null,` `))}catch(e){console.warn(`@supabase/gotrue-js: Error when querying Navigator LockManager state`,e)}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`),clearTimeout(i),await n()}})}catch(a){if(t>0&&clearTimeout(i),typeof a==`object`&&a&&`name`in a&&a.name===`AbortError`&&t>0){if(r.signal.aborted)return qh.debug&&console.log(`@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock`,e),console.warn(`@supabase/gotrue-js: Lock "${e}" was not released within ${t}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,{mode:`exclusive`,steal:!0},async t=>{if(t){qh.debug&&console.log(`@supabase/gotrue-js: navigatorLock: recovered (stolen)`,e,t.name);try{return await n()}finally{qh.debug&&console.log(`@supabase/gotrue-js: navigatorLock: released (stolen)`,e,t.name)}}else return console.warn(`@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true`),await n()}));throw qh.debug&&console.log(`@supabase/gotrue-js: navigatorLock: lock was stolen by another request`,e),new Yh(`Lock "${e}" was released because another request stole it`)}throw a}}function Zh(){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 Qh(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function $h(e){return parseInt(e,16)}function eg(e){let t=new TextEncoder().encode(e);return`0x`+Array.from(t,e=>e.toString(16).padStart(2,`0`)).join(``)}function tg(e){let{chainId:t,domain:n,expirationTime:r,issuedAt:i=new Date,nonce:a,notBefore:o,requestId:s,resources:c,scheme:l,uri:u,version:d}=e;if(!Number.isInteger(t))throw Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${t}`);if(!n)throw Error(`@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.`);if(a&&a.length<8)throw Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${a}`);if(!u)throw Error(`@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.`);if(d!==`1`)throw Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${d}`);if(e.statement?.includes(`
|
|
30
30
|
`))throw Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`);let f=Qh(e.address),p=`${l?`${l}://${n}`:n} wants you to sign in with your Ethereum account:\n${f}\n\n${e.statement?`${e.statement}\n`:``}`,m=`URI: ${u}\nVersion: ${d}\nChain ID: ${t}${a?`\nNonce: ${a}`:``}\nIssued At: ${i.toISOString()}`;if(r&&(m+=`\nExpiration Time: ${r.toISOString()}`),o&&(m+=`\nNot Before: ${o.toISOString()}`),s&&(m+=`\nRequest ID: ${s}`),c){let e=`
|
|
31
31
|
Resources:`;for(let t of c){if(!t||typeof t!=`string`)throw Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${t}`);e+=`\n- ${t}`}m+=e}return`${p}\n${m}`}var Q=class extends Error{constructor({message:e,code:t,cause:n,name:r}){super(e,{cause:n}),this.__isWebAuthnError=!0,this.name=r??(n instanceof Error?n.name:void 0)??`Unknown Error`,this.code=t}toJSON(){return{name:this.name,message:this.message,code:this.code}}},ng=class extends Q{constructor(e,t){super({code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:t,message:e}),this.name=`WebAuthnUnknownError`,this.originalError=t}};function rg({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new Q({message:`Registration ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`ConstraintError`){if(n.authenticatorSelection?.requireResidentKey===!0)return new Q({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.authenticatorSelection?.userVerification===`required`)return new Q({message:`User verification was required during automatic registration but it could not be performed`,code:`ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE`,cause:e});if(n.authenticatorSelection?.userVerification===`required`)return new Q({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 Q({message:`The authenticator was previously registered`,code:`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`,cause:e});else if(e.name===`NotAllowedError`)return new Q({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`NotSupportedError`)return n.pubKeyCredParams.filter(e=>e.type===`public-key`).length===0?new Q({message:`No entry in pubKeyCredParams was of type "public-key"`,code:`ERROR_MALFORMED_PUBKEYCREDPARAMS`,cause:e}):new Q({message:`No available authenticator supported any of the specified pubKeyCredParams algorithms`,code:`ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG`,cause:e});else if(e.name===`SecurityError`){let t=window.location.hostname;if(!ug(t))return new Q({message:`${window.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rp.id!==t)return new Q({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`TypeError`){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new Q({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 Q({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 Q({message:`a Non-Webauthn related error has occurred`,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e})}function ig({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new Q({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new Q({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=window.location.hostname;if(!ug(t))return new Q({message:`${window.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new Q({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`UnknownError`)return new Q({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 Q({message:`a Non-Webauthn related error has occurred`,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e})}var ag=new class{createNewAbortSignal(){if(this.controller){let e=Error(`Cancelling existing WebAuthn API call for new one`);e.name=`AbortError`,this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error(`Manually cancelling existing WebAuthn API call`);e.name=`AbortError`,this.controller.abort(e),this.controller=void 0}}};function og(e){if(!e)throw Error(`Credential creation options are required`);if(typeof PublicKeyCredential<`u`&&`parseCreationOptionsFromJSON`in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON==`function`)return PublicKeyCredential.parseCreationOptionsFromJSON(e);let{challenge:t,user:n,excludeCredentials:r}=e,i=Pd(e,[`challenge`,`user`,`excludeCredentials`]),a=$m(t).buffer,o=Object.assign(Object.assign({},n),{id:$m(n.id).buffer}),s=Object.assign(Object.assign({},i),{challenge:a,user:o});if(r&&r.length>0){s.excludeCredentials=Array(r.length);for(let e=0;e<r.length;e++){let t=r[e];s.excludeCredentials[e]=Object.assign(Object.assign({},t),{id:$m(t.id).buffer,type:t.type||`public-key`,transports:t.transports})}}return s}function sg(e){if(!e)throw Error(`Credential request options are required`);if(typeof PublicKeyCredential<`u`&&`parseRequestOptionsFromJSON`in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON==`function`)return PublicKeyCredential.parseRequestOptionsFromJSON(e);let{challenge:t,allowCredentials:n}=e,r=Pd(e,[`challenge`,`allowCredentials`]),i=$m(t).buffer,a=Object.assign(Object.assign({},r),{challenge:i});if(n&&n.length>0){a.allowCredentials=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e];a.allowCredentials[e]=Object.assign(Object.assign({},t),{id:$m(t.id).buffer,type:t.type||`public-key`,transports:t.transports})}}return a}function cg(e){if(`toJSON`in e&&typeof e.toJSON==`function`)return e.toJSON();let t=e;return{id:e.id,rawId:e.id,response:{attestationObject:th(new Uint8Array(e.response.attestationObject)),clientDataJSON:th(new Uint8Array(e.response.clientDataJSON))},type:`public-key`,clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:t.authenticatorAttachment??void 0}}function lg(e){if(`toJSON`in e&&typeof e.toJSON==`function`)return e.toJSON();let t=e,n=e.getClientExtensionResults(),r=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:th(new Uint8Array(r.authenticatorData)),clientDataJSON:th(new Uint8Array(r.clientDataJSON)),signature:th(new Uint8Array(r.signature)),userHandle:r.userHandle?th(new Uint8Array(r.userHandle)):void 0},type:`public-key`,clientExtensionResults:n,authenticatorAttachment:t.authenticatorAttachment??void 0}}function ug(e){return e===`localhost`||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function dg(){return!!(ih()&&`PublicKeyCredential`in window&&window.PublicKeyCredential&&`credentials`in navigator&&typeof(navigator==null?void 0:navigator.credentials)?.create==`function`&&typeof(navigator==null?void 0:navigator.credentials)?.get==`function`)}async function fg(e){try{let t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new ng(`Browser returned unexpected credential type`,t)}:{data:null,error:new ng(`Empty credential response`,t)}}catch(t){return{data:null,error:rg({error:t,options:e})}}}async function pg(e){try{let t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new ng(`Browser returned unexpected credential type`,t)}:{data:null,error:new ng(`Empty credential response`,t)}}catch(t){return{data:null,error:ig({error:t,options:e})}}}var mg={hints:[`security-key`],authenticatorSelection:{authenticatorAttachment:`cross-platform`,requireResidentKey:!1,userVerification:`preferred`,residentKey:`discouraged`},attestation:`direct`},hg={userVerification:`preferred`,hints:[`security-key`],attestation:`direct`};function gg(...e){let t=e=>typeof e==`object`&&!!e&&!Array.isArray(e),n=e=>e instanceof ArrayBuffer||ArrayBuffer.isView(e),r={};for(let i of e)if(i)for(let e in i){let a=i[e];if(a!==void 0){if(Array.isArray(a))r[e]=a;else if(n(a))r[e]=a;else if(t(a)){let n=r[e];r[e]=t(n)?gg(n,a):gg(a)}else r[e]=a}}return r}function _g(e,t){return gg(mg,e,t||{})}function vg(e,t){return gg(hg,e,t||{})}var yg=class{constructor(e){this.client=e,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(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:`webauthn`}))}async _challenge({factorId:e,webauthn:t,friendlyName:n,signal:r},i){try{let{data:a,error:o}=await this.client.mfa.challenge({factorId:e,webauthn:t});if(!a)return{data:null,error:o};let s=r??ag.createNewAbortSignal();if(a.webauthn.type===`create`){let{user:e}=a.webauthn.credential_options.publicKey;if(!e.name){let t=n;if(t)e.name=`${e.id}:${t}`;else{let t=(await this.client.getUser()).data.user,n=t?.user_metadata?.name||t?.email||t?.id||`User`;e.name=`${e.id}:${n}`}}e.displayName||=e.name}switch(a.webauthn.type){case`create`:{let{data:t,error:n}=await fg({publicKey:_g(a.webauthn.credential_options.publicKey,i?.create),signal:s});return t?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:t}},error:null}:{data:null,error:n}}case`request`:{let t=vg(a.webauthn.credential_options.publicKey,i?.request),{data:n,error:r}=await pg(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:t,signal:s}));return n?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:n}},error:null}:{data:null,error:r}}}}catch(e){return X(e)?{data:null,error:e}:{data:null,error:new Am(`Unexpected error in challenge`,e)}}}async _verify({challengeId:e,factorId:t,webauthn:n}){return this.client.mfa.verify({factorId:t,challengeId:e,webauthn:n})}async _authenticate({factorId:e,webauthn:{rpId:t=typeof window<`u`?window.location.hostname:void 0,rpOrigins:n=typeof window<`u`?[window.location.origin]:void 0,signal:r}={}},i){if(!t)return{data:null,error:new Dm(`rpId is required for WebAuthn authentication`)};try{if(!dg())return{data:null,error:new Am(`Browser does not support WebAuthn`,null)};let{data:a,error:o}=await this.challenge({factorId:e,webauthn:{rpId:t,rpOrigins:n},signal:r},{request:i});if(!a)return{data:null,error:o};let{webauthn:s}=a;return this._verify({factorId:e,challengeId:a.challengeId,webauthn:{type:s.type,rpId:t,rpOrigins:n,credential_response:s.credential_response}})}catch(e){return X(e)?{data:null,error:e}:{data:null,error:new Am(`Unexpected error in authenticate`,e)}}}async _register({friendlyName:e,webauthn:{rpId:t=typeof window<`u`?window.location.hostname:void 0,rpOrigins:n=typeof window<`u`?[window.location.origin]:void 0,signal:r}={}},i){if(!t)return{data:null,error:new Dm(`rpId is required for WebAuthn registration`)};try{if(!dg())return{data:null,error:new Am(`Browser does not support WebAuthn`,null)};let{data:a,error:o}=await this._enroll({friendlyName:e});if(!a)return await this.client.mfa.listFactors().then(t=>t.data?.all.find(t=>t.factor_type===`webauthn`&&t.friendly_name===e&&t.status!==`unverified`)).then(e=>e?this.client.mfa.unenroll({factorId:e?.id}):void 0),{data:null,error:o};let{data:s,error:c}=await this._challenge({factorId:a.id,friendlyName:a.friendly_name,webauthn:{rpId:t,rpOrigins:n},signal:r},{create:i});return s?this._verify({factorId:a.id,challengeId:s.challengeId,webauthn:{rpId:t,rpOrigins:n,type:s.webauthn.type,credential_response:s.webauthn.credential_response}}):{data:null,error:c}}catch(e){return X(e)?{data:null,error:e}:{data:null,error:new Am(`Unexpected error in register`,e)}}}};Zh();var bg={url:xm,storageKey:Sm,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Cm,flowType:`implicit`,debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}};async function xg(e,t,n){return await n()}var Sg={},Cg=class e{get jwks(){return Sg[this.storageKey]?.jwks??{keys:[]}}set jwks(e){Sg[this.storageKey]=Object.assign(Object.assign({},Sg[this.storageKey]),{jwks:e})}get jwks_cached_at(){return Sg[this.storageKey]?.cachedAt??-(2**53-1)}set jwks_cached_at(e){Sg[this.storageKey]=Object.assign(Object.assign({},Sg[this.storageKey]),{cachedAt:e})}constructor(t){var n;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=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;let r=Object.assign(Object.assign({},bg),t);if(this.storageKey=r.storageKey,this.instanceID=e.nextInstanceID[this.storageKey]??0,e.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!r.debug,typeof r.debug==`function`&&(this.logger=r.debug),this.instanceID>0&&ih()){let e=`${this._logPrefix()} 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.`;console.warn(e),this.logDebugMessages&&console.trace(e)}if(this.persistSession=r.persistSession,this.autoRefreshToken=r.autoRefreshToken,this.experimental=r.experimental??{},this.admin=new Gh({url:r.url,headers:r.headers,fetch:r.fetch,experimental:this.experimental}),this.url=r.url,this.headers=r.headers,this.fetch=ch(r.fetch),this.lock=r.lock||xg,this.detectSessionInUrl=r.detectSessionInUrl,this.flowType=r.flowType,this.hasCustomAuthorizationHeader=r.hasCustomAuthorizationHeader,this.throwOnError=r.throwOnError,this.lockAcquireTimeout=r.lockAcquireTimeout,this.lock=r.lock?r.lock:this.persistSession&&ih()&&(globalThis==null?void 0:globalThis.navigator)?.locks?Xh:xg,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=-(2**53-1)),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 yg(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(r.storage?this.storage=r.storage:oh()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Kh(this.memoryStorage)),r.userStorage&&(this.userStorage=r.userStorage)):(this.memoryStorage={},this.storage=Kh(this.memoryStorage)),ih()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(e){console.error(`Failed to create a new BroadcastChannel, multi-tab state changes will not be available`,e)}(n=this.broadcastChannel)==null||n.addEventListener(`message`,async e=>{this._debug(`received broadcast notification from other tab or client`,e);try{await this._notifyAllSubscribers(e.data.event,e.data.session,!1)}catch(e){this._debug(`#broadcastChannel`,`error`,e)}})}r.skipAutoInitialize||this.initialize().catch(e=>{this._debug(`#initialize()`,`error`,e)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${vm}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise||=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise}async _initialize(){try{let e={},t=`none`;if(ih()&&(e=sh(window.location.href),this._isImplicitGrantCallback(e)?t=`implicit`:await this._isPKCECallback(e)&&(t=`pkce`)),ih()&&this.detectSessionInUrl&&t!==`none`){let{data:n,error:r}=await this._getSessionFromURL(e,t);if(r){if(this._debug(`#_initialize()`,`error detecting session from URL`,r),Lm(r)){let e=r.details?.code;if(e===`identity_already_exists`||e===`identity_not_found`||e===`single_identity_not_deletable`)return{error:r}}return{error:r}}let{session:i,redirectType:a}=n;return this._debug(`#_initialize()`,`detected session in URL`,i,`redirect type`,a),await this._saveSession(i),setTimeout(async()=>{a===`recovery`?await this._notifyAllSubscribers(`PASSWORD_RECOVERY`,i):await this._notifyAllSubscribers(`SIGNED_IN`,i)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){return X(e)?this._returnResult({error:e}):this._returnResult({error:new Am(`Unexpected error during initialization`,e)})}finally{await this._handleVisibilityChange(),this._debug(`#_initialize()`,`end`)}}async signInAnonymously(e){try{let{data:t,error:n}=await Z(this.fetch,`POST`,`${this.url}/signup`,{headers:this.headers,body:{data:e?.options?.data??{},gotrue_meta_security:{captcha_token:e?.options?.captchaToken}},xform:Lh});if(n||!t)return this._returnResult({data:{user:null,session:null},error:n});let r=t.session,i=t.user;return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers(`SIGNED_IN`,r)),this._returnResult({data:{user:i,session:r},error:null})}catch(e){if(X(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signUp(e){try{let t;if(`email`in e){let{email:n,password:r,options:i}=e,a=null,o=null;this.flowType===`pkce`&&([a,o]=await xh(this.storage,this.storageKey)),t=await Z(this.fetch,`POST`,`${this.url}/signup`,{headers:this.headers,redirectTo:i?.emailRedirectTo,body:{email:n,password:r,data:i?.data??{},gotrue_meta_security:{captcha_token:i?.captchaToken},code_challenge:a,code_challenge_method:o},xform:Lh})}else if(`phone`in e){let{phone:n,password:r,options:i}=e;t=await Z(this.fetch,`POST`,`${this.url}/signup`,{headers:this.headers,body:{phone:n,password:r,data:i?.data??{},channel:i?.channel??`sms`,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:Lh})}else throw new Fm(`You must provide either an email or phone number and a password`);let{data:n,error:r}=t;if(r||!n)return await fh(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:r});let i=n.session,a=n.user;return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers(`SIGNED_IN`,i)),this._returnResult({data:{user:a,session:i},error:null})}catch(e){if(await fh(this.storage,`${this.storageKey}-code-verifier`),X(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithPassword(e){try{let t;if(`email`in e){let{email:n,password:r,options:i}=e;t=await Z(this.fetch,`POST`,`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:n,password:r,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:Rh})}else if(`phone`in e){let{phone:n,password:r,options:i}=e;t=await Z(this.fetch,`POST`,`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:n,password:r,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:Rh})}else throw new Fm(`You must provide either an email or phone number and a password`);let{data:n,error:r}=t;if(r)return this._returnResult({data:{user:null,session:null},error:r});if(!n||!n.session||!n.user){let e=new Pm;return this._returnResult({data:{user:null,session:null},error:e})}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:r})}catch(e){if(X(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOAuth(e){return await this._handleProviderSignIn(e.provider,{redirectTo:e.options?.redirectTo,scopes:e.options?.scopes,queryParams:e.options?.queryParams,skipBrowserRedirect:e.options?.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){let{chain:t}=e;switch(t){case`ethereum`:return await this.signInWithEthereum(e);case`solana`:return await this.signInWithSolana(e);default:throw Error(`@supabase/auth-js: Unsupported chain "${t}"`)}}async signInWithEthereum(e){let t,n;if(`message`in e)t=e.message,n=e.signature;else{let{chain:r,wallet:i,statement:a,options:o}=e,s;if(!ih()){if(typeof i!=`object`||!o?.url)throw Error(`@supabase/auth-js: Both wallet and url must be specified in non-browser environments.`);s=i}else if(typeof i==`object`)s=i;else{let e=window;if(`ethereum`in e&&typeof e.ethereum==`object`&&`request`in e.ethereum&&typeof e.ethereum.request==`function`)s=e.ethereum;else throw 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.`)}let c=new URL(o?.url??window.location.href),l=await s.request({method:`eth_requestAccounts`}).then(e=>e).catch(()=>{throw Error(`@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid`)});if(!l||l.length===0)throw Error(`@supabase/auth-js: No accounts available. Please ensure the wallet is connected.`);let u=Qh(l[0]),d=o?.signInWithEthereum?.chainId;d||=$h(await s.request({method:`eth_chainId`})),t=tg({domain:c.host,address:u,statement:a,uri:c.href,version:`1`,chainId:d,nonce:o?.signInWithEthereum?.nonce,issuedAt:o?.signInWithEthereum?.issuedAt??new Date,expirationTime:o?.signInWithEthereum?.expirationTime,notBefore:o?.signInWithEthereum?.notBefore,requestId:o?.signInWithEthereum?.requestId,resources:o?.signInWithEthereum?.resources}),n=await s.request({method:`personal_sign`,params:[eg(t),u]})}try{let{data:r,error:i}=await Z(this.fetch,`POST`,`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:`ethereum`,message:t,signature:n},e.options?.captchaToken?{gotrue_meta_security:{captcha_token:e.options?.captchaToken}}:null),xform:Lh});if(i)throw i;if(!r||!r.session||!r.user){let e=new Pm;return this._returnResult({data:{user:null,session:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers(`SIGNED_IN`,r.session)),this._returnResult({data:Object.assign({},r),error:i})}catch(e){if(X(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSolana(e){let t,n;if(`message`in e)t=e.message,n=e.signature;else{let{chain:r,wallet:i,statement:a,options:o}=e,s;if(!ih()){if(typeof i!=`object`||!o?.url)throw Error(`@supabase/auth-js: Both wallet and url must be specified in non-browser environments.`);s=i}else if(typeof i==`object`)s=i;else{let e=window;if(`solana`in e&&typeof e.solana==`object`&&(`signIn`in e.solana&&typeof e.solana.signIn==`function`||`signMessage`in e.solana&&typeof e.solana.signMessage==`function`))s=e.solana;else throw 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.`)}let c=new URL(o?.url??window.location.href);if(`signIn`in s&&s.signIn){let e=await s.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},o?.signInWithSolana),{version:`1`,domain:c.host,uri:c.href}),a?{statement:a}:null)),r;if(Array.isArray(e)&&e[0]&&typeof e[0]==`object`)r=e[0];else if(e&&typeof e==`object`&&`signedMessage`in e&&`signature`in e)r=e;else throw Error(`@supabase/auth-js: Wallet method signIn() returned unrecognized value`);if(`signedMessage`in r&&`signature`in r&&(typeof r.signedMessage==`string`||r.signedMessage instanceof Uint8Array)&&r.signature instanceof Uint8Array)t=typeof r.signedMessage==`string`?r.signedMessage:new TextDecoder().decode(r.signedMessage),n=r.signature;else throw 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 Error(`@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API`);t=[`${c.host} wants you to sign in with your Solana account:`,s.publicKey.toBase58(),...a?[``,a,``]:[``],`Version: 1`,`URI: ${c.href}`,`Issued At: ${o?.signInWithSolana?.issuedAt??new Date().toISOString()}`,...o?.signInWithSolana?.notBefore?[`Not Before: ${o.signInWithSolana.notBefore}`]:[],...o?.signInWithSolana?.expirationTime?[`Expiration Time: ${o.signInWithSolana.expirationTime}`]:[],...o?.signInWithSolana?.chainId?[`Chain ID: ${o.signInWithSolana.chainId}`]:[],...o?.signInWithSolana?.nonce?[`Nonce: ${o.signInWithSolana.nonce}`]:[],...o?.signInWithSolana?.requestId?[`Request ID: ${o.signInWithSolana.requestId}`]:[],...o?.signInWithSolana?.resources?.length?[`Resources`,...o.signInWithSolana.resources.map(e=>`- ${e}`)]:[]].join(`
|
|
32
|
-
`);let e=await s.signMessage(new TextEncoder().encode(t),`utf8`);if(!e||!(e instanceof Uint8Array))throw Error(`@supabase/auth-js: Wallet signMessage() API returned an recognized value`);n=e}}try{let{data:r,error:i}=await Z(this.fetch,`POST`,`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:`solana`,message:t,signature:th(n)},e.options?.captchaToken?{gotrue_meta_security:{captcha_token:e.options?.captchaToken}}:null),xform:Lh});if(i)throw i;if(!r||!r.session||!r.user){let e=new Pm;return this._returnResult({data:{user:null,session:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers(`SIGNED_IN`,r.session)),this._returnResult({data:Object.assign({},r),error:i})}catch(e){if(X(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _exchangeCodeForSession(e){let[t,n]=(await dh(this.storage,`${this.storageKey}-code-verifier`)??``).split(`/`);try{if(!t&&this.flowType===`pkce`)throw new zm;let{data:r,error:i}=await Z(this.fetch,`POST`,`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:t},xform:Lh});if(await fh(this.storage,`${this.storageKey}-code-verifier`),i)throw i;if(!r||!r.session||!r.user){let e=new Pm;return this._returnResult({data:{user:null,session:null,redirectType:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers(n===`recovery`?`PASSWORD_RECOVERY`:`SIGNED_IN`,r.session)),this._returnResult({data:Object.assign(Object.assign({},r),{redirectType:n??null}),error:i})}catch(e){if(await fh(this.storage,`${this.storageKey}-code-verifier`),X(e))return this._returnResult({data:{user:null,session:null,redirectType:null},error:e});throw e}}async signInWithIdToken(e){try{let{options:t,provider:n,token:r,access_token:i,nonce:a}=e,{data:o,error:s}=await Z(this.fetch,`POST`,`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:r,access_token:i,nonce:a,gotrue_meta_security:{captcha_token:t?.captchaToken}},xform:Lh});if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!o||!o.session||!o.user){let e=new Pm;return this._returnResult({data:{user:null,session:null},error:e})}return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers(`SIGNED_IN`,o.session)),this._returnResult({data:o,error:s})}catch(e){if(X(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOtp(e){try{if(`email`in e){let{email:t,options:n}=e,r=null,i=null;this.flowType===`pkce`&&([r,i]=await xh(this.storage,this.storageKey));let{error:a}=await Z(this.fetch,`POST`,`${this.url}/otp`,{headers:this.headers,body:{email:t,data:n?.data??{},create_user:n?.shouldCreateUser??!0,gotrue_meta_security:{captcha_token:n?.captchaToken},code_challenge:r,code_challenge_method:i},redirectTo:n?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:a})}if(`phone`in e){let{phone:t,options:n}=e,{data:r,error:i}=await Z(this.fetch,`POST`,`${this.url}/otp`,{headers:this.headers,body:{phone:t,data:n?.data??{},create_user:n?.shouldCreateUser??!0,gotrue_meta_security:{captcha_token:n?.captchaToken},channel:n?.channel??`sms`}});return this._returnResult({data:{user:null,session:null,messageId:r?.message_id},error:i})}throw new Fm(`You must provide either an email or phone number.`)}catch(e){if(await fh(this.storage,`${this.storageKey}-code-verifier`),X(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async verifyOtp(e){try{let t,n;`options`in e&&(t=e.options?.redirectTo,n=e.options?.captchaToken);let{data:r,error:i}=await Z(this.fetch,`POST`,`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:n}}),redirectTo:t,xform:Lh});if(i)throw i;if(!r)throw Error(`An error occurred on token verification.`);let a=r.session,o=r.user;return a?.access_token&&(await this._saveSession(a),await this._notifyAllSubscribers(e.type==`recovery`?`PASSWORD_RECOVERY`:`SIGNED_IN`,a)),this._returnResult({data:{user:o,session:a},error:null})}catch(e){if(X(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSSO(e){try{let t=null,n=null;this.flowType===`pkce`&&([t,n]=await xh(this.storage,this.storageKey));let r=await Z(this.fetch,`POST`,`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},`providerId`in e?{provider_id:e.providerId}:null),`domain`in e?{domain:e.domain}:null),{redirect_to:e.options?.redirectTo??void 0}),e?.options?.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:t,code_challenge_method:n}),headers:this.headers,xform:Bh});return r.data?.url&&ih()&&!e.options?.skipBrowserRedirect&&window.location.assign(r.data.url),this._returnResult(r)}catch(e){if(await fh(this.storage,`${this.storageKey}-code-verifier`),X(e))return this._returnResult({data:null,error:e});throw e}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;if(n)throw n;if(!t)throw new Mm;let{error:r}=await Z(this.fetch,`GET`,`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return this._returnResult({data:{user:null,session:null},error:r})})}catch(e){if(X(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{let t=`${this.url}/resend`;if(`email`in e){let{email:n,type:r,options:i}=e,{error:a}=await Z(this.fetch,`POST`,t,{headers:this.headers,body:{email:n,type:r,gotrue_meta_security:{captcha_token:i?.captchaToken}},redirectTo:i?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:a})}if(`phone`in e){let{phone:n,type:r,options:i}=e,{data:a,error:o}=await Z(this.fetch,`POST`,t,{headers:this.headers,body:{phone:n,type:r,gotrue_meta_security:{captcha_token:i?.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:a?.message_id},error:o})}throw new Fm(`You must provide either an email or phone number and a type`)}catch(e){if(X(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async e=>e))}async _acquireLock(e,t){this._debug(`#_acquireLock`,`begin`,e);try{if(this.lockAcquired){let e=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),n=(async()=>(await e,await t()))();return this.pendingInLock.push((async()=>{try{await n}catch{}})()),n}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug(`#_acquireLock`,`lock acquired for storage key`,this.storageKey);try{this.lockAcquired=!0;let e=t();for(this.pendingInLock.push((async()=>{try{await e}catch{}})()),await e;this.pendingInLock.length;){let e=[...this.pendingInLock];await Promise.all(e),this.pendingInLock.splice(0,e.length)}return await e}finally{this._debug(`#_acquireLock`,`lock released for storage key`,this.storageKey),this.lockAcquired=!1}})}finally{this._debug(`#_acquireLock`,`end`)}}async _useSession(e){this._debug(`#_useSession`,`begin`);try{return await e(await this.__loadSession())}finally{this._debug(`#_useSession`,`end`)}}async __loadSession(){this._debug(`#__loadSession()`,`begin`),this.lockAcquired||this._debug(`#__loadSession()`,`used outside of an acquired lock!`,Error().stack);try{let e=null,t=await dh(this.storage,this.storageKey);if(this._debug(`#getSession()`,`session from storage`,t),t!==null&&(this._isValidSession(t)?e=t:(this._debug(`#getSession()`,`session from storage is not valid`),await this._removeSession())),!e)return{data:{session:null},error:null};let n=e.expires_at?e.expires_at*1e3-Date.now()<bm:!1;if(this._debug(`#__loadSession()`,`session has${n?``:` not`} expired`,`expires_at`,e.expires_at),!n){if(this.userStorage){let t=await dh(this.userStorage,this.storageKey+`-user`);t?.user?e.user=t.user:e.user=kh()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){let t={value:this.suppressGetSessionWarning};e.user=Ah(e.user,t),t.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}let{data:r,error:i}=await this._callRefreshToken(e.refresh_token);return i?this._returnResult({data:{session:null},error:i}):this._returnResult({data:{session:r},error:null})}finally{this._debug(`#__loadSession()`,`end`)}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;let t=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return t.data.user&&(this.suppressGetSessionWarning=!0),t}async _getUser(e){try{return e?await Z(this.fetch,`GET`,`${this.url}/user`,{headers:this.headers,jwt:e,xform:zh}):await this._useSession(async e=>{let{data:t,error:n}=e;if(n)throw n;return!t.session?.access_token&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Mm}:await Z(this.fetch,`GET`,`${this.url}/user`,{headers:this.headers,jwt:t.session?.access_token??void 0,xform:zh})})}catch(e){if(X(e))return Nm(e)&&(await this._removeSession(),await fh(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:e});throw e}}async updateUser(e,t={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,t))}async _updateUser(e,t={}){try{return await this._useSession(async n=>{let{data:r,error:i}=n;if(i)throw i;if(!r.session)throw new Mm;let a=r.session,o=null,s=null;this.flowType===`pkce`&&e.email!=null&&([o,s]=await xh(this.storage,this.storageKey));let{data:c,error:l}=await Z(this.fetch,`PUT`,`${this.url}/user`,{headers:this.headers,redirectTo:t?.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:o,code_challenge_method:s}),jwt:a.access_token,xform:zh});if(l)throw l;return a.user=c.user,await this._saveSession(a),await this._notifyAllSubscribers(`USER_UPDATED`,a),this._returnResult({data:{user:a.user},error:null})})}catch(e){if(await fh(this.storage,`${this.storageKey}-code-verifier`),X(e))return this._returnResult({data:{user:null},error:e});throw e}}async setSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new Mm;let t=Date.now()/1e3,n=t,r=!0,i=null,{payload:a}=mh(e.access_token);if(a.exp&&(n=a.exp,r=n<=t),r){let{data:t,error:n}=await this._callRefreshToken(e.refresh_token);if(n)return this._returnResult({data:{user:null,session:null},error:n});if(!t)return{data:{user:null,session:null},error:null};i=t}else{let{data:r,error:a}=await this._getUser(e.access_token);if(a)return this._returnResult({data:{user:null,session:null},error:a});i={access_token:e.access_token,refresh_token:e.refresh_token,user:r.user,token_type:`bearer`,expires_in:n-t,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(e){if(X(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async t=>{if(!e){let{data:n,error:r}=t;if(r)throw r;e=n.session??void 0}if(!e?.refresh_token)throw new Mm;let{data:n,error:r}=await this._callRefreshToken(e.refresh_token);return r?this._returnResult({data:{user:null,session:null},error:r}):n?this._returnResult({data:{user:n.user,session:n},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(e){if(X(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _getSessionFromURL(e,t){try{if(!ih())throw new Im(`No browser detected.`);if(e.error||e.error_description||e.error_code)throw new Im(e.error_description||`Error in URL with unspecified error_description`,{error:e.error||`unspecified_error`,code:e.error_code||`unspecified_code`});switch(t){case`implicit`:if(this.flowType===`pkce`)throw new Rm(`Not a valid PKCE flow url.`);break;case`pkce`:if(this.flowType===`implicit`)throw new Im(`Not a valid implicit grant flow url.`)}if(t===`pkce`){if(this._debug(`#_initialize()`,`begin`,`is PKCE flow`,!0),!e.code)throw new Rm(`No code detected.`);let{data:t,error:n}=await this._exchangeCodeForSession(e.code);if(n)throw n;let r=new URL(window.location.href);return r.searchParams.delete(`code`),window.history.replaceState(window.history.state,``,r.toString()),{data:{session:t.session,redirectType:t.redirectType??null},error:null}}let{provider_token:n,provider_refresh_token:r,access_token:i,refresh_token:a,expires_in:o,expires_at:s,token_type:c}=e;if(!i||!o||!a||!c)throw new Im(`No session defined in URL`);let l=Math.round(Date.now()/1e3),u=parseInt(o),d=l+u;s&&(d=parseInt(s));let f=d-l;f*1e3<=3e4&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${f}s, should have been closer to ${u}s`);let p=d-u;l-p>=120?console.warn(`@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale`,p,d,l):l-p<0&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew`,p,d,l);let{data:m,error:h}=await this._getUser(i);if(h)throw h;let g={provider_token:n,provider_refresh_token:r,access_token:i,expires_in:u,expires_at:d,refresh_token:a,token_type:c,user:m.user};return window.location.hash=``,this._debug(`#_getSessionFromURL()`,`clearing window.location.hash`),this._returnResult({data:{session:g,redirectType:e.type},error:null})}catch(e){if(X(e))return this._returnResult({data:{session:null,redirectType:null},error:e});throw e}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl==`function`?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error_description)}async _isPKCECallback(e){let t=await dh(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&t)}async signOut(e={scope:`global`}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:`global`}){return await this._useSession(async t=>{let{data:n,error:r}=t;if(r&&!Nm(r))return this._returnResult({error:r});let i=n.session?.access_token;if(i){let{error:t}=await this.admin.signOut(i,e);if(t&&!(km(t)&&(t.status===404||t.status===401||t.status===403)||Nm(t)))return this._returnResult({error:t})}return e!==`others`&&(await this._removeSession(),await fh(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){let t=rh(),n={id:t,callback:e,unsubscribe:()=>{this._debug(`#unsubscribe()`,`state change callback with id removed`,t),this.stateChangeEmitters.delete(t)}};return this._debug(`#onAuthStateChange()`,`registered callback with id`,t),this.stateChangeEmitters.set(t,n),(async()=>{await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(t)})})(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async t=>{try{let{data:{session:n},error:r}=t;if(r)throw r;await this.stateChangeEmitters.get(e)?.callback(`INITIAL_SESSION`,n),this._debug(`INITIAL_SESSION`,`callback id`,e,`session`,n)}catch(t){await this.stateChangeEmitters.get(e)?.callback(`INITIAL_SESSION`,null),this._debug(`INITIAL_SESSION`,`callback id`,e,`error`,t),Nm(t)?console.warn(t):console.error(t)}})}async resetPasswordForEmail(e,t={}){let n=null,r=null;this.flowType===`pkce`&&([n,r]=await xh(this.storage,this.storageKey,!0));try{return await Z(this.fetch,`POST`,`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:r,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(e){if(await fh(this.storage,`${this.storageKey}-code-verifier`),X(e))return this._returnResult({data:null,error:e});throw e}}async getUserIdentities(){try{let{data:e,error:t}=await this.getUser();if(t)throw t;return this._returnResult({data:{identities:e.user.identities??[]},error:null})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async linkIdentity(e){return`token`in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){try{let{data:t,error:n}=await this._useSession(async t=>{let{data:n,error:r}=t;if(r)throw r;let i=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:e.options?.redirectTo,scopes:e.options?.scopes,queryParams:e.options?.queryParams,skipBrowserRedirect:!0});return await Z(this.fetch,`GET`,i,{headers:this.headers,jwt:n.session?.access_token??void 0})});if(n)throw n;return ih()&&!e.options?.skipBrowserRedirect&&window.location.assign(t?.url),this._returnResult({data:{provider:e.provider,url:t?.url},error:null})}catch(t){if(X(t))return this._returnResult({data:{provider:e.provider,url:null},error:t});throw t}}async linkIdentityIdToken(e){return await this._useSession(async t=>{try{let{error:n,data:{session:r}}=t;if(n)throw n;let{options:i,provider:a,token:o,access_token:s,nonce:c}=e,{data:l,error:u}=await Z(this.fetch,`POST`,`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:r?.access_token??void 0,body:{provider:a,id_token:o,access_token:s,nonce:c,link_identity:!0,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:Lh});return u?this._returnResult({data:{user:null,session:null},error:u}):!l||!l.session||!l.user?this._returnResult({data:{user:null,session:null},error:new Pm}):(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers(`USER_UPDATED`,l.session)),this._returnResult({data:l,error:u}))}catch(e){if(await fh(this.storage,`${this.storageKey}-code-verifier`),X(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}})}async unlinkIdentity(e){try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)throw r;return await Z(this.fetch,`DELETE`,`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:n.session?.access_token??void 0})})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async _refreshAccessToken(e){let t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,`begin`);try{let n=Date.now();return await gh(async n=>(n>0&&await hh(200*2**(n-1)),this._debug(t,`refreshing attempt`,n),await Z(this.fetch,`POST`,`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:Lh})),(e,t)=>{let r=200*2**e;return t&&Vm(t)&&Date.now()+r-n<3e4})}catch(e){if(this._debug(t,`error`,e),X(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}finally{this._debug(t,`end`)}}_isValidSession(e){return typeof e==`object`&&!!e&&`access_token`in e&&`refresh_token`in e&&`expires_at`in e}async _handleProviderSignIn(e,t){let n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug(`#_handleProviderSignIn()`,`provider`,e,`options`,t,`url`,n),ih()&&!t.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){let e=`#_recoverAndRefresh()`;this._debug(e,`begin`);try{let t=await dh(this.storage,this.storageKey);if(t&&this.userStorage){let e=await dh(this.userStorage,this.storageKey+`-user`);!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!e&&(e={user:t.user},await uh(this.userStorage,this.storageKey+`-user`,e)),t.user=e?.user??kh()}else if(t&&!t.user&&!t.user){let e=await dh(this.storage,this.storageKey+`-user`);e&&e?.user?(t.user=e.user,await fh(this.storage,this.storageKey+`-user`),await uh(this.storage,this.storageKey,t)):t.user=kh()}if(this._debug(e,`session from storage`,t),!this._isValidSession(t)){this._debug(e,`session is not valid`),t!==null&&await this._removeSession();return}let n=(t.expires_at??1/0)*1e3-Date.now()<bm;if(this._debug(e,`session has${n?``:` not`} expired with margin of ${bm}s`),n){if(this.autoRefreshToken&&t.refresh_token){let{error:n}=await this._callRefreshToken(t.refresh_token);n&&(console.error(n),Vm(n)||(this._debug(e,`refresh failed with a non-retryable error, removing the session`,n),await this._removeSession()))}}else if(t.user&&t.user.__isUserNotAvailableProxy===!0)try{let{data:n,error:r}=await this._getUser(t.access_token);!r&&n?.user?(t.user=n.user,await this._saveSession(t),await this._notifyAllSubscribers(`SIGNED_IN`,t)):this._debug(e,`could not get user data, skipping SIGNED_IN notification`)}catch(t){console.error(`Error getting user data:`,t),this._debug(e,`error getting user data, skipping SIGNED_IN notification`,t)}else await this._notifyAllSubscribers(`SIGNED_IN`,t)}catch(t){this._debug(e,`error`,t),console.error(t);return}finally{this._debug(e,`end`)}}async _callRefreshToken(e){var t,n;if(!e)throw new Mm;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let r=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(r,`begin`);try{this.refreshingDeferred=new ph;let{data:t,error:n}=await this._refreshAccessToken(e);if(n)throw n;if(!t.session)throw new Mm;await this._saveSession(t.session),await this._notifyAllSubscribers(`TOKEN_REFRESHED`,t.session);let r={data:t.session,error:null};return this.refreshingDeferred.resolve(r),r}catch(e){if(this._debug(r,`error`,e),X(e)){let n={data:null,error:e};return Vm(e)||await this._removeSession(),(t=this.refreshingDeferred)==null||t.resolve(n),n}throw(n=this.refreshingDeferred)==null||n.reject(e),e}finally{this.refreshingDeferred=null,this._debug(r,`end`)}}async _notifyAllSubscribers(e,t,n=!0){let r=`#_notifyAllSubscribers(${e})`;this._debug(r,`begin`,t,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:t});let r=[],i=Array.from(this.stateChangeEmitters.values()).map(async n=>{try{await n.callback(e,t)}catch(e){r.push(e)}});if(await Promise.all(i),r.length>0){for(let e=0;e<r.length;e+=1)console.error(r[e]);throw r[0]}}finally{this._debug(r,`end`)}}async _saveSession(e){this._debug(`#_saveSession()`,e),this.suppressGetSessionWarning=!0,await fh(this.storage,`${this.storageKey}-code-verifier`);let t=Object.assign({},e),n=t.user&&t.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&t.user&&await uh(this.userStorage,this.storageKey+`-user`,{user:t.user});let e=Object.assign({},t);delete e.user;let r=jh(e);await uh(this.storage,this.storageKey,r)}else{let e=jh(t);await uh(this.storage,this.storageKey,e)}}async _removeSession(){this._debug(`#_removeSession()`),this.suppressGetSessionWarning=!1,await fh(this.storage,this.storageKey),await fh(this.storage,this.storageKey+`-code-verifier`),await fh(this.storage,this.storageKey+`-user`),this.userStorage&&await fh(this.userStorage,this.storageKey+`-user`),await this._notifyAllSubscribers(`SIGNED_OUT`,null)}_removeVisibilityChangedCallback(){this._debug(`#_removeVisibilityChangedCallback()`);let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&ih()&&window!=null&&window.removeEventListener&&window.removeEventListener(`visibilitychange`,e)}catch(e){console.error(`removing visibilitychange callback failed`,e)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug(`#_startAutoRefresh()`);let e=setInterval(()=>this._autoRefreshTokenTick(),ym);this.autoRefreshTicker=e,e&&typeof e==`object`&&typeof e.unref==`function`?e.unref():typeof Deno<`u`&&typeof Deno.unrefTimer==`function`&&Deno.unrefTimer(e);let t=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=t,t&&typeof t==`object`&&typeof t.unref==`function`?t.unref():typeof Deno<`u`&&typeof Deno.unrefTimer==`function`&&Deno.unrefTimer(t)}async _stopAutoRefresh(){this._debug(`#_stopAutoRefresh()`);let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);let t=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,t&&clearTimeout(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{let e=Date.now();try{return await this._useSession(async t=>{let{data:{session:n}}=t;if(!n||!n.refresh_token||!n.expires_at){this._debug(`#_autoRefreshTokenTick()`,`no session`);return}let r=Math.floor((n.expires_at*1e3-e)/ym);this._debug(`#_autoRefreshTokenTick()`,`access token expires in ${r} ticks, a tick lasts ${ym}ms, refresh threshold is 3 ticks`),r<=3&&await this._callRefreshToken(n.refresh_token)})}catch(e){console.error(`Auto refresh tick failed with error. This is likely a transient error.`,e)}}finally{this._debug(`#_autoRefreshTokenTick()`,`end`)}})}catch(e){if(e instanceof Jh)this._debug(`auto refresh token tick lock not available`);else throw e}}async _handleVisibilityChange(){if(this._debug(`#_handleVisibilityChange()`),!ih()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug(`#visibilityChangedCallback`,`error`,e)}},window==null||window.addEventListener(`visibilitychange`,this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error(`_handleVisibilityChange`,e)}}async _onVisibilityChanged(e){let t=`#_onVisibilityChanged(${e})`;this._debug(t,`visibilityState`,document.visibilityState),document.visibilityState===`visible`?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{document.visibilityState===`visible`?await this._recoverAndRefresh():this._debug(t,`acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting`)}))):document.visibilityState===`hidden`&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,n){let r=[`provider=${encodeURIComponent(t)}`];if(n?.redirectTo&&r.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n?.scopes&&r.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType===`pkce`){let[e,t]=await xh(this.storage,this.storageKey),n=new URLSearchParams({code_challenge:`${encodeURIComponent(e)}`,code_challenge_method:`${encodeURIComponent(t)}`});r.push(n.toString())}if(n?.queryParams){let e=new URLSearchParams(n.queryParams);r.push(e.toString())}return n?.skipBrowserRedirect&&r.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${r.join(`&`)}`}async _unenroll(e){try{return await this._useSession(async t=>{let{data:n,error:r}=t;return r?this._returnResult({data:null,error:r}):await Z(this.fetch,`DELETE`,`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:n?.session?.access_token})})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async _enroll(e){try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)return this._returnResult({data:null,error:r});let i=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType===`phone`?{phone:e.phone}:e.factorType===`totp`?{issuer:e.issuer}:{}),{data:a,error:o}=await Z(this.fetch,`POST`,`${this.url}/factors`,{body:i,headers:this.headers,jwt:n?.session?.access_token});return o?this._returnResult({data:null,error:o}):(e.factorType===`totp`&&a.type===`totp`&&a?.totp?.qr_code&&(a.totp.qr_code=`data:image/svg+xml;utf-8,${a.totp.qr_code}`),this._returnResult({data:a,error:null}))})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async _verify(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)return this._returnResult({data:null,error:r});let i=Object.assign({challenge_id:e.challengeId},`webauthn`in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type===`create`?cg(e.webauthn.credential_response):lg(e.webauthn.credential_response)})}:{code:e.code}),{data:a,error:o}=await Z(this.fetch,`POST`,`${this.url}/factors/${e.factorId}/verify`,{body:i,headers:this.headers,jwt:n?.session?.access_token});return o?this._returnResult({data:null,error:o}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+a.expires_in},a)),await this._notifyAllSubscribers(`MFA_CHALLENGE_VERIFIED`,a),this._returnResult({data:a,error:o}))})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}})}async _challenge(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)return this._returnResult({data:null,error:r});let i=await Z(this.fetch,`POST`,`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:n?.session?.access_token});if(i.error)return i;let{data:a}=i;if(a.type!==`webauthn`)return{data:a,error:null};switch(a.webauthn.type){case`create`:return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:og(a.webauthn.credential_options.publicKey)})})}),error:null};case`request`:return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:sg(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}})}async _challengeAndVerify(e){let{data:t,error:n}=await this._challenge({factorId:e.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){let{data:{user:e},error:t}=await this.getUser();if(t)return{data:null,error:t};let n={all:[],phone:[],totp:[],webauthn:[]};for(let t of e?.factors??[])n.all.push(t),t.status===`verified`&&n[t.factor_type].push(t);return{data:n,error:null}}async _getAuthenticatorAssuranceLevel(e){if(e)try{let{payload:t}=mh(e),n=null;t.aal&&(n=t.aal);let r=n,{data:{user:i},error:a}=await this.getUser(e);if(a)return this._returnResult({data:null,error:a});((i?.factors)?.filter(e=>e.status===`verified`)??[]).length>0&&(r=`aal2`);let o=t.amr||[];return{data:{currentLevel:n,nextLevel:r,currentAuthenticationMethods:o},error:null}}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}let{data:{session:t},error:n}=await this.getSession();if(n)return this._returnResult({data:null,error:n});if(!t)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let{payload:r}=mh(t.access_token),i=null;r.aal&&(i=r.aal);let a=i;(t.user.factors?.filter(e=>e.status===`verified`)??[]).length>0&&(a=`aal2`);let o=r.amr||[];return{data:{currentLevel:i,nextLevel:a,currentAuthenticationMethods:o},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?await Z(this.fetch,`GET`,`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:n.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new Mm})})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async _approveAuthorization(e,t){try{return await this._useSession(async n=>{let{data:{session:r},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!r)return this._returnResult({data:null,error:new Mm});let a=await Z(this.fetch,`POST`,`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:`approve`},xform:e=>({data:e,error:null})});return a.data&&a.data.redirect_url&&ih()&&!t?.skipBrowserRedirect&&window.location.assign(a.data.redirect_url),a})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async _denyAuthorization(e,t){try{return await this._useSession(async n=>{let{data:{session:r},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!r)return this._returnResult({data:null,error:new Mm});let a=await Z(this.fetch,`POST`,`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:`deny`},xform:e=>({data:e,error:null})});return a.data&&a.data.redirect_url&&ih()&&!t?.skipBrowserRedirect&&window.location.assign(a.data.redirect_url),a})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async _listOAuthGrants(){try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;return n?this._returnResult({data:null,error:n}):t?await Z(this.fetch,`GET`,`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new Mm})})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?(await Z(this.fetch,`DELETE`,`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new Mm})})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async fetchJwk(e,t={keys:[]}){let n=t.keys.find(t=>t.kid===e);if(n)return n;let r=Date.now();if(n=this.jwks.keys.find(t=>t.kid===e),n&&this.jwks_cached_at+6e5>r)return n;let{data:i,error:a}=await Z(this.fetch,`GET`,`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(a)throw a;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=r,n=i.keys.find(t=>t.kid===e),!n)?null:n}async getClaims(e,t={}){try{let n=e;if(!n){let{data:e,error:t}=await this.getSession();if(t||!e.session)return this._returnResult({data:null,error:t});n=e.session.access_token}let{header:r,payload:i,signature:a,raw:{header:o,payload:s}}=mh(n);t?.allowExpired||wh(i.exp);let c=!r.alg||r.alg.startsWith(`HS`)||!r.kid||!(`crypto`in globalThis&&`subtle`in globalThis.crypto)?null:await this.fetchJwk(r.kid,t?.keys?{keys:t.keys}:t?.jwks);if(!c){let{error:e}=await this.getUser(n);if(e)throw e;return{data:{claims:i,header:r,signature:a},error:null}}let l=Th(r.alg),u=await crypto.subtle.importKey(`jwk`,c,l,!0,[`verify`]);if(!await crypto.subtle.verify(l,u,a,eh(`${o}.${s}`)))throw new Um(`Invalid JWT signature`);return{data:{claims:i,header:r,signature:a},error:null}}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async signInWithPasskey(e){Oh(this.experimental);try{if(!dg())return this._returnResult({data:null,error:new Am(`Browser does not support WebAuthn`,null)});let{data:t,error:n}=await this._startPasskeyAuthentication({options:{captchaToken:e?.options?.captchaToken}});if(n||!t)return this._returnResult({data:null,error:n});let{data:r,error:i}=await pg({publicKey:sg(t.options),signal:e?.options?.signal??ag.createNewAbortSignal()});if(i||!r)return this._returnResult({data:null,error:i??new Am(`WebAuthn ceremony failed`,null)});let a=lg(r);return this._verifyPasskeyAuthentication({challengeId:t.challenge_id,credential:a})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async registerPasskey(e){Oh(this.experimental);try{if(!dg())return this._returnResult({data:null,error:new Am(`Browser does not support WebAuthn`,null)});let{data:t,error:n}=await this._startPasskeyRegistration();if(n||!t)return this._returnResult({data:null,error:n});let{data:r,error:i}=await fg({publicKey:og(t.options),signal:e?.options?.signal??ag.createNewAbortSignal()});if(i||!r)return this._returnResult({data:null,error:i??new Am(`WebAuthn ceremony failed`,null)});let a=cg(r);return this._verifyPasskeyRegistration({challengeId:t.challenge_id,credential:a})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async _startPasskeyRegistration(){Oh(this.experimental);try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!t)return this._returnResult({data:null,error:new Mm});let{data:r,error:i}=await Z(this.fetch,`POST`,`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:t.access_token,body:{}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:r,error:null})})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyRegistration(e){Oh(this.experimental);try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new Mm});let{data:i,error:a}=await Z(this.fetch,`POST`,`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:n.access_token,body:{challenge_id:e.challengeId,credential:e.credential}});return a?this._returnResult({data:null,error:a}):this._returnResult({data:i,error:null})})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async _startPasskeyAuthentication(e){Oh(this.experimental);try{let{data:t,error:n}=await Z(this.fetch,`POST`,`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:e?.options?.captchaToken}}});return n?this._returnResult({data:null,error:n}):this._returnResult({data:t,error:null})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyAuthentication(e){Oh(this.experimental);try{let{data:t,error:n}=await Z(this.fetch,`POST`,`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:Lh});return n?this._returnResult({data:null,error:n}):(t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers(`SIGNED_IN`,t.session)),this._returnResult({data:t,error:null}))}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async _listPasskeys(){Oh(this.experimental);try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!t)return this._returnResult({data:null,error:new Mm});let{data:r,error:i}=await Z(this.fetch,`GET`,`${this.url}/passkeys`,{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})});return i?this._returnResult({data:null,error:i}):this._returnResult({data:r,error:null})})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async _updatePasskey(e){Oh(this.experimental);try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new Mm});let{data:i,error:a}=await Z(this.fetch,`PATCH`,`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,body:{friendly_name:e.friendlyName}});return a?this._returnResult({data:null,error:a}):this._returnResult({data:i,error:null})})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async _deletePasskey(e){Oh(this.experimental);try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new Mm});let{error:i}=await Z(this.fetch,`DELETE`,`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,noResolveJson:!0});return i?this._returnResult({data:null,error:i}):this._returnResult({data:null,error:null})})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}};Cg.nextInstanceID={};var wg=Cg,Tg=`2.106.1`,Eg=``;Eg=typeof Deno<`u`?`deno`:typeof document<`u`?`web`:typeof navigator<`u`&&navigator.product===`ReactNative`?`react-native`:`node`;var Dg={headers:{"X-Client-Info":`supabase-js-${Eg}/${Tg}`}},Og={schema:`public`},kg={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:`implicit`},Ag={},jg={enabled:!1,respectSamplingDecision:!0};function Mg(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}var Ng=null,Pg=`@opentelemetry/api`;function Fg(){return Ng===null&&(Ng=import(Pg).catch(()=>null)),Ng}function Ig(){return Mg(this,void 0,void 0,function*(){try{let e=yield Fg();if(!e||!e.propagation||!e.context)return null;let t={};e.propagation.inject(e.context.active(),t);let n=t.traceparent;return n?{traceparent:n,tracestate:t.tracestate,baggage:t.baggage}:null}catch{return null}})}function Lg(e){if(!e||typeof e!=`string`)return null;let t=e.split(`-`);if(t.length!==4)return null;let[n,r,i,a]=t;if(n.length!==2||r.length!==32||i.length!==16||a.length!==2)return null;let o=/^[0-9a-f]+$/i;return!o.test(n)||!o.test(r)||!o.test(i)||!o.test(a)||r===`00000000000000000000000000000000`||i===`0000000000000000`?null:{version:n,traceId:r,parentId:i,traceFlags:a,isSampled:(parseInt(a,16)&1)==1}}function Rg(e,t){if(!e||!t||t.length===0)return!1;let n;if(e instanceof URL)n=e;else try{n=new URL(e)}catch{return!1}for(let e of t)try{if(typeof e==`string`){if(zg(n.hostname,e))return!0}else if(e instanceof RegExp){if(e.test(n.hostname))return!0}else if(typeof e==`function`&&e(n))return!0}catch{continue}return!1}function zg(e,t){if(t===e)return!0;if(t.startsWith(`*.`)){let n=t.slice(2);if(e.endsWith(n)&&(e===n||e.endsWith(`.`+n)))return!0}return!1}function Bg(e){let t=[];try{let n=new URL(e);t.push(n.hostname)}catch{}return t.push(`*.supabase.co`,`*.supabase.in`),t.push(`localhost`,`127.0.0.1`,`[::1]`),t}function Vg(e){"@babel/helpers - typeof";return Vg=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Vg(e)}function Hg(e,t){if(Vg(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Vg(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Ug(e){var t=Hg(e,`string`);return Vg(t)==`symbol`?t:t+``}function Wg(e,t,n){return(t=Ug(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Gg(Object(n),!0).forEach(function(t){Wg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gg(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Kg=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),qg=()=>Headers,Jg=(e,t,n,r,i)=>{let a=Kg(r),o=qg(),s=i?.enabled===!0,c=i?.respectSamplingDecision!==!1,l=s?Bg(t):null;return async(t,r)=>{let i=await n()??e,s=new o(r?.headers);if(s.has(`apikey`)||s.set(`apikey`,e),s.has(`Authorization`)||s.set(`Authorization`,`Bearer ${i}`),l){let e=await Yg(t,l,c);e&&(e.traceparent&&!s.has(`traceparent`)&&s.set(`traceparent`,e.traceparent),e.tracestate&&!s.has(`tracestate`)&&s.set(`tracestate`,e.tracestate),e.baggage&&!s.has(`baggage`)&&s.set(`baggage`,e.baggage))}return a(t,$($({},r),{},{headers:s}))}};async function Yg(e,t,n){if(!Rg(typeof e==`string`||e instanceof URL?e:e.url,t))return null;let r=await Ig();if(!r||!r.traceparent)return null;if(n){let e=Lg(r.traceparent);if(e&&!e.isSampled)return null}return r}function Xg(e){return typeof e==`boolean`?{enabled:e}:e}function Zg(e){return e.endsWith(`/`)?e:e+`/`}function Qg(e,t){let{db:n,auth:r,realtime:i,global:a}=e,{db:o,auth:s,realtime:c,global:l}=t,u=Xg(e.tracePropagation),d=Xg(t.tracePropagation),f={db:$($({},o),n),auth:$($({},s),r),realtime:$($({},c),i),storage:{},global:$($($({},l),a),{},{headers:$($({},l?.headers??{}),a?.headers??{})}),tracePropagation:{enabled:u?.enabled??d?.enabled??!1,respectSamplingDecision:u?.respectSamplingDecision??d?.respectSamplingDecision??!0},accessToken:async()=>``};return e.accessToken?f.accessToken=e.accessToken:delete f.accessToken,f}function $g(e){let t=e?.trim();if(!t)throw Error(`supabaseUrl is required.`);if(!t.match(/^https?:\/\//i))throw Error(`Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.`);try{return new URL(Zg(t))}catch{throw Error(`Invalid supabaseUrl: Provided URL is malformed.`)}}var e_=class extends wg{constructor(e){super(e)}},t_=class{constructor(e,t,n){this.supabaseUrl=e,this.supabaseKey=t;let r=$g(e);if(!t)throw Error(`supabaseKey is required.`);this.realtimeUrl=new URL(`realtime/v1`,r),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace(`http`,`ws`),this.authUrl=new URL(`auth/v1`,r),this.storageUrl=new URL(`storage/v1`,r),this.functionsUrl=new URL(`functions/v1`,r);let i=`sb-${r.hostname.split(`.`)[0]}-auth-token`,a={db:Og,realtime:Ag,auth:$($({},kg),{},{storageKey:i}),global:Dg,tracePropagation:jg},o=Qg(n??{},a);this.settings=o,this.storageKey=o.auth.storageKey??``,this.headers=o.global.headers??{},o.accessToken?(this.accessToken=o.accessToken,this.auth=new Proxy({},{get:(e,t)=>{throw Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(t)} is not possible`)}})):this.auth=this._initSupabaseAuthClient(o.auth??{},this.headers,o.global.fetch),this.fetch=Jg(t,e,this._getAccessToken.bind(this),o.global.fetch,o.tracePropagation),this.realtime=this._initRealtimeClient($({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},o.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(e=>this.realtime.setAuth(e)).catch(e=>console.warn(`Failed to set initial Realtime auth token:`,e)),this.rest=new cf(new URL(`rest/v1`,r).href,{headers:this.headers,schema:o.db.schema,fetch:this.fetch,timeout:o.db.timeout,urlLengthLimit:o.db.urlLengthLimit}),this.storage=new _m(this.storageUrl.href,this.headers,this.fetch,n?.storage),o.accessToken||this._listenForAuthEvents()}get functions(){return new Hd(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,n)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this;if(e.accessToken)return await e.accessToken();let{data:t}=await e.auth.getSession();return t.session?.access_token??e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,storageKey:a,flowType:o,lock:s,debug:c,throwOnError:l,experimental:u,lockAcquireTimeout:d,skipAutoInitialize:f},p,m){let h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new e_({url:this.authUrl.href,headers:$($({},h),p),storageKey:a,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,flowType:o,lock:s,debug:c,throwOnError:l,experimental:u,fetch:m,lockAcquireTimeout:d,skipAutoInitialize:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(e=>e.toLowerCase()===`authorization`)})}_initRealtimeClient(e){return new vp(this.realtimeUrl.href,$($({},e),{},{params:$($({},{apikey:this.supabaseKey}),e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,`CLIENT`,t?.access_token)})}_handleTokenChanged(e,t,n){(e===`TOKEN_REFRESHED`||e===`SIGNED_IN`)&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e===`SIGNED_OUT`&&(this.realtime.setAuth(),t==`STORAGE`&&this.auth.signOut(),this.changedAccessToken=void 0)}},n_=(e,t,n)=>new t_(e,t,n);function r_(){if(typeof window<`u`)return!1;let e=globalThis.process;if(!e)return!1;let t=e.version;if(t==null)return!1;let n=t.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=18:!1}r_()&&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 Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217`);var i_=class{client;channels=new Map;eventSubs=new Map;presenceSubs=new Map;constructor(e){if(e.client)this.client=e.client;else{if(!e.url||!e.anonKey)throw Error(`SupabaseTransport requires url + anonKey when no client is provided`);this.client=n_(e.url,e.anonKey)}}getChannel(e){let t=this.channels.get(e);return t||(t=this.client.channel(e,{config:{broadcast:{self:!1}}}),t.on(`broadcast`,{event:`gameEvent`},({payload:t})=>{let n=this.eventSubs.get(e);if(n)for(let e of n)e(t)}),t.on(`presence`,{event:`sync`},()=>{let t=this.presenceSubs.get(e);if(t){let n=this.flattenPresence(e);for(let e of t)e(n)}}),t.subscribe(),this.channels.set(e,t)),t}async broadcast(e,t){let n=this.eventSubs.get(e);if(n)for(let e of[...n])e(t);await this.getChannel(e).send({type:`broadcast`,event:`gameEvent`,payload:t})}subscribe(e,t){return this.getChannel(e),this.eventSubs.has(e)||this.eventSubs.set(e,new Set),this.eventSubs.get(e).add(t),()=>{this.eventSubs.get(e)?.delete(t)}}flattenPresence(e){let t=this.channels.get(e);if(!t)return[];let n=t.presenceState();return Object.values(n).flat()}presence={track:async(e,t)=>{await this.getChannel(e).track(t)},untrack:async e=>{let t=this.channels.get(e);t&&await t.untrack()},list:e=>(this.getChannel(e),this.flattenPresence(e)),onChange:(e,t)=>(this.getChannel(e),this.presenceSubs.has(e)||this.presenceSubs.set(e,new Set),this.presenceSubs.get(e).add(t),()=>{this.presenceSubs.get(e)?.delete(t)})}},a_=`__host__`,o_=`hashquiz:player-session`;function s_(e){try{let t=sessionStorage.getItem(o_);if(!t)return null;let n=JSON.parse(t);return n.code===e?n:null}catch{return null}}function c_(e){try{sessionStorage.setItem(o_,JSON.stringify(e))}catch{}}function l_(){try{let e=sessionStorage.getItem(o_+`:draft`);return e?JSON.parse(e):null}catch{return null}}function u_(e){try{sessionStorage.setItem(o_+`:draft`,JSON.stringify(e))}catch{}}function d_(){try{sessionStorage.removeItem(o_+`:draft`)}catch{}}function f_(){return Math.random().toString(36).slice(2)+Date.now().toString(36)}var p_=vc(`game`,()=>{let e=R(`join`),t=R(f_()),n=R(0),r=R(null),i=R(0),a=R(!1),o=R(0),s=R(0),c=R(0),l=R(null),u=R(0),d=R([]),f=R(void 0),p=R([]),m=R(``),h=R(null),g=R(null),_=R(`connecting`),v=K(()=>!a.value&&g.value!==null&&Date.now()<g.value),y=null,b=null,x=``,S=``,C=``,w=``,T=`local`,E=0,D=null,O=!1;function k(){O||typeof document>`u`||(O=!0,document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&te()}),window.addEventListener(`pageshow`,te),window.addEventListener(`online`,te),window.addEventListener(`pagehide`,ee))}function ee(){T===`supabase`&&b&&x&&b.presence.untrack(x)}function te(){if(e.value!==`join`&&S){if(T===`local`)!y||y.readyState===WebSocket.CLOSED||y.readyState===WebSocket.CLOSING?ne(0):y.readyState===WebSocket.OPEN&&y.send(JSON.stringify({type:`state_request`}));else if(T===`supabase`&&b&&x){let e={id:t.value,pseudo:C,email:w,score:s.value,joinedAt:Date.now()};b.presence.track(x,e),b.broadcast(x,bd.stateRequest(t.value)),_.value=`connected`}}}function ne(e){if(D)return;let t=e===void 0?Math.min(1e4,1e3*2**E):e;_.value=`reconnecting`,D=setTimeout(()=>{D=null,E++,A(!0)},t)}async function re(n,r,i){let a=Nd.supabaseUrl,o=Nd.supabaseAnonKey;if(!a||!o){m.value=`Missing Supabase credentials`;return}T=`supabase`,b=new i_({url:a,anonKey:o}),x=`game:${n}`,S=n,C=r,w=i,b.subscribe(x,se),k(),await new Promise(e=>setTimeout(e,300));let c=b.presence.list(x).filter(e=>e.id!==a_&&e.id!==t.value).map(e=>e.pseudo),l=r,u=2;for(;c.includes(l);)l=`${r}-${u++}`;C=l;let d={id:t.value,pseudo:l,email:i,score:s.value,joinedAt:Date.now()};await b.presence.track(x,d),setTimeout(()=>{b.presence.list(x).some(e=>e.id===a_)?(e.value===`join`&&(e.value=`lobby`),_.value=`connected`,c_({playerId:t.value,code:S,pseudo:C,email:w}),b.broadcast(x,bd.stateRequest(t.value))):(m.value=`No game found for this code`,_.value=`offline`)},3e3)}function ie(e,n){b&&b.broadcast(x,bd.answerSubmit(t.value,e,n))}function A(n){_.value=n?`reconnecting`:`connecting`;let r=`ws://${location.hostname}:3030/ws?role=player&id=${t.value}&code=${encodeURIComponent(S)}`,s=new WebSocket(r);y=s,s.onerror=()=>{n||(m.value=`Connection failed — check the join code and try again`)},s.onopen=()=>{E=0;let e=n?`player_rejoin`:`player_join`;s.send(JSON.stringify({type:e,pseudo:C,email:w})),_.value=`connected`;let t=l_();t&&t.questionIdx===i.value&&v.value&&(s.send(JSON.stringify({type:`submit_answer`,choiceIds:t.choiceIds,answerTimeMs:t.elapsed})),a.value=!0,o.value=t.elapsed,d_())},s.onmessage=e=>{se(JSON.parse(e.data))},s.onclose=()=>{y===s&&(_.value=`reconnecting`,e.value!==`join`&&ne())}}function ae(e,n,r){m.value=``,S=e,C=n,w=r;let i=s_(e);i&&(t.value=i.playerId,n||(C=i.pseudo),r||(w=i.email)),Nd.transport===`supabase`?re(e,C,w):(T=`local`,k(),A(i!==null))}function oe(m){if(h.value=m.quizMeta,s.value=m.totalScore,n.value=m.playerCount,m.phase===`finished`)p.value=m.podium??[],e.value=`podium`,g.value=null;else if(m.phase===`lobby`)e.value=`lobby`,r.value=null,g.value=null;else if(m.question&&(r.value=m.question,i.value=m.questionIdx??m.question.idx),m.phase===`revealed`&&m.reveal){d.value=m.reveal.correct,f.value=m.reveal.explanation;let n=m.reveal.scores.find(e=>e.playerId===t.value);n&&(c.value=n.delta,s.value=n.score);let r=Sd(m.reveal.scores,t.value);l.value=r?.rank??null,u.value=r?.total??0,a.value=!0,g.value=null,e.value=`question`}else{d.value=[],f.value=void 0,g.value=m.deadlineMs??null;let t=l_();t&&t.questionIdx===i.value||a.value&&g.value&&Date.now()>=g.value||(a.value=!1,o.value=0),e.value=`question`}}function se(m){if(m.type===`joined`)e.value=`lobby`,h.value=m.quizMeta,n.value=m.playerCount,_.value=`connected`,c_({playerId:t.value,code:S,pseudo:C,email:w});else if(m.type===`state_snapshot`){if(m.playerId&&m.playerId!==t.value)return;oe(m.snapshot),_.value=`connected`,c_({playerId:t.value,code:S,pseudo:C,email:w})}else switch(m.type){case`player_joined`:m.player.id!==t.value&&n.value++;break;case`player_rejoined`:break;case`player_left`:m.playerId!==t.value&&(n.value=Math.max(0,n.value-1));break;case`question_started`:r.value=m.question,i.value=m.idx,a.value=!1,o.value=0,l.value=null,u.value=0,d.value=[],f.value=void 0,g.value=m.deadlineMs,e.value=`question`,d_();break;case`answer_revealed`:{let e=m.scores.find(e=>e.playerId===t.value);e&&(c.value=e.delta,s.value=e.score);let n=Sd(m.scores,t.value);l.value=n?.rank??null,u.value=n?.total??0,d.value=m.correct,f.value=m.explanation,a.value=!0,g.value=null,d_();break}case`game_ended`:p.value=m.podium,e.value=`podium`,d_();break;case`game_reset`:r.value=null,i.value=0,a.value=!1,o.value=0,s.value=0,c.value=0,l.value=null,u.value=0,d.value=[],f.value=void 0,p.value=[],g.value=null,e.value=`lobby`,d_()}}function ce(e,t){a.value||g.value!==null&&Date.now()>=g.value||(a.value=!0,o.value=t,u_({questionIdx:i.value,choiceIds:e,elapsed:t}),T===`supabase`?ie(e,t):y&&y.readyState===WebSocket.OPEN&&(y.send(JSON.stringify({type:`submit_answer`,choiceIds:e,answerTimeMs:t})),d_()))}return{phase:e,playerId:t,playerCount:n,question:r,questionIdx:i,answered:a,answerTimeMs:o,totalScore:s,lastDelta:c,rank:l,playerTotal:u,correctIds:d,explanation:f,podium:p,connectError:m,quizMeta:h,deadlineMs:g,status:_,canStillAnswer:v,connect:ae,submitAnswer:ce,submitAnswerSupabase:ie}}),m_=new Set([`deck version mismatch`,`unknown deck`]),h_=20,g_=null;function __(e){g_=e}var v_=()=>{},y_=vc(`solo`,()=>{let e=R(`unavailable`),t=an(null),n=an(null),r=R(``),i=R(null),a=R(0),o=R(0),s=R(0),c=R(0),l=R(0),u=R(null),d=R(null),f=R([]),p=R([]),m=R(null),h=R(null),g=R(null),_=R(null),v=R(`idle`),y=R(null),b=null,x=null,S=null,C=0,w=Promise.resolve(),T=K(()=>f.value.filter(e=>e.key!==b?.key)),E=K(()=>({rank:1+T.value.filter(e=>e.score>s.value).length,of:1+T.value.length})),D=K(()=>{let e=p.value.map((e,t)=>({...e,rank:t+1,mine:e.id===h.value})),t=_.value;return t&&g.value!==null&&!e.some(e=>e.mine)&&e.push({...t,rank:g.value,mine:!0}),e});function O(){let t=n.value;i.value=t?.question??null,a.value=t?.index??0,o.value=t?.total??0,s.value=t?.score??0,c.value=t?.correctCount??0,l.value=t?.totalTimeMs??0,u.value=t?.deadlineMs??null,d.value=t?.lastResult??null,t&&(t.status===`question`?e.value=`question`:t.status===`revealed`?e.value=`revealed`:t.status===`finished`&&(e.value=`end`))}let k=()=>({pseudo:r.value,index:a.value,total:o.value,score:s.value});function ee(){n.value=null,h.value=null,g.value=null,_.value=null,v.value=`idle`,y.value=null,O()}function te(){C++,x?.();let e=[w];S&&e.push(Promise.resolve().then(S)),b&&e.push(b.leave()),w=Promise.all(e.map(e=>e.catch(v_))),b=x=S=null,f.value=[],ee()}async function ne(){let e=g_?.backend?.api,n=t.value?.id;if(!e||!n)return;let r=C,[i,a]=await Promise.all([e.fetchTop(n,h_),e.fetchCount(n)]);if(r!==C)return;i.ok&&(p.value=i.value),a.ok&&(m.value=a.value);let o=h.value;if(!i.ok||!o)return;let s=i.value.findIndex(e=>e.id===o);if(s>=0){g.value=s+1;return}let[c,l]=await Promise.all([e.fetchRank(o),_.value?.id===o?null:e.fetchRun(o)]);r===C&&h.value===o&&(c.ok&&(g.value=c.value),l?.ok&&(_.value=l.value))}async function re(n){te(),p.value=[],m.value=null,t.value=null;let r=g_?.backend;if(!g_||!r){e.value=`unavailable`;return}e.value=`loading`;let i=C,a;try{a=await g_.findDeck(n)}catch{a=void 0}i===C&&(!a||!a.quiz.meta.solo?e.value=`unavailable`:(t.value=a,e.value=`intro`,await Promise.all([ie(a.id,i),ne()])))}async function ie(r,i){await w;let a=g_?.backend;if(i===C&&a){try{b=a.live(r)}catch{e.value===`intro`&&(t.value=null,e.value=`unavailable`);return}x=b.onChange(e=>{f.value=e}),b.watch().catch(v_),S=a.api.onNewRun(r,()=>{ne()}),n.value&&n.value.status!==`finished`&&b.join(k()).catch(v_)}}function A(i){let a=i.trim(),o=t.value;if(!o||a.length<1||a.length>24||e.value!==`intro`&&e.value!==`end`)return;ee(),r.value=a;let s=new Md({quiz:o.quiz,deckId:o.id,deckVersion:o.version,pseudo:a,now:ae});s.start(),s.total===0?(t.value=null,e.value=`unavailable`):(n.value=s,O(),b?.join(k()).catch(v_))}let ae=()=>(g_?.now??Date.now)(),oe=()=>u.value!==null&&ae()>=u.value;function se(t){e.value===`question`&&(oe()?ce():(n.value?.answer(t),O(),b?.update(k()).catch(v_)))}function ce(t=[]){e.value===`question`&&(t.length>0?n.value?.answer(t):n.value?.timeout(),O(),b?.update(k()).catch(v_))}function j(){e.value===`revealed`&&(n.value?.next(),O(),n.value?.status===`finished`?M():b?.update(k()).catch(v_))}async function M(){b?.untrack().catch(v_),await le()}async function le(){let e=g_?.backend?.api,r=n.value,i=t.value;if(!e||!r||!i||r.status!==`finished`||v.value===`saving`||v.value===`saved`)return;let a=C;v.value=`saving`;let o=await e.submitRun(r.toSubmission(),i.quiz);a===C&&n.value===r&&(o.ok?(h.value=o.value.runId,g.value=o.value.rank,v.value=`saved`,await ne()):(y.value=o.error,m_.has(o.error)?(v.value=`stale`,g_?.reloadDecks?.()):v.value=`error`))}function ue(){v.value===`error`&&le()}async function de(){if(e.value!==`end`)return;let n=t.value;if(v.value===`stale`&&n){let t=r.value;await re(n.id),e.value===`intro`&&A(t)}else A(r.value)}function fe(){te(),t.value=null,e.value=`unavailable`}async function pe(e,n={}){let r=g_?.backend?.api;return r?r.submitLead(e,t.value?.id??null,n):{ok:!1,error:`unavailable`}}return{phase:e,deck:t,session:n,pseudo:r,question:i,index:a,total:o,score:s,correctCount:c,totalTimeMs:l,deadlineMs:u,lastResult:d,live:f,liveOthers:T,liveRank:E,top:p,runCount:m,myRunId:h,myRank:g,myRun:_,board:D,submitState:v,submitError:y,open:re,start:A,answer:se,timeout:ce,next:j,retrySubmit:ue,playAgain:de,abandon:fe,submitLead:pe}}),b_=`modulepreload`,x_=function(e){return`/`+e},S_={},C_={},w_=function(e){return e.pathname.endsWith(`.css`)},T_=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw delete e[t],n});return e[t]=i,i},E_=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=x_(t,n);let r=s(t),i=w_(r);return T_(S_,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}let t=i?e.styles:e.all,n=i?C_[r.href]:void 0;if(!n&&t.has(r.href))return;let o=document.createElement(`link`);if(o.rel=i?`stylesheet`:b_,i||(o.as=`script`),o.crossOrigin=``,o.href=r.href,a&&o.setAttribute(`nonce`,a),n&&delete C_[r.href],n?.isConnected?n.replaceWith(o):document.head.appendChild(o),i)return new Promise((e,t)=>{let n=i=>{o.removeEventListener(`load`,n),o.removeEventListener(`error`,n),i.type===`error`?(C_[r.href]=o,t(Error(`Unable to preload CSS for ${r}`))):e(i)};o.addEventListener(`load`,n),o.addEventListener(`error`,n)})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},D_=null;function O_(){return D_??=E_(async()=>{let{defaultSoloDeps:e}=await import(`./deps-BokiFfKQ.js`);return{defaultSoloDeps:e}},__vite__mapDeps([0,1,2,3])).then(({defaultSoloDeps:e})=>__(e())),D_}var k_=`#/solo/`;function A_(e){if(!e.startsWith(k_))return null;let t=e.slice(7);if(!t)return null;try{let e=decodeURIComponent(t);return e?{deckId:e}:null}catch{return null}}function j_(e){return k_+encodeURIComponent(e)}var M_={class:`join`},N_={class:`join__form`},P_={key:0,class:`join__error`},F_=[`disabled`],I_=sl(br({__name:`JoinView`,setup(e){let t=kr(()=>E_(()=>import(`./SoloCatalog-N7vmcKBX.js`),__vite__mapDeps([4,3,2,5,1,6,7,8]))),n=kd(Nd),r=p_(),i=R(``),a=R(``),o=R(``);zr(()=>{let e=new URLSearchParams(location.search).get(`code`);e&&(i.value=e.toUpperCase());try{let e=sessionStorage.getItem(`hashquiz:player-session`);if(e&&i.value){let t=JSON.parse(e);t.code===i.value&&(a.value=t.pseudo,o.value=t.email,r.connect(i.value,t.pseudo,t.email))}}catch{}});function s(){r.connect(i.value.trim().toUpperCase(),a.value.trim(),o.value.trim())}return(e,c)=>(V(),H(`div`,M_,[c[3]||=U(`p`,{class:`join__sub`},`Enter the game code to join`,-1),U(`div`,N_,[Kn(U(`input`,{"onUpdate:modelValue":c[0]||=e=>i.value=e,class:`hq-input`,placeholder:`Game code (e.g. ABC123)`,style:{"text-transform":`uppercase`,"letter-spacing":`0.12em`},maxlength:`8`},null,512),[[cs,i.value]]),Kn(U(`input`,{"onUpdate:modelValue":c[1]||=e=>a.value=e,class:`hq-input`,placeholder:`Your name`,maxlength:`20`},null,512),[[cs,a.value]]),Kn(U(`input`,{"onUpdate:modelValue":c[2]||=e=>o.value=e,class:`hq-input`,type:`email`,placeholder:`Email (optional)`},null,512),[[cs,o.value]]),z(r).connectError?(V(),H(`p`,P_,P(z(r).connectError),1)):G(``,!0),U(`button`,{class:`hq-btn-primary hq-press`,disabled:!i.value.trim()||!a.value.trim(),onClick:s},` Join Game `,8,F_)]),z(n)?(V(),va(z(t),{key:0})):G(``,!0)]))}}),[[`__scopeId`,`data-v-256fc64a`]]),L_={class:`lobby`},R_={class:`lobby__wait`},z_=sl(br({__name:`LobbyView`,setup(e){let t=p_(),n=K(()=>Array.from({length:Math.max(t.playerCount,1)},(e,t)=>({id:`p`+t})));return(e,r)=>(V(),H(`div`,L_,[z(t).quizMeta?(V(),va(z(yd),{key:0,quizInfo:z(t).quizMeta,playerCount:z(t).playerCount,compact:``},null,8,[`quizInfo`,`playerCount`])):G(``,!0),U(`div`,R_,[W(z(Cl),{class:`lobby__icon`}),r[0]||=U(`h2`,null,`Waiting for the host…`,-1)]),W(z(Bl),{class:`lobby__fx`,players:n.value,highlightId:`p0`},null,8,[`players`])]))}}),[[`__scopeId`,`data-v-146e398c`]]),B_={key:0,class:`question-view`},V_={class:`hq-progress`},H_={class:`hq-progress__label hq-label`},U_={class:`hq-progress__track hq-steps`},W_={class:`hq-progress__label`},G_={key:0,class:`hq-timer-wrap`},K_={class:`hq-sr-only`},q_={class:`hq-result__line`},J_={class:`hq-result__score`},Y_={key:0,class:`hq-result__rank hq-label`},X_={class:`hq-result__delta`},Z_={key:0,class:`hq-result__info`},Q_={key:1,class:`hq-result__info`},$_={class:`hq-q-meta`},e1={class:`hq-q-meta__tags`},t1={class:`hq-q-text`},n1={class:`hq-grid`},r1=[`disabled`],i1=sl(br({__name:`QuestionView`,setup(e){let t=p_(),n=R(t.question?.timer??0),r=R(new Set),i=R(!1),a=R(0),o=null,s=0,c=0,l=K(()=>t.question?.oneShoot??!0),u=K(()=>t.question?.type===`multiple`),d=K(()=>t.correctIds.length>0),f=K(()=>t.lastDelta>0),p=R(0),m=0;$n(d,e=>{if(cancelAnimationFrame(m),!e){p.value=0;return}let n=t.lastDelta;if(typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches||n<=0){p.value=n;return}let r=performance.now(),i=e=>{let t=Math.min((e-r)/600,1);p.value=Math.round(n*(1-(1-t)**3)),t<1&&(m=requestAnimationFrame(i))};m=requestAnimationFrame(i)},{immediate:!0});function h(){o&&clearInterval(o),o=setInterval(()=>{let e=Math.min(s,Math.max(0,Math.round((c-Date.now())/100)/10));n.value=e,e<=0&&(clearInterval(o),o=null,i.value=!0,r.value.size>0&&!t.answered&&t.submitAnswer([...r.value],a.value))},100)}$n(()=>t.question?.idx,()=>{r.value=new Set,i.value=!1,a.value=0},{immediate:!0}),$n(()=>[t.question?.idx,t.deadlineMs],([,e])=>{let r=t.question;r&&(s=r.timer,e==null?o&&=(clearInterval(o),null):(c=e,n.value=Math.min(s,Math.max(0,Math.round((c-Date.now())/100)/10)),n.value<=0?(i.value=!0,o&&=(clearInterval(o),null)):h()))},{immediate:!0}),zr(()=>{t.question&&c>Date.now()&&!o&&h()}),Ur(()=>{o&&clearInterval(o),cancelAnimationFrame(m)});function g(e){if(d.value){let n=t.correctIds.includes(e),i=r.value.has(e);return n?`correct`:i?`wrong`:`disabled`}return i.value||t.answered?r.value.has(e)?`selected`:`disabled`:r.value.has(e)?`selected`:`idle`}function _(e){if(i.value||t.answered||d.value)return;if(!l.value){a.value=(t.question.timer-n.value)*1e3;let i=new Set(r.value);i.has(e)?i.delete(e):i.add(e),r.value=i;return}if(!u.value){if(r.value.size>0)return;let i=(t.question.timer-n.value)*1e3;r.value=new Set([e]),t.submitAnswer([e],i);return}a.value=(t.question.timer-n.value)*1e3;let o=new Set(r.value);o.has(e)?o.delete(e):o.add(e),r.value=o}function v(){i.value||t.answered||r.value.size===0||t.submitAnswer([...r.value],a.value)}return(e,a)=>z(t).question?(V(),H(`div`,B_,[U(`div`,V_,[U(`span`,H_,`Q`+P(z(t).questionIdx+1),1),U(`div`,U_,[U(`div`,{class:`hq-progress__fill`,style:ve({width:(z(t).questionIdx+1)/(z(t).quizMeta?.totalQuestions??1)*100+`%`})},null,4)]),U(`span`,W_,P(z(t).quizMeta?.totalQuestions??`?`),1)]),d.value?(V(),H(`div`,{key:1,role:`status`,class:N([`hq-result`,f.value?`hq-result--correct`:`hq-result--wrong`])},[W(z(vu),{class:`hq-result__fx`,correct:f.value,delta:z(t).lastDelta,answered:z(t).answered},null,8,[`correct`,`delta`,`answered`]),U(`span`,K_,P(f.value?`Correct`:`Wrong`),1),U(`div`,q_,[U(`span`,J_,[Ea(P(z(t).totalScore)+` `,1),a[0]||=U(`small`,null,`pts`,-1)]),z(t).rank===null?G(``,!0):(V(),H(`span`,Y_,P(z(Vl)(z(t).rank))+` / `+P(z(t).playerTotal),1))]),U(`span`,X_,P(p.value>0?`+`+p.value:`+0`)+` pts`,1),z(t).answered?(V(),H(`span`,Z_,`Answered in `+P(Math.round(z(t).answerTimeMs/1e3))+`s / `+P(z(t).question.timer)+`s`,1)):(V(),H(`span`,Q_,`No answer submitted`))],2)):(V(),H(`div`,G_,[W(z(cl),{total:z(t).question.timer,remaining:n.value,size:`compact`},null,8,[`total`,`remaining`])])),U(`div`,$_,[U(`div`,e1,[(V(!0),H(B,null,Yr(z(t).question.tags,e=>(V(),H(`span`,{key:e,class:`hq-q-meta__tag`},P(e),1))),128))]),U(`span`,{class:N([`hq-difficulty`,`hq-difficulty--${z(t).question.difficulty}`])},[...a[1]||=[U(`span`,{class:`hq-difficulty__dot hq-difficulty__dot--1`},null,-1),U(`span`,{class:`hq-difficulty__dot hq-difficulty__dot--2`},null,-1),U(`span`,{class:`hq-difficulty__dot hq-difficulty__dot--3`},null,-1)]],2)]),U(`h2`,t1,P(z(t).question.text.replace(/^#+\s/,``)),1),U(`div`,n1,[(V(!0),H(B,null,Yr(z(t).question.choices,(e,t)=>(V(),va(z(Su),{key:e.id,id:e.id,text:e.text,"color-id":[`a`,`b`,`c`,`d`][t],state:g(e.id),onSelect:t=>_(e.id)},null,8,[`id`,`text`,`color-id`,`state`,`onSelect`]))),128))]),l.value&&u.value&&!z(t).answered&&!i.value?(V(),H(`button`,{key:2,class:`hq-validate-btn hq-press`,disabled:r.value.size===0,onClick:v},` Valider → `,8,r1)):G(``,!0)])):G(``,!0)}}),[[`__scopeId`,`data-v-7a64ad92`]]),a1={class:`podium-view`},o1={class:`podium-view__rank`},s1={class:`podium-view__medal`},c1={class:`podium-view__name`},l1={class:`podium-view__score`},u1={class:`podium-view__fx`},d1=sl(br({__name:`PodiumView`,setup(e){let t=p_(),n=K(()=>t.podium.find(e=>e.playerId===t.playerId)),r=K(()=>{let e=n.value?.rank??99;return e===1?`🥇`:e===2?`🥈`:e===3?`🥉`:`#${e}`});return(e,i)=>(V(),H(`div`,a1,[U(`div`,o1,[U(`p`,s1,P(r.value),1),U(`p`,c1,P(n.value?.pseudo??``),1),U(`p`,l1,P(z(t).totalScore.toLocaleString())+` pts`,1)]),U(`div`,u1,[W(z(ru),{podium:z(t).podium,"highlight-id":z(t).playerId},null,8,[`podium`,`highlight-id`])]),W(z(Du),{podium:z(t).podium},null,8,[`podium`])]))}}),[[`__scopeId`,`data-v-608e2d6a`]]),f1={class:`app`};xs(br({__name:`App`,setup(e){let t=kr(()=>E_(()=>import(`./SoloIntroView-D1lYB8yi.js`),__vite__mapDeps([9,3,10,11,12,13,7]))),n=kr(()=>E_(()=>import(`./SoloQuestionView-BhuykIzF.js`),__vite__mapDeps([14,11,15,7]))),r=kr(()=>E_(()=>import(`./SoloEndView-1nOIZgLK.js`),__vite__mapDeps([16,11,10,12,5,1,6,7,17]))),i=p_(),a=y_(),o=R(null),s=R(!1);async function c(e=!1){let t=A_(location.hash)?.deckId??null;if(t===o.value&&!e||(o.value!==null&&a.abandon(),o.value=t,s.value=!1,t===null)||(await O_(),o.value!==t))return;let n=a.open(t);s.value=!0,await n}function l(){o.value!==null&&(a.abandon(),s.value=!1)}function u(e){e.persisted&&c(!0)}let d=()=>{c()};zr(()=>{c(),window.addEventListener(`hashchange`,d),window.addEventListener(`pagehide`,l),window.addEventListener(`pageshow`,u)}),Ur(()=>{window.removeEventListener(`hashchange`,d),window.removeEventListener(`pagehide`,l),window.removeEventListener(`pageshow`,u)});let f=K(()=>{switch(i.status){case`connecting`:return`Connexion…`;case`reconnecting`:return`Reconnexion…`;case`offline`:return`Hors ligne`;default:return``}});return(e,c)=>(V(),H(B,null,[W(z(fl)),W(z(ll)),U(`div`,f1,[o.value===null?(V(),H(B,{key:1},[W(po,{name:`status`},{default:Gn(()=>[z(i).phase!==`join`&&z(i).status!==`connected`?(V(),H(`p`,{key:0,class:N([`status-banner`,`status-banner--${z(i).status}`])},P(f.value),3)):G(``,!0)]),_:1}),z(i).phase===`join`?(V(),va(I_,{key:0})):z(i).phase===`lobby`?(V(),va(z_,{key:1})):z(i).phase===`question`?(V(),va(i1,{key:2})):z(i).phase===`podium`?(V(),va(d1,{key:3})):G(``,!0)],64)):(V(),H(B,{key:0},[z(a).phase===`question`||z(a).phase===`revealed`?(V(),va(z(n),{key:0})):z(a).phase===`end`?(V(),va(z(r),{key:1})):s.value?(V(),va(z(t),{key:o.value})):G(``,!0)],64))])],64))}})).use(ic()).mount(`#app`);export{V as A,s as B,H as C,Nn as D,br as E,an as F,z as I,N as L,$n as M,Kn as N,zr as O,R as P,ve as R,G as S,W as T,l as V,_s as _,Nd as a,U as b,Su as c,sl as d,zs as f,cs as g,ds as h,n_ as i,Yr as j,Ur as k,vu as l,ls as m,O_ as n,xd as o,Bs as p,y_ as r,yd as s,j_ as t,cl as u,B as v,Ea as w,va as x,K as y,P as z};
|
|
32
|
+
`);let e=await s.signMessage(new TextEncoder().encode(t),`utf8`);if(!e||!(e instanceof Uint8Array))throw Error(`@supabase/auth-js: Wallet signMessage() API returned an recognized value`);n=e}}try{let{data:r,error:i}=await Z(this.fetch,`POST`,`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:`solana`,message:t,signature:th(n)},e.options?.captchaToken?{gotrue_meta_security:{captcha_token:e.options?.captchaToken}}:null),xform:Lh});if(i)throw i;if(!r||!r.session||!r.user){let e=new Pm;return this._returnResult({data:{user:null,session:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers(`SIGNED_IN`,r.session)),this._returnResult({data:Object.assign({},r),error:i})}catch(e){if(X(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _exchangeCodeForSession(e){let[t,n]=(await dh(this.storage,`${this.storageKey}-code-verifier`)??``).split(`/`);try{if(!t&&this.flowType===`pkce`)throw new zm;let{data:r,error:i}=await Z(this.fetch,`POST`,`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:t},xform:Lh});if(await fh(this.storage,`${this.storageKey}-code-verifier`),i)throw i;if(!r||!r.session||!r.user){let e=new Pm;return this._returnResult({data:{user:null,session:null,redirectType:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers(n===`recovery`?`PASSWORD_RECOVERY`:`SIGNED_IN`,r.session)),this._returnResult({data:Object.assign(Object.assign({},r),{redirectType:n??null}),error:i})}catch(e){if(await fh(this.storage,`${this.storageKey}-code-verifier`),X(e))return this._returnResult({data:{user:null,session:null,redirectType:null},error:e});throw e}}async signInWithIdToken(e){try{let{options:t,provider:n,token:r,access_token:i,nonce:a}=e,{data:o,error:s}=await Z(this.fetch,`POST`,`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:r,access_token:i,nonce:a,gotrue_meta_security:{captcha_token:t?.captchaToken}},xform:Lh});if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!o||!o.session||!o.user){let e=new Pm;return this._returnResult({data:{user:null,session:null},error:e})}return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers(`SIGNED_IN`,o.session)),this._returnResult({data:o,error:s})}catch(e){if(X(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOtp(e){try{if(`email`in e){let{email:t,options:n}=e,r=null,i=null;this.flowType===`pkce`&&([r,i]=await xh(this.storage,this.storageKey));let{error:a}=await Z(this.fetch,`POST`,`${this.url}/otp`,{headers:this.headers,body:{email:t,data:n?.data??{},create_user:n?.shouldCreateUser??!0,gotrue_meta_security:{captcha_token:n?.captchaToken},code_challenge:r,code_challenge_method:i},redirectTo:n?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:a})}if(`phone`in e){let{phone:t,options:n}=e,{data:r,error:i}=await Z(this.fetch,`POST`,`${this.url}/otp`,{headers:this.headers,body:{phone:t,data:n?.data??{},create_user:n?.shouldCreateUser??!0,gotrue_meta_security:{captcha_token:n?.captchaToken},channel:n?.channel??`sms`}});return this._returnResult({data:{user:null,session:null,messageId:r?.message_id},error:i})}throw new Fm(`You must provide either an email or phone number.`)}catch(e){if(await fh(this.storage,`${this.storageKey}-code-verifier`),X(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async verifyOtp(e){try{let t,n;`options`in e&&(t=e.options?.redirectTo,n=e.options?.captchaToken);let{data:r,error:i}=await Z(this.fetch,`POST`,`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:n}}),redirectTo:t,xform:Lh});if(i)throw i;if(!r)throw Error(`An error occurred on token verification.`);let a=r.session,o=r.user;return a?.access_token&&(await this._saveSession(a),await this._notifyAllSubscribers(e.type==`recovery`?`PASSWORD_RECOVERY`:`SIGNED_IN`,a)),this._returnResult({data:{user:o,session:a},error:null})}catch(e){if(X(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSSO(e){try{let t=null,n=null;this.flowType===`pkce`&&([t,n]=await xh(this.storage,this.storageKey));let r=await Z(this.fetch,`POST`,`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},`providerId`in e?{provider_id:e.providerId}:null),`domain`in e?{domain:e.domain}:null),{redirect_to:e.options?.redirectTo??void 0}),e?.options?.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:t,code_challenge_method:n}),headers:this.headers,xform:Bh});return r.data?.url&&ih()&&!e.options?.skipBrowserRedirect&&window.location.assign(r.data.url),this._returnResult(r)}catch(e){if(await fh(this.storage,`${this.storageKey}-code-verifier`),X(e))return this._returnResult({data:null,error:e});throw e}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;if(n)throw n;if(!t)throw new Mm;let{error:r}=await Z(this.fetch,`GET`,`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return this._returnResult({data:{user:null,session:null},error:r})})}catch(e){if(X(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{let t=`${this.url}/resend`;if(`email`in e){let{email:n,type:r,options:i}=e,{error:a}=await Z(this.fetch,`POST`,t,{headers:this.headers,body:{email:n,type:r,gotrue_meta_security:{captcha_token:i?.captchaToken}},redirectTo:i?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:a})}if(`phone`in e){let{phone:n,type:r,options:i}=e,{data:a,error:o}=await Z(this.fetch,`POST`,t,{headers:this.headers,body:{phone:n,type:r,gotrue_meta_security:{captcha_token:i?.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:a?.message_id},error:o})}throw new Fm(`You must provide either an email or phone number and a type`)}catch(e){if(X(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async e=>e))}async _acquireLock(e,t){this._debug(`#_acquireLock`,`begin`,e);try{if(this.lockAcquired){let e=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),n=(async()=>(await e,await t()))();return this.pendingInLock.push((async()=>{try{await n}catch{}})()),n}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug(`#_acquireLock`,`lock acquired for storage key`,this.storageKey);try{this.lockAcquired=!0;let e=t();for(this.pendingInLock.push((async()=>{try{await e}catch{}})()),await e;this.pendingInLock.length;){let e=[...this.pendingInLock];await Promise.all(e),this.pendingInLock.splice(0,e.length)}return await e}finally{this._debug(`#_acquireLock`,`lock released for storage key`,this.storageKey),this.lockAcquired=!1}})}finally{this._debug(`#_acquireLock`,`end`)}}async _useSession(e){this._debug(`#_useSession`,`begin`);try{return await e(await this.__loadSession())}finally{this._debug(`#_useSession`,`end`)}}async __loadSession(){this._debug(`#__loadSession()`,`begin`),this.lockAcquired||this._debug(`#__loadSession()`,`used outside of an acquired lock!`,Error().stack);try{let e=null,t=await dh(this.storage,this.storageKey);if(this._debug(`#getSession()`,`session from storage`,t),t!==null&&(this._isValidSession(t)?e=t:(this._debug(`#getSession()`,`session from storage is not valid`),await this._removeSession())),!e)return{data:{session:null},error:null};let n=e.expires_at?e.expires_at*1e3-Date.now()<bm:!1;if(this._debug(`#__loadSession()`,`session has${n?``:` not`} expired`,`expires_at`,e.expires_at),!n){if(this.userStorage){let t=await dh(this.userStorage,this.storageKey+`-user`);t?.user?e.user=t.user:e.user=kh()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){let t={value:this.suppressGetSessionWarning};e.user=Ah(e.user,t),t.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}let{data:r,error:i}=await this._callRefreshToken(e.refresh_token);return i?this._returnResult({data:{session:null},error:i}):this._returnResult({data:{session:r},error:null})}finally{this._debug(`#__loadSession()`,`end`)}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;let t=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return t.data.user&&(this.suppressGetSessionWarning=!0),t}async _getUser(e){try{return e?await Z(this.fetch,`GET`,`${this.url}/user`,{headers:this.headers,jwt:e,xform:zh}):await this._useSession(async e=>{let{data:t,error:n}=e;if(n)throw n;return!t.session?.access_token&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Mm}:await Z(this.fetch,`GET`,`${this.url}/user`,{headers:this.headers,jwt:t.session?.access_token??void 0,xform:zh})})}catch(e){if(X(e))return Nm(e)&&(await this._removeSession(),await fh(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:e});throw e}}async updateUser(e,t={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,t))}async _updateUser(e,t={}){try{return await this._useSession(async n=>{let{data:r,error:i}=n;if(i)throw i;if(!r.session)throw new Mm;let a=r.session,o=null,s=null;this.flowType===`pkce`&&e.email!=null&&([o,s]=await xh(this.storage,this.storageKey));let{data:c,error:l}=await Z(this.fetch,`PUT`,`${this.url}/user`,{headers:this.headers,redirectTo:t?.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:o,code_challenge_method:s}),jwt:a.access_token,xform:zh});if(l)throw l;return a.user=c.user,await this._saveSession(a),await this._notifyAllSubscribers(`USER_UPDATED`,a),this._returnResult({data:{user:a.user},error:null})})}catch(e){if(await fh(this.storage,`${this.storageKey}-code-verifier`),X(e))return this._returnResult({data:{user:null},error:e});throw e}}async setSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new Mm;let t=Date.now()/1e3,n=t,r=!0,i=null,{payload:a}=mh(e.access_token);if(a.exp&&(n=a.exp,r=n<=t),r){let{data:t,error:n}=await this._callRefreshToken(e.refresh_token);if(n)return this._returnResult({data:{user:null,session:null},error:n});if(!t)return{data:{user:null,session:null},error:null};i=t}else{let{data:r,error:a}=await this._getUser(e.access_token);if(a)return this._returnResult({data:{user:null,session:null},error:a});i={access_token:e.access_token,refresh_token:e.refresh_token,user:r.user,token_type:`bearer`,expires_in:n-t,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(e){if(X(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async t=>{if(!e){let{data:n,error:r}=t;if(r)throw r;e=n.session??void 0}if(!e?.refresh_token)throw new Mm;let{data:n,error:r}=await this._callRefreshToken(e.refresh_token);return r?this._returnResult({data:{user:null,session:null},error:r}):n?this._returnResult({data:{user:n.user,session:n},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(e){if(X(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _getSessionFromURL(e,t){try{if(!ih())throw new Im(`No browser detected.`);if(e.error||e.error_description||e.error_code)throw new Im(e.error_description||`Error in URL with unspecified error_description`,{error:e.error||`unspecified_error`,code:e.error_code||`unspecified_code`});switch(t){case`implicit`:if(this.flowType===`pkce`)throw new Rm(`Not a valid PKCE flow url.`);break;case`pkce`:if(this.flowType===`implicit`)throw new Im(`Not a valid implicit grant flow url.`)}if(t===`pkce`){if(this._debug(`#_initialize()`,`begin`,`is PKCE flow`,!0),!e.code)throw new Rm(`No code detected.`);let{data:t,error:n}=await this._exchangeCodeForSession(e.code);if(n)throw n;let r=new URL(window.location.href);return r.searchParams.delete(`code`),window.history.replaceState(window.history.state,``,r.toString()),{data:{session:t.session,redirectType:t.redirectType??null},error:null}}let{provider_token:n,provider_refresh_token:r,access_token:i,refresh_token:a,expires_in:o,expires_at:s,token_type:c}=e;if(!i||!o||!a||!c)throw new Im(`No session defined in URL`);let l=Math.round(Date.now()/1e3),u=parseInt(o),d=l+u;s&&(d=parseInt(s));let f=d-l;f*1e3<=3e4&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${f}s, should have been closer to ${u}s`);let p=d-u;l-p>=120?console.warn(`@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale`,p,d,l):l-p<0&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew`,p,d,l);let{data:m,error:h}=await this._getUser(i);if(h)throw h;let g={provider_token:n,provider_refresh_token:r,access_token:i,expires_in:u,expires_at:d,refresh_token:a,token_type:c,user:m.user};return window.location.hash=``,this._debug(`#_getSessionFromURL()`,`clearing window.location.hash`),this._returnResult({data:{session:g,redirectType:e.type},error:null})}catch(e){if(X(e))return this._returnResult({data:{session:null,redirectType:null},error:e});throw e}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl==`function`?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error_description)}async _isPKCECallback(e){let t=await dh(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&t)}async signOut(e={scope:`global`}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:`global`}){return await this._useSession(async t=>{let{data:n,error:r}=t;if(r&&!Nm(r))return this._returnResult({error:r});let i=n.session?.access_token;if(i){let{error:t}=await this.admin.signOut(i,e);if(t&&!(km(t)&&(t.status===404||t.status===401||t.status===403)||Nm(t)))return this._returnResult({error:t})}return e!==`others`&&(await this._removeSession(),await fh(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){let t=rh(),n={id:t,callback:e,unsubscribe:()=>{this._debug(`#unsubscribe()`,`state change callback with id removed`,t),this.stateChangeEmitters.delete(t)}};return this._debug(`#onAuthStateChange()`,`registered callback with id`,t),this.stateChangeEmitters.set(t,n),(async()=>{await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(t)})})(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async t=>{try{let{data:{session:n},error:r}=t;if(r)throw r;await this.stateChangeEmitters.get(e)?.callback(`INITIAL_SESSION`,n),this._debug(`INITIAL_SESSION`,`callback id`,e,`session`,n)}catch(t){await this.stateChangeEmitters.get(e)?.callback(`INITIAL_SESSION`,null),this._debug(`INITIAL_SESSION`,`callback id`,e,`error`,t),Nm(t)?console.warn(t):console.error(t)}})}async resetPasswordForEmail(e,t={}){let n=null,r=null;this.flowType===`pkce`&&([n,r]=await xh(this.storage,this.storageKey,!0));try{return await Z(this.fetch,`POST`,`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:r,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(e){if(await fh(this.storage,`${this.storageKey}-code-verifier`),X(e))return this._returnResult({data:null,error:e});throw e}}async getUserIdentities(){try{let{data:e,error:t}=await this.getUser();if(t)throw t;return this._returnResult({data:{identities:e.user.identities??[]},error:null})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async linkIdentity(e){return`token`in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){try{let{data:t,error:n}=await this._useSession(async t=>{let{data:n,error:r}=t;if(r)throw r;let i=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:e.options?.redirectTo,scopes:e.options?.scopes,queryParams:e.options?.queryParams,skipBrowserRedirect:!0});return await Z(this.fetch,`GET`,i,{headers:this.headers,jwt:n.session?.access_token??void 0})});if(n)throw n;return ih()&&!e.options?.skipBrowserRedirect&&window.location.assign(t?.url),this._returnResult({data:{provider:e.provider,url:t?.url},error:null})}catch(t){if(X(t))return this._returnResult({data:{provider:e.provider,url:null},error:t});throw t}}async linkIdentityIdToken(e){return await this._useSession(async t=>{try{let{error:n,data:{session:r}}=t;if(n)throw n;let{options:i,provider:a,token:o,access_token:s,nonce:c}=e,{data:l,error:u}=await Z(this.fetch,`POST`,`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:r?.access_token??void 0,body:{provider:a,id_token:o,access_token:s,nonce:c,link_identity:!0,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:Lh});return u?this._returnResult({data:{user:null,session:null},error:u}):!l||!l.session||!l.user?this._returnResult({data:{user:null,session:null},error:new Pm}):(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers(`USER_UPDATED`,l.session)),this._returnResult({data:l,error:u}))}catch(e){if(await fh(this.storage,`${this.storageKey}-code-verifier`),X(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}})}async unlinkIdentity(e){try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)throw r;return await Z(this.fetch,`DELETE`,`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:n.session?.access_token??void 0})})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async _refreshAccessToken(e){let t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,`begin`);try{let n=Date.now();return await gh(async n=>(n>0&&await hh(200*2**(n-1)),this._debug(t,`refreshing attempt`,n),await Z(this.fetch,`POST`,`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:Lh})),(e,t)=>{let r=200*2**e;return t&&Vm(t)&&Date.now()+r-n<3e4})}catch(e){if(this._debug(t,`error`,e),X(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}finally{this._debug(t,`end`)}}_isValidSession(e){return typeof e==`object`&&!!e&&`access_token`in e&&`refresh_token`in e&&`expires_at`in e}async _handleProviderSignIn(e,t){let n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug(`#_handleProviderSignIn()`,`provider`,e,`options`,t,`url`,n),ih()&&!t.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){let e=`#_recoverAndRefresh()`;this._debug(e,`begin`);try{let t=await dh(this.storage,this.storageKey);if(t&&this.userStorage){let e=await dh(this.userStorage,this.storageKey+`-user`);!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!e&&(e={user:t.user},await uh(this.userStorage,this.storageKey+`-user`,e)),t.user=e?.user??kh()}else if(t&&!t.user&&!t.user){let e=await dh(this.storage,this.storageKey+`-user`);e&&e?.user?(t.user=e.user,await fh(this.storage,this.storageKey+`-user`),await uh(this.storage,this.storageKey,t)):t.user=kh()}if(this._debug(e,`session from storage`,t),!this._isValidSession(t)){this._debug(e,`session is not valid`),t!==null&&await this._removeSession();return}let n=(t.expires_at??1/0)*1e3-Date.now()<bm;if(this._debug(e,`session has${n?``:` not`} expired with margin of ${bm}s`),n){if(this.autoRefreshToken&&t.refresh_token){let{error:n}=await this._callRefreshToken(t.refresh_token);n&&(console.error(n),Vm(n)||(this._debug(e,`refresh failed with a non-retryable error, removing the session`,n),await this._removeSession()))}}else if(t.user&&t.user.__isUserNotAvailableProxy===!0)try{let{data:n,error:r}=await this._getUser(t.access_token);!r&&n?.user?(t.user=n.user,await this._saveSession(t),await this._notifyAllSubscribers(`SIGNED_IN`,t)):this._debug(e,`could not get user data, skipping SIGNED_IN notification`)}catch(t){console.error(`Error getting user data:`,t),this._debug(e,`error getting user data, skipping SIGNED_IN notification`,t)}else await this._notifyAllSubscribers(`SIGNED_IN`,t)}catch(t){this._debug(e,`error`,t),console.error(t);return}finally{this._debug(e,`end`)}}async _callRefreshToken(e){var t,n;if(!e)throw new Mm;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let r=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(r,`begin`);try{this.refreshingDeferred=new ph;let{data:t,error:n}=await this._refreshAccessToken(e);if(n)throw n;if(!t.session)throw new Mm;await this._saveSession(t.session),await this._notifyAllSubscribers(`TOKEN_REFRESHED`,t.session);let r={data:t.session,error:null};return this.refreshingDeferred.resolve(r),r}catch(e){if(this._debug(r,`error`,e),X(e)){let n={data:null,error:e};return Vm(e)||await this._removeSession(),(t=this.refreshingDeferred)==null||t.resolve(n),n}throw(n=this.refreshingDeferred)==null||n.reject(e),e}finally{this.refreshingDeferred=null,this._debug(r,`end`)}}async _notifyAllSubscribers(e,t,n=!0){let r=`#_notifyAllSubscribers(${e})`;this._debug(r,`begin`,t,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:t});let r=[],i=Array.from(this.stateChangeEmitters.values()).map(async n=>{try{await n.callback(e,t)}catch(e){r.push(e)}});if(await Promise.all(i),r.length>0){for(let e=0;e<r.length;e+=1)console.error(r[e]);throw r[0]}}finally{this._debug(r,`end`)}}async _saveSession(e){this._debug(`#_saveSession()`,e),this.suppressGetSessionWarning=!0,await fh(this.storage,`${this.storageKey}-code-verifier`);let t=Object.assign({},e),n=t.user&&t.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&t.user&&await uh(this.userStorage,this.storageKey+`-user`,{user:t.user});let e=Object.assign({},t);delete e.user;let r=jh(e);await uh(this.storage,this.storageKey,r)}else{let e=jh(t);await uh(this.storage,this.storageKey,e)}}async _removeSession(){this._debug(`#_removeSession()`),this.suppressGetSessionWarning=!1,await fh(this.storage,this.storageKey),await fh(this.storage,this.storageKey+`-code-verifier`),await fh(this.storage,this.storageKey+`-user`),this.userStorage&&await fh(this.userStorage,this.storageKey+`-user`),await this._notifyAllSubscribers(`SIGNED_OUT`,null)}_removeVisibilityChangedCallback(){this._debug(`#_removeVisibilityChangedCallback()`);let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&ih()&&window!=null&&window.removeEventListener&&window.removeEventListener(`visibilitychange`,e)}catch(e){console.error(`removing visibilitychange callback failed`,e)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug(`#_startAutoRefresh()`);let e=setInterval(()=>this._autoRefreshTokenTick(),ym);this.autoRefreshTicker=e,e&&typeof e==`object`&&typeof e.unref==`function`?e.unref():typeof Deno<`u`&&typeof Deno.unrefTimer==`function`&&Deno.unrefTimer(e);let t=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=t,t&&typeof t==`object`&&typeof t.unref==`function`?t.unref():typeof Deno<`u`&&typeof Deno.unrefTimer==`function`&&Deno.unrefTimer(t)}async _stopAutoRefresh(){this._debug(`#_stopAutoRefresh()`);let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);let t=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,t&&clearTimeout(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{let e=Date.now();try{return await this._useSession(async t=>{let{data:{session:n}}=t;if(!n||!n.refresh_token||!n.expires_at){this._debug(`#_autoRefreshTokenTick()`,`no session`);return}let r=Math.floor((n.expires_at*1e3-e)/ym);this._debug(`#_autoRefreshTokenTick()`,`access token expires in ${r} ticks, a tick lasts ${ym}ms, refresh threshold is 3 ticks`),r<=3&&await this._callRefreshToken(n.refresh_token)})}catch(e){console.error(`Auto refresh tick failed with error. This is likely a transient error.`,e)}}finally{this._debug(`#_autoRefreshTokenTick()`,`end`)}})}catch(e){if(e instanceof Jh)this._debug(`auto refresh token tick lock not available`);else throw e}}async _handleVisibilityChange(){if(this._debug(`#_handleVisibilityChange()`),!ih()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug(`#visibilityChangedCallback`,`error`,e)}},window==null||window.addEventListener(`visibilitychange`,this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error(`_handleVisibilityChange`,e)}}async _onVisibilityChanged(e){let t=`#_onVisibilityChanged(${e})`;this._debug(t,`visibilityState`,document.visibilityState),document.visibilityState===`visible`?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{document.visibilityState===`visible`?await this._recoverAndRefresh():this._debug(t,`acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting`)}))):document.visibilityState===`hidden`&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,n){let r=[`provider=${encodeURIComponent(t)}`];if(n?.redirectTo&&r.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n?.scopes&&r.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType===`pkce`){let[e,t]=await xh(this.storage,this.storageKey),n=new URLSearchParams({code_challenge:`${encodeURIComponent(e)}`,code_challenge_method:`${encodeURIComponent(t)}`});r.push(n.toString())}if(n?.queryParams){let e=new URLSearchParams(n.queryParams);r.push(e.toString())}return n?.skipBrowserRedirect&&r.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${r.join(`&`)}`}async _unenroll(e){try{return await this._useSession(async t=>{let{data:n,error:r}=t;return r?this._returnResult({data:null,error:r}):await Z(this.fetch,`DELETE`,`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:n?.session?.access_token})})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async _enroll(e){try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)return this._returnResult({data:null,error:r});let i=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType===`phone`?{phone:e.phone}:e.factorType===`totp`?{issuer:e.issuer}:{}),{data:a,error:o}=await Z(this.fetch,`POST`,`${this.url}/factors`,{body:i,headers:this.headers,jwt:n?.session?.access_token});return o?this._returnResult({data:null,error:o}):(e.factorType===`totp`&&a.type===`totp`&&a?.totp?.qr_code&&(a.totp.qr_code=`data:image/svg+xml;utf-8,${a.totp.qr_code}`),this._returnResult({data:a,error:null}))})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async _verify(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)return this._returnResult({data:null,error:r});let i=Object.assign({challenge_id:e.challengeId},`webauthn`in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type===`create`?cg(e.webauthn.credential_response):lg(e.webauthn.credential_response)})}:{code:e.code}),{data:a,error:o}=await Z(this.fetch,`POST`,`${this.url}/factors/${e.factorId}/verify`,{body:i,headers:this.headers,jwt:n?.session?.access_token});return o?this._returnResult({data:null,error:o}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+a.expires_in},a)),await this._notifyAllSubscribers(`MFA_CHALLENGE_VERIFIED`,a),this._returnResult({data:a,error:o}))})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}})}async _challenge(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)return this._returnResult({data:null,error:r});let i=await Z(this.fetch,`POST`,`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:n?.session?.access_token});if(i.error)return i;let{data:a}=i;if(a.type!==`webauthn`)return{data:a,error:null};switch(a.webauthn.type){case`create`:return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:og(a.webauthn.credential_options.publicKey)})})}),error:null};case`request`:return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:sg(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}})}async _challengeAndVerify(e){let{data:t,error:n}=await this._challenge({factorId:e.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){let{data:{user:e},error:t}=await this.getUser();if(t)return{data:null,error:t};let n={all:[],phone:[],totp:[],webauthn:[]};for(let t of e?.factors??[])n.all.push(t),t.status===`verified`&&n[t.factor_type].push(t);return{data:n,error:null}}async _getAuthenticatorAssuranceLevel(e){if(e)try{let{payload:t}=mh(e),n=null;t.aal&&(n=t.aal);let r=n,{data:{user:i},error:a}=await this.getUser(e);if(a)return this._returnResult({data:null,error:a});((i?.factors)?.filter(e=>e.status===`verified`)??[]).length>0&&(r=`aal2`);let o=t.amr||[];return{data:{currentLevel:n,nextLevel:r,currentAuthenticationMethods:o},error:null}}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}let{data:{session:t},error:n}=await this.getSession();if(n)return this._returnResult({data:null,error:n});if(!t)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let{payload:r}=mh(t.access_token),i=null;r.aal&&(i=r.aal);let a=i;(t.user.factors?.filter(e=>e.status===`verified`)??[]).length>0&&(a=`aal2`);let o=r.amr||[];return{data:{currentLevel:i,nextLevel:a,currentAuthenticationMethods:o},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?await Z(this.fetch,`GET`,`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:n.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new Mm})})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async _approveAuthorization(e,t){try{return await this._useSession(async n=>{let{data:{session:r},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!r)return this._returnResult({data:null,error:new Mm});let a=await Z(this.fetch,`POST`,`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:`approve`},xform:e=>({data:e,error:null})});return a.data&&a.data.redirect_url&&ih()&&!t?.skipBrowserRedirect&&window.location.assign(a.data.redirect_url),a})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async _denyAuthorization(e,t){try{return await this._useSession(async n=>{let{data:{session:r},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!r)return this._returnResult({data:null,error:new Mm});let a=await Z(this.fetch,`POST`,`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:`deny`},xform:e=>({data:e,error:null})});return a.data&&a.data.redirect_url&&ih()&&!t?.skipBrowserRedirect&&window.location.assign(a.data.redirect_url),a})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async _listOAuthGrants(){try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;return n?this._returnResult({data:null,error:n}):t?await Z(this.fetch,`GET`,`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new Mm})})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?(await Z(this.fetch,`DELETE`,`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new Mm})})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async fetchJwk(e,t={keys:[]}){let n=t.keys.find(t=>t.kid===e);if(n)return n;let r=Date.now();if(n=this.jwks.keys.find(t=>t.kid===e),n&&this.jwks_cached_at+6e5>r)return n;let{data:i,error:a}=await Z(this.fetch,`GET`,`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(a)throw a;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=r,n=i.keys.find(t=>t.kid===e),!n)?null:n}async getClaims(e,t={}){try{let n=e;if(!n){let{data:e,error:t}=await this.getSession();if(t||!e.session)return this._returnResult({data:null,error:t});n=e.session.access_token}let{header:r,payload:i,signature:a,raw:{header:o,payload:s}}=mh(n);t?.allowExpired||wh(i.exp);let c=!r.alg||r.alg.startsWith(`HS`)||!r.kid||!(`crypto`in globalThis&&`subtle`in globalThis.crypto)?null:await this.fetchJwk(r.kid,t?.keys?{keys:t.keys}:t?.jwks);if(!c){let{error:e}=await this.getUser(n);if(e)throw e;return{data:{claims:i,header:r,signature:a},error:null}}let l=Th(r.alg),u=await crypto.subtle.importKey(`jwk`,c,l,!0,[`verify`]);if(!await crypto.subtle.verify(l,u,a,eh(`${o}.${s}`)))throw new Um(`Invalid JWT signature`);return{data:{claims:i,header:r,signature:a},error:null}}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async signInWithPasskey(e){Oh(this.experimental);try{if(!dg())return this._returnResult({data:null,error:new Am(`Browser does not support WebAuthn`,null)});let{data:t,error:n}=await this._startPasskeyAuthentication({options:{captchaToken:e?.options?.captchaToken}});if(n||!t)return this._returnResult({data:null,error:n});let{data:r,error:i}=await pg({publicKey:sg(t.options),signal:e?.options?.signal??ag.createNewAbortSignal()});if(i||!r)return this._returnResult({data:null,error:i??new Am(`WebAuthn ceremony failed`,null)});let a=lg(r);return this._verifyPasskeyAuthentication({challengeId:t.challenge_id,credential:a})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async registerPasskey(e){Oh(this.experimental);try{if(!dg())return this._returnResult({data:null,error:new Am(`Browser does not support WebAuthn`,null)});let{data:t,error:n}=await this._startPasskeyRegistration();if(n||!t)return this._returnResult({data:null,error:n});let{data:r,error:i}=await fg({publicKey:og(t.options),signal:e?.options?.signal??ag.createNewAbortSignal()});if(i||!r)return this._returnResult({data:null,error:i??new Am(`WebAuthn ceremony failed`,null)});let a=cg(r);return this._verifyPasskeyRegistration({challengeId:t.challenge_id,credential:a})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async _startPasskeyRegistration(){Oh(this.experimental);try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!t)return this._returnResult({data:null,error:new Mm});let{data:r,error:i}=await Z(this.fetch,`POST`,`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:t.access_token,body:{}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:r,error:null})})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyRegistration(e){Oh(this.experimental);try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new Mm});let{data:i,error:a}=await Z(this.fetch,`POST`,`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:n.access_token,body:{challenge_id:e.challengeId,credential:e.credential}});return a?this._returnResult({data:null,error:a}):this._returnResult({data:i,error:null})})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async _startPasskeyAuthentication(e){Oh(this.experimental);try{let{data:t,error:n}=await Z(this.fetch,`POST`,`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:e?.options?.captchaToken}}});return n?this._returnResult({data:null,error:n}):this._returnResult({data:t,error:null})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyAuthentication(e){Oh(this.experimental);try{let{data:t,error:n}=await Z(this.fetch,`POST`,`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:Lh});return n?this._returnResult({data:null,error:n}):(t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers(`SIGNED_IN`,t.session)),this._returnResult({data:t,error:null}))}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async _listPasskeys(){Oh(this.experimental);try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!t)return this._returnResult({data:null,error:new Mm});let{data:r,error:i}=await Z(this.fetch,`GET`,`${this.url}/passkeys`,{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})});return i?this._returnResult({data:null,error:i}):this._returnResult({data:r,error:null})})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async _updatePasskey(e){Oh(this.experimental);try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new Mm});let{data:i,error:a}=await Z(this.fetch,`PATCH`,`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,body:{friendly_name:e.friendlyName}});return a?this._returnResult({data:null,error:a}):this._returnResult({data:i,error:null})})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}async _deletePasskey(e){Oh(this.experimental);try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new Mm});let{error:i}=await Z(this.fetch,`DELETE`,`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,noResolveJson:!0});return i?this._returnResult({data:null,error:i}):this._returnResult({data:null,error:null})})}catch(e){if(X(e))return this._returnResult({data:null,error:e});throw e}}};Cg.nextInstanceID={};var wg=Cg,Tg=`2.106.1`,Eg=``;Eg=typeof Deno<`u`?`deno`:typeof document<`u`?`web`:typeof navigator<`u`&&navigator.product===`ReactNative`?`react-native`:`node`;var Dg={headers:{"X-Client-Info":`supabase-js-${Eg}/${Tg}`}},Og={schema:`public`},kg={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:`implicit`},Ag={},jg={enabled:!1,respectSamplingDecision:!0};function Mg(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}var Ng=null,Pg=`@opentelemetry/api`;function Fg(){return Ng===null&&(Ng=import(Pg).catch(()=>null)),Ng}function Ig(){return Mg(this,void 0,void 0,function*(){try{let e=yield Fg();if(!e||!e.propagation||!e.context)return null;let t={};e.propagation.inject(e.context.active(),t);let n=t.traceparent;return n?{traceparent:n,tracestate:t.tracestate,baggage:t.baggage}:null}catch{return null}})}function Lg(e){if(!e||typeof e!=`string`)return null;let t=e.split(`-`);if(t.length!==4)return null;let[n,r,i,a]=t;if(n.length!==2||r.length!==32||i.length!==16||a.length!==2)return null;let o=/^[0-9a-f]+$/i;return!o.test(n)||!o.test(r)||!o.test(i)||!o.test(a)||r===`00000000000000000000000000000000`||i===`0000000000000000`?null:{version:n,traceId:r,parentId:i,traceFlags:a,isSampled:(parseInt(a,16)&1)==1}}function Rg(e,t){if(!e||!t||t.length===0)return!1;let n;if(e instanceof URL)n=e;else try{n=new URL(e)}catch{return!1}for(let e of t)try{if(typeof e==`string`){if(zg(n.hostname,e))return!0}else if(e instanceof RegExp){if(e.test(n.hostname))return!0}else if(typeof e==`function`&&e(n))return!0}catch{continue}return!1}function zg(e,t){if(t===e)return!0;if(t.startsWith(`*.`)){let n=t.slice(2);if(e.endsWith(n)&&(e===n||e.endsWith(`.`+n)))return!0}return!1}function Bg(e){let t=[];try{let n=new URL(e);t.push(n.hostname)}catch{}return t.push(`*.supabase.co`,`*.supabase.in`),t.push(`localhost`,`127.0.0.1`,`[::1]`),t}function Vg(e){"@babel/helpers - typeof";return Vg=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Vg(e)}function Hg(e,t){if(Vg(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Vg(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Ug(e){var t=Hg(e,`string`);return Vg(t)==`symbol`?t:t+``}function Wg(e,t,n){return(t=Ug(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Gg(Object(n),!0).forEach(function(t){Wg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gg(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Kg=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),qg=()=>Headers,Jg=(e,t,n,r,i)=>{let a=Kg(r),o=qg(),s=i?.enabled===!0,c=i?.respectSamplingDecision!==!1,l=s?Bg(t):null;return async(t,r)=>{let i=await n()??e,s=new o(r?.headers);if(s.has(`apikey`)||s.set(`apikey`,e),s.has(`Authorization`)||s.set(`Authorization`,`Bearer ${i}`),l){let e=await Yg(t,l,c);e&&(e.traceparent&&!s.has(`traceparent`)&&s.set(`traceparent`,e.traceparent),e.tracestate&&!s.has(`tracestate`)&&s.set(`tracestate`,e.tracestate),e.baggage&&!s.has(`baggage`)&&s.set(`baggage`,e.baggage))}return a(t,$($({},r),{},{headers:s}))}};async function Yg(e,t,n){if(!Rg(typeof e==`string`||e instanceof URL?e:e.url,t))return null;let r=await Ig();if(!r||!r.traceparent)return null;if(n){let e=Lg(r.traceparent);if(e&&!e.isSampled)return null}return r}function Xg(e){return typeof e==`boolean`?{enabled:e}:e}function Zg(e){return e.endsWith(`/`)?e:e+`/`}function Qg(e,t){let{db:n,auth:r,realtime:i,global:a}=e,{db:o,auth:s,realtime:c,global:l}=t,u=Xg(e.tracePropagation),d=Xg(t.tracePropagation),f={db:$($({},o),n),auth:$($({},s),r),realtime:$($({},c),i),storage:{},global:$($($({},l),a),{},{headers:$($({},l?.headers??{}),a?.headers??{})}),tracePropagation:{enabled:u?.enabled??d?.enabled??!1,respectSamplingDecision:u?.respectSamplingDecision??d?.respectSamplingDecision??!0},accessToken:async()=>``};return e.accessToken?f.accessToken=e.accessToken:delete f.accessToken,f}function $g(e){let t=e?.trim();if(!t)throw Error(`supabaseUrl is required.`);if(!t.match(/^https?:\/\//i))throw Error(`Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.`);try{return new URL(Zg(t))}catch{throw Error(`Invalid supabaseUrl: Provided URL is malformed.`)}}var e_=class extends wg{constructor(e){super(e)}},t_=class{constructor(e,t,n){this.supabaseUrl=e,this.supabaseKey=t;let r=$g(e);if(!t)throw Error(`supabaseKey is required.`);this.realtimeUrl=new URL(`realtime/v1`,r),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace(`http`,`ws`),this.authUrl=new URL(`auth/v1`,r),this.storageUrl=new URL(`storage/v1`,r),this.functionsUrl=new URL(`functions/v1`,r);let i=`sb-${r.hostname.split(`.`)[0]}-auth-token`,a={db:Og,realtime:Ag,auth:$($({},kg),{},{storageKey:i}),global:Dg,tracePropagation:jg},o=Qg(n??{},a);this.settings=o,this.storageKey=o.auth.storageKey??``,this.headers=o.global.headers??{},o.accessToken?(this.accessToken=o.accessToken,this.auth=new Proxy({},{get:(e,t)=>{throw Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(t)} is not possible`)}})):this.auth=this._initSupabaseAuthClient(o.auth??{},this.headers,o.global.fetch),this.fetch=Jg(t,e,this._getAccessToken.bind(this),o.global.fetch,o.tracePropagation),this.realtime=this._initRealtimeClient($({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},o.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(e=>this.realtime.setAuth(e)).catch(e=>console.warn(`Failed to set initial Realtime auth token:`,e)),this.rest=new cf(new URL(`rest/v1`,r).href,{headers:this.headers,schema:o.db.schema,fetch:this.fetch,timeout:o.db.timeout,urlLengthLimit:o.db.urlLengthLimit}),this.storage=new _m(this.storageUrl.href,this.headers,this.fetch,n?.storage),o.accessToken||this._listenForAuthEvents()}get functions(){return new Hd(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,n)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this;if(e.accessToken)return await e.accessToken();let{data:t}=await e.auth.getSession();return t.session?.access_token??e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,storageKey:a,flowType:o,lock:s,debug:c,throwOnError:l,experimental:u,lockAcquireTimeout:d,skipAutoInitialize:f},p,m){let h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new e_({url:this.authUrl.href,headers:$($({},h),p),storageKey:a,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,flowType:o,lock:s,debug:c,throwOnError:l,experimental:u,fetch:m,lockAcquireTimeout:d,skipAutoInitialize:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(e=>e.toLowerCase()===`authorization`)})}_initRealtimeClient(e){return new vp(this.realtimeUrl.href,$($({},e),{},{params:$($({},{apikey:this.supabaseKey}),e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,`CLIENT`,t?.access_token)})}_handleTokenChanged(e,t,n){(e===`TOKEN_REFRESHED`||e===`SIGNED_IN`)&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e===`SIGNED_OUT`&&(this.realtime.setAuth(),t==`STORAGE`&&this.auth.signOut(),this.changedAccessToken=void 0)}},n_=(e,t,n)=>new t_(e,t,n);function r_(){if(typeof window<`u`)return!1;let e=globalThis.process;if(!e)return!1;let t=e.version;if(t==null)return!1;let n=t.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=18:!1}r_()&&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 Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217`);var i_=class{client;channels=new Map;eventSubs=new Map;presenceSubs=new Map;constructor(e){if(e.client)this.client=e.client;else{if(!e.url||!e.anonKey)throw Error(`SupabaseTransport requires url + anonKey when no client is provided`);this.client=n_(e.url,e.anonKey)}}getChannel(e){let t=this.channels.get(e);return t||(t=this.client.channel(e,{config:{broadcast:{self:!1}}}),t.on(`broadcast`,{event:`gameEvent`},({payload:t})=>{let n=this.eventSubs.get(e);if(n)for(let e of n)e(t)}),t.on(`presence`,{event:`sync`},()=>{let t=this.presenceSubs.get(e);if(t){let n=this.flattenPresence(e);for(let e of t)e(n)}}),t.subscribe(),this.channels.set(e,t)),t}async broadcast(e,t){let n=this.eventSubs.get(e);if(n)for(let e of[...n])e(t);await this.getChannel(e).send({type:`broadcast`,event:`gameEvent`,payload:t})}subscribe(e,t){return this.getChannel(e),this.eventSubs.has(e)||this.eventSubs.set(e,new Set),this.eventSubs.get(e).add(t),()=>{this.eventSubs.get(e)?.delete(t)}}flattenPresence(e){let t=this.channels.get(e);if(!t)return[];let n=t.presenceState();return Object.values(n).flat()}presence={track:async(e,t)=>{await this.getChannel(e).track(t)},untrack:async e=>{let t=this.channels.get(e);t&&await t.untrack()},list:e=>(this.getChannel(e),this.flattenPresence(e)),onChange:(e,t)=>(this.getChannel(e),this.presenceSubs.has(e)||this.presenceSubs.set(e,new Set),this.presenceSubs.get(e).add(t),()=>{this.presenceSubs.get(e)?.delete(t)})}},a_=`__host__`,o_=`hashquiz:player-session`;function s_(e){try{let t=sessionStorage.getItem(o_);if(!t)return null;let n=JSON.parse(t);return n.code===e?n:null}catch{return null}}function c_(e){try{sessionStorage.setItem(o_,JSON.stringify(e))}catch{}}function l_(){try{let e=sessionStorage.getItem(o_+`:draft`);return e?JSON.parse(e):null}catch{return null}}function u_(e){try{sessionStorage.setItem(o_+`:draft`,JSON.stringify(e))}catch{}}function d_(){try{sessionStorage.removeItem(o_+`:draft`)}catch{}}function f_(){return Math.random().toString(36).slice(2)+Date.now().toString(36)}var p_=vc(`game`,()=>{let e=R(`join`),t=R(f_()),n=R(0),r=R(null),i=R(0),a=R(!1),o=R(0),s=R(0),c=R(0),l=R(null),u=R(0),d=R([]),f=R(void 0),p=R([]),m=R(``),h=R(null),g=R(null),_=R(`connecting`),v=K(()=>!a.value&&g.value!==null&&Date.now()<g.value),y=null,b=null,x=``,S=``,C=``,w=``,T=`local`,E=0,D=null,O=!1;function k(){O||typeof document>`u`||(O=!0,document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&te()}),window.addEventListener(`pageshow`,te),window.addEventListener(`online`,te),window.addEventListener(`pagehide`,ee))}function ee(){T===`supabase`&&b&&x&&b.presence.untrack(x)}function te(){if(e.value!==`join`&&S){if(T===`local`)!y||y.readyState===WebSocket.CLOSED||y.readyState===WebSocket.CLOSING?ne(0):y.readyState===WebSocket.OPEN&&y.send(JSON.stringify({type:`state_request`}));else if(T===`supabase`&&b&&x){let e={id:t.value,pseudo:C,email:w,score:s.value,joinedAt:Date.now()};b.presence.track(x,e),b.broadcast(x,bd.stateRequest(t.value)),_.value=`connected`}}}function ne(e){if(D)return;let t=e===void 0?Math.min(1e4,1e3*2**E):e;_.value=`reconnecting`,D=setTimeout(()=>{D=null,E++,A(!0)},t)}async function re(n,r,i){let a=Nd.supabaseUrl,o=Nd.supabaseAnonKey;if(!a||!o){m.value=`Missing Supabase credentials`;return}T=`supabase`,b=new i_({url:a,anonKey:o}),x=`game:${n}`,S=n,C=r,w=i,b.subscribe(x,se),k(),await new Promise(e=>setTimeout(e,300));let c=b.presence.list(x).filter(e=>e.id!==a_&&e.id!==t.value).map(e=>e.pseudo),l=r,u=2;for(;c.includes(l);)l=`${r}-${u++}`;C=l;let d={id:t.value,pseudo:l,email:i,score:s.value,joinedAt:Date.now()};await b.presence.track(x,d),setTimeout(()=>{b.presence.list(x).some(e=>e.id===a_)?(e.value===`join`&&(e.value=`lobby`),_.value=`connected`,c_({playerId:t.value,code:S,pseudo:C,email:w}),b.broadcast(x,bd.stateRequest(t.value))):(m.value=`No game found for this code`,_.value=`offline`)},3e3)}function ie(e,n){b&&b.broadcast(x,bd.answerSubmit(t.value,e,n))}function A(n){_.value=n?`reconnecting`:`connecting`;let r=`ws://${location.hostname}:3030/ws?role=player&id=${t.value}&code=${encodeURIComponent(S)}`,s=new WebSocket(r);y=s,s.onerror=()=>{n||(m.value=`Connection failed — check the join code and try again`)},s.onopen=()=>{E=0;let e=n?`player_rejoin`:`player_join`;s.send(JSON.stringify({type:e,pseudo:C,email:w})),_.value=`connected`;let t=l_();t&&t.questionIdx===i.value&&v.value&&(s.send(JSON.stringify({type:`submit_answer`,choiceIds:t.choiceIds,answerTimeMs:t.elapsed})),a.value=!0,o.value=t.elapsed,d_())},s.onmessage=e=>{se(JSON.parse(e.data))},s.onclose=()=>{y===s&&(_.value=`reconnecting`,e.value!==`join`&&ne())}}function ae(e,n,r){m.value=``,S=e,C=n,w=r;let i=s_(e);i&&(t.value=i.playerId,n||(C=i.pseudo),r||(w=i.email)),Nd.transport===`supabase`?re(e,C,w):(T=`local`,k(),A(i!==null))}function oe(m){if(h.value=m.quizMeta,s.value=m.totalScore,n.value=m.playerCount,m.phase===`finished`)p.value=m.podium??[],e.value=`podium`,g.value=null;else if(m.phase===`lobby`)e.value=`lobby`,r.value=null,g.value=null;else if(m.question&&(r.value=m.question,i.value=m.questionIdx??m.question.idx),m.phase===`revealed`&&m.reveal){d.value=m.reveal.correct,f.value=m.reveal.explanation;let n=m.reveal.scores.find(e=>e.playerId===t.value);n&&(c.value=n.delta,s.value=n.score);let r=Sd(m.reveal.scores,t.value);l.value=r?.rank??null,u.value=r?.total??0,a.value=!0,g.value=null,e.value=`question`}else{d.value=[],f.value=void 0,g.value=m.deadlineMs??null;let t=l_();t&&t.questionIdx===i.value||a.value&&g.value&&Date.now()>=g.value||(a.value=!1,o.value=0),e.value=`question`}}function se(m){if(m.type===`joined`)e.value=`lobby`,h.value=m.quizMeta,n.value=m.playerCount,_.value=`connected`,c_({playerId:t.value,code:S,pseudo:C,email:w});else if(m.type===`state_snapshot`){if(m.playerId&&m.playerId!==t.value)return;oe(m.snapshot),_.value=`connected`,c_({playerId:t.value,code:S,pseudo:C,email:w})}else switch(m.type){case`player_joined`:m.player.id!==t.value&&n.value++;break;case`player_rejoined`:break;case`player_left`:m.playerId!==t.value&&(n.value=Math.max(0,n.value-1));break;case`question_started`:r.value=m.question,i.value=m.idx,a.value=!1,o.value=0,l.value=null,u.value=0,d.value=[],f.value=void 0,g.value=m.deadlineMs,e.value=`question`,d_();break;case`answer_revealed`:{let e=m.scores.find(e=>e.playerId===t.value);e&&(c.value=e.delta,s.value=e.score);let n=Sd(m.scores,t.value);l.value=n?.rank??null,u.value=n?.total??0,d.value=m.correct,f.value=m.explanation,a.value=!0,g.value=null,d_();break}case`game_ended`:p.value=m.podium,e.value=`podium`,d_();break;case`game_reset`:r.value=null,i.value=0,a.value=!1,o.value=0,s.value=0,c.value=0,l.value=null,u.value=0,d.value=[],f.value=void 0,p.value=[],g.value=null,e.value=`lobby`,d_()}}function ce(e,t){a.value||g.value!==null&&Date.now()>=g.value||(a.value=!0,o.value=t,u_({questionIdx:i.value,choiceIds:e,elapsed:t}),T===`supabase`?ie(e,t):y&&y.readyState===WebSocket.OPEN&&(y.send(JSON.stringify({type:`submit_answer`,choiceIds:e,answerTimeMs:t})),d_()))}return{phase:e,playerId:t,playerCount:n,question:r,questionIdx:i,answered:a,answerTimeMs:o,totalScore:s,lastDelta:c,rank:l,playerTotal:u,correctIds:d,explanation:f,podium:p,connectError:m,quizMeta:h,deadlineMs:g,status:_,canStillAnswer:v,connect:ae,submitAnswer:ce,submitAnswerSupabase:ie}}),m_=new Set([`deck version mismatch`,`unknown deck`]),h_=20,g_=null;function __(e){g_=e}var v_=()=>{},y_=vc(`solo`,()=>{let e=R(`unavailable`),t=an(null),n=an(null),r=R(``),i=R(null),a=R(0),o=R(0),s=R(0),c=R(0),l=R(0),u=R(null),d=R(null),f=R([]),p=R([]),m=R(null),h=R(null),g=R(null),_=R(null),v=R(`idle`),y=R(null),b=null,x=null,S=null,C=0,w=Promise.resolve(),T=K(()=>f.value.filter(e=>e.key!==b?.key)),E=K(()=>({rank:1+T.value.filter(e=>e.score>s.value).length,of:1+T.value.length})),D=K(()=>{let e=p.value.map((e,t)=>({...e,rank:t+1,mine:e.id===h.value})),t=_.value;return t&&g.value!==null&&!e.some(e=>e.mine)&&e.push({...t,rank:g.value,mine:!0}),e});function O(){let t=n.value;i.value=t?.question??null,a.value=t?.index??0,o.value=t?.total??0,s.value=t?.score??0,c.value=t?.correctCount??0,l.value=t?.totalTimeMs??0,u.value=t?.deadlineMs??null,d.value=t?.lastResult??null,t&&(t.status===`question`?e.value=`question`:t.status===`revealed`?e.value=`revealed`:t.status===`finished`&&(e.value=`end`))}let k=()=>({pseudo:r.value,index:a.value,total:o.value,score:s.value});function ee(){n.value=null,h.value=null,g.value=null,_.value=null,v.value=`idle`,y.value=null,O()}function te(){C++,x?.();let e=[w];S&&e.push(Promise.resolve().then(S)),b&&e.push(b.leave()),w=Promise.all(e.map(e=>e.catch(v_))),b=x=S=null,f.value=[],ee()}async function ne(){let e=g_?.backend?.api,n=t.value?.id;if(!e||!n)return;let r=C,[i,a]=await Promise.all([e.fetchTop(n,h_),e.fetchCount(n)]);if(r!==C)return;i.ok&&(p.value=i.value),a.ok&&(m.value=a.value);let o=h.value;if(!i.ok||!o)return;let s=i.value.findIndex(e=>e.id===o);if(s>=0){g.value=s+1;return}let[c,l]=await Promise.all([e.fetchRank(o),_.value?.id===o?null:e.fetchRun(o)]);r===C&&h.value===o&&(c.ok&&(g.value=c.value),l?.ok&&(_.value=l.value))}async function re(n){te(),p.value=[],m.value=null,t.value=null;let r=g_?.backend;if(!g_||!r){e.value=`unavailable`;return}e.value=`loading`;let i=C,a;try{a=await g_.findDeck(n)}catch{a=void 0}i===C&&(!a||!a.quiz.meta.solo?e.value=`unavailable`:(t.value=a,e.value=`intro`,await Promise.all([ie(a.id,i),ne()])))}async function ie(r,i){await w;let a=g_?.backend;if(i===C&&a){try{b=a.live(r)}catch{e.value===`intro`&&(t.value=null,e.value=`unavailable`);return}x=b.onChange(e=>{f.value=e}),b.watch().catch(v_),S=a.api.onNewRun(r,()=>{ne()}),n.value&&n.value.status!==`finished`&&b.join(k()).catch(v_)}}function A(i){let a=i.trim(),o=t.value;if(!o||a.length<1||a.length>24||e.value!==`intro`&&e.value!==`end`)return;ee(),r.value=a;let s=new Md({quiz:o.quiz,deckId:o.id,deckVersion:o.version,pseudo:a,now:ae});s.start(),s.total===0?(t.value=null,e.value=`unavailable`):(n.value=s,O(),b?.join(k()).catch(v_))}let ae=()=>(g_?.now??Date.now)(),oe=()=>u.value!==null&&ae()>=u.value;function se(t){e.value===`question`&&(oe()?ce():(n.value?.answer(t),O(),b?.update(k()).catch(v_)))}function ce(t=[]){e.value===`question`&&(t.length>0?n.value?.answer(t):n.value?.timeout(),O(),b?.update(k()).catch(v_))}function j(){e.value===`revealed`&&(n.value?.next(),O(),n.value?.status===`finished`?M():b?.update(k()).catch(v_))}async function M(){b?.untrack().catch(v_),await le()}async function le(){let e=g_?.backend?.api,r=n.value,i=t.value;if(!e||!r||!i||r.status!==`finished`||v.value===`saving`||v.value===`saved`)return;let a=C;v.value=`saving`;let o=await e.submitRun(r.toSubmission(),i.quiz);a===C&&n.value===r&&(o.ok?(h.value=o.value.runId,g.value=o.value.rank,v.value=`saved`,await ne()):(y.value=o.error,m_.has(o.error)?(v.value=`stale`,g_?.reloadDecks?.()):v.value=`error`))}function ue(){v.value===`error`&&le()}async function de(){if(e.value!==`end`)return;let n=t.value;if(v.value===`stale`&&n){let t=r.value;await re(n.id),e.value===`intro`&&A(t)}else A(r.value)}function fe(){te(),t.value=null,e.value=`unavailable`}async function pe(e,n={}){let r=g_?.backend?.api;return r?r.submitLead(e,t.value?.id??null,n):{ok:!1,error:`unavailable`}}return{phase:e,deck:t,session:n,pseudo:r,question:i,index:a,total:o,score:s,correctCount:c,totalTimeMs:l,deadlineMs:u,lastResult:d,live:f,liveOthers:T,liveRank:E,top:p,runCount:m,myRunId:h,myRank:g,myRun:_,board:D,submitState:v,submitError:y,open:re,start:A,answer:se,timeout:ce,next:j,retrySubmit:ue,playAgain:de,abandon:fe,submitLead:pe}}),b_=`modulepreload`,x_=function(e){return`/`+e},S_={},C_={},w_=function(e){return e.pathname.endsWith(`.css`)},T_=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw delete e[t],n});return e[t]=i,i},E_=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=x_(t,n);let r=s(t),i=w_(r);return T_(S_,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}let t=i?e.styles:e.all,n=i?C_[r.href]:void 0;if(!n&&t.has(r.href))return;let o=document.createElement(`link`);if(o.rel=i?`stylesheet`:b_,i||(o.as=`script`),o.crossOrigin=``,o.href=r.href,a&&o.setAttribute(`nonce`,a),n&&delete C_[r.href],n?.isConnected?n.replaceWith(o):document.head.appendChild(o),i)return new Promise((e,t)=>{let n=i=>{o.removeEventListener(`load`,n),o.removeEventListener(`error`,n),i.type===`error`?(C_[r.href]=o,t(Error(`Unable to preload CSS for ${r}`))):e(i)};o.addEventListener(`load`,n),o.addEventListener(`error`,n)})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},D_=null;function O_(){return D_??=E_(async()=>{let{defaultSoloDeps:e}=await import(`./deps-AJH7wiX7.js`);return{defaultSoloDeps:e}},__vite__mapDeps([0,1,2,3])).then(({defaultSoloDeps:e})=>__(e())),D_}var k_=`#/solo/`;function A_(e){if(!e.startsWith(k_))return null;let t=e.slice(7);if(!t)return null;try{let e=decodeURIComponent(t);return e?{deckId:e}:null}catch{return null}}function j_(e){return k_+encodeURIComponent(e)}var M_={class:`join`},N_={class:`join__form`},P_={key:0,class:`join__error`},F_=[`disabled`],I_=sl(br({__name:`JoinView`,setup(e){let t=kr(()=>E_(()=>import(`./SoloCatalog-BQSbd-wT.js`),__vite__mapDeps([4,3,2,5,1,6,7,8]))),n=kd(Nd),r=p_(),i=R(``),a=R(``),o=R(``);zr(()=>{let e=new URLSearchParams(location.search).get(`code`);e&&(i.value=e.toUpperCase());try{let e=sessionStorage.getItem(`hashquiz:player-session`);if(e&&i.value){let t=JSON.parse(e);t.code===i.value&&(a.value=t.pseudo,o.value=t.email,r.connect(i.value,t.pseudo,t.email))}}catch{}});function s(){r.connect(i.value.trim().toUpperCase(),a.value.trim(),o.value.trim())}return(e,c)=>(V(),H(`div`,M_,[c[3]||=U(`p`,{class:`join__sub`},`Enter the game code to join`,-1),U(`div`,N_,[Kn(U(`input`,{"onUpdate:modelValue":c[0]||=e=>i.value=e,class:`hq-input`,placeholder:`Game code (e.g. ABC123)`,style:{"text-transform":`uppercase`,"letter-spacing":`0.12em`},maxlength:`8`},null,512),[[cs,i.value]]),Kn(U(`input`,{"onUpdate:modelValue":c[1]||=e=>a.value=e,class:`hq-input`,placeholder:`Your name`,maxlength:`20`},null,512),[[cs,a.value]]),Kn(U(`input`,{"onUpdate:modelValue":c[2]||=e=>o.value=e,class:`hq-input`,type:`email`,placeholder:`Email (optional)`},null,512),[[cs,o.value]]),z(r).connectError?(V(),H(`p`,P_,P(z(r).connectError),1)):G(``,!0),U(`button`,{class:`hq-btn-primary hq-press`,disabled:!i.value.trim()||!a.value.trim(),onClick:s},` Join Game `,8,F_)]),z(n)?(V(),va(z(t),{key:0})):G(``,!0)]))}}),[[`__scopeId`,`data-v-256fc64a`]]),L_={class:`lobby`},R_={class:`lobby__wait`},z_=sl(br({__name:`LobbyView`,setup(e){let t=p_(),n=K(()=>Array.from({length:Math.max(t.playerCount,1)},(e,t)=>({id:`p`+t})));return(e,r)=>(V(),H(`div`,L_,[z(t).quizMeta?(V(),va(z(yd),{key:0,quizInfo:z(t).quizMeta,playerCount:z(t).playerCount,compact:``},null,8,[`quizInfo`,`playerCount`])):G(``,!0),U(`div`,R_,[W(z(Cl),{class:`lobby__icon`}),r[0]||=U(`h2`,null,`Waiting for the host…`,-1)]),W(z(Bl),{class:`lobby__fx`,players:n.value,highlightId:`p0`},null,8,[`players`])]))}}),[[`__scopeId`,`data-v-146e398c`]]),B_={key:0,class:`question-view`},V_={class:`hq-progress`},H_={class:`hq-progress__label hq-label`},U_={class:`hq-progress__track hq-steps`},W_={class:`hq-progress__label`},G_={key:0,class:`hq-timer-wrap`},K_={class:`hq-sr-only`},q_={class:`hq-result__line`},J_={class:`hq-result__score`},Y_={key:0,class:`hq-result__rank hq-label`},X_={class:`hq-result__delta`},Z_={key:0,class:`hq-result__info`},Q_={key:1,class:`hq-result__info`},$_={class:`hq-q-meta`},e1={class:`hq-q-meta__tags`},t1={class:`hq-q-text`},n1={class:`hq-grid`},r1=[`disabled`],i1=sl(br({__name:`QuestionView`,setup(e){let t=p_(),n=R(t.question?.timer??0),r=R(new Set),i=R(!1),a=R(0),o=null,s=0,c=0,l=K(()=>t.question?.oneShoot??!0),u=K(()=>t.question?.type===`multiple`),d=K(()=>t.correctIds.length>0),f=K(()=>t.lastDelta>0),p=R(0),m=0;$n(d,e=>{if(cancelAnimationFrame(m),!e){p.value=0;return}let n=t.lastDelta;if(typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches||n<=0){p.value=n;return}let r=performance.now(),i=e=>{let t=Math.min((e-r)/600,1);p.value=Math.round(n*(1-(1-t)**3)),t<1&&(m=requestAnimationFrame(i))};m=requestAnimationFrame(i)},{immediate:!0});function h(){o&&clearInterval(o),o=setInterval(()=>{let e=Math.min(s,Math.max(0,Math.round((c-Date.now())/100)/10));n.value=e,e<=0&&(clearInterval(o),o=null,i.value=!0,r.value.size>0&&!t.answered&&t.submitAnswer([...r.value],a.value))},100)}$n(()=>t.question?.idx,()=>{r.value=new Set,i.value=!1,a.value=0},{immediate:!0}),$n(()=>[t.question?.idx,t.deadlineMs],([,e])=>{let r=t.question;r&&(s=r.timer,e==null?o&&=(clearInterval(o),null):(c=e,n.value=Math.min(s,Math.max(0,Math.round((c-Date.now())/100)/10)),n.value<=0?(i.value=!0,o&&=(clearInterval(o),null)):h()))},{immediate:!0}),zr(()=>{t.question&&c>Date.now()&&!o&&h()}),Ur(()=>{o&&clearInterval(o),cancelAnimationFrame(m)});function g(e){if(d.value){let n=t.correctIds.includes(e),i=r.value.has(e);return n?`correct`:i?`wrong`:`disabled`}return i.value||t.answered?r.value.has(e)?`selected`:`disabled`:r.value.has(e)?`selected`:`idle`}function _(e){if(i.value||t.answered||d.value)return;if(!l.value){a.value=(t.question.timer-n.value)*1e3;let i=new Set(r.value);i.has(e)?i.delete(e):i.add(e),r.value=i;return}if(!u.value){if(r.value.size>0)return;let i=(t.question.timer-n.value)*1e3;r.value=new Set([e]),t.submitAnswer([e],i);return}a.value=(t.question.timer-n.value)*1e3;let o=new Set(r.value);o.has(e)?o.delete(e):o.add(e),r.value=o}function v(){i.value||t.answered||r.value.size===0||t.submitAnswer([...r.value],a.value)}return(e,a)=>z(t).question?(V(),H(`div`,B_,[U(`div`,V_,[U(`span`,H_,`Q`+P(z(t).questionIdx+1),1),U(`div`,U_,[U(`div`,{class:`hq-progress__fill`,style:ve({width:(z(t).questionIdx+1)/(z(t).quizMeta?.totalQuestions??1)*100+`%`})},null,4)]),U(`span`,W_,P(z(t).quizMeta?.totalQuestions??`?`),1)]),d.value?(V(),H(`div`,{key:1,role:`status`,class:N([`hq-result`,f.value?`hq-result--correct`:`hq-result--wrong`])},[W(z(vu),{class:`hq-result__fx`,correct:f.value,delta:z(t).lastDelta,answered:z(t).answered},null,8,[`correct`,`delta`,`answered`]),U(`span`,K_,P(f.value?`Correct`:`Wrong`),1),U(`div`,q_,[U(`span`,J_,[Ea(P(z(t).totalScore)+` `,1),a[0]||=U(`small`,null,`pts`,-1)]),z(t).rank===null?G(``,!0):(V(),H(`span`,Y_,P(z(Vl)(z(t).rank))+` / `+P(z(t).playerTotal),1))]),U(`span`,X_,P(p.value>0?`+`+p.value:`+0`)+` pts`,1),z(t).answered?(V(),H(`span`,Z_,`Answered in `+P(Math.round(z(t).answerTimeMs/1e3))+`s / `+P(z(t).question.timer)+`s`,1)):(V(),H(`span`,Q_,`No answer submitted`))],2)):(V(),H(`div`,G_,[W(z(cl),{total:z(t).question.timer,remaining:n.value,size:`compact`},null,8,[`total`,`remaining`])])),U(`div`,$_,[U(`div`,e1,[(V(!0),H(B,null,Yr(z(t).question.tags,e=>(V(),H(`span`,{key:e,class:`hq-q-meta__tag`},P(e),1))),128))]),U(`span`,{class:N([`hq-difficulty`,`hq-difficulty--${z(t).question.difficulty}`])},[...a[1]||=[U(`span`,{class:`hq-difficulty__dot hq-difficulty__dot--1`},null,-1),U(`span`,{class:`hq-difficulty__dot hq-difficulty__dot--2`},null,-1),U(`span`,{class:`hq-difficulty__dot hq-difficulty__dot--3`},null,-1)]],2)]),U(`h2`,t1,P(z(t).question.text.replace(/^#+\s/,``)),1),U(`div`,n1,[(V(!0),H(B,null,Yr(z(t).question.choices,(e,t)=>(V(),va(z(Su),{key:e.id,id:e.id,text:e.text,"color-id":[`a`,`b`,`c`,`d`][t],state:g(e.id),onSelect:t=>_(e.id)},null,8,[`id`,`text`,`color-id`,`state`,`onSelect`]))),128))]),l.value&&u.value&&!z(t).answered&&!i.value?(V(),H(`button`,{key:2,class:`hq-validate-btn hq-press`,disabled:r.value.size===0,onClick:v},` Valider → `,8,r1)):G(``,!0)])):G(``,!0)}}),[[`__scopeId`,`data-v-7a64ad92`]]),a1={class:`podium-view`},o1={class:`podium-view__rank`},s1={class:`podium-view__medal`},c1={class:`podium-view__name`},l1={class:`podium-view__score`},u1={class:`podium-view__fx`},d1=sl(br({__name:`PodiumView`,setup(e){let t=p_(),n=K(()=>t.podium.find(e=>e.playerId===t.playerId)),r=K(()=>{let e=n.value?.rank??99;return e===1?`🥇`:e===2?`🥈`:e===3?`🥉`:`#${e}`});return(e,i)=>(V(),H(`div`,a1,[U(`div`,o1,[U(`p`,s1,P(r.value),1),U(`p`,c1,P(n.value?.pseudo??``),1),U(`p`,l1,P(z(t).totalScore.toLocaleString())+` pts`,1)]),U(`div`,u1,[W(z(ru),{podium:z(t).podium,"highlight-id":z(t).playerId},null,8,[`podium`,`highlight-id`])]),W(z(Du),{podium:z(t).podium},null,8,[`podium`])]))}}),[[`__scopeId`,`data-v-608e2d6a`]]),f1={class:`app`};xs(br({__name:`App`,setup(e){let t=kr(()=>E_(()=>import(`./SoloIntroView-T-Jpx0e3.js`),__vite__mapDeps([9,3,10,11,12,13,7]))),n=kr(()=>E_(()=>import(`./SoloQuestionView-CcFu43-z.js`),__vite__mapDeps([14,11,15,7]))),r=kr(()=>E_(()=>import(`./SoloEndView-BUcP4RWT.js`),__vite__mapDeps([16,11,10,12,5,1,6,7,17]))),i=p_(),a=y_(),o=R(null),s=R(!1);async function c(e=!1){let t=A_(location.hash)?.deckId??null;if(t===o.value&&!e||(o.value!==null&&a.abandon(),o.value=t,s.value=!1,t===null)||(await O_(),o.value!==t))return;let n=a.open(t);s.value=!0,await n}function l(){o.value!==null&&(a.abandon(),s.value=!1)}function u(e){e.persisted&&c(!0)}let d=()=>{c()};zr(()=>{c(),window.addEventListener(`hashchange`,d),window.addEventListener(`pagehide`,l),window.addEventListener(`pageshow`,u)}),Ur(()=>{window.removeEventListener(`hashchange`,d),window.removeEventListener(`pagehide`,l),window.removeEventListener(`pageshow`,u)});let f=K(()=>{switch(i.status){case`connecting`:return`Connexion…`;case`reconnecting`:return`Reconnexion…`;case`offline`:return`Hors ligne`;default:return``}});return(e,c)=>(V(),H(B,null,[W(z(fl)),W(z(ll)),U(`div`,f1,[o.value===null?(V(),H(B,{key:1},[W(po,{name:`status`},{default:Gn(()=>[z(i).phase!==`join`&&z(i).status!==`connected`?(V(),H(`p`,{key:0,class:N([`status-banner`,`status-banner--${z(i).status}`])},P(f.value),3)):G(``,!0)]),_:1}),z(i).phase===`join`?(V(),va(I_,{key:0})):z(i).phase===`lobby`?(V(),va(z_,{key:1})):z(i).phase===`question`?(V(),va(i1,{key:2})):z(i).phase===`podium`?(V(),va(d1,{key:3})):G(``,!0)],64)):(V(),H(B,{key:0},[z(a).phase===`question`||z(a).phase===`revealed`?(V(),va(z(n),{key:0})):z(a).phase===`end`?(V(),va(z(r),{key:1})):s.value?(V(),va(z(t),{key:o.value})):G(``,!0)],64))])],64))}})).use(ic()).mount(`#app`);export{V as A,s as B,H as C,Nn as D,br as E,an as F,z as I,N as L,$n as M,Kn as N,zr as O,R as P,ve as R,G as S,W as T,l as V,_s as _,Nd as a,U as b,Su as c,sl as d,zs as f,cs as g,ds as h,n_ as i,Yr as j,Ur as k,vu as l,ls as m,O_ as n,xd as o,Bs as p,y_ as r,yd as s,j_ as t,cl as u,B as v,Ea as w,va as x,K as y,P as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=/^[^@\s]+@[^@\s]+\.[^@\s]+$/,t=[`tech-trainer`,`non-tech-trainer`,`training-org`,`company`,`teacher`,`speaker`,`workshop-host`,`other`],n=e=>t.includes(e);export{t as n,n as r,e as t};
|
package/web/index.html
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<meta property="og:image:height" content="630">
|
|
22
22
|
<meta name="twitter:card" content="summary_large_image">
|
|
23
23
|
<!-- hashquiz:head (canonical and og:url, written by `hashquiz build` from HASHQUIZ_SITE_URL) -->
|
|
24
|
-
<script type="module" crossorigin src="/assets/index-
|
|
24
|
+
<script type="module" crossorigin src="/assets/index-CC4u6JVh.js"></script>
|
|
25
25
|
<link rel="stylesheet" crossorigin href="/assets/index-BzQ6jGVm.css">
|
|
26
26
|
</head>
|
|
27
27
|
<body>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.lead[data-v-16f1c9fd]{background:var(--hq-surface);border:1px solid var(--hq-border);border-radius:var(--hq-radius);width:100%;padding:1rem}.lead__form[data-v-16f1c9fd]{flex-direction:column;gap:.6rem;display:flex}.lead__title[data-v-16f1c9fd]{margin:0 0 .25rem;font-size:1.05rem}.lead__consent[data-v-16f1c9fd]{color:var(--hq-text-muted);cursor:pointer;align-items:flex-start;gap:.6rem;font-size:.9rem;display:flex}.lead__consent input[data-v-16f1c9fd]{accent-color:var(--hq-accent);flex-shrink:0;width:1.1rem;height:1.1rem;margin-top:.2rem}.lead__error[data-v-16f1c9fd]{color:var(--hq-wrong);margin:0;font-size:.9rem}.lead__thanks[data-v-16f1c9fd]{text-align:center;color:var(--hq-correct);margin:0;font-weight:600}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as e,C as t,E as n,I as r,N as i,P as a,S as o,_ as s,b as c,d as l,g as u,h as d,j as f,m as p,n as m,r as h,v as g,y as _,z as v}from"./index-t6uIRzOv.js";import{n as y,r as b,t as x}from"./solo-backend-CBEhye1F.js";/* empty css */var S={class:`lead`,"aria-labelledby":`lead-title`},C={key:0,class:`lead__thanks`,role:`status`},w=[`aria-invalid`],T=[`value`],E={class:`lead__consent`},D={class:`lead__consent`},O=[`disabled`],k={key:0,class:`lead__error`,role:`status`},A=l(n({__name:`LeadForm`,props:{source:{default:`solo-end`}},setup(n){let l=n,A={"tech-trainer":`Formateur·rice tech`,"non-tech-trainer":`Formateur·rice non tech`,"training-org":`Organisme de formation`,company:`Entreprise`,teacher:`Enseignant·e`},j=h(),M=a(``),N=a(``),P=a(!1),F=a(!1),I=a(`idle`),L=_(()=>x.test(M.value.trim())),R=_(()=>L.value&&b(N.value)&&F.value&&I.value!==`sending`);async function z(){if(!R.value||!b(N.value))return;I.value=`sending`,await m();let e=await j.submitLead(M.value,{segment:N.value,founders:P.value,source:l.source});I.value=e.ok?`done`:`error`}return(n,a)=>(e(),t(`section`,S,[I.value===`done`?(e(),t(`p`,C,`Merci, vous serez prévenu·e du lancement !`)):(e(),t(`form`,{key:1,class:`lead__form`,novalidate:``,onSubmit:s(z,[`prevent`])},[a[7]||=c(`h3`,{id:`lead-title`,class:`lead__title`},`Créez vos propres quiz : bientôt disponible`,-1),a[8]||=c(`label`,{class:`solo-label`,for:`lead-email`},`Email`,-1),i(c(`input`,{id:`lead-email`,"onUpdate:modelValue":a[0]||=e=>M.value=e,class:`solo-input`,type:`email`,autocomplete:`email`,inputmode:`email`,required:``,"aria-invalid":M.value!==``&&!L.value},null,8,w),[[u,M.value]]),a[9]||=c(`label`,{class:`solo-label`,for:`lead-segment`},`Vous êtes`,-1),i(c(`select`,{id:`lead-segment`,"onUpdate:modelValue":a[1]||=e=>N.value=e,class:`solo-input`,required:``},[a[4]||=c(`option`,{value:``,disabled:``},`Choisir…`,-1),(e(!0),t(g,null,f(r(y),n=>(e(),t(`option`,{key:n,value:n},v(A[n]),9,T))),128))],512),[[d,N.value]]),c(`label`,E,[i(c(`input`,{"onUpdate:modelValue":a[2]||=e=>P.value=e,type:`checkbox`},null,512),[[p,P.value]]),a[5]||=c(`span`,null,`Je veux l'offre fondateurs (prévente)`,-1)]),c(`label`,D,[i(c(`input`,{"onUpdate:modelValue":a[3]||=e=>F.value=e,type:`checkbox`,required:``},null,512),[[p,F.value]]),a[6]||=c(`span`,null,`J'accepte d'être recontacté·e au sujet de HashQuiz`,-1)]),c(`button`,{class:`solo-btn solo-btn--ghost hq-press`,type:`submit`,disabled:!R.value},`Me prévenir`,8,O),I.value===`error`?(e(),t(`p`,k,`Oups, réessayez.`)):o(``,!0)],32))]))}}),[[`__scopeId`,`data-v-16f1c9fd`]]);export{A as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=/^[^@\s]+@[^@\s]+\.[^@\s]+$/,t=[`tech-trainer`,`non-tech-trainer`,`training-org`,`company`,`teacher`],n=e=>t.includes(e);export{t as n,n as r,e as t};
|