diff --git a/apps/admin/.output/nitro.json b/apps/admin/.output/nitro.json new file mode 100644 index 00000000..afe33aae --- /dev/null +++ b/apps/admin/.output/nitro.json @@ -0,0 +1,15 @@ +{ + "date": "2026-02-01T08:38:48.706Z", + "preset": "node-server", + "framework": { + "name": "nitro", + "version": "" + }, + "versions": { + "nitro": "3.0.1-20260131-190432-654aa755" + }, + "commands": { + "preview": "node ./server/index.mjs" + }, + "config": {} +} \ No newline at end of file diff --git a/apps/admin/.output/public/assets/client-ByMMc4SQ.js b/apps/admin/.output/public/assets/client-ByMMc4SQ.js new file mode 100644 index 00000000..5d478a71 --- /dev/null +++ b/apps/admin/.output/public/assets/client-ByMMc4SQ.js @@ -0,0 +1,6 @@ +import{r as j,a as kr,j as He,l as Sr,i as We,c as Ot,d as Oe,e as Pe,s as Pt}from"./main-CMD0s_Sp.js";function st(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Nt(...e){return t=>{let r=!1;const n=e.map(o=>{const i=st(o,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let o=0;o{let{children:i,...s}=n;_t(i)&&typeof Ne=="function"&&(i=Ne(i._payload));const a=j.Children.toArray(i),u=a.find(Or);if(u){const c=u.props.children,d=a.map(m=>m===u?j.Children.count(c)>1?j.Children.only(null):j.isValidElement(c)?c.props.children:null:m);return He.jsx(t,{...s,ref:o,children:j.isValidElement(c)?j.cloneElement(c,void 0,d):null})}return He.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var vr=Ar("Slot");function Cr(e){const t=j.forwardRef((r,n)=>{let{children:o,...i}=r;if(_t(o)&&typeof Ne=="function"&&(o=Ne(o._payload)),j.isValidElement(o)){const s=Nr(o),a=Pr(i,o.props);return o.type!==j.Fragment&&(a.ref=n?Nt(n,s):s),j.cloneElement(o,a)}return j.Children.count(o)>1?j.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Tr=Symbol("radix.slottable");function Or(e){return j.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Tr}function Pr(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...a)=>{const u=i(...a);return o(...a),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function Nr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Ft(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;ttypeof e=="boolean"?`${e}`:e===0?"0":e,at=Lt,_r=(e,t)=>r=>{var n;if(t?.variants==null)return at(e,r?.class,r?.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const d=r?.[c],m=i?.[c];if(d===null)return null;const x=it(d)||it(m);return o[c][x]}),a=r&&Object.entries(r).reduce((c,d)=>{let[m,x]=d;return x===void 0||(c[m]=x),c},{}),u=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((c,d)=>{let{class:m,className:x,...R}=d;return Object.entries(R).every(f=>{let[g,p]=f;return Array.isArray(p)?p.includes({...i,...a}[g]):{...i,...a}[g]===p})?[...c,m,x]:c},[]);return at(e,s,u,r?.class,r?.className)},Fr=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n({classGroupId:e,validator:t}),zt=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),_e="-",lt=[],zr="arbitrary..",jr=e=>{const t=Br(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return Ur(s);const a=s.split(_e),u=a[0]===""&&a.length>1?1:0;return jt(a,u,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const u=n[s],c=r[s];return u?c?Fr(c,u):u:c||lt}return r[s]||lt}}},jt=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const o=e[t],i=r.nextPart.get(o);if(i){const c=jt(e,t+1,i);if(c)return c}const s=r.validators;if(s===null)return;const a=t===0?e.join(_e):e.slice(t).join(_e),u=s.length;for(let c=0;ce.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?zr+n:void 0})(),Br=e=>{const{theme:t,classGroups:r}=e;return Ir(r,t)},Ir=(e,t)=>{const r=zt();for(const n in e){const o=e[n];Ze(o,r,n,t)}return r},Ze=(e,t,r,n)=>{const o=e.length;for(let i=0;i{if(typeof e=="string"){Mr(e,t,r);return}if(typeof e=="function"){qr(e,t,r,n);return}$r(e,t,r,n)},Mr=(e,t,r)=>{const n=e===""?t:Ut(t,e);n.classGroupId=r},qr=(e,t,r,n)=>{if(Vr(e)){Ze(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(Lr(r,e))},$r=(e,t,r,n)=>{const o=Object.entries(e),i=o.length;for(let s=0;s{let r=e;const n=t.split(_e),o=n.length;for(let i=0;i"isThemeGetter"in e&&e.isThemeGetter===!0,Hr=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const o=(i,s)=>{r[i]=s,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(i){let s=r[i];if(s!==void 0)return s;if((s=n[i])!==void 0)return o(i,s),s},set(i,s){i in r?r[i]=s:o(i,s)}}},Ge="!",ct=":",Wr=[],ut=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),Gr=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=o=>{const i=[];let s=0,a=0,u=0,c;const d=o.length;for(let g=0;gu?c-u:void 0;return ut(i,R,x,f)};if(t){const o=t+ct,i=n;n=s=>s.startsWith(o)?i(s.slice(o.length)):ut(Wr,!1,s,void 0,!0)}if(r){const o=n;n=i=>r({className:i,parseClassName:o})}return n},Jr=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let o=[];for(let i=0;i0&&(o.sort(),n.push(...o),o=[]),n.push(s)):o.push(s)}return o.length>0&&(o.sort(),n.push(...o)),n}},Kr=e=>({cache:Hr(e.cacheSize),parseClassName:Gr(e),sortModifiers:Jr(e),...jr(e)}),Xr=/\s+/,Yr=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:i}=t,s=[],a=e.trim().split(Xr);let u="";for(let c=a.length-1;c>=0;c-=1){const d=a[c],{isExternal:m,modifiers:x,hasImportantModifier:R,baseClassName:f,maybePostfixModifierPosition:g}=r(d);if(m){u=d+(u.length>0?" "+u:u);continue}let p=!!g,E=n(p?f.substring(0,g):f);if(!E){if(!p){u=d+(u.length>0?" "+u:u);continue}if(E=n(f),!E){u=d+(u.length>0?" "+u:u);continue}p=!1}const z=x.length===0?"":x.length===1?x[0]:i(x).join(":"),A=R?z+Ge:z,C=A+E;if(s.indexOf(C)>-1)continue;s.push(C);const N=o(E,p);for(let B=0;B0?" "+u:u)}return u},Zr=(...e)=>{let t=0,r,n,o="";for(;t{if(typeof e=="string")return e;let t,r="";for(let n=0;n{let r,n,o,i;const s=u=>{const c=t.reduce((d,m)=>m(d),e());return r=Kr(c),n=r.cache.get,o=r.cache.set,i=a,a(u)},a=u=>{const c=n(u);if(c)return c;const d=Yr(u,r);return o(u,d),d};return i=s,(...u)=>i(Zr(...u))},en=[],P=e=>{const t=r=>r[e]||en;return t.isThemeGetter=!0,t},It=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Dt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,tn=/^\d+\/\d+$/,rn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,nn=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,on=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,sn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,an=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,oe=e=>tn.test(e),S=e=>!!e&&!Number.isNaN(Number(e)),Z=e=>!!e&&Number.isInteger(Number(e)),De=e=>e.endsWith("%")&&S(e.slice(0,-1)),X=e=>rn.test(e),ln=()=>!0,cn=e=>nn.test(e)&&!on.test(e),Mt=()=>!1,un=e=>sn.test(e),dn=e=>an.test(e),fn=e=>!h(e)&&!b(e),pn=e=>ie(e,Vt,Mt),h=e=>It.test(e),ee=e=>ie(e,Ht,cn),Me=e=>ie(e,yn,S),dt=e=>ie(e,qt,Mt),mn=e=>ie(e,$t,dn),Ee=e=>ie(e,Wt,un),b=e=>Dt.test(e),pe=e=>ae(e,Ht),hn=e=>ae(e,wn),ft=e=>ae(e,qt),bn=e=>ae(e,Vt),gn=e=>ae(e,$t),Re=e=>ae(e,Wt,!0),ie=(e,t,r)=>{const n=It.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},ae=(e,t,r=!1)=>{const n=Dt.exec(e);return n?n[1]?t(n[1]):r:!1},qt=e=>e==="position"||e==="percentage",$t=e=>e==="image"||e==="url",Vt=e=>e==="length"||e==="size"||e==="bg-size",Ht=e=>e==="length",yn=e=>e==="number",wn=e=>e==="family-name",Wt=e=>e==="shadow",xn=()=>{const e=P("color"),t=P("font"),r=P("text"),n=P("font-weight"),o=P("tracking"),i=P("leading"),s=P("breakpoint"),a=P("container"),u=P("spacing"),c=P("radius"),d=P("shadow"),m=P("inset-shadow"),x=P("text-shadow"),R=P("drop-shadow"),f=P("blur"),g=P("perspective"),p=P("aspect"),E=P("ease"),z=P("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],N=()=>[...C(),b,h],B=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],w=()=>[b,h,u],I=()=>[oe,"full","auto",...w()],ue=()=>[Z,"none","subgrid",b,h],de=()=>["auto",{span:["full",Z,b,h]},Z,b,h],J=()=>[Z,"auto",b,h],Y=()=>["auto","min","max","fr",b,h],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],K=()=>["start","end","center","stretch","center-safe","end-safe"],T=()=>["auto",...w()],H=()=>[oe,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],y=()=>[e,b,h],fe=()=>[...C(),ft,dt,{position:[b,h]}],we=()=>["no-repeat",{repeat:["","x","y","space","round"]}],$=()=>["auto","cover","contain",bn,pn,{size:[b,h]}],W=()=>[De,pe,ee],O=()=>["","none","full",c,b,h],F=()=>["",S,pe,ee],Q=()=>["solid","dashed","dotted","double"],nt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],L=()=>[S,De,ft,dt],ot=()=>["","none",f,b,h],xe=()=>["none",S,b,h],ke=()=>["none",S,b,h],Ie=()=>[S,b,h],Se=()=>[oe,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[X],breakpoint:[X],color:[ln],container:[X],"drop-shadow":[X],ease:["in","out","in-out"],font:[fn],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[X],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[X],shadow:[X],spacing:["px",S],text:[X],"text-shadow":[X],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",oe,h,b,p]}],container:["container"],columns:[{columns:[S,h,b,a]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:N()}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{start:I()}],end:[{end:I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[Z,"auto",b,h]}],basis:[{basis:[oe,"full","auto",a,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[S,oe,"auto","initial","none",h]}],grow:[{grow:["",S,b,h]}],shrink:[{shrink:["",S,b,h]}],order:[{order:[Z,"first","last","none",b,h]}],"grid-cols":[{"grid-cols":ue()}],"col-start-end":[{col:de()}],"col-start":[{"col-start":J()}],"col-end":[{"col-end":J()}],"grid-rows":[{"grid-rows":ue()}],"row-start-end":[{row:de()}],"row-start":[{"row-start":J()}],"row-end":[{"row-end":J()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Y()}],"auto-rows":[{"auto-rows":Y()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...K(),"normal"]}],"justify-self":[{"justify-self":["auto",...K()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...K(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...K(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...K(),"baseline"]}],"place-self":[{"place-self":["auto",...K()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:T()}],mx:[{mx:T()}],my:[{my:T()}],ms:[{ms:T()}],me:[{me:T()}],mt:[{mt:T()}],mr:[{mr:T()}],mb:[{mb:T()}],ml:[{ml:T()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:H()}],w:[{w:[a,"screen",...H()]}],"min-w":[{"min-w":[a,"screen","none",...H()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...H()]}],h:[{h:["screen","lh",...H()]}],"min-h":[{"min-h":["screen","lh","none",...H()]}],"max-h":[{"max-h":["screen","lh",...H()]}],"font-size":[{text:["base",r,pe,ee]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,b,Me]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",De,h]}],"font-family":[{font:[hn,h,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,b,h]}],"line-clamp":[{"line-clamp":[S,"none",b,Me]}],leading:[{leading:[i,...w()]}],"list-image":[{"list-image":["none",b,h]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",b,h]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:y()}],"text-color":[{text:y()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[S,"from-font","auto",b,ee]}],"text-decoration-color":[{decoration:y()}],"underline-offset":[{"underline-offset":[S,"auto",b,h]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",b,h]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",b,h]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:fe()}],"bg-repeat":[{bg:we()}],"bg-size":[{bg:$()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Z,b,h],radial:["",b,h],conic:[Z,b,h]},gn,mn]}],"bg-color":[{bg:y()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:y()}],"gradient-via":[{via:y()}],"gradient-to":[{to:y()}],rounded:[{rounded:O()}],"rounded-s":[{"rounded-s":O()}],"rounded-e":[{"rounded-e":O()}],"rounded-t":[{"rounded-t":O()}],"rounded-r":[{"rounded-r":O()}],"rounded-b":[{"rounded-b":O()}],"rounded-l":[{"rounded-l":O()}],"rounded-ss":[{"rounded-ss":O()}],"rounded-se":[{"rounded-se":O()}],"rounded-ee":[{"rounded-ee":O()}],"rounded-es":[{"rounded-es":O()}],"rounded-tl":[{"rounded-tl":O()}],"rounded-tr":[{"rounded-tr":O()}],"rounded-br":[{"rounded-br":O()}],"rounded-bl":[{"rounded-bl":O()}],"border-w":[{border:F()}],"border-w-x":[{"border-x":F()}],"border-w-y":[{"border-y":F()}],"border-w-s":[{"border-s":F()}],"border-w-e":[{"border-e":F()}],"border-w-t":[{"border-t":F()}],"border-w-r":[{"border-r":F()}],"border-w-b":[{"border-b":F()}],"border-w-l":[{"border-l":F()}],"divide-x":[{"divide-x":F()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":F()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"hidden","none"]}],"border-color":[{border:y()}],"border-color-x":[{"border-x":y()}],"border-color-y":[{"border-y":y()}],"border-color-s":[{"border-s":y()}],"border-color-e":[{"border-e":y()}],"border-color-t":[{"border-t":y()}],"border-color-r":[{"border-r":y()}],"border-color-b":[{"border-b":y()}],"border-color-l":[{"border-l":y()}],"divide-color":[{divide:y()}],"outline-style":[{outline:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[S,b,h]}],"outline-w":[{outline:["",S,pe,ee]}],"outline-color":[{outline:y()}],shadow:[{shadow:["","none",d,Re,Ee]}],"shadow-color":[{shadow:y()}],"inset-shadow":[{"inset-shadow":["none",m,Re,Ee]}],"inset-shadow-color":[{"inset-shadow":y()}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:y()}],"ring-offset-w":[{"ring-offset":[S,ee]}],"ring-offset-color":[{"ring-offset":y()}],"inset-ring-w":[{"inset-ring":F()}],"inset-ring-color":[{"inset-ring":y()}],"text-shadow":[{"text-shadow":["none",x,Re,Ee]}],"text-shadow-color":[{"text-shadow":y()}],opacity:[{opacity:[S,b,h]}],"mix-blend":[{"mix-blend":[...nt(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":nt()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[S]}],"mask-image-linear-from-pos":[{"mask-linear-from":L()}],"mask-image-linear-to-pos":[{"mask-linear-to":L()}],"mask-image-linear-from-color":[{"mask-linear-from":y()}],"mask-image-linear-to-color":[{"mask-linear-to":y()}],"mask-image-t-from-pos":[{"mask-t-from":L()}],"mask-image-t-to-pos":[{"mask-t-to":L()}],"mask-image-t-from-color":[{"mask-t-from":y()}],"mask-image-t-to-color":[{"mask-t-to":y()}],"mask-image-r-from-pos":[{"mask-r-from":L()}],"mask-image-r-to-pos":[{"mask-r-to":L()}],"mask-image-r-from-color":[{"mask-r-from":y()}],"mask-image-r-to-color":[{"mask-r-to":y()}],"mask-image-b-from-pos":[{"mask-b-from":L()}],"mask-image-b-to-pos":[{"mask-b-to":L()}],"mask-image-b-from-color":[{"mask-b-from":y()}],"mask-image-b-to-color":[{"mask-b-to":y()}],"mask-image-l-from-pos":[{"mask-l-from":L()}],"mask-image-l-to-pos":[{"mask-l-to":L()}],"mask-image-l-from-color":[{"mask-l-from":y()}],"mask-image-l-to-color":[{"mask-l-to":y()}],"mask-image-x-from-pos":[{"mask-x-from":L()}],"mask-image-x-to-pos":[{"mask-x-to":L()}],"mask-image-x-from-color":[{"mask-x-from":y()}],"mask-image-x-to-color":[{"mask-x-to":y()}],"mask-image-y-from-pos":[{"mask-y-from":L()}],"mask-image-y-to-pos":[{"mask-y-to":L()}],"mask-image-y-from-color":[{"mask-y-from":y()}],"mask-image-y-to-color":[{"mask-y-to":y()}],"mask-image-radial":[{"mask-radial":[b,h]}],"mask-image-radial-from-pos":[{"mask-radial-from":L()}],"mask-image-radial-to-pos":[{"mask-radial-to":L()}],"mask-image-radial-from-color":[{"mask-radial-from":y()}],"mask-image-radial-to-color":[{"mask-radial-to":y()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[S]}],"mask-image-conic-from-pos":[{"mask-conic-from":L()}],"mask-image-conic-to-pos":[{"mask-conic-to":L()}],"mask-image-conic-from-color":[{"mask-conic-from":y()}],"mask-image-conic-to-color":[{"mask-conic-to":y()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:fe()}],"mask-repeat":[{mask:we()}],"mask-size":[{mask:$()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",b,h]}],filter:[{filter:["","none",b,h]}],blur:[{blur:ot()}],brightness:[{brightness:[S,b,h]}],contrast:[{contrast:[S,b,h]}],"drop-shadow":[{"drop-shadow":["","none",R,Re,Ee]}],"drop-shadow-color":[{"drop-shadow":y()}],grayscale:[{grayscale:["",S,b,h]}],"hue-rotate":[{"hue-rotate":[S,b,h]}],invert:[{invert:["",S,b,h]}],saturate:[{saturate:[S,b,h]}],sepia:[{sepia:["",S,b,h]}],"backdrop-filter":[{"backdrop-filter":["","none",b,h]}],"backdrop-blur":[{"backdrop-blur":ot()}],"backdrop-brightness":[{"backdrop-brightness":[S,b,h]}],"backdrop-contrast":[{"backdrop-contrast":[S,b,h]}],"backdrop-grayscale":[{"backdrop-grayscale":["",S,b,h]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[S,b,h]}],"backdrop-invert":[{"backdrop-invert":["",S,b,h]}],"backdrop-opacity":[{"backdrop-opacity":[S,b,h]}],"backdrop-saturate":[{"backdrop-saturate":[S,b,h]}],"backdrop-sepia":[{"backdrop-sepia":["",S,b,h]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",b,h]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[S,"initial",b,h]}],ease:[{ease:["linear","initial",E,b,h]}],delay:[{delay:[S,b,h]}],animate:[{animate:["none",z,b,h]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,b,h]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:xe()}],"rotate-x":[{"rotate-x":xe()}],"rotate-y":[{"rotate-y":xe()}],"rotate-z":[{"rotate-z":xe()}],scale:[{scale:ke()}],"scale-x":[{"scale-x":ke()}],"scale-y":[{"scale-y":ke()}],"scale-z":[{"scale-z":ke()}],"scale-3d":["scale-3d"],skew:[{skew:Ie()}],"skew-x":[{"skew-x":Ie()}],"skew-y":[{"skew-y":Ie()}],transform:[{transform:[b,h,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Se()}],"translate-x":[{"translate-x":Se()}],"translate-y":[{"translate-y":Se()}],"translate-z":[{"translate-z":Se()}],"translate-none":["translate-none"],accent:[{accent:y()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:y()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",b,h]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",b,h]}],fill:[{fill:["none",...y()]}],"stroke-w":[{stroke:[S,pe,ee,Me]}],stroke:[{stroke:["none",...y()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},kn=Qr(xn);function Sn(...e){return kn(Lt(e))}const En=_r("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Rn=j.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},i)=>{const s=n?vr:"button";return He.jsx(s,{className:Sn(En({variant:t,size:r,className:e})),ref:i,...o})});Rn.displayName="Button";function Gt(e,t){return function(){return e.apply(t,arguments)}}const{toString:An}=Object.prototype,{getPrototypeOf:Qe}=Object,{iterator:Le,toStringTag:Jt}=Symbol,ze=(e=>t=>{const r=An.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),V=e=>(e=e.toLowerCase(),t=>ze(t)===e),je=e=>t=>typeof t===e,{isArray:le}=Array,se=je("undefined");function he(e){return e!==null&&!se(e)&&e.constructor!==null&&!se(e.constructor)&&D(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Kt=V("ArrayBuffer");function vn(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Kt(e.buffer),t}const Cn=je("string"),D=je("function"),Xt=je("number"),be=e=>e!==null&&typeof e=="object",Tn=e=>e===!0||e===!1,ve=e=>{if(ze(e)!=="object")return!1;const t=Qe(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Jt in e)&&!(Le in e)},On=e=>{if(!be(e)||he(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Pn=V("Date"),Nn=V("File"),_n=V("Blob"),Fn=V("FileList"),Ln=e=>be(e)&&D(e.pipe),zn=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||D(e.append)&&((t=ze(e))==="formdata"||t==="object"&&D(e.toString)&&e.toString()==="[object FormData]"))},jn=V("URLSearchParams"),[Un,Bn,In,Dn]=["ReadableStream","Request","Response","Headers"].map(V),Mn=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ge(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),le(e))for(n=0,o=e.length;n0;)if(o=r[n],t===o.toLowerCase())return o;return null}const te=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Zt=e=>!se(e)&&e!==te;function Je(){const{caseless:e,skipUndefined:t}=Zt(this)&&this||{},r={},n=(o,i)=>{const s=e&&Yt(r,i)||i;ve(r[s])&&ve(o)?r[s]=Je(r[s],o):ve(o)?r[s]=Je({},o):le(o)?r[s]=o.slice():(!t||!se(o))&&(r[s]=o)};for(let o=0,i=arguments.length;o(ge(t,(o,i)=>{r&&D(o)?e[i]=Gt(o,r):e[i]=o},{allOwnKeys:n}),e),$n=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Vn=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},Hn=(e,t,r,n)=>{let o,i,s;const a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!n||n(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=r!==!1&&Qe(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Wn=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},Gn=e=>{if(!e)return null;if(le(e))return e;let t=e.length;if(!Xt(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Jn=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Qe(Uint8Array)),Kn=(e,t)=>{const n=(e&&e[Le]).call(e);let o;for(;(o=n.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},Xn=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Yn=V("HTMLFormElement"),Zn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),pt=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Qn=V("RegExp"),Qt=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};ge(r,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(n[i]=s||o)}),Object.defineProperties(e,n)},eo=e=>{Qt(e,(t,r)=>{if(D(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(D(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},to=(e,t)=>{const r={},n=o=>{o.forEach(i=>{r[i]=!0})};return le(e)?n(e):n(String(e).split(t)),r},ro=()=>{},no=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function oo(e){return!!(e&&D(e.append)&&e[Jt]==="FormData"&&e[Le])}const so=e=>{const t=new Array(10),r=(n,o)=>{if(be(n)){if(t.indexOf(n)>=0)return;if(he(n))return n;if(!("toJSON"in n)){t[o]=n;const i=le(n)?[]:{};return ge(n,(s,a)=>{const u=r(s,o+1);!se(u)&&(i[a]=u)}),t[o]=void 0,i}}return n};return r(e,0)},io=V("AsyncFunction"),ao=e=>e&&(be(e)||D(e))&&D(e.then)&&D(e.catch),er=((e,t)=>e?setImmediate:t?((r,n)=>(te.addEventListener("message",({source:o,data:i})=>{o===te&&i===r&&n.length&&n.shift()()},!1),o=>{n.push(o),te.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",D(te.postMessage)),lo=typeof queueMicrotask<"u"?queueMicrotask.bind(te):typeof process<"u"&&process.nextTick||er,co=e=>e!=null&&D(e[Le]),l={isArray:le,isArrayBuffer:Kt,isBuffer:he,isFormData:zn,isArrayBufferView:vn,isString:Cn,isNumber:Xt,isBoolean:Tn,isObject:be,isPlainObject:ve,isEmptyObject:On,isReadableStream:Un,isRequest:Bn,isResponse:In,isHeaders:Dn,isUndefined:se,isDate:Pn,isFile:Nn,isBlob:_n,isRegExp:Qn,isFunction:D,isStream:Ln,isURLSearchParams:jn,isTypedArray:Jn,isFileList:Fn,forEach:ge,merge:Je,extend:qn,trim:Mn,stripBOM:$n,inherits:Vn,toFlatObject:Hn,kindOf:ze,kindOfTest:V,endsWith:Wn,toArray:Gn,forEachEntry:Kn,matchAll:Xn,isHTMLForm:Yn,hasOwnProperty:pt,hasOwnProp:pt,reduceDescriptors:Qt,freezeMethods:eo,toObjectSet:to,toCamelCase:Zn,noop:ro,toFiniteNumber:no,findKey:Yt,global:te,isContextDefined:Zt,isSpecCompliantForm:oo,toJSONObject:so,isAsyncFn:io,isThenable:ao,setImmediate:er,asap:lo,isIterable:co};function k(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}l.inherits(k,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:l.toJSONObject(this.config),code:this.code,status:this.status}}});const tr=k.prototype,rr={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{rr[e]={value:e}});Object.defineProperties(k,rr);Object.defineProperty(tr,"isAxiosError",{value:!0});k.from=(e,t,r,n,o,i)=>{const s=Object.create(tr);l.toFlatObject(e,s,function(d){return d!==Error.prototype},c=>c!=="isAxiosError");const a=e&&e.message?e.message:"Error",u=t==null&&e?e.code:t;return k.call(s,a,u,r,n,o),e&&s.cause==null&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};const uo=null;function Ke(e){return l.isPlainObject(e)||l.isArray(e)}function nr(e){return l.endsWith(e,"[]")?e.slice(0,-2):e}function mt(e,t,r){return e?e.concat(t).map(function(o,i){return o=nr(o),!r&&i?"["+o+"]":o}).join(r?".":""):t}function fo(e){return l.isArray(e)&&!e.some(Ke)}const po=l.toFlatObject(l,{},null,function(t){return/^is[A-Z]/.test(t)});function Ue(e,t,r){if(!l.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=l.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,p){return!l.isUndefined(p[g])});const n=r.metaTokens,o=r.visitor||d,i=r.dots,s=r.indexes,u=(r.Blob||typeof Blob<"u"&&Blob)&&l.isSpecCompliantForm(t);if(!l.isFunction(o))throw new TypeError("visitor must be a function");function c(f){if(f===null)return"";if(l.isDate(f))return f.toISOString();if(l.isBoolean(f))return f.toString();if(!u&&l.isBlob(f))throw new k("Blob is not supported. Use a Buffer instead.");return l.isArrayBuffer(f)||l.isTypedArray(f)?u&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function d(f,g,p){let E=f;if(f&&!p&&typeof f=="object"){if(l.endsWith(g,"{}"))g=n?g:g.slice(0,-2),f=JSON.stringify(f);else if(l.isArray(f)&&fo(f)||(l.isFileList(f)||l.endsWith(g,"[]"))&&(E=l.toArray(f)))return g=nr(g),E.forEach(function(A,C){!(l.isUndefined(A)||A===null)&&t.append(s===!0?mt([g],C,i):s===null?g:g+"[]",c(A))}),!1}return Ke(f)?!0:(t.append(mt(p,g,i),c(f)),!1)}const m=[],x=Object.assign(po,{defaultVisitor:d,convertValue:c,isVisitable:Ke});function R(f,g){if(!l.isUndefined(f)){if(m.indexOf(f)!==-1)throw Error("Circular reference detected in "+g.join("."));m.push(f),l.forEach(f,function(E,z){(!(l.isUndefined(E)||E===null)&&o.call(t,E,l.isString(z)?z.trim():z,g,x))===!0&&R(E,g?g.concat(z):[z])}),m.pop()}}if(!l.isObject(e))throw new TypeError("data must be an object");return R(e),t}function ht(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function et(e,t){this._pairs=[],e&&Ue(e,this,t)}const or=et.prototype;or.append=function(t,r){this._pairs.push([t,r])};or.toString=function(t){const r=t?function(n){return t.call(this,n,ht)}:ht;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function mo(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function sr(e,t,r){if(!t)return e;const n=r&&r.encode||mo;l.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let i;if(o?i=o(t,r):i=l.isURLSearchParams(t)?t.toString():new et(t,r).toString(n),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class bt{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){l.forEach(this.handlers,function(n){n!==null&&t(n)})}}const ir={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ho=typeof URLSearchParams<"u"?URLSearchParams:et,bo=typeof FormData<"u"?FormData:null,go=typeof Blob<"u"?Blob:null,yo={isBrowser:!0,classes:{URLSearchParams:ho,FormData:bo,Blob:go},protocols:["http","https","file","blob","url","data"]},tt=typeof window<"u"&&typeof document<"u",Xe=typeof navigator=="object"&&navigator||void 0,wo=tt&&(!Xe||["ReactNative","NativeScript","NS"].indexOf(Xe.product)<0),xo=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",ko=tt&&window.location.href||"http://localhost",So=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:tt,hasStandardBrowserEnv:wo,hasStandardBrowserWebWorkerEnv:xo,navigator:Xe,origin:ko},Symbol.toStringTag,{value:"Module"})),U={...So,...yo};function Eo(e,t){return Ue(e,new U.classes.URLSearchParams,{visitor:function(r,n,o,i){return U.isNode&&l.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function Ro(e){return l.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Ao(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n=r.length;return s=!s&&l.isArray(o)?o.length:s,u?(l.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!a):((!o[s]||!l.isObject(o[s]))&&(o[s]=[]),t(r,n,o[s],i)&&l.isArray(o[s])&&(o[s]=Ao(o[s])),!a)}if(l.isFormData(e)&&l.isFunction(e.entries)){const r={};return l.forEachEntry(e,(n,o)=>{t(Ro(n),o,r,0)}),r}return null}function vo(e,t,r){if(l.isString(e))try{return(t||JSON.parse)(e),l.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const ye={transitional:ir,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,i=l.isObject(t);if(i&&l.isHTMLForm(t)&&(t=new FormData(t)),l.isFormData(t))return o?JSON.stringify(ar(t)):t;if(l.isArrayBuffer(t)||l.isBuffer(t)||l.isStream(t)||l.isFile(t)||l.isBlob(t)||l.isReadableStream(t))return t;if(l.isArrayBufferView(t))return t.buffer;if(l.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Eo(t,this.formSerializer).toString();if((a=l.isFileList(t))||n.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return Ue(a?{"files[]":t}:t,u&&new u,this.formSerializer)}}return i||o?(r.setContentType("application/json",!1),vo(t)):t}],transformResponse:[function(t){const r=this.transitional||ye.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(l.isResponse(t)||l.isReadableStream(t))return t;if(t&&l.isString(t)&&(n&&!this.responseType||o)){const s=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(a){if(s)throw a.name==="SyntaxError"?k.from(a,k.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:U.classes.FormData,Blob:U.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};l.forEach(["delete","get","head","post","put","patch"],e=>{ye.headers[e]={}});const Co=l.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),To=e=>{const t={};let r,n,o;return e&&e.split(` +`).forEach(function(s){o=s.indexOf(":"),r=s.substring(0,o).trim().toLowerCase(),n=s.substring(o+1).trim(),!(!r||t[r]&&Co[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},gt=Symbol("internals");function me(e){return e&&String(e).trim().toLowerCase()}function Ce(e){return e===!1||e==null?e:l.isArray(e)?e.map(Ce):String(e)}function Oo(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const Po=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function qe(e,t,r,n,o){if(l.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!l.isString(t)){if(l.isString(n))return t.indexOf(n)!==-1;if(l.isRegExp(n))return n.test(t)}}function No(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function _o(e,t){const r=l.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,i,s){return this[n].call(this,t,o,i,s)},configurable:!0})})}let M=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function i(a,u,c){const d=me(u);if(!d)throw new Error("header name must be a non-empty string");const m=l.findKey(o,d);(!m||o[m]===void 0||c===!0||c===void 0&&o[m]!==!1)&&(o[m||u]=Ce(a))}const s=(a,u)=>l.forEach(a,(c,d)=>i(c,d,u));if(l.isPlainObject(t)||t instanceof this.constructor)s(t,r);else if(l.isString(t)&&(t=t.trim())&&!Po(t))s(To(t),r);else if(l.isObject(t)&&l.isIterable(t)){let a={},u,c;for(const d of t){if(!l.isArray(d))throw TypeError("Object iterator must return a key-value pair");a[c=d[0]]=(u=a[c])?l.isArray(u)?[...u,d[1]]:[u,d[1]]:d[1]}s(a,r)}else t!=null&&i(r,t,n);return this}get(t,r){if(t=me(t),t){const n=l.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return Oo(o);if(l.isFunction(r))return r.call(this,o,n);if(l.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=me(t),t){const n=l.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||qe(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function i(s){if(s=me(s),s){const a=l.findKey(n,s);a&&(!r||qe(n,n[a],a,r))&&(delete n[a],o=!0)}}return l.isArray(t)?t.forEach(i):i(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const i=r[n];(!t||qe(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const r=this,n={};return l.forEach(this,(o,i)=>{const s=l.findKey(n,i);if(s){r[s]=Ce(o),delete r[i];return}const a=t?No(i):String(i).trim();a!==i&&delete r[i],r[a]=Ce(o),n[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return l.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&l.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(` +`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[gt]=this[gt]={accessors:{}}).accessors,o=this.prototype;function i(s){const a=me(s);n[a]||(_o(o,s),n[a]=!0)}return l.isArray(t)?t.forEach(i):i(t),this}};M.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);l.reduceDescriptors(M.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});l.freezeMethods(M);function $e(e,t){const r=this||ye,n=t||r,o=M.from(n.headers);let i=n.data;return l.forEach(e,function(a){i=a.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function lr(e){return!!(e&&e.__CANCEL__)}function ce(e,t,r){k.call(this,e??"canceled",k.ERR_CANCELED,t,r),this.name="CanceledError"}l.inherits(ce,k,{__CANCEL__:!0});function cr(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new k("Request failed with status code "+r.status,[k.ERR_BAD_REQUEST,k.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Fo(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Lo(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(u){const c=Date.now(),d=n[i];s||(s=c),r[o]=u,n[o]=c;let m=i,x=0;for(;m!==o;)x+=r[m++],m=m%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),c-s{r=d,o=null,i&&(clearTimeout(i),i=null),e(...c)};return[(...c)=>{const d=Date.now(),m=d-r;m>=n?s(c,d):(o=c,i||(i=setTimeout(()=>{i=null,s(o)},n-m)))},()=>o&&s(o)]}const Fe=(e,t,r=3)=>{let n=0;const o=Lo(50,250);return zo(i=>{const s=i.loaded,a=i.lengthComputable?i.total:void 0,u=s-n,c=o(u),d=s<=a;n=s;const m={loaded:s,total:a,progress:a?s/a:void 0,bytes:u,rate:c||void 0,estimated:c&&a&&d?(a-s)/c:void 0,event:i,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(m)},r)},yt=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},wt=e=>(...t)=>l.asap(()=>e(...t)),jo=U.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,U.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(U.origin),U.navigator&&/(msie|trident)/i.test(U.navigator.userAgent)):()=>!0,Uo=U.hasStandardBrowserEnv?{write(e,t,r,n,o,i,s){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];l.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),l.isString(n)&&a.push(`path=${n}`),l.isString(o)&&a.push(`domain=${o}`),i===!0&&a.push("secure"),l.isString(s)&&a.push(`SameSite=${s}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Bo(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Io(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ur(e,t,r){let n=!Bo(t);return e&&(n||r==!1)?Io(e,t):t}const xt=e=>e instanceof M?{...e}:e;function ne(e,t){t=t||{};const r={};function n(c,d,m,x){return l.isPlainObject(c)&&l.isPlainObject(d)?l.merge.call({caseless:x},c,d):l.isPlainObject(d)?l.merge({},d):l.isArray(d)?d.slice():d}function o(c,d,m,x){if(l.isUndefined(d)){if(!l.isUndefined(c))return n(void 0,c,m,x)}else return n(c,d,m,x)}function i(c,d){if(!l.isUndefined(d))return n(void 0,d)}function s(c,d){if(l.isUndefined(d)){if(!l.isUndefined(c))return n(void 0,c)}else return n(void 0,d)}function a(c,d,m){if(m in t)return n(c,d);if(m in e)return n(void 0,c)}const u={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(c,d,m)=>o(xt(c),xt(d),m,!0)};return l.forEach(Object.keys({...e,...t}),function(d){const m=u[d]||o,x=m(e[d],t[d],d);l.isUndefined(x)&&m!==a||(r[d]=x)}),r}const dr=e=>{const t=ne({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=t;if(t.headers=s=M.from(s),t.url=sr(ur(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),l.isFormData(r)){if(U.hasStandardBrowserEnv||U.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(l.isFunction(r.getHeaders)){const u=r.getHeaders(),c=["content-type","content-length"];Object.entries(u).forEach(([d,m])=>{c.includes(d.toLowerCase())&&s.set(d,m)})}}if(U.hasStandardBrowserEnv&&(n&&l.isFunction(n)&&(n=n(t)),n||n!==!1&&jo(t.url))){const u=o&&i&&Uo.read(i);u&&s.set(o,u)}return t},Do=typeof XMLHttpRequest<"u",Mo=Do&&function(e){return new Promise(function(r,n){const o=dr(e);let i=o.data;const s=M.from(o.headers).normalize();let{responseType:a,onUploadProgress:u,onDownloadProgress:c}=o,d,m,x,R,f;function g(){R&&R(),f&&f(),o.cancelToken&&o.cancelToken.unsubscribe(d),o.signal&&o.signal.removeEventListener("abort",d)}let p=new XMLHttpRequest;p.open(o.method.toUpperCase(),o.url,!0),p.timeout=o.timeout;function E(){if(!p)return;const A=M.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),N={data:!a||a==="text"||a==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:A,config:e,request:p};cr(function(_){r(_),g()},function(_){n(_),g()},N),p=null}"onloadend"in p?p.onloadend=E:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(E)},p.onabort=function(){p&&(n(new k("Request aborted",k.ECONNABORTED,e,p)),p=null)},p.onerror=function(C){const N=C&&C.message?C.message:"Network Error",B=new k(N,k.ERR_NETWORK,e,p);B.event=C||null,n(B),p=null},p.ontimeout=function(){let C=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const N=o.transitional||ir;o.timeoutErrorMessage&&(C=o.timeoutErrorMessage),n(new k(C,N.clarifyTimeoutError?k.ETIMEDOUT:k.ECONNABORTED,e,p)),p=null},i===void 0&&s.setContentType(null),"setRequestHeader"in p&&l.forEach(s.toJSON(),function(C,N){p.setRequestHeader(N,C)}),l.isUndefined(o.withCredentials)||(p.withCredentials=!!o.withCredentials),a&&a!=="json"&&(p.responseType=o.responseType),c&&([x,f]=Fe(c,!0),p.addEventListener("progress",x)),u&&p.upload&&([m,R]=Fe(u),p.upload.addEventListener("progress",m),p.upload.addEventListener("loadend",R)),(o.cancelToken||o.signal)&&(d=A=>{p&&(n(!A||A.type?new ce(null,e,p):A),p.abort(),p=null)},o.cancelToken&&o.cancelToken.subscribe(d),o.signal&&(o.signal.aborted?d():o.signal.addEventListener("abort",d)));const z=Fo(o.url);if(z&&U.protocols.indexOf(z)===-1){n(new k("Unsupported protocol "+z+":",k.ERR_BAD_REQUEST,e));return}p.send(i||null)})},qo=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const i=function(c){if(!o){o=!0,a();const d=c instanceof Error?c:this.reason;n.abort(d instanceof k?d:new ce(d instanceof Error?d.message:d))}};let s=t&&setTimeout(()=>{s=null,i(new k(`timeout ${t} of ms exceeded`,k.ETIMEDOUT))},t);const a=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(i):c.removeEventListener("abort",i)}),e=null)};e.forEach(c=>c.addEventListener("abort",i));const{signal:u}=n;return u.unsubscribe=()=>l.asap(a),u}},$o=function*(e,t){let r=e.byteLength;if(r{const o=Vo(e,t);let i=0,s,a=u=>{s||(s=!0,n&&n(u))};return new ReadableStream({async pull(u){try{const{done:c,value:d}=await o.next();if(c){a(),u.close();return}let m=d.byteLength;if(r){let x=i+=m;r(x)}u.enqueue(new Uint8Array(d))}catch(c){throw a(c),c}},cancel(u){return a(u),o.return()}},{highWaterMark:2})},St=64*1024,{isFunction:Ae}=l,Wo=(({Request:e,Response:t})=>({Request:e,Response:t}))(l.global),{ReadableStream:Et,TextEncoder:Rt}=l.global,At=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Go=e=>{e=l.merge.call({skipUndefined:!0},Wo,e);const{fetch:t,Request:r,Response:n}=e,o=t?Ae(t):typeof fetch=="function",i=Ae(r),s=Ae(n);if(!o)return!1;const a=o&&Ae(Et),u=o&&(typeof Rt=="function"?(f=>g=>f.encode(g))(new Rt):async f=>new Uint8Array(await new r(f).arrayBuffer())),c=i&&a&&At(()=>{let f=!1;const g=new r(U.origin,{body:new Et,method:"POST",get duplex(){return f=!0,"half"}}).headers.has("Content-Type");return f&&!g}),d=s&&a&&At(()=>l.isReadableStream(new n("").body)),m={stream:d&&(f=>f.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!m[f]&&(m[f]=(g,p)=>{let E=g&&g[f];if(E)return E.call(g);throw new k(`Response type '${f}' is not supported`,k.ERR_NOT_SUPPORT,p)})});const x=async f=>{if(f==null)return 0;if(l.isBlob(f))return f.size;if(l.isSpecCompliantForm(f))return(await new r(U.origin,{method:"POST",body:f}).arrayBuffer()).byteLength;if(l.isArrayBufferView(f)||l.isArrayBuffer(f))return f.byteLength;if(l.isURLSearchParams(f)&&(f=f+""),l.isString(f))return(await u(f)).byteLength},R=async(f,g)=>{const p=l.toFiniteNumber(f.getContentLength());return p??x(g)};return async f=>{let{url:g,method:p,data:E,signal:z,cancelToken:A,timeout:C,onDownloadProgress:N,onUploadProgress:B,responseType:_,headers:w,withCredentials:I="same-origin",fetchOptions:ue}=dr(f),de=t||fetch;_=_?(_+"").toLowerCase():"text";let J=qo([z,A&&A.toAbortSignal()],C),Y=null;const q=J&&J.unsubscribe&&(()=>{J.unsubscribe()});let K;try{if(B&&c&&p!=="get"&&p!=="head"&&(K=await R(w,E))!==0){let $=new r(g,{method:"POST",body:E,duplex:"half"}),W;if(l.isFormData(E)&&(W=$.headers.get("content-type"))&&w.setContentType(W),$.body){const[O,F]=yt(K,Fe(wt(B)));E=kt($.body,St,O,F)}}l.isString(I)||(I=I?"include":"omit");const T=i&&"credentials"in r.prototype,H={...ue,signal:J,method:p.toUpperCase(),headers:w.normalize().toJSON(),body:E,duplex:"half",credentials:T?I:void 0};Y=i&&new r(g,H);let y=await(i?de(Y,ue):de(g,H));const fe=d&&(_==="stream"||_==="response");if(d&&(N||fe&&q)){const $={};["status","statusText","headers"].forEach(Q=>{$[Q]=y[Q]});const W=l.toFiniteNumber(y.headers.get("content-length")),[O,F]=N&&yt(W,Fe(wt(N),!0))||[];y=new n(kt(y.body,St,O,()=>{F&&F(),q&&q()}),$)}_=_||"text";let we=await m[l.findKey(m,_)||"text"](y,f);return!fe&&q&&q(),await new Promise(($,W)=>{cr($,W,{data:we,headers:M.from(y.headers),status:y.status,statusText:y.statusText,config:f,request:Y})})}catch(T){throw q&&q(),T&&T.name==="TypeError"&&/Load failed|fetch/i.test(T.message)?Object.assign(new k("Network Error",k.ERR_NETWORK,f,Y),{cause:T.cause||T}):k.from(T,T&&T.code,f,Y)}}},Jo=new Map,fr=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,i=[n,o,r];let s=i.length,a=s,u,c,d=Jo;for(;a--;)u=i[a],c=d.get(u),c===void 0&&d.set(u,c=a?new Map:Go(t)),d=c;return c};fr();const rt={http:uo,xhr:Mo,fetch:{get:fr}};l.forEach(rt,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const vt=e=>`- ${e}`,Ko=e=>l.isFunction(e)||e===null||e===!1;function Xo(e,t){e=l.isArray(e)?e:[e];const{length:r}=e;let n,o;const i={};for(let s=0;s`adapter ${u} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=r?s.length>1?`since : +`+s.map(vt).join(` +`):" "+vt(s[0]):"as no adapter specified";throw new k("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o}const pr={getAdapter:Xo,adapters:rt};function Ve(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ce(null,e)}function Ct(e){return Ve(e),e.headers=M.from(e.headers),e.data=$e.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),pr.getAdapter(e.adapter||ye.adapter,e)(e).then(function(n){return Ve(e),n.data=$e.call(e,e.transformResponse,n),n.headers=M.from(n.headers),n},function(n){return lr(n)||(Ve(e),n&&n.response&&(n.response.data=$e.call(e,e.transformResponse,n.response),n.response.headers=M.from(n.response.headers))),Promise.reject(n)})}const mr="1.13.2",Be={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Be[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Tt={};Be.transitional=function(t,r,n){function o(i,s){return"[Axios v"+mr+"] Transitional option '"+i+"'"+s+(n?". "+n:"")}return(i,s,a)=>{if(t===!1)throw new k(o(s," has been removed"+(r?" in "+r:"")),k.ERR_DEPRECATED);return r&&!Tt[s]&&(Tt[s]=!0,console.warn(o(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,s,a):!0}};Be.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function Yo(e,t,r){if(typeof e!="object")throw new k("options must be an object",k.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const i=n[o],s=t[i];if(s){const a=e[i],u=a===void 0||s(a,i,e);if(u!==!0)throw new k("option "+i+" must be "+u,k.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new k("Unknown option "+i,k.ERR_BAD_OPTION)}}const Te={assertOptions:Yo,validators:Be},G=Te.validators;let re=class{constructor(t){this.defaults=t||{},this.interceptors={request:new bt,response:new bt}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=` +`+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=ne(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&Te.assertOptions(n,{silentJSONParsing:G.transitional(G.boolean),forcedJSONParsing:G.transitional(G.boolean),clarifyTimeoutError:G.transitional(G.boolean)},!1),o!=null&&(l.isFunction(o)?r.paramsSerializer={serialize:o}:Te.assertOptions(o,{encode:G.function,serialize:G.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Te.assertOptions(r,{baseUrl:G.spelling("baseURL"),withXsrfToken:G.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&l.merge(i.common,i[r.method]);i&&l.forEach(["delete","get","head","post","put","patch","common"],f=>{delete i[f]}),r.headers=M.concat(s,i);const a=[];let u=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(r)===!1||(u=u&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const c=[];this.interceptors.response.forEach(function(g){c.push(g.fulfilled,g.rejected)});let d,m=0,x;if(!u){const f=[Ct.bind(this),void 0];for(f.unshift(...a),f.push(...c),x=f.length,d=Promise.resolve(r);m{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(a=>{n.subscribe(a),i=a}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},t(function(i,s,a){n.reason||(n.reason=new ce(i,s,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new hr(function(o){t=o}),cancel:t}}};function Qo(e){return function(r){return e.apply(null,r)}}function es(e){return l.isObject(e)&&e.isAxiosError===!0}const Ye={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ye).forEach(([e,t])=>{Ye[t]=e});function br(e){const t=new re(e),r=Gt(re.prototype.request,t);return l.extend(r,re.prototype,t,{allOwnKeys:!0}),l.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return br(ne(e,o))},r}const v=br(ye);v.Axios=re;v.CanceledError=ce;v.CancelToken=Zo;v.isCancel=lr;v.VERSION=mr;v.toFormData=Ue;v.AxiosError=k;v.Cancel=v.CanceledError;v.all=function(t){return Promise.all(t)};v.spread=Qo;v.isAxiosError=es;v.mergeConfig=ne;v.AxiosHeaders=M;v.formToJSON=e=>ar(l.isHTMLForm(e)?new FormData(e):e);v.getAdapter=pr.getAdapter;v.HttpStatusCode=Ye;v.default=v;const{Axios:ss,AxiosError:is,CanceledError:as,isCancel:ls,CancelToken:cs,VERSION:us,all:ds,Cancel:fs,isAxiosError:ps,spread:ms,toFormData:hs,AxiosHeaders:bs,HttpStatusCode:gs,formToJSON:ys,getAdapter:ws,mergeConfig:xs}=v,ks=(e,t)=>xr.post("/auth/email/sign-in",{email:e,password:t}),gr=e=>xr.post("/admin/auth/reissue",{},{headers:{Authorization:`Bearer ${e}`}}),yr=e=>`Bearer ${e}`,wr=v.create({baseURL:void 0,withCredentials:!0});wr.interceptors.request.use(async e=>{const t={...e};let r=Sr();if(r===null||We(r)){const n=Ot();if(n===null||We(n))return Oe(),Pe(),e;await gr(n).then(o=>{r=o.data.accessToken,Pt(r)}).catch(o=>{Oe(),Pe(),console.error("인증 토큰 갱신중 오류가 발생했습니다",o)})}return r!==null&&(t.headers.Authorization=yr(r)),t},e=>Promise.reject(e));wr.interceptors.response.use(e=>e,async e=>{const t={...e};if(e.response?.status===401||e.response?.status===403){const r=Ot();if(r===null||We(r))throw Oe(),Pe(),t;try{const n=await gr(r).then(o=>o.data.accessToken);return Pt(n),e?.config.headers===void 0&&(t.config.headers={}),t.config.headers.Authorization=yr(n),await v.request(t.config)}catch{throw Oe(),Pe(),Error("로그인이 필요합니다")}}else throw t});const xr=v.create({baseURL:void 0});export{Rn as B,wr as a,Nt as b,Sn as c,Ar as d,_r as e,ks as f,rs as u}; diff --git a/apps/admin/.output/public/assets/index-C5TecN1M.js b/apps/admin/.output/public/assets/index-C5TecN1M.js new file mode 100644 index 00000000..0ccfb7da --- /dev/null +++ b/apps/admin/.output/public/assets/index-C5TecN1M.js @@ -0,0 +1 @@ +import{r as c,j as o,t as G,R as W,a as we}from"./main-CMD0s_Sp.js";import{c as O,a as Q,B as M,b as at,u as K}from"./client-ByMMc4SQ.js";const Te=6048e5,ot=864e5,he=Symbol.for("constructDateFrom");function A(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&he in e?e[he](t):e instanceof Date?new e.constructor(t):new Date(t)}function I(e,t){return A(t||e,e)}let st={};function Z(){return st}function U(e,t){const n=Z(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=I(e,t?.in),s=a.getDay(),u=(s=s.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function ge(e){const t=I(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function it(e,...t){const n=A.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function pe(e,t){const n=I(e,t?.in);return n.setHours(0,0,0,0),n}function ct(e,t,n){const[r,a]=it(n?.in,e,t),s=pe(r),u=pe(a),l=+s-ge(s),m=+u-ge(u);return Math.round((l-m)/ot)}function ut(e,t){const n=Re(e,t),r=A(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),J(r)}function lt(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function dt(e){return!(!lt(e)&&typeof e!="number"||isNaN(+I(e)))}function ft(e,t){const n=I(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const mt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},ht=(e,t,n)=>{let r;const a=mt[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function ne(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const gt={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},pt={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},bt={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},yt={date:ne({formats:gt,defaultWidth:"full"}),time:ne({formats:pt,defaultWidth:"full"}),dateTime:ne({formats:bt,defaultWidth:"full"})},xt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},St=(e,t,n,r)=>xt[e];function H(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const u=e.defaultFormattingWidth||e.defaultWidth,l=n?.width?String(n.width):u;a=e.formattingValues[l]||e.formattingValues[u]}else{const u=e.defaultWidth,l=n?.width?String(n.width):e.defaultWidth;a=e.values[l]||e.values[u]}const s=e.argumentCallback?e.argumentCallback(t):t;return a[s]}}const vt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},wt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Tt={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Rt={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},jt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Nt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Ct=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Pt={ordinalNumber:Ct,era:H({values:vt,defaultWidth:"wide"}),quarter:H({values:wt,defaultWidth:"wide",argumentCallback:e=>e-1}),month:H({values:Tt,defaultWidth:"wide"}),day:H({values:Rt,defaultWidth:"wide"}),dayPeriod:H({values:jt,defaultWidth:"wide",formattingValues:Nt,defaultFormattingWidth:"wide"})};function $(e){return(t,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(a);if(!s)return null;const u=s[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],m=Array.isArray(l)?Mt(l,f=>f.test(u)):Et(l,f=>f.test(u));let h;h=e.valueCallback?e.valueCallback(m):m,h=n.valueCallback?n.valueCallback(h):h;const d=t.slice(u.length);return{value:h,rest:d}}}function Et(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Mt(e,t){for(let n=0;n{const r=t.match(e.matchPattern);if(!r)return null;const a=r[0],s=t.match(e.parsePattern);if(!s)return null;let u=e.valueCallback?e.valueCallback(s[0]):s[0];u=n.valueCallback?n.valueCallback(u):u;const l=t.slice(a.length);return{value:u,rest:l}}}const It=/^(\d+)(th|st|nd|rd)?/i,Dt=/\d+/i,Ft={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},kt={any:[/^b/i,/^(a|c)/i]},At={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},_t={any:[/1/i,/2/i,/3/i,/4/i]},Wt={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Lt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Yt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Gt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},qt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Vt={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Ht={ordinalNumber:Ot({matchPattern:It,parsePattern:Dt,valueCallback:e=>parseInt(e,10)}),era:$({matchPatterns:Ft,defaultMatchWidth:"wide",parsePatterns:kt,defaultParseWidth:"any"}),quarter:$({matchPatterns:At,defaultMatchWidth:"wide",parsePatterns:_t,defaultParseWidth:"any",valueCallback:e=>e+1}),month:$({matchPatterns:Wt,defaultMatchWidth:"wide",parsePatterns:Lt,defaultParseWidth:"any"}),day:$({matchPatterns:Yt,defaultMatchWidth:"wide",parsePatterns:Gt,defaultParseWidth:"any"}),dayPeriod:$({matchPatterns:qt,defaultMatchWidth:"any",parsePatterns:Vt,defaultParseWidth:"any"})},$t={code:"en-US",formatDistance:ht,formatLong:yt,formatRelative:St,localize:Pt,match:Ht,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Ut(e,t){const n=I(e,t?.in);return ct(n,ft(n))+1}function Bt(e,t){const n=I(e,t?.in),r=+J(n)-+ut(n);return Math.round(r/Te)+1}function je(e,t){const n=I(e,t?.in),r=n.getFullYear(),a=Z(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,u=A(t?.in||e,0);u.setFullYear(r+1,0,s),u.setHours(0,0,0,0);const l=U(u,t),m=A(t?.in||e,0);m.setFullYear(r,0,s),m.setHours(0,0,0,0);const h=U(m,t);return+n>=+l?r+1:+n>=+h?r:r-1}function Qt(e,t){const n=Z(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=je(e,t),s=A(t?.in||e,0);return s.setFullYear(a,0,r),s.setHours(0,0,0,0),U(s,t)}function Xt(e,t){const n=I(e,t?.in),r=+U(n,t)-+Qt(n,t);return Math.round(r/Te)+1}function y(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const k={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return y(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):y(n+1,2)},d(e,t){return y(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return y(e.getHours()%12||12,t.length)},H(e,t){return y(e.getHours(),t.length)},m(e,t){return y(e.getMinutes(),t.length)},s(e,t){return y(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return y(a,t.length)}},Y={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},be={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return k.y(e,t)},Y:function(e,t,n,r){const a=je(e,r),s=a>0?a:1-a;if(t==="YY"){const u=s%100;return y(u,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):y(s,t.length)},R:function(e,t){const n=Re(e);return y(n,t.length)},u:function(e,t){const n=e.getFullYear();return y(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return y(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return y(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return k.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return y(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const a=Xt(e,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):y(a,t.length)},I:function(e,t,n){const r=Bt(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):y(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):k.d(e,t)},D:function(e,t,n){const r=Ut(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):y(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const a=e.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return y(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const a=e.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return y(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return y(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let a;switch(r===12?a=Y.noon:r===0?a=Y.midnight:a=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let a;switch(r>=17?a=Y.evening:r>=12?a=Y.afternoon:r>=4?a=Y.morning:a=Y.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return k.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):k.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):y(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):y(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):k.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):k.s(e,t)},S:function(e,t){return k.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return xe(r);case"XXXX":case"XX":return L(r);default:return L(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return xe(r);case"xxxx":case"xx":return L(r);default:return L(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ye(r,":");default:return"GMT"+L(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ye(r,":");default:return"GMT"+L(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return y(r,t.length)},T:function(e,t,n){return y(+e,t.length)}};function ye(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),s=r%60;return s===0?n+String(a):n+String(a)+t+y(s,2)}function xe(e,t){return e%60===0?(e>0?"-":"+")+y(Math.abs(e)/60,2):L(e,t)}function L(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=y(Math.trunc(r/60),2),s=y(r%60,2);return n+a+t+s}const Se=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},Ne=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Kt=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return Se(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Se(r,t)).replace("{{time}}",Ne(a,t))},Jt={p:Ne,P:Kt},zt=/^D+$/,Zt=/^Y+$/,en=["D","DD","YY","YYYY"];function tn(e){return zt.test(e)}function nn(e){return Zt.test(e)}function rn(e,t,n){const r=an(e,t,n);if(console.warn(r),en.includes(e))throw new RangeError(r)}function an(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const on=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,sn=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,cn=/^'([^]*?)'?$/,un=/''/g,ln=/[a-zA-Z]/;function Ce(e,t,n){const r=Z(),a=r.locale??$t,s=r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,u=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,l=I(e,n?.in);if(!dt(l))throw new RangeError("Invalid time value");let m=t.match(sn).map(d=>{const f=d[0];if(f==="p"||f==="P"){const b=Jt[f];return b(d,a.formatLong)}return d}).join("").match(on).map(d=>{if(d==="''")return{isToken:!1,value:"'"};const f=d[0];if(f==="'")return{isToken:!1,value:dn(d)};if(be[f])return{isToken:!0,value:d};if(f.match(ln))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:d}});a.localize.preprocessor&&(m=a.localize.preprocessor(l,m));const h={firstWeekContainsDate:s,weekStartsOn:u,locale:a};return m.map(d=>{if(!d.isToken)return d.value;const f=d.value;(nn(f)||tn(f))&&rn(f,t,String(e));const b=be[f[0]];return b(l,f,a.localize,h)}).join("")}function dn(e){const t=e.match(cn);return t?t[1].replace(un,"'"):e}const ce=c.forwardRef(({className:e,...t},n)=>o.jsx("div",{className:"relative w-full overflow-auto",children:o.jsx("table",{ref:n,className:O("w-full caption-bottom text-sm",e),...t})}));ce.displayName="Table";const ue=c.forwardRef(({className:e,...t},n)=>o.jsx("thead",{ref:n,className:O("[&_tr]:border-b",e),...t}));ue.displayName="TableHeader";const le=c.forwardRef(({className:e,...t},n)=>o.jsx("tbody",{ref:n,className:O("[&_tr:last-child]:border-0",e),...t}));le.displayName="TableBody";const fn=c.forwardRef(({className:e,...t},n)=>o.jsx("tfoot",{ref:n,className:O("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));fn.displayName="TableFooter";const D=c.forwardRef(({className:e,...t},n)=>o.jsx("tr",{ref:n,className:O("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));D.displayName="TableRow";const j=c.forwardRef(({className:e,...t},n)=>o.jsx("th",{ref:n,className:O("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));j.displayName="TableHead";const w=c.forwardRef(({className:e,...t},n)=>o.jsx("td",{ref:n,className:O("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));w.displayName="TableCell";const mn=c.forwardRef(({className:e,...t},n)=>o.jsx("caption",{ref:n,className:O("mt-4 text-sm text-muted-foreground",e),...t}));mn.displayName="TableCaption";const q={getGpaScores:(e,t)=>Q.get("/admin/scores/gpas",{params:{...e,page:t}}).then(n=>n.data),updateGpaScore:(e,t,n,r)=>{if(!r)throw new Error("Score data is required");const a={gpa:r.gpaScoreStatusResponse.gpaResponse.gpa,gpaCriteria:r.gpaScoreStatusResponse.gpaResponse.gpaCriteria,verifyStatus:t,rejectedReason:n};return Q.put(`/admin/scores/gpas/${e}`,a)},getLanguageScores:(e,t)=>Q.get("/admin/scores/language-tests",{params:{...e,page:t}}).then(n=>n.data),updateLanguageScore:(e,t,n,r)=>{if(!r)throw new Error("Score data is required");const a={languageTestType:r.languageTestScoreStatusResponse.languageTestResponse.languageTestType,languageTestScore:r.languageTestScoreStatusResponse.languageTestResponse.languageTestScore,verifyStatus:t,rejectedReason:n};return Q.put(`/admin/scores/language-tests/${e}`,a)}};function Pe({currentStatus:e,onVerifyChange:t}){const[n,r]=c.useState(!1),[a,s]=c.useState(""),u=()=>{t("APPROVED")},l=()=>{n?(t("REJECTED",a),r(!1),s("")):r(!0)};return e!=="PENDING"?null:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{type:"button",onClick:u,className:"rounded bg-green-500 px-3 py-1 text-white hover:bg-green-600",children:"승인"}),n?o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{type:"text",value:a,onChange:m=>s(m.target.value),placeholder:"거절 사유",className:"rounded border px-2 py-1"}),o.jsx("button",{type:"button",onClick:l,className:"rounded bg-red-500 px-3 py-1 text-white hover:bg-red-600",children:"확인"})]}):o.jsx("button",{type:"button",onClick:l,className:"rounded bg-red-500 px-3 py-1 text-white hover:bg-red-600",children:"거절"})]})}const hn={PENDING:"bg-yellow-100 text-yellow-800",APPROVED:"bg-green-100 text-green-800",REJECTED:"bg-red-100 text-red-800"},gn={PENDING:"대기중",APPROVED:"승인됨",REJECTED:"거절됨"};function Ee({status:e}){return o.jsx("span",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${hn[e]}`,children:gn[e]})}const pn=void 0;function bn({verifyFilter:e}){const[t,n]=c.useState([]),[r,a]=c.useState(1),[s,u]=c.useState(1),[l,m]=c.useState(!1),[h,d]=c.useState(null),[f,b]=c.useState(0),[S,T]=c.useState(0),v=async()=>{m(!0);try{const i=await q.getGpaScores({verifyStatus:e},r);n(i.content),u(i.totalPages)}catch(i){console.error("Failed to fetch GPA scores:",i)}finally{m(!1)}};c.useEffect(()=>{v()},[e,r]);const p=async(i,g,P)=>{try{const E=t.find(N=>N.gpaScoreStatusResponse.id===i);await q.updateGpaScore(i,g,P,E),v()}catch(E){console.error("Failed to update GPA score:",E),G.error("성적 상태 업데이트에 실패했습니다")}},R=i=>{d(i.gpaScoreStatusResponse.id),b(i.gpaScoreStatusResponse.gpaResponse.gpa),T(i.gpaScoreStatusResponse.gpaResponse.gpaCriteria)},C=async i=>{try{await q.updateGpaScore(i.gpaScoreStatusResponse.id,i.gpaScoreStatusResponse.verifyStatus,i.gpaScoreStatusResponse.rejectedReason||void 0,{...i,gpaScoreStatusResponse:{...i.gpaScoreStatusResponse,gpaResponse:{...i.gpaScoreStatusResponse.gpaResponse,gpa:f,gpaCriteria:S}}}),d(null),v(),G.success("GPA가 수정되었습니다")}catch(g){console.error("Failed to update GPA:",g),G.error("GPA 수정에 실패했습니다")}},x=i=>{i<1||i>s||a(i)};return o.jsxs("div",{className:"rounded-lg border bg-white shadow",children:[o.jsx("div",{className:"overflow-x-auto",children:o.jsxs(ce,{children:[o.jsx(ue,{children:o.jsxs(D,{children:[o.jsx(j,{children:"ID"}),o.jsx(j,{children:"닉네임"}),o.jsx(j,{children:"GPA"}),o.jsx(j,{children:"기준점수"}),o.jsx(j,{children:"상태"}),o.jsx(j,{children:"제출일"}),o.jsx(j,{children:"거절사유"}),o.jsx(j,{children:"인증파일"}),o.jsx(j,{children:"작업"})]})}),o.jsx(le,{children:l?o.jsx(D,{children:o.jsx(w,{colSpan:9,className:"text-center",children:o.jsxs("div",{className:"flex items-center justify-center",children:[o.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-b-2 border-gray-900"}),o.jsx("span",{className:"ml-2",children:"로딩중..."})]})})}):t.length===0?o.jsx(D,{children:o.jsx(w,{colSpan:9,className:"text-center text-gray-500",children:"데이터가 없습니다"})}):t.map(i=>o.jsxs(D,{className:"hover:bg-gray-50",children:[o.jsx(w,{children:i.gpaScoreStatusResponse.id}),o.jsx(w,{children:o.jsxs("div",{className:"flex items-center",children:[o.jsx("img",{src:i.siteUserResponse.profileImageUrl,alt:"프로필",className:"mr-2 h-8 w-8 rounded-full"}),i.siteUserResponse.nickname]})}),o.jsx(w,{children:h===i.gpaScoreStatusResponse.id?o.jsx("div",{className:"flex gap-2",children:o.jsx("input",{type:"number",step:"0.01",value:f,onChange:g=>b(Number.parseFloat(g.target.value)),className:"w-20 rounded border px-2 py-1"})}):i.gpaScoreStatusResponse.gpaResponse.gpa}),o.jsx(w,{children:h===i.gpaScoreStatusResponse.id?o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{type:"number",step:"0.01",value:S,onChange:g=>T(Number.parseFloat(g.target.value)),className:"w-20 rounded border px-2 py-1"}),o.jsx(M,{onClick:()=>C(i),variant:"default",children:"저장"}),o.jsx(M,{onClick:()=>d(null),variant:"secondary",children:"취소"})]}):o.jsxs("div",{className:"flex gap-2",children:[i.gpaScoreStatusResponse.gpaResponse.gpaCriteria,o.jsx(M,{onClick:()=>R(i),variant:"secondary",children:"수정"})]})}),o.jsx(w,{children:o.jsx(Ee,{status:i.gpaScoreStatusResponse.verifyStatus})}),o.jsx(w,{children:Ce(new Date(i.gpaScoreStatusResponse.createdAt),"yyyy-MM-dd HH:mm")}),o.jsx(w,{children:i.gpaScoreStatusResponse.rejectedReason||"-"}),o.jsx(w,{children:o.jsx("a",{href:`${pn}${i.gpaScoreStatusResponse.gpaResponse.gpaReportUrl}`,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 hover:underline",children:"파일 보기"})}),o.jsx(w,{children:o.jsx(Pe,{currentStatus:i.gpaScoreStatusResponse.verifyStatus,onVerifyChange:(g,P)=>p(i.gpaScoreStatusResponse.id,g,P)})})]},i.gpaScoreStatusResponse.id))})]})}),o.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 p-4",children:[o.jsx(M,{onClick:()=>x(r-1),disabled:r===1,variant:"secondary",children:"이전"}),Array.from({length:s},(i,g)=>o.jsx(M,{onClick:()=>x(g+1),variant:r===g+1?"default":"secondary",children:g+1},g+1)),o.jsx(M,{onClick:()=>x(r+1),disabled:r===s,variant:"secondary",children:"다음"})]})]})}const yn=void 0,ve=[{value:"TOEIC",label:"TOEIC"},{value:"TOEFL_IBT",label:"TOEFL IBT"},{value:"TOEFL_ITP",label:"TOEFL ITP"},{value:"IELTS",label:"IELTS"},{value:"JLPT",label:"JLPT"},{value:"NEW_HSK",label:"NEW HSK"},{value:"DALF",label:"DALF"},{value:"CEFR",label:"CEFR"},{value:"TCF",label:"TCF"},{value:"TEF",label:"TEF"},{value:"DUOLINGO",label:"DUOLINGO"},{value:"ETC",label:"기타"}];function xn({verifyFilter:e}){const[t,n]=c.useState([]),[r,a]=c.useState(1),[s,u]=c.useState(1),[l,m]=c.useState(!1),[h,d]=c.useState(null),[f,b]=c.useState(""),[S,T]=c.useState("TOEIC"),v=async()=>{m(!0);try{const i=await q.getLanguageScores({verifyStatus:e},r);n(i.content),u(i.totalPages)}catch(i){console.error("Failed to fetch Language scores:",i)}finally{m(!1)}};c.useEffect(()=>{v()},[e,r]);const p=async(i,g,P)=>{try{const E=t.find(N=>N.languageTestScoreStatusResponse.id===i);await q.updateLanguageScore(i,g,P,E),v()}catch(E){console.error("Failed to update Language score:",E),G.error("성적 상태 업데이트에 실패했습니다")}},R=i=>{d(i.languageTestScoreStatusResponse.id),b(i.languageTestScoreStatusResponse.languageTestResponse.languageTestScore),T(i.languageTestScoreStatusResponse.languageTestResponse.languageTestType)},C=async i=>{try{await q.updateLanguageScore(i.languageTestScoreStatusResponse.id,i.languageTestScoreStatusResponse.verifyStatus,i.languageTestScoreStatusResponse.rejectedReason||void 0,{...i,languageTestScoreStatusResponse:{...i.languageTestScoreStatusResponse,languageTestResponse:{...i.languageTestScoreStatusResponse.languageTestResponse,languageTestScore:f,languageTestType:S}}}),d(null),v(),G.success("어학성적이 수정되었습니다")}catch(g){console.error("Failed to update language score:",g),G.error("어학성적 수정에 실패했습니다")}},x=i=>{i<1||i>s||a(i)};return o.jsxs("div",{className:"rounded-lg border bg-white shadow",children:[o.jsx("div",{className:"overflow-x-auto",children:o.jsxs(ce,{children:[o.jsx(ue,{children:o.jsxs(D,{children:[o.jsx(j,{children:"ID"}),o.jsx(j,{children:"닉네임"}),o.jsx(j,{children:"시험종류"}),o.jsx(j,{children:"점수"}),o.jsx(j,{children:"상태"}),o.jsx(j,{children:"제출일"}),o.jsx(j,{children:"거절사유"}),o.jsx(j,{children:"인증파일"}),o.jsx(j,{children:"작업"})]})}),o.jsx(le,{children:l?o.jsx(D,{children:o.jsx(w,{colSpan:9,className:"text-center",children:o.jsxs("div",{className:"flex items-center justify-center",children:[o.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-b-2 border-gray-900"}),o.jsx("span",{className:"ml-2",children:"로딩중..."})]})})}):t.length===0?o.jsx(D,{children:o.jsx(w,{colSpan:9,className:"text-center text-gray-500",children:"데이터가 없습니다"})}):t.map(i=>o.jsxs(D,{className:"hover:bg-gray-50",children:[o.jsx(w,{children:i.languageTestScoreStatusResponse.id}),o.jsx(w,{children:o.jsxs("div",{className:"flex items-center",children:[o.jsx("img",{src:i.siteUserResponse.profileImageUrl,alt:"프로필",className:"mr-2 h-8 w-8 rounded-full"}),i.siteUserResponse.nickname]})}),o.jsx(w,{children:h===i.languageTestScoreStatusResponse.id?o.jsx("div",{className:"flex gap-2",children:o.jsx("select",{value:S,onChange:g=>T(g.target.value),className:"rounded border px-2 py-1",children:ve.map(g=>o.jsx("option",{value:g.value,children:g.label},g.value))})}):ve.find(g=>g.value===i.languageTestScoreStatusResponse.languageTestResponse.languageTestType)?.label||i.languageTestScoreStatusResponse.languageTestResponse.languageTestType}),o.jsx(w,{children:h===i.languageTestScoreStatusResponse.id?o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{type:"text",value:f,onChange:g=>b(g.target.value),className:"w-20 rounded border px-2 py-1"}),o.jsx(M,{onClick:()=>C(i),variant:"default",children:"저장"}),o.jsx(M,{onClick:()=>d(null),variant:"secondary",children:"취소"})]}):o.jsxs("div",{className:"flex gap-2",children:[i.languageTestScoreStatusResponse.languageTestResponse.languageTestScore,o.jsx(M,{onClick:()=>R(i),variant:"secondary",children:"수정"})]})}),o.jsx(w,{children:o.jsx(Ee,{status:i.languageTestScoreStatusResponse.verifyStatus})}),o.jsx(w,{children:Ce(new Date(i.languageTestScoreStatusResponse.createdAt),"yyyy-MM-dd HH:mm")}),o.jsx(w,{children:i.languageTestScoreStatusResponse.rejectedReason||"-"}),o.jsx(w,{children:o.jsx("a",{href:`${yn}${i.languageTestScoreStatusResponse.languageTestResponse.languageTestReportUrl}`,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 hover:underline",children:"파일 보기"})}),o.jsx(w,{children:o.jsx(Pe,{currentStatus:i.languageTestScoreStatusResponse.verifyStatus,onVerifyChange:(g,P)=>p(i.languageTestScoreStatusResponse.id,g,P)})})]},i.languageTestScoreStatusResponse.id))})]})}),o.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2 p-4",children:[o.jsx(M,{onClick:()=>x(r-1),disabled:r===1,variant:"secondary",children:"이전"}),Array.from({length:s},(i,g)=>o.jsx(M,{onClick:()=>x(g+1),variant:r===g+1?"default":"secondary",children:g+1},g+1)),o.jsx(M,{onClick:()=>x(r+1),disabled:r===s,variant:"secondary",children:"다음"})]})]})}function F(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e?.(a),n===!1||!a.defaultPrevented)return t?.(a)}}function de(e,t=[]){let n=[];function r(s,u){const l=c.createContext(u),m=n.length;n=[...n,u];const h=f=>{const{scope:b,children:S,...T}=f,v=b?.[e]?.[m]||l,p=c.useMemo(()=>T,Object.values(T));return o.jsx(v.Provider,{value:p,children:S})};h.displayName=s+"Provider";function d(f,b){const S=b?.[e]?.[m]||l,T=c.useContext(S);if(T)return T;if(u!==void 0)return u;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[h,d]}const a=()=>{const s=n.map(u=>c.createContext(u));return function(l){const m=l?.[e]||s;return c.useMemo(()=>({[`__scope${e}`]:{...l,[e]:m}}),[l,m])}};return a.scopeName=e,[r,Sn(a,...t)]}function Sn(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(s){const u=r.reduce((l,{useScope:m,scopeName:h})=>{const f=m(s)[`__scope${h}`];return{...l,...f}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return n.scopeName=t.scopeName,n}function ae(e){const t=vn(e),n=c.forwardRef((r,a)=>{const{children:s,...u}=r,l=c.Children.toArray(s),m=l.find(Tn);if(m){const h=m.props.children,d=l.map(f=>f===m?c.Children.count(h)>1?c.Children.only(null):c.isValidElement(h)?h.props.children:null:f);return o.jsx(t,{...u,ref:a,children:c.isValidElement(h)?c.cloneElement(h,void 0,d):null})}return o.jsx(t,{...u,ref:a,children:s})});return n.displayName=`${e}.Slot`,n}function vn(e){const t=c.forwardRef((n,r)=>{const{children:a,...s}=n;if(c.isValidElement(a)){const u=jn(a),l=Rn(s,a.props);return a.type!==c.Fragment&&(l.ref=r?at(r,u):u),c.cloneElement(a,l)}return c.Children.count(a)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var wn=Symbol("radix.slottable");function Tn(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===wn}function Rn(e,t){const n={...t};for(const r in t){const a=e[r],s=t[r];/^on[A-Z]/.test(r)?a&&s?n[r]=(...l)=>{const m=s(...l);return a(...l),m}:a&&(n[r]=a):r==="style"?n[r]={...a,...s}:r==="className"&&(n[r]=[a,s].filter(Boolean).join(" "))}return{...e,...n}}function jn(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Nn(e){const t=e+"CollectionProvider",[n,r]=de(t),[a,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),u=v=>{const{scope:p,children:R}=v,C=W.useRef(null),x=W.useRef(new Map).current;return o.jsx(a,{scope:p,itemMap:x,collectionRef:C,children:R})};u.displayName=t;const l=e+"CollectionSlot",m=ae(l),h=W.forwardRef((v,p)=>{const{scope:R,children:C}=v,x=s(l,R),i=K(p,x.collectionRef);return o.jsx(m,{ref:i,children:C})});h.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",b=ae(d),S=W.forwardRef((v,p)=>{const{scope:R,children:C,...x}=v,i=W.useRef(null),g=K(p,i),P=s(d,R);return W.useEffect(()=>(P.itemMap.set(i,{ref:i,...x}),()=>{P.itemMap.delete(i)})),o.jsx(b,{[f]:"",ref:g,children:C})});S.displayName=d;function T(v){const p=s(e+"CollectionConsumer",v);return W.useCallback(()=>{const C=p.collectionRef.current;if(!C)return[];const x=Array.from(C.querySelectorAll(`[${f}]`));return Array.from(p.itemMap.values()).sort((P,E)=>x.indexOf(P.ref.current)-x.indexOf(E.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:u,Slot:h,ItemSlot:S},T,r]}var z=globalThis?.document?c.useLayoutEffect:()=>{},Cn=we[" useId ".trim().toString()]||(()=>{}),Pn=0;function Me(e){const[t,n]=c.useState(Cn());return z(()=>{n(r=>r??String(Pn++))},[e]),e||(t?`radix-${t}`:"")}var En=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],V=En.reduce((e,t)=>{const n=ae(`Primitive.${t}`),r=c.forwardRef((a,s)=>{const{asChild:u,...l}=a,m=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(m,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Mn(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...n)=>t.current?.(...n),[])}var On=we[" useInsertionEffect ".trim().toString()]||z;function Oe({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,s,u]=In({defaultProp:t,onChange:n}),l=e!==void 0,m=l?e:a;{const d=c.useRef(e!==void 0);c.useEffect(()=>{const f=d.current;f!==l&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=l},[l,r])}const h=c.useCallback(d=>{if(l){const f=Dn(d)?d(e):d;f!==e&&u.current?.(f)}else s(d)},[l,e,s,u]);return[m,h]}function In({defaultProp:e,onChange:t}){const[n,r]=c.useState(e),a=c.useRef(n),s=c.useRef(t);return On(()=>{s.current=t},[t]),c.useEffect(()=>{a.current!==n&&(s.current?.(n),a.current=n)},[n,a]),[n,r,s]}function Dn(e){return typeof e=="function"}var Fn=c.createContext(void 0);function Ie(e){const t=c.useContext(Fn);return e||t||"ltr"}var re="rovingFocusGroup.onEntryFocus",kn={bubbles:!1,cancelable:!0},B="RovingFocusGroup",[oe,De,An]=Nn(B),[_n,Fe]=de(B,[An]),[Wn,Ln]=_n(B),ke=c.forwardRef((e,t)=>o.jsx(oe.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(oe.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(Yn,{...e,ref:t})})}));ke.displayName=B;var Yn=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:s,currentTabStopId:u,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:m,onEntryFocus:h,preventScrollOnEntryFocus:d=!1,...f}=e,b=c.useRef(null),S=K(t,b),T=Ie(s),[v,p]=Oe({prop:u,defaultProp:l??null,onChange:m,caller:B}),[R,C]=c.useState(!1),x=Mn(h),i=De(n),g=c.useRef(!1),[P,E]=c.useState(0);return c.useEffect(()=>{const N=b.current;if(N)return N.addEventListener(re,x),()=>N.removeEventListener(re,x)},[x]),o.jsx(Wn,{scope:n,orientation:r,dir:T,loop:a,currentTabStopId:v,onItemFocus:c.useCallback(N=>p(N),[p]),onItemShiftTab:c.useCallback(()=>C(!0),[]),onFocusableItemAdd:c.useCallback(()=>E(N=>N+1),[]),onFocusableItemRemove:c.useCallback(()=>E(N=>N-1),[]),children:o.jsx(V.div,{tabIndex:R||P===0?-1:0,"data-orientation":r,...f,ref:S,style:{outline:"none",...e.style},onMouseDown:F(e.onMouseDown,()=>{g.current=!0}),onFocus:F(e.onFocus,N=>{const et=!g.current;if(N.target===N.currentTarget&&et&&!R){const me=new CustomEvent(re,kn);if(N.currentTarget.dispatchEvent(me),!me.defaultPrevented){const te=i().filter(_=>_.focusable),tt=te.find(_=>_.active),nt=te.find(_=>_.id===v),rt=[tt,nt,...te].filter(Boolean).map(_=>_.ref.current);We(rt,d)}}g.current=!1}),onBlur:F(e.onBlur,()=>C(!1))})})}),Ae="RovingFocusGroupItem",_e=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:s,children:u,...l}=e,m=Me(),h=s||m,d=Ln(Ae,n),f=d.currentTabStopId===h,b=De(n),{onFocusableItemAdd:S,onFocusableItemRemove:T,currentTabStopId:v}=d;return c.useEffect(()=>{if(r)return S(),()=>T()},[r,S,T]),o.jsx(oe.ItemSlot,{scope:n,id:h,focusable:r,active:a,children:o.jsx(V.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...l,ref:t,onMouseDown:F(e.onMouseDown,p=>{r?d.onItemFocus(h):p.preventDefault()}),onFocus:F(e.onFocus,()=>d.onItemFocus(h)),onKeyDown:F(e.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){d.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const R=Vn(p,d.orientation,d.dir);if(R!==void 0){if(p.metaKey||p.ctrlKey||p.altKey||p.shiftKey)return;p.preventDefault();let x=b().filter(i=>i.focusable).map(i=>i.ref.current);if(R==="last")x.reverse();else if(R==="prev"||R==="next"){R==="prev"&&x.reverse();const i=x.indexOf(p.currentTarget);x=d.loop?Hn(x,i+1):x.slice(i+1)}setTimeout(()=>We(x))}}),children:typeof u=="function"?u({isCurrentTabStop:f,hasTabStop:v!=null}):u})})});_e.displayName=Ae;var Gn={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function qn(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Vn(e,t,n){const r=qn(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Gn[r]}function We(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Hn(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var $n=ke,Un=_e;function Bn(e,t){return c.useReducer((n,r)=>t[n][r]??n,e)}var Le=e=>{const{present:t,children:n}=e,r=Qn(t),a=typeof n=="function"?n({present:r.isPresent}):c.Children.only(n),s=K(r.ref,Xn(a));return typeof n=="function"||r.isPresent?c.cloneElement(a,{ref:s}):null};Le.displayName="Presence";function Qn(e){const[t,n]=c.useState(),r=c.useRef(null),a=c.useRef(e),s=c.useRef("none"),u=e?"mounted":"unmounted",[l,m]=Bn(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const h=X(r.current);s.current=l==="mounted"?h:"none"},[l]),z(()=>{const h=r.current,d=a.current;if(d!==e){const b=s.current,S=X(h);e?m("MOUNT"):S==="none"||h?.display==="none"?m("UNMOUNT"):m(d&&b!==S?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,m]),z(()=>{if(t){let h;const d=t.ownerDocument.defaultView??window,f=S=>{const v=X(r.current).includes(CSS.escape(S.animationName));if(S.target===t&&v&&(m("ANIMATION_END"),!a.current)){const p=t.style.animationFillMode;t.style.animationFillMode="forwards",h=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=p)})}},b=S=>{S.target===t&&(s.current=X(r.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(h),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:c.useCallback(h=>{r.current=h?getComputedStyle(h):null,n(h)},[])}}function X(e){return e?.animationName||"none"}function Xn(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ee="Tabs",[Kn]=de(ee,[Fe]),Ye=Fe(),[Jn,fe]=Kn(ee),Ge=c.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:s,orientation:u="horizontal",dir:l,activationMode:m="automatic",...h}=e,d=Ie(l),[f,b]=Oe({prop:r,onChange:a,defaultProp:s??"",caller:ee});return o.jsx(Jn,{scope:n,baseId:Me(),value:f,onValueChange:b,orientation:u,dir:d,activationMode:m,children:o.jsx(V.div,{dir:d,"data-orientation":u,...h,ref:t})})});Ge.displayName=ee;var qe="TabsList",Ve=c.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,s=fe(qe,n),u=Ye(n);return o.jsx($n,{asChild:!0,...u,orientation:s.orientation,dir:s.dir,loop:r,children:o.jsx(V.div,{role:"tablist","aria-orientation":s.orientation,...a,ref:t})})});Ve.displayName=qe;var He="TabsTrigger",$e=c.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...s}=e,u=fe(He,n),l=Ye(n),m=Qe(u.baseId,r),h=Xe(u.baseId,r),d=r===u.value;return o.jsx(Un,{asChild:!0,...l,focusable:!a,active:d,children:o.jsx(V.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":h,"data-state":d?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:m,...s,ref:t,onMouseDown:F(e.onMouseDown,f=>{!a&&f.button===0&&f.ctrlKey===!1?u.onValueChange(r):f.preventDefault()}),onKeyDown:F(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&u.onValueChange(r)}),onFocus:F(e.onFocus,()=>{const f=u.activationMode!=="manual";!d&&!a&&f&&u.onValueChange(r)})})})});$e.displayName=He;var Ue="TabsContent",Be=c.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:s,...u}=e,l=fe(Ue,n),m=Qe(l.baseId,r),h=Xe(l.baseId,r),d=r===l.value,f=c.useRef(d);return c.useEffect(()=>{const b=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(b)},[]),o.jsx(Le,{present:a||d,children:({present:b})=>o.jsx(V.div,{"data-state":d?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":m,hidden:!b,id:h,tabIndex:0,...u,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:b&&s})})});Be.displayName=Ue;function Qe(e,t){return`${e}-trigger-${t}`}function Xe(e,t){return`${e}-content-${t}`}var zn=Ge,Ke=Ve,Je=$e,ze=Be;const Zn=zn,Ze=c.forwardRef(({className:e,...t},n)=>o.jsx(Ke,{ref:n,className:O("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Ze.displayName=Ke.displayName;const se=c.forwardRef(({className:e,...t},n)=>o.jsx(Je,{ref:n,className:O("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));se.displayName=Je.displayName;const ie=c.forwardRef(({className:e,...t},n)=>o.jsx(ze,{ref:n,className:O("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));ie.displayName=ze.displayName;function rr(){const[e,t]=c.useState("PENDING");return o.jsxs("div",{className:"container mx-auto py-6",children:[o.jsx("h1",{className:"mb-6 text-2xl font-bold",children:"성적 관리"}),o.jsx("div",{className:"mb-4",children:o.jsxs("select",{value:e,onChange:n=>t(n.target.value),className:"rounded border p-2",children:[o.jsx("option",{value:"PENDING",children:"대기중"}),o.jsx("option",{value:"APPROVED",children:"승인됨"}),o.jsx("option",{value:"REJECTED",children:"거절됨"})]})}),o.jsxs(Zn,{defaultValue:"gpa",children:[o.jsxs(Ze,{children:[o.jsx(se,{value:"gpa",children:"GPA 성적"}),o.jsx(se,{value:"language",children:"어학성적"})]}),o.jsx(ie,{value:"gpa",children:o.jsx(bn,{verifyFilter:e})}),o.jsx(ie,{value:"language",children:o.jsx(xn,{verifyFilter:e})})]})]})}export{rr as component}; diff --git a/apps/admin/.output/public/assets/login-BFKyXQqT.js b/apps/admin/.output/public/assets/login-BFKyXQqT.js new file mode 100644 index 00000000..f934c735 --- /dev/null +++ b/apps/admin/.output/public/assets/login-BFKyXQqT.js @@ -0,0 +1 @@ +import{r,j as a,u as R,s as S,b as D,t as N}from"./main-CMD0s_Sp.js";import{c as i,d as P,e as L,B as T,f as k}from"./client-ByMMc4SQ.js";const b=r.forwardRef(({className:t,...e},s)=>a.jsx("div",{ref:s,className:i("rounded-xl border bg-card text-card-foreground shadow",t),...e}));b.displayName="Card";const h=r.forwardRef(({className:t,...e},s)=>a.jsx("div",{ref:s,className:i("flex flex-col space-y-1.5 p-6",t),...e}));h.displayName="CardHeader";const g=r.forwardRef(({className:t,...e},s)=>a.jsx("div",{ref:s,className:i("font-semibold leading-none tracking-tight",t),...e}));g.displayName="CardTitle";const v=r.forwardRef(({className:t,...e},s)=>a.jsx("div",{ref:s,className:i("text-sm text-muted-foreground",t),...e}));v.displayName="CardDescription";const w=r.forwardRef(({className:t,...e},s)=>a.jsx("div",{ref:s,className:i("p-6 pt-0",t),...e}));w.displayName="CardContent";const E=r.forwardRef(({className:t,...e},s)=>a.jsx("div",{ref:s,className:i("flex items-center p-6 pt-0",t),...e}));E.displayName="CardFooter";const u=r.forwardRef(({className:t,type:e,...s},o)=>a.jsx("input",{type:e,className:i("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:o,...s}));u.displayName="Input";var F=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],I=F.reduce((t,e)=>{const s=P(`Primitive.${e}`),o=r.forwardRef((c,d)=>{const{asChild:l,...m}=c,n=l?s:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(n,{...m,ref:d})});return o.displayName=`Primitive.${e}`,{...t,[e]:o}},{}),A="Label",y=r.forwardRef((t,e)=>a.jsx(I.label,{...t,ref:e,onMouseDown:s=>{s.target.closest("button, input, select, textarea")||(t.onMouseDown?.(s),!s.defaultPrevented&&s.detail>1&&s.preventDefault())}}));y.displayName=A;var j=y;const M=L("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),x=r.forwardRef(({className:t,...e},s)=>a.jsx(j,{ref:s,className:i(M(),t),...e}));x.displayName=j.displayName;function B(){const t=R(),[e,s]=r.useState(""),[o,c]=r.useState(""),[d,l]=r.useState(!1),m=async n=>{n.preventDefault(),l(!0);try{const p=await k(e,o),{accessToken:f,refreshToken:C}=p.data;S(f),D(C),N("로그인 성공",{description:"관리자 페이지로 이동합니다."}),t({to:"/scores"})}catch(p){const f=p;N.error("로그인 실패",{description:f.response?.data?.message||"로그인에 실패했습니다."})}finally{l(!1)}};return a.jsx("div",{className:"flex h-screen items-center justify-center bg-slate-50",children:a.jsxs(b,{className:"w-[360px]",children:[a.jsxs(h,{className:"space-y-1 pb-4",children:[a.jsx(g,{className:"text-center text-xl",children:"관리자 로그인"}),a.jsx(v,{className:"text-center text-sm",children:"솔리드 커넥션 관리자 페이지입니다"})]}),a.jsx(w,{children:a.jsxs("form",{onSubmit:m,className:"space-y-3",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(x,{htmlFor:"email",className:"text-sm",children:"이메일"}),a.jsx(u,{id:"email",type:"email",placeholder:"admin@example.com",value:e,onChange:n=>s(n.target.value),disabled:d,required:!0,className:"h-9"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(x,{htmlFor:"password",className:"text-sm",children:"비밀번호"}),a.jsx(u,{id:"password",type:"password",value:o,onChange:n=>c(n.target.value),disabled:d,required:!0,className:"h-9"})]}),a.jsx(T,{type:"submit",className:"mt-2 h-9 w-full",disabled:d,children:d?"로그인 중...":"로그인"})]})})]})})}export{B as component}; diff --git a/apps/admin/.output/public/assets/main-CMD0s_Sp.js b/apps/admin/.output/public/assets/main-CMD0s_Sp.js new file mode 100644 index 00000000..1046f9c0 --- /dev/null +++ b/apps/admin/.output/public/assets/main-CMD0s_Sp.js @@ -0,0 +1,18 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-C5TecN1M.js","assets/client-ByMMc4SQ.js","assets/login-BFKyXQqT.js"])))=>i.map(i=>d[i]); +function ov(a,s){for(var i=0;io[c]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}function qy(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var hc={exports:{}},$i={};var Jm;function uv(){if(Jm)return $i;Jm=1;var a=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function i(o,c,f){var y=null;if(f!==void 0&&(y=""+f),c.key!==void 0&&(y=""+c.key),"key"in c){f={};for(var p in c)p!=="key"&&(f[p]=c[p])}else f=c;return c=f.ref,{$$typeof:a,type:o,key:y,ref:c!==void 0?c:null,props:f}}return $i.Fragment=s,$i.jsx=i,$i.jsxs=i,$i}var Fm;function cv(){return Fm||(Fm=1,hc.exports=uv()),hc.exports}var $=cv(),mc={exports:{}},mt={};var Pm;function fv(){if(Pm)return mt;Pm=1;var a=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),y=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),_=Symbol.iterator;function A(R){return R===null||typeof R!="object"?null:(R=_&&R[_]||R["@@iterator"],typeof R=="function"?R:null)}var O={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,z={};function U(R,j,X){this.props=R,this.context=j,this.refs=z,this.updater=X||O}U.prototype.isReactComponent={},U.prototype.setState=function(R,j){if(typeof R!="object"&&typeof R!="function"&&R!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,R,j,"setState")},U.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function J(){}J.prototype=U.prototype;function G(R,j,X){this.props=R,this.context=j,this.refs=z,this.updater=X||O}var V=G.prototype=new J;V.constructor=G,w(V,U.prototype),V.isPureReactComponent=!0;var I=Array.isArray;function W(){}var Z={H:null,A:null,T:null,S:null},Q=Object.prototype.hasOwnProperty;function P(R,j,X){var k=X.ref;return{$$typeof:a,type:R,key:j,ref:k!==void 0?k:null,props:X}}function dt(R,j){return P(R.type,j,R.props)}function it(R){return typeof R=="object"&&R!==null&&R.$$typeof===a}function ct(R){var j={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(X){return j[X]})}var at=/\/+/g;function bt(R,j){return typeof R=="object"&&R!==null&&R.key!=null?ct(""+R.key):j.toString(36)}function wt(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(W,W):(R.status="pending",R.then(function(j){R.status==="pending"&&(R.status="fulfilled",R.value=j)},function(j){R.status==="pending"&&(R.status="rejected",R.reason=j)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function N(R,j,X,k,tt){var rt=typeof R;(rt==="undefined"||rt==="boolean")&&(R=null);var yt=!1;if(R===null)yt=!0;else switch(rt){case"bigint":case"string":case"number":yt=!0;break;case"object":switch(R.$$typeof){case a:case s:yt=!0;break;case S:return yt=R._init,N(yt(R._payload),j,X,k,tt)}}if(yt)return tt=tt(R),yt=k===""?"."+bt(R,0):k,I(tt)?(X="",yt!=null&&(X=yt.replace(at,"$&/")+"/"),N(tt,j,X,"",function(be){return be})):tt!=null&&(it(tt)&&(tt=dt(tt,X+(tt.key==null||R&&R.key===tt.key?"":(""+tt.key).replace(at,"$&/")+"/")+yt)),j.push(tt)),1;yt=0;var ht=k===""?".":k+":";if(I(R))for(var At=0;At>>1,pt=N[St];if(0>>1;Stc(X,lt))kc(tt,X)?(N[St]=tt,N[k]=lt,St=k):(N[St]=X,N[j]=lt,St=j);else if(kc(tt,lt))N[St]=tt,N[k]=lt,St=k;else break t}}return K}function c(N,K){var lt=N.sortIndex-K.sortIndex;return lt!==0?lt:N.id-K.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;a.unstable_now=function(){return f.now()}}else{var y=Date,p=y.now();a.unstable_now=function(){return y.now()-p}}var g=[],m=[],S=1,h=null,_=3,A=!1,O=!1,w=!1,z=!1,U=typeof setTimeout=="function"?setTimeout:null,J=typeof clearTimeout=="function"?clearTimeout:null,G=typeof setImmediate<"u"?setImmediate:null;function V(N){for(var K=i(m);K!==null;){if(K.callback===null)o(m);else if(K.startTime<=N)o(m),K.sortIndex=K.expirationTime,s(g,K);else break;K=i(m)}}function I(N){if(w=!1,V(N),!O)if(i(g)!==null)O=!0,W||(W=!0,ct());else{var K=i(m);K!==null&&wt(I,K.startTime-N)}}var W=!1,Z=-1,Q=5,P=-1;function dt(){return z?!0:!(a.unstable_now()-PN&&dt());){var St=h.callback;if(typeof St=="function"){h.callback=null,_=h.priorityLevel;var pt=St(h.expirationTime<=N);if(N=a.unstable_now(),typeof pt=="function"){h.callback=pt,V(N),K=!0;break e}h===i(g)&&o(g),V(N)}else o(g);h=i(g)}if(h!==null)K=!0;else{var R=i(m);R!==null&&wt(I,R.startTime-N),K=!1}}break t}finally{h=null,_=lt,A=!1}K=void 0}}finally{K?ct():W=!1}}}var ct;if(typeof G=="function")ct=function(){G(it)};else if(typeof MessageChannel<"u"){var at=new MessageChannel,bt=at.port2;at.port1.onmessage=it,ct=function(){bt.postMessage(null)}}else ct=function(){U(it,0)};function wt(N,K){Z=U(function(){N(a.unstable_now())},K)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(N){N.callback=null},a.unstable_forceFrameRate=function(N){0>N||125St?(N.sortIndex=lt,s(m,N),i(g)===null&&N===i(m)&&(w?(J(Z),Z=-1):w=!0,wt(I,lt-St))):(N.sortIndex=pt,s(g,N),O||A||(O=!0,W||(W=!0,ct()))),N},a.unstable_shouldYield=dt,a.unstable_wrapCallback=function(N){var K=_;return function(){var lt=_;_=K;try{return N.apply(this,arguments)}finally{_=lt}}}})(gc)),gc}var Im;function mv(){return Im||(Im=1,pc.exports=hv()),pc.exports}var vc={exports:{}},ve={};var ty;function yv(){if(ty)return ve;ty=1;var a=fs();function s(g){var m="https://react.dev/errors/"+g;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(s){console.error(s)}}return a(),vc.exports=yv(),vc.exports}var ny;function pv(){if(ny)return Wi;ny=1;var a=mv(),s=fs(),i=Gy();function o(t){var e="https://react.dev/errors/"+t;if(1pt||(t.current=St[pt],St[pt]=null,pt--)}function X(t,e){pt++,St[pt]=t.current,t.current=e}var k=R(null),tt=R(null),rt=R(null),yt=R(null);function ht(t,e){switch(X(rt,e),X(tt,t),X(k,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?gm(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=gm(e),t=vm(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}j(k),X(k,t)}function At(){j(k),j(tt),j(rt)}function be(t){t.memoizedState!==null&&X(yt,t);var e=k.current,n=vm(e,t.type);e!==n&&(X(tt,t),X(k,n))}function Re(t){tt.current===t&&(j(k),j(tt)),yt.current===t&&(j(yt),Ki._currentValue=lt)}var Ye,za;function qe(t){if(Ye===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Ye=e&&e[1]||"",za=-1)":-1r||E[l]!==D[r]){var H=` +`+E[l].replace(" at new "," at ");return t.displayName&&H.includes("")&&(H=H.replace("",t.displayName)),H}while(1<=l&&0<=r);break}}}finally{Jn=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?qe(n):""}function xe(t,e){switch(t.tag){case 26:case 27:case 5:return qe(t.type);case 16:return qe("Lazy");case 13:return t.child!==e&&e!==null?qe("Suspense Fallback"):qe("Suspense");case 19:return qe("SuspenseList");case 0:case 15:return En(t.type,!1);case 11:return En(t.type.render,!1);case 1:return En(t.type,!0);case 31:return qe("Activity");default:return""}}function Tn(t){try{var e="",n=null;do e+=xe(t,n),n=t,t=t.return;while(t);return e}catch(l){return` +Error generating stack: `+l.message+` +`+l.stack}}var Kt=Object.prototype.hasOwnProperty,Ca=a.unstable_scheduleCallback,Da=a.unstable_cancelCallback,se=a.unstable_shouldYield,dn=a.unstable_requestPaint,ce=a.unstable_now,si=a.unstable_getCurrentPriorityLevel,Dt=a.unstable_ImmediatePriority,te=a.unstable_UserBlockingPriority,ee=a.unstable_NormalPriority,Fn=a.unstable_LowPriority,Rn=a.unstable_IdlePriority,hs=a.log,Pn=a.unstable_setDisableYieldValue,Na=null,_e=null;function rn(t){if(typeof hs=="function"&&Pn(t),_e&&typeof _e.setStrictMode=="function")try{_e.setStrictMode(Na,t)}catch{}}var pe=Math.clz32?Math.clz32:hn,eo=Math.log,ri=Math.LN2;function hn(t){return t>>>=0,t===0?32:31-(eo(t)/ri|0)|0}var ul=256,cl=262144,La=4194304;function mn(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function ft(t,e,n){var l=t.pendingLanes;if(l===0)return 0;var r=0,u=t.suspendedLanes,d=t.pingedLanes;t=t.warmLanes;var v=l&134217727;return v!==0?(l=v&~u,l!==0?r=mn(l):(d&=v,d!==0?r=mn(d):n||(n=v&~t,n!==0&&(r=mn(n))))):(v=l&~u,v!==0?r=mn(v):d!==0?r=mn(d):n||(n=l&~t,n!==0&&(r=mn(n)))),r===0?0:e!==0&&e!==r&&(e&u)===0&&(u=r&-r,n=e&-e,u>=n||u===32&&(n&4194048)!==0)?e:r}function Vt(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function re(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ge(){var t=La;return La<<=1,(La&62914560)===0&&(La=4194304),t}function $n(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Qt(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function we(t,e,n,l,r,u){var d=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var v=t.entanglements,E=t.expirationTimes,D=t.hiddenUpdates;for(n=d&~n;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var ng=/[\n"\\]/g;function Fe(t){return t.replace(ng,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function so(t,e,n,l,r,u,d,v){t.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?t.type=d:t.removeAttribute("type"),e!=null?d==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+Je(e)):t.value!==""+Je(e)&&(t.value=""+Je(e)):d!=="submit"&&d!=="reset"||t.removeAttribute("value"),e!=null?ro(t,d,Je(e)):n!=null?ro(t,d,Je(n)):l!=null&&t.removeAttribute("value"),r==null&&u!=null&&(t.defaultChecked=!!u),r!=null&&(t.checked=r&&typeof r!="function"&&typeof r!="symbol"),v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?t.name=""+Je(v):t.removeAttribute("name")}function ff(t,e,n,l,r,u,d,v){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(t.type=u),e!=null||n!=null){if(!(u!=="submit"&&u!=="reset"||e!=null)){io(t);return}n=n!=null?""+Je(n):"",e=e!=null?""+Je(e):n,v||e===t.value||(t.value=e),t.defaultValue=e}l=l??r,l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=v?t.checked:!!l,t.defaultChecked=!!l,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(t.name=d),io(t)}function ro(t,e,n){e==="number"&&ps(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function gl(t,e,n,l){if(t=t.options,e){e={};for(var r=0;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ho=!1;if(An)try{var fi={};Object.defineProperty(fi,"passive",{get:function(){ho=!0}}),window.addEventListener("test",fi,fi),window.removeEventListener("test",fi,fi)}catch{ho=!1}var In=null,mo=null,vs=null;function vf(){if(vs)return vs;var t,e=mo,n=e.length,l,r="value"in In?In.value:In.textContent,u=r.length;for(t=0;t=mi),Rf=" ",xf=!1;function wf(t,e){switch(t){case"keyup":return zg.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Af(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var _l=!1;function Dg(t,e){switch(t){case"compositionend":return Af(e);case"keypress":return e.which!==32?null:(xf=!0,Rf);case"textInput":return t=e.data,t===Rf&&xf?null:t;default:return null}}function Ng(t,e){if(_l)return t==="compositionend"||!So&&wf(t,e)?(t=vf(),vs=mo=In=null,_l=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=l}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=Uf(n)}}function Hf(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Hf(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function jf(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=ps(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=ps(t.document)}return e}function Eo(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var Gg=An&&"documentMode"in document&&11>=document.documentMode,El=null,To=null,vi=null,Ro=!1;function Yf(t,e,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ro||El==null||El!==ps(l)||(l=El,"selectionStart"in l&&Eo(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),vi&&gi(vi,l)||(vi=l,l=fr(To,"onSelect"),0>=d,r-=d,yn=1<<32-pe(e)+r|n<vt?(Rt=nt,nt=null):Rt=nt.sibling;var Ot=L(M,nt,C[vt],Y);if(Ot===null){nt===null&&(nt=Rt);break}t&&nt&&Ot.alternate===null&&e(M,nt),x=u(Ot,x,vt),Mt===null?st=Ot:Mt.sibling=Ot,Mt=Ot,nt=Rt}if(vt===C.length)return n(M,nt),xt&&On(M,vt),st;if(nt===null){for(;vtvt?(Rt=nt,nt=null):Rt=nt.sibling;var _a=L(M,nt,Ot.value,Y);if(_a===null){nt===null&&(nt=Rt);break}t&&nt&&_a.alternate===null&&e(M,nt),x=u(_a,x,vt),Mt===null?st=_a:Mt.sibling=_a,Mt=_a,nt=Rt}if(Ot.done)return n(M,nt),xt&&On(M,vt),st;if(nt===null){for(;!Ot.done;vt++,Ot=C.next())Ot=q(M,Ot.value,Y),Ot!==null&&(x=u(Ot,x,vt),Mt===null?st=Ot:Mt.sibling=Ot,Mt=Ot);return xt&&On(M,vt),st}for(nt=l(nt);!Ot.done;vt++,Ot=C.next())Ot=B(nt,M,vt,Ot.value,Y),Ot!==null&&(t&&Ot.alternate!==null&&nt.delete(Ot.key===null?vt:Ot.key),x=u(Ot,x,vt),Mt===null?st=Ot:Mt.sibling=Ot,Mt=Ot);return t&&nt.forEach(function(rv){return e(M,rv)}),xt&&On(M,vt),st}function Ht(M,x,C,Y){if(typeof C=="object"&&C!==null&&C.type===w&&C.key===null&&(C=C.props.children),typeof C=="object"&&C!==null){switch(C.$$typeof){case A:t:{for(var st=C.key;x!==null;){if(x.key===st){if(st=C.type,st===w){if(x.tag===7){n(M,x.sibling),Y=r(x,C.props.children),Y.return=M,M=Y;break t}}else if(x.elementType===st||typeof st=="object"&&st!==null&&st.$$typeof===Q&&ka(st)===x.type){n(M,x.sibling),Y=r(x,C.props),Ri(Y,C),Y.return=M,M=Y;break t}n(M,x);break}else e(M,x);x=x.sibling}C.type===w?(Y=Ga(C.props.children,M.mode,Y,C.key),Y.return=M,M=Y):(Y=Ms(C.type,C.key,C.props,null,M.mode,Y),Ri(Y,C),Y.return=M,M=Y)}return d(M);case O:t:{for(st=C.key;x!==null;){if(x.key===st)if(x.tag===4&&x.stateNode.containerInfo===C.containerInfo&&x.stateNode.implementation===C.implementation){n(M,x.sibling),Y=r(x,C.children||[]),Y.return=M,M=Y;break t}else{n(M,x);break}else e(M,x);x=x.sibling}Y=Co(C,M.mode,Y),Y.return=M,M=Y}return d(M);case Q:return C=ka(C),Ht(M,x,C,Y)}if(wt(C))return et(M,x,C,Y);if(ct(C)){if(st=ct(C),typeof st!="function")throw Error(o(150));return C=st.call(C),ut(M,x,C,Y)}if(typeof C.then=="function")return Ht(M,x,Us(C),Y);if(C.$$typeof===G)return Ht(M,x,Cs(M,C),Y);Bs(M,C)}return typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint"?(C=""+C,x!==null&&x.tag===6?(n(M,x.sibling),Y=r(x,C),Y.return=M,M=Y):(n(M,x),Y=zo(C,M.mode,Y),Y.return=M,M=Y),d(M)):n(M,x)}return function(M,x,C,Y){try{Ti=0;var st=Ht(M,x,C,Y);return Nl=null,st}catch(nt){if(nt===Dl||nt===Ns)throw nt;var Mt=Ve(29,nt,null,M.mode);return Mt.lanes=Y,Mt.return=M,Mt}}}var Ja=od(!0),ud=od(!1),la=!1;function Xo(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qo(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function ia(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function sa(t,e,n){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(Ct&2)!==0){var r=l.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),l.pending=e,e=As(t),kf(t,null,n),e}return ws(t,l,e,n),As(t)}function xi(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var l=e.lanes;l&=t.pendingLanes,n|=l,e.lanes=n,Ae(t,n)}}function Zo(t,e){var n=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var r=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var d={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};u===null?r=u=d:u=u.next=d,n=n.next}while(n!==null);u===null?r=u=e:u=u.next=e}else r=u=e;n={baseState:l.baseState,firstBaseUpdate:r,lastBaseUpdate:u,shared:l.shared,callbacks:l.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var ko=!1;function wi(){if(ko){var t=Cl;if(t!==null)throw t}}function Ai(t,e,n,l){ko=!1;var r=t.updateQueue;la=!1;var u=r.firstBaseUpdate,d=r.lastBaseUpdate,v=r.shared.pending;if(v!==null){r.shared.pending=null;var E=v,D=E.next;E.next=null,d===null?u=D:d.next=D,d=E;var H=t.alternate;H!==null&&(H=H.updateQueue,v=H.lastBaseUpdate,v!==d&&(v===null?H.firstBaseUpdate=D:v.next=D,H.lastBaseUpdate=E))}if(u!==null){var q=r.baseState;d=0,H=D=E=null,v=u;do{var L=v.lane&-536870913,B=L!==v.lane;if(B?(Tt&L)===L:(l&L)===L){L!==0&&L===zl&&(ko=!0),H!==null&&(H=H.next={lane:0,tag:v.tag,payload:v.payload,callback:null,next:null});t:{var et=t,ut=v;L=e;var Ht=n;switch(ut.tag){case 1:if(et=ut.payload,typeof et=="function"){q=et.call(Ht,q,L);break t}q=et;break t;case 3:et.flags=et.flags&-65537|128;case 0:if(et=ut.payload,L=typeof et=="function"?et.call(Ht,q,L):et,L==null)break t;q=h({},q,L);break t;case 2:la=!0}}L=v.callback,L!==null&&(t.flags|=64,B&&(t.flags|=8192),B=r.callbacks,B===null?r.callbacks=[L]:B.push(L))}else B={lane:L,tag:v.tag,payload:v.payload,callback:v.callback,next:null},H===null?(D=H=B,E=q):H=H.next=B,d|=L;if(v=v.next,v===null){if(v=r.shared.pending,v===null)break;B=v,v=B.next,B.next=null,r.lastBaseUpdate=B,r.shared.pending=null}}while(!0);H===null&&(E=q),r.baseState=E,r.firstBaseUpdate=D,r.lastBaseUpdate=H,u===null&&(r.shared.lanes=0),fa|=d,t.lanes=d,t.memoizedState=q}}function cd(t,e){if(typeof t!="function")throw Error(o(191,t));t.call(e)}function fd(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;tu?u:8;var d=N.T,v={};N.T=v,fu(t,!1,e,n);try{var E=r(),D=N.S;if(D!==null&&D(v,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var H=Pg(E,l);zi(t,e,H,Ke(t))}else zi(t,e,l,Ke(t))}catch(q){zi(t,e,{then:function(){},status:"rejected",reason:q},Ke())}finally{K.p=u,d!==null&&v.types!==null&&(d.types=v.types),N.T=d}}function n0(){}function uu(t,e,n,l){if(t.tag!==5)throw Error(o(476));var r=Xd(t).queue;Vd(t,r,e,lt,n===null?n0:function(){return Qd(t),n(l)})}function Xd(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:lt,baseState:lt,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nn,lastRenderedState:lt},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nn,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function Qd(t){var e=Xd(t);e.next===null&&(e=t.alternate.memoizedState),zi(t,e.next.queue,{},Ke())}function cu(){return he(Ki)}function Zd(){return Ft().memoizedState}function kd(){return Ft().memoizedState}function a0(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=Ke();t=ia(n);var l=sa(e,t,n);l!==null&&(Ue(l,e,n),xi(l,e,n)),e={cache:Yo()},t.payload=e;return}e=e.return}}function l0(t,e,n){var l=Ke();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ks(t)?Jd(e,n):(n=Mo(t,e,n,l),n!==null&&(Ue(n,t,l),Fd(n,e,l)))}function Kd(t,e,n){var l=Ke();zi(t,e,n,l)}function zi(t,e,n,l){var r={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ks(t))Jd(e,r);else{var u=t.alternate;if(t.lanes===0&&(u===null||u.lanes===0)&&(u=e.lastRenderedReducer,u!==null))try{var d=e.lastRenderedState,v=u(d,n);if(r.hasEagerState=!0,r.eagerState=v,Ge(v,d))return ws(t,e,r,0),jt===null&&xs(),!1}catch{}if(n=Mo(t,e,r,l),n!==null)return Ue(n,t,l),Fd(n,e,l),!0}return!1}function fu(t,e,n,l){if(l={lane:2,revertLane:Xu(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ks(t)){if(e)throw Error(o(479))}else e=Mo(t,n,l,2),e!==null&&Ue(e,t,2)}function ks(t){var e=t.alternate;return t===gt||e!==null&&e===gt}function Jd(t,e){Ul=Ys=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Fd(t,e,n){if((n&4194048)!==0){var l=e.lanes;l&=t.pendingLanes,n|=l,e.lanes=n,Ae(t,n)}}var Ci={readContext:he,use:Vs,useCallback:Zt,useContext:Zt,useEffect:Zt,useImperativeHandle:Zt,useLayoutEffect:Zt,useInsertionEffect:Zt,useMemo:Zt,useReducer:Zt,useRef:Zt,useState:Zt,useDebugValue:Zt,useDeferredValue:Zt,useTransition:Zt,useSyncExternalStore:Zt,useId:Zt,useHostTransitionStatus:Zt,useFormState:Zt,useActionState:Zt,useOptimistic:Zt,useMemoCache:Zt,useCacheRefresh:Zt};Ci.useEffectEvent=Zt;var Pd={readContext:he,use:Vs,useCallback:function(t,e){return Ee().memoizedState=[t,e===void 0?null:e],t},useContext:he,useEffect:Nd,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,Qs(4194308,4,Hd.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Qs(4194308,4,t,e)},useInsertionEffect:function(t,e){Qs(4,2,t,e)},useMemo:function(t,e){var n=Ee();e=e===void 0?null:e;var l=t();if(Fa){rn(!0);try{t()}finally{rn(!1)}}return n.memoizedState=[l,e],l},useReducer:function(t,e,n){var l=Ee();if(n!==void 0){var r=n(e);if(Fa){rn(!0);try{n(e)}finally{rn(!1)}}}else r=e;return l.memoizedState=l.baseState=r,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},l.queue=t,t=t.dispatch=l0.bind(null,gt,t),[l.memoizedState,t]},useRef:function(t){var e=Ee();return t={current:t},e.memoizedState=t},useState:function(t){t=lu(t);var e=t.queue,n=Kd.bind(null,gt,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:ru,useDeferredValue:function(t,e){var n=Ee();return ou(n,t,e)},useTransition:function(){var t=lu(!1);return t=Vd.bind(null,gt,t.queue,!0,!1),Ee().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var l=gt,r=Ee();if(xt){if(n===void 0)throw Error(o(407));n=n()}else{if(n=e(),jt===null)throw Error(o(349));(Tt&127)!==0||gd(l,e,n)}r.memoizedState=n;var u={value:n,getSnapshot:e};return r.queue=u,Nd(Sd.bind(null,l,u,t),[t]),l.flags|=2048,Hl(9,{destroy:void 0},vd.bind(null,l,u,n,e),null),n},useId:function(){var t=Ee(),e=jt.identifierPrefix;if(xt){var n=pn,l=yn;n=(l&~(1<<32-pe(l)-1)).toString(32)+n,e="_"+e+"R_"+n,n=qs++,0<\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof l.is=="string"?d.createElement("select",{is:l.is}):d.createElement("select"),l.multiple?u.multiple=!0:l.size&&(u.size=l.size);break;default:u=typeof l.is=="string"?d.createElement(r,{is:l.is}):d.createElement(r)}}u[fe]=e,u[Oe]=l;t:for(d=e.child;d!==null;){if(d.tag===5||d.tag===6)u.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break t;for(;d.sibling===null;){if(d.return===null||d.return===e)break t;d=d.return}d.sibling.return=d.return,d=d.sibling}e.stateNode=u;t:switch(ye(u,r,l),r){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break t;case"img":l=!0;break t;default:l=!1}l&&Un(e)}}return Gt(e),xu(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==l&&Un(e);else{if(typeof l!="string"&&e.stateNode===null)throw Error(o(166));if(t=rt.current,Ml(e)){if(t=e.stateNode,n=e.memoizedProps,l=null,r=de,r!==null)switch(r.tag){case 27:case 5:l=r.memoizedProps}t[fe]=e,t=!!(t.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||ym(t.nodeValue,n)),t||na(e,!0)}else t=dr(t).createTextNode(l),t[fe]=e,e.stateNode=t}return Gt(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(l=Ml(e),n!==null){if(t===null){if(!l)throw Error(o(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(557));t[fe]=e}else Va(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Gt(e),t=!1}else n=Uo(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(Qe(e),e):(Qe(e),null);if((e.flags&128)!==0)throw Error(o(558))}return Gt(e),null;case 13:if(l=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(r=Ml(e),l!==null&&l.dehydrated!==null){if(t===null){if(!r)throw Error(o(318));if(r=e.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(o(317));r[fe]=e}else Va(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Gt(e),r=!1}else r=Uo(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),r=!0;if(!r)return e.flags&256?(Qe(e),e):(Qe(e),null)}return Qe(e),(e.flags&128)!==0?(e.lanes=n,e):(n=l!==null,t=t!==null&&t.memoizedState!==null,n&&(l=e.child,r=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(r=l.alternate.memoizedState.cachePool.pool),u=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),u!==r&&(l.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),$s(e,e.updateQueue),Gt(e),null);case 4:return At(),t===null&&Ku(e.stateNode.containerInfo),Gt(e),null;case 10:return Cn(e.type),Gt(e),null;case 19:if(j(Jt),l=e.memoizedState,l===null)return Gt(e),null;if(r=(e.flags&128)!==0,u=l.rendering,u===null)if(r)Ni(l,!1);else{if(kt!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(u=js(t),u!==null){for(e.flags|=128,Ni(l,!1),t=u.updateQueue,e.updateQueue=t,$s(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)Kf(n,t),n=n.sibling;return X(Jt,Jt.current&1|2),xt&&On(e,l.treeForkCount),e.child}t=t.sibling}l.tail!==null&&ce()>nr&&(e.flags|=128,r=!0,Ni(l,!1),e.lanes=4194304)}else{if(!r)if(t=js(u),t!==null){if(e.flags|=128,r=!0,t=t.updateQueue,e.updateQueue=t,$s(e,t),Ni(l,!0),l.tail===null&&l.tailMode==="hidden"&&!u.alternate&&!xt)return Gt(e),null}else 2*ce()-l.renderingStartTime>nr&&n!==536870912&&(e.flags|=128,r=!0,Ni(l,!1),e.lanes=4194304);l.isBackwards?(u.sibling=e.child,e.child=u):(t=l.last,t!==null?t.sibling=u:e.child=u,l.last=u)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=ce(),t.sibling=null,n=Jt.current,X(Jt,r?n&1|2:n&1),xt&&On(e,l.treeForkCount),t):(Gt(e),null);case 22:case 23:return Qe(e),Jo(),l=e.memoizedState!==null,t!==null?t.memoizedState!==null!==l&&(e.flags|=8192):l&&(e.flags|=8192),l?(n&536870912)!==0&&(e.flags&128)===0&&(Gt(e),e.subtreeFlags&6&&(e.flags|=8192)):Gt(e),n=e.updateQueue,n!==null&&$s(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),l=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),l!==n&&(e.flags|=2048),t!==null&&j(Za),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),Cn(Pt),Gt(e),null;case 25:return null;case 30:return null}throw Error(o(156,e.tag))}function u0(t,e){switch(No(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Cn(Pt),At(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return Re(e),null;case 31:if(e.memoizedState!==null){if(Qe(e),e.alternate===null)throw Error(o(340));Va()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(Qe(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(o(340));Va()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return j(Jt),null;case 4:return At(),null;case 10:return Cn(e.type),null;case 22:case 23:return Qe(e),Jo(),t!==null&&j(Za),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Cn(Pt),null;case 25:return null;default:return null}}function bh(t,e){switch(No(e),e.tag){case 3:Cn(Pt),At();break;case 26:case 27:case 5:Re(e);break;case 4:At();break;case 31:e.memoizedState!==null&&Qe(e);break;case 13:Qe(e);break;case 19:j(Jt);break;case 10:Cn(e.type);break;case 22:case 23:Qe(e),Jo(),t!==null&&j(Za);break;case 24:Cn(Pt)}}function Li(t,e){try{var n=e.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var r=l.next;n=r;do{if((n.tag&t)===t){l=void 0;var u=n.create,d=n.inst;l=u(),d.destroy=l}n=n.next}while(n!==r)}}catch(v){Lt(e,e.return,v)}}function ua(t,e,n){try{var l=e.updateQueue,r=l!==null?l.lastEffect:null;if(r!==null){var u=r.next;l=u;do{if((l.tag&t)===t){var d=l.inst,v=d.destroy;if(v!==void 0){d.destroy=void 0,r=e;var E=n,D=v;try{D()}catch(H){Lt(r,E,H)}}}l=l.next}while(l!==u)}}catch(H){Lt(e,e.return,H)}}function _h(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{fd(e,n)}catch(l){Lt(t,t.return,l)}}}function Eh(t,e,n){n.props=Pa(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(l){Lt(t,e,l)}}function Ui(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}typeof n=="function"?t.refCleanup=n(l):n.current=l}}catch(r){Lt(t,e,r)}}function gn(t,e){var n=t.ref,l=t.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(r){Lt(t,e,r)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){Lt(t,e,r)}else n.current=null}function Th(t){var e=t.type,n=t.memoizedProps,l=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break t;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(r){Lt(t,t.return,r)}}function wu(t,e,n){try{var l=t.stateNode;C0(l,t.type,n,e),l[Oe]=e}catch(r){Lt(t,t.return,r)}}function Rh(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&pa(t.type)||t.tag===4}function Au(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||Rh(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&pa(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Mu(t,e,n){var l=t.tag;if(l===5||l===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=wn));else if(l!==4&&(l===27&&pa(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(Mu(t,e,n),t=t.sibling;t!==null;)Mu(t,e,n),t=t.sibling}function Ws(t,e,n){var l=t.tag;if(l===5||l===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(l!==4&&(l===27&&pa(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(Ws(t,e,n),t=t.sibling;t!==null;)Ws(t,e,n),t=t.sibling}function xh(t){var e=t.stateNode,n=t.memoizedProps;try{for(var l=t.type,r=e.attributes;r.length;)e.removeAttributeNode(r[0]);ye(e,l,n),e[fe]=t,e[Oe]=n}catch(u){Lt(t,t.return,u)}}var Bn=!1,It=!1,Ou=!1,wh=typeof WeakSet=="function"?WeakSet:Set,ue=null;function c0(t,e){if(t=t.containerInfo,Pu=Sr,t=jf(t),Eo(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else t:{n=(n=t.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var r=l.anchorOffset,u=l.focusNode;l=l.focusOffset;try{n.nodeType,u.nodeType}catch{n=null;break t}var d=0,v=-1,E=-1,D=0,H=0,q=t,L=null;e:for(;;){for(var B;q!==n||r!==0&&q.nodeType!==3||(v=d+r),q!==u||l!==0&&q.nodeType!==3||(E=d+l),q.nodeType===3&&(d+=q.nodeValue.length),(B=q.firstChild)!==null;)L=q,q=B;for(;;){if(q===t)break e;if(L===n&&++D===r&&(v=d),L===u&&++H===l&&(E=d),(B=q.nextSibling)!==null)break;q=L,L=q.parentNode}q=B}n=v===-1||E===-1?null:{start:v,end:E}}else n=null}n=n||{start:0,end:0}}else n=null;for($u={focusedElem:t,selectionRange:n},Sr=!1,ue=e;ue!==null;)if(e=ue,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ue=t;else for(;ue!==null;){switch(e=ue,u=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n title"))),ye(u,l,n),u[fe]=t,oe(u),l=u;break t;case"link":var d=Dm("link","href",r).get(l+(n.href||""));if(d){for(var v=0;vHt&&(d=Ht,Ht=ut,ut=d);var M=Bf(v,ut),x=Bf(v,Ht);if(M&&x&&(B.rangeCount!==1||B.anchorNode!==M.node||B.anchorOffset!==M.offset||B.focusNode!==x.node||B.focusOffset!==x.offset)){var C=q.createRange();C.setStart(M.node,M.offset),B.removeAllRanges(),ut>Ht?(B.addRange(C),B.extend(x.node,x.offset)):(C.setEnd(x.node,x.offset),B.addRange(C))}}}}for(q=[],B=v;B=B.parentNode;)B.nodeType===1&&q.push({element:B,left:B.scrollLeft,top:B.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;vn?32:n,N.T=null,n=Bu,Bu=null;var u=ha,d=Gn;if(ne=0,Vl=ha=null,Gn=0,(Ct&6)!==0)throw Error(o(331));var v=Ct;if(Ct|=4,Hh(u.current),Lh(u,u.current,d,n),Ct=v,Gi(0,!1),_e&&typeof _e.onPostCommitFiberRoot=="function")try{_e.onPostCommitFiberRoot(Na,u)}catch{}return!0}finally{K.p=r,N.T=l,em(t,e)}}function am(t,e,n){e=$e(n,e),e=yu(t.stateNode,e,2),t=sa(t,e,2),t!==null&&(Qt(t,2),vn(t))}function Lt(t,e,n){if(t.tag===3)am(t,t,n);else for(;e!==null;){if(e.tag===3){am(e,t,n);break}else if(e.tag===1){var l=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(da===null||!da.has(l))){t=$e(n,t),n=lh(2),l=sa(e,n,2),l!==null&&(ih(n,l,e,t),Qt(l,2),vn(l));break}}e=e.return}}function qu(t,e,n){var l=t.pingCache;if(l===null){l=t.pingCache=new h0;var r=new Set;l.set(e,r)}else r=l.get(e),r===void 0&&(r=new Set,l.set(e,r));r.has(n)||(Du=!0,r.add(n),t=v0.bind(null,t,e,n),e.then(t,t))}function v0(t,e,n){var l=t.pingCache;l!==null&&l.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,jt===t&&(Tt&n)===n&&(kt===4||kt===3&&(Tt&62914560)===Tt&&300>ce()-er?(Ct&2)===0&&Xl(t,0):Nu|=n,Gl===Tt&&(Gl=0)),vn(t)}function lm(t,e){e===0&&(e=ge()),t=qa(t,e),t!==null&&(Qt(t,e),vn(t))}function S0(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),lm(t,n)}function b0(t,e){var n=0;switch(t.tag){case 31:case 13:var l=t.stateNode,r=t.memoizedState;r!==null&&(n=r.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(e),lm(t,n)}function _0(t,e){return Ca(t,e)}var or=null,Zl=null,Gu=!1,ur=!1,Vu=!1,ya=0;function vn(t){t!==Zl&&t.next===null&&(Zl===null?or=Zl=t:Zl=Zl.next=t),ur=!0,Gu||(Gu=!0,T0())}function Gi(t,e){if(!Vu&&ur){Vu=!0;do for(var n=!1,l=or;l!==null;){if(t!==0){var r=l.pendingLanes;if(r===0)var u=0;else{var d=l.suspendedLanes,v=l.pingedLanes;u=(1<<31-pe(42|t)+1)-1,u&=r&~(d&~v),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(n=!0,om(l,u))}else u=Tt,u=ft(l,l===jt?u:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(u&3)===0||Vt(l,u)||(n=!0,om(l,u));l=l.next}while(n);Vu=!1}}function E0(){im()}function im(){ur=Gu=!1;var t=0;ya!==0&&N0()&&(t=ya);for(var e=ce(),n=null,l=or;l!==null;){var r=l.next,u=sm(l,e);u===0?(l.next=null,n===null?or=r:n.next=r,r===null&&(Zl=n)):(n=l,(t!==0||(u&3)!==0)&&(ur=!0)),l=r}ne!==0&&ne!==5||Gi(t),ya!==0&&(ya=0)}function sm(t,e){for(var n=t.suspendedLanes,l=t.pingedLanes,r=t.expirationTimes,u=t.pendingLanes&-62914561;0v)break;var H=E.transferSize,q=E.initiatorType;H&&pm(q)&&(E=E.responseEnd,d+=H*(E"u"?null:document;function Mm(t,e,n){var l=kl;if(l&&typeof e=="string"&&e){var r=Fe(e);r='link[rel="'+t+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),Am.has(r)||(Am.add(r),t={rel:t,crossOrigin:n,href:e},l.querySelector(r)===null&&(e=l.createElement("link"),ye(e,"link",t),oe(e),l.head.appendChild(e)))}}function V0(t){Vn.D(t),Mm("dns-prefetch",t,null)}function X0(t,e){Vn.C(t,e),Mm("preconnect",t,e)}function Q0(t,e,n){Vn.L(t,e,n);var l=kl;if(l&&t&&e){var r='link[rel="preload"][as="'+Fe(e)+'"]';e==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+Fe(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+Fe(n.imageSizes)+'"]')):r+='[href="'+Fe(t)+'"]';var u=r;switch(e){case"style":u=Kl(t);break;case"script":u=Jl(t)}an.has(u)||(t=h({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),an.set(u,t),l.querySelector(r)!==null||e==="style"&&l.querySelector(Zi(u))||e==="script"&&l.querySelector(ki(u))||(e=l.createElement("link"),ye(e,"link",t),oe(e),l.head.appendChild(e)))}}function Z0(t,e){Vn.m(t,e);var n=kl;if(n&&t){var l=e&&typeof e.as=="string"?e.as:"script",r='link[rel="modulepreload"][as="'+Fe(l)+'"][href="'+Fe(t)+'"]',u=r;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Jl(t)}if(!an.has(u)&&(t=h({rel:"modulepreload",href:t},e),an.set(u,t),n.querySelector(r)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(ki(u)))return}l=n.createElement("link"),ye(l,"link",t),oe(l),n.head.appendChild(l)}}}function k0(t,e,n){Vn.S(t,e,n);var l=kl;if(l&&t){var r=yl(l).hoistableStyles,u=Kl(t);e=e||"default";var d=r.get(u);if(!d){var v={loading:0,preload:null};if(d=l.querySelector(Zi(u)))v.loading=5;else{t=h({rel:"stylesheet",href:t,"data-precedence":e},n),(n=an.get(u))&&lc(t,n);var E=d=l.createElement("link");oe(E),ye(E,"link",t),E._p=new Promise(function(D,H){E.onload=D,E.onerror=H}),E.addEventListener("load",function(){v.loading|=1}),E.addEventListener("error",function(){v.loading|=2}),v.loading|=4,mr(d,e,l)}d={type:"stylesheet",instance:d,count:1,state:v},r.set(u,d)}}}function K0(t,e){Vn.X(t,e);var n=kl;if(n&&t){var l=yl(n).hoistableScripts,r=Jl(t),u=l.get(r);u||(u=n.querySelector(ki(r)),u||(t=h({src:t,async:!0},e),(e=an.get(r))&&ic(t,e),u=n.createElement("script"),oe(u),ye(u,"link",t),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},l.set(r,u))}}function J0(t,e){Vn.M(t,e);var n=kl;if(n&&t){var l=yl(n).hoistableScripts,r=Jl(t),u=l.get(r);u||(u=n.querySelector(ki(r)),u||(t=h({src:t,async:!0,type:"module"},e),(e=an.get(r))&&ic(t,e),u=n.createElement("script"),oe(u),ye(u,"link",t),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},l.set(r,u))}}function Om(t,e,n,l){var r=(r=rt.current)?hr(r):null;if(!r)throw Error(o(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=Kl(n.href),n=yl(r).hoistableStyles,l=n.get(e),l||(l={type:"style",instance:null,count:0,state:null},n.set(e,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=Kl(n.href);var u=yl(r).hoistableStyles,d=u.get(t);if(d||(r=r.ownerDocument||r,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(t,d),(u=r.querySelector(Zi(t)))&&!u._p&&(d.instance=u,d.state.loading=5),an.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},an.set(t,n),u||F0(r,t,n,d.state))),e&&l===null)throw Error(o(528,""));return d}if(e&&l!==null)throw Error(o(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Jl(n),n=yl(r).hoistableScripts,l=n.get(e),l||(l={type:"script",instance:null,count:0,state:null},n.set(e,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,t))}}function Kl(t){return'href="'+Fe(t)+'"'}function Zi(t){return'link[rel="stylesheet"]['+t+"]"}function zm(t){return h({},t,{"data-precedence":t.precedence,precedence:null})}function F0(t,e,n,l){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?l.loading=1:(e=t.createElement("link"),l.preload=e,e.addEventListener("load",function(){return l.loading|=1}),e.addEventListener("error",function(){return l.loading|=2}),ye(e,"link",n),oe(e),t.head.appendChild(e))}function Jl(t){return'[src="'+Fe(t)+'"]'}function ki(t){return"script[async]"+t}function Cm(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var l=t.querySelector('style[data-href~="'+Fe(n.href)+'"]');if(l)return e.instance=l,oe(l),l;var r=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),oe(l),ye(l,"style",r),mr(l,n.precedence,t),e.instance=l;case"stylesheet":r=Kl(n.href);var u=t.querySelector(Zi(r));if(u)return e.state.loading|=4,e.instance=u,oe(u),u;l=zm(n),(r=an.get(r))&&lc(l,r),u=(t.ownerDocument||t).createElement("link"),oe(u);var d=u;return d._p=new Promise(function(v,E){d.onload=v,d.onerror=E}),ye(u,"link",l),e.state.loading|=4,mr(u,n.precedence,t),e.instance=u;case"script":return u=Jl(n.src),(r=t.querySelector(ki(u)))?(e.instance=r,oe(r),r):(l=n,(r=an.get(u))&&(l=h({},n),ic(l,r)),t=t.ownerDocument||t,r=t.createElement("script"),oe(r),ye(r,"link",l),t.head.appendChild(r),e.instance=r);case"void":return null;default:throw Error(o(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(l=e.instance,e.state.loading|=4,mr(l,n.precedence,t));return e.instance}function mr(t,e,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=l.length?l[l.length-1]:null,u=r,d=0;d title"):null)}function P0(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function Lm(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function $0(t,e,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var r=Kl(l.href),u=e.querySelector(Zi(r));if(u){e=u._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=pr.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=u,oe(u);return}u=e.ownerDocument||e,l=zm(l),(r=an.get(r))&&lc(l,r),u=u.createElement("link"),oe(u);var d=u;d._p=new Promise(function(v,E){d.onload=v,d.onerror=E}),ye(u,"link",l),n.instance=u}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=pr.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var sc=0;function W0(t,e){return t.stylesheets&&t.count===0&&vr(t,t.stylesheets),0sc?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(r)}}:null}function pr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)vr(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var gr=null;function vr(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,gr=new Map,e.forEach(I0,t),gr=null,pr.call(t))}function I0(t,e){if(!(e.state.loading&4)){var n=gr.get(t);if(n)var l=n.get(null);else{n=new Map,gr.set(t,n);for(var r=t.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(s){console.error(s)}}return a(),yc.exports=pv(),yc.exports}var vv=gv();const Bc=new WeakMap,Sv=new WeakMap,Ur={current:[]};let Sc=!1,is=0;const ls=new Set,wr=new Map;function Vy(a){for(const s of a){if(Ur.current.includes(s))continue;Ur.current.push(s),s.recompute();const i=Sv.get(s);if(i)for(const o of i){const c=Bc.get(o);c?.length&&Vy(c)}}}function bv(a){const s={prevVal:a.prevState,currentVal:a.state};for(const i of a.listeners)i(s)}function _v(a){const s={prevVal:a.prevState,currentVal:a.state};for(const i of a.listeners)i(s)}function Xy(a){if(is>0&&!wr.has(a)&&wr.set(a,a.prevState),ls.add(a),!(is>0)&&!Sc)try{for(Sc=!0;ls.size>0;){const s=Array.from(ls);ls.clear();for(const i of s){const o=wr.get(i)??i.prevState;i.prevState=o,bv(i)}for(const i of s){const o=Bc.get(i);o&&(Ur.current.push(i),Vy(o))}for(const i of s){const o=Bc.get(i);if(o)for(const c of o)_v(c)}}}finally{Sc=!1,Ur.current=[],wr.clear()}}function Ev(a){is++;try{a()}finally{if(is--,is===0){const s=ls.values().next().value;s&&Xy(s)}}}function Tv(a){return typeof a=="function"}class Rv{constructor(s,i){this.listeners=new Set,this.subscribe=o=>{var c,f;this.listeners.add(o);const y=(f=(c=this.options)==null?void 0:c.onSubscribe)==null?void 0:f.call(c,o,this);return()=>{this.listeners.delete(o),y?.()}},this.prevState=s,this.state=s,this.options=i}setState(s){var i,o,c;this.prevState=this.state,(i=this.options)!=null&&i.updateFn?this.state=this.options.updateFn(this.prevState)(s):Tv(s)?this.state=s(this.prevState):this.state=s,(c=(o=this.options)==null?void 0:o.onUpdate)==null||c.call(o),Xy(this)}}const wa="__TSR_index",ly="popstate",iy="beforeunload";function xv(a){let s=a.getLocation();const i=new Set,o=y=>{s=a.getLocation(),i.forEach(p=>p({location:s,action:y}))},c=y=>{a.notifyOnIndexChange??!0?o(y):s=a.getLocation()},f=async({task:y,navigateOpts:p,...g})=>{if(p?.ignoreBlocker??!1){y();return}const S=a.getBlockers?.()??[],h=g.type==="PUSH"||g.type==="REPLACE";if(typeof document<"u"&&S.length&&h)for(const _ of S){const A=Br(g.path,g.state);if(await _.blockerFn({currentLocation:s,nextLocation:A,action:g.type})){a.onBlocked?.();return}}y()};return{get location(){return s},get length(){return a.getLength()},subscribers:i,subscribe:y=>(i.add(y),()=>{i.delete(y)}),push:(y,p,g)=>{const m=s.state[wa];p=sy(m+1,p),f({task:()=>{a.pushState(y,p),o({type:"PUSH"})},navigateOpts:g,type:"PUSH",path:y,state:p})},replace:(y,p,g)=>{const m=s.state[wa];p=sy(m,p),f({task:()=>{a.replaceState(y,p),o({type:"REPLACE"})},navigateOpts:g,type:"REPLACE",path:y,state:p})},go:(y,p)=>{f({task:()=>{a.go(y),c({type:"GO",index:y})},navigateOpts:p,type:"GO"})},back:y=>{f({task:()=>{a.back(y?.ignoreBlocker??!1),c({type:"BACK"})},navigateOpts:y,type:"BACK"})},forward:y=>{f({task:()=>{a.forward(y?.ignoreBlocker??!1),c({type:"FORWARD"})},navigateOpts:y,type:"FORWARD"})},canGoBack:()=>s.state[wa]!==0,createHref:y=>a.createHref(y),block:y=>{if(!a.setBlockers)return()=>{};const p=a.getBlockers?.()??[];return a.setBlockers([...p,y]),()=>{const g=a.getBlockers?.()??[];a.setBlockers?.(g.filter(m=>m!==y))}},flush:()=>a.flush?.(),destroy:()=>a.destroy?.(),notify:o}}function sy(a,s){s||(s={});const i=Vc();return{...s,key:i,__TSR_key:i,[wa]:a}}function wv(a){const s=typeof document<"u"?window:void 0,i=s.history.pushState,o=s.history.replaceState;let c=[];const f=()=>c,y=Q=>c=Q,p=(Q=>Q),g=(()=>Br(`${s.location.pathname}${s.location.search}${s.location.hash}`,s.history.state));if(!s.history.state?.__TSR_key&&!s.history.state?.key){const Q=Vc();s.history.replaceState({[wa]:0,key:Q,__TSR_key:Q},"")}let m=g(),S,h=!1,_=!1,A=!1,O=!1;const w=()=>m;let z,U;const J=()=>{z&&(Z._ignoreSubscribers=!0,(z.isPush?s.history.pushState:s.history.replaceState)(z.state,"",z.href),Z._ignoreSubscribers=!1,z=void 0,U=void 0,S=void 0)},G=(Q,P,dt)=>{const it=p(P);U||(S=m),m=Br(P,dt),z={href:it,state:dt,isPush:z?.isPush||Q==="push"},U||(U=Promise.resolve().then(()=>J()))},V=Q=>{m=g(),Z.notify({type:Q})},I=async()=>{if(_){_=!1;return}const Q=g(),P=Q.state[wa]-m.state[wa],dt=P===1,it=P===-1,ct=!dt&&!it||h;h=!1;const at=ct?"GO":it?"BACK":"FORWARD",bt=ct?{type:"GO",index:P}:{type:it?"BACK":"FORWARD"};if(A)A=!1;else{const wt=f();if(typeof document<"u"&&wt.length){for(const N of wt)if(await N.blockerFn({currentLocation:m,nextLocation:Q,action:at})){_=!0,s.history.go(1),Z.notify(bt);return}}}m=g(),Z.notify(bt)},W=Q=>{if(O){O=!1;return}let P=!1;const dt=f();if(typeof document<"u"&&dt.length)for(const it of dt){const ct=it.enableBeforeUnload??!0;if(ct===!0){P=!0;break}if(typeof ct=="function"&&ct()===!0){P=!0;break}}if(P)return Q.preventDefault(),Q.returnValue=""},Z=xv({getLocation:w,getLength:()=>s.history.length,pushState:(Q,P)=>G("push",Q,P),replaceState:(Q,P)=>G("replace",Q,P),back:Q=>(Q&&(A=!0),O=!0,s.history.back()),forward:Q=>{Q&&(A=!0),O=!0,s.history.forward()},go:Q=>{h=!0,s.history.go(Q)},createHref:Q=>p(Q),flush:J,destroy:()=>{s.history.pushState=i,s.history.replaceState=o,s.removeEventListener(iy,W,{capture:!0}),s.removeEventListener(ly,I)},onBlocked:()=>{S&&m!==S&&(m=S)},getBlockers:f,setBlockers:y,notifyOnIndexChange:!1});return s.addEventListener(iy,W,{capture:!0}),s.addEventListener(ly,I),s.history.pushState=function(...Q){const P=i.apply(s.history,Q);return Z._ignoreSubscribers||V("PUSH"),P},s.history.replaceState=function(...Q){const P=o.apply(s.history,Q);return Z._ignoreSubscribers||V("REPLACE"),P},Z}function Av(a){let s=a.replace(/[\x00-\x1f\x7f]/g,"");return s.startsWith("//")&&(s="/"+s.replace(/^\/+/,"")),s}function Br(a,s){const i=Av(a),o=i.indexOf("#"),c=i.indexOf("?"),f=Vc();return{href:i,pathname:i.substring(0,o>0?c>0?Math.min(o,c):o:c>0?c:i.length),hash:o>-1?i.substring(o):"",search:c>-1?i.slice(c,o===-1?void 0:o):"",state:s||{[wa]:0,key:f,__TSR_key:f}}}function Vc(){return(Math.random()+1).toString(36).substring(7)}const Mv=!1;function Il(a){let s;return Ev(()=>{s=a()}),s}function os(a){return a[a.length-1]}function Ov(a){return typeof a=="function"}function Ra(a,s){return Ov(a)?a(s):a}const zv=Object.prototype.hasOwnProperty,ry=Object.prototype.propertyIsEnumerable;function Be(a,s,i=0){if(a===s)return a;if(i>500)return s;const o=s,c=cy(a)&&cy(o);if(!c&&!(Hr(a)&&Hr(o)))return o;const f=c?a:oy(a);if(!f)return o;const y=c?o:oy(o);if(!y)return o;const p=f.length,g=y.length,m=c?new Array(g):{};let S=0;for(let h=0;h"u")return!0;const i=s.prototype;return!(!uy(i)||!i.hasOwnProperty("isPrototypeOf"))}function uy(a){return Object.prototype.toString.call(a)==="[object Object]"}function cy(a){return Array.isArray(a)&&a.length===Object.keys(a).length}function nl(a,s,i){if(a===s)return!0;if(typeof a!=typeof s)return!1;if(Array.isArray(a)&&Array.isArray(s)){if(a.length!==s.length)return!1;for(let o=0,c=a.length;oc||!nl(a[y],s[y],i)))return!1;return c===f}return!1}function ll(a){let s,i;const o=new Promise((c,f)=>{s=c,i=f});return o.status="pending",o.resolve=c=>{o.status="resolved",o.value=c,s(c),a?.(c)},o.reject=c=>{o.status="rejected",i(c)},o}function Cv(a){return typeof a?.message!="string"?!1:a.message.startsWith("Failed to fetch dynamically imported module")||a.message.startsWith("error loading dynamically imported module")||a.message.startsWith("Importing a module script failed")}function ti(a){return!!(a&&typeof a=="object"&&typeof a.then=="function")}function Dv(a){return a.replace(/[\x00-\x1f\x7f]/g,"")}function fy(a){let s;try{s=decodeURI(a)}catch{s=a.replaceAll(/%[0-9A-F]{2}/gi,i=>{try{return decodeURI(i)}catch{return i}})}return Dv(s)}const Qy=["http:","https:","mailto:","tel:"];function jr(a){if(!a)return!1;try{const s=new URL(a);return!Qy.includes(s.protocol)}catch{return!1}}const Nv={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},Lv=/[&><\u2028\u2029]/g;function Uv(a){return a.replace(Lv,s=>Nv[s])}function Ii(a,s){if(!a||!/[%\\\x00-\x1f\x7f]/.test(a)&&!a.startsWith("//"))return a;const i=/%25|%5C/gi;let o=0,c="",f;for(;(f=i.exec(a))!==null;)c+=fy(a.slice(o,f.index))+f[0],o=i.lastIndex;return c=c+fy(o?a.slice(o):a),c.startsWith("//")&&(c="/"+c.replace(/^\/+/,"")),c}function Bv(a){return/\s|[^\u0000-\u007F]/.test(a)?a.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):a}var Hv="Invariant failed";function je(a,s){if(!a)throw new Error(Hv)}function Yr(a){const s=new Map;let i,o;const c=f=>{f.next&&(f.prev?(f.prev.next=f.next,f.next.prev=f.prev,f.next=void 0,o&&(o.next=f,f.prev=o)):(f.next.prev=void 0,i=f.next,f.next=void 0,o&&(f.prev=o,o.next=f)),o=f)};return{get(f){const y=s.get(f);if(y)return c(y),y.value},set(f,y){if(s.size>=a&&i){const g=i;s.delete(g.key),g.next&&(i=g.next,g.next.prev=void 0),g===o&&(o=void 0)}const p=s.get(f);if(p)p.value=y,c(p);else{const g={key:f,value:y,prev:o};o&&(o.next=g),o=g,i||(i=g),s.set(f,g)}},clear(){s.clear(),i=void 0,o=void 0}}}const ii=0,il=1,sl=2,us=3,Ia=4,Zy=5;function jv(a){const s=a.indexOf("{");if(s===-1)return null;const i=a.indexOf("}",s);return i===-1||s+1>=a.length?null:[s,i]}function Xc(a,s,i=new Uint16Array(6)){const o=a.indexOf("/",s),c=o===-1?a.length:o,f=a.substring(s,c);if(!f||!f.includes("$"))return i[0]=ii,i[1]=s,i[2]=s,i[3]=c,i[4]=c,i[5]=c,i;if(f==="$"){const p=a.length;return i[0]=sl,i[1]=s,i[2]=s,i[3]=p,i[4]=p,i[5]=p,i}if(f.charCodeAt(0)===36)return i[0]=il,i[1]=s,i[2]=s+1,i[3]=c,i[4]=c,i[5]=c,i;const y=jv(f);if(y){const[p,g]=y,m=f.charCodeAt(p+1);if(m===45){if(p+2!Q.skipOnParamError&&Q.caseSensitive===V&&Q.prefix===I&&Q.suffix===W);if(Z)O=Z;else{const Q=_c(il,i.fullPath??i.from,V,I,W);O=Q,Q.depth=f,Q.parent=c,c.dynamic??=[],c.dynamic.push(Q)}break}case us:{const J=g.substring(w,A[1]),G=g.substring(A[4],z),V=S&&!!(J||G),I=J?V?J:J.toLowerCase():void 0,W=G?V?G:G.toLowerCase():void 0,Z=!h&&c.optional?.find(Q=>!Q.skipOnParamError&&Q.caseSensitive===V&&Q.prefix===I&&Q.suffix===W);if(Z)O=Z;else{const Q=_c(us,i.fullPath??i.from,V,I,W);O=Q,Q.parent=c,Q.depth=f,c.optional??=[],c.optional.push(Q)}break}case sl:{const J=g.substring(w,A[1]),G=g.substring(A[4],z),V=S&&!!(J||G),I=J?V?J:J.toLowerCase():void 0,W=G?V?G:G.toLowerCase():void 0,Z=_c(sl,i.fullPath??i.from,V,I,W);O=Z,Z.parent=c,Z.depth=f,c.wildcard??=[],c.wildcard.push(Z)}}c=O}if(h&&i.children&&!i.isRoot&&i.id&&i.id.charCodeAt(i.id.lastIndexOf("/")+1)===95){const A=tl(i.fullPath??i.from);A.kind=Zy,A.parent=c,f++,A.depth=f,c.pathless??=[],c.pathless.push(A),c=A}const _=(i.path||!i.children)&&!i.isRoot;if(_&&g.endsWith("/")){const A=tl(i.fullPath??i.from);A.kind=Ia,A.parent=c,f++,A.depth=f,c.index=A,c=A}c.parse=i.options?.params?.parse??null,c.skipOnParamError=h,c.parsingPriority=i.options?.skipRouteOnParseError?.priority??0,_&&!c.route&&(c.route=i,c.fullPath=i.fullPath??i.from)}if(i.children)for(const g of i.children)Zr(a,s,g,p,c,f,y)}function bc(a,s){if(a.skipOnParamError&&!s.skipOnParamError)return-1;if(!a.skipOnParamError&&s.skipOnParamError)return 1;if(a.skipOnParamError&&s.skipOnParamError&&(a.parsingPriority||s.parsingPriority))return s.parsingPriority-a.parsingPriority;if(a.prefix&&s.prefix&&a.prefix!==s.prefix){if(a.prefix.startsWith(s.prefix))return-1;if(s.prefix.startsWith(a.prefix))return 1}if(a.suffix&&s.suffix&&a.suffix!==s.suffix){if(a.suffix.endsWith(s.suffix))return-1;if(s.suffix.endsWith(a.suffix))return 1}return a.prefix&&!s.prefix?-1:!a.prefix&&s.prefix?1:a.suffix&&!s.suffix?-1:!a.suffix&&s.suffix?1:a.caseSensitive&&!s.caseSensitive?-1:!a.caseSensitive&&s.caseSensitive?1:0}function Ea(a){if(a.pathless)for(const s of a.pathless)Ea(s);if(a.static)for(const s of a.static.values())Ea(s);if(a.staticInsensitive)for(const s of a.staticInsensitive.values())Ea(s);if(a.dynamic?.length){a.dynamic.sort(bc);for(const s of a.dynamic)Ea(s)}if(a.optional?.length){a.optional.sort(bc);for(const s of a.optional)Ea(s)}if(a.wildcard?.length){a.wildcard.sort(bc);for(const s of a.wildcard)Ea(s)}}function tl(a){return{kind:ii,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:a,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function _c(a,s,i,o,c){return{kind:a,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:s,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:i,prefix:o,suffix:c}}function Yv(a,s){const i=tl("/"),o=new Uint16Array(6);for(const c of a)Zr(!1,o,c,1,i,0);Ea(i),s.masksTree=i,s.flatCache=Yr(1e3)}function qv(a,s){a||="/";const i=s.flatCache.get(a);if(i)return i;const o=Qc(a,s.masksTree);return s.flatCache.set(a,o),o}function Gv(a,s,i,o,c){a||="/",o||="/";const f=s?`case\0${a}`:a;let y=c.singleCache.get(f);if(!y){y=tl("/");const p=new Uint16Array(6);Zr(s,p,{from:a},1,y,0),c.singleCache.set(f,y)}return Qc(o,y,i)}function Vv(a,s,i=!1){const o=i?a:`nofuzz\0${a}`,c=s.matchCache.get(o);if(c!==void 0)return c;a||="/";let f;try{f=Qc(a,s.segmentTree,i)}catch(y){if(y instanceof URIError)f=null;else throw y}return f&&(f.branch=Zv(f.route)),s.matchCache.set(o,f),f}function Xv(a){return a==="/"?a:a.replace(/\/{1,}$/,"")}function Qv(a,s=!1,i){const o=tl(a.fullPath),c=new Uint16Array(6),f={},y={};let p=0;return Zr(s,c,a,1,o,0,m=>{if(i?.(m,p),je(!(m.id in f),`Duplicate routes found with id: ${String(m.id)}`),f[m.id]=m,p!==0&&m.path){const S=Xv(m.fullPath);(!y[S]||m.fullPath.endsWith("/"))&&(y[S]=m)}p++}),Ea(o),{processedTree:{segmentTree:o,singleCache:Yr(1e3),matchCache:Yr(1e3),flatCache:null,masksTree:null},routesById:f,routesByPath:y}}function Qc(a,s,i=!1){const o=a.split("/"),c=Kv(a,o,s,i);if(!c)return null;const[f]=ky(a,o,c);return{route:c.node.route,rawParams:f,parsedParams:c.parsedParams}}function ky(a,s,i){const o=kv(i.node);let c=null;const f={};let y=i.extract?.part??0,p=i.extract?.node??0,g=i.extract?.path??0,m=i.extract?.segment??0;for(;p=0;it--){const ct=_.optional[it];p.push({node:ct,index:A,skipped:P,depth:dt,statics:z,dynamics:U,optionals:J,extract:G,rawParams:V,parsedParams:I})}if(!W)for(let it=_.optional.length-1;it>=0;it--){const ct=_.optional[it],{prefix:at,suffix:bt}=ct;if(at||bt){const wt=ct.caseSensitive?Z:Q??=Z.toLowerCase();if(at&&!wt.startsWith(at)||bt&&!wt.endsWith(bt))continue}p.push({node:ct,index:A+1,skipped:O,depth:dt,statics:z,dynamics:U,optionals:J+1,extract:G,rawParams:V,parsedParams:I})}}if(!W&&_.dynamic&&Z)for(let P=_.dynamic.length-1;P>=0;P--){const dt=_.dynamic[P],{prefix:it,suffix:ct}=dt;if(it||ct){const at=dt.caseSensitive?Z:Q??=Z.toLowerCase();if(it&&!at.startsWith(it)||ct&&!at.endsWith(ct))continue}p.push({node:dt,index:A+1,skipped:O,depth:w+1,statics:z,dynamics:U+1,optionals:J,extract:G,rawParams:V,parsedParams:I})}if(!W&&_.staticInsensitive){const P=_.staticInsensitive.get(Q??=Z.toLowerCase());P&&p.push({node:P,index:A+1,skipped:O,depth:w+1,statics:z+1,dynamics:U,optionals:J,extract:G,rawParams:V,parsedParams:I})}if(!W&&_.static){const P=_.static.get(Z);P&&p.push({node:P,index:A+1,skipped:O,depth:w+1,statics:z+1,dynamics:U,optionals:J,extract:G,rawParams:V,parsedParams:I})}if(_.pathless){const P=w+1;for(let dt=_.pathless.length-1;dt>=0;dt--){const it=_.pathless[dt];p.push({node:it,index:A,skipped:O,depth:P,statics:z,dynamics:U,optionals:J,extract:G,rawParams:V,parsedParams:I})}}}if(S&&g)return ts(g,S)?S:g;if(S)return S;if(g)return g;if(o&&m){let h=m.index;for(let A=0;Aa.statics||s.statics===a.statics&&(s.dynamics>a.dynamics||s.dynamics===a.dynamics&&(s.optionals>a.optionals||s.optionals===a.optionals&&((s.node.kind===Ia)>(a.node.kind===Ia)||s.node.kind===Ia==(a.node.kind===Ia)&&s.depth>a.depth))):!0}function Cr(a){return Zc(a.filter(s=>s!==void 0).join("/"))}function Zc(a){return a.replace(/\/{2,}/g,"/")}function Ky(a){return a==="/"?a:a.replace(/^\/{1,}/,"")}function Qn(a){const s=a.length;return s>1&&a[s-1]==="/"?a.replace(/\/{1,}$/,""):a}function Jy(a){return Qn(Ky(a))}function qr(a,s){return a?.endsWith("/")&&a!=="/"&&a!==`${s}/`?a.slice(0,-1):a}function Jv(a,s,i){return qr(a,i)===qr(s,i)}function Fv({base:a,to:s,trailingSlash:i="never",cache:o}){const c=s.startsWith("/"),f=!c&&s===".";let y;if(o){y=c?s:f?a:a+"\0"+s;const h=o.get(y);if(h)return h}let p;if(f)p=a.split("/");else if(c)p=s.split("/");else{for(p=a.split("/");p.length>1&&os(p)==="";)p.pop();const h=s.split("/");for(let _=0,A=h.length;_1&&(os(p)===""?i==="never"&&p.pop():i==="always"&&p.push(""));let g,m="";for(let h=0;h0&&(m+="/");const _=p[h];if(!_)continue;g=Xc(_,0,g);const A=g[0];if(A===ii){m+=_;continue}const O=g[5],w=_.substring(0,g[1]),z=_.substring(g[4],O),U=_.substring(g[2],g[3]);A===il?m+=w||z?`${w}{$${U}}${z}`:`$${U}`:A===sl?m+=w||z?`${w}{$}${z}`:"$":m+=`${w}{-$${U}}${z}`}m=Zc(m);const S=m||"/";return y&&o&&o.set(y,S),S}function Pv(a){const s=new Map(a.map(c=>[encodeURIComponent(c),c])),i=Array.from(s.keys()).map(c=>c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),o=new RegExp(i,"g");return c=>c.replace(o,f=>s.get(f)??f)}function Tc(a,s,i){const o=s[a];return typeof o!="string"?o:a==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(o)?o:o.split("/").map(c=>dy(c,i)).join("/"):dy(o,i)}function Rc({path:a,params:s,decoder:i,server:o}){let c=!1;const f={};if(!a||a==="/")return{interpolatedPath:"/",usedParams:f,isMissingParams:c};if(!a.includes("$"))return{interpolatedPath:a,usedParams:f,isMissingParams:c};const y=a.length;let p=0,g,m="";for(;p{let i;return(...o)=>{i||(i=setTimeout(()=>{a(...o),i=null},s))}};function Iv(){const a=$v();if(!a)return null;const s=a.getItem(Hc);let i=s?JSON.parse(s):{};return{state:i,set:o=>{i=Ra(o,i)||i;try{a.setItem(Hc,JSON.stringify(i))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Ar=Iv(),tS=a=>a.state.__TSR_key||a.href;function eS(a){const s=[];let i;for(;i=a.parentNode;)s.push(`${a.tagName}:nth-child(${Array.prototype.indexOf.call(i.children,a)+1})`),a=i;return`${s.reverse().join(" > ")}`.toLowerCase()}let Gr=!1;function nS({storageKey:a,key:s,behavior:i,shouldScrollRestoration:o,scrollToTopSelectors:c,location:f}){let y;try{y=JSON.parse(sessionStorage.getItem(a)||"{}")}catch(m){console.error(m);return}const p=s||window.history.state?.__TSR_key,g=y[p];Gr=!0;t:{if(o&&g&&Object.keys(g).length>0){for(const h in g){const _=g[h];if(h==="window")window.scrollTo({top:_.scrollY,left:_.scrollX,behavior:i});else if(h){const A=document.querySelector(h);A&&(A.scrollLeft=_.scrollX,A.scrollTop=_.scrollY)}}break t}const m=(f??window.location).hash.split("#",2)[1];if(m){const h=window.history.state?.__hashScrollIntoViewOptions??!0;if(h){const _=document.getElementById(m);_&&_.scrollIntoView(h)}break t}const S={top:0,left:0,behavior:i};if(window.scrollTo(S),c)for(const h of c){if(h==="window")continue;const _=typeof h=="function"?h():document.querySelector(h);_&&_.scrollTo(S)}}Gr=!1}function aS(a,s){if(!Ar||((a.options.scrollRestoration??!1)&&(a.isScrollRestoring=!0),a.isScrollRestorationSetup||!Ar))return;a.isScrollRestorationSetup=!0,Gr=!1;const o=a.options.getScrollRestorationKey||tS;window.history.scrollRestoration="manual";const c=f=>{if(Gr||!a.isScrollRestoring)return;let y="";if(f.target===document||f.target===window)y="window";else{const g=f.target.getAttribute("data-scroll-restoration-id");g?y=`[data-scroll-restoration-id="${g}"]`:y=eS(f.target)}const p=o(a.state.location);Ar.set(g=>{const m=g[p]||={},S=m[y]||={};if(y==="window")S.scrollX=window.scrollX||0,S.scrollY=window.scrollY||0;else if(y){const h=document.querySelector(y);h&&(S.scrollX=h.scrollLeft||0,S.scrollY=h.scrollTop||0)}return g})};typeof document<"u"&&document.addEventListener("scroll",Wv(c,100),!0),a.subscribe("onRendered",f=>{const y=o(f.toLocation);if(!a.resetNextScroll){a.resetNextScroll=!0;return}typeof a.options.scrollRestoration=="function"&&!a.options.scrollRestoration({location:a.latestLocation})||(nS({storageKey:Hc,key:y,behavior:a.options.scrollRestorationBehavior,shouldScrollRestoration:a.isScrollRestoring,scrollToTopSelectors:a.options.scrollToTopSelectors,location:a.history.location}),a.isScrollRestoring&&Ar.set(p=>(p[y]||={},p)))})}function lS(a){if(typeof document<"u"&&document.querySelector){const s=a.state.location.state.__hashScrollIntoViewOptions??!0;if(s&&a.state.location.hash!==""){const i=document.getElementById(a.state.location.hash);i&&i.scrollIntoView(s)}}}function Fy(a,s=String){const i=new URLSearchParams;for(const o in a){const c=a[o];c!==void 0&&i.set(o,s(c))}return i.toString()}function xc(a){return a?a==="false"?!1:a==="true"?!0:+a*0===0&&+a+""===a?+a:a:""}function iS(a){const s=new URLSearchParams(a),i={};for(const[o,c]of s.entries()){const f=i[o];f==null?i[o]=xc(c):Array.isArray(f)?f.push(xc(c)):i[o]=[f,xc(c)]}return i}const sS=oS(JSON.parse),rS=uS(JSON.stringify,JSON.parse);function oS(a){return s=>{s[0]==="?"&&(s=s.substring(1));const i=iS(s);for(const o in i){const c=i[o];if(typeof c=="string")try{i[o]=a(c)}catch{}}return i}}function uS(a,s){const i=typeof s=="function";function o(c){if(typeof c=="object"&&c!==null)try{return a(c)}catch{}else if(i&&typeof c=="string")try{return s(c),a(c)}catch{}return c}return c=>{const f=Fy(c,o);return f?`?${f}`:""}}const ln="__root__";function kr(a){if(a.statusCode=a.statusCode||a.code||307,!a._builtLocation&&typeof a.href=="string"&&jr(a.href))throw new Error(`Redirect blocked: unsafe protocol in href "${a.href}". Only ${Qy.join(", ")} protocols are allowed.`);if(!a._builtLocation&&!a.reloadDocument&&typeof a.href=="string")try{new URL(a.href),a.reloadDocument=!0}catch{}const s=new Headers(a.headers);a.href&&s.get("Location")===null&&s.set("Location",a.href);const i=new Response(null,{status:a.statusCode,headers:s});if(i.options=a,a.throw)throw i;return i}function sn(a){return a instanceof Response&&!!a.options}function cS(a){if(a!==null&&typeof a=="object"&&a.isSerializedRedirect)return kr(a)}const Dr=a=>{if(!a.rendered)return a.rendered=!0,a.onReady?.()},Kr=(a,s)=>!!(a.preload&&!a.router.state.matches.some(i=>i.id===s)),ei=(a,s,i=!0)=>{const o={...a.router.options.context??{}},c=i?s:s-1;for(let f=0;f<=c;f++){const y=a.matches[f];if(!y)continue;const p=a.router.getMatch(y.id);p&&Object.assign(o,p.__routeContext,p.__beforeLoadContext)}return o},Py=(a,s)=>{const i=a.router.routesById[s.routeId??""]??a.router.routeTree;!i.options.notFoundComponent&&a.router.options?.defaultNotFoundComponent&&(i.options.notFoundComponent=a.router.options.defaultNotFoundComponent),je(i.options.notFoundComponent);const o=a.matches.find(c=>c.routeId===i.id);je(o,"Could not find match for route: "+i.id),a.updateMatch(o.id,c=>({...c,status:"notFound",error:s,isFetching:!1})),s.routerCode==="BEFORE_LOAD"&&i.parentRoute&&(s.routeId=i.parentRoute.id,Py(a,s))},xa=(a,s,i)=>{if(!(!sn(i)&&!Te(i))){if(sn(i)&&i.redirectHandled&&!i.options.reloadDocument)throw i;if(s){s._nonReactive.beforeLoadPromise?.resolve(),s._nonReactive.loaderPromise?.resolve(),s._nonReactive.beforeLoadPromise=void 0,s._nonReactive.loaderPromise=void 0;const o=sn(i)?"redirected":"notFound";s._nonReactive.error=i,a.updateMatch(s.id,c=>({...c,status:o,context:ei(a,s.index),isFetching:!1,error:i})),Te(i)&&!i.routeId&&(i.routeId=s.routeId),s._nonReactive.loadPromise?.resolve()}throw sn(i)?(a.rendered=!0,i.options._fromLocation=a.location,i.redirectHandled=!0,i=a.router.resolveRedirect(i),i):(Py(a,i),i)}},$y=(a,s)=>!!a.router.getMatch(s)._nonReactive.dehydrated,es=(a,s,i,o)=>{const{id:c,routeId:f}=a.matches[s],y=a.router.looseRoutesById[f];if(i instanceof Promise)throw i;i.routerCode=o,a.firstBadMatchIndex??=s,xa(a,a.router.getMatch(c),i);try{y.options.onError?.(i)}catch(p){i=p,xa(a,a.router.getMatch(c),i)}a.updateMatch(c,p=>(p._nonReactive.beforeLoadPromise?.resolve(),p._nonReactive.beforeLoadPromise=void 0,p._nonReactive.loadPromise?.resolve(),{...p,error:i,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},Wy=(a,s,i,o)=>{if(o._nonReactive.pendingTimeout!==void 0)return;const c=i.options.pendingMs??a.router.options.defaultPendingMs;if(!!(a.onReady&&!Kr(a,s)&&(i.options.loader||i.options.beforeLoad||ep(i))&&typeof c=="number"&&c!==1/0&&(i.options.pendingComponent??a.router.options?.defaultPendingComponent))){const y=setTimeout(()=>{Dr(a)},c);o._nonReactive.pendingTimeout=y}},fS=(a,s,i)=>{const o=a.router.getMatch(s);if(!o._nonReactive.beforeLoadPromise&&!o._nonReactive.loaderPromise)return;Wy(a,s,i,o);const c=()=>{const f=a.router.getMatch(s);f.preload&&(f.status==="redirected"||f.status==="notFound")&&xa(a,f,f.error)};return o._nonReactive.beforeLoadPromise?o._nonReactive.beforeLoadPromise.then(c):c()},dS=(a,s,i,o)=>{const c=a.router.getMatch(s),f=c._nonReactive.loadPromise;c._nonReactive.loadPromise=ll(()=>{f?.resolve()});const{paramsError:y,searchError:p}=c;y&&es(a,i,y,"PARSE_PARAMS"),p&&es(a,i,p,"VALIDATE_SEARCH"),Wy(a,s,o,c);const g=new AbortController;let m=!1;const S=()=>{m||(m=!0,a.updateMatch(s,V=>({...V,isFetching:"beforeLoad",fetchCount:V.fetchCount+1,abortController:g})))},h=()=>{c._nonReactive.beforeLoadPromise?.resolve(),c._nonReactive.beforeLoadPromise=void 0,a.updateMatch(s,V=>({...V,isFetching:!1}))};if(!o.options.beforeLoad){Il(()=>{S(),h()});return}c._nonReactive.beforeLoadPromise=ll();const _={...ei(a,i,!1),...c.__routeContext},{search:A,params:O,cause:w}=c,z=Kr(a,s),U={search:A,abortController:g,params:O,preload:z,context:_,location:a.location,navigate:V=>a.router.navigate({...V,_fromLocation:a.location}),buildLocation:a.router.buildLocation,cause:z?"preload":w,matches:a.matches,...a.router.options.additionalContext},J=V=>{if(V===void 0){Il(()=>{S(),h()});return}(sn(V)||Te(V))&&(S(),es(a,i,V,"BEFORE_LOAD")),Il(()=>{S(),a.updateMatch(s,I=>({...I,__beforeLoadContext:V})),h()})};let G;try{if(G=o.options.beforeLoad(U),ti(G))return S(),G.catch(V=>{es(a,i,V,"BEFORE_LOAD")}).then(J)}catch(V){S(),es(a,i,V,"BEFORE_LOAD")}J(G)},hS=(a,s)=>{const{id:i,routeId:o}=a.matches[s],c=a.router.looseRoutesById[o],f=()=>p(),y=()=>dS(a,i,s,c),p=()=>{if($y(a,i))return;const g=fS(a,i,c);return ti(g)?g.then(y):y()};return f()},mS=(a,s,i)=>{const o=a.router.getMatch(s);if(!o||!i.options.head&&!i.options.scripts&&!i.options.headers)return;const c={ssr:a.router.options.ssr,matches:a.matches,match:o,params:o.params,loaderData:o.loaderData};return Promise.all([i.options.head?.(c),i.options.scripts?.(c),i.options.headers?.(c)]).then(([f,y,p])=>{const g=f?.meta,m=f?.links,S=f?.scripts,h=f?.styles;return{meta:g,links:m,headScripts:S,headers:p,scripts:y,styles:h}})},Iy=(a,s,i,o)=>{const c=a.matchPromises[i-1],{params:f,loaderDeps:y,abortController:p,cause:g}=a.router.getMatch(s),m=ei(a,i),S=Kr(a,s);return{params:f,deps:y,preload:!!S,parentMatchPromise:c,abortController:p,context:m,location:a.location,navigate:h=>a.router.navigate({...h,_fromLocation:a.location}),cause:S?"preload":g,route:o,...a.router.options.additionalContext}},hy=async(a,s,i,o)=>{try{const c=a.router.getMatch(s);try{(!(Mv??a.router.isServer)||c.ssr===!0)&&tp(o);const f=o.options.loader?.(Iy(a,s,i,o)),y=o.options.loader&&ti(f);if((y||o._lazyPromise||o._componentsPromise||o.options.head||o.options.scripts||o.options.headers||c._nonReactive.minPendingPromise)&&a.updateMatch(s,m=>({...m,isFetching:"loader"})),o.options.loader){const m=y?await f:f;xa(a,a.router.getMatch(s),m),m!==void 0&&a.updateMatch(s,S=>({...S,loaderData:m}))}o._lazyPromise&&await o._lazyPromise;const g=c._nonReactive.minPendingPromise;g&&await g,o._componentsPromise&&await o._componentsPromise,a.updateMatch(s,m=>({...m,error:void 0,context:ei(a,i),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(f){let y=f;if(y?.name==="AbortError"){a.updateMatch(s,g=>({...g,status:g.status==="pending"?"success":g.status,isFetching:!1,context:ei(a,i)}));return}const p=c._nonReactive.minPendingPromise;p&&await p,Te(f)&&await o.options.notFoundComponent?.preload?.(),xa(a,a.router.getMatch(s),f);try{o.options.onError?.(f)}catch(g){y=g,xa(a,a.router.getMatch(s),g)}a.updateMatch(s,g=>({...g,error:y,context:ei(a,i),status:"error",isFetching:!1}))}}catch(c){const f=a.router.getMatch(s);f&&(f._nonReactive.loaderPromise=void 0),xa(a,f,c)}},yS=async(a,s)=>{const{id:i,routeId:o}=a.matches[s];let c=!1,f=!1;const y=a.router.looseRoutesById[o];if(!$y(a,i)){const m=a.router.getMatch(i);if(m._nonReactive.loaderPromise){if(m.status==="success"&&!a.sync&&!m.preload)return m;await m._nonReactive.loaderPromise;const S=a.router.getMatch(i),h=S._nonReactive.error||S.error;h&&xa(a,S,h)}else{const S=Date.now()-m.updatedAt,h=Kr(a,i),_=h?y.options.preloadStaleTime??a.router.options.defaultPreloadStaleTime??3e4:y.options.staleTime??a.router.options.defaultStaleTime??0,A=y.options.shouldReload,O=typeof A=="function"?A(Iy(a,i,s,y)):A,w=!!h&&!a.router.state.matches.some(G=>G.id===i),z=a.router.getMatch(i);z._nonReactive.loaderPromise=ll(),w!==z.preload&&a.updateMatch(i,G=>({...G,preload:w}));const{status:U,invalid:J}=z;c=U==="success"&&(J||(O??S>_)),h&&y.options.preload===!1||(c&&!a.sync?(f=!0,(async()=>{try{await hy(a,i,s,y);const G=a.router.getMatch(i);G._nonReactive.loaderPromise?.resolve(),G._nonReactive.loadPromise?.resolve(),G._nonReactive.loaderPromise=void 0}catch(G){sn(G)&&await a.router.navigate(G.options)}})()):(U!=="success"||c&&a.sync)&&await hy(a,i,s,y))}}const p=a.router.getMatch(i);f||(p._nonReactive.loaderPromise?.resolve(),p._nonReactive.loadPromise?.resolve()),clearTimeout(p._nonReactive.pendingTimeout),p._nonReactive.pendingTimeout=void 0,f||(p._nonReactive.loaderPromise=void 0),p._nonReactive.dehydrated=void 0;const g=f?p.isFetching:!1;return g!==p.isFetching||p.invalid!==!1?(a.updateMatch(i,m=>({...m,isFetching:g,invalid:!1})),a.router.getMatch(i)):p};async function my(a){const s=Object.assign(a,{matchPromises:[]});s.router.state.matches.some(i=>i._forcePending)&&Dr(s);try{for(let p=0;pp.status==="rejected").map(p=>p.reason);let f;for(const p of c){if(sn(p))throw p;!f&&Te(p)&&(f=p)}for(const p of s.matches){const{id:g,routeId:m}=p,S=s.router.looseRoutesById[m];try{const h=mS(s,g,S);if(h){const _=await h;s.updateMatch(g,A=>({...A,..._}))}}catch(h){console.error(`Error executing head for route ${m}:`,h)}}if(f)throw f;const y=Dr(s);ti(y)&&await y}catch(i){if(Te(i)&&!s.preload){const o=Dr(s);throw ti(o)&&await o,i}if(sn(i))throw i}return s.matches}async function tp(a){if(!a._lazyLoaded&&a._lazyPromise===void 0&&(a.lazyFn?a._lazyPromise=a.lazyFn().then(s=>{const{id:i,...o}=s.options;Object.assign(a.options,o),a._lazyLoaded=!0,a._lazyPromise=void 0}):a._lazyLoaded=!0),!a._componentsLoaded&&a._componentsPromise===void 0){const s=()=>{const i=[];for(const o of np){const c=a.options[o]?.preload;c&&i.push(c())}if(i.length)return Promise.all(i).then(()=>{a._componentsLoaded=!0,a._componentsPromise=void 0});a._componentsLoaded=!0,a._componentsPromise=void 0};a._componentsPromise=a._lazyPromise?a._lazyPromise.then(s):s()}return a._componentsPromise}function ep(a){for(const s of np)if(a.options[s]?.preload)return!0;return!1}const np=["component","errorComponent","pendingComponent","notFoundComponent"];function pS(a){return{input:({url:s})=>{for(const i of a)s=jc(i,s);return s},output:({url:s})=>{for(let i=a.length-1;i>=0;i--)s=ap(a[i],s);return s}}}function gS(a){const s=Jy(a.basepath),i=`/${s}`,o=`${i}/`,c=a.caseSensitive?i:i.toLowerCase(),f=a.caseSensitive?o:o.toLowerCase();return{input:({url:y})=>{const p=a.caseSensitive?y.pathname:y.pathname.toLowerCase();return p===c?y.pathname="/":p.startsWith(f)&&(y.pathname=y.pathname.slice(i.length)),y},output:({url:y})=>(y.pathname=Cr(["/",s,y.pathname]),y)}}function jc(a,s){const i=a?.input?.({url:s});if(i){if(typeof i=="string")return new URL(i);if(i instanceof URL)return i}return s}function ap(a,s){const i=a?.output?.({url:s});if(i){if(typeof i=="string")return new URL(i);if(i instanceof URL)return i}return s}function vS(a){return a instanceof Error?{name:a.name,message:a.message}:{data:a}}function al(a){const s=a.resolvedLocation,i=a.location,o=s?.pathname!==i.pathname,c=s?.href!==i.href,f=s?.hash!==i.hash;return{fromLocation:s,toLocation:i,pathChanged:o,hrefChanged:c,hashChanged:f}}class SS{constructor(s){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=i=>i(),this.update=i=>{i.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const o=this.options,c=this.basepath??o?.basepath??"/",f=this.basepath===void 0,y=o?.rewrite;if(this.options={...o,...i},this.isServer=this.options.isServer??typeof document>"u",this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Pv(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=wv()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let _;this.resolvePathCache=Yr(1e3),_=this.buildRouteTree(),this.setRoutes(_)}!this.__store&&this.latestLocation&&(this.__store=new Rv(_S(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(_=>!["redirected"].includes(_.status))}}}),aS(this));let p=!1;const g=this.options.basepath??"/",m=this.options.rewrite;if(f||c!==g||y!==m){this.basepath=g;const _=[],A=Jy(g);A&&A!=="/"&&_.push(gS({basepath:g})),m&&_.push(m),this.rewrite=_.length===0?void 0:_.length===1?_[0]:pS(_),this.history&&this.updateLatestLocation(),p=!0}p&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const i=Qv(this.routeTree,this.options.caseSensitive,(o,c)=>{o.init({originalIndex:c})});return this.options.routeMasks&&Yv(this.options.routeMasks,i.processedTree),i},this.subscribe=(i,o)=>{const c={eventType:i,fn:o};return this.subscribers.add(c),()=>{this.subscribers.delete(c)}},this.emit=i=>{this.subscribers.forEach(o=>{o.eventType===i.type&&o.fn(i)})},this.parseLocation=(i,o)=>{const c=({pathname:g,search:m,hash:S,href:h,state:_})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(g)){const J=this.options.parseSearch(m),G=this.options.stringifySearch(J);return{href:g+G+S,publicHref:h,pathname:Ii(g),external:!1,searchStr:G,search:Be(o?.search,J),hash:Ii(S.slice(1)),state:Be(o?.state,_)}}const A=new URL(h,this.origin),O=jc(this.rewrite,A),w=this.options.parseSearch(O.search),z=this.options.stringifySearch(w);return O.search=z,{href:O.href.replace(O.origin,""),publicHref:h,pathname:Ii(O.pathname),external:!!this.rewrite&&O.origin!==this.origin,searchStr:z,search:Be(o?.search,w),hash:Ii(O.hash.slice(1)),state:Be(o?.state,_)}},f=c(i),{__tempLocation:y,__tempKey:p}=f.state;if(y&&(!p||p===this.tempLocationKey)){const g=c(y);return g.state.key=f.state.key,g.state.__TSR_key=f.state.__TSR_key,delete g.state.__tempLocation,{...g,maskedLocation:f}}return f},this.resolvePathWithBase=(i,o)=>Fv({base:i,to:Zc(o),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(i,o,c)=>typeof i=="string"?this.matchRoutesInternal({pathname:i,search:o},c):this.matchRoutesInternal(i,o),this.getMatchedRoutes=i=>ES({pathname:i,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=i=>{const o=this.getMatch(i);o&&(o.abortController.abort(),clearTimeout(o._nonReactive.pendingTimeout),o._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const i=this.state.matches.filter(f=>f.status==="pending"),o=this.state.matches.filter(f=>f.isFetching==="loader");new Set([...this.state.pendingMatches??[],...i,...o]).forEach(f=>{this.cancelMatch(f.id)})},this.buildLocation=i=>{const o=(f={})=>{const y=f._fromLocation||this.pendingBuiltLocation||this.latestLocation,p=this.matchRoutesLightweight(y);f.from;const g=f.unsafeRelative==="path"?y.pathname:f.from??p.fullPath,m=this.resolvePathWithBase(g,"."),S=p.search,h={...p.params},_=f.to?this.resolvePathWithBase(m,`${f.to}`):this.resolvePathWithBase(m,"."),A=f.params===!1||f.params===null?{}:(f.params??!0)===!0?h:Object.assign(h,Ra(f.params,h)),O=Rc({path:_,params:A,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,w=this.getMatchedRoutes(O);let z=w.matchedRoutes;(w.foundRoute?w.foundRoute.path!=="/"&&w.routeParams["**"]:Qn(O))&&this.options.notFoundRoute&&(z=[...z,this.options.notFoundRoute]);let J=!1;if(Object.keys(A).length>0)for(const at of z){const bt=at.options.params?.stringify??at.options.stringifyParams;bt&&(J=!0,Object.assign(A,bt(A)))}const G=i.leaveParams?_:Ii(J?Rc({path:_,params:A,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:O);let V=S;if(i._includeValidateSearch&&this.options.search?.strict){const at={};z.forEach(bt=>{if(bt.options.validateSearch)try{Object.assign(at,Nr(bt.options.validateSearch,{...at,...V}))}catch{}}),V=at}V=TS({search:V,dest:f,destRoutes:z,_includeValidateSearch:i._includeValidateSearch}),V=Be(S,V);const I=this.options.stringifySearch(V),W=f.hash===!0?y.hash:f.hash?Ra(f.hash,y.hash):void 0,Z=W?`#${W}`:"";let Q=f.state===!0?y.state:f.state?Ra(f.state,y.state):{};Q=Be(y.state,Q);const P=`${G}${I}${Z}`;let dt,it,ct=!1;if(this.rewrite){const at=new URL(P,this.origin),bt=ap(this.rewrite,at);dt=at.href.replace(at.origin,""),bt.origin!==this.origin?(it=bt.href,ct=!0):it=bt.pathname+bt.search+bt.hash}else dt=Bv(P),it=dt;return{publicHref:it,href:dt,pathname:G,search:V,searchStr:I,state:Q,hash:W??"",external:ct,unmaskOnReload:f.unmaskOnReload}},c=(f={},y)=>{const p=o(f);let g=y?o(y):void 0;if(!g){const m={};if(this.options.routeMasks){const S=qv(p.pathname,this.processedTree);if(S){Object.assign(m,S.rawParams);const{from:h,params:_,...A}=S.route,O=_===!1||_===null?{}:(_??!0)===!0?m:Object.assign(m,Ra(_,m));y={from:i.from,...A,params:O},g=o(y)}}}return g&&(p.maskedLocation=g),p};return i.mask?c(i,{from:i.from,...i.mask}):c(i)},this.commitLocation=async({viewTransition:i,ignoreBlocker:o,...c})=>{const f=()=>{const g=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];g.forEach(S=>{c.state[S]=this.latestLocation.state[S]});const m=nl(c.state,this.latestLocation.state);return g.forEach(S=>{delete c.state[S]}),m},y=Qn(this.latestLocation.href)===Qn(c.href),p=this.commitLocationPromise;if(this.commitLocationPromise=ll(()=>{p?.resolve()}),y&&f())this.load();else{let{maskedLocation:g,hashScrollIntoView:m,...S}=c;g&&(S={...g,state:{...g.state,__tempKey:void 0,__tempLocation:{...S,search:S.searchStr,state:{...S.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(S.unmaskOnReload??this.options.unmaskOnReload??!1)&&(S.state.__tempKey=this.tempLocationKey)),S.state.__hashScrollIntoViewOptions=m??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=i,this.history[c.replace?"replace":"push"](S.publicHref,S.state,{ignoreBlocker:o})}return this.resetNextScroll=c.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:i,resetScroll:o,hashScrollIntoView:c,viewTransition:f,ignoreBlocker:y,href:p,...g}={})=>{if(p){const h=this.history.location.state.__TSR_index,_=Br(p,{__TSR_index:i?h:h+1}),A=new URL(_.pathname,this.origin),O=jc(this.rewrite,A);g.to=O.pathname,g.search=this.options.parseSearch(_.search),g.hash=_.hash.slice(1)}const m=this.buildLocation({...g,_includeValidateSearch:!0});this.pendingBuiltLocation=m;const S=this.commitLocation({...m,viewTransition:f,replace:i,resetScroll:o,hashScrollIntoView:c,ignoreBlocker:y});return Promise.resolve().then(()=>{this.pendingBuiltLocation===m&&(this.pendingBuiltLocation=void 0)}),S},this.navigate=async({to:i,reloadDocument:o,href:c,publicHref:f,...y})=>{let p=!1;if(c)try{new URL(`${c}`),p=!0}catch{}if(p&&!o&&(o=!0),o){if(i!==void 0||!c){const m=this.buildLocation({to:i,...y});c=c??m.publicHref,f=f??m.publicHref}const g=!p&&f?f:c;if(jr(g))return Promise.resolve();if(!y.ignoreBlocker){const S=this.history.getBlockers?.()??[];for(const h of S)if(h?.blockerFn&&await h.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return y.replace?window.location.replace(g):window.location.href=g,Promise.resolve()}return this.buildAndCommitLocation({...y,href:c,to:i,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const i=this.matchRoutes(this.latestLocation);this.__store.setState(o=>({...o,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:i,cachedMatches:o.cachedMatches.filter(c=>!i.some(f=>f.id===c.id))}))},this.load=async i=>{let o,c,f;for(f=new Promise(p=>{this.startTransition(async()=>{try{this.beforeLoad();const g=this.latestLocation,m=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...al({resolvedLocation:m,location:g})}),this.emit({type:"onBeforeLoad",...al({resolvedLocation:m,location:g})}),await my({router:this,sync:i?.sync,matches:this.state.pendingMatches,location:g,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let S=[],h=[],_=[];Il(()=>{this.__store.setState(A=>{const O=A.matches,w=A.pendingMatches||A.matches;return S=O.filter(z=>!w.some(U=>U.id===z.id)),h=w.filter(z=>!O.some(U=>U.id===z.id)),_=w.filter(z=>O.some(U=>U.id===z.id)),{...A,isLoading:!1,loadedAt:Date.now(),matches:w,pendingMatches:void 0,cachedMatches:[...A.cachedMatches,...S.filter(z=>z.status!=="error"&&z.status!=="notFound")]}}),this.clearExpiredCache()}),[[S,"onLeave"],[h,"onEnter"],[_,"onStay"]].forEach(([A,O])=>{A.forEach(w=>{this.looseRoutesById[w.routeId].options[O]?.(w)})})})})}})}catch(g){sn(g)?(o=g,this.navigate({...o.options,replace:!0,ignoreBlocker:!0})):Te(g)&&(c=g),this.__store.setState(m=>({...m,statusCode:o?o.status:c?404:m.matches.some(S=>S.status==="error")?500:200,redirect:o}))}this.latestLoadPromise===f&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),p()})}),this.latestLoadPromise=f,await f;this.latestLoadPromise&&f!==this.latestLoadPromise;)await this.latestLoadPromise;let y;this.hasNotFoundMatch()?y=404:this.__store.state.matches.some(p=>p.status==="error")&&(y=500),y!==void 0&&this.__store.setState(p=>({...p,statusCode:y}))},this.startViewTransition=i=>{const o=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,o&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let c;if(typeof o=="object"&&this.isViewTransitionTypesSupported){const f=this.latestLocation,y=this.state.resolvedLocation,p=typeof o.types=="function"?o.types(al({resolvedLocation:y,location:f})):o.types;if(p===!1){i();return}c={update:i,types:p}}else c=i;document.startViewTransition(c)}else i()},this.updateMatch=(i,o)=>{this.startTransition(()=>{const c=this.state.pendingMatches?.some(f=>f.id===i)?"pendingMatches":this.state.matches.some(f=>f.id===i)?"matches":this.state.cachedMatches.some(f=>f.id===i)?"cachedMatches":"";c&&this.__store.setState(f=>({...f,[c]:f[c]?.map(y=>y.id===i?o(y):y)}))})},this.getMatch=i=>{const o=c=>c.id===i;return this.state.cachedMatches.find(o)??this.state.pendingMatches?.find(o)??this.state.matches.find(o)},this.invalidate=i=>{const o=c=>i?.filter?.(c)??!0?{...c,invalid:!0,...i?.forcePending||c.status==="error"||c.status==="notFound"?{status:"pending",error:void 0}:void 0}:c;return this.__store.setState(c=>({...c,matches:c.matches.map(o),cachedMatches:c.cachedMatches.map(o),pendingMatches:c.pendingMatches?.map(o)})),this.shouldViewTransition=!1,this.load({sync:i?.sync})},this.getParsedLocationHref=i=>i.publicHref||"/",this.resolveRedirect=i=>{const o=i.headers.get("Location");if(!i.options.href||i.options._builtLocation){const c=i.options._builtLocation??this.buildLocation(i.options),f=this.getParsedLocationHref(c);i.options.href=f,i.headers.set("Location",f)}else if(o)try{const c=new URL(o);if(this.origin&&c.origin===this.origin){const f=c.pathname+c.search+c.hash;i.options.href=f,i.headers.set("Location",f)}}catch{}return i.headers.get("Location")||i.headers.set("Location",i.options.href),i},this.clearCache=i=>{const o=i?.filter;o!==void 0?this.__store.setState(c=>({...c,cachedMatches:c.cachedMatches.filter(f=>!o(f))})):this.__store.setState(c=>({...c,cachedMatches:[]}))},this.clearExpiredCache=()=>{const i=o=>{const c=this.looseRoutesById[o.routeId];if(!c.options.loader)return!0;const f=(o.preload?c.options.preloadGcTime??this.options.defaultPreloadGcTime:c.options.gcTime??this.options.defaultGcTime)??300*1e3;return o.status==="error"?!0:Date.now()-o.updatedAt>=f};this.clearCache({filter:i})},this.loadRouteChunk=tp,this.preloadRoute=async i=>{const o=this.buildLocation(i);let c=this.matchRoutes(o,{throwOnError:!0,preload:!0,dest:i});const f=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(p=>p.id)),y=new Set([...f,...this.state.cachedMatches.map(p=>p.id)]);Il(()=>{c.forEach(p=>{y.has(p.id)||this.__store.setState(g=>({...g,cachedMatches:[...g.cachedMatches,p]}))})});try{return c=await my({router:this,matches:c,location:o,preload:!0,updateMatch:(p,g)=>{f.has(p)?c=c.map(m=>m.id===p?g(m):m):this.updateMatch(p,g)}}),c}catch(p){if(sn(p))return p.options.reloadDocument?void 0:await this.preloadRoute({...p.options,_fromLocation:o});Te(p)||console.error(p);return}},this.matchRoute=(i,o)=>{const c={...i,to:i.to?this.resolvePathWithBase(i.from||"",i.to):void 0,params:i.params||{},leaveParams:!0},f=this.buildLocation(c);if(o?.pending&&this.state.status!=="pending")return!1;const p=(o?.pending===void 0?!this.state.isLoading:o.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,g=Gv(f.pathname,o?.caseSensitive??!1,o?.fuzzy??!1,p.pathname,this.processedTree);return!g||i.params&&!nl(g.rawParams,i.params,{partial:!0})?!1:o?.includeSearch??!0?nl(p.search,f.search,{partial:!0})?g.rawParams:!1:g.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(i=>i.status==="notFound"||i.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...s,caseSensitive:s.caseSensitive??!1,notFoundMode:s.notFoundMode??"fuzzy",stringifySearch:s.stringifySearch??rS,parseSearch:s.parseSearch??sS}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:s,routesByPath:i,processedTree:o}){this.routesById=s,this.routesByPath=i,this.processedTree=o;const c=this.options.notFoundRoute;c&&(c.init({originalIndex:99999999999}),this.routesById[c.id]=c)}get looseRoutesById(){return this.routesById}getParentContext(s){return s?.id?s.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(s,i){const o=this.getMatchedRoutes(s.pathname),{foundRoute:c,routeParams:f,parsedParams:y}=o;let{matchedRoutes:p}=o,g=!1;(c?c.path!=="/"&&f["**"]:Qn(s.pathname))&&(this.options.notFoundRoute?p=[...p,this.options.notFoundRoute]:g=!0);const m=g?xS(this.options.notFoundMode,p):void 0,S=new Array(p.length);for(let h=0;hat.routeId===_.id),Q=W?._strictParams??V;let P;if(!W)try{yy(_,V,y,Q)}catch(at){if(Te(at)||sn(at)?P=at:P=new bS(at.message,{cause:at}),i?.throwOnError)throw P}Object.assign(f,Q);const dt=Z?"stay":"enter";let it;if(W)it={...W,cause:dt,params:Z?Be(Z.params,f):f,_strictParams:Q,search:Be(Z?Z.search:W.search,O),_strictSearch:w};else{const at=_.options.loader||_.options.beforeLoad||_.lazyFn||ep(_)?"pending":"success";it={id:I,ssr:_.options.ssr,index:h,routeId:_.id,params:Z?Be(Z.params,f):f,_strictParams:Q,pathname:G,updatedAt:Date.now(),search:Z?Be(Z.search,O):O,_strictSearch:w,searchError:void 0,status:at,isFetching:!1,error:void 0,paramsError:P,__routeContext:void 0,_nonReactive:{loadPromise:ll()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:dt,loaderDeps:Z?Be(Z.loaderDeps,U):U,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:_.options.staticData||{},fullPath:_.fullPath}}i?.preload||(it.globalNotFound=m===_.id),it.searchError=z;const ct=this.getParentContext(A);it.context={...ct,...it.__routeContext,...it.__beforeLoadContext},S[h]=it}for(let h=0;hthis.navigate({...J,_fromLocation:s}),buildLocation:this.buildLocation,cause:_.cause,abortController:_.abortController,preload:!!_.preload,matches:S};_.__routeContext=A.options.context(U)??void 0}_.context={...z,..._.__routeContext,..._.__beforeLoadContext}}}return S}matchRoutesLightweight(s){const{matchedRoutes:i,routeParams:o,parsedParams:c}=this.getMatchedRoutes(s.pathname),f=os(i),y={...s.search};for(const S of i)try{Object.assign(y,Nr(S.options.validateSearch,y))}catch{}const p=os(this.state.matches),g=p&&p.routeId===f.id&&s.pathname===this.state.location.pathname;let m;if(g)m=p.params;else{const S={...o};for(const h of i)try{yy(h,o,c??{},S)}catch{}m=S}return{matchedRoutes:i,fullPath:f.fullPath,search:y,params:m}}}class Vr extends Error{}class bS extends Error{}function _S(a){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:a,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Nr(a,s){if(a==null)return{};if("~standard"in a){const i=a["~standard"].validate(s);if(i instanceof Promise)throw new Vr("Async validation not supported");if(i.issues)throw new Vr(JSON.stringify(i.issues,void 0,2),{cause:i});return i.value}return"parse"in a?a.parse(s):typeof a=="function"?a(s):{}}function ES({pathname:a,routesById:s,processedTree:i}){const o={},c=Qn(a);let f,y;const p=Vv(c,i,!0);return p&&(f=p.route,Object.assign(o,p.rawParams),y=Object.assign({},p.parsedParams)),{matchedRoutes:p?.branch||[s[ln]],routeParams:o,foundRoute:f,parsedParams:y}}function TS({search:a,dest:s,destRoutes:i,_includeValidateSearch:o}){return RS(i)(a,s,o??!1)}function RS(a){const s={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const c of a){if("search"in c.options)c.options.search?.middlewares&&s.middlewares.push(...c.options.search.middlewares);else if(c.options.preSearchFilters||c.options.postSearchFilters){const f=({search:y,next:p})=>{let g=y;"preSearchFilters"in c.options&&c.options.preSearchFilters&&(g=c.options.preSearchFilters.reduce((S,h)=>h(S),y));const m=p(g);return"postSearchFilters"in c.options&&c.options.postSearchFilters?c.options.postSearchFilters.reduce((S,h)=>h(S),m):m};s.middlewares.push(f)}if(c.options.validateSearch){const f=({search:y,next:p})=>{const g=p(y);if(!s._includeValidateSearch)return g;try{return{...g,...Nr(c.options.validateSearch,g)??void 0}}catch{return g}};s.middlewares.push(f)}}const i=({search:c})=>{const f=s.dest;return f.search?f.search===!0?c:Ra(f.search,c):{}};s.middlewares.push(i);const o=(c,f,y)=>{if(c>=y.length)return f;const p=y[c];return p({search:f,next:m=>o(c+1,m,y)})};return function(f,y,p){return s.dest=y,s._includeValidateSearch=p,o(0,f,s.middlewares)}}function xS(a,s){if(a!=="root")for(let i=s.length-1;i>=0;i--){const o=s[i];if(o.children)return o.id}return ln}function yy(a,s,i,o){const c=a.options.params?.parse??a.options.parseParams;if(c)if(a.options.skipRouteOnParseError)for(const f in s)f in i&&(o[f]=i[f]);else{const f=c(o);Object.assign(o,f)}}const bn=Symbol.for("TSR_DEFERRED_PROMISE");function wS(a,s){const i=a;return i[bn]||(i[bn]={status:"pending"},i.then(o=>{i[bn].status="success",i[bn].data=o}).catch(o=>{i[bn].status="error",i[bn].error={data:vS(o),__isServerError:!0}})),i}const AS="Error preloading route! ☝️";class lp{constructor(s){if(this.init=i=>{this.originalIndex=i.originalIndex;const o=this.options,c=!o?.path&&!o?.id;this.parentRoute=this.options.getParentRoute?.(),c?this._path=ln:this.parentRoute||je(!1);let f=c?ln:o?.path;f&&f!=="/"&&(f=Ky(f));const y=o?.id||f;let p=c?ln:Cr([this.parentRoute.id===ln?"":this.parentRoute.id,y]);f===ln&&(f="/"),p!==ln&&(p=Cr(["/",p]));const g=p===ln?"/":Cr([this.parentRoute.fullPath,f]);this._path=f,this._id=p,this._fullPath=g,this._to=Qn(g)},this.addChildren=i=>this._addFileChildren(i),this._addFileChildren=i=>(Array.isArray(i)&&(this.children=i),typeof i=="object"&&i!==null&&(this.children=Object.values(i)),this),this._addFileTypes=()=>this,this.updateLoader=i=>(Object.assign(this.options,i),this),this.update=i=>(Object.assign(this.options,i),this),this.lazy=i=>(this.lazyFn=i,this),this.redirect=i=>kr({from:this.fullPath,...i}),this.options=s||{},this.isRoot=!s?.getParentRoute,s?.id&&s?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class MS extends lp{constructor(s){super(s)}}var OS=(a=>(a[a.AggregateError=1]="AggregateError",a[a.ArrowFunction=2]="ArrowFunction",a[a.ErrorPrototypeStack=4]="ErrorPrototypeStack",a[a.ObjectAssign=8]="ObjectAssign",a[a.BigIntTypedArray=16]="BigIntTypedArray",a[a.RegExp=32]="RegExp",a))(OS||{}),Zn=Symbol.asyncIterator,ip=Symbol.hasInstance,ni=Symbol.isConcatSpreadable,kn=Symbol.iterator,sp=Symbol.match,rp=Symbol.matchAll,op=Symbol.replace,up=Symbol.search,cp=Symbol.species,fp=Symbol.split,dp=Symbol.toPrimitive,ai=Symbol.toStringTag,hp=Symbol.unscopables,mp={[Zn]:0,[ip]:1,[ni]:2,[kn]:3,[sp]:4,[rp]:5,[op]:6,[up]:7,[cp]:8,[fp]:9,[dp]:10,[ai]:11,[hp]:12},zS={0:Zn,1:ip,2:ni,3:kn,4:sp,5:rp,6:op,7:up,8:cp,9:fp,10:dp,11:ai,12:hp},b=void 0,CS={2:!0,3:!1,1:b,0:null,4:-0,5:Number.POSITIVE_INFINITY,6:Number.NEGATIVE_INFINITY,7:Number.NaN},DS={0:"Error",1:"EvalError",2:"RangeError",3:"ReferenceError",4:"SyntaxError",5:"TypeError",6:"URIError"},NS={0:Error,1:EvalError,2:RangeError,3:ReferenceError,4:SyntaxError,5:TypeError,6:URIError};function zt(a,s,i,o,c,f,y,p,g,m,S,h){return{t:a,i:s,s:i,c:o,m:c,p:f,e:y,a:p,f:g,b:m,o:S,l:h}}function Aa(a){return zt(2,b,a,b,b,b,b,b,b,b,b,b)}var yp=Aa(2),pp=Aa(3),LS=Aa(1),US=Aa(0),BS=Aa(4),HS=Aa(5),jS=Aa(6),YS=Aa(7);function qS(a){switch(a){case'"':return'\\"';case"\\":return"\\\\";case` +`:return"\\n";case"\r":return"\\r";case"\b":return"\\b";case" ":return"\\t";case"\f":return"\\f";case"<":return"\\x3C";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:return b}}function Ma(a){let s="",i=0,o;for(let c=0,f=a.length;cp1(a),Ep=class extends Error{constructor(a,s){super(g1(a)),this.cause=s}},py=class extends Ep{constructor(a){super("parsing",a)}},v1=class extends Ep{constructor(a){super("deserialization",a)}};function Kn(a){return`Seroval Error (specific: ${a})`}var Jr=class extends Error{constructor(s){super(Kn(1)),this.value=s}},Tp=class extends Error{constructor(s){super(Kn(2))}},S1=class extends Error{constructor(a){super(Kn(3))}},ds=class extends Error{constructor(a){super(Kn(4))}},b1=class extends Error{constructor(a){super(Kn(5)),this.value=a}},_1=class extends Error{constructor(a){super(Kn(6))}},E1=class extends Error{constructor(a){super(Kn(7))}},Oa=class extends Error{constructor(a){super(Kn(8))}},T1=class extends Error{constructor(s){super(Kn(9))}},R1=class{constructor(a,s){this.value=a,this.replacement=s}},Fr=()=>{let a={p:0,s:0,f:0};return a.p=new Promise((s,i)=>{a.s=s,a.f=i}),a},x1=(a,s)=>{a.s(s),a.p.s=1,a.p.v=s},w1=(a,s)=>{a.f(s),a.p.s=2,a.p.v=s};Fr.toString();x1.toString();w1.toString();var A1=()=>{let a=[],s=[],i=!0,o=!1,c=0,f=(g,m,S)=>{for(S=0;S{for(m=0,S=a.length;m(i&&(m=c++,s[m]=g),y(g),()=>{i&&(s[m]=s[c],s[c--]=void 0)});return{__SEROVAL_STREAM__:!0,on:g=>p(g),next:g=>{i&&(a.push(g),f(g,"next"))},throw:g=>{i&&(a.push(g),f(g,"throw"),i=!1,o=!1,s.length=0)},return:g=>{i&&(a.push(g),f(g,"return"),i=!1,o=!0,s.length=0)}}},M1=a=>s=>()=>{let i=0,o={[a]:()=>o,next:()=>{if(i>s.d)return{done:!0,value:void 0};let c=i++,f=s.v[c];if(c===s.t)throw f;return{done:c===s.d,value:f}}};return o},O1=(a,s)=>i=>()=>{let o=0,c=-1,f=!1,y=[],p=[],g=(S=0,h=p.length)=>{for(;S{let h=p.shift();h&&h.s({done:!1,value:S}),y.push(S)},throw:S=>{let h=p.shift();h&&h.f(S),g(),c=y.length,f=!0,y.push(S)},return:S=>{let h=p.shift();h&&h.s({done:!0,value:S}),g(),c=y.length,y.push(S)}});let m={[a]:()=>m,next:()=>{if(c===-1){let _=o++;if(_>=y.length){let A=s();return p.push(A),A.p}return{done:!1,value:y[_]}}if(o>c)return{done:!0,value:void 0};let S=o++,h=y[S];if(S!==c)return{done:!1,value:h};if(f)throw h;return{done:!0,value:h}}};return m},Rp=a=>{let s=atob(a),i=s.length,o=new Uint8Array(i);for(let c=0;c{}),s}var j1=O1(Zn,Fr);function Y1(a){return j1(a)}async function q1(a){try{return[1,await a]}catch(s){return[0,s]}}function G1(a,s){return{plugins:s.plugins,mode:a,marked:new Set,features:63^(s.disabledFeatures||0),refs:s.refs||new Map,depthLimit:s.depthLimit||1e3}}function Lr(a,s){a.marked.add(s)}function V1(a,s){let i=a.refs.size;return a.refs.set(s,i),i}function $r(a,s){let i=a.refs.get(s);return i!=null?(Lr(a,i),{type:1,value:JS(i)}):{type:0,value:V1(a,s)}}function Kc(a,s){let i=$r(a,s);return i.type===1?i:vp(s)?{type:2,value:WS(i.value,s)}:i}function el(a,s){let i=Kc(a,s);if(i.type!==0)return i.value;if(s in mp)return $S(i.value,s);throw new Jr(s)}function Wr(a,s){let i=$r(a,B1[s]);return i.type===1?i.value:zt(26,i.value,s,b,b,b,b,b,b,b,b,b)}function X1(a){let s=$r(a,L1);return s.type===1?s.value:zt(27,s.value,b,b,b,b,b,b,el(a,kn),b,b,b)}function Q1(a){let s=$r(a,U1);return s.type===1?s.value:zt(29,s.value,b,b,b,b,b,[Wr(a,1),el(a,Zn)],b,b,b,b)}function Z1(a,s,i,o){return zt(i?11:10,a,b,b,b,o,b,b,b,b,bp(s),b)}function k1(a,s,i,o){return zt(8,s,b,b,b,b,{k:i,v:o},b,Wr(a,0),b,b,b)}function K1(a,s,i){let o=new Uint8Array(i),c="";for(let f=0,y=o.length;f{Lr(this.base,s),le(this,a,p).then(g=>{f.push(f1(s,g))},g=>{c(g),y()})},throw:p=>{Lr(this.base,s),le(this,a,p).then(g=>{f.push(d1(s,g)),o(f),y()},g=>{c(g),y()})},return:p=>{Lr(this.base,s),le(this,a,p).then(g=>{f.push(h1(s,g)),o(f),y()},g=>{c(g),y()})}})}async function rb(a,s,i,o){return c1(i,Wr(a.base,4),await new Promise(sb.bind(a,s,i,o)))}async function ob(a,s,i,o){let c=[];for(let f=0,y=o.v.length;f(a[a.Vanilla=1]="Vanilla",a[a.Cross=2]="Cross",a))(db||{});function Ap(a,s){for(let i=0,o=s.length;i0)for(let f=0,y=i.v,p=c.length;fpb)throw new Oa(s);return ie(a,s.i,new RegExp(i,s.m))}throw new Tp(s)}function Cb(a,s,i){let o=ie(a,i.i,new Set);for(let c=0,f=i.a,y=f.length;cmb)throw new Oa(s);return ie(a,s.i,Rp(rl(s.s)))}function Lb(a,s,i){var o;let c=hb(i.c),f=Yt(a,s,i.f),y=(o=i.b)!=null?o:0;if(y<0||y>f.byteLength)throw new Oa(i);return ie(a,i.i,new c(f,y,i.l))}function Ub(a,s,i){var o;let c=Yt(a,s,i.f),f=(o=i.b)!=null?o:0;if(f<0||f>c.byteLength)throw new Oa(i);return ie(a,i.i,new DataView(c,f,i.l))}function Dp(a,s,i,o){if(i.p){let c=Cp(a,s,i.p,{});Object.defineProperties(o,Object.getOwnPropertyDescriptors(c))}return o}function Bb(a,s,i){let o=ie(a,i.i,new AggregateError([],rl(i.m)));return Dp(a,s,i,o)}function Hb(a,s,i){let o=Yc(i,NS,i.s),c=ie(a,i.i,new o(rl(i.m)));return Dp(a,s,i,c)}function jb(a,s,i){let o=Fr(),c=ie(a,i.i,o.p),f=Yt(a,s,i.f);return i.s?o.s(f):o.f(f),c}function Yb(a,s,i){return ie(a,i.i,Object(Yt(a,s,i.f)))}function qb(a,s,i){let o=a.base.plugins;if(o){let c=rl(i.c);for(let f=0,y=o.length;fa.base.depthLimit)throw new T1(a.base.depthLimit);switch(s+=1,i.t){case 2:return Yc(i,CS,i.s);case 0:return Number(i.s);case 1:return rl(String(i.s));case 3:if(String(i.s).length>yb)throw new Oa(i);return BigInt(i.s);case 4:return a.base.refs.get(i.i);case 18:return Tb(a,i);case 9:return Rb(a,s,i);case 10:case 11:return Mb(a,s,i);case 5:return Ob(a,i);case 6:return zb(a,i);case 7:return Cb(a,s,i);case 8:return Db(a,s,i);case 19:return Nb(a,i);case 16:case 15:return Lb(a,s,i);case 20:return Ub(a,s,i);case 14:return Bb(a,s,i);case 13:return Hb(a,s,i);case 12:return jb(a,s,i);case 17:return Yc(i,zS,i.s);case 21:return Yb(a,s,i);case 25:return qb(a,s,i);case 22:return Gb(a,i);case 23:return Vb(a,s,i);case 24:return Xb(a,s,i);case 28:return Qb(a,s,i);case 30:return Zb(a,s,i);case 31:return kb(a,s,i);case 32:return Kb(a,s,i);case 33:return Jb(a,s,i);case 34:return Fb(a,s,i);case 27:return Pb(a,s,i);case 29:return $b(a,s,i);case 35:return Wb(a,s,i);default:throw new Tp(i)}}function Ib(a,s){try{return Yt(a,0,s)}catch(i){throw new v1(i)}}var t_=()=>T;t_.toString();function Ac(a,s){let i=Mp(s.plugins),o=Sb({plugins:i,refs:s.refs,features:s.features,disabledFeatures:s.disabledFeatures});return Ib(o,a)}async function e_(a,s={}){let i=Mp(s.plugins),o=J1(1,{plugins:i,disabledFeatures:s.disabledFeatures});return{t:await fb(o,a),f:o.base.features,m:Array.from(o.base.marked)}}function n_(a){return{tag:"$TSR/t/"+a.key,test:a.test,parse:{sync(s,i){return i.parse(a.toSerializable(s))},async async(s,i){return await i.parse(a.toSerializable(s))},stream(s,i){return i.parse(a.toSerializable(s))}},serialize:void 0,deserialize(s,i){return a.fromSerializable(i.deserialize(s))}}}var Ta={},Np=a=>new ReadableStream({start:s=>{a.on({next:i=>{try{s.enqueue(i)}catch{}},throw:i=>{s.error(i)},return:()=>{try{s.close()}catch{}}})}}),a_={tag:"seroval-plugins/web/ReadableStreamFactory",test(a){return a===Ta},parse:{sync(){return Ta},async async(){return await Promise.resolve(Ta)},stream(){return Ta}},serialize(){return Np.toString()},deserialize(){return Ta}};function Sy(a){let s=ol(),i=a.getReader();async function o(){try{let c=await i.read();c.done?s.return(c.value):(s.next(c.value),await o())}catch(c){s.throw(c)}}return o().catch(()=>{}),s}var l_={tag:"seroval/plugins/web/ReadableStream",extends:[a_],test(a){return typeof ReadableStream>"u"?!1:a instanceof ReadableStream},parse:{sync(a,s){return{factory:s.parse(Ta),stream:s.parse(ol())}},async async(a,s){return{factory:await s.parse(Ta),stream:await s.parse(Sy(a))}},stream(a,s){return{factory:s.parse(Ta),stream:s.parse(Sy(a))}}},serialize(a,s){return"("+s.serialize(a.factory)+")("+s.serialize(a.stream)+")"},deserialize(a,s){let i=s.deserialize(a.stream);return Np(i)}},i_=l_;const s_={tag:"$TSR/Error",test(a){return a instanceof Error},parse:{sync(a,s){return{message:s.parse(a.message)}},async async(a,s){return{message:await s.parse(a.message)}},stream(a,s){return{message:s.parse(a.message)}}},serialize(a,s){return"new Error("+s.serialize(a.message)+")"},deserialize(a,s){return new Error(s.deserialize(a.message))}};class r_{constructor(s,i){this.stream=s,this.hint=i?.hint??"binary"}}const Xr=globalThis.Buffer,Lp=!!Xr&&typeof Xr.from=="function";function Up(a){if(a.length===0)return"";if(Lp)return Xr.from(a).toString("base64");const s=32768,i=[];for(let o=0;onew ReadableStream({start(s){a.on({next(i){try{s.enqueue(Bp(i))}catch{}},throw(i){s.error(i)},return(){try{s.close()}catch{}}})}}),u_=new TextEncoder,c_=a=>new ReadableStream({start(s){a.on({next(i){try{typeof i=="string"?s.enqueue(u_.encode(i)):s.enqueue(Bp(i.$b64))}catch{}},throw(i){s.error(i)},return(){try{s.close()}catch{}}})}}),f_="(s=>new ReadableStream({start(c){s.on({next(b){try{const d=atob(b),a=new Uint8Array(d.length);for(let i=0;i{const e=new TextEncoder();return new ReadableStream({start(c){s.on({next(v){try{if(typeof v==='string'){c.enqueue(e.encode(v))}else{const d=atob(v.$b64),a=new Uint8Array(d.length);for(let i=0;i{try{for(;;){const{done:o,value:c}=await i.read();if(o){s.return(void 0);break}s.next(Up(c))}}catch(o){s.throw(o)}finally{i.releaseLock()}})(),s}function _y(a){const s=ol(),i=a.getReader(),o=new TextDecoder("utf-8",{fatal:!0});return(async()=>{try{for(;;){const{done:c,value:f}=await i.read();if(c){try{const y=o.decode();y.length>0&&s.next(y)}catch{}s.return(void 0);break}try{const y=o.decode(f,{stream:!0});y.length>0&&s.next(y)}catch{s.next({$b64:Up(f)})}}}catch(c){s.throw(c)}finally{i.releaseLock()}})(),s}const h_={tag:"tss/RawStreamFactory",test(a){return a===ss},parse:{sync(){},async(){return Promise.resolve(void 0)},stream(){}},serialize(){return f_},deserialize(){return ss}},m_={tag:"tss/RawStreamFactoryText",test(a){return a===rs},parse:{sync(){},async(){return Promise.resolve(void 0)},stream(){}},serialize(){return d_},deserialize(){return rs}},y_={tag:"tss/RawStream",extends:[h_,m_],test(a){return a instanceof r_},parse:{sync(a,s){const i=a.hint==="text"?rs:ss;return{hint:a.hint,factory:s.parse(i),stream:s.parse(ol())}},async async(a,s){const i=a.hint==="text"?rs:ss,o=a.hint==="text"?_y(a.stream):by(a.stream);return{hint:a.hint,factory:await s.parse(i),stream:await s.parse(o)}},stream(a,s){const i=a.hint==="text"?rs:ss,o=a.hint==="text"?_y(a.stream):by(a.stream);return{hint:a.hint,factory:s.parse(i),stream:s.parse(o)}}},serialize(a,s){return"("+s.serialize(a.factory)+")("+s.serialize(a.stream)+")"},deserialize(a,s){const i=s.deserialize(a.stream);return a.hint==="text"?c_(i):o_(i)}};function p_(a){return{tag:"tss/RawStream",test:()=>!1,parse:{},serialize(){throw new Error("RawStreamDeserializePlugin.serialize should not be called. Client only deserializes.")},deserialize(s){return a(s.streamId)}}}const g_=[s_,y_,i_],v_="use",Qr=dv[v_],Or=typeof window<"u"?ot.useLayoutEffect:ot.useEffect;function Mc(a){const s=ot.useRef({value:a,prev:null}),i=s.current.value;return a!==i&&(s.current={value:a,prev:i}),s.current.prev}function S_(a,s,i={},o={}){ot.useEffect(()=>{if(!a.current||o.disabled||typeof IntersectionObserver!="function")return;const c=new IntersectionObserver(([f])=>{s(f)},i);return c.observe(a.current),()=>{c.disconnect()}},[s,i,o.disabled,a])}function b_(a){const s=ot.useRef(null);return ot.useImperativeHandle(a,()=>s.current,[]),s}function __({promise:a}){if(Qr)return Qr(a);const s=wS(a);if(s[bn].status==="pending")throw s;if(s[bn].status==="error")throw s[bn].error;return s[bn].data}function E_(a){const s=$.jsx(T_,{...a});return a.fallback?$.jsx(ot.Suspense,{fallback:a.fallback,children:s}):s}function T_(a){const s=__(a);return a.children(s)}function Fc(a){const s=a.errorComponent??Pc;return $.jsx(R_,{getResetKey:a.getResetKey,onCatch:a.onCatch,children:({error:i,reset:o})=>i?ot.createElement(s,{error:i,reset:o}):a.children})}class R_ extends ot.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(s){return{resetKey:s.getResetKey()}}static getDerivedStateFromError(s){return{error:s}}reset(){this.setState({error:null})}componentDidUpdate(s,i){i.error&&i.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(s,i){this.props.onCatch&&this.props.onCatch(s,i)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Pc({error:a}){const[s,i]=ot.useState(!1);return $.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[$.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[$.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),$.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>i(o=>!o),children:s?"Hide Error":"Show Error"})]}),$.jsx("div",{style:{height:".25rem"}}),s?$.jsx("div",{children:$.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:a.message?$.jsx("code",{children:a.message}):null})}):null]})}function x_({children:a,fallback:s=null}){return Hp()?$.jsx(F.Fragment,{children:a}):$.jsx(F.Fragment,{children:s})}function Hp(){return F.useSyncExternalStore(w_,()=>!0,()=>!1)}function w_(){return()=>{}}var Oc={exports:{}},zc={},Cc={exports:{}},Dc={};var Ey;function A_(){if(Ey)return Dc;Ey=1;var a=fs();function s(h,_){return h===_&&(h!==0||1/h===1/_)||h!==h&&_!==_}var i=typeof Object.is=="function"?Object.is:s,o=a.useState,c=a.useEffect,f=a.useLayoutEffect,y=a.useDebugValue;function p(h,_){var A=_(),O=o({inst:{value:A,getSnapshot:_}}),w=O[0].inst,z=O[1];return f(function(){w.value=A,w.getSnapshot=_,g(w)&&z({inst:w})},[h,A,_]),c(function(){return g(w)&&z({inst:w}),h(function(){g(w)&&z({inst:w})})},[h]),y(A),A}function g(h){var _=h.getSnapshot;h=h.value;try{var A=_();return!i(h,A)}catch{return!0}}function m(h,_){return _()}var S=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:p;return Dc.useSyncExternalStore=a.useSyncExternalStore!==void 0?a.useSyncExternalStore:S,Dc}var Ty;function M_(){return Ty||(Ty=1,Cc.exports=A_()),Cc.exports}var Ry;function O_(){if(Ry)return zc;Ry=1;var a=fs(),s=M_();function i(m,S){return m===S&&(m!==0||1/m===1/S)||m!==m&&S!==S}var o=typeof Object.is=="function"?Object.is:i,c=s.useSyncExternalStore,f=a.useRef,y=a.useEffect,p=a.useMemo,g=a.useDebugValue;return zc.useSyncExternalStoreWithSelector=function(m,S,h,_,A){var O=f(null);if(O.current===null){var w={hasValue:!1,value:null};O.current=w}else w=O.current;O=p(function(){function U(W){if(!J){if(J=!0,G=W,W=_(W),A!==void 0&&w.hasValue){var Z=w.value;if(A(Z,W))return V=Z}return V=W}if(Z=V,o(G,W))return Z;var Q=_(W);return A!==void 0&&A(Z,Q)?(G=W,Z):(G=W,V=Q)}var J=!1,G,V,I=h===void 0?null:h;return[function(){return U(S())},I===null?void 0:function(){return U(I())}]},[S,h,_,A]);var z=c(m,O[0],O[1]);return y(function(){w.hasValue=!0,w.value=z},[z]),g(z),z},zc}var xy;function z_(){return xy||(xy=1,Oc.exports=O_()),Oc.exports}var C_=z_();function D_(a,s=o=>o,i={}){const o=i.equal??N_;return C_.useSyncExternalStoreWithSelector(a.subscribe,()=>a.state,()=>a.state,s,o)}function N_(a,s){if(Object.is(a,s))return!0;if(typeof a!="object"||a===null||typeof s!="object"||s===null)return!1;if(a instanceof Map&&s instanceof Map){if(a.size!==s.size)return!1;for(const[o,c]of a)if(!s.has(o)||!Object.is(c,s.get(o)))return!1;return!0}if(a instanceof Set&&s instanceof Set){if(a.size!==s.size)return!1;for(const o of a)if(!s.has(o))return!1;return!0}if(a instanceof Date&&s instanceof Date)return a.getTime()===s.getTime();const i=wy(a);if(i.length!==wy(s).length)return!1;for(let o=0;o"u"?Nc:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=Nc,Nc)}function Se(a){const s=ot.useContext(jp());return a?.warn,s}function ae(a){const s=Se({warn:a?.router===void 0}),i=a?.router||s,o=ot.useRef(void 0);return D_(i.__store,c=>{if(a?.select){if(a.structuralSharing??i.options.defaultStructuralSharing){const f=Be(o.current,a.select(c));return o.current=f,f}return a.select(c)}return c})}const Ir=ot.createContext(void 0),L_=ot.createContext(void 0);function _n(a){const s=ot.useContext(a.from?L_:Ir);return ae({select:o=>{const c=o.matches.find(f=>a.from?a.from===f.routeId:f.id===s);if(je(!((a.shouldThrow??!0)&&!c),`Could not find ${a.from?`an active match from "${a.from}"`:"a nearest match!"}`),c!==void 0)return a.select?a.select(c):c},structuralSharing:a.structuralSharing})}function $c(a){return _n({from:a.from,strict:a.strict,structuralSharing:a.structuralSharing,select:s=>a.select?a.select(s.loaderData):s.loaderData})}function Wc(a){const{select:s,...i}=a;return _n({...i,select:o=>s?s(o.loaderDeps):o.loaderDeps})}function Ic(a){return _n({from:a.from,shouldThrow:a.shouldThrow,structuralSharing:a.structuralSharing,strict:a.strict,select:s=>{const i=a.strict===!1?s.params:s._strictParams;return a.select?a.select(i):i}})}function tf(a){return _n({from:a.from,strict:a.strict,shouldThrow:a.shouldThrow,structuralSharing:a.structuralSharing,select:s=>a.select?a.select(s.search):s.search})}function ef(a){const s=Se();return ot.useCallback(i=>s.navigate({...i,from:i.from??a?.from}),[a?.from,s])}var Yp=Gy();const U_=qy(Yp);function B_(a,s){const i=Se(),o=b_(s),{activeProps:c,inactiveProps:f,activeOptions:y,to:p,preload:g,preloadDelay:m,hashScrollIntoView:S,replace:h,startTransition:_,resetScroll:A,viewTransition:O,children:w,target:z,disabled:U,style:J,className:G,onClick:V,onFocus:I,onMouseEnter:W,onMouseLeave:Z,onTouchStart:Q,ignoreBlocker:P,params:dt,search:it,hash:ct,state:at,mask:bt,reloadDocument:wt,unsafeRelative:N,from:K,_fromLocation:lt,...St}=a,pt=Hp(),R=ae({select:Dt=>Dt.location.search,structuralSharing:!0}),j=a.from,X=ot.useMemo(()=>({...a,from:j}),[i,R,j,a._fromLocation,a.hash,a.to,a.search,a.params,a.state,a.mask,a.unsafeRelative]),k=ot.useMemo(()=>i.buildLocation({...X}),[i,X]),tt=k.maskedLocation?k.maskedLocation.publicHref:k.publicHref,rt=k.maskedLocation?k.maskedLocation.external:k.external,yt=ot.useMemo(()=>V_(tt,rt,i.history,U),[U,rt,tt,i.history]),ht=ot.useMemo(()=>{if(yt?.external)return jr(yt.href)?void 0:yt.href;if(!X_(p)&&!(typeof p!="string"||p.indexOf(":")===-1))try{return new URL(p),jr(p)?void 0:p}catch{}},[p,yt]),At=ae({select:Dt=>{if(ht)return!1;if(y?.exact){if(!Jv(Dt.location.pathname,k.pathname,i.basepath))return!1}else{const te=qr(Dt.location.pathname,i.basepath),ee=qr(k.pathname,i.basepath);if(!(te.startsWith(ee)&&(te.length===ee.length||te[ee.length]==="/")))return!1}return(y?.includeSearch??!0)&&!nl(Dt.location.search,k.search,{partial:!y?.exact,ignoreUndefined:!y?.explicitUndefined})?!1:y?.includeHash?pt&&Dt.location.hash===k.hash:!0}}),be=At?Ra(c,{})??H_:Lc,Re=At?Lc:Ra(f,{})??Lc,Ye=[G,be.className,Re.className].filter(Boolean).join(" "),za=(J||be.style||Re.style)&&{...J,...be.style,...Re.style},[qe,Jn]=ot.useState(!1),En=ot.useRef(!1),xe=a.reloadDocument||ht?!1:g??i.options.defaultPreload,Tn=m??i.options.defaultPreloadDelay??0,Kt=ot.useCallback(()=>{i.preloadRoute({...X}).catch(Dt=>{console.warn(Dt),console.warn(AS)})},[i,X]),Ca=ot.useCallback(Dt=>{Dt?.isIntersecting&&Kt()},[Kt]);S_(o,Ca,G_,{disabled:!!U||xe!=="viewport"}),ot.useEffect(()=>{En.current||!U&&xe==="render"&&(Kt(),En.current=!0)},[U,Kt,xe]);const Da=Dt=>{const te=Dt.currentTarget.getAttribute("target"),ee=z!==void 0?z:te;if(!U&&!Q_(Dt)&&!Dt.defaultPrevented&&(!ee||ee==="_self")&&Dt.button===0){Dt.preventDefault(),Yp.flushSync(()=>{Jn(!0)});const Fn=i.subscribe("onResolved",()=>{Fn(),Jn(!1)});i.navigate({...X,replace:h,resetScroll:A,hashScrollIntoView:S,startTransition:_,viewTransition:O,ignoreBlocker:P})}};if(ht)return{...St,ref:o,href:ht,...w&&{children:w},...z&&{target:z},...U&&{disabled:U},...J&&{style:J},...G&&{className:G},...V&&{onClick:V},...I&&{onFocus:I},...W&&{onMouseEnter:W},...Z&&{onMouseLeave:Z},...Q&&{onTouchStart:Q}};const se=Dt=>{U||xe&&Kt()},dn=se,ce=Dt=>{if(!(U||!xe))if(!Tn)Kt();else{const te=Dt.target;if(ns.has(te))return;const ee=setTimeout(()=>{ns.delete(te),Kt()},Tn);ns.set(te,ee)}},si=Dt=>{if(U||!xe||!Tn)return;const te=Dt.target,ee=ns.get(te);ee&&(clearTimeout(ee),ns.delete(te))};return{...St,...be,...Re,href:yt?.href,ref:o,onClick:as([V,Da]),onFocus:as([I,se]),onMouseEnter:as([W,ce]),onMouseLeave:as([Z,si]),onTouchStart:as([Q,dn]),disabled:!!U,target:z,...za&&{style:za},...Ye&&{className:Ye},...U&&j_,...At&&Y_,...pt&&qe&&q_}}const Lc={},H_={className:"active"},j_={role:"link","aria-disabled":!0},Y_={"data-status":"active","aria-current":"page"},q_={"data-transitioning":"transitioning"},ns=new WeakMap,G_={rootMargin:"100px"},as=a=>s=>{for(const i of a)if(i){if(s.defaultPrevented)return;i(s)}};function V_(a,s,i,o){if(!o)return s?{href:a,external:!0}:{href:i.createHref(a)||"/",external:!1}}function X_(a){if(typeof a!="string")return!1;const s=a.charCodeAt(0);return s===47?a.charCodeAt(1)!==47:s===46}const qp=ot.forwardRef((a,s)=>{const{_asChild:i,...o}=a,{type:c,...f}=B_(o,s),y=typeof o.children=="function"?o.children({isActive:f["data-status"]==="active"}):o.children;if(!i){const{disabled:p,...g}=f;return ot.createElement("a",g,y)}return ot.createElement(i,f,y)});function Q_(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}let Z_=class extends lp{constructor(s){super(s),this.useMatch=i=>_n({select:i?.select,from:this.id,structuralSharing:i?.structuralSharing}),this.useRouteContext=i=>_n({...i,from:this.id,select:o=>i?.select?i.select(o.context):o.context}),this.useSearch=i=>tf({select:i?.select,structuralSharing:i?.structuralSharing,from:this.id}),this.useParams=i=>Ic({select:i?.select,structuralSharing:i?.structuralSharing,from:this.id}),this.useLoaderDeps=i=>Wc({...i,from:this.id}),this.useLoaderData=i=>$c({...i,from:this.id}),this.useNavigate=()=>ef({from:this.fullPath}),this.Link=F.forwardRef((i,o)=>$.jsx(qp,{ref:o,from:this.fullPath,...i})),this.$$typeof=Symbol.for("react.memo")}};function k_(a){return new Z_(a)}class K_ extends MS{constructor(s){super(s),this.useMatch=i=>_n({select:i?.select,from:this.id,structuralSharing:i?.structuralSharing}),this.useRouteContext=i=>_n({...i,from:this.id,select:o=>i?.select?i.select(o.context):o.context}),this.useSearch=i=>tf({select:i?.select,structuralSharing:i?.structuralSharing,from:this.id}),this.useParams=i=>Ic({select:i?.select,structuralSharing:i?.structuralSharing,from:this.id}),this.useLoaderDeps=i=>Wc({...i,from:this.id}),this.useLoaderData=i=>$c({...i,from:this.id}),this.useNavigate=()=>ef({from:this.fullPath}),this.Link=F.forwardRef((i,o)=>$.jsx(qp,{ref:o,from:this.fullPath,...i})),this.$$typeof=Symbol.for("react.memo")}}function J_(a){return new K_(a)}function cs(a){return typeof a=="object"?new Ay(a,{silent:!0}).createRoute(a):new Ay(a,{silent:!0}).createRoute}class Ay{constructor(s,i){this.path=s,this.createRoute=o=>{this.silent;const c=k_(o);return c.isRoot=!1,c},this.silent=i?.silent}}class My{constructor(s){this.useMatch=i=>_n({select:i?.select,from:this.options.id,structuralSharing:i?.structuralSharing}),this.useRouteContext=i=>_n({from:this.options.id,select:o=>i?.select?i.select(o.context):o.context}),this.useSearch=i=>tf({select:i?.select,structuralSharing:i?.structuralSharing,from:this.options.id}),this.useParams=i=>Ic({select:i?.select,structuralSharing:i?.structuralSharing,from:this.options.id}),this.useLoaderDeps=i=>Wc({...i,from:this.options.id}),this.useLoaderData=i=>$c({...i,from:this.options.id}),this.useNavigate=()=>{const i=Se();return ef({from:i.routesById[this.options.id].fullPath})},this.options=s,this.$$typeof=Symbol.for("react.memo")}}function Oy(a){return typeof a=="object"?new My(a):s=>new My({id:a,...s})}function Gp(a,s){let i,o,c,f;const y=()=>(i||(i=a().then(g=>{i=void 0,o=g[s]}).catch(g=>{if(c=g,Cv(c)&&c instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const m=`tanstack_router_reload:${c.message}`;sessionStorage.getItem(m)||(sessionStorage.setItem(m,"1"),f=!0)}})),i),p=function(m){if(f)throw window.location.reload(),new Promise(()=>{});if(c)throw c;if(!o)if(Qr)Qr(y());else throw y();return ot.createElement(o,m)};return p.preload=y,p}function F_(){const a=Se(),s=ot.useRef({router:a,mounted:!1}),[i,o]=ot.useState(!1),{hasPendingMatches:c,isLoading:f}=ae({select:h=>({isLoading:h.isLoading,hasPendingMatches:h.matches.some(_=>_.status==="pending")}),structuralSharing:!0}),y=Mc(f),p=f||i||c,g=Mc(p),m=f||c,S=Mc(m);return a.startTransition=h=>{o(!0),ot.startTransition(()=>{h(),o(!1)})},ot.useEffect(()=>{const h=a.history.subscribe(a.load),_=a.buildLocation({to:a.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Qn(a.latestLocation.publicHref)!==Qn(_.publicHref)&&a.commitLocation({..._,replace:!0}),()=>{h()}},[a,a.history]),Or(()=>{if(typeof window<"u"&&a.ssr||s.current.router===a&&s.current.mounted)return;s.current={router:a,mounted:!0},(async()=>{try{await a.load()}catch(_){console.error(_)}})()},[a]),Or(()=>{y&&!f&&a.emit({type:"onLoad",...al(a.state)})},[y,a,f]),Or(()=>{S&&!m&&a.emit({type:"onBeforeRouteMount",...al(a.state)})},[m,S,a]),Or(()=>{if(g&&!p){const h=al(a.state);a.emit({type:"onResolved",...h}),a.__store.setState(_=>({..._,status:"idle",resolvedLocation:_.location})),h.hrefChanged&&lS(a)}},[p,g,a]),null}function P_(a){const s=ae({select:i=>`not-found-${i.location.pathname}-${i.status}`});return $.jsx(Fc,{getResetKey:()=>s,onCatch:(i,o)=>{if(Te(i))a.onCatch?.(i,o);else throw i},errorComponent:({error:i})=>{if(Te(i))return a.fallback?.(i);throw i},children:a.children})}function $_(){return $.jsx("p",{children:"Not Found"})}function $l(a){return $.jsx($.Fragment,{children:a.children})}function Vp(a,s,i){return s.options.notFoundComponent?$.jsx(s.options.notFoundComponent,{...i}):a.options.defaultNotFoundComponent?$.jsx(a.options.defaultNotFoundComponent,{...i}):$.jsx($_,{})}function W_(){return Se().isScrollRestoring,null}const Xp=ot.memo(function({matchId:s}){const i=Se(),o=ae({select:w=>{const z=w.matches.findIndex(J=>J.id===s),U=w.matches[z];return je(U),{routeId:U.routeId,ssr:U.ssr,_displayPending:U._displayPending,resetKey:w.loadedAt,parentRouteId:w.matches[z-1]?.routeId}},structuralSharing:!0}),c=i.routesById[o.routeId],f=c.options.pendingComponent??i.options.defaultPendingComponent,y=f?$.jsx(f,{}):null,p=c.options.errorComponent??i.options.defaultErrorComponent,g=c.options.onCatch??i.options.defaultOnCatch,m=c.isRoot?c.options.notFoundComponent??i.options.notFoundRoute?.options.component:c.options.notFoundComponent,S=o.ssr===!1||o.ssr==="data-only",h=(!c.isRoot||c.options.wrapInSuspense||S)&&(c.options.wrapInSuspense??f??(c.options.errorComponent?.preload||S))?ot.Suspense:$l,_=p?Fc:$l,A=m?P_:$l,O=c.isRoot?c.options.shellComponent??$l:$l;return $.jsxs(O,{children:[$.jsx(Ir.Provider,{value:s,children:$.jsx(h,{fallback:y,children:$.jsx(_,{getResetKey:()=>o.resetKey,errorComponent:p||Pc,onCatch:(w,z)=>{if(Te(w))throw w;g?.(w,z)},children:$.jsx(A,{fallback:w=>{if(!m||w.routeId&&w.routeId!==o.routeId||!w.routeId&&!c.isRoot)throw w;return ot.createElement(m,w)},children:S||o._displayPending?$.jsx(x_,{fallback:y,children:$.jsx(zy,{matchId:s})}):$.jsx(zy,{matchId:s})})})})}),o.parentRouteId===ln&&i.options.scrollRestoration?$.jsxs($.Fragment,{children:[$.jsx(I_,{}),$.jsx(W_,{})]}):null]})});function I_(){const a=Se(),s=ot.useRef(void 0);return $.jsx("script",{suppressHydrationWarning:!0,ref:i=>{i&&(s.current===void 0||s.current.href!==a.latestLocation.href)&&(a.emit({type:"onRendered",...al(a.state)}),s.current=a.latestLocation)}},a.latestLocation.state.__TSR_key)}const zy=ot.memo(function({matchId:s}){const i=Se(),{match:o,key:c,routeId:f}=ae({select:g=>{const m=g.matches.find(O=>O.id===s),S=m.routeId,_=(i.routesById[S].options.remountDeps??i.options.defaultRemountDeps)?.({routeId:S,loaderDeps:m.loaderDeps,params:m._strictParams,search:m._strictSearch});return{key:_?JSON.stringify(_):void 0,routeId:S,match:{id:m.id,status:m.status,error:m.error,invalid:m.invalid,_forcePending:m._forcePending,_displayPending:m._displayPending}}},structuralSharing:!0}),y=i.routesById[f],p=ot.useMemo(()=>{const g=y.options.component??i.options.defaultComponent;return g?$.jsx(g,{},c):$.jsx(t2,{})},[c,y.options.component,i.options.defaultComponent]);if(o._displayPending)throw i.getMatch(o.id)?._nonReactive.displayPendingPromise;if(o._forcePending)throw i.getMatch(o.id)?._nonReactive.minPendingPromise;if(o.status==="pending"){const g=y.options.pendingMinMs??i.options.defaultPendingMinMs;if(g){const m=i.getMatch(o.id);if(m&&!m._nonReactive.minPendingPromise){const S=ll();m._nonReactive.minPendingPromise=S,setTimeout(()=>{S.resolve(),m._nonReactive.minPendingPromise=void 0},g)}}throw i.getMatch(o.id)?._nonReactive.loadPromise}if(o.status==="notFound")return je(Te(o.error)),Vp(i,y,o.error);if(o.status==="redirected")throw je(sn(o.error)),i.getMatch(o.id)?._nonReactive.loadPromise;if(o.status==="error")throw o.error;return p}),t2=ot.memo(function(){const s=Se(),i=ot.useContext(Ir),o=ae({select:m=>m.matches.find(S=>S.id===i)?.routeId}),c=s.routesById[o],f=ae({select:m=>{const h=m.matches.find(_=>_.id===i);return je(h),h.globalNotFound}}),y=ae({select:m=>{const S=m.matches,h=S.findIndex(_=>_.id===i);return S[h+1]?.id}}),p=s.options.defaultPendingComponent?$.jsx(s.options.defaultPendingComponent,{}):null;if(f)return Vp(s,c,void 0);if(!y)return null;const g=$.jsx(Xp,{matchId:y});return o===ln?$.jsx(ot.Suspense,{fallback:p,children:g}):g});function e2(){const a=Se(),i=a.routesById[ln].options.pendingComponent??a.options.defaultPendingComponent,o=i?$.jsx(i,{}):null,c=typeof document<"u"&&a.ssr?$l:ot.Suspense,f=$.jsxs(c,{fallback:o,children:[$.jsx(F_,{}),$.jsx(n2,{})]});return a.options.InnerWrap?$.jsx(a.options.InnerWrap,{children:f}):f}function n2(){const a=Se(),s=ae({select:c=>c.matches[0]?.id}),i=ae({select:c=>c.loadedAt}),o=s?$.jsx(Xp,{matchId:s}):null;return $.jsx(Ir.Provider,{value:s,children:a.options.disableGlobalCatchBoundary?o:$.jsx(Fc,{getResetKey:()=>i,errorComponent:Pc,onCatch:c=>{c.message||c.toString()},children:o})})}const a2=a=>new l2(a);class l2 extends SS{constructor(s){super(s)}}typeof globalThis<"u"?(globalThis.createFileRoute=cs,globalThis.createLazyFileRoute=Oy):typeof window<"u"&&(window.createFileRoute=cs,window.createLazyFileRoute=Oy);function i2({router:a,children:s,...i}){Object.keys(i).length>0&&a.update({...a.options,...i,context:{...a.options.context,...i.context}});const o=jp(),c=$.jsx(o.Provider,{value:a,children:s});return a.options.Wrap?$.jsx(a.options.Wrap,{children:c}):c}function s2({router:a,...s}){return $.jsx(i2,{router:a,...s,children:$.jsx(e2,{})})}function Qp({tag:a,attrs:s,children:i,nonce:o}){switch(a){case"title":return $.jsx("title",{...s,suppressHydrationWarning:!0,children:i});case"meta":return $.jsx("meta",{...s,suppressHydrationWarning:!0});case"link":return $.jsx("link",{...s,nonce:o,suppressHydrationWarning:!0});case"style":return $.jsx("style",{...s,dangerouslySetInnerHTML:{__html:i},nonce:o});case"script":return $.jsx(r2,{attrs:s,children:i});default:return null}}function r2({attrs:a,children:s}){Se(),ot.useEffect(()=>{if(a?.src){const i=(()=>{try{const f=document.baseURI||window.location.href;return new URL(a.src,f).href}catch{return a.src}})();if(Array.from(document.querySelectorAll("script[src]")).find(f=>f.src===i))return;const c=document.createElement("script");for(const[f,y]of Object.entries(a))f!=="suppressHydrationWarning"&&y!==void 0&&y!==!1&&c.setAttribute(f,typeof y=="boolean"?"":String(y));return document.head.appendChild(c),()=>{c.parentNode&&c.parentNode.removeChild(c)}}if(typeof s=="string"){const i=typeof a?.type=="string"?a.type:"text/javascript",o=typeof a?.nonce=="string"?a.nonce:void 0;if(Array.from(document.querySelectorAll("script:not([src])")).find(y=>{if(!(y instanceof HTMLScriptElement))return!1;const p=y.getAttribute("type")??"text/javascript",g=y.getAttribute("nonce")??void 0;return y.textContent===s&&p===i&&g===o}))return;const f=document.createElement("script");if(f.textContent=s,a)for(const[y,p]of Object.entries(a))y!=="suppressHydrationWarning"&&p!==void 0&&p!==!1&&f.setAttribute(y,typeof p=="boolean"?"":String(p));return document.head.appendChild(f),()=>{f.parentNode&&f.parentNode.removeChild(f)}}},[a,s]);{const{src:i,...o}=a||{};return $.jsx("script",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:""},...o})}}const o2=()=>{const a=Se(),s=a.options.ssr?.nonce,i=ae({select:g=>g.matches.map(m=>m.meta).filter(Boolean)}),o=ot.useMemo(()=>{const g=[],m={};let S;for(let h=i.length-1;h>=0;h--){const _=i[h];for(let A=_.length-1;A>=0;A--){const O=_[A];if(O)if(O.title)S||(S={tag:"title",children:O.title});else if("script:ld+json"in O)try{const w=JSON.stringify(O["script:ld+json"]);g.push({tag:"script",attrs:{type:"application/ld+json"},children:Uv(w)})}catch{}else{const w=O.name??O.property;if(w){if(m[w])continue;m[w]=!0}g.push({tag:"meta",attrs:{...O,nonce:s}})}}}return S&&g.push(S),s&&g.push({tag:"meta",attrs:{property:"csp-nonce",content:s}}),g.reverse(),g},[i,s]),c=ae({select:g=>{const m=g.matches.map(_=>_.links).filter(Boolean).flat(1).map(_=>({tag:"link",attrs:{..._,nonce:s}})),S=a.ssr?.manifest,h=g.matches.map(_=>S?.routes[_.routeId]?.assets??[]).filter(Boolean).flat(1).filter(_=>_.tag==="link").map(_=>({tag:"link",attrs:{..._.attrs,suppressHydrationWarning:!0,nonce:s}}));return[...m,...h]},structuralSharing:!0}),f=ae({select:g=>{const m=[];return g.matches.map(S=>a.looseRoutesById[S.routeId]).forEach(S=>a.ssr?.manifest?.routes[S.id]?.preloads?.filter(Boolean).forEach(h=>{m.push({tag:"link",attrs:{rel:"modulepreload",href:h,nonce:s}})})),m},structuralSharing:!0}),y=ae({select:g=>g.matches.map(m=>m.styles).flat(1).filter(Boolean).map(({children:m,...S})=>({tag:"style",attrs:{...S,nonce:s},children:m})),structuralSharing:!0}),p=ae({select:g=>g.matches.map(m=>m.headScripts).flat(1).filter(Boolean).map(({children:m,...S})=>({tag:"script",attrs:{...S,nonce:s},children:m})),structuralSharing:!0});return u2([...o,...f,...c,...y,...p],g=>JSON.stringify(g))};function u2(a,s){const i=new Set;return a.filter(o=>{const c=s(o);return i.has(c)?!1:(i.add(c),!0)})}function c2(){const a=o2(),i=Se().options.ssr?.nonce;return $.jsx($.Fragment,{children:a.map(o=>ot.createElement(Qp,{...o,key:`tsr-meta-${JSON.stringify(o)}`,nonce:i}))})}const f2=()=>{const a=Se(),s=a.options.ssr?.nonce,i=ae({select:y=>{const p=[],g=a.ssr?.manifest;return g?(y.matches.map(m=>a.looseRoutesById[m.routeId]).forEach(m=>g.routes[m.id]?.assets?.filter(S=>S.tag==="script").forEach(S=>{p.push({tag:"script",attrs:{...S.attrs,nonce:s},children:S.children})})),p):[]},structuralSharing:!0}),{scripts:o}=ae({select:y=>({scripts:y.matches.map(p=>p.scripts).flat(1).filter(Boolean).map(({children:p,...g})=>({tag:"script",attrs:{...g,suppressHydrationWarning:!0,nonce:s},children:p}))}),structuralSharing:!0});let c;a.serverSsr&&(c=a.serverSsr.takeBufferedScripts());const f=[...o,...i];return c&&f.unshift(c),$.jsx($.Fragment,{children:f.map((y,p)=>ot.createElement(Qp,{...y,key:`tsr-scripts-${y.tag}-${p}`}))})};function d2(a,s){a.id=s.i,a.__beforeLoadContext=s.b,a.loaderData=s.l,a.status=s.s,a.ssr=s.ssr,a.updatedAt=s.u,a.error=s.e}async function h2(a){je(window.$_TSR);const s=a.options.serializationAdapters;if(s?.length){const w=new Map;s.forEach(z=>{w.set(z.key,z.fromSerializable)}),window.$_TSR.t=w,window.$_TSR.buffer.forEach(z=>z())}window.$_TSR.initialized=!0,je(window.$_TSR.router);const{manifest:i,dehydratedData:o,lastMatchId:c}=window.$_TSR.router;a.ssr={manifest:i};const y=document.querySelector('meta[property="csp-nonce"]')?.content;a.options.ssr={nonce:y};const p=a.matchRoutes(a.state.location),g=Promise.all(p.map(w=>{const z=a.looseRoutesById[w.routeId];return a.loadRouteChunk(z)}));function m(w){const U=a.looseRoutesById[w.routeId].options.pendingMinMs??a.options.defaultPendingMinMs;if(U){const J=ll();w._nonReactive.minPendingPromise=J,w._forcePending=!0,setTimeout(()=>{J.resolve(),a.updateMatch(w.id,G=>(G._nonReactive.minPendingPromise=void 0,{...G,_forcePending:void 0}))},U)}}function S(w){const z=a.looseRoutesById[w.routeId];z&&(z.options.ssr=w.ssr)}let h;p.forEach(w=>{const z=window.$_TSR.router.matches.find(U=>U.i===w.id);if(!z){w._nonReactive.dehydrated=!1,w.ssr=!1,S(w);return}d2(w,z),S(w),w._nonReactive.dehydrated=w.ssr!==!1,(w.ssr==="data-only"||w.ssr===!1)&&h===void 0&&(h=w.index,m(w))}),a.__store.setState(w=>({...w,matches:p})),await a.options.hydrate?.(o),await Promise.all(a.state.matches.map(async w=>{try{const z=a.looseRoutesById[w.routeId],J=a.state.matches[w.index-1]?.context??a.options.context;if(z.options.context){const W={deps:w.loaderDeps,params:w.params,context:J??{},location:a.state.location,navigate:Z=>a.navigate({...Z,_fromLocation:a.state.location}),buildLocation:a.buildLocation,cause:w.cause,abortController:w.abortController,preload:!1,matches:p};w.__routeContext=z.options.context(W)??void 0}w.context={...J,...w.__routeContext,...w.__beforeLoadContext};const G={ssr:a.options.ssr,matches:a.state.matches,match:w,params:w.params,loaderData:w.loaderData},V=await z.options.head?.(G),I=await z.options.scripts?.(G);w.meta=V?.meta,w.links=V?.links,w.headScripts=V?.scripts,w.styles=V?.styles,w.scripts=I}catch(z){if(Te(z))w.error={isNotFound:!0},console.error(`NotFound error during hydration for routeId: ${w.routeId}`,z);else throw w.error=z,console.error(`Error during hydration for route ${w.routeId}:`,z),z}}));const _=p[p.length-1].id!==c;if(!p.some(w=>w.ssr===!1)&&!_)return p.forEach(w=>{w._nonReactive.dehydrated=void 0}),g;const O=Promise.resolve().then(()=>a.load()).catch(w=>{console.error("Error during router hydration:",w)});if(_){const w=p[1];je(w),m(w),w._displayPending=!0,w._nonReactive.displayPendingPromise=O,O.then(()=>{Il(()=>{a.__store.state.status==="pending"&&a.__store.setState(z=>({...z,status:"idle",resolvedLocation:z.location})),a.updateMatch(w.id,z=>({...z,_displayPending:void 0,displayPendingPromise:void 0}))})})}return g}const m2="__TSS_CONTEXT",qc=Symbol.for("TSS_SERVER_FUNCTION"),y2="x-tss-serialized",p2="x-tss-raw",Zp="application/x-tss-framed",Xn={JSON:0,CHUNK:1,END:2,ERROR:3},Pl=9,Cy=1,g2=/;\s*v=(\d+)/;function v2(a){const s=a.match(g2);return s?parseInt(s[1],10):void 0}function S2(a){const s=v2(a);if(s!==void 0&&s!==Cy)throw new Error(`Incompatible framed protocol version: server=${s}, client=${Cy}. Please ensure client and server are using compatible versions.`)}const kp=()=>window.__TSS_START_OPTIONS__;function b2(){return[...kp()?.serializationAdapters?.map(n_)??[],...g_]}const Dy=new TextDecoder,_2=new Uint8Array(0),Ny=16*1024*1024,Ly=32*1024*1024,Uy=1024,By=1e5;function E2(a){const s=new Map,i=new Map,o=new Set;let c=!1,f=null,y=0,p;const g=new ReadableStream({start(h){p=h},cancel(){c=!0;try{f?.cancel()}catch{}s.forEach(h=>{try{h.error(new Error("Framed response cancelled"))}catch{}}),s.clear(),i.clear(),o.clear()}});function m(h){const _=i.get(h);if(_)return _;if(o.has(h))return new ReadableStream({start(O){O.close()}});if(i.size>=Uy)throw new Error(`Too many raw streams in framed response (max ${Uy})`);const A=new ReadableStream({start(O){s.set(h,O)},cancel(){o.add(h),s.delete(h),i.delete(h)}});return i.set(h,A),A}function S(h){return m(h),s.get(h)}return(async()=>{const h=a.getReader();f=h;const _=[];let A=0;function O(){if(A=Pl){const Z=z[0],Q=(z[1]<<24|z[2]<<16|z[3]<<8|z[4])>>>0,P=(z[5]<<24|z[6]<<16|z[7]<<8|z[8])>>>0;return{type:Z,streamId:Q,length:P}}const U=new Uint8Array(Pl);let J=0,G=Pl;for(let Z=0;Z<_.length&&G>0;Z++){const Q=_[Z],P=Math.min(Q.length,G);U.set(Q.subarray(0,P),J),J+=P,G-=P}const V=U[0],I=(U[1]<<24|U[2]<<16|U[3]<<8|U[4])>>>0,W=(U[5]<<24|U[6]<<16|U[7]<<8|U[8])>>>0;return{type:V,streamId:I,length:W}}function w(z){if(z===0)return _2;const U=new Uint8Array(z);let J=0,G=z;for(;G>0&&_.length>0;){const V=_[0];if(!V)break;const I=Math.min(V.length,G);U.set(V.subarray(0,I),J),J+=I,G-=I,I===V.length?_.shift():_[0]=V.subarray(I)}return A-=z,U}try{for(;;){const{done:z,value:U}=await h.read();if(c||z)break;if(U){if(A+U.length>Ly)throw new Error(`Framed response buffer exceeded ${Ly} bytes`);for(_.push(U),A+=U.length;;){const J=O();if(!J)break;const{type:G,streamId:V,length:I}=J;if(G!==Xn.JSON&&G!==Xn.CHUNK&&G!==Xn.END&&G!==Xn.ERROR)throw new Error(`Unknown frame type: ${G}`);if(G===Xn.JSON){if(V!==0)throw new Error("Invalid JSON frame streamId (expected 0)")}else if(V===0)throw new Error("Invalid raw frame streamId (expected non-zero)");if(I>Ny)throw new Error(`Frame payload too large: ${I} bytes (max ${Ny})`);const W=Pl+I;if(ABy)throw new Error(`Too many frames in framed response (max ${By})`);w(Pl);const Z=w(I);switch(G){case Xn.JSON:{try{p.enqueue(Dy.decode(Z))}catch{}break}case Xn.CHUNK:{const Q=S(V);Q&&Q.enqueue(Z);break}case Xn.END:{const Q=S(V);if(o.add(V),Q){try{Q.close()}catch{}s.delete(V)}break}case Xn.ERROR:{const Q=S(V);if(o.add(V),Q){const P=Dy.decode(Z);Q.error(new Error(P)),s.delete(V)}break}}}}}if(A!==0)throw new Error("Incomplete frame at end of framed response");try{p.close()}catch{}s.forEach(z=>{try{z.close()}catch{}}),s.clear()}catch(z){try{p.error(z)}catch{}s.forEach(U=>{try{U.error(z)}catch{}}),s.clear()}finally{try{h.releaseLock()}catch{}f=null}})(),{getOrCreateStream:m,jsonChunks:g}}let li=null;const T2=Object.prototype.hasOwnProperty;function Kp(a){for(const s in a)if(T2.call(a,s))return!0;return!1}async function R2(a,s,i){li||(li=b2());const c=s[0],f=c.fetch??i,y=c.data instanceof FormData?"formData":"payload",p=c.headers?new Headers(c.headers):new Headers;if(p.set("x-tsr-serverFn","true"),y==="payload"&&p.set("accept",`${Zp}, application/x-ndjson, application/json`),c.method==="GET"){if(y==="formData")throw new Error("FormData is not supported with GET requests");const m=await Jp(c);if(m!==void 0){const S=Fy({payload:m});a.includes("?")?a+=`&${S}`:a+=`?${S}`}}let g;if(c.method==="POST"){const m=await x2(c);m?.contentType&&p.set("content-type",m.contentType),g=m?.body}return await w2(async()=>f(a,{method:c.method,headers:p,signal:c.signal,body:g}))}async function Jp(a){let s=!1;const i={};if(a.data!==void 0&&(s=!0,i.data=a.data),a.context&&Kp(a.context)&&(s=!0,i.context=a.context),s)return Fp(i)}async function Fp(a){return JSON.stringify(await Promise.resolve(e_(a,{plugins:li})))}async function x2(a){if(a.data instanceof FormData){let i;return a.context&&Kp(a.context)&&(i=await Fp(a.context)),i!==void 0&&a.data.set(m2,i),{body:a.data}}const s=await Jp(a);if(s)return{body:s,contentType:"application/json"}}async function w2(a){let s;try{s=await a()}catch(c){if(c instanceof Response)s=c;else throw console.log(c),c}if(s.headers.get(p2)==="true")return s;const i=s.headers.get("content-type");if(je(i),!!s.headers.get(y2)){let c;if(i.includes(Zp)){if(S2(i),!s.body)throw new Error("No response body for framed response");const{getOrCreateStream:f,jsonChunks:y}=E2(s.body),g=[p_(f),...li||[]],m=new Map;c=await M2({jsonStream:y,onMessage:S=>Ac(S,{refs:m,plugins:g}),onError(S,h){console.error(S,h)}})}else if(i.includes("application/x-ndjson")){const f=new Map;c=await A2({response:s,onMessage:y=>Ac(y,{refs:f,plugins:li}),onError(y,p){console.error(y,p)}})}else if(i.includes("application/json")){const f=await s.json();c=Ac(f,{plugins:li})}if(je(c),c instanceof Error)throw c;return c}if(i.includes("application/json")){const c=await s.json(),f=cS(c);if(f)throw f;if(Te(c))throw c;return c}if(!s.ok)throw new Error(await s.text());return s}async function A2({response:a,onMessage:s,onError:i}){if(!a.body)throw new Error("No response body");const o=a.body.pipeThrough(new TextDecoderStream).getReader();let c="",f=!1,y;for(;!f;){const{value:p,done:g}=await o.read();if(p&&(c+=p),c.length===0&&g)throw new Error("Stream ended before first object");if(c.endsWith(` +`)){const m=c.split(` +`).filter(Boolean),S=m[0];if(!S)throw new Error("No JSON line in the first chunk");y=JSON.parse(S),f=!0,c=m.slice(1).join(` +`)}else{const m=c.indexOf(` +`);if(m>=0){const S=c.slice(0,m).trim();c=c.slice(m+1),S.length>0&&(y=JSON.parse(S),f=!0)}}}return(async()=>{try{for(;;){const{value:p,done:g}=await o.read();p&&(c+=p);const m=c.lastIndexOf(` +`);if(m>=0){const S=c.slice(0,m);c=c.slice(m+1);const h=S.split(` +`).filter(Boolean);for(const _ of h)try{s(JSON.parse(_))}catch(A){i?.(`Invalid JSON line: ${_}`,A)}}if(g)break}}catch(p){i?.("Stream processing error:",p)}})(),s(y)}async function M2({jsonStream:a,onMessage:s,onError:i}){const o=a.getReader(),{value:c,done:f}=await o.read();if(f||!c)throw new Error("Stream ended before first object");const y=JSON.parse(c);return(async()=>{try{for(;;){const{value:p,done:g}=await o.read();if(g)break;if(p)try{s(JSON.parse(p))}catch(m){i?.(`Invalid JSON: ${p}`,m)}}}catch(p){i?.("Stream processing error:",p)}})(),s(y)}function O2(a){const s="/_serverFn/"+a;return Object.assign((...c)=>{const f=kp()?.serverFns?.fetch;return R2(s,c,f??fetch)},{url:s,serverFnMeta:{id:a},[qc]:!0})}const z2={key:"$TSS/serverfn",test:a=>typeof a!="function"||!(qc in a)?!1:!!a[qc],toSerializable:({serverFnMeta:a})=>({functionId:a.id}),fromSerializable:({functionId:a})=>O2(a)};function C2(a){if(typeof document>"u")return;let s=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",s.appendChild(i),i.styleSheet?i.styleSheet.cssText=a:i.appendChild(document.createTextNode(a))}const D2=a=>{switch(a){case"success":return U2;case"info":return H2;case"warning":return B2;case"error":return j2;default:return null}},N2=Array(12).fill(0),L2=({visible:a,className:s})=>F.createElement("div",{className:["sonner-loading-wrapper",s].filter(Boolean).join(" "),"data-visible":a},F.createElement("div",{className:"sonner-spinner"},N2.map((i,o)=>F.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),U2=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},F.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),B2=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},F.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),H2=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},F.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),j2=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},F.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Y2=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},F.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),F.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),q2=()=>{const[a,s]=F.useState(document.hidden);return F.useEffect(()=>{const i=()=>{s(document.hidden)};return document.addEventListener("visibilitychange",i),()=>window.removeEventListener("visibilitychange",i)},[]),a};let Gc=1;class G2{constructor(){this.subscribe=s=>(this.subscribers.push(s),()=>{const i=this.subscribers.indexOf(s);this.subscribers.splice(i,1)}),this.publish=s=>{this.subscribers.forEach(i=>i(s))},this.addToast=s=>{this.publish(s),this.toasts=[...this.toasts,s]},this.create=s=>{var i;const{message:o,...c}=s,f=typeof s?.id=="number"||((i=s.id)==null?void 0:i.length)>0?s.id:Gc++,y=this.toasts.find(g=>g.id===f),p=s.dismissible===void 0?!0:s.dismissible;return this.dismissedToasts.has(f)&&this.dismissedToasts.delete(f),y?this.toasts=this.toasts.map(g=>g.id===f?(this.publish({...g,...s,id:f,title:o}),{...g,...s,id:f,dismissible:p,title:o}):g):this.addToast({title:o,...c,dismissible:p,id:f}),f},this.dismiss=s=>(s?(this.dismissedToasts.add(s),requestAnimationFrame(()=>this.subscribers.forEach(i=>i({id:s,dismiss:!0})))):this.toasts.forEach(i=>{this.subscribers.forEach(o=>o({id:i.id,dismiss:!0}))}),s),this.message=(s,i)=>this.create({...i,message:s}),this.error=(s,i)=>this.create({...i,message:s,type:"error"}),this.success=(s,i)=>this.create({...i,type:"success",message:s}),this.info=(s,i)=>this.create({...i,type:"info",message:s}),this.warning=(s,i)=>this.create({...i,type:"warning",message:s}),this.loading=(s,i)=>this.create({...i,type:"loading",message:s}),this.promise=(s,i)=>{if(!i)return;let o;i.loading!==void 0&&(o=this.create({...i,promise:s,type:"loading",message:i.loading,description:typeof i.description!="function"?i.description:void 0}));const c=Promise.resolve(s instanceof Function?s():s);let f=o!==void 0,y;const p=c.then(async m=>{if(y=["resolve",m],F.isValidElement(m))f=!1,this.create({id:o,type:"default",message:m});else if(X2(m)&&!m.ok){f=!1;const h=typeof i.error=="function"?await i.error(`HTTP error! status: ${m.status}`):i.error,_=typeof i.description=="function"?await i.description(`HTTP error! status: ${m.status}`):i.description,O=typeof h=="object"&&!F.isValidElement(h)?h:{message:h};this.create({id:o,type:"error",description:_,...O})}else if(m instanceof Error){f=!1;const h=typeof i.error=="function"?await i.error(m):i.error,_=typeof i.description=="function"?await i.description(m):i.description,O=typeof h=="object"&&!F.isValidElement(h)?h:{message:h};this.create({id:o,type:"error",description:_,...O})}else if(i.success!==void 0){f=!1;const h=typeof i.success=="function"?await i.success(m):i.success,_=typeof i.description=="function"?await i.description(m):i.description,O=typeof h=="object"&&!F.isValidElement(h)?h:{message:h};this.create({id:o,type:"success",description:_,...O})}}).catch(async m=>{if(y=["reject",m],i.error!==void 0){f=!1;const S=typeof i.error=="function"?await i.error(m):i.error,h=typeof i.description=="function"?await i.description(m):i.description,A=typeof S=="object"&&!F.isValidElement(S)?S:{message:S};this.create({id:o,type:"error",description:h,...A})}}).finally(()=>{f&&(this.dismiss(o),o=void 0),i.finally==null||i.finally.call(i)}),g=()=>new Promise((m,S)=>p.then(()=>y[0]==="reject"?S(y[1]):m(y[1])).catch(S));return typeof o!="string"&&typeof o!="number"?{unwrap:g}:Object.assign(o,{unwrap:g})},this.custom=(s,i)=>{const o=i?.id||Gc++;return this.create({jsx:s(o),id:o,...i}),o},this.getActiveToasts=()=>this.toasts.filter(s=>!this.dismissedToasts.has(s.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const He=new G2,V2=(a,s)=>{const i=s?.id||Gc++;return He.addToast({title:a,...s,id:i}),i},X2=a=>a&&typeof a=="object"&&"ok"in a&&typeof a.ok=="boolean"&&"status"in a&&typeof a.status=="number",Q2=V2,Z2=()=>He.toasts,k2=()=>He.getActiveToasts(),OE=Object.assign(Q2,{success:He.success,info:He.info,warning:He.warning,error:He.error,custom:He.custom,message:He.message,promise:He.promise,dismiss:He.dismiss,loading:He.loading},{getHistory:Z2,getToasts:k2});C2("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function zr(a){return a.label!==void 0}const K2=3,J2="24px",F2="16px",Hy=4e3,P2=356,$2=14,W2=45,I2=200;function Sn(...a){return a.filter(Boolean).join(" ")}function tE(a){const[s,i]=a.split("-"),o=[];return s&&o.push(s),i&&o.push(i),o}const eE=a=>{var s,i,o,c,f,y,p,g,m;const{invert:S,toast:h,unstyled:_,interacting:A,setHeights:O,visibleToasts:w,heights:z,index:U,toasts:J,expanded:G,removeToast:V,defaultRichColors:I,closeButton:W,style:Z,cancelButtonStyle:Q,actionButtonStyle:P,className:dt="",descriptionClassName:it="",duration:ct,position:at,gap:bt,expandByDefault:wt,classNames:N,icons:K,closeButtonAriaLabel:lt="Close toast"}=a,[St,pt]=F.useState(null),[R,j]=F.useState(null),[X,k]=F.useState(!1),[tt,rt]=F.useState(!1),[yt,ht]=F.useState(!1),[At,be]=F.useState(!1),[Re,Ye]=F.useState(!1),[za,qe]=F.useState(0),[Jn,En]=F.useState(0),xe=F.useRef(h.duration||ct||Hy),Tn=F.useRef(null),Kt=F.useRef(null),Ca=U===0,Da=U+1<=w,se=h.type,dn=h.dismissible!==!1,ce=h.className||"",si=h.descriptionClassName||"",Dt=F.useMemo(()=>z.findIndex(ft=>ft.toastId===h.id)||0,[z,h.id]),te=F.useMemo(()=>{var ft;return(ft=h.closeButton)!=null?ft:W},[h.closeButton,W]),ee=F.useMemo(()=>h.duration||ct||Hy,[h.duration,ct]),Fn=F.useRef(0),Rn=F.useRef(0),hs=F.useRef(0),Pn=F.useRef(null),[Na,_e]=at.split("-"),rn=F.useMemo(()=>z.reduce((ft,Vt,re)=>re>=Dt?ft:ft+Vt.height,0),[z,Dt]),pe=q2(),eo=h.invert||S,ri=se==="loading";Rn.current=F.useMemo(()=>Dt*bt+rn,[Dt,rn]),F.useEffect(()=>{xe.current=ee},[ee]),F.useEffect(()=>{k(!0)},[]),F.useEffect(()=>{const ft=Kt.current;if(ft){const Vt=ft.getBoundingClientRect().height;return En(Vt),O(re=>[{toastId:h.id,height:Vt,position:h.position},...re]),()=>O(re=>re.filter(ge=>ge.toastId!==h.id))}},[O,h.id]),F.useLayoutEffect(()=>{if(!X)return;const ft=Kt.current,Vt=ft.style.height;ft.style.height="auto";const re=ft.getBoundingClientRect().height;ft.style.height=Vt,En(re),O(ge=>ge.find(Qt=>Qt.toastId===h.id)?ge.map(Qt=>Qt.toastId===h.id?{...Qt,height:re}:Qt):[{toastId:h.id,height:re,position:h.position},...ge])},[X,h.title,h.description,O,h.id,h.jsx,h.action,h.cancel]);const hn=F.useCallback(()=>{rt(!0),qe(Rn.current),O(ft=>ft.filter(Vt=>Vt.toastId!==h.id)),setTimeout(()=>{V(h)},I2)},[h,V,O,Rn]);F.useEffect(()=>{if(h.promise&&se==="loading"||h.duration===1/0||h.type==="loading")return;let ft;return G||A||pe?(()=>{if(hs.current{h.onAutoClose==null||h.onAutoClose.call(h,h),hn()},xe.current)),()=>clearTimeout(ft)},[G,A,h,se,pe,hn]),F.useEffect(()=>{h.delete&&(hn(),h.onDismiss==null||h.onDismiss.call(h,h))},[hn,h.delete]);function ul(){var ft;if(K?.loading){var Vt;return F.createElement("div",{className:Sn(N?.loader,h==null||(Vt=h.classNames)==null?void 0:Vt.loader,"sonner-loader"),"data-visible":se==="loading"},K.loading)}return F.createElement(L2,{className:Sn(N?.loader,h==null||(ft=h.classNames)==null?void 0:ft.loader),visible:se==="loading"})}const cl=h.icon||K?.[se]||D2(se);var La,mn;return F.createElement("li",{tabIndex:0,ref:Kt,className:Sn(dt,ce,N?.toast,h==null||(s=h.classNames)==null?void 0:s.toast,N?.default,N?.[se],h==null||(i=h.classNames)==null?void 0:i[se]),"data-sonner-toast":"","data-rich-colors":(La=h.richColors)!=null?La:I,"data-styled":!(h.jsx||h.unstyled||_),"data-mounted":X,"data-promise":!!h.promise,"data-swiped":Re,"data-removed":tt,"data-visible":Da,"data-y-position":Na,"data-x-position":_e,"data-index":U,"data-front":Ca,"data-swiping":yt,"data-dismissible":dn,"data-type":se,"data-invert":eo,"data-swipe-out":At,"data-swipe-direction":R,"data-expanded":!!(G||wt&&X),"data-testid":h.testId,style:{"--index":U,"--toasts-before":U,"--z-index":J.length-U,"--offset":`${tt?za:Rn.current}px`,"--initial-height":wt?"auto":`${Jn}px`,...Z,...h.style},onDragEnd:()=>{ht(!1),pt(null),Pn.current=null},onPointerDown:ft=>{ft.button!==2&&(ri||!dn||(Tn.current=new Date,qe(Rn.current),ft.target.setPointerCapture(ft.pointerId),ft.target.tagName!=="BUTTON"&&(ht(!0),Pn.current={x:ft.clientX,y:ft.clientY})))},onPointerUp:()=>{var ft,Vt,re;if(At||!dn)return;Pn.current=null;const ge=Number(((ft=Kt.current)==null?void 0:ft.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),$n=Number(((Vt=Kt.current)==null?void 0:Vt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Qt=new Date().getTime()-((re=Tn.current)==null?void 0:re.getTime()),we=St==="x"?ge:$n,Ua=Math.abs(we)/Qt;if(Math.abs(we)>=W2||Ua>.11){qe(Rn.current),h.onDismiss==null||h.onDismiss.call(h,h),j(St==="x"?ge>0?"right":"left":$n>0?"down":"up"),hn(),be(!0);return}else{var Ae,Me;(Ae=Kt.current)==null||Ae.style.setProperty("--swipe-amount-x","0px"),(Me=Kt.current)==null||Me.style.setProperty("--swipe-amount-y","0px")}Ye(!1),ht(!1),pt(null)},onPointerMove:ft=>{var Vt,re,ge;if(!Pn.current||!dn||((Vt=window.getSelection())==null?void 0:Vt.toString().length)>0)return;const Qt=ft.clientY-Pn.current.y,we=ft.clientX-Pn.current.x;var Ua;const Ae=(Ua=a.swipeDirections)!=null?Ua:tE(at);!St&&(Math.abs(we)>1||Math.abs(Qt)>1)&&pt(Math.abs(we)>Math.abs(Qt)?"x":"y");let Me={x:0,y:0};const fl=on=>1/(1.5+Math.abs(on)/20);if(St==="y"){if(Ae.includes("top")||Ae.includes("bottom"))if(Ae.includes("top")&&Qt<0||Ae.includes("bottom")&&Qt>0)Me.y=Qt;else{const on=Qt*fl(Qt);Me.y=Math.abs(on)0)Me.x=we;else{const on=we*fl(we);Me.x=Math.abs(on)0||Math.abs(Me.y)>0)&&Ye(!0),(re=Kt.current)==null||re.style.setProperty("--swipe-amount-x",`${Me.x}px`),(ge=Kt.current)==null||ge.style.setProperty("--swipe-amount-y",`${Me.y}px`)}},te&&!h.jsx&&se!=="loading"?F.createElement("button",{"aria-label":lt,"data-disabled":ri,"data-close-button":!0,onClick:ri||!dn?()=>{}:()=>{hn(),h.onDismiss==null||h.onDismiss.call(h,h)},className:Sn(N?.closeButton,h==null||(o=h.classNames)==null?void 0:o.closeButton)},(mn=K?.close)!=null?mn:Y2):null,(se||h.icon||h.promise)&&h.icon!==null&&(K?.[se]!==null||h.icon)?F.createElement("div",{"data-icon":"",className:Sn(N?.icon,h==null||(c=h.classNames)==null?void 0:c.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||ul():null,h.type!=="loading"?cl:null):null,F.createElement("div",{"data-content":"",className:Sn(N?.content,h==null||(f=h.classNames)==null?void 0:f.content)},F.createElement("div",{"data-title":"",className:Sn(N?.title,h==null||(y=h.classNames)==null?void 0:y.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?F.createElement("div",{"data-description":"",className:Sn(it,si,N?.description,h==null||(p=h.classNames)==null?void 0:p.description)},typeof h.description=="function"?h.description():h.description):null),F.isValidElement(h.cancel)?h.cancel:h.cancel&&zr(h.cancel)?F.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||Q,onClick:ft=>{zr(h.cancel)&&dn&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,ft),hn())},className:Sn(N?.cancelButton,h==null||(g=h.classNames)==null?void 0:g.cancelButton)},h.cancel.label):null,F.isValidElement(h.action)?h.action:h.action&&zr(h.action)?F.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||P,onClick:ft=>{zr(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,ft),!ft.defaultPrevented&&hn())},className:Sn(N?.actionButton,h==null||(m=h.classNames)==null?void 0:m.actionButton)},h.action.label):null)};function jy(){if(typeof window>"u"||typeof document>"u")return"ltr";const a=document.documentElement.getAttribute("dir");return a==="auto"||!a?window.getComputedStyle(document.documentElement).direction:a}function nE(a,s){const i={};return[a,s].forEach((o,c)=>{const f=c===1,y=f?"--mobile-offset":"--offset",p=f?F2:J2;function g(m){["top","right","bottom","left"].forEach(S=>{i[`${y}-${S}`]=typeof m=="number"?`${m}px`:m})}typeof o=="number"||typeof o=="string"?g(o):typeof o=="object"?["top","right","bottom","left"].forEach(m=>{o[m]===void 0?i[`${y}-${m}`]=p:i[`${y}-${m}`]=typeof o[m]=="number"?`${o[m]}px`:o[m]}):g(p)}),i}const aE=F.forwardRef(function(s,i){const{id:o,invert:c,position:f="bottom-right",hotkey:y=["altKey","KeyT"],expand:p,closeButton:g,className:m,offset:S,mobileOffset:h,theme:_="light",richColors:A,duration:O,style:w,visibleToasts:z=K2,toastOptions:U,dir:J=jy(),gap:G=$2,icons:V,containerAriaLabel:I="Notifications"}=s,[W,Z]=F.useState([]),Q=F.useMemo(()=>o?W.filter(X=>X.toasterId===o):W.filter(X=>!X.toasterId),[W,o]),P=F.useMemo(()=>Array.from(new Set([f].concat(Q.filter(X=>X.position).map(X=>X.position)))),[Q,f]),[dt,it]=F.useState([]),[ct,at]=F.useState(!1),[bt,wt]=F.useState(!1),[N,K]=F.useState(_!=="system"?_:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),lt=F.useRef(null),St=y.join("+").replace(/Key/g,"").replace(/Digit/g,""),pt=F.useRef(null),R=F.useRef(!1),j=F.useCallback(X=>{Z(k=>{var tt;return(tt=k.find(rt=>rt.id===X.id))!=null&&tt.delete||He.dismiss(X.id),k.filter(({id:rt})=>rt!==X.id)})},[]);return F.useEffect(()=>He.subscribe(X=>{if(X.dismiss){requestAnimationFrame(()=>{Z(k=>k.map(tt=>tt.id===X.id?{...tt,delete:!0}:tt))});return}setTimeout(()=>{U_.flushSync(()=>{Z(k=>{const tt=k.findIndex(rt=>rt.id===X.id);return tt!==-1?[...k.slice(0,tt),{...k[tt],...X},...k.slice(tt+1)]:[X,...k]})})})}),[W]),F.useEffect(()=>{if(_!=="system"){K(_);return}if(_==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?K("dark"):K("light")),typeof window>"u")return;const X=window.matchMedia("(prefers-color-scheme: dark)");try{X.addEventListener("change",({matches:k})=>{K(k?"dark":"light")})}catch{X.addListener(({matches:tt})=>{try{K(tt?"dark":"light")}catch(rt){console.error(rt)}})}},[_]),F.useEffect(()=>{W.length<=1&&at(!1)},[W]),F.useEffect(()=>{const X=k=>{var tt;if(y.every(ht=>k[ht]||k.code===ht)){var yt;at(!0),(yt=lt.current)==null||yt.focus()}k.code==="Escape"&&(document.activeElement===lt.current||(tt=lt.current)!=null&&tt.contains(document.activeElement))&&at(!1)};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[y]),F.useEffect(()=>{if(lt.current)return()=>{pt.current&&(pt.current.focus({preventScroll:!0}),pt.current=null,R.current=!1)}},[lt.current]),F.createElement("section",{ref:i,"aria-label":`${I} ${St}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},P.map((X,k)=>{var tt;const[rt,yt]=X.split("-");return Q.length?F.createElement("ol",{key:X,dir:J==="auto"?jy():J,tabIndex:-1,ref:lt,className:m,"data-sonner-toaster":!0,"data-sonner-theme":N,"data-y-position":rt,"data-x-position":yt,style:{"--front-toast-height":`${((tt=dt[0])==null?void 0:tt.height)||0}px`,"--width":`${P2}px`,"--gap":`${G}px`,...w,...nE(S,h)},onBlur:ht=>{R.current&&!ht.currentTarget.contains(ht.relatedTarget)&&(R.current=!1,pt.current&&(pt.current.focus({preventScroll:!0}),pt.current=null))},onFocus:ht=>{ht.target instanceof HTMLElement&&ht.target.dataset.dismissible==="false"||R.current||(R.current=!0,pt.current=ht.relatedTarget)},onMouseEnter:()=>at(!0),onMouseMove:()=>at(!0),onMouseLeave:()=>{bt||at(!1)},onDragEnd:()=>at(!1),onPointerDown:ht=>{ht.target instanceof HTMLElement&&ht.target.dataset.dismissible==="false"||wt(!0)},onPointerUp:()=>wt(!1)},Q.filter(ht=>!ht.position&&k===0||ht.position===X).map((ht,At)=>{var be,Re;return F.createElement(eE,{key:ht.id,icons:V,index:At,toast:ht,defaultRichColors:A,duration:(be=U?.duration)!=null?be:O,className:U?.className,descriptionClassName:U?.descriptionClassName,invert:c,visibleToasts:z,closeButton:(Re=U?.closeButton)!=null?Re:g,interacting:bt,position:X,style:U?.style,unstyled:U?.unstyled,classNames:U?.classNames,cancelButtonStyle:U?.cancelButtonStyle,actionButtonStyle:U?.actionButtonStyle,closeButtonAriaLabel:U?.closeButtonAriaLabel,removeToast:j,toasts:Q.filter(Ye=>Ye.position==ht.position),heights:dt.filter(Ye=>Ye.position==ht.position),setHeights:it,expandByDefault:p,gap:G,expanded:ct,swipeDirections:s.swipeDirections})})):null}))});function lE({children:a}){return $.jsx("div",{className:"min-h-screen bg-gray-100",children:$.jsx("main",{className:"p-6",children:a})})}const iE="/assets/styles-BHpgolea.css",to=J_({head:()=>({meta:[{charSet:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1"},{title:"Solid Connection Admin"}],links:[{rel:"stylesheet",href:iE}]}),shellComponent:sE});function sE({children:a}){return $.jsxs("html",{lang:"ko",children:[$.jsx("head",{children:$.jsx(c2,{})}),$.jsxs("body",{children:[$.jsx(lE,{children:a}),$.jsx(aE,{}),$.jsx(f2,{})]})]})}const rE=cs("/")({beforeLoad:()=>{throw kr({to:"/scores"})}}),oE="modulepreload",uE=function(a){return"/"+a},Yy={},Pp=function(s,i,o){let c=Promise.resolve();if(i&&i.length>0){let g=function(m){return Promise.all(m.map(S=>Promise.resolve(S).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const y=document.querySelector("meta[property=csp-nonce]"),p=y?.nonce||y?.getAttribute("nonce");c=g(i.map(m=>{if(m=uE(m),m in Yy)return;Yy[m]=!0;const S=m.endsWith(".css"),h=S?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${h}`))return;const _=document.createElement("link");if(_.rel=S?"stylesheet":oE,S||(_.as="script"),_.crossOrigin="",_.href=m,p&&_.setAttribute("nonce",p),document.head.appendChild(_),S)return new Promise((A,O)=>{_.addEventListener("load",A),_.addEventListener("error",()=>O(new Error(`Unable to preload CSS for ${m}`)))})}))}function f(y){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=y,window.dispatchEvent(p),!p.defaultPrevented)throw y}return c.then(y=>{for(const p of y||[])p.status==="rejected"&&f(p.reason);return s().catch(f)})},cE=a=>{if(!a)return!0;try{const s=JSON.parse(atob(a.split(".")[1])),i=Math.floor(Date.now()/1e3),{exp:o}=s;return o{try{return localStorage.getItem("refreshToken")}catch(a){return console.error("Could not load refresh token",a),null}},CE=a=>{try{localStorage.setItem("refreshToken",a)}catch(s){console.error("Could not save refresh token",s)}},DE=()=>{try{localStorage.removeItem("refreshToken")}catch(a){console.error("Could not remove refresh token",a)}},fE=()=>{try{return localStorage.getItem("accessToken")}catch(a){return console.error("Could not load access token",a),null}},NE=a=>{try{localStorage.setItem("accessToken",a)}catch(s){console.error("Could not save access token",s)}},LE=()=>{try{localStorage.removeItem("accessToken")}catch(a){console.error("Could not remove access token",a)}},dE=()=>Pp(()=>import("./index-C5TecN1M.js"),__vite__mapDeps([0,1])),hE=cs("/scores/")({beforeLoad:()=>{if(typeof window<"u"){const a=fE();if(!a||cE(a))throw kr({to:"/auth/login"})}},component:Gp(dE,"component")}),mE=()=>Pp(()=>import("./login-BFKyXQqT.js"),__vite__mapDeps([2,1])),yE=cs("/auth/login")({component:Gp(mE,"component")}),pE=rE.update({id:"/",path:"/",getParentRoute:()=>to}),gE=hE.update({id:"/scores/",path:"/scores/",getParentRoute:()=>to}),vE=yE.update({id:"/auth/login",path:"/auth/login",getParentRoute:()=>to}),SE={IndexRoute:pE,AuthLoginRoute:vE,ScoresIndexRoute:gE},bE=to._addFileChildren(SE),_E=()=>a2({routeTree:bE,context:{},scrollRestoration:!0,defaultPreloadStaleTime:0});async function EE(){const a=await _E();let s;return s=[],window.__TSS_START_OPTIONS__={serializationAdapters:s},s.push(z2),a.options.serializationAdapters&&s.push(...a.options.serializationAdapters),a.update({basepath:"",serializationAdapters:s}),a.state.matches.length||await h2(a),a}async function TE(){const a=await EE();return window.$_TSR?.h(),a}let Uc;function RE(){return Uc||(Uc=TE()),$.jsx(E_,{promise:Uc,children:a=>$.jsx(s2,{router:a})})}ot.startTransition(()=>{vv.hydrateRoot(document,$.jsx(ot.StrictMode,{children:$.jsx(RE,{})}))});export{F as R,dv as a,CE as b,zE as c,LE as d,DE as e,cE as i,$ as j,fE as l,ot as r,NE as s,OE as t,ef as u}; diff --git a/apps/admin/.output/public/assets/styles-BHpgolea.css b/apps/admin/.output/public/assets/styles-BHpgolea.css new file mode 100644 index 00000000..2f4bc332 --- /dev/null +++ b/apps/admin/.output/public/assets/styles-BHpgolea.css @@ -0,0 +1 @@ +@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-100:oklch(93.6% .032 17.717);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-800:oklch(44.4% .177 26.899);--color-yellow-100:oklch(97.3% .071 103.193);--color-yellow-800:oklch(47.6% .114 61.907);--color-green-100:oklch(96.2% .044 156.743);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-800:oklch(44.8% .119 151.328);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-800:oklch(42.4% .199 265.638);--color-slate-50:oklch(98.4% .003 247.858);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-900:oklch(21% .034 264.665);--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.relative{position:relative}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-4{margin-top:calc(var(--spacing)*4)}.mr-2{margin-right:calc(var(--spacing)*2)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.ml-2{margin-left:calc(var(--spacing)*2)}.flex{display:flex}.inline-flex{display:inline-flex}.h-5{height:calc(var(--spacing)*5)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-screen{height:100vh}.min-h-screen{min-height:100vh}.w-5{width:calc(var(--spacing)*5)}.w-8{width:calc(var(--spacing)*8)}.w-9{width:calc(var(--spacing)*9)}.w-20{width:calc(var(--spacing)*20)}.w-\[360px\]{width:360px}.w-full{width:100%}.caption-bottom{caption-side:bottom}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.gap-2{gap:calc(var(--spacing)*2)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}.overflow-auto{overflow:auto}.overflow-x-auto{overflow-x:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-gray-900{border-color:var(--color-gray-900)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-green-100{background-color:var(--color-green-100)}.bg-green-500{background-color:var(--color-green-500)}.bg-red-100{background-color:var(--color-red-100)}.bg-red-500{background-color:var(--color-red-500)}.bg-slate-50{background-color:var(--color-slate-50)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-yellow-100{background-color:var(--color-yellow-100)}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-2\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-8{padding-inline:calc(var(--spacing)*8)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.py-6{padding-block:calc(var(--spacing)*6)}.pt-0{padding-top:calc(var(--spacing)*0)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.text-center{text-align:center}.text-left{text-align:left}.align-middle{vertical-align:middle}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-none{--tw-leading:1;line-height:1}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.whitespace-nowrap{white-space:nowrap}.text-blue-600{color:var(--color-blue-600)}.text-gray-500{color:var(--color-gray-500)}.text-green-800{color:var(--color-green-800)}.text-red-800{color:var(--color-red-800)}.text-white{color:var(--color-white)}.text-yellow-800{color:var(--color-yellow-800)}.underline-offset-4{text-underline-offset:4px}.shadow,.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-70:is(:where(.peer):disabled~*){opacity:.7}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}@media(hover:hover){.hover\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\:bg-green-600:hover{background-color:var(--color-green-600)}.hover\:bg-red-600:hover{background-color:var(--color-red-600)}.hover\:text-blue-800:hover{color:var(--color-blue-800)}.hover\:underline:hover{text-decoration-line:underline}}.focus-visible\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.data-\[state\=active\]\:shadow[data-state=active]{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}@media(min-width:48rem){.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:calc(var(--spacing)*0)}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y:2px;translate:var(--tw-translate-x)var(--tw-translate-y)}.\[\&\>tr\]\:last\:border-b-0>tr:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}}body{margin:calc(var(--spacing)*0);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@keyframes spin{to{transform:rotate(360deg)}} diff --git a/apps/admin/.output/public/favicon.ico b/apps/admin/.output/public/favicon.ico new file mode 100644 index 00000000..a11777cc Binary files /dev/null and b/apps/admin/.output/public/favicon.ico differ diff --git a/apps/admin/.output/public/logo192.png b/apps/admin/.output/public/logo192.png new file mode 100644 index 00000000..fc44b0a3 Binary files /dev/null and b/apps/admin/.output/public/logo192.png differ diff --git a/apps/admin/.output/public/logo512.png b/apps/admin/.output/public/logo512.png new file mode 100644 index 00000000..a4e47a65 Binary files /dev/null and b/apps/admin/.output/public/logo512.png differ diff --git a/apps/admin/.output/public/manifest.json b/apps/admin/.output/public/manifest.json new file mode 100644 index 00000000..078ef501 --- /dev/null +++ b/apps/admin/.output/public/manifest.json @@ -0,0 +1,25 @@ +{ + "short_name": "TanStack App", + "name": "Create TanStack App Sample", + "icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + }, + { + "src": "logo192.png", + "type": "image/png", + "sizes": "192x192" + }, + { + "src": "logo512.png", + "type": "image/png", + "sizes": "512x512" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/apps/admin/.output/public/robots.txt b/apps/admin/.output/public/robots.txt new file mode 100644 index 00000000..e9e57dc4 --- /dev/null +++ b/apps/admin/.output/public/robots.txt @@ -0,0 +1,3 @@ +# https://www.robotstxt.org/robotstxt.html +User-agent: * +Disallow: diff --git a/apps/admin/.output/public/tanstack-circle-logo.png b/apps/admin/.output/public/tanstack-circle-logo.png new file mode 100644 index 00000000..9db3e67b Binary files /dev/null and b/apps/admin/.output/public/tanstack-circle-logo.png differ diff --git a/apps/admin/.output/public/tanstack-word-logo-white.svg b/apps/admin/.output/public/tanstack-word-logo-white.svg new file mode 100644 index 00000000..b6ec5086 --- /dev/null +++ b/apps/admin/.output/public/tanstack-word-logo-white.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/admin/.output/server/_chunks/_libs/@radix-ui/primitive.mjs b/apps/admin/.output/server/_chunks/_libs/@radix-ui/primitive.mjs new file mode 100644 index 00000000..7ce0eece --- /dev/null +++ b/apps/admin/.output/server/_chunks/_libs/@radix-ui/primitive.mjs @@ -0,0 +1,11 @@ +function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) { + return function handleEvent(event) { + originalEventHandler?.(event); + if (checkForDefaultPrevented === false || !event.defaultPrevented) { + return ourEventHandler?.(event); + } + }; +} +export { + composeEventHandlers as c +}; diff --git a/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-collection.mjs b/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-collection.mjs new file mode 100644 index 00000000..d1971073 --- /dev/null +++ b/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-collection.mjs @@ -0,0 +1,69 @@ +import { R as React2, j as jsxRuntimeExports } from "../../../_libs/react.mjs"; +import { c as createContextScope } from "./react-context.mjs"; +import { u as useComposedRefs } from "./react-compose-refs.mjs"; +import { c as createSlot } from "./react-slot.mjs"; +function createCollection(name) { + const PROVIDER_NAME = name + "CollectionProvider"; + const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME); + const [CollectionProviderImpl, useCollectionContext] = createCollectionContext( + PROVIDER_NAME, + { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() } + ); + const CollectionProvider = (props) => { + const { scope, children } = props; + const ref = React2.useRef(null); + const itemMap = React2.useRef(/* @__PURE__ */ new Map()).current; + return /* @__PURE__ */ jsxRuntimeExports.jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children }); + }; + CollectionProvider.displayName = PROVIDER_NAME; + const COLLECTION_SLOT_NAME = name + "CollectionSlot"; + const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME); + const CollectionSlot = React2.forwardRef( + (props, forwardedRef) => { + const { scope, children } = props; + const context = useCollectionContext(COLLECTION_SLOT_NAME, scope); + const composedRefs = useComposedRefs(forwardedRef, context.collectionRef); + return /* @__PURE__ */ jsxRuntimeExports.jsx(CollectionSlotImpl, { ref: composedRefs, children }); + } + ); + CollectionSlot.displayName = COLLECTION_SLOT_NAME; + const ITEM_SLOT_NAME = name + "CollectionItemSlot"; + const ITEM_DATA_ATTR = "data-radix-collection-item"; + const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME); + const CollectionItemSlot = React2.forwardRef( + (props, forwardedRef) => { + const { scope, children, ...itemData } = props; + const ref = React2.useRef(null); + const composedRefs = useComposedRefs(forwardedRef, ref); + const context = useCollectionContext(ITEM_SLOT_NAME, scope); + React2.useEffect(() => { + context.itemMap.set(ref, { ref, ...itemData }); + return () => void context.itemMap.delete(ref); + }); + return /* @__PURE__ */ jsxRuntimeExports.jsx(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children }); + } + ); + CollectionItemSlot.displayName = ITEM_SLOT_NAME; + function useCollection(scope) { + const context = useCollectionContext(name + "CollectionConsumer", scope); + const getItems = React2.useCallback(() => { + const collectionNode = context.collectionRef.current; + if (!collectionNode) return []; + const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`)); + const items = Array.from(context.itemMap.values()); + const orderedItems = items.sort( + (a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current) + ); + return orderedItems; + }, [context.collectionRef, context.itemMap]); + return getItems; + } + return [ + { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot }, + useCollection, + createCollectionScope + ]; +} +export { + createCollection as c +}; diff --git a/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-compose-refs.mjs b/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-compose-refs.mjs new file mode 100644 index 00000000..e0b5c3b8 --- /dev/null +++ b/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-compose-refs.mjs @@ -0,0 +1,39 @@ +import { r as reactExports } from "../../../_libs/react.mjs"; +function setRef(ref, value) { + if (typeof ref === "function") { + return ref(value); + } else if (ref !== null && ref !== void 0) { + ref.current = value; + } +} +function composeRefs(...refs) { + return (node) => { + let hasCleanup = false; + const cleanups = refs.map((ref) => { + const cleanup = setRef(ref, node); + if (!hasCleanup && typeof cleanup == "function") { + hasCleanup = true; + } + return cleanup; + }); + if (hasCleanup) { + return () => { + for (let i = 0; i < cleanups.length; i++) { + const cleanup = cleanups[i]; + if (typeof cleanup == "function") { + cleanup(); + } else { + setRef(refs[i], null); + } + } + }; + } + }; +} +function useComposedRefs(...refs) { + return reactExports.useCallback(composeRefs(...refs), refs); +} +export { + composeRefs as c, + useComposedRefs as u +}; diff --git a/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-context.mjs b/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-context.mjs new file mode 100644 index 00000000..46e34f8c --- /dev/null +++ b/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-context.mjs @@ -0,0 +1,61 @@ +import { r as reactExports, j as jsxRuntimeExports } from "../../../_libs/react.mjs"; +function createContextScope(scopeName, createContextScopeDeps = []) { + let defaultContexts = []; + function createContext3(rootComponentName, defaultContext) { + const BaseContext = reactExports.createContext(defaultContext); + const index = defaultContexts.length; + defaultContexts = [...defaultContexts, defaultContext]; + const Provider = (props) => { + const { scope, children, ...context } = props; + const Context = scope?.[scopeName]?.[index] || BaseContext; + const value = reactExports.useMemo(() => context, Object.values(context)); + return /* @__PURE__ */ jsxRuntimeExports.jsx(Context.Provider, { value, children }); + }; + Provider.displayName = rootComponentName + "Provider"; + function useContext2(consumerName, scope) { + const Context = scope?.[scopeName]?.[index] || BaseContext; + const context = reactExports.useContext(Context); + if (context) return context; + if (defaultContext !== void 0) return defaultContext; + throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``); + } + return [Provider, useContext2]; + } + const createScope = () => { + const scopeContexts = defaultContexts.map((defaultContext) => { + return reactExports.createContext(defaultContext); + }); + return function useScope(scope) { + const contexts = scope?.[scopeName] || scopeContexts; + return reactExports.useMemo( + () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }), + [scope, contexts] + ); + }; + }; + createScope.scopeName = scopeName; + return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)]; +} +function composeContextScopes(...scopes) { + const baseScope = scopes[0]; + if (scopes.length === 1) return baseScope; + const createScope = () => { + const scopeHooks = scopes.map((createScope2) => ({ + useScope: createScope2(), + scopeName: createScope2.scopeName + })); + return function useComposedScopes(overrideScopes) { + const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => { + const scopeProps = useScope(overrideScopes); + const currentScope = scopeProps[`__scope${scopeName}`]; + return { ...nextScopes2, ...currentScope }; + }, {}); + return reactExports.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]); + }; + }; + createScope.scopeName = baseScope.scopeName; + return createScope; +} +export { + createContextScope as c +}; diff --git a/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-direction.mjs b/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-direction.mjs new file mode 100644 index 00000000..d8156e6c --- /dev/null +++ b/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-direction.mjs @@ -0,0 +1,9 @@ +import { r as reactExports } from "../../../_libs/react.mjs"; +var DirectionContext = reactExports.createContext(void 0); +function useDirection(localDir) { + const globalDir = reactExports.useContext(DirectionContext); + return localDir || globalDir || "ltr"; +} +export { + useDirection as u +}; diff --git a/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-id.mjs b/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-id.mjs new file mode 100644 index 00000000..8f2f5ff1 --- /dev/null +++ b/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-id.mjs @@ -0,0 +1,14 @@ +import { r as reactExports, a as React } from "../../../_libs/react.mjs"; +import { u as useLayoutEffect2 } from "./react-use-layout-effect.mjs"; +var useReactId = React[" useId ".trim().toString()] || (() => void 0); +var count = 0; +function useId(deterministicId) { + const [id, setId] = reactExports.useState(useReactId()); + useLayoutEffect2(() => { + setId((reactId) => reactId ?? String(count++)); + }, [deterministicId]); + return deterministicId || (id ? `radix-${id}` : ""); +} +export { + useId as u +}; diff --git a/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-label.mjs b/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-label.mjs new file mode 100644 index 00000000..bc210b26 --- /dev/null +++ b/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-label.mjs @@ -0,0 +1,23 @@ +import { r as reactExports, j as jsxRuntimeExports } from "../../../_libs/react.mjs"; +import { P as Primitive } from "./react-primitive.mjs"; +var NAME = "Label"; +var Label = reactExports.forwardRef((props, forwardedRef) => { + return /* @__PURE__ */ jsxRuntimeExports.jsx( + Primitive.label, + { + ...props, + ref: forwardedRef, + onMouseDown: (event) => { + const target = event.target; + if (target.closest("button, input, select, textarea")) return; + props.onMouseDown?.(event); + if (!event.defaultPrevented && event.detail > 1) event.preventDefault(); + } + } + ); +}); +Label.displayName = NAME; +var Root = Label; +export { + Root as R +}; diff --git a/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-presence.mjs b/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-presence.mjs new file mode 100644 index 00000000..5a797bac --- /dev/null +++ b/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-presence.mjs @@ -0,0 +1,128 @@ +import { r as reactExports } from "../../../_libs/react.mjs"; +import { u as useComposedRefs } from "./react-compose-refs.mjs"; +import { u as useLayoutEffect2 } from "./react-use-layout-effect.mjs"; +function useStateMachine(initialState, machine) { + return reactExports.useReducer((state, event) => { + const nextState = machine[state][event]; + return nextState ?? state; + }, initialState); +} +var Presence = (props) => { + const { present, children } = props; + const presence = usePresence(present); + const child = typeof children === "function" ? children({ present: presence.isPresent }) : reactExports.Children.only(children); + const ref = useComposedRefs(presence.ref, getElementRef(child)); + const forceMount = typeof children === "function"; + return forceMount || presence.isPresent ? reactExports.cloneElement(child, { ref }) : null; +}; +Presence.displayName = "Presence"; +function usePresence(present) { + const [node, setNode] = reactExports.useState(); + const stylesRef = reactExports.useRef(null); + const prevPresentRef = reactExports.useRef(present); + const prevAnimationNameRef = reactExports.useRef("none"); + const initialState = present ? "mounted" : "unmounted"; + const [state, send] = useStateMachine(initialState, { + mounted: { + UNMOUNT: "unmounted", + ANIMATION_OUT: "unmountSuspended" + }, + unmountSuspended: { + MOUNT: "mounted", + ANIMATION_END: "unmounted" + }, + unmounted: { + MOUNT: "mounted" + } + }); + reactExports.useEffect(() => { + const currentAnimationName = getAnimationName(stylesRef.current); + prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none"; + }, [state]); + useLayoutEffect2(() => { + const styles = stylesRef.current; + const wasPresent = prevPresentRef.current; + const hasPresentChanged = wasPresent !== present; + if (hasPresentChanged) { + const prevAnimationName = prevAnimationNameRef.current; + const currentAnimationName = getAnimationName(styles); + if (present) { + send("MOUNT"); + } else if (currentAnimationName === "none" || styles?.display === "none") { + send("UNMOUNT"); + } else { + const isAnimating = prevAnimationName !== currentAnimationName; + if (wasPresent && isAnimating) { + send("ANIMATION_OUT"); + } else { + send("UNMOUNT"); + } + } + prevPresentRef.current = present; + } + }, [present, send]); + useLayoutEffect2(() => { + if (node) { + let timeoutId; + const ownerWindow = node.ownerDocument.defaultView ?? window; + const handleAnimationEnd = (event) => { + const currentAnimationName = getAnimationName(stylesRef.current); + const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName)); + if (event.target === node && isCurrentAnimation) { + send("ANIMATION_END"); + if (!prevPresentRef.current) { + const currentFillMode = node.style.animationFillMode; + node.style.animationFillMode = "forwards"; + timeoutId = ownerWindow.setTimeout(() => { + if (node.style.animationFillMode === "forwards") { + node.style.animationFillMode = currentFillMode; + } + }); + } + } + }; + const handleAnimationStart = (event) => { + if (event.target === node) { + prevAnimationNameRef.current = getAnimationName(stylesRef.current); + } + }; + node.addEventListener("animationstart", handleAnimationStart); + node.addEventListener("animationcancel", handleAnimationEnd); + node.addEventListener("animationend", handleAnimationEnd); + return () => { + ownerWindow.clearTimeout(timeoutId); + node.removeEventListener("animationstart", handleAnimationStart); + node.removeEventListener("animationcancel", handleAnimationEnd); + node.removeEventListener("animationend", handleAnimationEnd); + }; + } else { + send("ANIMATION_END"); + } + }, [node, send]); + return { + isPresent: ["mounted", "unmountSuspended"].includes(state), + ref: reactExports.useCallback((node2) => { + stylesRef.current = node2 ? getComputedStyle(node2) : null; + setNode(node2); + }, []) + }; +} +function getAnimationName(styles) { + return styles?.animationName || "none"; +} +function getElementRef(element) { + let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get; + let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; + if (mayWarn) { + return element.ref; + } + getter = Object.getOwnPropertyDescriptor(element, "ref")?.get; + mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; + if (mayWarn) { + return element.props.ref; + } + return element.props.ref || element.ref; +} +export { + Presence as P +}; diff --git a/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-primitive.mjs b/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-primitive.mjs new file mode 100644 index 00000000..1c418b4d --- /dev/null +++ b/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-primitive.mjs @@ -0,0 +1,70 @@ +import { r as reactExports, j as jsxRuntimeExports } from "../../../_libs/react.mjs"; +import { c as createSlot, a as createSlot$1 } from "./react-slot.mjs"; +var NODES$1 = [ + "a", + "button", + "div", + "form", + "h2", + "h3", + "img", + "input", + "label", + "li", + "nav", + "ol", + "p", + "select", + "span", + "svg", + "ul" +]; +var Primitive$1 = NODES$1.reduce((primitive, node) => { + const Slot = createSlot(`Primitive.${node}`); + const Node = reactExports.forwardRef((props, forwardedRef) => { + const { asChild, ...primitiveProps } = props; + const Comp = asChild ? Slot : node; + if (typeof window !== "undefined") { + window[/* @__PURE__ */ Symbol.for("radix-ui")] = true; + } + return /* @__PURE__ */ jsxRuntimeExports.jsx(Comp, { ...primitiveProps, ref: forwardedRef }); + }); + Node.displayName = `Primitive.${node}`; + return { ...primitive, [node]: Node }; +}, {}); +var NODES = [ + "a", + "button", + "div", + "form", + "h2", + "h3", + "img", + "input", + "label", + "li", + "nav", + "ol", + "p", + "select", + "span", + "svg", + "ul" +]; +var Primitive = NODES.reduce((primitive, node) => { + const Slot = createSlot$1(`Primitive.${node}`); + const Node = reactExports.forwardRef((props, forwardedRef) => { + const { asChild, ...primitiveProps } = props; + const Comp = asChild ? Slot : node; + if (typeof window !== "undefined") { + window[/* @__PURE__ */ Symbol.for("radix-ui")] = true; + } + return /* @__PURE__ */ jsxRuntimeExports.jsx(Comp, { ...primitiveProps, ref: forwardedRef }); + }); + Node.displayName = `Primitive.${node}`; + return { ...primitive, [node]: Node }; +}, {}); +export { + Primitive as P, + Primitive$1 as a +}; diff --git a/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-roving-focus.mjs b/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-roving-focus.mjs new file mode 100644 index 00000000..a0d3927c --- /dev/null +++ b/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-roving-focus.mjs @@ -0,0 +1,224 @@ +import { r as reactExports, j as jsxRuntimeExports } from "../../../_libs/react.mjs"; +import { c as composeEventHandlers } from "./primitive.mjs"; +import { c as createCollection } from "./react-collection.mjs"; +import { u as useComposedRefs } from "./react-compose-refs.mjs"; +import { c as createContextScope } from "./react-context.mjs"; +import { u as useId } from "./react-id.mjs"; +import { a as Primitive } from "./react-primitive.mjs"; +import { u as useCallbackRef } from "./react-use-callback-ref.mjs"; +import { u as useControllableState } from "./react-use-controllable-state.mjs"; +import { u as useDirection } from "./react-direction.mjs"; +var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus"; +var EVENT_OPTIONS = { bubbles: false, cancelable: true }; +var GROUP_NAME = "RovingFocusGroup"; +var [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME); +var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope( + GROUP_NAME, + [createCollectionScope] +); +var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME); +var RovingFocusGroup = reactExports.forwardRef( + (props, forwardedRef) => { + return /* @__PURE__ */ jsxRuntimeExports.jsx(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsxRuntimeExports.jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) }); + } +); +RovingFocusGroup.displayName = GROUP_NAME; +var RovingFocusGroupImpl = reactExports.forwardRef((props, forwardedRef) => { + const { + __scopeRovingFocusGroup, + orientation, + loop = false, + dir, + currentTabStopId: currentTabStopIdProp, + defaultCurrentTabStopId, + onCurrentTabStopIdChange, + onEntryFocus, + preventScrollOnEntryFocus = false, + ...groupProps + } = props; + const ref = reactExports.useRef(null); + const composedRefs = useComposedRefs(forwardedRef, ref); + const direction = useDirection(dir); + const [currentTabStopId, setCurrentTabStopId] = useControllableState({ + prop: currentTabStopIdProp, + defaultProp: defaultCurrentTabStopId ?? null, + onChange: onCurrentTabStopIdChange, + caller: GROUP_NAME + }); + const [isTabbingBackOut, setIsTabbingBackOut] = reactExports.useState(false); + const handleEntryFocus = useCallbackRef(onEntryFocus); + const getItems = useCollection(__scopeRovingFocusGroup); + const isClickFocusRef = reactExports.useRef(false); + const [focusableItemsCount, setFocusableItemsCount] = reactExports.useState(0); + reactExports.useEffect(() => { + const node = ref.current; + if (node) { + node.addEventListener(ENTRY_FOCUS, handleEntryFocus); + return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus); + } + }, [handleEntryFocus]); + return /* @__PURE__ */ jsxRuntimeExports.jsx( + RovingFocusProvider, + { + scope: __scopeRovingFocusGroup, + orientation, + dir: direction, + loop, + currentTabStopId, + onItemFocus: reactExports.useCallback( + (tabStopId) => setCurrentTabStopId(tabStopId), + [setCurrentTabStopId] + ), + onItemShiftTab: reactExports.useCallback(() => setIsTabbingBackOut(true), []), + onFocusableItemAdd: reactExports.useCallback( + () => setFocusableItemsCount((prevCount) => prevCount + 1), + [] + ), + onFocusableItemRemove: reactExports.useCallback( + () => setFocusableItemsCount((prevCount) => prevCount - 1), + [] + ), + children: /* @__PURE__ */ jsxRuntimeExports.jsx( + Primitive.div, + { + tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0, + "data-orientation": orientation, + ...groupProps, + ref: composedRefs, + style: { outline: "none", ...props.style }, + onMouseDown: composeEventHandlers(props.onMouseDown, () => { + isClickFocusRef.current = true; + }), + onFocus: composeEventHandlers(props.onFocus, (event) => { + const isKeyboardFocus = !isClickFocusRef.current; + if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) { + const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS); + event.currentTarget.dispatchEvent(entryFocusEvent); + if (!entryFocusEvent.defaultPrevented) { + const items = getItems().filter((item) => item.focusable); + const activeItem = items.find((item) => item.active); + const currentItem = items.find((item) => item.id === currentTabStopId); + const candidateItems = [activeItem, currentItem, ...items].filter( + Boolean + ); + const candidateNodes = candidateItems.map((item) => item.ref.current); + focusFirst(candidateNodes, preventScrollOnEntryFocus); + } + } + isClickFocusRef.current = false; + }), + onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false)) + } + ) + } + ); +}); +var ITEM_NAME = "RovingFocusGroupItem"; +var RovingFocusGroupItem = reactExports.forwardRef( + (props, forwardedRef) => { + const { + __scopeRovingFocusGroup, + focusable = true, + active = false, + tabStopId, + children, + ...itemProps + } = props; + const autoId = useId(); + const id = tabStopId || autoId; + const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup); + const isCurrentTabStop = context.currentTabStopId === id; + const getItems = useCollection(__scopeRovingFocusGroup); + const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context; + reactExports.useEffect(() => { + if (focusable) { + onFocusableItemAdd(); + return () => onFocusableItemRemove(); + } + }, [focusable, onFocusableItemAdd, onFocusableItemRemove]); + return /* @__PURE__ */ jsxRuntimeExports.jsx( + Collection.ItemSlot, + { + scope: __scopeRovingFocusGroup, + id, + focusable, + active, + children: /* @__PURE__ */ jsxRuntimeExports.jsx( + Primitive.span, + { + tabIndex: isCurrentTabStop ? 0 : -1, + "data-orientation": context.orientation, + ...itemProps, + ref: forwardedRef, + onMouseDown: composeEventHandlers(props.onMouseDown, (event) => { + if (!focusable) event.preventDefault(); + else context.onItemFocus(id); + }), + onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)), + onKeyDown: composeEventHandlers(props.onKeyDown, (event) => { + if (event.key === "Tab" && event.shiftKey) { + context.onItemShiftTab(); + return; + } + if (event.target !== event.currentTarget) return; + const focusIntent = getFocusIntent(event, context.orientation, context.dir); + if (focusIntent !== void 0) { + if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return; + event.preventDefault(); + const items = getItems().filter((item) => item.focusable); + let candidateNodes = items.map((item) => item.ref.current); + if (focusIntent === "last") candidateNodes.reverse(); + else if (focusIntent === "prev" || focusIntent === "next") { + if (focusIntent === "prev") candidateNodes.reverse(); + const currentIndex = candidateNodes.indexOf(event.currentTarget); + candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1); + } + setTimeout(() => focusFirst(candidateNodes)); + } + }), + children: typeof children === "function" ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null }) : children + } + ) + } + ); + } +); +RovingFocusGroupItem.displayName = ITEM_NAME; +var MAP_KEY_TO_FOCUS_INTENT = { + ArrowLeft: "prev", + ArrowUp: "prev", + ArrowRight: "next", + ArrowDown: "next", + PageUp: "first", + Home: "first", + PageDown: "last", + End: "last" +}; +function getDirectionAwareKey(key, dir) { + if (dir !== "rtl") return key; + return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key; +} +function getFocusIntent(event, orientation, dir) { + const key = getDirectionAwareKey(event.key, dir); + if (orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) return void 0; + if (orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0; + return MAP_KEY_TO_FOCUS_INTENT[key]; +} +function focusFirst(candidates, preventScroll = false) { + const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement; + for (const candidate of candidates) { + if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return; + candidate.focus({ preventScroll }); + if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return; + } +} +function wrapArray(array, startIndex) { + return array.map((_, index) => array[(startIndex + index) % array.length]); +} +var Root = RovingFocusGroup; +var Item = RovingFocusGroupItem; +export { + Item as I, + Root as R, + createRovingFocusGroupScope as c +}; diff --git a/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-slot.mjs b/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-slot.mjs new file mode 100644 index 00000000..51c013d2 --- /dev/null +++ b/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-slot.mjs @@ -0,0 +1,186 @@ +import { r as reactExports, a as React, j as jsxRuntimeExports } from "../../../_libs/react.mjs"; +import { c as composeRefs } from "./react-compose-refs.mjs"; +var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"); +var use = React[" use ".trim().toString()]; +function isPromiseLike(value) { + return typeof value === "object" && value !== null && "then" in value; +} +function isLazyComponent(element) { + return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload); +} +// @__NO_SIDE_EFFECTS__ +function createSlot$1(ownerName) { + const SlotClone = /* @__PURE__ */ createSlotClone$1(ownerName); + const Slot2 = reactExports.forwardRef((props, forwardedRef) => { + let { children, ...slotProps } = props; + if (isLazyComponent(children) && typeof use === "function") { + children = use(children._payload); + } + const childrenArray = reactExports.Children.toArray(children); + const slottable = childrenArray.find(isSlottable$1); + if (slottable) { + const newElement = slottable.props.children; + const newChildren = childrenArray.map((child) => { + if (child === slottable) { + if (reactExports.Children.count(newElement) > 1) return reactExports.Children.only(null); + return reactExports.isValidElement(newElement) ? newElement.props.children : null; + } else { + return child; + } + }); + return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: reactExports.isValidElement(newElement) ? reactExports.cloneElement(newElement, void 0, newChildren) : null }); + } + return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children }); + }); + Slot2.displayName = `${ownerName}.Slot`; + return Slot2; +} +var Slot = /* @__PURE__ */ createSlot$1("Slot"); +// @__NO_SIDE_EFFECTS__ +function createSlotClone$1(ownerName) { + const SlotClone = reactExports.forwardRef((props, forwardedRef) => { + let { children, ...slotProps } = props; + if (isLazyComponent(children) && typeof use === "function") { + children = use(children._payload); + } + if (reactExports.isValidElement(children)) { + const childrenRef = getElementRef$1(children); + const props2 = mergeProps$1(slotProps, children.props); + if (children.type !== reactExports.Fragment) { + props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef; + } + return reactExports.cloneElement(children, props2); + } + return reactExports.Children.count(children) > 1 ? reactExports.Children.only(null) : null; + }); + SlotClone.displayName = `${ownerName}.SlotClone`; + return SlotClone; +} +var SLOTTABLE_IDENTIFIER$1 = /* @__PURE__ */ Symbol("radix.slottable"); +function isSlottable$1(child) { + return reactExports.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER$1; +} +function mergeProps$1(slotProps, childProps) { + const overrideProps = { ...childProps }; + for (const propName in childProps) { + const slotPropValue = slotProps[propName]; + const childPropValue = childProps[propName]; + const isHandler = /^on[A-Z]/.test(propName); + if (isHandler) { + if (slotPropValue && childPropValue) { + overrideProps[propName] = (...args) => { + const result = childPropValue(...args); + slotPropValue(...args); + return result; + }; + } else if (slotPropValue) { + overrideProps[propName] = slotPropValue; + } + } else if (propName === "style") { + overrideProps[propName] = { ...slotPropValue, ...childPropValue }; + } else if (propName === "className") { + overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" "); + } + } + return { ...slotProps, ...overrideProps }; +} +function getElementRef$1(element) { + let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get; + let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; + if (mayWarn) { + return element.ref; + } + getter = Object.getOwnPropertyDescriptor(element, "ref")?.get; + mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; + if (mayWarn) { + return element.props.ref; + } + return element.props.ref || element.ref; +} +// @__NO_SIDE_EFFECTS__ +function createSlot(ownerName) { + const SlotClone = /* @__PURE__ */ createSlotClone(ownerName); + const Slot2 = reactExports.forwardRef((props, forwardedRef) => { + const { children, ...slotProps } = props; + const childrenArray = reactExports.Children.toArray(children); + const slottable = childrenArray.find(isSlottable); + if (slottable) { + const newElement = slottable.props.children; + const newChildren = childrenArray.map((child) => { + if (child === slottable) { + if (reactExports.Children.count(newElement) > 1) return reactExports.Children.only(null); + return reactExports.isValidElement(newElement) ? newElement.props.children : null; + } else { + return child; + } + }); + return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: reactExports.isValidElement(newElement) ? reactExports.cloneElement(newElement, void 0, newChildren) : null }); + } + return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children }); + }); + Slot2.displayName = `${ownerName}.Slot`; + return Slot2; +} +// @__NO_SIDE_EFFECTS__ +function createSlotClone(ownerName) { + const SlotClone = reactExports.forwardRef((props, forwardedRef) => { + const { children, ...slotProps } = props; + if (reactExports.isValidElement(children)) { + const childrenRef = getElementRef(children); + const props2 = mergeProps(slotProps, children.props); + if (children.type !== reactExports.Fragment) { + props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef; + } + return reactExports.cloneElement(children, props2); + } + return reactExports.Children.count(children) > 1 ? reactExports.Children.only(null) : null; + }); + SlotClone.displayName = `${ownerName}.SlotClone`; + return SlotClone; +} +var SLOTTABLE_IDENTIFIER = /* @__PURE__ */ Symbol("radix.slottable"); +function isSlottable(child) { + return reactExports.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER; +} +function mergeProps(slotProps, childProps) { + const overrideProps = { ...childProps }; + for (const propName in childProps) { + const slotPropValue = slotProps[propName]; + const childPropValue = childProps[propName]; + const isHandler = /^on[A-Z]/.test(propName); + if (isHandler) { + if (slotPropValue && childPropValue) { + overrideProps[propName] = (...args) => { + const result = childPropValue(...args); + slotPropValue(...args); + return result; + }; + } else if (slotPropValue) { + overrideProps[propName] = slotPropValue; + } + } else if (propName === "style") { + overrideProps[propName] = { ...slotPropValue, ...childPropValue }; + } else if (propName === "className") { + overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" "); + } + } + return { ...slotProps, ...overrideProps }; +} +function getElementRef(element) { + let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get; + let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; + if (mayWarn) { + return element.ref; + } + getter = Object.getOwnPropertyDescriptor(element, "ref")?.get; + mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; + if (mayWarn) { + return element.props.ref; + } + return element.props.ref || element.ref; +} +export { + Slot as S, + createSlot$1 as a, + createSlot as c +}; diff --git a/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-tabs.mjs b/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-tabs.mjs new file mode 100644 index 00000000..02491420 --- /dev/null +++ b/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-tabs.mjs @@ -0,0 +1,189 @@ +import { r as reactExports, j as jsxRuntimeExports } from "../../../_libs/react.mjs"; +import { c as composeEventHandlers } from "./primitive.mjs"; +import { c as createContextScope } from "./react-context.mjs"; +import { c as createRovingFocusGroupScope, R as Root, I as Item } from "./react-roving-focus.mjs"; +import { P as Presence } from "./react-presence.mjs"; +import { a as Primitive } from "./react-primitive.mjs"; +import { u as useDirection } from "./react-direction.mjs"; +import { u as useControllableState } from "./react-use-controllable-state.mjs"; +import { u as useId } from "./react-id.mjs"; +var TABS_NAME = "Tabs"; +var [createTabsContext] = createContextScope(TABS_NAME, [ + createRovingFocusGroupScope +]); +var useRovingFocusGroupScope = createRovingFocusGroupScope(); +var [TabsProvider, useTabsContext] = createTabsContext(TABS_NAME); +var Tabs = reactExports.forwardRef( + (props, forwardedRef) => { + const { + __scopeTabs, + value: valueProp, + onValueChange, + defaultValue, + orientation = "horizontal", + dir, + activationMode = "automatic", + ...tabsProps + } = props; + const direction = useDirection(dir); + const [value, setValue] = useControllableState({ + prop: valueProp, + onChange: onValueChange, + defaultProp: defaultValue ?? "", + caller: TABS_NAME + }); + return /* @__PURE__ */ jsxRuntimeExports.jsx( + TabsProvider, + { + scope: __scopeTabs, + baseId: useId(), + value, + onValueChange: setValue, + orientation, + dir: direction, + activationMode, + children: /* @__PURE__ */ jsxRuntimeExports.jsx( + Primitive.div, + { + dir: direction, + "data-orientation": orientation, + ...tabsProps, + ref: forwardedRef + } + ) + } + ); + } +); +Tabs.displayName = TABS_NAME; +var TAB_LIST_NAME = "TabsList"; +var TabsList = reactExports.forwardRef( + (props, forwardedRef) => { + const { __scopeTabs, loop = true, ...listProps } = props; + const context = useTabsContext(TAB_LIST_NAME, __scopeTabs); + const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeTabs); + return /* @__PURE__ */ jsxRuntimeExports.jsx( + Root, + { + asChild: true, + ...rovingFocusGroupScope, + orientation: context.orientation, + dir: context.dir, + loop, + children: /* @__PURE__ */ jsxRuntimeExports.jsx( + Primitive.div, + { + role: "tablist", + "aria-orientation": context.orientation, + ...listProps, + ref: forwardedRef + } + ) + } + ); + } +); +TabsList.displayName = TAB_LIST_NAME; +var TRIGGER_NAME = "TabsTrigger"; +var TabsTrigger = reactExports.forwardRef( + (props, forwardedRef) => { + const { __scopeTabs, value, disabled = false, ...triggerProps } = props; + const context = useTabsContext(TRIGGER_NAME, __scopeTabs); + const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeTabs); + const triggerId = makeTriggerId(context.baseId, value); + const contentId = makeContentId(context.baseId, value); + const isSelected = value === context.value; + return /* @__PURE__ */ jsxRuntimeExports.jsx( + Item, + { + asChild: true, + ...rovingFocusGroupScope, + focusable: !disabled, + active: isSelected, + children: /* @__PURE__ */ jsxRuntimeExports.jsx( + Primitive.button, + { + type: "button", + role: "tab", + "aria-selected": isSelected, + "aria-controls": contentId, + "data-state": isSelected ? "active" : "inactive", + "data-disabled": disabled ? "" : void 0, + disabled, + id: triggerId, + ...triggerProps, + ref: forwardedRef, + onMouseDown: composeEventHandlers(props.onMouseDown, (event) => { + if (!disabled && event.button === 0 && event.ctrlKey === false) { + context.onValueChange(value); + } else { + event.preventDefault(); + } + }), + onKeyDown: composeEventHandlers(props.onKeyDown, (event) => { + if ([" ", "Enter"].includes(event.key)) context.onValueChange(value); + }), + onFocus: composeEventHandlers(props.onFocus, () => { + const isAutomaticActivation = context.activationMode !== "manual"; + if (!isSelected && !disabled && isAutomaticActivation) { + context.onValueChange(value); + } + }) + } + ) + } + ); + } +); +TabsTrigger.displayName = TRIGGER_NAME; +var CONTENT_NAME = "TabsContent"; +var TabsContent = reactExports.forwardRef( + (props, forwardedRef) => { + const { __scopeTabs, value, forceMount, children, ...contentProps } = props; + const context = useTabsContext(CONTENT_NAME, __scopeTabs); + const triggerId = makeTriggerId(context.baseId, value); + const contentId = makeContentId(context.baseId, value); + const isSelected = value === context.value; + const isMountAnimationPreventedRef = reactExports.useRef(isSelected); + reactExports.useEffect(() => { + const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false); + return () => cancelAnimationFrame(rAF); + }, []); + return /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || isSelected, children: ({ present }) => /* @__PURE__ */ jsxRuntimeExports.jsx( + Primitive.div, + { + "data-state": isSelected ? "active" : "inactive", + "data-orientation": context.orientation, + role: "tabpanel", + "aria-labelledby": triggerId, + hidden: !present, + id: contentId, + tabIndex: 0, + ...contentProps, + ref: forwardedRef, + style: { + ...props.style, + animationDuration: isMountAnimationPreventedRef.current ? "0s" : void 0 + }, + children: present && children + } + ) }); + } +); +TabsContent.displayName = CONTENT_NAME; +function makeTriggerId(baseId, value) { + return `${baseId}-trigger-${value}`; +} +function makeContentId(baseId, value) { + return `${baseId}-content-${value}`; +} +var Root2 = Tabs; +var List = TabsList; +var Trigger = TabsTrigger; +var Content = TabsContent; +export { + Content as C, + List as L, + Root2 as R, + Trigger as T +}; diff --git a/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-use-callback-ref.mjs b/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-use-callback-ref.mjs new file mode 100644 index 00000000..1100120f --- /dev/null +++ b/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-use-callback-ref.mjs @@ -0,0 +1,11 @@ +import { r as reactExports } from "../../../_libs/react.mjs"; +function useCallbackRef(callback) { + const callbackRef = reactExports.useRef(callback); + reactExports.useEffect(() => { + callbackRef.current = callback; + }); + return reactExports.useMemo(() => (...args) => callbackRef.current?.(...args), []); +} +export { + useCallbackRef as u +}; diff --git a/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-use-controllable-state.mjs b/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-use-controllable-state.mjs new file mode 100644 index 00000000..0fd14df4 --- /dev/null +++ b/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-use-controllable-state.mjs @@ -0,0 +1,69 @@ +import { r as reactExports, a as React } from "../../../_libs/react.mjs"; +import { u as useLayoutEffect2 } from "./react-use-layout-effect.mjs"; +var useInsertionEffect = React[" useInsertionEffect ".trim().toString()] || useLayoutEffect2; +function useControllableState({ + prop, + defaultProp, + onChange = () => { + }, + caller +}) { + const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({ + defaultProp, + onChange + }); + const isControlled = prop !== void 0; + const value = isControlled ? prop : uncontrolledProp; + { + const isControlledRef = reactExports.useRef(prop !== void 0); + reactExports.useEffect(() => { + const wasControlled = isControlledRef.current; + if (wasControlled !== isControlled) { + const from = wasControlled ? "controlled" : "uncontrolled"; + const to = isControlled ? "controlled" : "uncontrolled"; + console.warn( + `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.` + ); + } + isControlledRef.current = isControlled; + }, [isControlled, caller]); + } + const setValue = reactExports.useCallback( + (nextValue) => { + if (isControlled) { + const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue; + if (value2 !== prop) { + onChangeRef.current?.(value2); + } + } else { + setUncontrolledProp(nextValue); + } + }, + [isControlled, prop, setUncontrolledProp, onChangeRef] + ); + return [value, setValue]; +} +function useUncontrolledState({ + defaultProp, + onChange +}) { + const [value, setValue] = reactExports.useState(defaultProp); + const prevValueRef = reactExports.useRef(value); + const onChangeRef = reactExports.useRef(onChange); + useInsertionEffect(() => { + onChangeRef.current = onChange; + }, [onChange]); + reactExports.useEffect(() => { + if (prevValueRef.current !== value) { + onChangeRef.current?.(value); + prevValueRef.current = value; + } + }, [value, prevValueRef]); + return [value, setValue, onChangeRef]; +} +function isFunction(value) { + return typeof value === "function"; +} +export { + useControllableState as u +}; diff --git a/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-use-effect-event.mjs b/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-use-effect-event.mjs new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-use-effect-event.mjs @@ -0,0 +1 @@ + diff --git a/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-use-layout-effect.mjs b/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-use-layout-effect.mjs new file mode 100644 index 00000000..0fa6f8b0 --- /dev/null +++ b/apps/admin/.output/server/_chunks/_libs/@radix-ui/react-use-layout-effect.mjs @@ -0,0 +1,6 @@ +import { r as reactExports } from "../../../_libs/react.mjs"; +var useLayoutEffect2 = globalThis?.document ? reactExports.useLayoutEffect : () => { +}; +export { + useLayoutEffect2 as u +}; diff --git a/apps/admin/.output/server/_chunks/_libs/@tanstack/history.mjs b/apps/admin/.output/server/_chunks/_libs/@tanstack/history.mjs new file mode 100644 index 00000000..686db8ba --- /dev/null +++ b/apps/admin/.output/server/_chunks/_libs/@tanstack/history.mjs @@ -0,0 +1,217 @@ +const stateIndexKey = "__TSR_index"; +function createHistory(opts) { + let location = opts.getLocation(); + const subscribers = /* @__PURE__ */ new Set(); + const notify = (action) => { + location = opts.getLocation(); + subscribers.forEach((subscriber) => subscriber({ location, action })); + }; + const handleIndexChange = (action) => { + if (opts.notifyOnIndexChange ?? true) notify(action); + else location = opts.getLocation(); + }; + const tryNavigation = async ({ + task, + navigateOpts, + ...actionInfo + }) => { + const ignoreBlocker = navigateOpts?.ignoreBlocker ?? false; + if (ignoreBlocker) { + task(); + return; + } + const blockers = opts.getBlockers?.() ?? []; + const isPushOrReplace = actionInfo.type === "PUSH" || actionInfo.type === "REPLACE"; + if (typeof document !== "undefined" && blockers.length && isPushOrReplace) { + for (const blocker of blockers) { + const nextLocation = parseHref(actionInfo.path, actionInfo.state); + const isBlocked = await blocker.blockerFn({ + currentLocation: location, + nextLocation, + action: actionInfo.type + }); + if (isBlocked) { + opts.onBlocked?.(); + return; + } + } + } + task(); + }; + return { + get location() { + return location; + }, + get length() { + return opts.getLength(); + }, + subscribers, + subscribe: (cb) => { + subscribers.add(cb); + return () => { + subscribers.delete(cb); + }; + }, + push: (path, state, navigateOpts) => { + const currentIndex = location.state[stateIndexKey]; + state = assignKeyAndIndex(currentIndex + 1, state); + tryNavigation({ + task: () => { + opts.pushState(path, state); + notify({ type: "PUSH" }); + }, + navigateOpts, + type: "PUSH", + path, + state + }); + }, + replace: (path, state, navigateOpts) => { + const currentIndex = location.state[stateIndexKey]; + state = assignKeyAndIndex(currentIndex, state); + tryNavigation({ + task: () => { + opts.replaceState(path, state); + notify({ type: "REPLACE" }); + }, + navigateOpts, + type: "REPLACE", + path, + state + }); + }, + go: (index, navigateOpts) => { + tryNavigation({ + task: () => { + opts.go(index); + handleIndexChange({ type: "GO", index }); + }, + navigateOpts, + type: "GO" + }); + }, + back: (navigateOpts) => { + tryNavigation({ + task: () => { + opts.back(navigateOpts?.ignoreBlocker ?? false); + handleIndexChange({ type: "BACK" }); + }, + navigateOpts, + type: "BACK" + }); + }, + forward: (navigateOpts) => { + tryNavigation({ + task: () => { + opts.forward(navigateOpts?.ignoreBlocker ?? false); + handleIndexChange({ type: "FORWARD" }); + }, + navigateOpts, + type: "FORWARD" + }); + }, + canGoBack: () => location.state[stateIndexKey] !== 0, + createHref: (str) => opts.createHref(str), + block: (blocker) => { + if (!opts.setBlockers) return () => { + }; + const blockers = opts.getBlockers?.() ?? []; + opts.setBlockers([...blockers, blocker]); + return () => { + const blockers2 = opts.getBlockers?.() ?? []; + opts.setBlockers?.(blockers2.filter((b) => b !== blocker)); + }; + }, + flush: () => opts.flush?.(), + destroy: () => opts.destroy?.(), + notify + }; +} +function assignKeyAndIndex(index, state) { + if (!state) { + state = {}; + } + const key = createRandomKey(); + return { + ...state, + key, + // TODO: Remove in v2 - use __TSR_key instead + __TSR_key: key, + [stateIndexKey]: index + }; +} +function createMemoryHistory(opts = { + initialEntries: ["/"] +}) { + const entries = opts.initialEntries; + let index = opts.initialIndex ? Math.min(Math.max(opts.initialIndex, 0), entries.length - 1) : entries.length - 1; + const states = entries.map( + (_entry, index2) => assignKeyAndIndex(index2, void 0) + ); + const getLocation = () => parseHref(entries[index], states[index]); + let blockers = []; + const _getBlockers = () => blockers; + const _setBlockers = (newBlockers) => blockers = newBlockers; + return createHistory({ + getLocation, + getLength: () => entries.length, + pushState: (path, state) => { + if (index < entries.length - 1) { + entries.splice(index + 1); + states.splice(index + 1); + } + states.push(state); + entries.push(path); + index = Math.max(entries.length - 1, 0); + }, + replaceState: (path, state) => { + states[index] = state; + entries[index] = path; + }, + back: () => { + index = Math.max(index - 1, 0); + }, + forward: () => { + index = Math.min(index + 1, entries.length - 1); + }, + go: (n) => { + index = Math.min(Math.max(index + n, 0), entries.length - 1); + }, + createHref: (path) => path, + getBlockers: _getBlockers, + setBlockers: _setBlockers + }); +} +function sanitizePath(path) { + let sanitized = path.replace(/[\x00-\x1f\x7f]/g, ""); + if (sanitized.startsWith("//")) { + sanitized = "/" + sanitized.replace(/^\/+/, ""); + } + return sanitized; +} +function parseHref(href, state) { + const sanitizedHref = sanitizePath(href); + const hashIndex = sanitizedHref.indexOf("#"); + const searchIndex = sanitizedHref.indexOf("?"); + const addedKey = createRandomKey(); + return { + href: sanitizedHref, + pathname: sanitizedHref.substring( + 0, + hashIndex > 0 ? searchIndex > 0 ? Math.min(hashIndex, searchIndex) : hashIndex : searchIndex > 0 ? searchIndex : sanitizedHref.length + ), + hash: hashIndex > -1 ? sanitizedHref.substring(hashIndex) : "", + search: searchIndex > -1 ? sanitizedHref.slice( + searchIndex, + hashIndex === -1 ? void 0 : hashIndex + ) : "", + state: state || { [stateIndexKey]: 0, key: addedKey, __TSR_key: addedKey } + }; +} +function createRandomKey() { + return (Math.random() + 1).toString(36).substring(7); +} +export { + createMemoryHistory as c, + parseHref as p +}; diff --git a/apps/admin/.output/server/_chunks/_libs/@tanstack/react-router.mjs b/apps/admin/.output/server/_chunks/_libs/@tanstack/react-router.mjs new file mode 100644 index 00000000..ae587773 --- /dev/null +++ b/apps/admin/.output/server/_chunks/_libs/@tanstack/react-router.mjs @@ -0,0 +1,1475 @@ +import { j as jsxRuntimeExports, r as reactExports, a as React, R as React2 } from "../../../_libs/react.mjs"; +import { w as warning } from "../../../_libs/tiny-warning.mjs"; +import { i as isNotFound, d as defaultGetScrollRestorationKey, r as restoreScroll, e as escapeHtml, s as storageKey, a as rootRouteId, b as isRedirect, g as getLocationChangeInfo, t as transformReadableStreamWithRouter, c as transformPipeableStreamWithRouter, f as isDangerousProtocol, h as exactPathTest, j as removeTrailingSlash, k as deepEqual, l as functionalUpdate, B as BaseRootRoute, m as BaseRoute, n as isModuleNotFoundError, R as RouterCore } from "./router-core.mjs"; +import { i as invariant } from "../../../_libs/tiny-invariant.mjs"; +import { PassThrough } from "node:stream"; +import { R as ReactDOMServer } from "../react-dom.mjs"; +import { i as isbot } from "../../../_libs/isbot.mjs"; +function CatchBoundary(props) { + const errorComponent = props.errorComponent ?? ErrorComponent; + return /* @__PURE__ */ jsxRuntimeExports.jsx( + CatchBoundaryImpl, + { + getResetKey: props.getResetKey, + onCatch: props.onCatch, + children: ({ error, reset }) => { + if (error) { + return reactExports.createElement(errorComponent, { + error, + reset + }); + } + return props.children; + } + } + ); +} +class CatchBoundaryImpl extends reactExports.Component { + constructor() { + super(...arguments); + this.state = { error: null }; + } + static getDerivedStateFromProps(props) { + return { resetKey: props.getResetKey() }; + } + static getDerivedStateFromError(error) { + return { error }; + } + reset() { + this.setState({ error: null }); + } + componentDidUpdate(prevProps, prevState) { + if (prevState.error && prevState.resetKey !== this.state.resetKey) { + this.reset(); + } + } + componentDidCatch(error, errorInfo) { + if (this.props.onCatch) { + this.props.onCatch(error, errorInfo); + } + } + render() { + return this.props.children({ + error: this.state.resetKey !== this.props.getResetKey() ? null : this.state.error, + reset: () => { + this.reset(); + } + }); + } +} +function ErrorComponent({ error }) { + const [show, setShow] = reactExports.useState(false); + return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { padding: ".5rem", maxWidth: "100%" }, children: [ + /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex", alignItems: "center", gap: ".5rem" }, children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { style: { fontSize: "1rem" }, children: "Something went wrong!" }), + /* @__PURE__ */ jsxRuntimeExports.jsx( + "button", + { + style: { + appearance: "none", + fontSize: ".6em", + border: "1px solid currentColor", + padding: ".1rem .2rem", + fontWeight: "bold", + borderRadius: ".25rem" + }, + onClick: () => setShow((d) => !d), + children: show ? "Hide Error" : "Show Error" + } + ) + ] }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { height: ".25rem" } }), + show ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx( + "pre", + { + style: { + fontSize: ".7em", + border: "1px solid red", + borderRadius: ".25rem", + padding: ".3rem", + color: "red", + overflow: "auto" + }, + children: error.message ? /* @__PURE__ */ jsxRuntimeExports.jsx("code", { children: error.message }) : null + } + ) }) : null + ] }); +} +const routerContext = reactExports.createContext(null); +function getRouterContext() { + if (typeof document === "undefined") { + return routerContext; + } + if (window.__TSR_ROUTER_CONTEXT__) { + return window.__TSR_ROUTER_CONTEXT__; + } + window.__TSR_ROUTER_CONTEXT__ = routerContext; + return routerContext; +} +function useRouter(opts) { + const value = reactExports.useContext(getRouterContext()); + warning( + !((opts?.warn ?? true) && !value) + ); + return value; +} +function useRouterState(opts) { + const contextRouter = useRouter({ + warn: opts?.router === void 0 + }); + const router = opts?.router || contextRouter; + { + const state = router.state; + return opts?.select ? opts.select(state) : state; + } +} +const REACT_USE = "use"; +const reactUse = React[REACT_USE]; +function useForwardedRef(ref) { + const innerRef = reactExports.useRef(null); + reactExports.useImperativeHandle(ref, () => innerRef.current, []); + return innerRef; +} +const matchContext = reactExports.createContext(void 0); +const dummyMatchContext = reactExports.createContext( + void 0 +); +function CatchNotFound(props) { + const resetKey = useRouterState({ + select: (s) => `not-found-${s.location.pathname}-${s.status}` + }); + return /* @__PURE__ */ jsxRuntimeExports.jsx( + CatchBoundary, + { + getResetKey: () => resetKey, + onCatch: (error, errorInfo) => { + if (isNotFound(error)) { + props.onCatch?.(error, errorInfo); + } else { + throw error; + } + }, + errorComponent: ({ error }) => { + if (isNotFound(error)) { + return props.fallback?.(error); + } else { + throw error; + } + }, + children: props.children + } + ); +} +function DefaultGlobalNotFound() { + return /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "Not Found" }); +} +function SafeFragment(props) { + return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: props.children }); +} +function renderRouteNotFound(router, route, data) { + if (!route.options.notFoundComponent) { + if (router.options.defaultNotFoundComponent) { + return /* @__PURE__ */ jsxRuntimeExports.jsx(router.options.defaultNotFoundComponent, { ...data }); + } + return /* @__PURE__ */ jsxRuntimeExports.jsx(DefaultGlobalNotFound, {}); + } + return /* @__PURE__ */ jsxRuntimeExports.jsx(route.options.notFoundComponent, { ...data }); +} +function ScriptOnce({ children }) { + const router = useRouter(); + return /* @__PURE__ */ jsxRuntimeExports.jsx( + "script", + { + nonce: router.options.ssr?.nonce, + dangerouslySetInnerHTML: { + __html: children + ";document.currentScript.remove()" + } + } + ); +} +function ScrollRestoration() { + const router = useRouter(); + if (!router.isScrollRestoring || false) { + return null; + } + if (typeof router.options.scrollRestoration === "function") { + const shouldRestore = router.options.scrollRestoration({ + location: router.latestLocation + }); + if (!shouldRestore) { + return null; + } + } + const getKey = router.options.getScrollRestorationKey || defaultGetScrollRestorationKey; + const userKey = getKey(router.latestLocation); + const resolvedKey = userKey !== defaultGetScrollRestorationKey(router.latestLocation) ? userKey : void 0; + const restoreScrollOptions = { + storageKey, + shouldScrollRestoration: true + }; + if (resolvedKey) { + restoreScrollOptions.key = resolvedKey; + } + return /* @__PURE__ */ jsxRuntimeExports.jsx( + ScriptOnce, + { + children: `(${restoreScroll.toString()})(${escapeHtml(JSON.stringify(restoreScrollOptions))})` + } + ); +} +function ClientOnly({ children, fallback = null }) { + return useHydrated() ? /* @__PURE__ */ jsxRuntimeExports.jsx(React2.Fragment, { children }) : /* @__PURE__ */ jsxRuntimeExports.jsx(React2.Fragment, { children: fallback }); +} +function useHydrated() { + return React2.useSyncExternalStore( + subscribe, + () => true, + () => false + ); +} +function subscribe() { + return () => { + }; +} +const Match = reactExports.memo(function MatchImpl({ + matchId +}) { + const router = useRouter(); + const matchState = useRouterState({ + select: (s) => { + const matchIndex = s.matches.findIndex((d) => d.id === matchId); + const match = s.matches[matchIndex]; + invariant( + match + ); + return { + routeId: match.routeId, + ssr: match.ssr, + _displayPending: match._displayPending, + resetKey: s.loadedAt, + parentRouteId: s.matches[matchIndex - 1]?.routeId + }; + }, + structuralSharing: true + }); + const route = router.routesById[matchState.routeId]; + const PendingComponent = route.options.pendingComponent ?? router.options.defaultPendingComponent; + const pendingElement = PendingComponent ? /* @__PURE__ */ jsxRuntimeExports.jsx(PendingComponent, {}) : null; + const routeErrorComponent = route.options.errorComponent ?? router.options.defaultErrorComponent; + const routeOnCatch = route.options.onCatch ?? router.options.defaultOnCatch; + const routeNotFoundComponent = route.isRoot ? ( + // If it's the root route, use the globalNotFound option, with fallback to the notFoundRoute's component + route.options.notFoundComponent ?? router.options.notFoundRoute?.options.component + ) : route.options.notFoundComponent; + const resolvedNoSsr = matchState.ssr === false || matchState.ssr === "data-only"; + const ResolvedSuspenseBoundary = ( + // If we're on the root route, allow forcefully wrapping in suspense + (!route.isRoot || route.options.wrapInSuspense || resolvedNoSsr) && (route.options.wrapInSuspense ?? PendingComponent ?? (route.options.errorComponent?.preload || resolvedNoSsr)) ? reactExports.Suspense : SafeFragment + ); + const ResolvedCatchBoundary = routeErrorComponent ? CatchBoundary : SafeFragment; + const ResolvedNotFoundBoundary = routeNotFoundComponent ? CatchNotFound : SafeFragment; + const ShellComponent = route.isRoot ? route.options.shellComponent ?? SafeFragment : SafeFragment; + return /* @__PURE__ */ jsxRuntimeExports.jsxs(ShellComponent, { children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx(matchContext.Provider, { value: matchId, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResolvedSuspenseBoundary, { fallback: pendingElement, children: /* @__PURE__ */ jsxRuntimeExports.jsx( + ResolvedCatchBoundary, + { + getResetKey: () => matchState.resetKey, + errorComponent: routeErrorComponent || ErrorComponent, + onCatch: (error, errorInfo) => { + if (isNotFound(error)) throw error; + routeOnCatch?.(error, errorInfo); + }, + children: /* @__PURE__ */ jsxRuntimeExports.jsx( + ResolvedNotFoundBoundary, + { + fallback: (error) => { + if (!routeNotFoundComponent || error.routeId && error.routeId !== matchState.routeId || !error.routeId && !route.isRoot) + throw error; + return reactExports.createElement(routeNotFoundComponent, error); + }, + children: resolvedNoSsr || matchState._displayPending ? /* @__PURE__ */ jsxRuntimeExports.jsx(ClientOnly, { fallback: pendingElement, children: /* @__PURE__ */ jsxRuntimeExports.jsx(MatchInner, { matchId }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(MatchInner, { matchId }) + } + ) + } + ) }) }), + matchState.parentRouteId === rootRouteId && router.options.scrollRestoration ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx(OnRendered, {}), + /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollRestoration, {}) + ] }) : null + ] }); +}); +function OnRendered() { + const router = useRouter(); + const prevLocationRef = reactExports.useRef( + void 0 + ); + return /* @__PURE__ */ jsxRuntimeExports.jsx( + "script", + { + suppressHydrationWarning: true, + ref: (el) => { + if (el && (prevLocationRef.current === void 0 || prevLocationRef.current.href !== router.latestLocation.href)) { + router.emit({ + type: "onRendered", + ...getLocationChangeInfo(router.state) + }); + prevLocationRef.current = router.latestLocation; + } + } + }, + router.latestLocation.state.__TSR_key + ); +} +const MatchInner = reactExports.memo(function MatchInnerImpl({ + matchId +}) { + const router = useRouter(); + const { match, key, routeId } = useRouterState({ + select: (s) => { + const match2 = s.matches.find((d) => d.id === matchId); + const routeId2 = match2.routeId; + const remountFn = router.routesById[routeId2].options.remountDeps ?? router.options.defaultRemountDeps; + const remountDeps = remountFn?.({ + routeId: routeId2, + loaderDeps: match2.loaderDeps, + params: match2._strictParams, + search: match2._strictSearch + }); + const key2 = remountDeps ? JSON.stringify(remountDeps) : void 0; + return { + key: key2, + routeId: routeId2, + match: { + id: match2.id, + status: match2.status, + error: match2.error, + invalid: match2.invalid, + _forcePending: match2._forcePending, + _displayPending: match2._displayPending + } + }; + }, + structuralSharing: true + }); + const route = router.routesById[routeId]; + const out = reactExports.useMemo(() => { + const Comp = route.options.component ?? router.options.defaultComponent; + if (Comp) { + return /* @__PURE__ */ jsxRuntimeExports.jsx(Comp, {}, key); + } + return /* @__PURE__ */ jsxRuntimeExports.jsx(Outlet, {}); + }, [key, route.options.component, router.options.defaultComponent]); + if (match._displayPending) { + throw router.getMatch(match.id)?._nonReactive.displayPendingPromise; + } + if (match._forcePending) { + throw router.getMatch(match.id)?._nonReactive.minPendingPromise; + } + if (match.status === "pending") { + const pendingMinMs = route.options.pendingMinMs ?? router.options.defaultPendingMinMs; + if (pendingMinMs) { + const routerMatch = router.getMatch(match.id); + if (routerMatch && !routerMatch._nonReactive.minPendingPromise) ; + } + throw router.getMatch(match.id)?._nonReactive.loadPromise; + } + if (match.status === "notFound") { + invariant(isNotFound(match.error)); + return renderRouteNotFound(router, route, match.error); + } + if (match.status === "redirected") { + invariant(isRedirect(match.error)); + throw router.getMatch(match.id)?._nonReactive.loadPromise; + } + if (match.status === "error") { + { + const RouteErrorComponent = (route.options.errorComponent ?? router.options.defaultErrorComponent) || ErrorComponent; + return /* @__PURE__ */ jsxRuntimeExports.jsx( + RouteErrorComponent, + { + error: match.error, + reset: void 0, + info: { + componentStack: "" + } + } + ); + } + } + return out; +}); +const Outlet = reactExports.memo(function OutletImpl() { + const router = useRouter(); + const matchId = reactExports.useContext(matchContext); + const routeId = useRouterState({ + select: (s) => s.matches.find((d) => d.id === matchId)?.routeId + }); + const route = router.routesById[routeId]; + const parentGlobalNotFound = useRouterState({ + select: (s) => { + const matches = s.matches; + const parentMatch = matches.find((d) => d.id === matchId); + invariant( + parentMatch + ); + return parentMatch.globalNotFound; + } + }); + const childMatchId = useRouterState({ + select: (s) => { + const matches = s.matches; + const index = matches.findIndex((d) => d.id === matchId); + return matches[index + 1]?.id; + } + }); + const pendingElement = router.options.defaultPendingComponent ? /* @__PURE__ */ jsxRuntimeExports.jsx(router.options.defaultPendingComponent, {}) : null; + if (parentGlobalNotFound) { + return renderRouteNotFound(router, route, void 0); + } + if (!childMatchId) { + return null; + } + const nextMatch = /* @__PURE__ */ jsxRuntimeExports.jsx(Match, { matchId: childMatchId }); + if (routeId === rootRouteId) { + return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: pendingElement, children: nextMatch }); + } + return nextMatch; +}); +function Matches() { + const router = useRouter(); + const rootRoute = router.routesById[rootRouteId]; + const PendingComponent = rootRoute.options.pendingComponent ?? router.options.defaultPendingComponent; + const pendingElement = PendingComponent ? /* @__PURE__ */ jsxRuntimeExports.jsx(PendingComponent, {}) : null; + const ResolvedSuspense = SafeFragment; + const inner = /* @__PURE__ */ jsxRuntimeExports.jsxs(ResolvedSuspense, { fallback: pendingElement, children: [ + false, + /* @__PURE__ */ jsxRuntimeExports.jsx(MatchesInner, {}) + ] }); + return router.options.InnerWrap ? /* @__PURE__ */ jsxRuntimeExports.jsx(router.options.InnerWrap, { children: inner }) : inner; +} +function MatchesInner() { + const router = useRouter(); + const matchId = useRouterState({ + select: (s) => { + return s.matches[0]?.id; + } + }); + const resetKey = useRouterState({ + select: (s) => s.loadedAt + }); + const matchComponent = matchId ? /* @__PURE__ */ jsxRuntimeExports.jsx(Match, { matchId }) : null; + return /* @__PURE__ */ jsxRuntimeExports.jsx(matchContext.Provider, { value: matchId, children: router.options.disableGlobalCatchBoundary ? matchComponent : /* @__PURE__ */ jsxRuntimeExports.jsx( + CatchBoundary, + { + getResetKey: () => resetKey, + errorComponent: ErrorComponent, + onCatch: (error) => { + warning(false, error.message || error.toString()); + }, + children: matchComponent + } + ) }); +} +function RouterContextProvider({ + router, + children, + ...rest +}) { + if (Object.keys(rest).length > 0) { + router.update({ + ...router.options, + ...rest, + context: { + ...router.options.context, + ...rest.context + } + }); + } + const routerContext2 = getRouterContext(); + const provider = /* @__PURE__ */ jsxRuntimeExports.jsx(routerContext2.Provider, { value: router, children }); + if (router.options.Wrap) { + return /* @__PURE__ */ jsxRuntimeExports.jsx(router.options.Wrap, { children: provider }); + } + return provider; +} +function RouterProvider({ router, ...rest }) { + return /* @__PURE__ */ jsxRuntimeExports.jsx(RouterContextProvider, { router, ...rest, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Matches, {}) }); +} +const renderRouterToStream = async ({ + request, + router, + responseHeaders, + children +}) => { + if (typeof ReactDOMServer.renderToReadableStream === "function") { + const stream = await ReactDOMServer.renderToReadableStream(children, { + signal: request.signal, + nonce: router.options.ssr?.nonce, + progressiveChunkSize: Number.POSITIVE_INFINITY + }); + if (isbot(request.headers.get("User-Agent"))) { + await stream.allReady; + } + const responseStream = transformReadableStreamWithRouter( + router, + stream + ); + return new Response(responseStream, { + status: router.state.statusCode, + headers: responseHeaders + }); + } + if (typeof ReactDOMServer.renderToPipeableStream === "function") { + const reactAppPassthrough = new PassThrough(); + try { + const pipeable = ReactDOMServer.renderToPipeableStream(children, { + nonce: router.options.ssr?.nonce, + progressiveChunkSize: Number.POSITIVE_INFINITY, + ...isbot(request.headers.get("User-Agent")) ? { + onAllReady() { + pipeable.pipe(reactAppPassthrough); + } + } : { + onShellReady() { + pipeable.pipe(reactAppPassthrough); + } + }, + onError: (error, info) => { + console.error("Error in renderToPipeableStream:", error, info); + if (!reactAppPassthrough.destroyed) { + reactAppPassthrough.destroy( + error instanceof Error ? error : new Error(String(error)) + ); + } + } + }); + } catch (e) { + console.error("Error in renderToPipeableStream:", e); + reactAppPassthrough.destroy(e instanceof Error ? e : new Error(String(e))); + } + const responseStream = transformPipeableStreamWithRouter( + router, + reactAppPassthrough + ); + return new Response(responseStream, { + status: router.state.statusCode, + headers: responseHeaders + }); + } + throw new Error( + "No renderToReadableStream or renderToPipeableStream found in react-dom/server. Ensure you are using a version of react-dom that supports streaming." + ); +}; +function useMatch(opts) { + const nearestMatchId = reactExports.useContext( + opts.from ? dummyMatchContext : matchContext + ); + const matchSelection = useRouterState({ + select: (state) => { + const match = state.matches.find( + (d) => opts.from ? opts.from === d.routeId : d.id === nearestMatchId + ); + invariant( + !((opts.shouldThrow ?? true) && !match), + `Could not find ${opts.from ? `an active match from "${opts.from}"` : "a nearest match!"}` + ); + if (match === void 0) { + return void 0; + } + return opts.select ? opts.select(match) : match; + }, + structuralSharing: opts.structuralSharing + }); + return matchSelection; +} +function useLoaderData(opts) { + return useMatch({ + from: opts.from, + strict: opts.strict, + structuralSharing: opts.structuralSharing, + select: (s) => { + return opts.select ? opts.select(s.loaderData) : s.loaderData; + } + }); +} +function useLoaderDeps(opts) { + const { select, ...rest } = opts; + return useMatch({ + ...rest, + select: (s) => { + return select ? select(s.loaderDeps) : s.loaderDeps; + } + }); +} +function useParams(opts) { + return useMatch({ + from: opts.from, + shouldThrow: opts.shouldThrow, + structuralSharing: opts.structuralSharing, + strict: opts.strict, + select: (match) => { + const params = opts.strict === false ? match.params : match._strictParams; + return opts.select ? opts.select(params) : params; + } + }); +} +function useSearch(opts) { + return useMatch({ + from: opts.from, + strict: opts.strict, + shouldThrow: opts.shouldThrow, + structuralSharing: opts.structuralSharing, + select: (match) => { + return opts.select ? opts.select(match.search) : match.search; + } + }); +} +function useNavigate(_defaultOpts) { + const router = useRouter(); + return reactExports.useCallback( + (options) => { + return router.navigate({ + ...options, + from: options.from ?? _defaultOpts?.from + }); + }, + [_defaultOpts?.from, router] + ); +} +function useLinkProps(options, forwardedRef) { + const router = useRouter(); + const innerRef = useForwardedRef(forwardedRef); + const { + // custom props + activeProps, + inactiveProps, + activeOptions, + to, + preload: userPreload, + preloadDelay: userPreloadDelay, + hashScrollIntoView, + replace, + startTransition, + resetScroll, + viewTransition, + // element props + children, + target, + disabled, + style, + className, + onClick, + onFocus, + onMouseEnter, + onMouseLeave, + onTouchStart, + ignoreBlocker, + // prevent these from being returned + params: _params, + search: _search, + hash: _hash, + state: _state, + mask: _mask, + reloadDocument: _reloadDocument, + unsafeRelative: _unsafeRelative, + from: _from, + _fromLocation, + ...propsSafeToSpread + } = options; + { + const safeInternal = isSafeInternal(to); + if (typeof to === "string" && !safeInternal && // Quick checks to avoid `new URL` in common internal-like cases + to.indexOf(":") > -1) { + try { + new URL(to); + if (isDangerousProtocol(to)) { + if (false) ; + return { + ...propsSafeToSpread, + ref: innerRef, + href: void 0, + ...children && { children }, + ...target && { target }, + ...disabled && { disabled }, + ...style && { style }, + ...className && { className } + }; + } + return { + ...propsSafeToSpread, + ref: innerRef, + href: to, + ...children && { children }, + ...target && { target }, + ...disabled && { disabled }, + ...style && { style }, + ...className && { className } + }; + } catch { + } + } + const next2 = router.buildLocation({ ...options, from: options.from }); + const hrefOptionPublicHref2 = next2.maskedLocation ? next2.maskedLocation.publicHref : next2.publicHref; + const hrefOptionExternal2 = next2.maskedLocation ? next2.maskedLocation.external : next2.external; + const hrefOption2 = getHrefOption( + hrefOptionPublicHref2, + hrefOptionExternal2, + router.history, + disabled + ); + const externalLink2 = (() => { + if (hrefOption2?.external) { + if (isDangerousProtocol(hrefOption2.href)) { + return void 0; + } + return hrefOption2.href; + } + if (safeInternal) return void 0; + if (typeof to === "string" && to.indexOf(":") > -1) { + try { + new URL(to); + if (isDangerousProtocol(to)) { + if (false) ; + return void 0; + } + return to; + } catch { + } + } + return void 0; + })(); + const isActive2 = (() => { + if (externalLink2) return false; + const currentLocation = router.state.location; + const exact = activeOptions?.exact ?? false; + if (exact) { + const testExact = exactPathTest( + currentLocation.pathname, + next2.pathname, + router.basepath + ); + if (!testExact) { + return false; + } + } else { + const currentPathSplit = removeTrailingSlash( + currentLocation.pathname, + router.basepath + ); + const nextPathSplit = removeTrailingSlash( + next2.pathname, + router.basepath + ); + const pathIsFuzzyEqual = currentPathSplit.startsWith(nextPathSplit) && (currentPathSplit.length === nextPathSplit.length || currentPathSplit[nextPathSplit.length] === "/"); + if (!pathIsFuzzyEqual) { + return false; + } + } + const includeSearch = activeOptions?.includeSearch ?? true; + if (includeSearch) { + if (currentLocation.search !== next2.search) { + const currentSearchEmpty = !currentLocation.search || typeof currentLocation.search === "object" && Object.keys(currentLocation.search).length === 0; + const nextSearchEmpty = !next2.search || typeof next2.search === "object" && Object.keys(next2.search).length === 0; + if (!(currentSearchEmpty && nextSearchEmpty)) { + const searchTest = deepEqual(currentLocation.search, next2.search, { + partial: !exact, + ignoreUndefined: !activeOptions?.explicitUndefined + }); + if (!searchTest) { + return false; + } + } + } + } + if (activeOptions?.includeHash) { + return false; + } + return true; + })(); + if (externalLink2) { + return { + ...propsSafeToSpread, + ref: innerRef, + href: externalLink2, + ...children && { children }, + ...target && { target }, + ...disabled && { disabled }, + ...style && { style }, + ...className && { className } + }; + } + const resolvedActiveProps2 = isActive2 ? functionalUpdate(activeProps, {}) ?? STATIC_ACTIVE_OBJECT : STATIC_EMPTY_OBJECT; + const resolvedInactiveProps2 = isActive2 ? STATIC_EMPTY_OBJECT : functionalUpdate(inactiveProps, {}) ?? STATIC_EMPTY_OBJECT; + const resolvedStyle2 = (() => { + const baseStyle = style; + const activeStyle = resolvedActiveProps2.style; + const inactiveStyle = resolvedInactiveProps2.style; + if (!baseStyle && !activeStyle && !inactiveStyle) { + return void 0; + } + if (baseStyle && !activeStyle && !inactiveStyle) { + return baseStyle; + } + if (!baseStyle && activeStyle && !inactiveStyle) { + return activeStyle; + } + if (!baseStyle && !activeStyle && inactiveStyle) { + return inactiveStyle; + } + return { + ...baseStyle, + ...activeStyle, + ...inactiveStyle + }; + })(); + const resolvedClassName2 = (() => { + const baseClassName = className; + const activeClassName = resolvedActiveProps2.className; + const inactiveClassName = resolvedInactiveProps2.className; + if (!baseClassName && !activeClassName && !inactiveClassName) { + return ""; + } + let out = ""; + if (baseClassName) { + out = baseClassName; + } + if (activeClassName) { + out = out ? `${out} ${activeClassName}` : activeClassName; + } + if (inactiveClassName) { + out = out ? `${out} ${inactiveClassName}` : inactiveClassName; + } + return out; + })(); + return { + ...propsSafeToSpread, + ...resolvedActiveProps2, + ...resolvedInactiveProps2, + href: hrefOption2?.href, + ref: innerRef, + disabled: !!disabled, + target, + ...resolvedStyle2 && { style: resolvedStyle2 }, + ...resolvedClassName2 && { className: resolvedClassName2 }, + ...disabled && STATIC_DISABLED_PROPS, + ...isActive2 && STATIC_ACTIVE_PROPS + }; + } +} +const STATIC_EMPTY_OBJECT = {}; +const STATIC_ACTIVE_OBJECT = { className: "active" }; +const STATIC_DISABLED_PROPS = { role: "link", "aria-disabled": true }; +const STATIC_ACTIVE_PROPS = { "data-status": "active", "aria-current": "page" }; +function getHrefOption(publicHref, external, history, disabled) { + if (disabled) return void 0; + if (external) { + return { href: publicHref, external: true }; + } + return { + href: history.createHref(publicHref) || "/", + external: false + }; +} +function isSafeInternal(to) { + if (typeof to !== "string") return false; + const zero = to.charCodeAt(0); + if (zero === 47) return to.charCodeAt(1) !== 47; + return zero === 46; +} +const Link = reactExports.forwardRef( + (props, ref) => { + const { _asChild, ...rest } = props; + const { type: _type, ...linkProps } = useLinkProps(rest, ref); + const children = typeof rest.children === "function" ? rest.children({ + isActive: linkProps["data-status"] === "active" + }) : rest.children; + if (!_asChild) { + const { disabled: _, ...rest2 } = linkProps; + return reactExports.createElement("a", rest2, children); + } + return reactExports.createElement(_asChild, linkProps, children); + } +); +class Route extends BaseRoute { + /** + * @deprecated Use the `createRoute` function instead. + */ + constructor(options) { + super(options); + this.useMatch = (opts) => { + return useMatch({ + select: opts?.select, + from: this.id, + structuralSharing: opts?.structuralSharing + }); + }; + this.useRouteContext = (opts) => { + return useMatch({ + ...opts, + from: this.id, + select: (d) => opts?.select ? opts.select(d.context) : d.context + }); + }; + this.useSearch = (opts) => { + return useSearch({ + select: opts?.select, + structuralSharing: opts?.structuralSharing, + from: this.id + }); + }; + this.useParams = (opts) => { + return useParams({ + select: opts?.select, + structuralSharing: opts?.structuralSharing, + from: this.id + }); + }; + this.useLoaderDeps = (opts) => { + return useLoaderDeps({ ...opts, from: this.id }); + }; + this.useLoaderData = (opts) => { + return useLoaderData({ ...opts, from: this.id }); + }; + this.useNavigate = () => { + return useNavigate({ from: this.fullPath }); + }; + this.Link = React2.forwardRef( + (props, ref) => { + return /* @__PURE__ */ jsxRuntimeExports.jsx(Link, { ref, from: this.fullPath, ...props }); + } + ); + this.$$typeof = /* @__PURE__ */ Symbol.for("react.memo"); + } +} +function createRoute(options) { + return new Route( + // TODO: Help us TypeChris, you're our only hope! + options + ); +} +class RootRoute extends BaseRootRoute { + /** + * @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead. + */ + constructor(options) { + super(options); + this.useMatch = (opts) => { + return useMatch({ + select: opts?.select, + from: this.id, + structuralSharing: opts?.structuralSharing + }); + }; + this.useRouteContext = (opts) => { + return useMatch({ + ...opts, + from: this.id, + select: (d) => opts?.select ? opts.select(d.context) : d.context + }); + }; + this.useSearch = (opts) => { + return useSearch({ + select: opts?.select, + structuralSharing: opts?.structuralSharing, + from: this.id + }); + }; + this.useParams = (opts) => { + return useParams({ + select: opts?.select, + structuralSharing: opts?.structuralSharing, + from: this.id + }); + }; + this.useLoaderDeps = (opts) => { + return useLoaderDeps({ ...opts, from: this.id }); + }; + this.useLoaderData = (opts) => { + return useLoaderData({ ...opts, from: this.id }); + }; + this.useNavigate = () => { + return useNavigate({ from: this.fullPath }); + }; + this.Link = React2.forwardRef( + (props, ref) => { + return /* @__PURE__ */ jsxRuntimeExports.jsx(Link, { ref, from: this.fullPath, ...props }); + } + ); + this.$$typeof = /* @__PURE__ */ Symbol.for("react.memo"); + } +} +function createRootRoute(options) { + return new RootRoute(options); +} +function createFileRoute(path) { + if (typeof path === "object") { + return new FileRoute(path, { + silent: true + }).createRoute(path); + } + return new FileRoute(path, { + silent: true + }).createRoute; +} +class FileRoute { + constructor(path, _opts) { + this.path = path; + this.createRoute = (options) => { + warning( + this.silent + ); + const route = createRoute(options); + route.isRoot = false; + return route; + }; + this.silent = _opts?.silent; + } +} +class LazyRoute { + constructor(opts) { + this.useMatch = (opts2) => { + return useMatch({ + select: opts2?.select, + from: this.options.id, + structuralSharing: opts2?.structuralSharing + }); + }; + this.useRouteContext = (opts2) => { + return useMatch({ + from: this.options.id, + select: (d) => opts2?.select ? opts2.select(d.context) : d.context + }); + }; + this.useSearch = (opts2) => { + return useSearch({ + select: opts2?.select, + structuralSharing: opts2?.structuralSharing, + from: this.options.id + }); + }; + this.useParams = (opts2) => { + return useParams({ + select: opts2?.select, + structuralSharing: opts2?.structuralSharing, + from: this.options.id + }); + }; + this.useLoaderDeps = (opts2) => { + return useLoaderDeps({ ...opts2, from: this.options.id }); + }; + this.useLoaderData = (opts2) => { + return useLoaderData({ ...opts2, from: this.options.id }); + }; + this.useNavigate = () => { + const router = useRouter(); + return useNavigate({ from: router.routesById[this.options.id].fullPath }); + }; + this.options = opts; + this.$$typeof = /* @__PURE__ */ Symbol.for("react.memo"); + } +} +function createLazyFileRoute(id) { + if (typeof id === "object") { + return new LazyRoute(id); + } + return (opts) => new LazyRoute({ id, ...opts }); +} +function lazyRouteComponent(importer, exportName) { + let loadPromise; + let comp; + let error; + let reload; + const load = () => { + if (!loadPromise) { + loadPromise = importer().then((res) => { + loadPromise = void 0; + comp = res[exportName]; + }).catch((err) => { + error = err; + if (isModuleNotFoundError(error)) { + if (error instanceof Error && typeof window !== "undefined" && typeof sessionStorage !== "undefined") { + const storageKey2 = `tanstack_router_reload:${error.message}`; + if (!sessionStorage.getItem(storageKey2)) { + sessionStorage.setItem(storageKey2, "1"); + reload = true; + } + } + } + }); + } + return loadPromise; + }; + const lazyComp = function Lazy(props) { + if (reload) { + window.location.reload(); + throw new Promise(() => { + }); + } + if (error) { + throw error; + } + if (!comp) { + if (reactUse) { + reactUse(load()); + } else { + throw load(); + } + } + return reactExports.createElement(comp, props); + }; + lazyComp.preload = load; + return lazyComp; +} +const createRouter = (options) => { + return new Router(options); +}; +class Router extends RouterCore { + constructor(options) { + super(options); + } +} +if (typeof globalThis !== "undefined") { + globalThis.createFileRoute = createFileRoute; + globalThis.createLazyFileRoute = createLazyFileRoute; +} else if (typeof window !== "undefined") { + window.createFileRoute = createFileRoute; + window.createLazyFileRoute = createLazyFileRoute; +} +function Asset({ + tag, + attrs, + children, + nonce +}) { + switch (tag) { + case "title": + return /* @__PURE__ */ jsxRuntimeExports.jsx("title", { ...attrs, suppressHydrationWarning: true, children }); + case "meta": + return /* @__PURE__ */ jsxRuntimeExports.jsx("meta", { ...attrs, suppressHydrationWarning: true }); + case "link": + return /* @__PURE__ */ jsxRuntimeExports.jsx("link", { ...attrs, nonce, suppressHydrationWarning: true }); + case "style": + return /* @__PURE__ */ jsxRuntimeExports.jsx( + "style", + { + ...attrs, + dangerouslySetInnerHTML: { __html: children }, + nonce + } + ); + case "script": + return /* @__PURE__ */ jsxRuntimeExports.jsx(Script, { attrs, children }); + default: + return null; + } +} +function Script({ + attrs, + children +}) { + useRouter(); + reactExports.useEffect(() => { + if (attrs?.src) { + const normSrc = (() => { + try { + const base = document.baseURI || window.location.href; + return new URL(attrs.src, base).href; + } catch { + return attrs.src; + } + })(); + const existingScript = Array.from( + document.querySelectorAll("script[src]") + ).find((el) => el.src === normSrc); + if (existingScript) { + return; + } + const script = document.createElement("script"); + for (const [key, value] of Object.entries(attrs)) { + if (key !== "suppressHydrationWarning" && value !== void 0 && value !== false) { + script.setAttribute( + key, + typeof value === "boolean" ? "" : String(value) + ); + } + } + document.head.appendChild(script); + return () => { + if (script.parentNode) { + script.parentNode.removeChild(script); + } + }; + } + if (typeof children === "string") { + const typeAttr = typeof attrs?.type === "string" ? attrs.type : "text/javascript"; + const nonceAttr = typeof attrs?.nonce === "string" ? attrs.nonce : void 0; + const existingScript = Array.from( + document.querySelectorAll("script:not([src])") + ).find((el) => { + if (!(el instanceof HTMLScriptElement)) return false; + const sType = el.getAttribute("type") ?? "text/javascript"; + const sNonce = el.getAttribute("nonce") ?? void 0; + return el.textContent === children && sType === typeAttr && sNonce === nonceAttr; + }); + if (existingScript) { + return; + } + const script = document.createElement("script"); + script.textContent = children; + if (attrs) { + for (const [key, value] of Object.entries(attrs)) { + if (key !== "suppressHydrationWarning" && value !== void 0 && value !== false) { + script.setAttribute( + key, + typeof value === "boolean" ? "" : String(value) + ); + } + } + } + document.head.appendChild(script); + return () => { + if (script.parentNode) { + script.parentNode.removeChild(script); + } + }; + } + return void 0; + }, [attrs, children]); + if (attrs?.src && typeof attrs.src === "string") { + return /* @__PURE__ */ jsxRuntimeExports.jsx("script", { ...attrs, suppressHydrationWarning: true }); + } + if (typeof children === "string") { + return /* @__PURE__ */ jsxRuntimeExports.jsx( + "script", + { + ...attrs, + dangerouslySetInnerHTML: { __html: children }, + suppressHydrationWarning: true + } + ); + } + return null; +} +const useTags = () => { + const router = useRouter(); + const nonce = router.options.ssr?.nonce; + const routeMeta = useRouterState({ + select: (state) => { + return state.matches.map((match) => match.meta).filter(Boolean); + } + }); + const meta = reactExports.useMemo(() => { + const resultMeta = []; + const metaByAttribute = {}; + let title; + for (let i = routeMeta.length - 1; i >= 0; i--) { + const metas = routeMeta[i]; + for (let j = metas.length - 1; j >= 0; j--) { + const m = metas[j]; + if (!m) continue; + if (m.title) { + if (!title) { + title = { + tag: "title", + children: m.title + }; + } + } else if ("script:ld+json" in m) { + try { + const json = JSON.stringify(m["script:ld+json"]); + resultMeta.push({ + tag: "script", + attrs: { + type: "application/ld+json" + }, + children: escapeHtml(json) + }); + } catch { + } + } else { + const attribute = m.name ?? m.property; + if (attribute) { + if (metaByAttribute[attribute]) { + continue; + } else { + metaByAttribute[attribute] = true; + } + } + resultMeta.push({ + tag: "meta", + attrs: { + ...m, + nonce + } + }); + } + } + } + if (title) { + resultMeta.push(title); + } + if (nonce) { + resultMeta.push({ + tag: "meta", + attrs: { + property: "csp-nonce", + content: nonce + } + }); + } + resultMeta.reverse(); + return resultMeta; + }, [routeMeta, nonce]); + const links = useRouterState({ + select: (state) => { + const constructed = state.matches.map((match) => match.links).filter(Boolean).flat(1).map((link) => ({ + tag: "link", + attrs: { + ...link, + nonce + } + })); + const manifest = router.ssr?.manifest; + const assets = state.matches.map((match) => manifest?.routes[match.routeId]?.assets ?? []).filter(Boolean).flat(1).filter((asset) => asset.tag === "link").map( + (asset) => ({ + tag: "link", + attrs: { + ...asset.attrs, + suppressHydrationWarning: true, + nonce + } + }) + ); + return [...constructed, ...assets]; + }, + structuralSharing: true + }); + const preloadLinks = useRouterState({ + select: (state) => { + const preloadLinks2 = []; + state.matches.map((match) => router.looseRoutesById[match.routeId]).forEach( + (route) => router.ssr?.manifest?.routes[route.id]?.preloads?.filter(Boolean).forEach((preload) => { + preloadLinks2.push({ + tag: "link", + attrs: { + rel: "modulepreload", + href: preload, + nonce + } + }); + }) + ); + return preloadLinks2; + }, + structuralSharing: true + }); + const styles = useRouterState({ + select: (state) => state.matches.map((match) => match.styles).flat(1).filter(Boolean).map(({ children, ...attrs }) => ({ + tag: "style", + attrs: { + ...attrs, + nonce + }, + children + })), + structuralSharing: true + }); + const headScripts = useRouterState({ + select: (state) => state.matches.map((match) => match.headScripts).flat(1).filter(Boolean).map(({ children, ...script }) => ({ + tag: "script", + attrs: { + ...script, + nonce + }, + children + })), + structuralSharing: true + }); + return uniqBy( + [ + ...meta, + ...preloadLinks, + ...links, + ...styles, + ...headScripts + ], + (d) => { + return JSON.stringify(d); + } + ); +}; +function uniqBy(arr, fn) { + const seen = /* @__PURE__ */ new Set(); + return arr.filter((item) => { + const key = fn(item); + if (seen.has(key)) { + return false; + } + seen.add(key); + return true; + }); +} +function HeadContent() { + const tags = useTags(); + const router = useRouter(); + const nonce = router.options.ssr?.nonce; + return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: tags.map((tag) => /* @__PURE__ */ reactExports.createElement(Asset, { ...tag, key: `tsr-meta-${JSON.stringify(tag)}`, nonce })) }); +} +const Scripts = () => { + const router = useRouter(); + const nonce = router.options.ssr?.nonce; + const assetScripts = useRouterState({ + select: (state) => { + const assetScripts2 = []; + const manifest = router.ssr?.manifest; + if (!manifest) { + return []; + } + state.matches.map((match) => router.looseRoutesById[match.routeId]).forEach( + (route) => manifest.routes[route.id]?.assets?.filter((d) => d.tag === "script").forEach((asset) => { + assetScripts2.push({ + tag: "script", + attrs: { ...asset.attrs, nonce }, + children: asset.children + }); + }) + ); + return assetScripts2; + }, + structuralSharing: true + }); + const { scripts } = useRouterState({ + select: (state) => ({ + scripts: state.matches.map((match) => match.scripts).flat(1).filter(Boolean).map(({ children, ...script }) => ({ + tag: "script", + attrs: { + ...script, + suppressHydrationWarning: true, + nonce + }, + children + })) + }), + structuralSharing: true + }); + let serverBufferedScript = void 0; + if (router.serverSsr) { + serverBufferedScript = router.serverSsr.takeBufferedScripts(); + } + const allScripts = [...scripts, ...assetScripts]; + if (serverBufferedScript) { + allScripts.unshift(serverBufferedScript); + } + return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: allScripts.map((asset, i) => /* @__PURE__ */ reactExports.createElement(Asset, { ...asset, key: `tsr-scripts-${asset.tag}-${i}` })) }); +}; +export { + HeadContent as H, + RouterProvider as R, + Scripts as S, + createRootRoute as a, + createFileRoute as b, + createRouter as c, + lazyRouteComponent as l, + renderRouterToStream as r, + useNavigate as u +}; diff --git a/apps/admin/.output/server/_chunks/_libs/@tanstack/react-store.mjs b/apps/admin/.output/server/_chunks/_libs/@tanstack/react-store.mjs new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/apps/admin/.output/server/_chunks/_libs/@tanstack/react-store.mjs @@ -0,0 +1 @@ + diff --git a/apps/admin/.output/server/_chunks/_libs/@tanstack/router-core.mjs b/apps/admin/.output/server/_chunks/_libs/@tanstack/router-core.mjs new file mode 100644 index 00000000..2930f7ce --- /dev/null +++ b/apps/admin/.output/server/_chunks/_libs/@tanstack/router-core.mjs @@ -0,0 +1,4773 @@ +import { s as splitSetCookieString } from "../../../_libs/cookie-es.mjs"; +import { p as parseHref } from "./history.mjs"; +import { i as invariant } from "../../../_libs/tiny-invariant.mjs"; +import { n as ni, t as te, c as cn, m as mn } from "../../../_libs/seroval.mjs"; +import { p } from "../../../_libs/seroval-plugins.mjs"; +import { ReadableStream as ReadableStream$1 } from "node:stream/web"; +import { Readable } from "node:stream"; +function toHeadersInstance(init) { + if (init instanceof Headers) { + return init; + } else if (Array.isArray(init)) { + return new Headers(init); + } else if (typeof init === "object") { + return new Headers(init); + } else { + return null; + } +} +function mergeHeaders(...headers) { + return headers.reduce((acc, header) => { + const headersInstance = toHeadersInstance(header); + if (!headersInstance) return acc; + for (const [key, value] of headersInstance.entries()) { + if (key === "set-cookie") { + const splitCookies = splitSetCookieString(value); + splitCookies.forEach((cookie) => acc.append("set-cookie", cookie)); + } else { + acc.set(key, value); + } + } + return acc; + }, new Headers()); +} +const isServer = true; +function batch(fn) { + { + return fn(); + } +} +function isNotFound(obj) { + return !!obj?.isNotFound; +} +function last(arr) { + return arr[arr.length - 1]; +} +function isFunction(d) { + return typeof d === "function"; +} +function functionalUpdate(updater, previous) { + if (isFunction(updater)) { + return updater(previous); + } + return updater; +} +function replaceEqualDeep(prev, _next, _depth = 0) { + { + return _next; + } +} +function isPlainObject(o) { + if (!hasObjectPrototype(o)) { + return false; + } + const ctor = o.constructor; + if (typeof ctor === "undefined") { + return true; + } + const prot = ctor.prototype; + if (!hasObjectPrototype(prot)) { + return false; + } + if (!prot.hasOwnProperty("isPrototypeOf")) { + return false; + } + return true; +} +function hasObjectPrototype(o) { + return Object.prototype.toString.call(o) === "[object Object]"; +} +function deepEqual(a, b, opts) { + if (a === b) { + return true; + } + if (typeof a !== typeof b) { + return false; + } + if (Array.isArray(a) && Array.isArray(b)) { + if (a.length !== b.length) return false; + for (let i = 0, l = a.length; i < l; i++) { + if (!deepEqual(a[i], b[i], opts)) return false; + } + return true; + } + if (isPlainObject(a) && isPlainObject(b)) { + const ignoreUndefined = opts?.ignoreUndefined ?? true; + if (opts?.partial) { + for (const k in b) { + if (!ignoreUndefined || b[k] !== void 0) { + if (!deepEqual(a[k], b[k], opts)) return false; + } + } + return true; + } + let aCount = 0; + if (!ignoreUndefined) { + aCount = Object.keys(a).length; + } else { + for (const k in a) { + if (a[k] !== void 0) aCount++; + } + } + let bCount = 0; + for (const k in b) { + if (!ignoreUndefined || b[k] !== void 0) { + bCount++; + if (bCount > aCount || !deepEqual(a[k], b[k], opts)) return false; + } + } + return aCount === bCount; + } + return false; +} +function createControlledPromise(onResolve) { + let resolveLoadPromise; + let rejectLoadPromise; + const controlledPromise = new Promise((resolve, reject) => { + resolveLoadPromise = resolve; + rejectLoadPromise = reject; + }); + controlledPromise.status = "pending"; + controlledPromise.resolve = (value) => { + controlledPromise.status = "resolved"; + controlledPromise.value = value; + resolveLoadPromise(value); + onResolve?.(value); + }; + controlledPromise.reject = (e) => { + controlledPromise.status = "rejected"; + rejectLoadPromise(e); + }; + return controlledPromise; +} +function isModuleNotFoundError(error) { + if (typeof error?.message !== "string") return false; + return error.message.startsWith("Failed to fetch dynamically imported module") || error.message.startsWith("error loading dynamically imported module") || error.message.startsWith("Importing a module script failed"); +} +function isPromise(value) { + return Boolean( + value && typeof value === "object" && typeof value.then === "function" + ); +} +function sanitizePathSegment(segment) { + return segment.replace(/[\x00-\x1f\x7f]/g, ""); +} +function decodeSegment(segment) { + let decoded; + try { + decoded = decodeURI(segment); + } catch { + decoded = segment.replaceAll(/%[0-9A-F]{2}/gi, (match) => { + try { + return decodeURI(match); + } catch { + return match; + } + }); + } + return sanitizePathSegment(decoded); +} +const SAFE_URL_PROTOCOLS = ["http:", "https:", "mailto:", "tel:"]; +function isDangerousProtocol(url) { + if (!url) return false; + try { + const parsed = new URL(url); + return !SAFE_URL_PROTOCOLS.includes(parsed.protocol); + } catch { + return false; + } +} +const HTML_ESCAPE_LOOKUP = { + "&": "\\u0026", + ">": "\\u003e", + "<": "\\u003c", + "\u2028": "\\u2028", + "\u2029": "\\u2029" +}; +const HTML_ESCAPE_REGEX = /[&><\u2028\u2029]/g; +function escapeHtml(str) { + return str.replace(HTML_ESCAPE_REGEX, (match) => HTML_ESCAPE_LOOKUP[match]); +} +function decodePath(path, decodeIgnore) { + if (!path) return path; + if (!/[%\\\x00-\x1f\x7f]/.test(path) && !path.startsWith("//")) { + return path; + } + const re = /%25|%5C/gi; + let cursor = 0; + let result = ""; + let match; + while (null !== (match = re.exec(path))) { + result += decodeSegment(path.slice(cursor, match.index)) + match[0]; + cursor = re.lastIndex; + } + result = result + decodeSegment(cursor ? path.slice(cursor) : path); + if (result.startsWith("//")) { + result = "/" + result.replace(/^\/+/, ""); + } + return result; +} +function encodePathLikeUrl(path) { + if (!/\s|[^\u0000-\u007F]/.test(path)) return path; + return path.replace(/\s|[^\u0000-\u007F]/gu, encodeURIComponent); +} +function createLRUCache(max) { + const cache = /* @__PURE__ */ new Map(); + let oldest; + let newest; + const touch = (entry) => { + if (!entry.next) return; + if (!entry.prev) { + entry.next.prev = void 0; + oldest = entry.next; + entry.next = void 0; + if (newest) { + entry.prev = newest; + newest.next = entry; + } + } else { + entry.prev.next = entry.next; + entry.next.prev = entry.prev; + entry.next = void 0; + if (newest) { + newest.next = entry; + entry.prev = newest; + } + } + newest = entry; + }; + return { + get(key) { + const entry = cache.get(key); + if (!entry) return void 0; + touch(entry); + return entry.value; + }, + set(key, value) { + if (cache.size >= max && oldest) { + const toDelete = oldest; + cache.delete(toDelete.key); + if (toDelete.next) { + oldest = toDelete.next; + toDelete.next.prev = void 0; + } + if (toDelete === newest) { + newest = void 0; + } + } + const existing = cache.get(key); + if (existing) { + existing.value = value; + touch(existing); + } else { + const entry = { key, value, prev: newest }; + if (newest) newest.next = entry; + newest = entry; + if (!oldest) oldest = entry; + cache.set(key, entry); + } + }, + clear() { + cache.clear(); + oldest = void 0; + newest = void 0; + } + }; +} +const SEGMENT_TYPE_PATHNAME = 0; +const SEGMENT_TYPE_PARAM = 1; +const SEGMENT_TYPE_WILDCARD = 2; +const SEGMENT_TYPE_OPTIONAL_PARAM = 3; +const SEGMENT_TYPE_INDEX = 4; +const SEGMENT_TYPE_PATHLESS = 5; +function getOpenAndCloseBraces(part) { + const openBrace = part.indexOf("{"); + if (openBrace === -1) return null; + const closeBrace = part.indexOf("}", openBrace); + if (closeBrace === -1) return null; + const afterOpen = openBrace + 1; + if (afterOpen >= part.length) return null; + return [openBrace, closeBrace]; +} +function parseSegment(path, start, output = new Uint16Array(6)) { + const next = path.indexOf("/", start); + const end = next === -1 ? path.length : next; + const part = path.substring(start, end); + if (!part || !part.includes("$")) { + output[0] = SEGMENT_TYPE_PATHNAME; + output[1] = start; + output[2] = start; + output[3] = end; + output[4] = end; + output[5] = end; + return output; + } + if (part === "$") { + const total = path.length; + output[0] = SEGMENT_TYPE_WILDCARD; + output[1] = start; + output[2] = start; + output[3] = total; + output[4] = total; + output[5] = total; + return output; + } + if (part.charCodeAt(0) === 36) { + output[0] = SEGMENT_TYPE_PARAM; + output[1] = start; + output[2] = start + 1; + output[3] = end; + output[4] = end; + output[5] = end; + return output; + } + const braces = getOpenAndCloseBraces(part); + if (braces) { + const [openBrace, closeBrace] = braces; + const firstChar = part.charCodeAt(openBrace + 1); + if (firstChar === 45) { + if (openBrace + 2 < part.length && part.charCodeAt(openBrace + 2) === 36) { + const paramStart = openBrace + 3; + const paramEnd = closeBrace; + if (paramStart < paramEnd) { + output[0] = SEGMENT_TYPE_OPTIONAL_PARAM; + output[1] = start + openBrace; + output[2] = start + paramStart; + output[3] = start + paramEnd; + output[4] = start + closeBrace + 1; + output[5] = end; + return output; + } + } + } else if (firstChar === 36) { + const dollarPos = openBrace + 1; + const afterDollar = openBrace + 2; + if (afterDollar === closeBrace) { + output[0] = SEGMENT_TYPE_WILDCARD; + output[1] = start + openBrace; + output[2] = start + dollarPos; + output[3] = start + afterDollar; + output[4] = start + closeBrace + 1; + output[5] = path.length; + return output; + } + output[0] = SEGMENT_TYPE_PARAM; + output[1] = start + openBrace; + output[2] = start + afterDollar; + output[3] = start + closeBrace; + output[4] = start + closeBrace + 1; + output[5] = end; + return output; + } + } + output[0] = SEGMENT_TYPE_PATHNAME; + output[1] = start; + output[2] = start; + output[3] = end; + output[4] = end; + output[5] = end; + return output; +} +function parseSegments(defaultCaseSensitive, data, route, start, node, depth, onRoute) { + onRoute?.(route); + let cursor = start; + { + const path = route.fullPath ?? route.from; + const length = path.length; + const caseSensitive = route.options?.caseSensitive ?? defaultCaseSensitive; + const skipOnParamError = !!(route.options?.params?.parse && route.options?.skipRouteOnParseError?.params); + while (cursor < length) { + const segment = parseSegment(path, cursor, data); + let nextNode; + const start2 = cursor; + const end = segment[5]; + cursor = end + 1; + depth++; + const kind = segment[0]; + switch (kind) { + case SEGMENT_TYPE_PATHNAME: { + const value = path.substring(segment[2], segment[3]); + if (caseSensitive) { + const existingNode = node.static?.get(value); + if (existingNode) { + nextNode = existingNode; + } else { + node.static ??= /* @__PURE__ */ new Map(); + const next = createStaticNode( + route.fullPath ?? route.from + ); + next.parent = node; + next.depth = depth; + nextNode = next; + node.static.set(value, next); + } + } else { + const name = value.toLowerCase(); + const existingNode = node.staticInsensitive?.get(name); + if (existingNode) { + nextNode = existingNode; + } else { + node.staticInsensitive ??= /* @__PURE__ */ new Map(); + const next = createStaticNode( + route.fullPath ?? route.from + ); + next.parent = node; + next.depth = depth; + nextNode = next; + node.staticInsensitive.set(name, next); + } + } + break; + } + case SEGMENT_TYPE_PARAM: { + const prefix_raw = path.substring(start2, segment[1]); + const suffix_raw = path.substring(segment[4], end); + const actuallyCaseSensitive = caseSensitive && !!(prefix_raw || suffix_raw); + const prefix = !prefix_raw ? void 0 : actuallyCaseSensitive ? prefix_raw : prefix_raw.toLowerCase(); + const suffix = !suffix_raw ? void 0 : actuallyCaseSensitive ? suffix_raw : suffix_raw.toLowerCase(); + const existingNode = !skipOnParamError && node.dynamic?.find( + (s) => !s.skipOnParamError && s.caseSensitive === actuallyCaseSensitive && s.prefix === prefix && s.suffix === suffix + ); + if (existingNode) { + nextNode = existingNode; + } else { + const next = createDynamicNode( + SEGMENT_TYPE_PARAM, + route.fullPath ?? route.from, + actuallyCaseSensitive, + prefix, + suffix + ); + nextNode = next; + next.depth = depth; + next.parent = node; + node.dynamic ??= []; + node.dynamic.push(next); + } + break; + } + case SEGMENT_TYPE_OPTIONAL_PARAM: { + const prefix_raw = path.substring(start2, segment[1]); + const suffix_raw = path.substring(segment[4], end); + const actuallyCaseSensitive = caseSensitive && !!(prefix_raw || suffix_raw); + const prefix = !prefix_raw ? void 0 : actuallyCaseSensitive ? prefix_raw : prefix_raw.toLowerCase(); + const suffix = !suffix_raw ? void 0 : actuallyCaseSensitive ? suffix_raw : suffix_raw.toLowerCase(); + const existingNode = !skipOnParamError && node.optional?.find( + (s) => !s.skipOnParamError && s.caseSensitive === actuallyCaseSensitive && s.prefix === prefix && s.suffix === suffix + ); + if (existingNode) { + nextNode = existingNode; + } else { + const next = createDynamicNode( + SEGMENT_TYPE_OPTIONAL_PARAM, + route.fullPath ?? route.from, + actuallyCaseSensitive, + prefix, + suffix + ); + nextNode = next; + next.parent = node; + next.depth = depth; + node.optional ??= []; + node.optional.push(next); + } + break; + } + case SEGMENT_TYPE_WILDCARD: { + const prefix_raw = path.substring(start2, segment[1]); + const suffix_raw = path.substring(segment[4], end); + const actuallyCaseSensitive = caseSensitive && !!(prefix_raw || suffix_raw); + const prefix = !prefix_raw ? void 0 : actuallyCaseSensitive ? prefix_raw : prefix_raw.toLowerCase(); + const suffix = !suffix_raw ? void 0 : actuallyCaseSensitive ? suffix_raw : suffix_raw.toLowerCase(); + const next = createDynamicNode( + SEGMENT_TYPE_WILDCARD, + route.fullPath ?? route.from, + actuallyCaseSensitive, + prefix, + suffix + ); + nextNode = next; + next.parent = node; + next.depth = depth; + node.wildcard ??= []; + node.wildcard.push(next); + } + } + node = nextNode; + } + if (skipOnParamError && route.children && !route.isRoot && route.id && route.id.charCodeAt(route.id.lastIndexOf("/") + 1) === 95) { + const pathlessNode = createStaticNode( + route.fullPath ?? route.from + ); + pathlessNode.kind = SEGMENT_TYPE_PATHLESS; + pathlessNode.parent = node; + depth++; + pathlessNode.depth = depth; + node.pathless ??= []; + node.pathless.push(pathlessNode); + node = pathlessNode; + } + const isLeaf = (route.path || !route.children) && !route.isRoot; + if (isLeaf && path.endsWith("/")) { + const indexNode = createStaticNode( + route.fullPath ?? route.from + ); + indexNode.kind = SEGMENT_TYPE_INDEX; + indexNode.parent = node; + depth++; + indexNode.depth = depth; + node.index = indexNode; + node = indexNode; + } + node.parse = route.options?.params?.parse ?? null; + node.skipOnParamError = skipOnParamError; + node.parsingPriority = route.options?.skipRouteOnParseError?.priority ?? 0; + if (isLeaf && !node.route) { + node.route = route; + node.fullPath = route.fullPath ?? route.from; + } + } + if (route.children) + for (const child of route.children) { + parseSegments( + defaultCaseSensitive, + data, + child, + cursor, + node, + depth, + onRoute + ); + } +} +function sortDynamic(a, b) { + if (a.skipOnParamError && !b.skipOnParamError) return -1; + if (!a.skipOnParamError && b.skipOnParamError) return 1; + if (a.skipOnParamError && b.skipOnParamError && (a.parsingPriority || b.parsingPriority)) + return b.parsingPriority - a.parsingPriority; + if (a.prefix && b.prefix && a.prefix !== b.prefix) { + if (a.prefix.startsWith(b.prefix)) return -1; + if (b.prefix.startsWith(a.prefix)) return 1; + } + if (a.suffix && b.suffix && a.suffix !== b.suffix) { + if (a.suffix.endsWith(b.suffix)) return -1; + if (b.suffix.endsWith(a.suffix)) return 1; + } + if (a.prefix && !b.prefix) return -1; + if (!a.prefix && b.prefix) return 1; + if (a.suffix && !b.suffix) return -1; + if (!a.suffix && b.suffix) return 1; + if (a.caseSensitive && !b.caseSensitive) return -1; + if (!a.caseSensitive && b.caseSensitive) return 1; + return 0; +} +function sortTreeNodes(node) { + if (node.pathless) { + for (const child of node.pathless) { + sortTreeNodes(child); + } + } + if (node.static) { + for (const child of node.static.values()) { + sortTreeNodes(child); + } + } + if (node.staticInsensitive) { + for (const child of node.staticInsensitive.values()) { + sortTreeNodes(child); + } + } + if (node.dynamic?.length) { + node.dynamic.sort(sortDynamic); + for (const child of node.dynamic) { + sortTreeNodes(child); + } + } + if (node.optional?.length) { + node.optional.sort(sortDynamic); + for (const child of node.optional) { + sortTreeNodes(child); + } + } + if (node.wildcard?.length) { + node.wildcard.sort(sortDynamic); + for (const child of node.wildcard) { + sortTreeNodes(child); + } + } +} +function createStaticNode(fullPath) { + return { + kind: SEGMENT_TYPE_PATHNAME, + depth: 0, + pathless: null, + index: null, + static: null, + staticInsensitive: null, + dynamic: null, + optional: null, + wildcard: null, + route: null, + fullPath, + parent: null, + parse: null, + skipOnParamError: false, + parsingPriority: 0 + }; +} +function createDynamicNode(kind, fullPath, caseSensitive, prefix, suffix) { + return { + kind, + depth: 0, + pathless: null, + index: null, + static: null, + staticInsensitive: null, + dynamic: null, + optional: null, + wildcard: null, + route: null, + fullPath, + parent: null, + parse: null, + skipOnParamError: false, + parsingPriority: 0, + caseSensitive, + prefix, + suffix + }; +} +function processRouteMasks(routeList, processedTree) { + const segmentTree = createStaticNode("/"); + const data = new Uint16Array(6); + for (const route of routeList) { + parseSegments(false, data, route, 1, segmentTree, 0); + } + sortTreeNodes(segmentTree); + processedTree.masksTree = segmentTree; + processedTree.flatCache = createLRUCache(1e3); +} +function findFlatMatch(path, processedTree) { + path ||= "/"; + const cached = processedTree.flatCache.get(path); + if (cached) return cached; + const result = findMatch(path, processedTree.masksTree); + processedTree.flatCache.set(path, result); + return result; +} +function findSingleMatch(from, caseSensitive, fuzzy, path, processedTree) { + from ||= "/"; + path ||= "/"; + const key = caseSensitive ? `case\0${from}` : from; + let tree = processedTree.singleCache.get(key); + if (!tree) { + tree = createStaticNode("/"); + const data = new Uint16Array(6); + parseSegments(caseSensitive, data, { from }, 1, tree, 0); + processedTree.singleCache.set(key, tree); + } + return findMatch(path, tree, fuzzy); +} +function findRouteMatch(path, processedTree, fuzzy = false) { + const key = fuzzy ? path : `nofuzz\0${path}`; + const cached = processedTree.matchCache.get(key); + if (cached !== void 0) return cached; + path ||= "/"; + let result; + try { + result = findMatch( + path, + processedTree.segmentTree, + fuzzy + ); + } catch (err) { + if (err instanceof URIError) { + result = null; + } else { + throw err; + } + } + if (result) result.branch = buildRouteBranch(result.route); + processedTree.matchCache.set(key, result); + return result; +} +function trimPathRight$1(path) { + return path === "/" ? path : path.replace(/\/{1,}$/, ""); +} +function processRouteTree(routeTree, caseSensitive = false, initRoute) { + const segmentTree = createStaticNode(routeTree.fullPath); + const data = new Uint16Array(6); + const routesById = {}; + const routesByPath = {}; + let index = 0; + parseSegments(caseSensitive, data, routeTree, 1, segmentTree, 0, (route) => { + initRoute?.(route, index); + invariant( + !(route.id in routesById), + `Duplicate routes found with id: ${String(route.id)}` + ); + routesById[route.id] = route; + if (index !== 0 && route.path) { + const trimmedFullPath = trimPathRight$1(route.fullPath); + if (!routesByPath[trimmedFullPath] || route.fullPath.endsWith("/")) { + routesByPath[trimmedFullPath] = route; + } + } + index++; + }); + sortTreeNodes(segmentTree); + const processedTree = { + segmentTree, + singleCache: createLRUCache(1e3), + matchCache: createLRUCache(1e3), + flatCache: null, + masksTree: null + }; + return { + processedTree, + routesById, + routesByPath + }; +} +function findMatch(path, segmentTree, fuzzy = false) { + const parts = path.split("/"); + const leaf = getNodeMatch(path, parts, segmentTree, fuzzy); + if (!leaf) return null; + const [rawParams] = extractParams(path, parts, leaf); + return { + route: leaf.node.route, + rawParams, + parsedParams: leaf.parsedParams + }; +} +function extractParams(path, parts, leaf) { + const list = buildBranch(leaf.node); + let nodeParts = null; + const rawParams = {}; + let partIndex = leaf.extract?.part ?? 0; + let nodeIndex = leaf.extract?.node ?? 0; + let pathIndex = leaf.extract?.path ?? 0; + let segmentCount = leaf.extract?.segment ?? 0; + for (; nodeIndex < list.length; partIndex++, nodeIndex++, pathIndex++, segmentCount++) { + const node = list[nodeIndex]; + if (node.kind === SEGMENT_TYPE_INDEX) break; + if (node.kind === SEGMENT_TYPE_PATHLESS) { + segmentCount--; + partIndex--; + pathIndex--; + continue; + } + const part = parts[partIndex]; + const currentPathIndex = pathIndex; + if (part) pathIndex += part.length; + if (node.kind === SEGMENT_TYPE_PARAM) { + nodeParts ??= leaf.node.fullPath.split("/"); + const nodePart = nodeParts[segmentCount]; + const preLength = node.prefix?.length ?? 0; + const isCurlyBraced = nodePart.charCodeAt(preLength) === 123; + if (isCurlyBraced) { + const sufLength = node.suffix?.length ?? 0; + const name = nodePart.substring( + preLength + 2, + nodePart.length - sufLength - 1 + ); + const value = part.substring(preLength, part.length - sufLength); + rawParams[name] = decodeURIComponent(value); + } else { + const name = nodePart.substring(1); + rawParams[name] = decodeURIComponent(part); + } + } else if (node.kind === SEGMENT_TYPE_OPTIONAL_PARAM) { + if (leaf.skipped & 1 << nodeIndex) { + partIndex--; + pathIndex = currentPathIndex - 1; + continue; + } + nodeParts ??= leaf.node.fullPath.split("/"); + const nodePart = nodeParts[segmentCount]; + const preLength = node.prefix?.length ?? 0; + const sufLength = node.suffix?.length ?? 0; + const name = nodePart.substring( + preLength + 3, + nodePart.length - sufLength - 1 + ); + const value = node.suffix || node.prefix ? part.substring(preLength, part.length - sufLength) : part; + if (value) rawParams[name] = decodeURIComponent(value); + } else if (node.kind === SEGMENT_TYPE_WILDCARD) { + const n = node; + const value = path.substring( + currentPathIndex + (n.prefix?.length ?? 0), + path.length - (n.suffix?.length ?? 0) + ); + const splat = decodeURIComponent(value); + rawParams["*"] = splat; + rawParams._splat = splat; + break; + } + } + if (leaf.rawParams) Object.assign(rawParams, leaf.rawParams); + return [ + rawParams, + { + part: partIndex, + node: nodeIndex, + path: pathIndex, + segment: segmentCount + } + ]; +} +function buildRouteBranch(route) { + const list = [route]; + while (route.parentRoute) { + route = route.parentRoute; + list.push(route); + } + list.reverse(); + return list; +} +function buildBranch(node) { + const list = Array(node.depth + 1); + do { + list[node.depth] = node; + node = node.parent; + } while (node); + return list; +} +function getNodeMatch(path, parts, segmentTree, fuzzy) { + if (path === "/" && segmentTree.index) + return { node: segmentTree.index, skipped: 0 }; + const trailingSlash = !last(parts); + const pathIsIndex = trailingSlash && path !== "/"; + const partsLength = parts.length - (trailingSlash ? 1 : 0); + const stack = [ + { + node: segmentTree, + index: 1, + skipped: 0, + depth: 1, + statics: 1, + dynamics: 0, + optionals: 0 + } + ]; + let wildcardMatch = null; + let bestFuzzy = null; + let bestMatch = null; + while (stack.length) { + const frame = stack.pop(); + const { node, index, skipped, depth, statics, dynamics, optionals } = frame; + let { extract, rawParams, parsedParams } = frame; + if (node.skipOnParamError) { + const result = validateMatchParams(path, parts, frame); + if (!result) continue; + rawParams = frame.rawParams; + extract = frame.extract; + parsedParams = frame.parsedParams; + } + if (fuzzy && node.route && node.kind !== SEGMENT_TYPE_INDEX && isFrameMoreSpecific(bestFuzzy, frame)) { + bestFuzzy = frame; + } + const isBeyondPath = index === partsLength; + if (isBeyondPath) { + if (node.route && !pathIsIndex && isFrameMoreSpecific(bestMatch, frame)) { + bestMatch = frame; + } + if (!node.optional && !node.wildcard && !node.index && !node.pathless) + continue; + } + const part = isBeyondPath ? void 0 : parts[index]; + let lowerPart; + if (isBeyondPath && node.index) { + const indexFrame = { + node: node.index, + index, + skipped, + depth: depth + 1, + statics, + dynamics, + optionals, + extract, + rawParams, + parsedParams + }; + let indexValid = true; + if (node.index.skipOnParamError) { + const result = validateMatchParams(path, parts, indexFrame); + if (!result) indexValid = false; + } + if (indexValid) { + if (statics === partsLength && !dynamics && !optionals && !skipped) { + return indexFrame; + } + if (isFrameMoreSpecific(bestMatch, indexFrame)) { + bestMatch = indexFrame; + } + } + } + if (node.wildcard && isFrameMoreSpecific(wildcardMatch, frame)) { + for (const segment of node.wildcard) { + const { prefix, suffix } = segment; + if (prefix) { + if (isBeyondPath) continue; + const casePart = segment.caseSensitive ? part : lowerPart ??= part.toLowerCase(); + if (!casePart.startsWith(prefix)) continue; + } + if (suffix) { + if (isBeyondPath) continue; + const end = parts.slice(index).join("/").slice(-suffix.length); + const casePart = segment.caseSensitive ? end : end.toLowerCase(); + if (casePart !== suffix) continue; + } + const frame2 = { + node: segment, + index: partsLength, + skipped, + depth, + statics, + dynamics, + optionals, + extract, + rawParams, + parsedParams + }; + if (segment.skipOnParamError) { + const result = validateMatchParams(path, parts, frame2); + if (!result) continue; + } + wildcardMatch = frame2; + break; + } + } + if (node.optional) { + const nextSkipped = skipped | 1 << depth; + const nextDepth = depth + 1; + for (let i = node.optional.length - 1; i >= 0; i--) { + const segment = node.optional[i]; + stack.push({ + node: segment, + index, + skipped: nextSkipped, + depth: nextDepth, + statics, + dynamics, + optionals, + extract, + rawParams, + parsedParams + }); + } + if (!isBeyondPath) { + for (let i = node.optional.length - 1; i >= 0; i--) { + const segment = node.optional[i]; + const { prefix, suffix } = segment; + if (prefix || suffix) { + const casePart = segment.caseSensitive ? part : lowerPart ??= part.toLowerCase(); + if (prefix && !casePart.startsWith(prefix)) continue; + if (suffix && !casePart.endsWith(suffix)) continue; + } + stack.push({ + node: segment, + index: index + 1, + skipped, + depth: nextDepth, + statics, + dynamics, + optionals: optionals + 1, + extract, + rawParams, + parsedParams + }); + } + } + } + if (!isBeyondPath && node.dynamic && part) { + for (let i = node.dynamic.length - 1; i >= 0; i--) { + const segment = node.dynamic[i]; + const { prefix, suffix } = segment; + if (prefix || suffix) { + const casePart = segment.caseSensitive ? part : lowerPart ??= part.toLowerCase(); + if (prefix && !casePart.startsWith(prefix)) continue; + if (suffix && !casePart.endsWith(suffix)) continue; + } + stack.push({ + node: segment, + index: index + 1, + skipped, + depth: depth + 1, + statics, + dynamics: dynamics + 1, + optionals, + extract, + rawParams, + parsedParams + }); + } + } + if (!isBeyondPath && node.staticInsensitive) { + const match = node.staticInsensitive.get( + lowerPart ??= part.toLowerCase() + ); + if (match) { + stack.push({ + node: match, + index: index + 1, + skipped, + depth: depth + 1, + statics: statics + 1, + dynamics, + optionals, + extract, + rawParams, + parsedParams + }); + } + } + if (!isBeyondPath && node.static) { + const match = node.static.get(part); + if (match) { + stack.push({ + node: match, + index: index + 1, + skipped, + depth: depth + 1, + statics: statics + 1, + dynamics, + optionals, + extract, + rawParams, + parsedParams + }); + } + } + if (node.pathless) { + const nextDepth = depth + 1; + for (let i = node.pathless.length - 1; i >= 0; i--) { + const segment = node.pathless[i]; + stack.push({ + node: segment, + index, + skipped, + depth: nextDepth, + statics, + dynamics, + optionals, + extract, + rawParams, + parsedParams + }); + } + } + } + if (bestMatch && wildcardMatch) { + return isFrameMoreSpecific(wildcardMatch, bestMatch) ? bestMatch : wildcardMatch; + } + if (bestMatch) return bestMatch; + if (wildcardMatch) return wildcardMatch; + if (fuzzy && bestFuzzy) { + let sliceIndex = bestFuzzy.index; + for (let i = 0; i < bestFuzzy.index; i++) { + sliceIndex += parts[i].length; + } + const splat = sliceIndex === path.length ? "/" : path.slice(sliceIndex); + bestFuzzy.rawParams ??= {}; + bestFuzzy.rawParams["**"] = decodeURIComponent(splat); + return bestFuzzy; + } + return null; +} +function validateMatchParams(path, parts, frame) { + try { + const [rawParams, state] = extractParams(path, parts, frame); + frame.rawParams = rawParams; + frame.extract = state; + const parsed = frame.node.parse(rawParams); + frame.parsedParams = Object.assign({}, frame.parsedParams, parsed); + return true; + } catch { + return null; + } +} +function isFrameMoreSpecific(prev, next) { + if (!prev) return true; + return next.statics > prev.statics || next.statics === prev.statics && (next.dynamics > prev.dynamics || next.dynamics === prev.dynamics && (next.optionals > prev.optionals || next.optionals === prev.optionals && ((next.node.kind === SEGMENT_TYPE_INDEX) > (prev.node.kind === SEGMENT_TYPE_INDEX) || next.node.kind === SEGMENT_TYPE_INDEX === (prev.node.kind === SEGMENT_TYPE_INDEX) && next.depth > prev.depth))); +} +function joinPaths(paths) { + return cleanPath( + paths.filter((val) => { + return val !== void 0; + }).join("/") + ); +} +function cleanPath(path) { + return path.replace(/\/{2,}/g, "/"); +} +function trimPathLeft(path) { + return path === "/" ? path : path.replace(/^\/{1,}/, ""); +} +function trimPathRight(path) { + const len = path.length; + return len > 1 && path[len - 1] === "/" ? path.replace(/\/{1,}$/, "") : path; +} +function trimPath(path) { + return trimPathRight(trimPathLeft(path)); +} +function removeTrailingSlash(value, basepath) { + if (value?.endsWith("/") && value !== "/" && value !== `${basepath}/`) { + return value.slice(0, -1); + } + return value; +} +function exactPathTest(pathName1, pathName2, basepath) { + return removeTrailingSlash(pathName1, basepath) === removeTrailingSlash(pathName2, basepath); +} +function resolvePath({ + base, + to, + trailingSlash = "never", + cache +}) { + const isAbsolute = to.startsWith("/"); + const isBase = !isAbsolute && to === "."; + let key; + if (cache) { + key = isAbsolute ? to : isBase ? base : base + "\0" + to; + const cached = cache.get(key); + if (cached) return cached; + } + let baseSegments; + if (isBase) { + baseSegments = base.split("/"); + } else if (isAbsolute) { + baseSegments = to.split("/"); + } else { + baseSegments = base.split("/"); + while (baseSegments.length > 1 && last(baseSegments) === "") { + baseSegments.pop(); + } + const toSegments = to.split("/"); + for (let index = 0, length = toSegments.length; index < length; index++) { + const value = toSegments[index]; + if (value === "") { + if (!index) { + baseSegments = [value]; + } else if (index === length - 1) { + baseSegments.push(value); + } else ; + } else if (value === "..") { + baseSegments.pop(); + } else if (value === ".") ; + else { + baseSegments.push(value); + } + } + } + if (baseSegments.length > 1) { + if (last(baseSegments) === "") { + if (trailingSlash === "never") { + baseSegments.pop(); + } + } else if (trailingSlash === "always") { + baseSegments.push(""); + } + } + let segment; + let joined = ""; + for (let i = 0; i < baseSegments.length; i++) { + if (i > 0) joined += "/"; + const part = baseSegments[i]; + if (!part) continue; + segment = parseSegment(part, 0, segment); + const kind = segment[0]; + if (kind === SEGMENT_TYPE_PATHNAME) { + joined += part; + continue; + } + const end = segment[5]; + const prefix = part.substring(0, segment[1]); + const suffix = part.substring(segment[4], end); + const value = part.substring(segment[2], segment[3]); + if (kind === SEGMENT_TYPE_PARAM) { + joined += prefix || suffix ? `${prefix}{$${value}}${suffix}` : `$${value}`; + } else if (kind === SEGMENT_TYPE_WILDCARD) { + joined += prefix || suffix ? `${prefix}{$}${suffix}` : "$"; + } else { + joined += `${prefix}{-$${value}}${suffix}`; + } + } + joined = cleanPath(joined); + const result = joined || "/"; + if (key && cache) cache.set(key, result); + return result; +} +function compileDecodeCharMap(pathParamsAllowedCharacters) { + const charMap = new Map( + pathParamsAllowedCharacters.map((char) => [encodeURIComponent(char), char]) + ); + const pattern = Array.from(charMap.keys()).map((key) => key.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|"); + const regex = new RegExp(pattern, "g"); + return (encoded) => encoded.replace(regex, (match) => charMap.get(match) ?? match); +} +function encodeParam(key, params, decoder) { + const value = params[key]; + if (typeof value !== "string") return value; + if (key === "_splat") { + if (/^[a-zA-Z0-9\-._~!/]*$/.test(value)) return value; + return value.split("/").map((segment) => encodePathParam(segment, decoder)).join("/"); + } else { + return encodePathParam(value, decoder); + } +} +function interpolatePath({ + path, + params, + decoder, + server +}) { + let isMissingParams = false; + const usedParams = {}; + if (!path || path === "/") + return { interpolatedPath: "/", usedParams, isMissingParams }; + if (!path.includes("$")) + return { interpolatedPath: path, usedParams, isMissingParams }; + { + if (path.indexOf("{") === -1) { + const length2 = path.length; + let cursor2 = 0; + let joined2 = ""; + while (cursor2 < length2) { + while (cursor2 < length2 && path.charCodeAt(cursor2) === 47) cursor2++; + if (cursor2 >= length2) break; + const start = cursor2; + let end = path.indexOf("/", cursor2); + if (end === -1) end = length2; + cursor2 = end; + const part = path.substring(start, end); + if (!part) continue; + if (part.charCodeAt(0) === 36) { + if (part.length === 1) { + const splat = params._splat; + usedParams._splat = splat; + usedParams["*"] = splat; + if (!splat) { + isMissingParams = true; + continue; + } + const value = encodeParam("_splat", params, decoder); + joined2 += "/" + value; + } else { + const key = part.substring(1); + if (!isMissingParams && !(key in params)) { + isMissingParams = true; + } + usedParams[key] = params[key]; + const value = encodeParam(key, params, decoder) ?? "undefined"; + joined2 += "/" + value; + } + } else { + joined2 += "/" + part; + } + } + if (path.endsWith("/")) joined2 += "/"; + const interpolatedPath2 = joined2 || "/"; + return { usedParams, interpolatedPath: interpolatedPath2, isMissingParams }; + } + } + const length = path.length; + let cursor = 0; + let segment; + let joined = ""; + while (cursor < length) { + const start = cursor; + segment = parseSegment(path, start, segment); + const end = segment[5]; + cursor = end + 1; + if (start === end) continue; + const kind = segment[0]; + if (kind === SEGMENT_TYPE_PATHNAME) { + joined += "/" + path.substring(start, end); + continue; + } + if (kind === SEGMENT_TYPE_WILDCARD) { + const splat = params._splat; + usedParams._splat = splat; + usedParams["*"] = splat; + const prefix = path.substring(start, segment[1]); + const suffix = path.substring(segment[4], end); + if (!splat) { + isMissingParams = true; + if (prefix || suffix) { + joined += "/" + prefix + suffix; + } + continue; + } + const value = encodeParam("_splat", params, decoder); + joined += "/" + prefix + value + suffix; + continue; + } + if (kind === SEGMENT_TYPE_PARAM) { + const key = path.substring(segment[2], segment[3]); + if (!isMissingParams && !(key in params)) { + isMissingParams = true; + } + usedParams[key] = params[key]; + const prefix = path.substring(start, segment[1]); + const suffix = path.substring(segment[4], end); + const value = encodeParam(key, params, decoder) ?? "undefined"; + joined += "/" + prefix + value + suffix; + continue; + } + if (kind === SEGMENT_TYPE_OPTIONAL_PARAM) { + const key = path.substring(segment[2], segment[3]); + const valueRaw = params[key]; + if (valueRaw == null) continue; + usedParams[key] = valueRaw; + const prefix = path.substring(start, segment[1]); + const suffix = path.substring(segment[4], end); + const value = encodeParam(key, params, decoder) ?? ""; + joined += "/" + prefix + value + suffix; + continue; + } + } + if (path.endsWith("/")) joined += "/"; + const interpolatedPath = joined || "/"; + return { usedParams, interpolatedPath, isMissingParams }; +} +function encodePathParam(value, decoder) { + const encoded = encodeURIComponent(value); + return decoder?.(encoded) ?? encoded; +} +function getSafeSessionStorage() { + try { + if (typeof window !== "undefined" && typeof window.sessionStorage === "object") { + return window.sessionStorage; + } + } catch { + } + return void 0; +} +const storageKey = "tsr-scroll-restoration-v1_3"; +function createScrollRestorationCache() { + const safeSessionStorage = getSafeSessionStorage(); + if (!safeSessionStorage) { + return null; + } + const persistedState = safeSessionStorage.getItem(storageKey); + let state = persistedState ? JSON.parse(persistedState) : {}; + return { + state, + // This setter is simply to make sure that we set the sessionStorage right + // after the state is updated. It doesn't necessarily need to be a functional + // update. + set: (updater) => { + state = functionalUpdate(updater, state) || state; + try { + safeSessionStorage.setItem(storageKey, JSON.stringify(state)); + } catch { + console.warn( + "[ts-router] Could not persist scroll restoration state to sessionStorage." + ); + } + } + }; +} +createScrollRestorationCache(); +const defaultGetScrollRestorationKey = (location) => { + return location.state.__TSR_key || location.href; +}; +function restoreScroll({ + storageKey: storageKey2, + key, + behavior, + shouldScrollRestoration, + scrollToTopSelectors, + location +}) { + let byKey; + try { + byKey = JSON.parse(sessionStorage.getItem(storageKey2) || "{}"); + } catch (error) { + console.error(error); + return; + } + const resolvedKey = key || window.history.state?.__TSR_key; + const elementEntries = byKey[resolvedKey]; + scroll: { + if (shouldScrollRestoration && elementEntries && Object.keys(elementEntries).length > 0) { + for (const elementSelector in elementEntries) { + const entry = elementEntries[elementSelector]; + if (elementSelector === "window") { + window.scrollTo({ + top: entry.scrollY, + left: entry.scrollX, + behavior + }); + } else if (elementSelector) { + const element = document.querySelector(elementSelector); + if (element) { + element.scrollLeft = entry.scrollX; + element.scrollTop = entry.scrollY; + } + } + } + break scroll; + } + const hash = (location ?? window.location).hash.split("#", 2)[1]; + if (hash) { + const hashScrollIntoViewOptions = window.history.state?.__hashScrollIntoViewOptions ?? true; + if (hashScrollIntoViewOptions) { + const el = document.getElementById(hash); + if (el) { + el.scrollIntoView(hashScrollIntoViewOptions); + } + } + break scroll; + } + const scrollOptions = { top: 0, left: 0, behavior }; + window.scrollTo(scrollOptions); + if (scrollToTopSelectors) { + for (const selector of scrollToTopSelectors) { + if (selector === "window") continue; + const element = typeof selector === "function" ? selector() : document.querySelector(selector); + if (element) element.scrollTo(scrollOptions); + } + } + } +} +function encode(obj, stringify = String) { + const result = new URLSearchParams(); + for (const key in obj) { + const val = obj[key]; + if (val !== void 0) { + result.set(key, stringify(val)); + } + } + return result.toString(); +} +function toValue(str) { + if (!str) return ""; + if (str === "false") return false; + if (str === "true") return true; + return +str * 0 === 0 && +str + "" === str ? +str : str; +} +function decode(str) { + const searchParams = new URLSearchParams(str); + const result = {}; + for (const [key, value] of searchParams.entries()) { + const previousValue = result[key]; + if (previousValue == null) { + result[key] = toValue(value); + } else if (Array.isArray(previousValue)) { + previousValue.push(toValue(value)); + } else { + result[key] = [previousValue, toValue(value)]; + } + } + return result; +} +const defaultParseSearch = parseSearchWith(JSON.parse); +const defaultStringifySearch = stringifySearchWith( + JSON.stringify, + JSON.parse +); +function parseSearchWith(parser) { + return (searchStr) => { + if (searchStr[0] === "?") { + searchStr = searchStr.substring(1); + } + const query = decode(searchStr); + for (const key in query) { + const value = query[key]; + if (typeof value === "string") { + try { + query[key] = parser(value); + } catch (_err) { + } + } + } + return query; + }; +} +function stringifySearchWith(stringify, parser) { + const hasParser = typeof parser === "function"; + function stringifyValue(val) { + if (typeof val === "object" && val !== null) { + try { + return stringify(val); + } catch (_err) { + } + } else if (hasParser && typeof val === "string") { + try { + parser(val); + return stringify(val); + } catch (_err) { + } + } + return val; + } + return (search) => { + const searchStr = encode(search, stringifyValue); + return searchStr ? `?${searchStr}` : ""; + }; +} +const rootRouteId = "__root__"; +function redirect(opts) { + opts.statusCode = opts.statusCode || opts.code || 307; + if (!opts._builtLocation && typeof opts.href === "string" && isDangerousProtocol(opts.href)) { + throw new Error( + `Redirect blocked: unsafe protocol in href "${opts.href}". Only ${SAFE_URL_PROTOCOLS.join(", ")} protocols are allowed.` + ); + } + if (!opts._builtLocation && !opts.reloadDocument && typeof opts.href === "string") { + try { + new URL(opts.href); + opts.reloadDocument = true; + } catch { + } + } + const headers = new Headers(opts.headers); + if (opts.href && headers.get("Location") === null) { + headers.set("Location", opts.href); + } + const response = new Response(null, { + status: opts.statusCode, + headers + }); + response.options = opts; + if (opts.throw) { + throw response; + } + return response; +} +function isRedirect(obj) { + return obj instanceof Response && !!obj.options; +} +function isResolvedRedirect(obj) { + return isRedirect(obj) && !!obj.options.href; +} +const triggerOnReady = (inner) => { + if (!inner.rendered) { + inner.rendered = true; + return inner.onReady?.(); + } +}; +const resolvePreload = (inner, matchId) => { + return !!(inner.preload && !inner.router.state.matches.some((d) => d.id === matchId)); +}; +const buildMatchContext = (inner, index, includeCurrentMatch = true) => { + const context = { + ...inner.router.options.context ?? {} + }; + const end = includeCurrentMatch ? index : index - 1; + for (let i = 0; i <= end; i++) { + const innerMatch = inner.matches[i]; + if (!innerMatch) continue; + const m = inner.router.getMatch(innerMatch.id); + if (!m) continue; + Object.assign(context, m.__routeContext, m.__beforeLoadContext); + } + return context; +}; +const _handleNotFound = (inner, err) => { + const routeCursor = inner.router.routesById[err.routeId ?? ""] ?? inner.router.routeTree; + if (!routeCursor.options.notFoundComponent && inner.router.options?.defaultNotFoundComponent) { + routeCursor.options.notFoundComponent = inner.router.options.defaultNotFoundComponent; + } + invariant( + routeCursor.options.notFoundComponent + ); + const matchForRoute = inner.matches.find((m) => m.routeId === routeCursor.id); + invariant(matchForRoute, "Could not find match for route: " + routeCursor.id); + inner.updateMatch(matchForRoute.id, (prev) => ({ + ...prev, + status: "notFound", + error: err, + isFetching: false + })); + if (err.routerCode === "BEFORE_LOAD" && routeCursor.parentRoute) { + err.routeId = routeCursor.parentRoute.id; + _handleNotFound(inner, err); + } +}; +const handleRedirectAndNotFound = (inner, match, err) => { + if (!isRedirect(err) && !isNotFound(err)) return; + if (isRedirect(err) && err.redirectHandled && !err.options.reloadDocument) { + throw err; + } + if (match) { + match._nonReactive.beforeLoadPromise?.resolve(); + match._nonReactive.loaderPromise?.resolve(); + match._nonReactive.beforeLoadPromise = void 0; + match._nonReactive.loaderPromise = void 0; + const status = isRedirect(err) ? "redirected" : "notFound"; + match._nonReactive.error = err; + inner.updateMatch(match.id, (prev) => ({ + ...prev, + status, + context: buildMatchContext(inner, match.index), + isFetching: false, + error: err + })); + if (isNotFound(err) && !err.routeId) { + err.routeId = match.routeId; + } + match._nonReactive.loadPromise?.resolve(); + } + if (isRedirect(err)) { + inner.rendered = true; + err.options._fromLocation = inner.location; + err.redirectHandled = true; + err = inner.router.resolveRedirect(err); + throw err; + } else { + _handleNotFound(inner, err); + throw err; + } +}; +const shouldSkipLoader = (inner, matchId) => { + const match = inner.router.getMatch(matchId); + if (match.ssr === false) { + return true; + } + return false; +}; +const handleSerialError = (inner, index, err, routerCode) => { + const { id: matchId, routeId } = inner.matches[index]; + const route = inner.router.looseRoutesById[routeId]; + if (err instanceof Promise) { + throw err; + } + err.routerCode = routerCode; + inner.firstBadMatchIndex ??= index; + handleRedirectAndNotFound(inner, inner.router.getMatch(matchId), err); + try { + route.options.onError?.(err); + } catch (errorHandlerErr) { + err = errorHandlerErr; + handleRedirectAndNotFound(inner, inner.router.getMatch(matchId), err); + } + inner.updateMatch(matchId, (prev) => { + prev._nonReactive.beforeLoadPromise?.resolve(); + prev._nonReactive.beforeLoadPromise = void 0; + prev._nonReactive.loadPromise?.resolve(); + return { + ...prev, + error: err, + status: "error", + isFetching: false, + updatedAt: Date.now(), + abortController: new AbortController() + }; + }); +}; +const isBeforeLoadSsr = (inner, matchId, index, route) => { + const existingMatch = inner.router.getMatch(matchId); + const parentMatchId = inner.matches[index - 1]?.id; + const parentMatch = parentMatchId ? inner.router.getMatch(parentMatchId) : void 0; + if (inner.router.isShell()) { + existingMatch.ssr = route.id === rootRouteId; + return; + } + if (parentMatch?.ssr === false) { + existingMatch.ssr = false; + return; + } + const parentOverride = (tempSsr2) => { + if (tempSsr2 === true && parentMatch?.ssr === "data-only") { + return "data-only"; + } + return tempSsr2; + }; + const defaultSsr = inner.router.options.defaultSsr ?? true; + if (route.options.ssr === void 0) { + existingMatch.ssr = parentOverride(defaultSsr); + return; + } + if (typeof route.options.ssr !== "function") { + existingMatch.ssr = parentOverride(route.options.ssr); + return; + } + const { search, params } = existingMatch; + const ssrFnContext = { + search: makeMaybe(search, existingMatch.searchError), + params: makeMaybe(params, existingMatch.paramsError), + location: inner.location, + matches: inner.matches.map((match) => ({ + index: match.index, + pathname: match.pathname, + fullPath: match.fullPath, + staticData: match.staticData, + id: match.id, + routeId: match.routeId, + search: makeMaybe(match.search, match.searchError), + params: makeMaybe(match.params, match.paramsError), + ssr: match.ssr + })) + }; + const tempSsr = route.options.ssr(ssrFnContext); + if (isPromise(tempSsr)) { + return tempSsr.then((ssr) => { + existingMatch.ssr = parentOverride(ssr ?? defaultSsr); + }); + } + existingMatch.ssr = parentOverride(tempSsr ?? defaultSsr); + return; +}; +const setupPendingTimeout = (inner, matchId, route, match) => { + if (match._nonReactive.pendingTimeout !== void 0) return; + route.options.pendingMs ?? inner.router.options.defaultPendingMs; + !!(inner.onReady && false); +}; +const preBeforeLoadSetup = (inner, matchId, route) => { + const existingMatch = inner.router.getMatch(matchId); + if (!existingMatch._nonReactive.beforeLoadPromise && !existingMatch._nonReactive.loaderPromise) + return; + setupPendingTimeout(inner, matchId, route, existingMatch); + const then = () => { + const match = inner.router.getMatch(matchId); + if (match.preload && (match.status === "redirected" || match.status === "notFound")) { + handleRedirectAndNotFound(inner, match, match.error); + } + }; + return existingMatch._nonReactive.beforeLoadPromise ? existingMatch._nonReactive.beforeLoadPromise.then(then) : then(); +}; +const executeBeforeLoad = (inner, matchId, index, route) => { + const match = inner.router.getMatch(matchId); + const prevLoadPromise = match._nonReactive.loadPromise; + match._nonReactive.loadPromise = createControlledPromise(() => { + prevLoadPromise?.resolve(); + }); + const { paramsError, searchError } = match; + if (paramsError) { + handleSerialError(inner, index, paramsError, "PARSE_PARAMS"); + } + if (searchError) { + handleSerialError(inner, index, searchError, "VALIDATE_SEARCH"); + } + setupPendingTimeout(inner, matchId, route, match); + const abortController = new AbortController(); + let isPending = false; + const pending = () => { + if (isPending) return; + isPending = true; + inner.updateMatch(matchId, (prev) => ({ + ...prev, + isFetching: "beforeLoad", + fetchCount: prev.fetchCount + 1, + abortController + // Note: We intentionally don't update context here. + // Context should only be updated after beforeLoad resolves to avoid + // components seeing incomplete context during async beforeLoad execution. + })); + }; + const resolve = () => { + match._nonReactive.beforeLoadPromise?.resolve(); + match._nonReactive.beforeLoadPromise = void 0; + inner.updateMatch(matchId, (prev) => ({ + ...prev, + isFetching: false + })); + }; + if (!route.options.beforeLoad) { + batch(() => { + pending(); + resolve(); + }); + return; + } + match._nonReactive.beforeLoadPromise = createControlledPromise(); + const context = { + ...buildMatchContext(inner, index, false), + ...match.__routeContext + }; + const { search, params, cause } = match; + const preload = resolvePreload(inner, matchId); + const beforeLoadFnContext = { + search, + abortController, + params, + preload, + context, + location: inner.location, + navigate: (opts) => inner.router.navigate({ + ...opts, + _fromLocation: inner.location + }), + buildLocation: inner.router.buildLocation, + cause: preload ? "preload" : cause, + matches: inner.matches, + ...inner.router.options.additionalContext + }; + const updateContext = (beforeLoadContext2) => { + if (beforeLoadContext2 === void 0) { + batch(() => { + pending(); + resolve(); + }); + return; + } + if (isRedirect(beforeLoadContext2) || isNotFound(beforeLoadContext2)) { + pending(); + handleSerialError(inner, index, beforeLoadContext2, "BEFORE_LOAD"); + } + batch(() => { + pending(); + inner.updateMatch(matchId, (prev) => ({ + ...prev, + __beforeLoadContext: beforeLoadContext2 + })); + resolve(); + }); + }; + let beforeLoadContext; + try { + beforeLoadContext = route.options.beforeLoad(beforeLoadFnContext); + if (isPromise(beforeLoadContext)) { + pending(); + return beforeLoadContext.catch((err) => { + handleSerialError(inner, index, err, "BEFORE_LOAD"); + }).then(updateContext); + } + } catch (err) { + pending(); + handleSerialError(inner, index, err, "BEFORE_LOAD"); + } + updateContext(beforeLoadContext); + return; +}; +const handleBeforeLoad = (inner, index) => { + const { id: matchId, routeId } = inner.matches[index]; + const route = inner.router.looseRoutesById[routeId]; + const serverSsr = () => { + { + const maybePromise = isBeforeLoadSsr(inner, matchId, index, route); + if (isPromise(maybePromise)) return maybePromise.then(queueExecution); + } + return queueExecution(); + }; + const execute = () => executeBeforeLoad(inner, matchId, index, route); + const queueExecution = () => { + if (shouldSkipLoader(inner, matchId)) return; + const result = preBeforeLoadSetup(inner, matchId, route); + return isPromise(result) ? result.then(execute) : execute(); + }; + return serverSsr(); +}; +const executeHead = (inner, matchId, route) => { + const match = inner.router.getMatch(matchId); + if (!match) { + return; + } + if (!route.options.head && !route.options.scripts && !route.options.headers) { + return; + } + const assetContext = { + ssr: inner.router.options.ssr, + matches: inner.matches, + match, + params: match.params, + loaderData: match.loaderData + }; + return Promise.all([ + route.options.head?.(assetContext), + route.options.scripts?.(assetContext), + route.options.headers?.(assetContext) + ]).then(([headFnContent, scripts, headers]) => { + const meta = headFnContent?.meta; + const links = headFnContent?.links; + const headScripts = headFnContent?.scripts; + const styles = headFnContent?.styles; + return { + meta, + links, + headScripts, + headers, + scripts, + styles + }; + }); +}; +const getLoaderContext = (inner, matchId, index, route) => { + const parentMatchPromise = inner.matchPromises[index - 1]; + const { params, loaderDeps, abortController, cause } = inner.router.getMatch(matchId); + const context = buildMatchContext(inner, index); + const preload = resolvePreload(inner, matchId); + return { + params, + deps: loaderDeps, + preload: !!preload, + parentMatchPromise, + abortController, + context, + location: inner.location, + navigate: (opts) => inner.router.navigate({ + ...opts, + _fromLocation: inner.location + }), + cause: preload ? "preload" : cause, + route, + ...inner.router.options.additionalContext + }; +}; +const runLoader = async (inner, matchId, index, route) => { + try { + const match = inner.router.getMatch(matchId); + try { + if (!(isServer ?? inner.router.isServer) || match.ssr === true) { + loadRouteChunk(route); + } + const loaderResult = route.options.loader?.( + getLoaderContext(inner, matchId, index, route) + ); + const loaderResultIsPromise = route.options.loader && isPromise(loaderResult); + const willLoadSomething = !!(loaderResultIsPromise || route._lazyPromise || route._componentsPromise || route.options.head || route.options.scripts || route.options.headers || match._nonReactive.minPendingPromise); + if (willLoadSomething) { + inner.updateMatch(matchId, (prev) => ({ + ...prev, + isFetching: "loader" + })); + } + if (route.options.loader) { + const loaderData = loaderResultIsPromise ? await loaderResult : loaderResult; + handleRedirectAndNotFound( + inner, + inner.router.getMatch(matchId), + loaderData + ); + if (loaderData !== void 0) { + inner.updateMatch(matchId, (prev) => ({ + ...prev, + loaderData + })); + } + } + if (route._lazyPromise) await route._lazyPromise; + const pendingPromise = match._nonReactive.minPendingPromise; + if (pendingPromise) await pendingPromise; + if (route._componentsPromise) await route._componentsPromise; + inner.updateMatch(matchId, (prev) => ({ + ...prev, + error: void 0, + context: buildMatchContext(inner, index), + status: "success", + isFetching: false, + updatedAt: Date.now() + })); + } catch (e) { + let error = e; + if (error?.name === "AbortError") { + inner.updateMatch(matchId, (prev) => ({ + ...prev, + status: prev.status === "pending" ? "success" : prev.status, + isFetching: false, + context: buildMatchContext(inner, index) + })); + return; + } + const pendingPromise = match._nonReactive.minPendingPromise; + if (pendingPromise) await pendingPromise; + if (isNotFound(e)) { + await route.options.notFoundComponent?.preload?.(); + } + handleRedirectAndNotFound(inner, inner.router.getMatch(matchId), e); + try { + route.options.onError?.(e); + } catch (onErrorError) { + error = onErrorError; + handleRedirectAndNotFound( + inner, + inner.router.getMatch(matchId), + onErrorError + ); + } + inner.updateMatch(matchId, (prev) => ({ + ...prev, + error, + context: buildMatchContext(inner, index), + status: "error", + isFetching: false + })); + } + } catch (err) { + const match = inner.router.getMatch(matchId); + if (match) { + match._nonReactive.loaderPromise = void 0; + } + handleRedirectAndNotFound(inner, match, err); + } +}; +const loadRouteMatch = async (inner, index) => { + const { id: matchId, routeId } = inner.matches[index]; + let loaderShouldRunAsync = false; + let loaderIsRunningAsync = false; + const route = inner.router.looseRoutesById[routeId]; + if (shouldSkipLoader(inner, matchId)) { + { + return inner.router.getMatch(matchId); + } + } else { + const prevMatch = inner.router.getMatch(matchId); + if (prevMatch._nonReactive.loaderPromise) { + if (prevMatch.status === "success" && !inner.sync && !prevMatch.preload) { + return prevMatch; + } + await prevMatch._nonReactive.loaderPromise; + const match2 = inner.router.getMatch(matchId); + const error = match2._nonReactive.error || match2.error; + if (error) { + handleRedirectAndNotFound(inner, match2, error); + } + } else { + const age = Date.now() - prevMatch.updatedAt; + const preload = resolvePreload(inner, matchId); + const staleAge = preload ? route.options.preloadStaleTime ?? inner.router.options.defaultPreloadStaleTime ?? 3e4 : route.options.staleTime ?? inner.router.options.defaultStaleTime ?? 0; + const shouldReloadOption = route.options.shouldReload; + const shouldReload = typeof shouldReloadOption === "function" ? shouldReloadOption(getLoaderContext(inner, matchId, index, route)) : shouldReloadOption; + const nextPreload = !!preload && !inner.router.state.matches.some((d) => d.id === matchId); + const match2 = inner.router.getMatch(matchId); + match2._nonReactive.loaderPromise = createControlledPromise(); + if (nextPreload !== match2.preload) { + inner.updateMatch(matchId, (prev) => ({ + ...prev, + preload: nextPreload + })); + } + const { status, invalid } = match2; + loaderShouldRunAsync = status === "success" && (invalid || (shouldReload ?? age > staleAge)); + if (preload && route.options.preload === false) ; + else if (loaderShouldRunAsync && !inner.sync) { + loaderIsRunningAsync = true; + (async () => { + try { + await runLoader(inner, matchId, index, route); + const match3 = inner.router.getMatch(matchId); + match3._nonReactive.loaderPromise?.resolve(); + match3._nonReactive.loadPromise?.resolve(); + match3._nonReactive.loaderPromise = void 0; + } catch (err) { + if (isRedirect(err)) { + await inner.router.navigate(err.options); + } + } + })(); + } else if (status !== "success" || loaderShouldRunAsync && inner.sync) { + await runLoader(inner, matchId, index, route); + } + } + } + const match = inner.router.getMatch(matchId); + if (!loaderIsRunningAsync) { + match._nonReactive.loaderPromise?.resolve(); + match._nonReactive.loadPromise?.resolve(); + } + clearTimeout(match._nonReactive.pendingTimeout); + match._nonReactive.pendingTimeout = void 0; + if (!loaderIsRunningAsync) match._nonReactive.loaderPromise = void 0; + match._nonReactive.dehydrated = void 0; + const nextIsFetching = loaderIsRunningAsync ? match.isFetching : false; + if (nextIsFetching !== match.isFetching || match.invalid !== false) { + inner.updateMatch(matchId, (prev) => ({ + ...prev, + isFetching: nextIsFetching, + invalid: false + })); + return inner.router.getMatch(matchId); + } else { + return match; + } +}; +async function loadMatches(arg) { + const inner = Object.assign(arg, { + matchPromises: [] + }); + try { + for (let i = 0; i < inner.matches.length; i++) { + const beforeLoad = handleBeforeLoad(inner, i); + if (isPromise(beforeLoad)) await beforeLoad; + } + const max = inner.firstBadMatchIndex ?? inner.matches.length; + for (let i = 0; i < max; i++) { + inner.matchPromises.push(loadRouteMatch(inner, i)); + } + const results = await Promise.allSettled(inner.matchPromises); + const failures = results.filter( + (result) => result.status === "rejected" + ).map((result) => result.reason); + let firstNotFound; + for (const err of failures) { + if (isRedirect(err)) { + throw err; + } + if (!firstNotFound && isNotFound(err)) { + firstNotFound = err; + } + } + for (const match of inner.matches) { + const { id: matchId, routeId } = match; + const route = inner.router.looseRoutesById[routeId]; + try { + const headResult = executeHead(inner, matchId, route); + if (headResult) { + const head = await headResult; + inner.updateMatch(matchId, (prev) => ({ + ...prev, + ...head + })); + } + } catch (err) { + console.error(`Error executing head for route ${routeId}:`, err); + } + } + if (firstNotFound) { + throw firstNotFound; + } + const readyPromise = triggerOnReady(inner); + if (isPromise(readyPromise)) await readyPromise; + } catch (err) { + if (isNotFound(err) && !inner.preload) { + const readyPromise = triggerOnReady(inner); + if (isPromise(readyPromise)) await readyPromise; + throw err; + } + if (isRedirect(err)) { + throw err; + } + } + return inner.matches; +} +async function loadRouteChunk(route) { + if (!route._lazyLoaded && route._lazyPromise === void 0) { + if (route.lazyFn) { + route._lazyPromise = route.lazyFn().then((lazyRoute) => { + const { id: _id, ...options } = lazyRoute.options; + Object.assign(route.options, options); + route._lazyLoaded = true; + route._lazyPromise = void 0; + }); + } else { + route._lazyLoaded = true; + } + } + if (!route._componentsLoaded && route._componentsPromise === void 0) { + const loadComponents = () => { + const preloads = []; + for (const type of componentTypes) { + const preload = route.options[type]?.preload; + if (preload) preloads.push(preload()); + } + if (preloads.length) + return Promise.all(preloads).then(() => { + route._componentsLoaded = true; + route._componentsPromise = void 0; + }); + route._componentsLoaded = true; + route._componentsPromise = void 0; + return; + }; + route._componentsPromise = route._lazyPromise ? route._lazyPromise.then(loadComponents) : loadComponents(); + } + return route._componentsPromise; +} +function makeMaybe(value, error) { + if (error) { + return { status: "error", error }; + } + return { status: "success", value }; +} +function routeNeedsPreload(route) { + for (const componentType of componentTypes) { + if (route.options[componentType]?.preload) { + return true; + } + } + return false; +} +const componentTypes = [ + "component", + "errorComponent", + "pendingComponent", + "notFoundComponent" +]; +function composeRewrites(rewrites) { + return { + input: ({ url }) => { + for (const rewrite of rewrites) { + url = executeRewriteInput(rewrite, url); + } + return url; + }, + output: ({ url }) => { + for (let i = rewrites.length - 1; i >= 0; i--) { + url = executeRewriteOutput(rewrites[i], url); + } + return url; + } + }; +} +function rewriteBasepath(opts) { + const trimmedBasepath = trimPath(opts.basepath); + const normalizedBasepath = `/${trimmedBasepath}`; + const normalizedBasepathWithSlash = `${normalizedBasepath}/`; + const checkBasepath = opts.caseSensitive ? normalizedBasepath : normalizedBasepath.toLowerCase(); + const checkBasepathWithSlash = opts.caseSensitive ? normalizedBasepathWithSlash : normalizedBasepathWithSlash.toLowerCase(); + return { + input: ({ url }) => { + const pathname = opts.caseSensitive ? url.pathname : url.pathname.toLowerCase(); + if (pathname === checkBasepath) { + url.pathname = "/"; + } else if (pathname.startsWith(checkBasepathWithSlash)) { + url.pathname = url.pathname.slice(normalizedBasepath.length); + } + return url; + }, + output: ({ url }) => { + url.pathname = joinPaths(["/", trimmedBasepath, url.pathname]); + return url; + } + }; +} +function executeRewriteInput(rewrite, url) { + const res = rewrite?.input?.({ url }); + if (res) { + if (typeof res === "string") { + return new URL(res); + } else if (res instanceof URL) { + return res; + } + } + return url; +} +function executeRewriteOutput(rewrite, url) { + const res = rewrite?.output?.({ url }); + if (res) { + if (typeof res === "string") { + return new URL(res); + } else if (res instanceof URL) { + return res; + } + } + return url; +} +function getLocationChangeInfo(routerState) { + const fromLocation = routerState.resolvedLocation; + const toLocation = routerState.location; + const pathChanged = fromLocation?.pathname !== toLocation.pathname; + const hrefChanged = fromLocation?.href !== toLocation.href; + const hashChanged = fromLocation?.hash !== toLocation.hash; + return { fromLocation, toLocation, pathChanged, hrefChanged, hashChanged }; +} +function createServerStore(initialState) { + const store = { + state: initialState, + setState: (updater) => { + store.state = updater(store.state); + } + }; + return store; +} +class RouterCore { + /** + * @deprecated Use the `createRouter` function instead + */ + constructor(options) { + this.tempLocationKey = `${Math.round( + Math.random() * 1e7 + )}`; + this.resetNextScroll = true; + this.shouldViewTransition = void 0; + this.isViewTransitionTypesSupported = void 0; + this.subscribers = /* @__PURE__ */ new Set(); + this.isScrollRestoring = false; + this.isScrollRestorationSetup = false; + this.startTransition = (fn) => fn(); + this.update = (newOptions) => { + if (newOptions.notFoundRoute) { + console.warn( + "The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info." + ); + } + const prevOptions = this.options; + const prevBasepath = this.basepath ?? prevOptions?.basepath ?? "/"; + const basepathWasUnset = this.basepath === void 0; + const prevRewriteOption = prevOptions?.rewrite; + this.options = { + ...prevOptions, + ...newOptions + }; + this.isServer = this.options.isServer ?? typeof document === "undefined"; + if (this.options.pathParamsAllowedCharacters) + this.pathParamsDecoder = compileDecodeCharMap( + this.options.pathParamsAllowedCharacters + ); + if (!this.history || this.options.history && this.options.history !== this.history) { + if (!this.options.history) ; + else { + this.history = this.options.history; + } + } + this.origin = this.options.origin; + if (!this.origin) { + { + this.origin = "http://localhost"; + } + } + if (this.history) { + this.updateLatestLocation(); + } + if (this.options.routeTree !== this.routeTree) { + this.routeTree = this.options.routeTree; + let processRouteTreeResult; + if (globalThis.__TSR_CACHE__ && globalThis.__TSR_CACHE__.routeTree === this.routeTree) { + const cached = globalThis.__TSR_CACHE__; + this.resolvePathCache = cached.resolvePathCache; + processRouteTreeResult = cached.processRouteTreeResult; + } else { + this.resolvePathCache = createLRUCache(1e3); + processRouteTreeResult = this.buildRouteTree(); + if (globalThis.__TSR_CACHE__ === void 0) { + globalThis.__TSR_CACHE__ = { + routeTree: this.routeTree, + processRouteTreeResult, + resolvePathCache: this.resolvePathCache + }; + } + } + this.setRoutes(processRouteTreeResult); + } + if (!this.__store && this.latestLocation) { + { + this.__store = createServerStore( + getInitialRouterState(this.latestLocation) + ); + } + } + let needsLocationUpdate = false; + const nextBasepath = this.options.basepath ?? "/"; + const nextRewriteOption = this.options.rewrite; + const basepathChanged = basepathWasUnset || prevBasepath !== nextBasepath; + const rewriteChanged = prevRewriteOption !== nextRewriteOption; + if (basepathChanged || rewriteChanged) { + this.basepath = nextBasepath; + const rewrites = []; + const trimmed = trimPath(nextBasepath); + if (trimmed && trimmed !== "/") { + rewrites.push( + rewriteBasepath({ + basepath: nextBasepath + }) + ); + } + if (nextRewriteOption) { + rewrites.push(nextRewriteOption); + } + this.rewrite = rewrites.length === 0 ? void 0 : rewrites.length === 1 ? rewrites[0] : composeRewrites(rewrites); + if (this.history) { + this.updateLatestLocation(); + } + needsLocationUpdate = true; + } + if (needsLocationUpdate && this.__store) { + this.__store.state = { + ...this.state, + location: this.latestLocation + }; + } + if (typeof window !== "undefined" && "CSS" in window && typeof window.CSS?.supports === "function") { + this.isViewTransitionTypesSupported = window.CSS.supports( + "selector(:active-view-transition-type(a)" + ); + } + }; + this.updateLatestLocation = () => { + this.latestLocation = this.parseLocation( + this.history.location, + this.latestLocation + ); + }; + this.buildRouteTree = () => { + const result = processRouteTree( + this.routeTree, + this.options.caseSensitive, + (route, i) => { + route.init({ + originalIndex: i + }); + } + ); + if (this.options.routeMasks) { + processRouteMasks(this.options.routeMasks, result.processedTree); + } + return result; + }; + this.subscribe = (eventType, fn) => { + const listener = { + eventType, + fn + }; + this.subscribers.add(listener); + return () => { + this.subscribers.delete(listener); + }; + }; + this.emit = (routerEvent) => { + this.subscribers.forEach((listener) => { + if (listener.eventType === routerEvent.type) { + listener.fn(routerEvent); + } + }); + }; + this.parseLocation = (locationToParse, previousLocation) => { + const parse = ({ + pathname, + search, + hash, + href, + state + }) => { + if (!this.rewrite && !/[ \x00-\x1f\x7f\u0080-\uffff]/.test(pathname)) { + const parsedSearch2 = this.options.parseSearch(search); + const searchStr2 = this.options.stringifySearch(parsedSearch2); + return { + href: pathname + searchStr2 + hash, + publicHref: href, + pathname: decodePath(pathname), + external: false, + searchStr: searchStr2, + search: replaceEqualDeep( + previousLocation?.search, + parsedSearch2 + ), + hash: decodePath(hash.slice(1)), + state: replaceEqualDeep(previousLocation?.state, state) + }; + } + const fullUrl = new URL(href, this.origin); + const url = executeRewriteInput(this.rewrite, fullUrl); + const parsedSearch = this.options.parseSearch(url.search); + const searchStr = this.options.stringifySearch(parsedSearch); + url.search = searchStr; + const fullPath = url.href.replace(url.origin, ""); + return { + href: fullPath, + publicHref: href, + pathname: decodePath(url.pathname), + external: !!this.rewrite && url.origin !== this.origin, + searchStr, + search: replaceEqualDeep(previousLocation?.search, parsedSearch), + hash: decodePath(url.hash.slice(1)), + state: replaceEqualDeep(previousLocation?.state, state) + }; + }; + const location = parse(locationToParse); + const { __tempLocation, __tempKey } = location.state; + if (__tempLocation && (!__tempKey || __tempKey === this.tempLocationKey)) { + const parsedTempLocation = parse(__tempLocation); + parsedTempLocation.state.key = location.state.key; + parsedTempLocation.state.__TSR_key = location.state.__TSR_key; + delete parsedTempLocation.state.__tempLocation; + return { + ...parsedTempLocation, + maskedLocation: location + }; + } + return location; + }; + this.resolvePathWithBase = (from, path) => { + const resolvedPath = resolvePath({ + base: from, + to: cleanPath(path), + trailingSlash: this.options.trailingSlash, + cache: this.resolvePathCache + }); + return resolvedPath; + }; + this.matchRoutes = (pathnameOrNext, locationSearchOrOpts, opts) => { + if (typeof pathnameOrNext === "string") { + return this.matchRoutesInternal( + { + pathname: pathnameOrNext, + search: locationSearchOrOpts + }, + opts + ); + } + return this.matchRoutesInternal(pathnameOrNext, locationSearchOrOpts); + }; + this.getMatchedRoutes = (pathname) => { + return getMatchedRoutes({ + pathname, + routesById: this.routesById, + processedTree: this.processedTree + }); + }; + this.cancelMatch = (id) => { + const match = this.getMatch(id); + if (!match) return; + match.abortController.abort(); + clearTimeout(match._nonReactive.pendingTimeout); + match._nonReactive.pendingTimeout = void 0; + }; + this.cancelMatches = () => { + const currentPendingMatches = this.state.matches.filter( + (match) => match.status === "pending" + ); + const currentLoadingMatches = this.state.matches.filter( + (match) => match.isFetching === "loader" + ); + const matchesToCancelArray = /* @__PURE__ */ new Set([ + ...this.state.pendingMatches ?? [], + ...currentPendingMatches, + ...currentLoadingMatches + ]); + matchesToCancelArray.forEach((match) => { + this.cancelMatch(match.id); + }); + }; + this.buildLocation = (opts) => { + const build = (dest = {}) => { + const currentLocation = dest._fromLocation || this.pendingBuiltLocation || this.latestLocation; + const lightweightResult = this.matchRoutesLightweight(currentLocation); + if (dest.from && false) ; + const defaultedFromPath = dest.unsafeRelative === "path" ? currentLocation.pathname : dest.from ?? lightweightResult.fullPath; + const fromPath = this.resolvePathWithBase(defaultedFromPath, "."); + const fromSearch = lightweightResult.search; + const fromParams = { ...lightweightResult.params }; + const nextTo = dest.to ? this.resolvePathWithBase(fromPath, `${dest.to}`) : this.resolvePathWithBase(fromPath, "."); + const nextParams = dest.params === false || dest.params === null ? {} : (dest.params ?? true) === true ? fromParams : Object.assign( + fromParams, + functionalUpdate(dest.params, fromParams) + ); + const interpolatedNextTo = interpolatePath({ + path: nextTo, + params: nextParams, + decoder: this.pathParamsDecoder, + server: this.isServer + }).interpolatedPath; + const destMatchResult = this.getMatchedRoutes(interpolatedNextTo); + let destRoutes = destMatchResult.matchedRoutes; + const isGlobalNotFound = destMatchResult.foundRoute ? destMatchResult.foundRoute.path !== "/" && destMatchResult.routeParams["**"] : trimPathRight(interpolatedNextTo); + if (isGlobalNotFound && this.options.notFoundRoute) { + destRoutes = [...destRoutes, this.options.notFoundRoute]; + } + let changedParams = false; + if (Object.keys(nextParams).length > 0) { + for (const route of destRoutes) { + const fn = route.options.params?.stringify ?? route.options.stringifyParams; + if (fn) { + changedParams = true; + Object.assign(nextParams, fn(nextParams)); + } + } + } + const nextPathname = opts.leaveParams ? ( + // Use the original template path for interpolation + // This preserves the original parameter syntax including optional parameters + nextTo + ) : decodePath( + !changedParams ? interpolatedNextTo : interpolatePath({ + path: nextTo, + params: nextParams, + decoder: this.pathParamsDecoder, + server: this.isServer + }).interpolatedPath + ); + let nextSearch = fromSearch; + if (opts._includeValidateSearch && this.options.search?.strict) { + const validatedSearch = {}; + destRoutes.forEach((route) => { + if (route.options.validateSearch) { + try { + Object.assign( + validatedSearch, + validateSearch(route.options.validateSearch, { + ...validatedSearch, + ...nextSearch + }) + ); + } catch { + } + } + }); + nextSearch = validatedSearch; + } + nextSearch = applySearchMiddleware({ + search: nextSearch, + dest, + destRoutes, + _includeValidateSearch: opts._includeValidateSearch + }); + nextSearch = replaceEqualDeep(fromSearch, nextSearch); + const searchStr = this.options.stringifySearch(nextSearch); + const hash = dest.hash === true ? currentLocation.hash : dest.hash ? functionalUpdate(dest.hash, currentLocation.hash) : void 0; + const hashStr = hash ? `#${hash}` : ""; + let nextState = dest.state === true ? currentLocation.state : dest.state ? functionalUpdate(dest.state, currentLocation.state) : {}; + nextState = replaceEqualDeep(currentLocation.state, nextState); + const fullPath = `${nextPathname}${searchStr}${hashStr}`; + let href; + let publicHref; + let external = false; + if (this.rewrite) { + const url = new URL(fullPath, this.origin); + const rewrittenUrl = executeRewriteOutput(this.rewrite, url); + href = url.href.replace(url.origin, ""); + if (rewrittenUrl.origin !== this.origin) { + publicHref = rewrittenUrl.href; + external = true; + } else { + publicHref = rewrittenUrl.pathname + rewrittenUrl.search + rewrittenUrl.hash; + } + } else { + href = encodePathLikeUrl(fullPath); + publicHref = href; + } + return { + publicHref, + href, + pathname: nextPathname, + search: nextSearch, + searchStr, + state: nextState, + hash: hash ?? "", + external, + unmaskOnReload: dest.unmaskOnReload + }; + }; + const buildWithMatches = (dest = {}, maskedDest) => { + const next = build(dest); + let maskedNext = maskedDest ? build(maskedDest) : void 0; + if (!maskedNext) { + const params = {}; + if (this.options.routeMasks) { + const match = findFlatMatch( + next.pathname, + this.processedTree + ); + if (match) { + Object.assign(params, match.rawParams); + const { + from: _from, + params: maskParams, + ...maskProps + } = match.route; + const nextParams = maskParams === false || maskParams === null ? {} : (maskParams ?? true) === true ? params : Object.assign(params, functionalUpdate(maskParams, params)); + maskedDest = { + from: opts.from, + ...maskProps, + params: nextParams + }; + maskedNext = build(maskedDest); + } + } + } + if (maskedNext) { + next.maskedLocation = maskedNext; + } + return next; + }; + if (opts.mask) { + return buildWithMatches(opts, { + from: opts.from, + ...opts.mask + }); + } + return buildWithMatches(opts); + }; + this.commitLocation = async ({ + viewTransition, + ignoreBlocker, + ...next + }) => { + const isSameState = () => { + const ignoredProps = [ + "key", + // TODO: Remove in v2 - use __TSR_key instead + "__TSR_key", + "__TSR_index", + "__hashScrollIntoViewOptions" + ]; + ignoredProps.forEach((prop) => { + next.state[prop] = this.latestLocation.state[prop]; + }); + const isEqual = deepEqual(next.state, this.latestLocation.state); + ignoredProps.forEach((prop) => { + delete next.state[prop]; + }); + return isEqual; + }; + const isSameUrl = trimPathRight(this.latestLocation.href) === trimPathRight(next.href); + const previousCommitPromise = this.commitLocationPromise; + this.commitLocationPromise = createControlledPromise(() => { + previousCommitPromise?.resolve(); + }); + if (isSameUrl && isSameState()) { + this.load(); + } else { + let { + // eslint-disable-next-line prefer-const + maskedLocation, + // eslint-disable-next-line prefer-const + hashScrollIntoView, + ...nextHistory + } = next; + if (maskedLocation) { + nextHistory = { + ...maskedLocation, + state: { + ...maskedLocation.state, + __tempKey: void 0, + __tempLocation: { + ...nextHistory, + search: nextHistory.searchStr, + state: { + ...nextHistory.state, + __tempKey: void 0, + __tempLocation: void 0, + __TSR_key: void 0, + key: void 0 + // TODO: Remove in v2 - use __TSR_key instead + } + } + } + }; + if (nextHistory.unmaskOnReload ?? this.options.unmaskOnReload ?? false) { + nextHistory.state.__tempKey = this.tempLocationKey; + } + } + nextHistory.state.__hashScrollIntoViewOptions = hashScrollIntoView ?? this.options.defaultHashScrollIntoView ?? true; + this.shouldViewTransition = viewTransition; + this.history[next.replace ? "replace" : "push"]( + nextHistory.publicHref, + nextHistory.state, + { ignoreBlocker } + ); + } + this.resetNextScroll = next.resetScroll ?? true; + if (!this.history.subscribers.size) { + this.load(); + } + return this.commitLocationPromise; + }; + this.buildAndCommitLocation = ({ + replace, + resetScroll, + hashScrollIntoView, + viewTransition, + ignoreBlocker, + href, + ...rest + } = {}) => { + if (href) { + const currentIndex = this.history.location.state.__TSR_index; + const parsed = parseHref(href, { + __TSR_index: replace ? currentIndex : currentIndex + 1 + }); + const hrefUrl = new URL(parsed.pathname, this.origin); + const rewrittenUrl = executeRewriteInput(this.rewrite, hrefUrl); + rest.to = rewrittenUrl.pathname; + rest.search = this.options.parseSearch(parsed.search); + rest.hash = parsed.hash.slice(1); + } + const location = this.buildLocation({ + ...rest, + _includeValidateSearch: true + }); + this.pendingBuiltLocation = location; + const commitPromise = this.commitLocation({ + ...location, + viewTransition, + replace, + resetScroll, + hashScrollIntoView, + ignoreBlocker + }); + Promise.resolve().then(() => { + if (this.pendingBuiltLocation === location) { + this.pendingBuiltLocation = void 0; + } + }); + return commitPromise; + }; + this.navigate = async ({ + to, + reloadDocument, + href, + publicHref, + ...rest + }) => { + let hrefIsUrl = false; + if (href) { + try { + new URL(`${href}`); + hrefIsUrl = true; + } catch { + } + } + if (hrefIsUrl && !reloadDocument) { + reloadDocument = true; + } + if (reloadDocument) { + if (to !== void 0 || !href) { + const location = this.buildLocation({ to, ...rest }); + href = href ?? location.publicHref; + publicHref = publicHref ?? location.publicHref; + } + const reloadHref = !hrefIsUrl && publicHref ? publicHref : href; + if (isDangerousProtocol(reloadHref)) { + return Promise.resolve(); + } + if (!rest.ignoreBlocker) { + const historyWithBlockers = this.history; + const blockers = historyWithBlockers.getBlockers?.() ?? []; + for (const blocker of blockers) { + if (blocker?.blockerFn) { + const shouldBlock = await blocker.blockerFn({ + currentLocation: this.latestLocation, + nextLocation: this.latestLocation, + // External URLs don't have a next location in our router + action: "PUSH" + }); + if (shouldBlock) { + return Promise.resolve(); + } + } + } + } + if (rest.replace) { + window.location.replace(reloadHref); + } else { + window.location.href = reloadHref; + } + return Promise.resolve(); + } + return this.buildAndCommitLocation({ + ...rest, + href, + to, + _isNavigate: true + }); + }; + this.beforeLoad = () => { + this.cancelMatches(); + this.updateLatestLocation(); + { + const nextLocation = this.buildLocation({ + to: this.latestLocation.pathname, + search: true, + params: true, + hash: true, + state: true, + _includeValidateSearch: true + }); + if (this.latestLocation.publicHref !== nextLocation.publicHref) { + const href = this.getParsedLocationHref(nextLocation); + if (nextLocation.external) { + throw redirect({ href }); + } else { + throw redirect({ href, _builtLocation: nextLocation }); + } + } + } + const pendingMatches = this.matchRoutes(this.latestLocation); + this.__store.setState((s) => ({ + ...s, + status: "pending", + statusCode: 200, + isLoading: true, + location: this.latestLocation, + pendingMatches, + // If a cached moved to pendingMatches, remove it from cachedMatches + cachedMatches: s.cachedMatches.filter( + (d) => !pendingMatches.some((e) => e.id === d.id) + ) + })); + }; + this.load = async (opts) => { + let redirect2; + let notFound; + let loadPromise; + loadPromise = new Promise((resolve) => { + this.startTransition(async () => { + try { + this.beforeLoad(); + const next = this.latestLocation; + const prevLocation = this.state.resolvedLocation; + if (!this.state.redirect) { + this.emit({ + type: "onBeforeNavigate", + ...getLocationChangeInfo({ + resolvedLocation: prevLocation, + location: next + }) + }); + } + this.emit({ + type: "onBeforeLoad", + ...getLocationChangeInfo({ + resolvedLocation: prevLocation, + location: next + }) + }); + await loadMatches({ + router: this, + sync: opts?.sync, + matches: this.state.pendingMatches, + location: next, + updateMatch: this.updateMatch, + // eslint-disable-next-line @typescript-eslint/require-await + onReady: async () => { + this.startTransition(() => { + this.startViewTransition(async () => { + let exitingMatches = []; + let enteringMatches = []; + let stayingMatches = []; + batch(() => { + this.__store.setState((s) => { + const previousMatches = s.matches; + const newMatches = s.pendingMatches || s.matches; + exitingMatches = previousMatches.filter( + (match) => !newMatches.some((d) => d.id === match.id) + ); + enteringMatches = newMatches.filter( + (match) => !previousMatches.some((d) => d.id === match.id) + ); + stayingMatches = newMatches.filter( + (match) => previousMatches.some((d) => d.id === match.id) + ); + return { + ...s, + isLoading: false, + loadedAt: Date.now(), + matches: newMatches, + pendingMatches: void 0, + /** + * When committing new matches, cache any exiting matches that are still usable. + * Routes that resolved with `status: 'error'` or `status: 'notFound'` are + * deliberately excluded from `cachedMatches` so that subsequent invalidations + * or reloads re-run their loaders instead of reusing the failed/not-found data. + */ + cachedMatches: [ + ...s.cachedMatches, + ...exitingMatches.filter( + (d) => d.status !== "error" && d.status !== "notFound" + ) + ] + }; + }); + this.clearExpiredCache(); + }); + [ + [exitingMatches, "onLeave"], + [enteringMatches, "onEnter"], + [stayingMatches, "onStay"] + ].forEach(([matches, hook]) => { + matches.forEach((match) => { + this.looseRoutesById[match.routeId].options[hook]?.( + match + ); + }); + }); + }); + }); + } + }); + } catch (err) { + if (isRedirect(err)) { + redirect2 = err; + } else if (isNotFound(err)) { + notFound = err; + } + this.__store.setState((s) => ({ + ...s, + statusCode: redirect2 ? redirect2.status : notFound ? 404 : s.matches.some((d) => d.status === "error") ? 500 : 200, + redirect: redirect2 + })); + } + if (this.latestLoadPromise === loadPromise) { + this.commitLocationPromise?.resolve(); + this.latestLoadPromise = void 0; + this.commitLocationPromise = void 0; + } + resolve(); + }); + }); + this.latestLoadPromise = loadPromise; + await loadPromise; + while (this.latestLoadPromise && loadPromise !== this.latestLoadPromise) { + await this.latestLoadPromise; + } + let newStatusCode = void 0; + if (this.hasNotFoundMatch()) { + newStatusCode = 404; + } else if (this.__store.state.matches.some((d) => d.status === "error")) { + newStatusCode = 500; + } + if (newStatusCode !== void 0) { + this.__store.setState((s) => ({ + ...s, + statusCode: newStatusCode + })); + } + }; + this.startViewTransition = (fn) => { + const shouldViewTransition = this.shouldViewTransition ?? this.options.defaultViewTransition; + this.shouldViewTransition = void 0; + if (shouldViewTransition && typeof document !== "undefined" && "startViewTransition" in document && typeof document.startViewTransition === "function") { + let startViewTransitionParams; + if (typeof shouldViewTransition === "object" && this.isViewTransitionTypesSupported) { + const next = this.latestLocation; + const prevLocation = this.state.resolvedLocation; + const resolvedViewTransitionTypes = typeof shouldViewTransition.types === "function" ? shouldViewTransition.types( + getLocationChangeInfo({ + resolvedLocation: prevLocation, + location: next + }) + ) : shouldViewTransition.types; + if (resolvedViewTransitionTypes === false) { + fn(); + return; + } + startViewTransitionParams = { + update: fn, + types: resolvedViewTransitionTypes + }; + } else { + startViewTransitionParams = fn; + } + document.startViewTransition(startViewTransitionParams); + } else { + fn(); + } + }; + this.updateMatch = (id, updater) => { + this.startTransition(() => { + const matchesKey = this.state.pendingMatches?.some((d) => d.id === id) ? "pendingMatches" : this.state.matches.some((d) => d.id === id) ? "matches" : this.state.cachedMatches.some((d) => d.id === id) ? "cachedMatches" : ""; + if (matchesKey) { + this.__store.setState((s) => ({ + ...s, + [matchesKey]: s[matchesKey]?.map( + (d) => d.id === id ? updater(d) : d + ) + })); + } + }); + }; + this.getMatch = (matchId) => { + const findFn = (d) => d.id === matchId; + return this.state.cachedMatches.find(findFn) ?? this.state.pendingMatches?.find(findFn) ?? this.state.matches.find(findFn); + }; + this.invalidate = (opts) => { + const invalidate = (d) => { + if (opts?.filter?.(d) ?? true) { + return { + ...d, + invalid: true, + ...opts?.forcePending || d.status === "error" || d.status === "notFound" ? { status: "pending", error: void 0 } : void 0 + }; + } + return d; + }; + this.__store.setState((s) => ({ + ...s, + matches: s.matches.map(invalidate), + cachedMatches: s.cachedMatches.map(invalidate), + pendingMatches: s.pendingMatches?.map(invalidate) + })); + this.shouldViewTransition = false; + return this.load({ sync: opts?.sync }); + }; + this.getParsedLocationHref = (location) => { + return location.publicHref || "/"; + }; + this.resolveRedirect = (redirect2) => { + const locationHeader = redirect2.headers.get("Location"); + if (!redirect2.options.href || redirect2.options._builtLocation) { + const location = redirect2.options._builtLocation ?? this.buildLocation(redirect2.options); + const href = this.getParsedLocationHref(location); + redirect2.options.href = href; + redirect2.headers.set("Location", href); + } else if (locationHeader) { + try { + const url = new URL(locationHeader); + if (this.origin && url.origin === this.origin) { + const href = url.pathname + url.search + url.hash; + redirect2.options.href = href; + redirect2.headers.set("Location", href); + } + } catch { + } + } + if (!redirect2.headers.get("Location")) { + redirect2.headers.set("Location", redirect2.options.href); + } + return redirect2; + }; + this.clearCache = (opts) => { + const filter = opts?.filter; + if (filter !== void 0) { + this.__store.setState((s) => { + return { + ...s, + cachedMatches: s.cachedMatches.filter( + (m) => !filter(m) + ) + }; + }); + } else { + this.__store.setState((s) => { + return { + ...s, + cachedMatches: [] + }; + }); + } + }; + this.clearExpiredCache = () => { + const filter = (d) => { + const route = this.looseRoutesById[d.routeId]; + if (!route.options.loader) { + return true; + } + const gcTime = (d.preload ? route.options.preloadGcTime ?? this.options.defaultPreloadGcTime : route.options.gcTime ?? this.options.defaultGcTime) ?? 5 * 60 * 1e3; + const isError = d.status === "error"; + if (isError) return true; + const gcEligible = Date.now() - d.updatedAt >= gcTime; + return gcEligible; + }; + this.clearCache({ filter }); + }; + this.loadRouteChunk = loadRouteChunk; + this.preloadRoute = async (opts) => { + const next = this.buildLocation(opts); + let matches = this.matchRoutes(next, { + throwOnError: true, + preload: true, + dest: opts + }); + const activeMatchIds = new Set( + [...this.state.matches, ...this.state.pendingMatches ?? []].map( + (d) => d.id + ) + ); + const loadedMatchIds = /* @__PURE__ */ new Set([ + ...activeMatchIds, + ...this.state.cachedMatches.map((d) => d.id) + ]); + batch(() => { + matches.forEach((match) => { + if (!loadedMatchIds.has(match.id)) { + this.__store.setState((s) => ({ + ...s, + cachedMatches: [...s.cachedMatches, match] + })); + } + }); + }); + try { + matches = await loadMatches({ + router: this, + matches, + location: next, + preload: true, + updateMatch: (id, updater) => { + if (activeMatchIds.has(id)) { + matches = matches.map((d) => d.id === id ? updater(d) : d); + } else { + this.updateMatch(id, updater); + } + } + }); + return matches; + } catch (err) { + if (isRedirect(err)) { + if (err.options.reloadDocument) { + return void 0; + } + return await this.preloadRoute({ + ...err.options, + _fromLocation: next + }); + } + if (!isNotFound(err)) { + console.error(err); + } + return void 0; + } + }; + this.matchRoute = (location, opts) => { + const matchLocation = { + ...location, + to: location.to ? this.resolvePathWithBase( + location.from || "", + location.to + ) : void 0, + params: location.params || {}, + leaveParams: true + }; + const next = this.buildLocation(matchLocation); + if (opts?.pending && this.state.status !== "pending") { + return false; + } + const pending = opts?.pending === void 0 ? !this.state.isLoading : opts.pending; + const baseLocation = pending ? this.latestLocation : this.state.resolvedLocation || this.state.location; + const match = findSingleMatch( + next.pathname, + opts?.caseSensitive ?? false, + opts?.fuzzy ?? false, + baseLocation.pathname, + this.processedTree + ); + if (!match) { + return false; + } + if (location.params) { + if (!deepEqual(match.rawParams, location.params, { partial: true })) { + return false; + } + } + if (opts?.includeSearch ?? true) { + return deepEqual(baseLocation.search, next.search, { partial: true }) ? match.rawParams : false; + } + return match.rawParams; + }; + this.hasNotFoundMatch = () => { + return this.__store.state.matches.some( + (d) => d.status === "notFound" || d.globalNotFound + ); + }; + this.update({ + defaultPreloadDelay: 50, + defaultPendingMs: 1e3, + defaultPendingMinMs: 500, + context: void 0, + ...options, + caseSensitive: options.caseSensitive ?? false, + notFoundMode: options.notFoundMode ?? "fuzzy", + stringifySearch: options.stringifySearch ?? defaultStringifySearch, + parseSearch: options.parseSearch ?? defaultParseSearch + }); + if (typeof document !== "undefined") { + self.__TSR_ROUTER__ = this; + } + } + isShell() { + return !!this.options.isShell; + } + isPrerendering() { + return !!this.options.isPrerendering; + } + get state() { + return this.__store.state; + } + setRoutes({ + routesById, + routesByPath, + processedTree + }) { + this.routesById = routesById; + this.routesByPath = routesByPath; + this.processedTree = processedTree; + const notFoundRoute = this.options.notFoundRoute; + if (notFoundRoute) { + notFoundRoute.init({ + originalIndex: 99999999999 + }); + this.routesById[notFoundRoute.id] = notFoundRoute; + } + } + get looseRoutesById() { + return this.routesById; + } + getParentContext(parentMatch) { + const parentMatchId = parentMatch?.id; + const parentContext = !parentMatchId ? this.options.context ?? void 0 : parentMatch.context ?? this.options.context ?? void 0; + return parentContext; + } + matchRoutesInternal(next, opts) { + const matchedRoutesResult = this.getMatchedRoutes(next.pathname); + const { foundRoute, routeParams, parsedParams } = matchedRoutesResult; + let { matchedRoutes } = matchedRoutesResult; + let isGlobalNotFound = false; + if ( + // If we found a route, and it's not an index route and we have left over path + foundRoute ? foundRoute.path !== "/" && routeParams["**"] : ( + // Or if we didn't find a route and we have left over path + trimPathRight(next.pathname) + ) + ) { + if (this.options.notFoundRoute) { + matchedRoutes = [...matchedRoutes, this.options.notFoundRoute]; + } else { + isGlobalNotFound = true; + } + } + const globalNotFoundRouteId = isGlobalNotFound ? findGlobalNotFoundRouteId(this.options.notFoundMode, matchedRoutes) : void 0; + const matches = new Array(matchedRoutes.length); + for (let index = 0; index < matchedRoutes.length; index++) { + const route = matchedRoutes[index]; + const parentMatch = matches[index - 1]; + let preMatchSearch; + let strictMatchSearch; + let searchError; + { + const parentSearch = parentMatch?.search ?? next.search; + const parentStrictSearch = parentMatch?._strictSearch ?? void 0; + try { + const strictSearch = validateSearch(route.options.validateSearch, { ...parentSearch }) ?? void 0; + preMatchSearch = { + ...parentSearch, + ...strictSearch + }; + strictMatchSearch = { ...parentStrictSearch, ...strictSearch }; + searchError = void 0; + } catch (err) { + let searchParamError = err; + if (!(err instanceof SearchParamError)) { + searchParamError = new SearchParamError(err.message, { + cause: err + }); + } + if (opts?.throwOnError) { + throw searchParamError; + } + preMatchSearch = parentSearch; + strictMatchSearch = {}; + searchError = searchParamError; + } + } + const loaderDeps = route.options.loaderDeps?.({ + search: preMatchSearch + }) ?? ""; + const loaderDepsHash = loaderDeps ? JSON.stringify(loaderDeps) : ""; + const { interpolatedPath, usedParams } = interpolatePath({ + path: route.fullPath, + params: routeParams, + decoder: this.pathParamsDecoder, + server: this.isServer + }); + const matchId = ( + // route.id for disambiguation + route.id + // interpolatedPath for param changes + interpolatedPath + // explicit deps + loaderDepsHash + ); + const existingMatch = this.getMatch(matchId); + const previousMatch = this.state.matches.find( + (d) => d.routeId === route.id + ); + const strictParams = existingMatch?._strictParams ?? usedParams; + let paramsError = void 0; + if (!existingMatch) { + try { + extractStrictParams(route, usedParams, parsedParams, strictParams); + } catch (err) { + if (isNotFound(err) || isRedirect(err)) { + paramsError = err; + } else { + paramsError = new PathParamError(err.message, { + cause: err + }); + } + if (opts?.throwOnError) { + throw paramsError; + } + } + } + Object.assign(routeParams, strictParams); + const cause = previousMatch ? "stay" : "enter"; + let match; + if (existingMatch) { + match = { + ...existingMatch, + cause, + params: previousMatch ? replaceEqualDeep(previousMatch.params, routeParams) : routeParams, + _strictParams: strictParams, + search: previousMatch ? replaceEqualDeep(previousMatch.search, preMatchSearch) : replaceEqualDeep(existingMatch.search, preMatchSearch), + _strictSearch: strictMatchSearch + }; + } else { + const status = route.options.loader || route.options.beforeLoad || route.lazyFn || routeNeedsPreload(route) ? "pending" : "success"; + match = { + id: matchId, + ssr: void 0, + index, + routeId: route.id, + params: previousMatch ? replaceEqualDeep(previousMatch.params, routeParams) : routeParams, + _strictParams: strictParams, + pathname: interpolatedPath, + updatedAt: Date.now(), + search: previousMatch ? replaceEqualDeep(previousMatch.search, preMatchSearch) : preMatchSearch, + _strictSearch: strictMatchSearch, + searchError: void 0, + status, + isFetching: false, + error: void 0, + paramsError, + __routeContext: void 0, + _nonReactive: { + loadPromise: createControlledPromise() + }, + __beforeLoadContext: void 0, + context: {}, + abortController: new AbortController(), + fetchCount: 0, + cause, + loaderDeps: previousMatch ? replaceEqualDeep(previousMatch.loaderDeps, loaderDeps) : loaderDeps, + invalid: false, + preload: false, + links: void 0, + scripts: void 0, + headScripts: void 0, + meta: void 0, + staticData: route.options.staticData || {}, + fullPath: route.fullPath + }; + } + if (!opts?.preload) { + match.globalNotFound = globalNotFoundRouteId === route.id; + } + match.searchError = searchError; + const parentContext = this.getParentContext(parentMatch); + match.context = { + ...parentContext, + ...match.__routeContext, + ...match.__beforeLoadContext + }; + matches[index] = match; + } + for (let index = 0; index < matches.length; index++) { + const match = matches[index]; + const route = this.looseRoutesById[match.routeId]; + const existingMatch = this.getMatch(match.id); + if (!existingMatch) { + const parentMatch = matches[index - 1]; + const parentContext = this.getParentContext(parentMatch); + if (route.options.context) { + const contextFnContext = { + deps: match.loaderDeps, + params: match.params, + context: parentContext ?? {}, + location: next, + navigate: (opts2) => this.navigate({ ...opts2, _fromLocation: next }), + buildLocation: this.buildLocation, + cause: match.cause, + abortController: match.abortController, + preload: !!match.preload, + matches + }; + match.__routeContext = route.options.context(contextFnContext) ?? void 0; + } + match.context = { + ...parentContext, + ...match.__routeContext, + ...match.__beforeLoadContext + }; + } + } + return matches; + } + /** + * Lightweight route matching for buildLocation. + * Only computes fullPath, accumulated search, and params - skipping expensive + * operations like AbortController, ControlledPromise, loaderDeps, and full match objects. + */ + matchRoutesLightweight(location) { + const { matchedRoutes, routeParams, parsedParams } = this.getMatchedRoutes( + location.pathname + ); + const lastRoute = last(matchedRoutes); + const accumulatedSearch = { ...location.search }; + for (const route of matchedRoutes) { + try { + Object.assign( + accumulatedSearch, + validateSearch(route.options.validateSearch, accumulatedSearch) + ); + } catch { + } + } + const lastStateMatch = last(this.state.matches); + const canReuseParams = lastStateMatch && lastStateMatch.routeId === lastRoute.id && location.pathname === this.state.location.pathname; + let params; + if (canReuseParams) { + params = lastStateMatch.params; + } else { + const strictParams = { ...routeParams }; + for (const route of matchedRoutes) { + try { + extractStrictParams( + route, + routeParams, + parsedParams ?? {}, + strictParams + ); + } catch { + } + } + params = strictParams; + } + return { + matchedRoutes, + fullPath: lastRoute.fullPath, + search: accumulatedSearch, + params + }; + } +} +class SearchParamError extends Error { +} +class PathParamError extends Error { +} +function getInitialRouterState(location) { + return { + loadedAt: 0, + isLoading: false, + isTransitioning: false, + status: "idle", + resolvedLocation: void 0, + location, + matches: [], + pendingMatches: [], + cachedMatches: [], + statusCode: 200 + }; +} +function validateSearch(validateSearch2, input) { + if (validateSearch2 == null) return {}; + if ("~standard" in validateSearch2) { + const result = validateSearch2["~standard"].validate(input); + if (result instanceof Promise) + throw new SearchParamError("Async validation not supported"); + if (result.issues) + throw new SearchParamError(JSON.stringify(result.issues, void 0, 2), { + cause: result + }); + return result.value; + } + if ("parse" in validateSearch2) { + return validateSearch2.parse(input); + } + if (typeof validateSearch2 === "function") { + return validateSearch2(input); + } + return {}; +} +function getMatchedRoutes({ + pathname, + routesById, + processedTree +}) { + const routeParams = {}; + const trimmedPath = trimPathRight(pathname); + let foundRoute = void 0; + let parsedParams = void 0; + const match = findRouteMatch(trimmedPath, processedTree, true); + if (match) { + foundRoute = match.route; + Object.assign(routeParams, match.rawParams); + parsedParams = Object.assign({}, match.parsedParams); + } + const matchedRoutes = match?.branch || [routesById[rootRouteId]]; + return { matchedRoutes, routeParams, foundRoute, parsedParams }; +} +function applySearchMiddleware({ + search, + dest, + destRoutes, + _includeValidateSearch +}) { + const middleware = buildMiddlewareChain(destRoutes); + return middleware(search, dest, _includeValidateSearch ?? false); +} +function buildMiddlewareChain(destRoutes) { + const context = { + dest: null, + _includeValidateSearch: false, + middlewares: [] + }; + for (const route of destRoutes) { + if ("search" in route.options) { + if (route.options.search?.middlewares) { + context.middlewares.push(...route.options.search.middlewares); + } + } else if (route.options.preSearchFilters || route.options.postSearchFilters) { + const legacyMiddleware = ({ search, next }) => { + let nextSearch = search; + if ("preSearchFilters" in route.options && route.options.preSearchFilters) { + nextSearch = route.options.preSearchFilters.reduce( + (prev, next2) => next2(prev), + search + ); + } + const result = next(nextSearch); + if ("postSearchFilters" in route.options && route.options.postSearchFilters) { + return route.options.postSearchFilters.reduce( + (prev, next2) => next2(prev), + result + ); + } + return result; + }; + context.middlewares.push(legacyMiddleware); + } + if (route.options.validateSearch) { + const validate = ({ search, next }) => { + const result = next(search); + if (!context._includeValidateSearch) return result; + try { + const validatedSearch = { + ...result, + ...validateSearch(route.options.validateSearch, result) ?? void 0 + }; + return validatedSearch; + } catch { + return result; + } + }; + context.middlewares.push(validate); + } + } + const final = ({ search }) => { + const dest = context.dest; + if (!dest.search) { + return {}; + } + if (dest.search === true) { + return search; + } + return functionalUpdate(dest.search, search); + }; + context.middlewares.push(final); + const applyNext = (index, currentSearch, middlewares) => { + if (index >= middlewares.length) { + return currentSearch; + } + const middleware = middlewares[index]; + const next = (newSearch) => { + return applyNext(index + 1, newSearch, middlewares); + }; + return middleware({ search: currentSearch, next }); + }; + return function middleware(search, dest, _includeValidateSearch) { + context.dest = dest; + context._includeValidateSearch = _includeValidateSearch; + return applyNext(0, search, context.middlewares); + }; +} +function findGlobalNotFoundRouteId(notFoundMode, routes) { + if (notFoundMode !== "root") { + for (let i = routes.length - 1; i >= 0; i--) { + const route = routes[i]; + if (route.children) { + return route.id; + } + } + } + return rootRouteId; +} +function extractStrictParams(route, referenceParams, parsedParams, accumulatedParams) { + const parseParams = route.options.params?.parse ?? route.options.parseParams; + if (parseParams) { + if (route.options.skipRouteOnParseError) { + for (const key in referenceParams) { + if (key in parsedParams) { + accumulatedParams[key] = parsedParams[key]; + } + } + } else { + const result = parseParams(accumulatedParams); + Object.assign(accumulatedParams, result); + } + } +} +class BaseRoute { + constructor(options) { + this.init = (opts) => { + this.originalIndex = opts.originalIndex; + const options2 = this.options; + const isRoot = !options2?.path && !options2?.id; + this.parentRoute = this.options.getParentRoute?.(); + if (isRoot) { + this._path = rootRouteId; + } else if (!this.parentRoute) { + invariant( + false + ); + } + let path = isRoot ? rootRouteId : options2?.path; + if (path && path !== "/") { + path = trimPathLeft(path); + } + const customId = options2?.id || path; + let id = isRoot ? rootRouteId : joinPaths([ + this.parentRoute.id === rootRouteId ? "" : this.parentRoute.id, + customId + ]); + if (path === rootRouteId) { + path = "/"; + } + if (id !== rootRouteId) { + id = joinPaths(["/", id]); + } + const fullPath = id === rootRouteId ? "/" : joinPaths([this.parentRoute.fullPath, path]); + this._path = path; + this._id = id; + this._fullPath = fullPath; + this._to = trimPathRight(fullPath); + }; + this.addChildren = (children) => { + return this._addFileChildren(children); + }; + this._addFileChildren = (children) => { + if (Array.isArray(children)) { + this.children = children; + } + if (typeof children === "object" && children !== null) { + this.children = Object.values(children); + } + return this; + }; + this._addFileTypes = () => { + return this; + }; + this.updateLoader = (options2) => { + Object.assign(this.options, options2); + return this; + }; + this.update = (options2) => { + Object.assign(this.options, options2); + return this; + }; + this.lazy = (lazyFn) => { + this.lazyFn = lazyFn; + return this; + }; + this.redirect = (opts) => redirect({ from: this.fullPath, ...opts }); + this.options = options || {}; + this.isRoot = !options?.getParentRoute; + if (options?.id && options?.path) { + throw new Error(`Route cannot have both an 'id' and a 'path' option.`); + } + } + get to() { + return this._to; + } + get id() { + return this._id; + } + get path() { + return this._path; + } + get fullPath() { + return this._fullPath; + } +} +class BaseRootRoute extends BaseRoute { + constructor(options) { + super(options); + } +} +const GLOBAL_TSR = "$_TSR"; +const TSR_SCRIPT_BARRIER_ID = "$tsr-stream-barrier"; +function createSerializationAdapter(opts) { + return opts; +} +function makeSsrSerovalPlugin(serializationAdapter, options) { + return ni({ + tag: "$TSR/t/" + serializationAdapter.key, + test: serializationAdapter.test, + parse: { + stream(value, ctx) { + return ctx.parse(serializationAdapter.toSerializable(value)); + } + }, + serialize(node, ctx) { + options.didRun = true; + return GLOBAL_TSR + '.t.get("' + serializationAdapter.key + '")(' + ctx.serialize(node) + ")"; + }, + // we never deserialize on the server during SSR + deserialize: void 0 + }); +} +function makeSerovalPlugin(serializationAdapter) { + return ni({ + tag: "$TSR/t/" + serializationAdapter.key, + test: serializationAdapter.test, + parse: { + sync(value, ctx) { + return ctx.parse(serializationAdapter.toSerializable(value)); + }, + async async(value, ctx) { + return await ctx.parse(serializationAdapter.toSerializable(value)); + }, + stream(value, ctx) { + return ctx.parse(serializationAdapter.toSerializable(value)); + } + }, + // we don't generate JS code outside of SSR (for now) + serialize: void 0, + deserialize(node, ctx) { + return serializationAdapter.fromSerializable(ctx.deserialize(node)); + } + }); +} +const ShallowErrorPlugin = /* @__PURE__ */ ni({ + tag: "$TSR/Error", + test(value) { + return value instanceof Error; + }, + parse: { + sync(value, ctx) { + return { + message: ctx.parse(value.message) + }; + }, + async async(value, ctx) { + return { + message: await ctx.parse(value.message) + }; + }, + stream(value, ctx) { + return { + message: ctx.parse(value.message) + }; + } + }, + serialize(node, ctx) { + return "new Error(" + ctx.serialize(node.message) + ")"; + }, + deserialize(node, ctx) { + return new Error(ctx.deserialize(node.message)); + } +}); +class RawStream { + constructor(stream, options) { + this.stream = stream; + this.hint = options?.hint ?? "binary"; + } +} +const BufferCtor = globalThis.Buffer; +const hasNodeBuffer = !!BufferCtor && typeof BufferCtor.from === "function"; +function uint8ArrayToBase64(bytes) { + if (bytes.length === 0) return ""; + if (hasNodeBuffer) { + return BufferCtor.from(bytes).toString("base64"); + } + const CHUNK_SIZE = 32768; + const chunks = []; + for (let i = 0; i < bytes.length; i += CHUNK_SIZE) { + const chunk = bytes.subarray(i, i + CHUNK_SIZE); + chunks.push(String.fromCharCode.apply(null, chunk)); + } + return btoa(chunks.join("")); +} +function base64ToUint8Array(base64) { + if (base64.length === 0) return new Uint8Array(0); + if (hasNodeBuffer) { + const buf = BufferCtor.from(base64, "base64"); + return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength); + } + const binary = atob(base64); + const bytes = new Uint8Array(binary.length); + for (let i = 0; i < binary.length; i++) { + bytes[i] = binary.charCodeAt(i); + } + return bytes; +} +const RAW_STREAM_FACTORY_BINARY = /* @__PURE__ */ Object.create(null); +const RAW_STREAM_FACTORY_TEXT = /* @__PURE__ */ Object.create(null); +const RAW_STREAM_FACTORY_CONSTRUCTOR_BINARY = (stream) => new ReadableStream({ + start(controller) { + stream.on({ + next(base64) { + try { + controller.enqueue(base64ToUint8Array(base64)); + } catch { + } + }, + throw(error) { + controller.error(error); + }, + return() { + try { + controller.close(); + } catch { + } + } + }); + } +}); +const textEncoderForFactory = new TextEncoder(); +const RAW_STREAM_FACTORY_CONSTRUCTOR_TEXT = (stream) => { + return new ReadableStream({ + start(controller) { + stream.on({ + next(value) { + try { + if (typeof value === "string") { + controller.enqueue(textEncoderForFactory.encode(value)); + } else { + controller.enqueue(base64ToUint8Array(value.$b64)); + } + } catch { + } + }, + throw(error) { + controller.error(error); + }, + return() { + try { + controller.close(); + } catch { + } + } + }); + } + }); +}; +const FACTORY_BINARY = `(s=>new ReadableStream({start(c){s.on({next(b){try{const d=atob(b),a=new Uint8Array(d.length);for(let i=0;i{const e=new TextEncoder();return new ReadableStream({start(c){s.on({next(v){try{if(typeof v==='string'){c.enqueue(e.encode(v))}else{const d=atob(v.$b64),a=new Uint8Array(d.length);for(let i=0;i { + try { + while (true) { + const { done, value } = await reader.read(); + if (done) { + stream.return(void 0); + break; + } + stream.next(uint8ArrayToBase64(value)); + } + } catch (error) { + stream.throw(error); + } finally { + reader.releaseLock(); + } + })(); + return stream; +} +function toTextStream(readable) { + const stream = te(); + const reader = readable.getReader(); + const decoder = new TextDecoder("utf-8", { fatal: true }); + (async () => { + try { + while (true) { + const { done, value } = await reader.read(); + if (done) { + try { + const remaining = decoder.decode(); + if (remaining.length > 0) { + stream.next(remaining); + } + } catch { + } + stream.return(void 0); + break; + } + try { + const text = decoder.decode(value, { stream: true }); + if (text.length > 0) { + stream.next(text); + } + } catch { + stream.next({ $b64: uint8ArrayToBase64(value) }); + } + } + } catch (error) { + stream.throw(error); + } finally { + reader.releaseLock(); + } + })(); + return stream; +} +const RawStreamFactoryBinaryPlugin = ni({ + tag: "tss/RawStreamFactory", + test(value) { + return value === RAW_STREAM_FACTORY_BINARY; + }, + parse: { + sync() { + return void 0; + }, + async() { + return Promise.resolve(void 0); + }, + stream() { + return void 0; + } + }, + serialize() { + return FACTORY_BINARY; + }, + deserialize() { + return RAW_STREAM_FACTORY_BINARY; + } +}); +const RawStreamFactoryTextPlugin = ni({ + tag: "tss/RawStreamFactoryText", + test(value) { + return value === RAW_STREAM_FACTORY_TEXT; + }, + parse: { + sync() { + return void 0; + }, + async() { + return Promise.resolve(void 0); + }, + stream() { + return void 0; + } + }, + serialize() { + return FACTORY_TEXT; + }, + deserialize() { + return RAW_STREAM_FACTORY_TEXT; + } +}); +const RawStreamSSRPlugin = ni({ + tag: "tss/RawStream", + extends: [RawStreamFactoryBinaryPlugin, RawStreamFactoryTextPlugin], + test(value) { + return value instanceof RawStream; + }, + parse: { + sync(value, ctx) { + const factory = value.hint === "text" ? RAW_STREAM_FACTORY_TEXT : RAW_STREAM_FACTORY_BINARY; + return { + hint: value.hint, + factory: ctx.parse(factory), + stream: ctx.parse(te()) + }; + }, + async async(value, ctx) { + const factory = value.hint === "text" ? RAW_STREAM_FACTORY_TEXT : RAW_STREAM_FACTORY_BINARY; + const encodedStream = value.hint === "text" ? toTextStream(value.stream) : toBinaryStream(value.stream); + return { + hint: value.hint, + factory: await ctx.parse(factory), + stream: await ctx.parse(encodedStream) + }; + }, + stream(value, ctx) { + const factory = value.hint === "text" ? RAW_STREAM_FACTORY_TEXT : RAW_STREAM_FACTORY_BINARY; + const encodedStream = value.hint === "text" ? toTextStream(value.stream) : toBinaryStream(value.stream); + return { + hint: value.hint, + factory: ctx.parse(factory), + stream: ctx.parse(encodedStream) + }; + } + }, + serialize(node, ctx) { + return "(" + ctx.serialize(node.factory) + ")(" + ctx.serialize(node.stream) + ")"; + }, + deserialize(node, ctx) { + const stream = ctx.deserialize(node.stream); + return node.hint === "text" ? RAW_STREAM_FACTORY_CONSTRUCTOR_TEXT(stream) : RAW_STREAM_FACTORY_CONSTRUCTOR_BINARY(stream); + } +}); +function createRawStreamRPCPlugin(onRawStream) { + let nextStreamId = 1; + return ni({ + tag: "tss/RawStream", + test(value) { + return value instanceof RawStream; + }, + parse: { + async(value) { + const streamId = nextStreamId++; + onRawStream(streamId, value.stream); + return Promise.resolve({ streamId }); + }, + stream(value) { + const streamId = nextStreamId++; + onRawStream(streamId, value.stream); + return { streamId }; + } + }, + serialize() { + throw new Error( + "RawStreamRPCPlugin.serialize should not be called. RPC uses JSON serialization, not JS code generation." + ); + }, + deserialize() { + throw new Error( + "RawStreamRPCPlugin.deserialize should not be called. Use createRawStreamDeserializePlugin on client." + ); + } + }); +} +const defaultSerovalPlugins = [ + ShallowErrorPlugin, + // RawStreamSSRPlugin must come before ReadableStreamPlugin to match first + RawStreamSSRPlugin, + // ReadableStreamNode is not exported by seroval + p +]; +const minifiedTsrBootStrapScript = "self.$_TSR={h(){this.hydrated=!0,this.c()},e(){this.streamEnded=!0,this.c()},c(){this.hydrated&&this.streamEnded&&(delete self.$_TSR,delete self.$R.tsr)},p(e){this.initialized?e():this.buffer.push(e)},buffer:[]};\n"; +const SCOPE_ID = "tsr"; +const TSR_PREFIX = GLOBAL_TSR + ".router="; +const P_PREFIX = GLOBAL_TSR + ".p(()=>"; +const P_SUFFIX = ")"; +function dehydrateMatch(match) { + const dehydratedMatch = { + i: match.id, + u: match.updatedAt, + s: match.status + }; + const properties = [ + ["__beforeLoadContext", "b"], + ["loaderData", "l"], + ["error", "e"], + ["ssr", "ssr"] + ]; + for (const [key, shorthand] of properties) { + if (match[key] !== void 0) { + dehydratedMatch[shorthand] = match[key]; + } + } + return dehydratedMatch; +} +const INITIAL_SCRIPTS = [ + mn(SCOPE_ID), + minifiedTsrBootStrapScript +]; +class ScriptBuffer { + constructor(router) { + this._scriptBarrierLifted = false; + this._cleanedUp = false; + this._pendingMicrotask = false; + this.router = router; + this._queue = INITIAL_SCRIPTS.slice(); + } + enqueue(script) { + if (this._cleanedUp) return; + this._queue.push(script); + if (this._scriptBarrierLifted && !this._pendingMicrotask) { + this._pendingMicrotask = true; + queueMicrotask(() => { + this._pendingMicrotask = false; + this.injectBufferedScripts(); + }); + } + } + liftBarrier() { + if (this._scriptBarrierLifted || this._cleanedUp) return; + this._scriptBarrierLifted = true; + if (this._queue.length > 0 && !this._pendingMicrotask) { + this._pendingMicrotask = true; + queueMicrotask(() => { + this._pendingMicrotask = false; + this.injectBufferedScripts(); + }); + } + } + /** + * Flushes any pending scripts synchronously. + * Call this before emitting onSerializationFinished to ensure all scripts are injected. + * + * IMPORTANT: Only injects if the barrier has been lifted. Before the barrier is lifted, + * scripts should remain in the queue so takeBufferedScripts() can retrieve them + */ + flush() { + if (!this._scriptBarrierLifted) return; + if (this._cleanedUp) return; + this._pendingMicrotask = false; + const scriptsToInject = this.takeAll(); + if (scriptsToInject && this.router?.serverSsr) { + this.router.serverSsr.injectScript(scriptsToInject); + } + } + takeAll() { + const bufferedScripts = this._queue; + this._queue = []; + if (bufferedScripts.length === 0) { + return void 0; + } + if (bufferedScripts.length === 1) { + return bufferedScripts[0] + ";document.currentScript.remove()"; + } + return bufferedScripts.join(";") + ";document.currentScript.remove()"; + } + injectBufferedScripts() { + if (this._cleanedUp) return; + if (this._queue.length === 0) return; + const scriptsToInject = this.takeAll(); + if (scriptsToInject && this.router?.serverSsr) { + this.router.serverSsr.injectScript(scriptsToInject); + } + } + cleanup() { + this._cleanedUp = true; + this._queue = []; + this.router = void 0; + } +} +const MANIFEST_CACHE_SIZE = 100; +const manifestCaches = /* @__PURE__ */ new WeakMap(); +function getManifestCache(manifest) { + const cache = manifestCaches.get(manifest); + if (cache) return cache; + const newCache = createLRUCache(MANIFEST_CACHE_SIZE); + manifestCaches.set(manifest, newCache); + return newCache; +} +function attachRouterServerSsrUtils({ + router, + manifest +}) { + router.ssr = { + manifest + }; + let _dehydrated = false; + let _serializationFinished = false; + const renderFinishedListeners = []; + const serializationFinishedListeners = []; + const scriptBuffer = new ScriptBuffer(router); + let injectedHtmlBuffer = ""; + router.serverSsr = { + injectHtml: (html) => { + if (!html) return; + injectedHtmlBuffer += html; + router.emit({ + type: "onInjectedHtml" + }); + }, + injectScript: (script) => { + if (!script) return; + const html = `${script}<\/script>`; + router.serverSsr.injectHtml(html); + }, + dehydrate: async () => { + invariant(!_dehydrated); + let matchesToDehydrate = router.state.matches; + if (router.isShell()) { + matchesToDehydrate = matchesToDehydrate.slice(0, 1); + } + const matches = matchesToDehydrate.map(dehydrateMatch); + let manifestToDehydrate = void 0; + if (manifest) { + const currentRouteIdsList = matchesToDehydrate.map((m) => m.routeId); + const manifestCacheKey = currentRouteIdsList.join("\0"); + let filteredRoutes; + { + filteredRoutes = getManifestCache(manifest).get(manifestCacheKey); + } + if (!filteredRoutes) { + const currentRouteIds = new Set(currentRouteIdsList); + const nextFilteredRoutes = {}; + for (const routeId in manifest.routes) { + const routeManifest = manifest.routes[routeId]; + if (currentRouteIds.has(routeId)) { + nextFilteredRoutes[routeId] = routeManifest; + } else if (routeManifest.assets && routeManifest.assets.length > 0) { + nextFilteredRoutes[routeId] = { + assets: routeManifest.assets + }; + } + } + { + getManifestCache(manifest).set(manifestCacheKey, nextFilteredRoutes); + } + filteredRoutes = nextFilteredRoutes; + } + manifestToDehydrate = { + routes: filteredRoutes + }; + } + const dehydratedRouter = { + manifest: manifestToDehydrate, + matches + }; + const lastMatchId = matchesToDehydrate[matchesToDehydrate.length - 1]?.id; + if (lastMatchId) { + dehydratedRouter.lastMatchId = lastMatchId; + } + const dehydratedData = await router.options.dehydrate?.(); + if (dehydratedData) { + dehydratedRouter.dehydratedData = dehydratedData; + } + _dehydrated = true; + const trackPlugins = { didRun: false }; + const serializationAdapters = router.options.serializationAdapters; + const plugins = serializationAdapters ? serializationAdapters.map((t) => makeSsrSerovalPlugin(t, trackPlugins)).concat(defaultSerovalPlugins) : defaultSerovalPlugins; + const signalSerializationComplete = () => { + _serializationFinished = true; + try { + serializationFinishedListeners.forEach((l) => l()); + router.emit({ type: "onSerializationFinished" }); + } catch (err) { + console.error("Serialization listener error:", err); + } finally { + serializationFinishedListeners.length = 0; + renderFinishedListeners.length = 0; + } + }; + cn(dehydratedRouter, { + refs: /* @__PURE__ */ new Map(), + plugins, + onSerialize: (data, initial) => { + let serialized = initial ? TSR_PREFIX + data : data; + if (trackPlugins.didRun) { + serialized = P_PREFIX + serialized + P_SUFFIX; + } + scriptBuffer.enqueue(serialized); + }, + scopeId: SCOPE_ID, + onDone: () => { + scriptBuffer.enqueue(GLOBAL_TSR + ".e()"); + scriptBuffer.flush(); + signalSerializationComplete(); + }, + onError: (err) => { + console.error("Serialization error:", err); + signalSerializationComplete(); + } + }); + }, + isDehydrated() { + return _dehydrated; + }, + isSerializationFinished() { + return _serializationFinished; + }, + onRenderFinished: (listener) => renderFinishedListeners.push(listener), + onSerializationFinished: (listener) => serializationFinishedListeners.push(listener), + setRenderFinished: () => { + try { + renderFinishedListeners.forEach((l) => l()); + } catch (err) { + console.error("Error in render finished listener:", err); + } finally { + renderFinishedListeners.length = 0; + } + scriptBuffer.liftBarrier(); + }, + takeBufferedScripts() { + const scripts = scriptBuffer.takeAll(); + const serverBufferedScript = { + tag: "script", + attrs: { + nonce: router.options.ssr?.nonce, + className: "$tsr", + id: TSR_SCRIPT_BARRIER_ID + }, + children: scripts + }; + return serverBufferedScript; + }, + liftScriptBarrier() { + scriptBuffer.liftBarrier(); + }, + takeBufferedHtml() { + if (!injectedHtmlBuffer) { + return void 0; + } + const buffered = injectedHtmlBuffer; + injectedHtmlBuffer = ""; + return buffered; + }, + cleanup() { + if (!router.serverSsr) return; + renderFinishedListeners.length = 0; + serializationFinishedListeners.length = 0; + injectedHtmlBuffer = ""; + scriptBuffer.cleanup(); + router.serverSsr = void 0; + } + }; +} +function getOrigin(request) { + try { + return new URL(request.url).origin; + } catch { + } + return "http://localhost"; +} +function getNormalizedURL(url, base) { + if (typeof url === "string") url = url.replace("\\", "%5C"); + const rawUrl = new URL(url, base); + const decodedPathname = decodePath(rawUrl.pathname); + const searchParams = new URLSearchParams(rawUrl.search); + const normalizedHref = decodedPathname + (searchParams.size > 0 ? "?" : "") + searchParams.toString() + rawUrl.hash; + return new URL(normalizedHref, rawUrl.origin); +} +function defineHandlerCallback(handler) { + return handler; +} +function transformReadableStreamWithRouter(router, routerStream) { + return transformStreamWithRouter(router, routerStream); +} +function transformPipeableStreamWithRouter(router, routerStream) { + return Readable.fromWeb( + transformStreamWithRouter(router, Readable.toWeb(routerStream)) + ); +} +const BODY_END_TAG = ""; +const HTML_END_TAG = ""; +const MIN_CLOSING_TAG_LENGTH = 4; +const DEFAULT_SERIALIZATION_TIMEOUT_MS = 6e4; +const DEFAULT_LIFETIME_TIMEOUT_MS = 6e4; +const textEncoder = new TextEncoder(); +function findLastClosingTagEnd(str) { + const len = str.length; + if (len < MIN_CLOSING_TAG_LENGTH) return -1; + let i = len - 1; + while (i >= MIN_CLOSING_TAG_LENGTH - 1) { + if (str.charCodeAt(i) === 62) { + let j = i - 1; + while (j >= 1) { + const code = str.charCodeAt(j); + if (code >= 97 && code <= 122 || // a-z + code >= 65 && code <= 90 || // A-Z + code >= 48 && code <= 57 || // 0-9 + code === 95 || // _ + code === 58 || // : + code === 46 || // . + code === 45) { + j--; + } else { + break; + } + } + const tagNameStart = j + 1; + if (tagNameStart < i) { + const startCode = str.charCodeAt(tagNameStart); + if (startCode >= 97 && startCode <= 122 || startCode >= 65 && startCode <= 90) { + if (j >= 1 && str.charCodeAt(j) === 47 && str.charCodeAt(j - 1) === 60) { + return i + 1; + } + } + } + } + i--; + } + return -1; +} +function transformStreamWithRouter(router, appStream, opts) { + const serializationAlreadyFinished = router.serverSsr?.isSerializationFinished() ?? false; + const initialBufferedHtml = router.serverSsr?.takeBufferedHtml(); + if (serializationAlreadyFinished && !initialBufferedHtml) { + let cleanedUp2 = false; + let controller2; + let isStreamClosed2 = false; + let lifetimeTimeoutHandle2; + const cleanup2 = () => { + if (cleanedUp2) return; + cleanedUp2 = true; + if (lifetimeTimeoutHandle2 !== void 0) { + clearTimeout(lifetimeTimeoutHandle2); + lifetimeTimeoutHandle2 = void 0; + } + router.serverSsr?.cleanup(); + }; + const safeClose2 = () => { + if (isStreamClosed2) return; + isStreamClosed2 = true; + try { + controller2?.close(); + } catch { + } + }; + const safeError2 = (error) => { + if (isStreamClosed2) return; + isStreamClosed2 = true; + try { + controller2?.error(error); + } catch { + } + }; + const lifetimeMs2 = DEFAULT_LIFETIME_TIMEOUT_MS; + lifetimeTimeoutHandle2 = setTimeout(() => { + if (!cleanedUp2 && !isStreamClosed2) { + console.warn( + `SSR stream transform exceeded maximum lifetime (${lifetimeMs2}ms), forcing cleanup` + ); + safeError2(new Error("Stream lifetime exceeded")); + cleanup2(); + } + }, lifetimeMs2); + const stream2 = new ReadableStream$1({ + start(c) { + controller2 = c; + }, + cancel() { + isStreamClosed2 = true; + cleanup2(); + } + }); + (async () => { + const reader = appStream.getReader(); + try { + while (true) { + const { done, value } = await reader.read(); + if (done) break; + if (cleanedUp2 || isStreamClosed2) return; + controller2?.enqueue(value); + } + if (cleanedUp2 || isStreamClosed2) return; + router.serverSsr?.setRenderFinished(); + safeClose2(); + cleanup2(); + } catch (error) { + if (cleanedUp2) return; + console.error("Error reading appStream:", error); + router.serverSsr?.setRenderFinished(); + safeError2(error); + cleanup2(); + } finally { + reader.releaseLock(); + } + })().catch((error) => { + if (cleanedUp2) return; + console.error("Error in stream transform:", error); + safeError2(error); + cleanup2(); + }); + return stream2; + } + let stopListeningToInjectedHtml; + let stopListeningToSerializationFinished; + let serializationTimeoutHandle; + let lifetimeTimeoutHandle; + let cleanedUp = false; + let controller; + let isStreamClosed = false; + const textDecoder = new TextDecoder(); + let pendingRouterHtml = initialBufferedHtml ?? ""; + let leftover = ""; + let pendingClosingTags = ""; + const MAX_LEFTOVER_CHARS = 2048; + let isAppRendering = true; + let streamBarrierLifted = false; + let serializationFinished = serializationAlreadyFinished; + function safeEnqueue(chunk) { + if (isStreamClosed) return; + if (typeof chunk === "string") { + controller.enqueue(textEncoder.encode(chunk)); + } else { + controller.enqueue(chunk); + } + } + function safeClose() { + if (isStreamClosed) return; + isStreamClosed = true; + try { + controller.close(); + } catch { + } + } + function safeError(error) { + if (isStreamClosed) return; + isStreamClosed = true; + try { + controller.error(error); + } catch { + } + } + function cleanup() { + if (cleanedUp) return; + cleanedUp = true; + try { + stopListeningToInjectedHtml?.(); + stopListeningToSerializationFinished?.(); + } catch { + } + stopListeningToInjectedHtml = void 0; + stopListeningToSerializationFinished = void 0; + if (serializationTimeoutHandle !== void 0) { + clearTimeout(serializationTimeoutHandle); + serializationTimeoutHandle = void 0; + } + if (lifetimeTimeoutHandle !== void 0) { + clearTimeout(lifetimeTimeoutHandle); + lifetimeTimeoutHandle = void 0; + } + pendingRouterHtml = ""; + leftover = ""; + pendingClosingTags = ""; + router.serverSsr?.cleanup(); + } + const stream = new ReadableStream$1({ + start(c) { + controller = c; + }, + cancel() { + isStreamClosed = true; + cleanup(); + } + }); + function flushPendingRouterHtml() { + if (!pendingRouterHtml) return; + safeEnqueue(pendingRouterHtml); + pendingRouterHtml = ""; + } + function appendRouterHtml(html) { + if (!html) return; + pendingRouterHtml += html; + } + function tryFinish() { + if (isAppRendering || !serializationFinished) return; + if (cleanedUp || isStreamClosed) return; + if (serializationTimeoutHandle !== void 0) { + clearTimeout(serializationTimeoutHandle); + serializationTimeoutHandle = void 0; + } + const decoderRemainder = textDecoder.decode(); + if (leftover) safeEnqueue(leftover); + if (decoderRemainder) safeEnqueue(decoderRemainder); + flushPendingRouterHtml(); + if (pendingClosingTags) safeEnqueue(pendingClosingTags); + safeClose(); + cleanup(); + } + const lifetimeMs = DEFAULT_LIFETIME_TIMEOUT_MS; + lifetimeTimeoutHandle = setTimeout(() => { + if (!cleanedUp && !isStreamClosed) { + console.warn( + `SSR stream transform exceeded maximum lifetime (${lifetimeMs}ms), forcing cleanup` + ); + safeError(new Error("Stream lifetime exceeded")); + cleanup(); + } + }, lifetimeMs); + if (!serializationAlreadyFinished) { + stopListeningToInjectedHtml = router.subscribe("onInjectedHtml", () => { + if (cleanedUp || isStreamClosed) return; + const html = router.serverSsr?.takeBufferedHtml(); + if (!html) return; + if (isAppRendering || leftover || pendingClosingTags) { + appendRouterHtml(html); + } else { + safeEnqueue(html); + } + }); + stopListeningToSerializationFinished = router.subscribe( + "onSerializationFinished", + () => { + serializationFinished = true; + tryFinish(); + } + ); + } + (async () => { + const reader = appStream.getReader(); + try { + while (true) { + const { done, value } = await reader.read(); + if (done) break; + if (cleanedUp || isStreamClosed) return; + const text = value instanceof Uint8Array ? textDecoder.decode(value, { stream: true }) : String(value); + const chunkString = leftover ? leftover + text : text; + if (!streamBarrierLifted) { + if (chunkString.includes(TSR_SCRIPT_BARRIER_ID)) { + streamBarrierLifted = true; + router.serverSsr?.liftScriptBarrier(); + } + } + if (pendingClosingTags) { + pendingClosingTags += chunkString; + leftover = ""; + continue; + } + const bodyEndIndex = chunkString.indexOf(BODY_END_TAG); + const htmlEndIndex = chunkString.indexOf(HTML_END_TAG); + if (bodyEndIndex !== -1 && htmlEndIndex !== -1 && bodyEndIndex < htmlEndIndex) { + pendingClosingTags = chunkString.slice(bodyEndIndex); + safeEnqueue(chunkString.slice(0, bodyEndIndex)); + flushPendingRouterHtml(); + leftover = ""; + continue; + } + const lastClosingTagEnd = findLastClosingTagEnd(chunkString); + if (lastClosingTagEnd > 0) { + safeEnqueue(chunkString.slice(0, lastClosingTagEnd)); + flushPendingRouterHtml(); + leftover = chunkString.slice(lastClosingTagEnd); + if (leftover.length > MAX_LEFTOVER_CHARS) { + safeEnqueue(leftover.slice(0, leftover.length - MAX_LEFTOVER_CHARS)); + leftover = leftover.slice(-MAX_LEFTOVER_CHARS); + } + } else { + const combined = chunkString; + if (combined.length > MAX_LEFTOVER_CHARS) { + const flushUpto = combined.length - MAX_LEFTOVER_CHARS; + safeEnqueue(combined.slice(0, flushUpto)); + leftover = combined.slice(flushUpto); + } else { + leftover = combined; + } + } + } + if (cleanedUp || isStreamClosed) return; + isAppRendering = false; + router.serverSsr?.setRenderFinished(); + if (serializationFinished) { + tryFinish(); + } else { + const timeoutMs = opts?.timeoutMs ?? DEFAULT_SERIALIZATION_TIMEOUT_MS; + serializationTimeoutHandle = setTimeout(() => { + if (!cleanedUp && !isStreamClosed) { + console.error("Serialization timeout after app render finished"); + safeError( + new Error("Serialization timeout after app render finished") + ); + cleanup(); + } + }, timeoutMs); + } + } catch (error) { + if (cleanedUp) return; + console.error("Error reading appStream:", error); + isAppRendering = false; + router.serverSsr?.setRenderFinished(); + safeError(error); + cleanup(); + } finally { + reader.releaseLock(); + } + })().catch((error) => { + if (cleanedUp) return; + console.error("Error in stream transform:", error); + safeError(error); + cleanup(); + }); + return stream; +} +export { + makeSerovalPlugin as A, + BaseRootRoute as B, + defineHandlerCallback as C, + redirect as D, + RouterCore as R, + rootRouteId as a, + isRedirect as b, + transformPipeableStreamWithRouter as c, + defaultGetScrollRestorationKey as d, + escapeHtml as e, + isDangerousProtocol as f, + getLocationChangeInfo as g, + exactPathTest as h, + isNotFound as i, + removeTrailingSlash as j, + deepEqual as k, + functionalUpdate as l, + BaseRoute as m, + isModuleNotFoundError as n, + getNormalizedURL as o, + getOrigin as p, + createSerializationAdapter as q, + restoreScroll as r, + storageKey as s, + transformReadableStreamWithRouter as t, + attachRouterServerSsrUtils as u, + createRawStreamRPCPlugin as v, + isResolvedRedirect as w, + mergeHeaders as x, + executeRewriteInput as y, + defaultSerovalPlugins as z +}; diff --git a/apps/admin/.output/server/_chunks/_libs/@tanstack/store.mjs b/apps/admin/.output/server/_chunks/_libs/@tanstack/store.mjs new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/apps/admin/.output/server/_chunks/_libs/@tanstack/store.mjs @@ -0,0 +1 @@ + diff --git a/apps/admin/.output/server/_chunks/_libs/asynckit.mjs b/apps/admin/.output/server/_chunks/_libs/asynckit.mjs new file mode 100644 index 00000000..fe4ce605 --- /dev/null +++ b/apps/admin/.output/server/_chunks/_libs/asynckit.mjs @@ -0,0 +1,220 @@ +function getDefaultExportFromCjs(x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x; +} +var defer_1; +var hasRequiredDefer; +function requireDefer() { + if (hasRequiredDefer) return defer_1; + hasRequiredDefer = 1; + defer_1 = defer; + function defer(fn) { + var nextTick = typeof setImmediate == "function" ? setImmediate : typeof process == "object" && typeof process.nextTick == "function" ? process.nextTick : null; + if (nextTick) { + nextTick(fn); + } else { + setTimeout(fn, 0); + } + } + return defer_1; +} +var async_1; +var hasRequiredAsync; +function requireAsync() { + if (hasRequiredAsync) return async_1; + hasRequiredAsync = 1; + var defer = /* @__PURE__ */ requireDefer(); + async_1 = async; + function async(callback) { + var isAsync = false; + defer(function() { + isAsync = true; + }); + return function async_callback(err, result) { + if (isAsync) { + callback(err, result); + } else { + defer(function nextTick_callback() { + callback(err, result); + }); + } + }; + } + return async_1; +} +var abort_1; +var hasRequiredAbort; +function requireAbort() { + if (hasRequiredAbort) return abort_1; + hasRequiredAbort = 1; + abort_1 = abort; + function abort(state) { + Object.keys(state.jobs).forEach(clean.bind(state)); + state.jobs = {}; + } + function clean(key) { + if (typeof this.jobs[key] == "function") { + this.jobs[key](); + } + } + return abort_1; +} +var iterate_1; +var hasRequiredIterate; +function requireIterate() { + if (hasRequiredIterate) return iterate_1; + hasRequiredIterate = 1; + var async = /* @__PURE__ */ requireAsync(), abort = /* @__PURE__ */ requireAbort(); + iterate_1 = iterate; + function iterate(list, iterator, state, callback) { + var key = state["keyedList"] ? state["keyedList"][state.index] : state.index; + state.jobs[key] = runJob(iterator, key, list[key], function(error, output) { + if (!(key in state.jobs)) { + return; + } + delete state.jobs[key]; + if (error) { + abort(state); + } else { + state.results[key] = output; + } + callback(error, state.results); + }); + } + function runJob(iterator, key, item, callback) { + var aborter; + if (iterator.length == 2) { + aborter = iterator(item, async(callback)); + } else { + aborter = iterator(item, key, async(callback)); + } + return aborter; + } + return iterate_1; +} +var state_1; +var hasRequiredState; +function requireState() { + if (hasRequiredState) return state_1; + hasRequiredState = 1; + state_1 = state; + function state(list, sortMethod) { + var isNamedList = !Array.isArray(list), initState = { + index: 0, + keyedList: isNamedList || sortMethod ? Object.keys(list) : null, + jobs: {}, + results: isNamedList ? {} : [], + size: isNamedList ? Object.keys(list).length : list.length + }; + if (sortMethod) { + initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) { + return sortMethod(list[a], list[b]); + }); + } + return initState; + } + return state_1; +} +var terminator_1; +var hasRequiredTerminator; +function requireTerminator() { + if (hasRequiredTerminator) return terminator_1; + hasRequiredTerminator = 1; + var abort = /* @__PURE__ */ requireAbort(), async = /* @__PURE__ */ requireAsync(); + terminator_1 = terminator; + function terminator(callback) { + if (!Object.keys(this.jobs).length) { + return; + } + this.index = this.size; + abort(this); + async(callback)(null, this.results); + } + return terminator_1; +} +var parallel_1; +var hasRequiredParallel; +function requireParallel() { + if (hasRequiredParallel) return parallel_1; + hasRequiredParallel = 1; + var iterate = /* @__PURE__ */ requireIterate(), initState = /* @__PURE__ */ requireState(), terminator = /* @__PURE__ */ requireTerminator(); + parallel_1 = parallel; + function parallel(list, iterator, callback) { + var state = initState(list); + while (state.index < (state["keyedList"] || list).length) { + iterate(list, iterator, state, function(error, result) { + if (error) { + callback(error, result); + return; + } + if (Object.keys(state.jobs).length === 0) { + callback(null, state.results); + return; + } + }); + state.index++; + } + return terminator.bind(state, callback); + } + return parallel_1; +} +var serialOrdered = { exports: {} }; +var hasRequiredSerialOrdered; +function requireSerialOrdered() { + if (hasRequiredSerialOrdered) return serialOrdered.exports; + hasRequiredSerialOrdered = 1; + var iterate = /* @__PURE__ */ requireIterate(), initState = /* @__PURE__ */ requireState(), terminator = /* @__PURE__ */ requireTerminator(); + serialOrdered.exports = serialOrdered$1; + serialOrdered.exports.ascending = ascending; + serialOrdered.exports.descending = descending; + function serialOrdered$1(list, iterator, sortMethod, callback) { + var state = initState(list, sortMethod); + iterate(list, iterator, state, function iteratorHandler(error, result) { + if (error) { + callback(error, result); + return; + } + state.index++; + if (state.index < (state["keyedList"] || list).length) { + iterate(list, iterator, state, iteratorHandler); + return; + } + callback(null, state.results); + }); + return terminator.bind(state, callback); + } + function ascending(a, b) { + return a < b ? -1 : a > b ? 1 : 0; + } + function descending(a, b) { + return -1 * ascending(a, b); + } + return serialOrdered.exports; +} +var serial_1; +var hasRequiredSerial; +function requireSerial() { + if (hasRequiredSerial) return serial_1; + hasRequiredSerial = 1; + var serialOrdered2 = /* @__PURE__ */ requireSerialOrdered(); + serial_1 = serial; + function serial(list, iterator, callback) { + return serialOrdered2(list, iterator, null, callback); + } + return serial_1; +} +var asynckit; +var hasRequiredAsynckit; +function requireAsynckit() { + if (hasRequiredAsynckit) return asynckit; + hasRequiredAsynckit = 1; + asynckit = { + parallel: /* @__PURE__ */ requireParallel(), + serial: /* @__PURE__ */ requireSerial(), + serialOrdered: /* @__PURE__ */ requireSerialOrdered() + }; + return asynckit; +} +export { + getDefaultExportFromCjs as g, + requireAsynckit as r +}; diff --git a/apps/admin/.output/server/_chunks/_libs/combined-stream.mjs b/apps/admin/.output/server/_chunks/_libs/combined-stream.mjs new file mode 100644 index 00000000..e573dca0 --- /dev/null +++ b/apps/admin/.output/server/_chunks/_libs/combined-stream.mjs @@ -0,0 +1,176 @@ +import require$$1 from "util"; +import stream from "stream"; +import { r as requireDelayed_stream } from "../../_libs/delayed-stream.mjs"; +var combined_stream; +var hasRequiredCombined_stream; +function requireCombined_stream() { + if (hasRequiredCombined_stream) return combined_stream; + hasRequiredCombined_stream = 1; + var util = require$$1; + var Stream = stream.Stream; + var DelayedStream = /* @__PURE__ */ requireDelayed_stream(); + combined_stream = CombinedStream; + function CombinedStream() { + this.writable = false; + this.readable = true; + this.dataSize = 0; + this.maxDataSize = 2 * 1024 * 1024; + this.pauseStreams = true; + this._released = false; + this._streams = []; + this._currentStream = null; + this._insideLoop = false; + this._pendingNext = false; + } + util.inherits(CombinedStream, Stream); + CombinedStream.create = function(options) { + var combinedStream = new this(); + options = options || {}; + for (var option in options) { + combinedStream[option] = options[option]; + } + return combinedStream; + }; + CombinedStream.isStreamLike = function(stream2) { + return typeof stream2 !== "function" && typeof stream2 !== "string" && typeof stream2 !== "boolean" && typeof stream2 !== "number" && !Buffer.isBuffer(stream2); + }; + CombinedStream.prototype.append = function(stream2) { + var isStreamLike = CombinedStream.isStreamLike(stream2); + if (isStreamLike) { + if (!(stream2 instanceof DelayedStream)) { + var newStream = DelayedStream.create(stream2, { + maxDataSize: Infinity, + pauseStream: this.pauseStreams + }); + stream2.on("data", this._checkDataSize.bind(this)); + stream2 = newStream; + } + this._handleErrors(stream2); + if (this.pauseStreams) { + stream2.pause(); + } + } + this._streams.push(stream2); + return this; + }; + CombinedStream.prototype.pipe = function(dest, options) { + Stream.prototype.pipe.call(this, dest, options); + this.resume(); + return dest; + }; + CombinedStream.prototype._getNext = function() { + this._currentStream = null; + if (this._insideLoop) { + this._pendingNext = true; + return; + } + this._insideLoop = true; + try { + do { + this._pendingNext = false; + this._realGetNext(); + } while (this._pendingNext); + } finally { + this._insideLoop = false; + } + }; + CombinedStream.prototype._realGetNext = function() { + var stream2 = this._streams.shift(); + if (typeof stream2 == "undefined") { + this.end(); + return; + } + if (typeof stream2 !== "function") { + this._pipeNext(stream2); + return; + } + var getStream = stream2; + getStream((function(stream3) { + var isStreamLike = CombinedStream.isStreamLike(stream3); + if (isStreamLike) { + stream3.on("data", this._checkDataSize.bind(this)); + this._handleErrors(stream3); + } + this._pipeNext(stream3); + }).bind(this)); + }; + CombinedStream.prototype._pipeNext = function(stream2) { + this._currentStream = stream2; + var isStreamLike = CombinedStream.isStreamLike(stream2); + if (isStreamLike) { + stream2.on("end", this._getNext.bind(this)); + stream2.pipe(this, { end: false }); + return; + } + var value = stream2; + this.write(value); + this._getNext(); + }; + CombinedStream.prototype._handleErrors = function(stream2) { + var self = this; + stream2.on("error", function(err) { + self._emitError(err); + }); + }; + CombinedStream.prototype.write = function(data) { + this.emit("data", data); + }; + CombinedStream.prototype.pause = function() { + if (!this.pauseStreams) { + return; + } + if (this.pauseStreams && this._currentStream && typeof this._currentStream.pause == "function") this._currentStream.pause(); + this.emit("pause"); + }; + CombinedStream.prototype.resume = function() { + if (!this._released) { + this._released = true; + this.writable = true; + this._getNext(); + } + if (this.pauseStreams && this._currentStream && typeof this._currentStream.resume == "function") this._currentStream.resume(); + this.emit("resume"); + }; + CombinedStream.prototype.end = function() { + this._reset(); + this.emit("end"); + }; + CombinedStream.prototype.destroy = function() { + this._reset(); + this.emit("close"); + }; + CombinedStream.prototype._reset = function() { + this.writable = false; + this._streams = []; + this._currentStream = null; + }; + CombinedStream.prototype._checkDataSize = function() { + this._updateDataSize(); + if (this.dataSize <= this.maxDataSize) { + return; + } + var message = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded."; + this._emitError(new Error(message)); + }; + CombinedStream.prototype._updateDataSize = function() { + this.dataSize = 0; + var self = this; + this._streams.forEach(function(stream2) { + if (!stream2.dataSize) { + return; + } + self.dataSize += stream2.dataSize; + }); + if (this._currentStream && this._currentStream.dataSize) { + this.dataSize += this._currentStream.dataSize; + } + }; + CombinedStream.prototype._emitError = function(err) { + this._reset(); + this.emit("error", err); + }; + return combined_stream; +} +export { + requireCombined_stream as r +}; diff --git a/apps/admin/.output/server/_chunks/_libs/debug.mjs b/apps/admin/.output/server/_chunks/_libs/debug.mjs new file mode 100644 index 00000000..e77de4d6 --- /dev/null +++ b/apps/admin/.output/server/_chunks/_libs/debug.mjs @@ -0,0 +1,547 @@ +import { r as requireMs } from "../../_libs/ms.mjs"; +import require$$1$1 from "tty"; +import require$$1 from "util"; +import { r as requireSupportsColor } from "./supports-color.mjs"; +var src = { exports: {} }; +var browser = { exports: {} }; +var common; +var hasRequiredCommon; +function requireCommon() { + if (hasRequiredCommon) return common; + hasRequiredCommon = 1; + function setup(env) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = /* @__PURE__ */ requireMs(); + createDebug.destroy = destroy; + Object.keys(env).forEach((key) => { + createDebug[key] = env[key]; + }); + createDebug.names = []; + createDebug.skips = []; + createDebug.formatters = {}; + function selectColor(namespace) { + let hash = 0; + for (let i = 0; i < namespace.length; i++) { + hash = (hash << 5) - hash + namespace.charCodeAt(i); + hash |= 0; + } + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + createDebug.selectColor = selectColor; + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; + function debug(...args) { + if (!debug.enabled) { + return; + } + const self = debug; + const curr = Number(/* @__PURE__ */ new Date()); + const ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + args[0] = createDebug.coerce(args[0]); + if (typeof args[0] !== "string") { + args.unshift("%O"); + } + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + if (match === "%%") { + return "%"; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === "function") { + const val = args[index]; + match = formatter.call(self, val); + args.splice(index, 1); + index--; + } + return match; + }); + createDebug.formatArgs.call(self, args); + const logFn = self.log || createDebug.log; + logFn.apply(self, args); + } + debug.namespace = namespace; + debug.useColors = createDebug.useColors(); + debug.color = createDebug.selectColor(namespace); + debug.extend = extend; + debug.destroy = createDebug.destroy; + Object.defineProperty(debug, "enabled", { + enumerable: true, + configurable: false, + get: () => { + if (enableOverride !== null) { + return enableOverride; + } + if (namespacesCache !== createDebug.namespaces) { + namespacesCache = createDebug.namespaces; + enabledCache = createDebug.enabled(namespace); + } + return enabledCache; + }, + set: (v) => { + enableOverride = v; + } + }); + if (typeof createDebug.init === "function") { + createDebug.init(debug); + } + return debug; + } + function extend(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; + } + function enable(namespaces) { + createDebug.save(namespaces); + createDebug.namespaces = namespaces; + createDebug.names = []; + createDebug.skips = []; + const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean); + for (const ns of split) { + if (ns[0] === "-") { + createDebug.skips.push(ns.slice(1)); + } else { + createDebug.names.push(ns); + } + } + } + function matchesTemplate(search, template) { + let searchIndex = 0; + let templateIndex = 0; + let starIndex = -1; + let matchIndex = 0; + while (searchIndex < search.length) { + if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) { + if (template[templateIndex] === "*") { + starIndex = templateIndex; + matchIndex = searchIndex; + templateIndex++; + } else { + searchIndex++; + templateIndex++; + } + } else if (starIndex !== -1) { + templateIndex = starIndex + 1; + matchIndex++; + searchIndex = matchIndex; + } else { + return false; + } + } + while (templateIndex < template.length && template[templateIndex] === "*") { + templateIndex++; + } + return templateIndex === template.length; + } + function disable() { + const namespaces = [ + ...createDebug.names, + ...createDebug.skips.map((namespace) => "-" + namespace) + ].join(","); + createDebug.enable(""); + return namespaces; + } + function enabled(name) { + for (const skip of createDebug.skips) { + if (matchesTemplate(name, skip)) { + return false; + } + } + for (const ns of createDebug.names) { + if (matchesTemplate(name, ns)) { + return true; + } + } + return false; + } + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + return val; + } + function destroy() { + console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); + } + createDebug.enable(createDebug.load()); + return createDebug; + } + common = setup; + return common; +} +var hasRequiredBrowser; +function requireBrowser() { + if (hasRequiredBrowser) return browser.exports; + hasRequiredBrowser = 1; + (function(module, exports$1) { + exports$1.formatArgs = formatArgs; + exports$1.save = save; + exports$1.load = load; + exports$1.useColors = useColors; + exports$1.storage = localstorage(); + exports$1.destroy = /* @__PURE__ */ (() => { + let warned = false; + return () => { + if (!warned) { + warned = true; + console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); + } + }; + })(); + exports$1.colors = [ + "#0000CC", + "#0000FF", + "#0033CC", + "#0033FF", + "#0066CC", + "#0066FF", + "#0099CC", + "#0099FF", + "#00CC00", + "#00CC33", + "#00CC66", + "#00CC99", + "#00CCCC", + "#00CCFF", + "#3300CC", + "#3300FF", + "#3333CC", + "#3333FF", + "#3366CC", + "#3366FF", + "#3399CC", + "#3399FF", + "#33CC00", + "#33CC33", + "#33CC66", + "#33CC99", + "#33CCCC", + "#33CCFF", + "#6600CC", + "#6600FF", + "#6633CC", + "#6633FF", + "#66CC00", + "#66CC33", + "#9900CC", + "#9900FF", + "#9933CC", + "#9933FF", + "#99CC00", + "#99CC33", + "#CC0000", + "#CC0033", + "#CC0066", + "#CC0099", + "#CC00CC", + "#CC00FF", + "#CC3300", + "#CC3333", + "#CC3366", + "#CC3399", + "#CC33CC", + "#CC33FF", + "#CC6600", + "#CC6633", + "#CC9900", + "#CC9933", + "#CCCC00", + "#CCCC33", + "#FF0000", + "#FF0033", + "#FF0066", + "#FF0099", + "#FF00CC", + "#FF00FF", + "#FF3300", + "#FF3333", + "#FF3366", + "#FF3399", + "#FF33CC", + "#FF33FF", + "#FF6600", + "#FF6633", + "#FF9900", + "#FF9933", + "#FFCC00", + "#FFCC33" + ]; + function useColors() { + if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) { + return true; + } + if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } + let m; + return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 + typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker + typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); + } + function formatArgs(args) { + args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff); + if (!this.useColors) { + return; + } + const c = "color: " + this.color; + args.splice(1, 0, c, "color: inherit"); + let index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, (match) => { + if (match === "%%") { + return; + } + index++; + if (match === "%c") { + lastC = index; + } + }); + args.splice(lastC, 0, c); + } + exports$1.log = console.debug || console.log || (() => { + }); + function save(namespaces) { + try { + if (namespaces) { + exports$1.storage.setItem("debug", namespaces); + } else { + exports$1.storage.removeItem("debug"); + } + } catch (error) { + } + } + function load() { + let r; + try { + r = exports$1.storage.getItem("debug") || exports$1.storage.getItem("DEBUG"); + } catch (error) { + } + if (!r && typeof process !== "undefined" && "env" in process) { + r = process.env.DEBUG; + } + return r; + } + function localstorage() { + try { + return localStorage; + } catch (error) { + } + } + module.exports = /* @__PURE__ */ requireCommon()(exports$1); + const { formatters } = module.exports; + formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (error) { + return "[UnexpectedJSONParseError]: " + error.message; + } + }; + })(browser, browser.exports); + return browser.exports; +} +var node = { exports: {} }; +var hasRequiredNode; +function requireNode() { + if (hasRequiredNode) return node.exports; + hasRequiredNode = 1; + (function(module, exports$1) { + const tty = require$$1$1; + const util = require$$1; + exports$1.init = init; + exports$1.log = log; + exports$1.formatArgs = formatArgs; + exports$1.save = save; + exports$1.load = load; + exports$1.useColors = useColors; + exports$1.destroy = util.deprecate( + () => { + }, + "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`." + ); + exports$1.colors = [6, 2, 3, 4, 5, 1]; + try { + const supportsColor = /* @__PURE__ */ requireSupportsColor(); + if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { + exports$1.colors = [ + 20, + 21, + 26, + 27, + 32, + 33, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 56, + 57, + 62, + 63, + 68, + 69, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 92, + 93, + 98, + 99, + 112, + 113, + 128, + 129, + 134, + 135, + 148, + 149, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 178, + 179, + 184, + 185, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 214, + 215, + 220, + 221 + ]; + } + } catch (error) { + } + exports$1.inspectOpts = Object.keys(process.env).filter((key) => { + return /^debug_/i.test(key); + }).reduce((obj, key) => { + const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => { + return k.toUpperCase(); + }); + let val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) { + val = true; + } else if (/^(no|off|false|disabled)$/i.test(val)) { + val = false; + } else if (val === "null") { + val = null; + } else { + val = Number(val); + } + obj[prop] = val; + return obj; + }, {}); + function useColors() { + return "colors" in exports$1.inspectOpts ? Boolean(exports$1.inspectOpts.colors) : tty.isatty(process.stderr.fd); + } + function formatArgs(args) { + const { namespace: name, useColors: useColors2 } = this; + if (useColors2) { + const c = this.color; + const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c); + const prefix = ` ${colorCode};1m${name} \x1B[0m`; + args[0] = prefix + args[0].split("\n").join("\n" + prefix); + args.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1B[0m"); + } else { + args[0] = getDate() + name + " " + args[0]; + } + } + function getDate() { + if (exports$1.inspectOpts.hideDate) { + return ""; + } + return (/* @__PURE__ */ new Date()).toISOString() + " "; + } + function log(...args) { + return process.stderr.write(util.formatWithOptions(exports$1.inspectOpts, ...args) + "\n"); + } + function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + delete process.env.DEBUG; + } + } + function load() { + return process.env.DEBUG; + } + function init(debug) { + debug.inspectOpts = {}; + const keys = Object.keys(exports$1.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports$1.inspectOpts[keys[i]]; + } + } + module.exports = /* @__PURE__ */ requireCommon()(exports$1); + const { formatters } = module.exports; + formatters.o = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" "); + }; + formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); + }; + })(node, node.exports); + return node.exports; +} +var hasRequiredSrc; +function requireSrc() { + if (hasRequiredSrc) return src.exports; + hasRequiredSrc = 1; + if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) { + src.exports = /* @__PURE__ */ requireBrowser(); + } else { + src.exports = /* @__PURE__ */ requireNode(); + } + return src.exports; +} +export { + requireSrc as r +}; diff --git a/apps/admin/.output/server/_chunks/_libs/follow-redirects.mjs b/apps/admin/.output/server/_chunks/_libs/follow-redirects.mjs new file mode 100644 index 00000000..ad3d9cb8 --- /dev/null +++ b/apps/admin/.output/server/_chunks/_libs/follow-redirects.mjs @@ -0,0 +1,530 @@ +import { g as getDefaultExportFromCjs } from "./asynckit.mjs"; +import require$$0 from "url"; +import require$$3 from "http"; +import require$$4$1 from "https"; +import stream from "stream"; +import require$$4 from "assert"; +import { r as requireSrc } from "./debug.mjs"; +var followRedirects$1 = { exports: {} }; +var debug_1; +var hasRequiredDebug; +function requireDebug() { + if (hasRequiredDebug) return debug_1; + hasRequiredDebug = 1; + var debug; + debug_1 = function() { + if (!debug) { + try { + debug = /* @__PURE__ */ requireSrc()("follow-redirects"); + } catch (error) { + } + if (typeof debug !== "function") { + debug = function() { + }; + } + } + debug.apply(null, arguments); + }; + return debug_1; +} +var hasRequiredFollowRedirects; +function requireFollowRedirects() { + if (hasRequiredFollowRedirects) return followRedirects$1.exports; + hasRequiredFollowRedirects = 1; + var url = require$$0; + var URL = url.URL; + var http = require$$3; + var https = require$$4$1; + var Writable = stream.Writable; + var assert = require$$4; + var debug = /* @__PURE__ */ requireDebug(); + (function detectUnsupportedEnvironment() { + var looksLikeNode = typeof process !== "undefined"; + var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined"; + var looksLikeV8 = isFunction(Error.captureStackTrace); + if (!looksLikeNode && (looksLikeBrowser || !looksLikeV8)) { + console.warn("The follow-redirects package should be excluded from browser builds."); + } + })(); + var useNativeURL = false; + try { + assert(new URL("")); + } catch (error) { + useNativeURL = error.code === "ERR_INVALID_URL"; + } + var preservedUrlFields = [ + "auth", + "host", + "hostname", + "href", + "path", + "pathname", + "port", + "protocol", + "query", + "search", + "hash" + ]; + var events = ["abort", "aborted", "connect", "error", "socket", "timeout"]; + var eventHandlers = /* @__PURE__ */ Object.create(null); + events.forEach(function(event) { + eventHandlers[event] = function(arg1, arg2, arg3) { + this._redirectable.emit(event, arg1, arg2, arg3); + }; + }); + var InvalidUrlError = createErrorType( + "ERR_INVALID_URL", + "Invalid URL", + TypeError + ); + var RedirectionError = createErrorType( + "ERR_FR_REDIRECTION_FAILURE", + "Redirected request failed" + ); + var TooManyRedirectsError = createErrorType( + "ERR_FR_TOO_MANY_REDIRECTS", + "Maximum number of redirects exceeded", + RedirectionError + ); + var MaxBodyLengthExceededError = createErrorType( + "ERR_FR_MAX_BODY_LENGTH_EXCEEDED", + "Request body larger than maxBodyLength limit" + ); + var WriteAfterEndError = createErrorType( + "ERR_STREAM_WRITE_AFTER_END", + "write after end" + ); + var destroy = Writable.prototype.destroy || noop; + function RedirectableRequest(options, responseCallback) { + Writable.call(this); + this._sanitizeOptions(options); + this._options = options; + this._ended = false; + this._ending = false; + this._redirectCount = 0; + this._redirects = []; + this._requestBodyLength = 0; + this._requestBodyBuffers = []; + if (responseCallback) { + this.on("response", responseCallback); + } + var self = this; + this._onNativeResponse = function(response) { + try { + self._processResponse(response); + } catch (cause) { + self.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause })); + } + }; + this._performRequest(); + } + RedirectableRequest.prototype = Object.create(Writable.prototype); + RedirectableRequest.prototype.abort = function() { + destroyRequest(this._currentRequest); + this._currentRequest.abort(); + this.emit("abort"); + }; + RedirectableRequest.prototype.destroy = function(error) { + destroyRequest(this._currentRequest, error); + destroy.call(this, error); + return this; + }; + RedirectableRequest.prototype.write = function(data, encoding, callback) { + if (this._ending) { + throw new WriteAfterEndError(); + } + if (!isString(data) && !isBuffer(data)) { + throw new TypeError("data should be a string, Buffer or Uint8Array"); + } + if (isFunction(encoding)) { + callback = encoding; + encoding = null; + } + if (data.length === 0) { + if (callback) { + callback(); + } + return; + } + if (this._requestBodyLength + data.length <= this._options.maxBodyLength) { + this._requestBodyLength += data.length; + this._requestBodyBuffers.push({ data, encoding }); + this._currentRequest.write(data, encoding, callback); + } else { + this.emit("error", new MaxBodyLengthExceededError()); + this.abort(); + } + }; + RedirectableRequest.prototype.end = function(data, encoding, callback) { + if (isFunction(data)) { + callback = data; + data = encoding = null; + } else if (isFunction(encoding)) { + callback = encoding; + encoding = null; + } + if (!data) { + this._ended = this._ending = true; + this._currentRequest.end(null, null, callback); + } else { + var self = this; + var currentRequest = this._currentRequest; + this.write(data, encoding, function() { + self._ended = true; + currentRequest.end(null, null, callback); + }); + this._ending = true; + } + }; + RedirectableRequest.prototype.setHeader = function(name, value) { + this._options.headers[name] = value; + this._currentRequest.setHeader(name, value); + }; + RedirectableRequest.prototype.removeHeader = function(name) { + delete this._options.headers[name]; + this._currentRequest.removeHeader(name); + }; + RedirectableRequest.prototype.setTimeout = function(msecs, callback) { + var self = this; + function destroyOnTimeout(socket) { + socket.setTimeout(msecs); + socket.removeListener("timeout", socket.destroy); + socket.addListener("timeout", socket.destroy); + } + function startTimer(socket) { + if (self._timeout) { + clearTimeout(self._timeout); + } + self._timeout = setTimeout(function() { + self.emit("timeout"); + clearTimer(); + }, msecs); + destroyOnTimeout(socket); + } + function clearTimer() { + if (self._timeout) { + clearTimeout(self._timeout); + self._timeout = null; + } + self.removeListener("abort", clearTimer); + self.removeListener("error", clearTimer); + self.removeListener("response", clearTimer); + self.removeListener("close", clearTimer); + if (callback) { + self.removeListener("timeout", callback); + } + if (!self.socket) { + self._currentRequest.removeListener("socket", startTimer); + } + } + if (callback) { + this.on("timeout", callback); + } + if (this.socket) { + startTimer(this.socket); + } else { + this._currentRequest.once("socket", startTimer); + } + this.on("socket", destroyOnTimeout); + this.on("abort", clearTimer); + this.on("error", clearTimer); + this.on("response", clearTimer); + this.on("close", clearTimer); + return this; + }; + [ + "flushHeaders", + "getHeader", + "setNoDelay", + "setSocketKeepAlive" + ].forEach(function(method) { + RedirectableRequest.prototype[method] = function(a, b) { + return this._currentRequest[method](a, b); + }; + }); + ["aborted", "connection", "socket"].forEach(function(property) { + Object.defineProperty(RedirectableRequest.prototype, property, { + get: function() { + return this._currentRequest[property]; + } + }); + }); + RedirectableRequest.prototype._sanitizeOptions = function(options) { + if (!options.headers) { + options.headers = {}; + } + if (options.host) { + if (!options.hostname) { + options.hostname = options.host; + } + delete options.host; + } + if (!options.pathname && options.path) { + var searchPos = options.path.indexOf("?"); + if (searchPos < 0) { + options.pathname = options.path; + } else { + options.pathname = options.path.substring(0, searchPos); + options.search = options.path.substring(searchPos); + } + } + }; + RedirectableRequest.prototype._performRequest = function() { + var protocol = this._options.protocol; + var nativeProtocol = this._options.nativeProtocols[protocol]; + if (!nativeProtocol) { + throw new TypeError("Unsupported protocol " + protocol); + } + if (this._options.agents) { + var scheme = protocol.slice(0, -1); + this._options.agent = this._options.agents[scheme]; + } + var request = this._currentRequest = nativeProtocol.request(this._options, this._onNativeResponse); + request._redirectable = this; + for (var event of events) { + request.on(event, eventHandlers[event]); + } + this._currentUrl = /^\//.test(this._options.path) ? url.format(this._options) : ( + // When making a request to a proxy, […] + // a client MUST send the target URI in absolute-form […]. + this._options.path + ); + if (this._isRedirect) { + var i = 0; + var self = this; + var buffers = this._requestBodyBuffers; + (function writeNext(error) { + if (request === self._currentRequest) { + if (error) { + self.emit("error", error); + } else if (i < buffers.length) { + var buffer = buffers[i++]; + if (!request.finished) { + request.write(buffer.data, buffer.encoding, writeNext); + } + } else if (self._ended) { + request.end(); + } + } + })(); + } + }; + RedirectableRequest.prototype._processResponse = function(response) { + var statusCode = response.statusCode; + if (this._options.trackRedirects) { + this._redirects.push({ + url: this._currentUrl, + headers: response.headers, + statusCode + }); + } + var location = response.headers.location; + if (!location || this._options.followRedirects === false || statusCode < 300 || statusCode >= 400) { + response.responseUrl = this._currentUrl; + response.redirects = this._redirects; + this.emit("response", response); + this._requestBodyBuffers = []; + return; + } + destroyRequest(this._currentRequest); + response.destroy(); + if (++this._redirectCount > this._options.maxRedirects) { + throw new TooManyRedirectsError(); + } + var requestHeaders; + var beforeRedirect = this._options.beforeRedirect; + if (beforeRedirect) { + requestHeaders = Object.assign({ + // The Host header was set by nativeProtocol.request + Host: response.req.getHeader("host") + }, this._options.headers); + } + var method = this._options.method; + if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || // RFC7231§6.4.4: The 303 (See Other) status code indicates that + // the server is redirecting the user agent to a different resource […] + // A user agent can perform a retrieval request targeting that URI + // (a GET or HEAD request if using HTTP) […] + statusCode === 303 && !/^(?:GET|HEAD)$/.test(this._options.method)) { + this._options.method = "GET"; + this._requestBodyBuffers = []; + removeMatchingHeaders(/^content-/i, this._options.headers); + } + var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers); + var currentUrlParts = parseUrl(this._currentUrl); + var currentHost = currentHostHeader || currentUrlParts.host; + var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url.format(Object.assign(currentUrlParts, { host: currentHost })); + var redirectUrl = resolveUrl(location, currentUrl); + debug("redirecting to", redirectUrl.href); + this._isRedirect = true; + spreadUrlObject(redirectUrl, this._options); + if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) { + removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers); + } + if (isFunction(beforeRedirect)) { + var responseDetails = { + headers: response.headers, + statusCode + }; + var requestDetails = { + url: currentUrl, + method, + headers: requestHeaders + }; + beforeRedirect(this._options, responseDetails, requestDetails); + this._sanitizeOptions(this._options); + } + this._performRequest(); + }; + function wrap(protocols) { + var exports$1 = { + maxRedirects: 21, + maxBodyLength: 10 * 1024 * 1024 + }; + var nativeProtocols = {}; + Object.keys(protocols).forEach(function(scheme) { + var protocol = scheme + ":"; + var nativeProtocol = nativeProtocols[protocol] = protocols[scheme]; + var wrappedProtocol = exports$1[scheme] = Object.create(nativeProtocol); + function request(input, options, callback) { + if (isURL(input)) { + input = spreadUrlObject(input); + } else if (isString(input)) { + input = spreadUrlObject(parseUrl(input)); + } else { + callback = options; + options = validateUrl(input); + input = { protocol }; + } + if (isFunction(options)) { + callback = options; + options = null; + } + options = Object.assign({ + maxRedirects: exports$1.maxRedirects, + maxBodyLength: exports$1.maxBodyLength + }, input, options); + options.nativeProtocols = nativeProtocols; + if (!isString(options.host) && !isString(options.hostname)) { + options.hostname = "::1"; + } + assert.equal(options.protocol, protocol, "protocol mismatch"); + debug("options", options); + return new RedirectableRequest(options, callback); + } + function get(input, options, callback) { + var wrappedRequest = wrappedProtocol.request(input, options, callback); + wrappedRequest.end(); + return wrappedRequest; + } + Object.defineProperties(wrappedProtocol, { + request: { value: request, configurable: true, enumerable: true, writable: true }, + get: { value: get, configurable: true, enumerable: true, writable: true } + }); + }); + return exports$1; + } + function noop() { + } + function parseUrl(input) { + var parsed; + if (useNativeURL) { + parsed = new URL(input); + } else { + parsed = validateUrl(url.parse(input)); + if (!isString(parsed.protocol)) { + throw new InvalidUrlError({ input }); + } + } + return parsed; + } + function resolveUrl(relative, base) { + return useNativeURL ? new URL(relative, base) : parseUrl(url.resolve(base, relative)); + } + function validateUrl(input) { + if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) { + throw new InvalidUrlError({ input: input.href || input }); + } + if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) { + throw new InvalidUrlError({ input: input.href || input }); + } + return input; + } + function spreadUrlObject(urlObject, target) { + var spread = target || {}; + for (var key of preservedUrlFields) { + spread[key] = urlObject[key]; + } + if (spread.hostname.startsWith("[")) { + spread.hostname = spread.hostname.slice(1, -1); + } + if (spread.port !== "") { + spread.port = Number(spread.port); + } + spread.path = spread.search ? spread.pathname + spread.search : spread.pathname; + return spread; + } + function removeMatchingHeaders(regex, headers) { + var lastValue; + for (var header in headers) { + if (regex.test(header)) { + lastValue = headers[header]; + delete headers[header]; + } + } + return lastValue === null || typeof lastValue === "undefined" ? void 0 : String(lastValue).trim(); + } + function createErrorType(code, message, baseClass) { + function CustomError(properties) { + if (isFunction(Error.captureStackTrace)) { + Error.captureStackTrace(this, this.constructor); + } + Object.assign(this, properties || {}); + this.code = code; + this.message = this.cause ? message + ": " + this.cause.message : message; + } + CustomError.prototype = new (baseClass || Error)(); + Object.defineProperties(CustomError.prototype, { + constructor: { + value: CustomError, + enumerable: false + }, + name: { + value: "Error [" + code + "]", + enumerable: false + } + }); + return CustomError; + } + function destroyRequest(request, error) { + for (var event of events) { + request.removeListener(event, eventHandlers[event]); + } + request.on("error", noop); + request.destroy(error); + } + function isSubdomain(subdomain, domain) { + assert(isString(subdomain) && isString(domain)); + var dot = subdomain.length - domain.length - 1; + return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); + } + function isString(value) { + return typeof value === "string" || value instanceof String; + } + function isFunction(value) { + return typeof value === "function"; + } + function isBuffer(value) { + return typeof value === "object" && "length" in value; + } + function isURL(value) { + return URL && value instanceof URL; + } + followRedirects$1.exports = wrap({ http, https }); + followRedirects$1.exports.wrap = wrap; + return followRedirects$1.exports; +} +var followRedirectsExports = /* @__PURE__ */ requireFollowRedirects(); +const followRedirects = /* @__PURE__ */ getDefaultExportFromCjs(followRedirectsExports); +export { + followRedirects as f +}; diff --git a/apps/admin/.output/server/_chunks/_libs/form-data.mjs b/apps/admin/.output/server/_chunks/_libs/form-data.mjs new file mode 100644 index 00000000..fc0e373f --- /dev/null +++ b/apps/admin/.output/server/_chunks/_libs/form-data.mjs @@ -0,0 +1,350 @@ +import { r as requireAsynckit, g as getDefaultExportFromCjs } from "./asynckit.mjs"; +import { r as requireCombined_stream } from "./combined-stream.mjs"; +import require$$1 from "util"; +import require$$1$1 from "path"; +import require$$3 from "http"; +import require$$4 from "https"; +import require$$0 from "url"; +import require$$6 from "fs"; +import stream from "stream"; +import require$$1$2 from "crypto"; +import { r as requireMimeTypes } from "../../_libs/mime-types.mjs"; +import { r as requireEsSetTostringtag } from "../../_libs/es-set-tostringtag.mjs"; +import { r as requireHasown } from "../../_libs/hasown.mjs"; +var populate; +var hasRequiredPopulate; +function requirePopulate() { + if (hasRequiredPopulate) return populate; + hasRequiredPopulate = 1; + populate = function(dst, src) { + Object.keys(src).forEach(function(prop) { + dst[prop] = dst[prop] || src[prop]; + }); + return dst; + }; + return populate; +} +var form_data; +var hasRequiredForm_data; +function requireForm_data() { + if (hasRequiredForm_data) return form_data; + hasRequiredForm_data = 1; + var CombinedStream = /* @__PURE__ */ requireCombined_stream(); + var util = require$$1; + var path = require$$1$1; + var http = require$$3; + var https = require$$4; + var parseUrl = require$$0.parse; + var fs = require$$6; + var Stream = stream.Stream; + var crypto = require$$1$2; + var mime = /* @__PURE__ */ requireMimeTypes(); + var asynckit = /* @__PURE__ */ requireAsynckit(); + var setToStringTag = /* @__PURE__ */ requireEsSetTostringtag(); + var hasOwn = /* @__PURE__ */ requireHasown(); + var populate2 = /* @__PURE__ */ requirePopulate(); + function FormData2(options) { + if (!(this instanceof FormData2)) { + return new FormData2(options); + } + this._overheadLength = 0; + this._valueLength = 0; + this._valuesToMeasure = []; + CombinedStream.call(this); + options = options || {}; + for (var option in options) { + this[option] = options[option]; + } + } + util.inherits(FormData2, CombinedStream); + FormData2.LINE_BREAK = "\r\n"; + FormData2.DEFAULT_CONTENT_TYPE = "application/octet-stream"; + FormData2.prototype.append = function(field, value, options) { + options = options || {}; + if (typeof options === "string") { + options = { filename: options }; + } + var append = CombinedStream.prototype.append.bind(this); + if (typeof value === "number" || value == null) { + value = String(value); + } + if (Array.isArray(value)) { + this._error(new Error("Arrays are not supported.")); + return; + } + var header = this._multiPartHeader(field, value, options); + var footer = this._multiPartFooter(); + append(header); + append(value); + append(footer); + this._trackLength(header, value, options); + }; + FormData2.prototype._trackLength = function(header, value, options) { + var valueLength = 0; + if (options.knownLength != null) { + valueLength += Number(options.knownLength); + } else if (Buffer.isBuffer(value)) { + valueLength = value.length; + } else if (typeof value === "string") { + valueLength = Buffer.byteLength(value); + } + this._valueLength += valueLength; + this._overheadLength += Buffer.byteLength(header) + FormData2.LINE_BREAK.length; + if (!value || !value.path && !(value.readable && hasOwn(value, "httpVersion")) && !(value instanceof Stream)) { + return; + } + if (!options.knownLength) { + this._valuesToMeasure.push(value); + } + }; + FormData2.prototype._lengthRetriever = function(value, callback) { + if (hasOwn(value, "fd")) { + if (value.end != void 0 && value.end != Infinity && value.start != void 0) { + callback(null, value.end + 1 - (value.start ? value.start : 0)); + } else { + fs.stat(value.path, function(err, stat) { + if (err) { + callback(err); + return; + } + var fileSize = stat.size - (value.start ? value.start : 0); + callback(null, fileSize); + }); + } + } else if (hasOwn(value, "httpVersion")) { + callback(null, Number(value.headers["content-length"])); + } else if (hasOwn(value, "httpModule")) { + value.on("response", function(response) { + value.pause(); + callback(null, Number(response.headers["content-length"])); + }); + value.resume(); + } else { + callback("Unknown stream"); + } + }; + FormData2.prototype._multiPartHeader = function(field, value, options) { + if (typeof options.header === "string") { + return options.header; + } + var contentDisposition = this._getContentDisposition(value, options); + var contentType = this._getContentType(value, options); + var contents = ""; + var headers = { + // add custom disposition as third element or keep it two elements if not + "Content-Disposition": ["form-data", 'name="' + field + '"'].concat(contentDisposition || []), + // if no content type. allow it to be empty array + "Content-Type": [].concat(contentType || []) + }; + if (typeof options.header === "object") { + populate2(headers, options.header); + } + var header; + for (var prop in headers) { + if (hasOwn(headers, prop)) { + header = headers[prop]; + if (header == null) { + continue; + } + if (!Array.isArray(header)) { + header = [header]; + } + if (header.length) { + contents += prop + ": " + header.join("; ") + FormData2.LINE_BREAK; + } + } + } + return "--" + this.getBoundary() + FormData2.LINE_BREAK + contents + FormData2.LINE_BREAK; + }; + FormData2.prototype._getContentDisposition = function(value, options) { + var filename; + if (typeof options.filepath === "string") { + filename = path.normalize(options.filepath).replace(/\\/g, "/"); + } else if (options.filename || value && (value.name || value.path)) { + filename = path.basename(options.filename || value && (value.name || value.path)); + } else if (value && value.readable && hasOwn(value, "httpVersion")) { + filename = path.basename(value.client._httpMessage.path || ""); + } + if (filename) { + return 'filename="' + filename + '"'; + } + }; + FormData2.prototype._getContentType = function(value, options) { + var contentType = options.contentType; + if (!contentType && value && value.name) { + contentType = mime.lookup(value.name); + } + if (!contentType && value && value.path) { + contentType = mime.lookup(value.path); + } + if (!contentType && value && value.readable && hasOwn(value, "httpVersion")) { + contentType = value.headers["content-type"]; + } + if (!contentType && (options.filepath || options.filename)) { + contentType = mime.lookup(options.filepath || options.filename); + } + if (!contentType && value && typeof value === "object") { + contentType = FormData2.DEFAULT_CONTENT_TYPE; + } + return contentType; + }; + FormData2.prototype._multiPartFooter = function() { + return (function(next) { + var footer = FormData2.LINE_BREAK; + var lastPart = this._streams.length === 0; + if (lastPart) { + footer += this._lastBoundary(); + } + next(footer); + }).bind(this); + }; + FormData2.prototype._lastBoundary = function() { + return "--" + this.getBoundary() + "--" + FormData2.LINE_BREAK; + }; + FormData2.prototype.getHeaders = function(userHeaders) { + var header; + var formHeaders = { + "content-type": "multipart/form-data; boundary=" + this.getBoundary() + }; + for (header in userHeaders) { + if (hasOwn(userHeaders, header)) { + formHeaders[header.toLowerCase()] = userHeaders[header]; + } + } + return formHeaders; + }; + FormData2.prototype.setBoundary = function(boundary) { + if (typeof boundary !== "string") { + throw new TypeError("FormData boundary must be a string"); + } + this._boundary = boundary; + }; + FormData2.prototype.getBoundary = function() { + if (!this._boundary) { + this._generateBoundary(); + } + return this._boundary; + }; + FormData2.prototype.getBuffer = function() { + var dataBuffer = new Buffer.alloc(0); + var boundary = this.getBoundary(); + for (var i = 0, len = this._streams.length; i < len; i++) { + if (typeof this._streams[i] !== "function") { + if (Buffer.isBuffer(this._streams[i])) { + dataBuffer = Buffer.concat([dataBuffer, this._streams[i]]); + } else { + dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i])]); + } + if (typeof this._streams[i] !== "string" || this._streams[i].substring(2, boundary.length + 2) !== boundary) { + dataBuffer = Buffer.concat([dataBuffer, Buffer.from(FormData2.LINE_BREAK)]); + } + } + } + return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]); + }; + FormData2.prototype._generateBoundary = function() { + this._boundary = "--------------------------" + crypto.randomBytes(12).toString("hex"); + }; + FormData2.prototype.getLengthSync = function() { + var knownLength = this._overheadLength + this._valueLength; + if (this._streams.length) { + knownLength += this._lastBoundary().length; + } + if (!this.hasKnownLength()) { + this._error(new Error("Cannot calculate proper length in synchronous way.")); + } + return knownLength; + }; + FormData2.prototype.hasKnownLength = function() { + var hasKnownLength = true; + if (this._valuesToMeasure.length) { + hasKnownLength = false; + } + return hasKnownLength; + }; + FormData2.prototype.getLength = function(cb) { + var knownLength = this._overheadLength + this._valueLength; + if (this._streams.length) { + knownLength += this._lastBoundary().length; + } + if (!this._valuesToMeasure.length) { + process.nextTick(cb.bind(this, null, knownLength)); + return; + } + asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) { + if (err) { + cb(err); + return; + } + values.forEach(function(length) { + knownLength += length; + }); + cb(null, knownLength); + }); + }; + FormData2.prototype.submit = function(params, cb) { + var request; + var options; + var defaults = { method: "post" }; + if (typeof params === "string") { + params = parseUrl(params); + options = populate2({ + port: params.port, + path: params.pathname, + host: params.hostname, + protocol: params.protocol + }, defaults); + } else { + options = populate2(params, defaults); + if (!options.port) { + options.port = options.protocol === "https:" ? 443 : 80; + } + } + options.headers = this.getHeaders(params.headers); + if (options.protocol === "https:") { + request = https.request(options); + } else { + request = http.request(options); + } + this.getLength((function(err, length) { + if (err && err !== "Unknown stream") { + this._error(err); + return; + } + if (length) { + request.setHeader("Content-Length", length); + } + this.pipe(request); + if (cb) { + var onResponse; + var callback = function(error, responce) { + request.removeListener("error", callback); + request.removeListener("response", onResponse); + return cb.call(this, error, responce); + }; + onResponse = callback.bind(this, null); + request.on("error", callback); + request.on("response", onResponse); + } + }).bind(this)); + return request; + }; + FormData2.prototype._error = function(err) { + if (!this.error) { + this.error = err; + this.pause(); + this.emit("error", err); + } + }; + FormData2.prototype.toString = function() { + return "[object FormData]"; + }; + setToStringTag(FormData2.prototype, "FormData"); + form_data = FormData2; + return form_data; +} +var form_dataExports = /* @__PURE__ */ requireForm_data(); +const FormData = /* @__PURE__ */ getDefaultExportFromCjs(form_dataExports); +export { + FormData as F +}; diff --git a/apps/admin/.output/server/_chunks/_libs/react-dom.mjs b/apps/admin/.output/server/_chunks/_libs/react-dom.mjs new file mode 100644 index 00000000..77aac42f --- /dev/null +++ b/apps/admin/.output/server/_chunks/_libs/react-dom.mjs @@ -0,0 +1,10781 @@ +import { g as getDefaultExportFromCjs } from "./asynckit.mjs"; +import { b as requireReact } from "../../_libs/react.mjs"; +import require$$1 from "util"; +import require$$1$1 from "crypto"; +import require$$2 from "async_hooks"; +import stream from "stream"; +var server_node = {}; +var reactDomServerLegacy_node_production = {}; +var reactDom = { exports: {} }; +var reactDom_production = {}; +var hasRequiredReactDom_production; +function requireReactDom_production() { + if (hasRequiredReactDom_production) return reactDom_production; + hasRequiredReactDom_production = 1; + var React = /* @__PURE__ */ requireReact(); + function formatProdErrorMessage(code) { + var url = "https://react.dev/errors/" + code; + if (1 < arguments.length) { + url += "?args[]=" + encodeURIComponent(arguments[1]); + for (var i = 2; i < arguments.length; i++) + url += "&args[]=" + encodeURIComponent(arguments[i]); + } + return "Minified React error #" + code + "; visit " + url + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."; + } + function noop() { + } + var Internals = { + d: { + f: noop, + r: function() { + throw Error(formatProdErrorMessage(522)); + }, + D: noop, + C: noop, + L: noop, + m: noop, + X: noop, + S: noop, + M: noop + }, + p: 0, + findDOMNode: null + }, REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"); + function createPortal$1(children, containerInfo, implementation) { + var key = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null; + return { + $$typeof: REACT_PORTAL_TYPE, + key: null == key ? null : "" + key, + children, + containerInfo, + implementation + }; + } + var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; + function getCrossOriginStringAs(as, input) { + if ("font" === as) return ""; + if ("string" === typeof input) + return "use-credentials" === input ? input : ""; + } + reactDom_production.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Internals; + reactDom_production.createPortal = function(children, container) { + var key = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null; + if (!container || 1 !== container.nodeType && 9 !== container.nodeType && 11 !== container.nodeType) + throw Error(formatProdErrorMessage(299)); + return createPortal$1(children, container, null, key); + }; + reactDom_production.flushSync = function(fn) { + var previousTransition = ReactSharedInternals.T, previousUpdatePriority = Internals.p; + try { + if (ReactSharedInternals.T = null, Internals.p = 2, fn) return fn(); + } finally { + ReactSharedInternals.T = previousTransition, Internals.p = previousUpdatePriority, Internals.d.f(); + } + }; + reactDom_production.preconnect = function(href, options) { + "string" === typeof href && (options ? (options = options.crossOrigin, options = "string" === typeof options ? "use-credentials" === options ? options : "" : void 0) : options = null, Internals.d.C(href, options)); + }; + reactDom_production.prefetchDNS = function(href) { + "string" === typeof href && Internals.d.D(href); + }; + reactDom_production.preinit = function(href, options) { + if ("string" === typeof href && options && "string" === typeof options.as) { + var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin), integrity = "string" === typeof options.integrity ? options.integrity : void 0, fetchPriority = "string" === typeof options.fetchPriority ? options.fetchPriority : void 0; + "style" === as ? Internals.d.S( + href, + "string" === typeof options.precedence ? options.precedence : void 0, + { + crossOrigin, + integrity, + fetchPriority + } + ) : "script" === as && Internals.d.X(href, { + crossOrigin, + integrity, + fetchPriority, + nonce: "string" === typeof options.nonce ? options.nonce : void 0 + }); + } + }; + reactDom_production.preinitModule = function(href, options) { + if ("string" === typeof href) + if ("object" === typeof options && null !== options) { + if (null == options.as || "script" === options.as) { + var crossOrigin = getCrossOriginStringAs( + options.as, + options.crossOrigin + ); + Internals.d.M(href, { + crossOrigin, + integrity: "string" === typeof options.integrity ? options.integrity : void 0, + nonce: "string" === typeof options.nonce ? options.nonce : void 0 + }); + } + } else null == options && Internals.d.M(href); + }; + reactDom_production.preload = function(href, options) { + if ("string" === typeof href && "object" === typeof options && null !== options && "string" === typeof options.as) { + var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin); + Internals.d.L(href, as, { + crossOrigin, + integrity: "string" === typeof options.integrity ? options.integrity : void 0, + nonce: "string" === typeof options.nonce ? options.nonce : void 0, + type: "string" === typeof options.type ? options.type : void 0, + fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0, + referrerPolicy: "string" === typeof options.referrerPolicy ? options.referrerPolicy : void 0, + imageSrcSet: "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0, + imageSizes: "string" === typeof options.imageSizes ? options.imageSizes : void 0, + media: "string" === typeof options.media ? options.media : void 0 + }); + } + }; + reactDom_production.preloadModule = function(href, options) { + if ("string" === typeof href) + if (options) { + var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin); + Internals.d.m(href, { + as: "string" === typeof options.as && "script" !== options.as ? options.as : void 0, + crossOrigin, + integrity: "string" === typeof options.integrity ? options.integrity : void 0 + }); + } else Internals.d.m(href); + }; + reactDom_production.requestFormReset = function(form) { + Internals.d.r(form); + }; + reactDom_production.unstable_batchedUpdates = function(fn, a) { + return fn(a); + }; + reactDom_production.useFormState = function(action, initialState, permalink) { + return ReactSharedInternals.H.useFormState(action, initialState, permalink); + }; + reactDom_production.useFormStatus = function() { + return ReactSharedInternals.H.useHostTransitionStatus(); + }; + reactDom_production.version = "19.2.4"; + return reactDom_production; +} +var hasRequiredReactDom; +function requireReactDom() { + if (hasRequiredReactDom) return reactDom.exports; + hasRequiredReactDom = 1; + function checkDCE() { + if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== "function") { + return; + } + try { + __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE); + } catch (err) { + console.error(err); + } + } + { + checkDCE(); + reactDom.exports = /* @__PURE__ */ requireReactDom_production(); + } + return reactDom.exports; +} +var hasRequiredReactDomServerLegacy_node_production; +function requireReactDomServerLegacy_node_production() { + if (hasRequiredReactDomServerLegacy_node_production) return reactDomServerLegacy_node_production; + hasRequiredReactDomServerLegacy_node_production = 1; + var React = /* @__PURE__ */ requireReact(), ReactDOM2 = /* @__PURE__ */ requireReactDom(), REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"), REACT_SCOPE_TYPE = /* @__PURE__ */ Symbol.for("react.scope"), REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity"), REACT_LEGACY_HIDDEN_TYPE = /* @__PURE__ */ Symbol.for("react.legacy_hidden"), REACT_MEMO_CACHE_SENTINEL = /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel"), REACT_VIEW_TRANSITION_TYPE = /* @__PURE__ */ Symbol.for("react.view_transition"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator; + function getIteratorFn(maybeIterable) { + if (null === maybeIterable || "object" !== typeof maybeIterable) return null; + maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"]; + return "function" === typeof maybeIterable ? maybeIterable : null; + } + var isArrayImpl = Array.isArray; + function murmurhash3_32_gc(key, seed) { + var remainder = key.length & 3; + var bytes = key.length - remainder; + var h1 = seed; + for (seed = 0; seed < bytes; ) { + var k1 = key.charCodeAt(seed) & 255 | (key.charCodeAt(++seed) & 255) << 8 | (key.charCodeAt(++seed) & 255) << 16 | (key.charCodeAt(++seed) & 255) << 24; + ++seed; + k1 = 3432918353 * (k1 & 65535) + ((3432918353 * (k1 >>> 16) & 65535) << 16) & 4294967295; + k1 = k1 << 15 | k1 >>> 17; + k1 = 461845907 * (k1 & 65535) + ((461845907 * (k1 >>> 16) & 65535) << 16) & 4294967295; + h1 ^= k1; + h1 = h1 << 13 | h1 >>> 19; + h1 = 5 * (h1 & 65535) + ((5 * (h1 >>> 16) & 65535) << 16) & 4294967295; + h1 = (h1 & 65535) + 27492 + (((h1 >>> 16) + 58964 & 65535) << 16); + } + k1 = 0; + switch (remainder) { + case 3: + k1 ^= (key.charCodeAt(seed + 2) & 255) << 16; + case 2: + k1 ^= (key.charCodeAt(seed + 1) & 255) << 8; + case 1: + k1 ^= key.charCodeAt(seed) & 255, k1 = 3432918353 * (k1 & 65535) + ((3432918353 * (k1 >>> 16) & 65535) << 16) & 4294967295, k1 = k1 << 15 | k1 >>> 17, h1 ^= 461845907 * (k1 & 65535) + ((461845907 * (k1 >>> 16) & 65535) << 16) & 4294967295; + } + h1 ^= key.length; + h1 ^= h1 >>> 16; + h1 = 2246822507 * (h1 & 65535) + ((2246822507 * (h1 >>> 16) & 65535) << 16) & 4294967295; + h1 ^= h1 >>> 13; + h1 = 3266489909 * (h1 & 65535) + ((3266489909 * (h1 >>> 16) & 65535) << 16) & 4294967295; + return (h1 ^ h1 >>> 16) >>> 0; + } + var assign = Object.assign, hasOwnProperty = Object.prototype.hasOwnProperty, VALID_ATTRIBUTE_NAME_REGEX = RegExp( + "^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$" + ), illegalAttributeNameCache = {}, validatedAttributeNameCache = {}; + function isAttributeNameSafe(attributeName) { + if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) + return true; + if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) return false; + if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) + return validatedAttributeNameCache[attributeName] = true; + illegalAttributeNameCache[attributeName] = true; + return false; + } + var unitlessNumbers = new Set( + "animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split( + " " + ) + ), aliases = /* @__PURE__ */ new Map([ + ["acceptCharset", "accept-charset"], + ["htmlFor", "for"], + ["httpEquiv", "http-equiv"], + ["crossOrigin", "crossorigin"], + ["accentHeight", "accent-height"], + ["alignmentBaseline", "alignment-baseline"], + ["arabicForm", "arabic-form"], + ["baselineShift", "baseline-shift"], + ["capHeight", "cap-height"], + ["clipPath", "clip-path"], + ["clipRule", "clip-rule"], + ["colorInterpolation", "color-interpolation"], + ["colorInterpolationFilters", "color-interpolation-filters"], + ["colorProfile", "color-profile"], + ["colorRendering", "color-rendering"], + ["dominantBaseline", "dominant-baseline"], + ["enableBackground", "enable-background"], + ["fillOpacity", "fill-opacity"], + ["fillRule", "fill-rule"], + ["floodColor", "flood-color"], + ["floodOpacity", "flood-opacity"], + ["fontFamily", "font-family"], + ["fontSize", "font-size"], + ["fontSizeAdjust", "font-size-adjust"], + ["fontStretch", "font-stretch"], + ["fontStyle", "font-style"], + ["fontVariant", "font-variant"], + ["fontWeight", "font-weight"], + ["glyphName", "glyph-name"], + ["glyphOrientationHorizontal", "glyph-orientation-horizontal"], + ["glyphOrientationVertical", "glyph-orientation-vertical"], + ["horizAdvX", "horiz-adv-x"], + ["horizOriginX", "horiz-origin-x"], + ["imageRendering", "image-rendering"], + ["letterSpacing", "letter-spacing"], + ["lightingColor", "lighting-color"], + ["markerEnd", "marker-end"], + ["markerMid", "marker-mid"], + ["markerStart", "marker-start"], + ["overlinePosition", "overline-position"], + ["overlineThickness", "overline-thickness"], + ["paintOrder", "paint-order"], + ["panose-1", "panose-1"], + ["pointerEvents", "pointer-events"], + ["renderingIntent", "rendering-intent"], + ["shapeRendering", "shape-rendering"], + ["stopColor", "stop-color"], + ["stopOpacity", "stop-opacity"], + ["strikethroughPosition", "strikethrough-position"], + ["strikethroughThickness", "strikethrough-thickness"], + ["strokeDasharray", "stroke-dasharray"], + ["strokeDashoffset", "stroke-dashoffset"], + ["strokeLinecap", "stroke-linecap"], + ["strokeLinejoin", "stroke-linejoin"], + ["strokeMiterlimit", "stroke-miterlimit"], + ["strokeOpacity", "stroke-opacity"], + ["strokeWidth", "stroke-width"], + ["textAnchor", "text-anchor"], + ["textDecoration", "text-decoration"], + ["textRendering", "text-rendering"], + ["transformOrigin", "transform-origin"], + ["underlinePosition", "underline-position"], + ["underlineThickness", "underline-thickness"], + ["unicodeBidi", "unicode-bidi"], + ["unicodeRange", "unicode-range"], + ["unitsPerEm", "units-per-em"], + ["vAlphabetic", "v-alphabetic"], + ["vHanging", "v-hanging"], + ["vIdeographic", "v-ideographic"], + ["vMathematical", "v-mathematical"], + ["vectorEffect", "vector-effect"], + ["vertAdvY", "vert-adv-y"], + ["vertOriginX", "vert-origin-x"], + ["vertOriginY", "vert-origin-y"], + ["wordSpacing", "word-spacing"], + ["writingMode", "writing-mode"], + ["xmlnsXlink", "xmlns:xlink"], + ["xHeight", "x-height"] + ]), matchHtmlRegExp = /["'&<>]/; + function escapeTextForBrowser(text) { + if ("boolean" === typeof text || "number" === typeof text || "bigint" === typeof text) + return "" + text; + text = "" + text; + var match = matchHtmlRegExp.exec(text); + if (match) { + var html = "", index, lastIndex = 0; + for (index = match.index; index < text.length; index++) { + switch (text.charCodeAt(index)) { + case 34: + match = """; + break; + case 38: + match = "&"; + break; + case 39: + match = "'"; + break; + case 60: + match = "<"; + break; + case 62: + match = ">"; + break; + default: + continue; + } + lastIndex !== index && (html += text.slice(lastIndex, index)); + lastIndex = index + 1; + html += match; + } + text = lastIndex !== index ? html + text.slice(lastIndex, index) : html; + } + return text; + } + var uppercasePattern = /([A-Z])/g, msPattern = /^ms-/, isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i; + function sanitizeURL(url) { + return isJavaScriptProtocol.test("" + url) ? "javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')" : url; + } + var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, ReactDOMSharedInternals = ReactDOM2.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, sharedNotPendingObject = { + pending: false, + data: null, + method: null, + action: null + }, previousDispatcher = ReactDOMSharedInternals.d; + ReactDOMSharedInternals.d = { + f: previousDispatcher.f, + r: previousDispatcher.r, + D: prefetchDNS, + C: preconnect, + L: preload, + m: preloadModule, + X: preinitScript, + S: preinitStyle, + M: preinitModuleScript + }; + var PRELOAD_NO_CREDS = [], currentlyFlushingRenderState = null, scriptRegex = /(<\/|<)(s)(cript)/gi; + function scriptReplacer(match, prefix2, s, suffix2) { + return "" + prefix2 + ("s" === s ? "\\u0073" : "\\u0053") + suffix2; + } + function createResumableState(identifierPrefix, externalRuntimeConfig, bootstrapScriptContent, bootstrapScripts, bootstrapModules) { + return { + idPrefix: void 0 === identifierPrefix ? "" : identifierPrefix, + nextFormID: 0, + streamingFormat: 0, + bootstrapScriptContent, + bootstrapScripts, + bootstrapModules, + instructions: 0, + hasBody: false, + hasHtml: false, + unknownResources: {}, + dnsResources: {}, + connectResources: { default: {}, anonymous: {}, credentials: {} }, + imageResources: {}, + styleResources: {}, + scriptResources: {}, + moduleUnknownResources: {}, + moduleScriptResources: {} + }; + } + function createFormatContext(insertionMode, selectedValue, tagScope, viewTransition) { + return { + insertionMode, + selectedValue, + tagScope, + viewTransition + }; + } + function getChildFormatContext(parentContext, type, props) { + var subtreeScope = parentContext.tagScope & -25; + switch (type) { + case "noscript": + return createFormatContext(2, null, subtreeScope | 1, null); + case "select": + return createFormatContext( + 2, + null != props.value ? props.value : props.defaultValue, + subtreeScope, + null + ); + case "svg": + return createFormatContext(4, null, subtreeScope, null); + case "picture": + return createFormatContext(2, null, subtreeScope | 2, null); + case "math": + return createFormatContext(5, null, subtreeScope, null); + case "foreignObject": + return createFormatContext(2, null, subtreeScope, null); + case "table": + return createFormatContext(6, null, subtreeScope, null); + case "thead": + case "tbody": + case "tfoot": + return createFormatContext(7, null, subtreeScope, null); + case "colgroup": + return createFormatContext(9, null, subtreeScope, null); + case "tr": + return createFormatContext(8, null, subtreeScope, null); + case "head": + if (2 > parentContext.insertionMode) + return createFormatContext(3, null, subtreeScope, null); + break; + case "html": + if (0 === parentContext.insertionMode) + return createFormatContext(1, null, subtreeScope, null); + } + return 6 <= parentContext.insertionMode || 2 > parentContext.insertionMode ? createFormatContext(2, null, subtreeScope, null) : parentContext.tagScope !== subtreeScope ? createFormatContext( + parentContext.insertionMode, + parentContext.selectedValue, + subtreeScope, + null + ) : parentContext; + } + function getSuspenseViewTransition(parentViewTransition) { + return null === parentViewTransition ? null : { + update: parentViewTransition.update, + enter: "none", + exit: "none", + share: parentViewTransition.update, + name: parentViewTransition.autoName, + autoName: parentViewTransition.autoName, + nameIdx: 0 + }; + } + function getSuspenseFallbackFormatContext(resumableState, parentContext) { + parentContext.tagScope & 32 && (resumableState.instructions |= 128); + return createFormatContext( + parentContext.insertionMode, + parentContext.selectedValue, + parentContext.tagScope | 12, + getSuspenseViewTransition(parentContext.viewTransition) + ); + } + function getSuspenseContentFormatContext(resumableState, parentContext) { + resumableState = getSuspenseViewTransition(parentContext.viewTransition); + var subtreeScope = parentContext.tagScope | 16; + null !== resumableState && "none" !== resumableState.share && (subtreeScope |= 64); + return createFormatContext( + parentContext.insertionMode, + parentContext.selectedValue, + subtreeScope, + resumableState + ); + } + var styleNameCache = /* @__PURE__ */ new Map(); + function pushStyleAttribute(target, style) { + if ("object" !== typeof style) + throw Error( + "The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX." + ); + var isFirst = true, styleName; + for (styleName in style) + if (hasOwnProperty.call(style, styleName)) { + var styleValue = style[styleName]; + if (null != styleValue && "boolean" !== typeof styleValue && "" !== styleValue) { + if (0 === styleName.indexOf("--")) { + var nameChunk = escapeTextForBrowser(styleName); + styleValue = escapeTextForBrowser(("" + styleValue).trim()); + } else + nameChunk = styleNameCache.get(styleName), void 0 === nameChunk && (nameChunk = escapeTextForBrowser( + styleName.replace(uppercasePattern, "-$1").toLowerCase().replace(msPattern, "-ms-") + ), styleNameCache.set(styleName, nameChunk)), styleValue = "number" === typeof styleValue ? 0 === styleValue || unitlessNumbers.has(styleName) ? "" + styleValue : styleValue + "px" : escapeTextForBrowser(("" + styleValue).trim()); + isFirst ? (isFirst = false, target.push(' style="', nameChunk, ":", styleValue)) : target.push(";", nameChunk, ":", styleValue); + } + } + isFirst || target.push('"'); + } + function pushBooleanAttribute(target, name, value) { + value && "function" !== typeof value && "symbol" !== typeof value && target.push(" ", name, '=""'); + } + function pushStringAttribute(target, name, value) { + "function" !== typeof value && "symbol" !== typeof value && "boolean" !== typeof value && target.push(" ", name, '="', escapeTextForBrowser(value), '"'); + } + var actionJavaScriptURL = escapeTextForBrowser( + "javascript:throw new Error('React form unexpectedly submitted.')" + ); + function pushAdditionalFormField(value, key) { + this.push('"); + } + function validateAdditionalFormField(value) { + if ("string" !== typeof value) + throw Error( + "File/Blob fields are not yet supported in progressive forms. Will fallback to client hydration." + ); + } + function getCustomFormFields(resumableState, formAction) { + if ("function" === typeof formAction.$$FORM_ACTION) { + var id = resumableState.nextFormID++; + resumableState = resumableState.idPrefix + id; + try { + var customFields = formAction.$$FORM_ACTION(resumableState); + if (customFields) { + var formData = customFields.data; + null != formData && formData.forEach(validateAdditionalFormField); + } + return customFields; + } catch (x) { + if ("object" === typeof x && null !== x && "function" === typeof x.then) + throw x; + } + } + return null; + } + function pushFormActionAttribute(target, resumableState, renderState, formAction, formEncType, formMethod, formTarget, name) { + var formData = null; + if ("function" === typeof formAction) { + var customFields = getCustomFormFields(resumableState, formAction); + null !== customFields ? (name = customFields.name, formAction = customFields.action || "", formEncType = customFields.encType, formMethod = customFields.method, formTarget = customFields.target, formData = customFields.data) : (target.push(" ", "formAction", '="', actionJavaScriptURL, '"'), formTarget = formMethod = formEncType = formAction = name = null, injectFormReplayingRuntime(resumableState, renderState)); + } + null != name && pushAttribute(target, "name", name); + null != formAction && pushAttribute(target, "formAction", formAction); + null != formEncType && pushAttribute(target, "formEncType", formEncType); + null != formMethod && pushAttribute(target, "formMethod", formMethod); + null != formTarget && pushAttribute(target, "formTarget", formTarget); + return formData; + } + function pushAttribute(target, name, value) { + switch (name) { + case "className": + pushStringAttribute(target, "class", value); + break; + case "tabIndex": + pushStringAttribute(target, "tabindex", value); + break; + case "dir": + case "role": + case "viewBox": + case "width": + case "height": + pushStringAttribute(target, name, value); + break; + case "style": + pushStyleAttribute(target, value); + break; + case "src": + case "href": + if ("" === value) break; + case "action": + case "formAction": + if (null == value || "function" === typeof value || "symbol" === typeof value || "boolean" === typeof value) + break; + value = sanitizeURL("" + value); + target.push(" ", name, '="', escapeTextForBrowser(value), '"'); + break; + case "defaultValue": + case "defaultChecked": + case "innerHTML": + case "suppressContentEditableWarning": + case "suppressHydrationWarning": + case "ref": + break; + case "autoFocus": + case "multiple": + case "muted": + pushBooleanAttribute(target, name.toLowerCase(), value); + break; + case "xlinkHref": + if ("function" === typeof value || "symbol" === typeof value || "boolean" === typeof value) + break; + value = sanitizeURL("" + value); + target.push(" ", "xlink:href", '="', escapeTextForBrowser(value), '"'); + break; + case "contentEditable": + case "spellCheck": + case "draggable": + case "value": + case "autoReverse": + case "externalResourcesRequired": + case "focusable": + case "preserveAlpha": + "function" !== typeof value && "symbol" !== typeof value && target.push(" ", name, '="', escapeTextForBrowser(value), '"'); + break; + case "inert": + case "allowFullScreen": + case "async": + case "autoPlay": + case "controls": + case "default": + case "defer": + case "disabled": + case "disablePictureInPicture": + case "disableRemotePlayback": + case "formNoValidate": + case "hidden": + case "loop": + case "noModule": + case "noValidate": + case "open": + case "playsInline": + case "readOnly": + case "required": + case "reversed": + case "scoped": + case "seamless": + case "itemScope": + value && "function" !== typeof value && "symbol" !== typeof value && target.push(" ", name, '=""'); + break; + case "capture": + case "download": + true === value ? target.push(" ", name, '=""') : false !== value && "function" !== typeof value && "symbol" !== typeof value && target.push(" ", name, '="', escapeTextForBrowser(value), '"'); + break; + case "cols": + case "rows": + case "size": + case "span": + "function" !== typeof value && "symbol" !== typeof value && !isNaN(value) && 1 <= value && target.push(" ", name, '="', escapeTextForBrowser(value), '"'); + break; + case "rowSpan": + case "start": + "function" === typeof value || "symbol" === typeof value || isNaN(value) || target.push(" ", name, '="', escapeTextForBrowser(value), '"'); + break; + case "xlinkActuate": + pushStringAttribute(target, "xlink:actuate", value); + break; + case "xlinkArcrole": + pushStringAttribute(target, "xlink:arcrole", value); + break; + case "xlinkRole": + pushStringAttribute(target, "xlink:role", value); + break; + case "xlinkShow": + pushStringAttribute(target, "xlink:show", value); + break; + case "xlinkTitle": + pushStringAttribute(target, "xlink:title", value); + break; + case "xlinkType": + pushStringAttribute(target, "xlink:type", value); + break; + case "xmlBase": + pushStringAttribute(target, "xml:base", value); + break; + case "xmlLang": + pushStringAttribute(target, "xml:lang", value); + break; + case "xmlSpace": + pushStringAttribute(target, "xml:space", value); + break; + default: + if (!(2 < name.length) || "o" !== name[0] && "O" !== name[0] || "n" !== name[1] && "N" !== name[1]) { + if (name = aliases.get(name) || name, isAttributeNameSafe(name)) { + switch (typeof value) { + case "function": + case "symbol": + return; + case "boolean": + var prefix$8 = name.toLowerCase().slice(0, 5); + if ("data-" !== prefix$8 && "aria-" !== prefix$8) return; + } + target.push(" ", name, '="', escapeTextForBrowser(value), '"'); + } + } + } + } + function pushInnerHTML(target, innerHTML, children) { + if (null != innerHTML) { + if (null != children) + throw Error( + "Can only set one of `children` or `props.dangerouslySetInnerHTML`." + ); + if ("object" !== typeof innerHTML || !("__html" in innerHTML)) + throw Error( + "`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://react.dev/link/dangerously-set-inner-html for more information." + ); + innerHTML = innerHTML.__html; + null !== innerHTML && void 0 !== innerHTML && target.push("" + innerHTML); + } + } + function flattenOptionChildren(children) { + var content = ""; + React.Children.forEach(children, function(child) { + null != child && (content += child); + }); + return content; + } + function injectFormReplayingRuntime(resumableState, renderState) { + if (0 === (resumableState.instructions & 16)) { + resumableState.instructions |= 16; + var preamble = renderState.preamble, bootstrapChunks = renderState.bootstrapChunks; + (preamble.htmlChunks || preamble.headChunks) && 0 === bootstrapChunks.length ? (bootstrapChunks.push(renderState.startInlineScript), pushCompletedShellIdAttribute(bootstrapChunks, resumableState), bootstrapChunks.push( + ">", + `addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error('React form unexpectedly submitted.')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.ownerDocument||c,(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,d,b))}});`, + "<\/script>" + )) : bootstrapChunks.unshift( + renderState.startInlineScript, + ">", + `addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error('React form unexpectedly submitted.')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.ownerDocument||c,(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,d,b))}});`, + "<\/script>" + ); + } + } + function pushLinkImpl(target, props) { + target.push(startChunkForTag("link")); + for (var propKey in props) + if (hasOwnProperty.call(props, propKey)) { + var propValue = props[propKey]; + if (null != propValue) + switch (propKey) { + case "children": + case "dangerouslySetInnerHTML": + throw Error( + "link is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`." + ); + default: + pushAttribute(target, propKey, propValue); + } + } + target.push("/>"); + return null; + } + var styleRegex = /(<\/|<)(s)(tyle)/gi; + function styleReplacer(match, prefix2, s, suffix2) { + return "" + prefix2 + ("s" === s ? "\\73 " : "\\53 ") + suffix2; + } + function pushSelfClosing(target, props, tag) { + target.push(startChunkForTag(tag)); + for (var propKey in props) + if (hasOwnProperty.call(props, propKey)) { + var propValue = props[propKey]; + if (null != propValue) + switch (propKey) { + case "children": + case "dangerouslySetInnerHTML": + throw Error( + tag + " is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`." + ); + default: + pushAttribute(target, propKey, propValue); + } + } + target.push("/>"); + return null; + } + function pushTitleImpl(target, props) { + target.push(startChunkForTag("title")); + var children = null, innerHTML = null, propKey; + for (propKey in props) + if (hasOwnProperty.call(props, propKey)) { + var propValue = props[propKey]; + if (null != propValue) + switch (propKey) { + case "children": + children = propValue; + break; + case "dangerouslySetInnerHTML": + innerHTML = propValue; + break; + default: + pushAttribute(target, propKey, propValue); + } + } + target.push(">"); + props = Array.isArray(children) ? 2 > children.length ? children[0] : null : children; + "function" !== typeof props && "symbol" !== typeof props && null !== props && void 0 !== props && target.push(escapeTextForBrowser("" + props)); + pushInnerHTML(target, innerHTML, children); + target.push(endChunkForTag("title")); + return null; + } + function pushScriptImpl(target, props) { + target.push(startChunkForTag("script")); + var children = null, innerHTML = null, propKey; + for (propKey in props) + if (hasOwnProperty.call(props, propKey)) { + var propValue = props[propKey]; + if (null != propValue) + switch (propKey) { + case "children": + children = propValue; + break; + case "dangerouslySetInnerHTML": + innerHTML = propValue; + break; + default: + pushAttribute(target, propKey, propValue); + } + } + target.push(">"); + pushInnerHTML(target, innerHTML, children); + "string" === typeof children && target.push(("" + children).replace(scriptRegex, scriptReplacer)); + target.push(endChunkForTag("script")); + return null; + } + function pushStartSingletonElement(target, props, tag) { + target.push(startChunkForTag(tag)); + var innerHTML = tag = null, propKey; + for (propKey in props) + if (hasOwnProperty.call(props, propKey)) { + var propValue = props[propKey]; + if (null != propValue) + switch (propKey) { + case "children": + tag = propValue; + break; + case "dangerouslySetInnerHTML": + innerHTML = propValue; + break; + default: + pushAttribute(target, propKey, propValue); + } + } + target.push(">"); + pushInnerHTML(target, innerHTML, tag); + return tag; + } + function pushStartGenericElement(target, props, tag) { + target.push(startChunkForTag(tag)); + var innerHTML = tag = null, propKey; + for (propKey in props) + if (hasOwnProperty.call(props, propKey)) { + var propValue = props[propKey]; + if (null != propValue) + switch (propKey) { + case "children": + tag = propValue; + break; + case "dangerouslySetInnerHTML": + innerHTML = propValue; + break; + default: + pushAttribute(target, propKey, propValue); + } + } + target.push(">"); + pushInnerHTML(target, innerHTML, tag); + return "string" === typeof tag ? (target.push(escapeTextForBrowser(tag)), null) : tag; + } + var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/, validatedTagCache = /* @__PURE__ */ new Map(); + function startChunkForTag(tag) { + var tagStartChunk = validatedTagCache.get(tag); + if (void 0 === tagStartChunk) { + if (!VALID_TAG_REGEX.test(tag)) throw Error("Invalid tag: " + tag); + tagStartChunk = "<" + tag; + validatedTagCache.set(tag, tagStartChunk); + } + return tagStartChunk; + } + function pushStartInstance(target$jscomp$0, type, props, resumableState, renderState, preambleState, hoistableState, formatContext, textEmbedded) { + switch (type) { + case "div": + case "span": + case "svg": + case "path": + break; + case "a": + target$jscomp$0.push(startChunkForTag("a")); + var children = null, innerHTML = null, propKey; + for (propKey in props) + if (hasOwnProperty.call(props, propKey)) { + var propValue = props[propKey]; + if (null != propValue) + switch (propKey) { + case "children": + children = propValue; + break; + case "dangerouslySetInnerHTML": + innerHTML = propValue; + break; + case "href": + "" === propValue ? pushStringAttribute(target$jscomp$0, "href", "") : pushAttribute(target$jscomp$0, propKey, propValue); + break; + default: + pushAttribute(target$jscomp$0, propKey, propValue); + } + } + target$jscomp$0.push(">"); + pushInnerHTML(target$jscomp$0, innerHTML, children); + if ("string" === typeof children) { + target$jscomp$0.push(escapeTextForBrowser(children)); + var JSCompiler_inline_result = null; + } else JSCompiler_inline_result = children; + return JSCompiler_inline_result; + case "g": + case "p": + case "li": + break; + case "select": + target$jscomp$0.push(startChunkForTag("select")); + var children$jscomp$0 = null, innerHTML$jscomp$0 = null, propKey$jscomp$0; + for (propKey$jscomp$0 in props) + if (hasOwnProperty.call(props, propKey$jscomp$0)) { + var propValue$jscomp$0 = props[propKey$jscomp$0]; + if (null != propValue$jscomp$0) + switch (propKey$jscomp$0) { + case "children": + children$jscomp$0 = propValue$jscomp$0; + break; + case "dangerouslySetInnerHTML": + innerHTML$jscomp$0 = propValue$jscomp$0; + break; + case "defaultValue": + case "value": + break; + default: + pushAttribute( + target$jscomp$0, + propKey$jscomp$0, + propValue$jscomp$0 + ); + } + } + target$jscomp$0.push(">"); + pushInnerHTML(target$jscomp$0, innerHTML$jscomp$0, children$jscomp$0); + return children$jscomp$0; + case "option": + var selectedValue = formatContext.selectedValue; + target$jscomp$0.push(startChunkForTag("option")); + var children$jscomp$1 = null, value = null, selected = null, innerHTML$jscomp$1 = null, propKey$jscomp$1; + for (propKey$jscomp$1 in props) + if (hasOwnProperty.call(props, propKey$jscomp$1)) { + var propValue$jscomp$1 = props[propKey$jscomp$1]; + if (null != propValue$jscomp$1) + switch (propKey$jscomp$1) { + case "children": + children$jscomp$1 = propValue$jscomp$1; + break; + case "selected": + selected = propValue$jscomp$1; + break; + case "dangerouslySetInnerHTML": + innerHTML$jscomp$1 = propValue$jscomp$1; + break; + case "value": + value = propValue$jscomp$1; + default: + pushAttribute( + target$jscomp$0, + propKey$jscomp$1, + propValue$jscomp$1 + ); + } + } + if (null != selectedValue) { + var stringValue = null !== value ? "" + value : flattenOptionChildren(children$jscomp$1); + if (isArrayImpl(selectedValue)) + for (var i = 0; i < selectedValue.length; i++) { + if ("" + selectedValue[i] === stringValue) { + target$jscomp$0.push(' selected=""'); + break; + } + } + else + "" + selectedValue === stringValue && target$jscomp$0.push(' selected=""'); + } else selected && target$jscomp$0.push(' selected=""'); + target$jscomp$0.push(">"); + pushInnerHTML(target$jscomp$0, innerHTML$jscomp$1, children$jscomp$1); + return children$jscomp$1; + case "textarea": + target$jscomp$0.push(startChunkForTag("textarea")); + var value$jscomp$0 = null, defaultValue = null, children$jscomp$2 = null, propKey$jscomp$2; + for (propKey$jscomp$2 in props) + if (hasOwnProperty.call(props, propKey$jscomp$2)) { + var propValue$jscomp$2 = props[propKey$jscomp$2]; + if (null != propValue$jscomp$2) + switch (propKey$jscomp$2) { + case "children": + children$jscomp$2 = propValue$jscomp$2; + break; + case "value": + value$jscomp$0 = propValue$jscomp$2; + break; + case "defaultValue": + defaultValue = propValue$jscomp$2; + break; + case "dangerouslySetInnerHTML": + throw Error( + "`dangerouslySetInnerHTML` does not make sense on